From 3807e95da27ebe69502186a1133e20f16edc4ed6 Mon Sep 17 00:00:00 2001 From: natxocc Date: Thu, 30 Apr 2026 14:39:40 +0200 Subject: [PATCH] Include balham y new bundle --- dist/sigpro-grid.esm.min.js | 275 +++++++++++++++++++++++++++--------- dist/sigpro-grid.min.js | 106 +++++++------- index.js | 91 ++++++------ 3 files changed, 305 insertions(+), 167 deletions(-) diff --git a/dist/sigpro-grid.esm.min.js b/dist/sigpro-grid.esm.min.js index fbada63..9e446d7 100644 --- a/dist/sigpro-grid.esm.min.js +++ b/dist/sigpro-grid.esm.min.js @@ -1,70 +1,205 @@ -var r_=(_)=>typeof _==="function",r$=(_)=>_&&typeof _==="object",If=Array.isArray,R0=typeof document<"u"?document:null,v2=(_)=>_?._isRuntime?_.container:_ instanceof Node?_:R0.createTextNode(_==null?"":String(_)),k_=null,U0=null,c1=!1,t$=0,l$=new Set,T2=new WeakMap,hQ=Symbol("iter"),uQ=new WeakMap,lZ="http://www.w3.org/2000/svg",I2="http://www.w3.org/1999/xlink",sZ=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),yf=(_)=>{if(!_||_._disposed)return;_._disposed=!0;let f=[_];while(f.length){let $=f.pop();if($._cleanups)$._cleanups.forEach((z)=>z()),$._cleanups.clear();if($._children)$._children.forEach((z)=>f.push(z)),$._children.clear();if($._deps)$._deps.forEach((z)=>z.delete($)),$._deps.clear()}},o0=(_)=>{if(U0)(U0._cleanups||=new Set).add(_)},aZ=(_)=>{let f=k_;k_=null;try{return _()}finally{k_=f}},p1=(_,f=!1)=>{let $=()=>{if($._disposed)return;if($._deps)$._deps.forEach((J)=>J.delete($));if($._cleanups)$._cleanups.forEach((J)=>J()),$._cleanups.clear();let z=k_,Q=U0;k_=U0=$;try{return $._result=_()}catch(J){console.error("[SigPro]",J)}finally{k_=z,U0=Q}};if($._deps=$._cleanups=$._children=null,$._disposed=!1,$._isComputed=f,$._depth=k_?k_._depth+1:0,$._mounts=[],$._parent=U0,U0)(U0._children||=new Set).add($);return $},y2=()=>{if(c1)return;c1=!0;let _=Array.from(l$).sort((f,$)=>f._depth-$._depth);l$.clear();for(let f of _)if(!f._disposed)f();c1=!1},oZ=(_)=>{t$++;try{return _()}finally{if(t$--,t$===0&&l$.size>0&&!c1)y2()}},H0=(_,f=!1)=>{if(!f&&k_&&!k_._disposed)_.add(k_),(k_._deps||=new Set).add(_);else if(f&&_.size>0){let $=!1;for(let z of _){if(z===k_||z._disposed)continue;if(z._isComputed){if(z._dirty=!0,z._subs)H0(z._subs,!0)}else l$.add(z),$=!0}if($&&!c1&&t$===0)queueMicrotask(y2)}},mQ=(_,f=null)=>{let $=new Set;if(r_(_)){let z,Q=()=>{if(Q._dirty){let J=k_;k_=Q;try{let q=_();if(!Object.is(z,q))z=q,H0($,!0)}finally{k_=J}Q._dirty=!1}return H0($),z};return Q._isComputed=!0,Q._subs=$,Q._dirty=!0,Q._deps=null,Q._disposed=!1,Q}if(f)try{_=JSON.parse(localStorage.getItem(f))??_}catch(z){}return(...z)=>{if(z.length){let Q=r_(z[0])?z[0](_):z[0];if(!Object.is(_,Q)){if(_=Q,f)localStorage.setItem(f,JSON.stringify(_));H0($,!0)}}return H0($),_}},b2=(_)=>{if(!r$(_))return _;let f=T2.get(_);if(f)return f;let $=new Map,z=(J)=>{let q=$.get(J);if(!q)$.set(J,q=new Set);return q},Q=new Proxy(_,{get(J,q,X){if(typeof q!=="symbol")H0(z(q));return b2(Reflect.get(J,q,X))},set(J,q,X,Y){let Z=Reflect.has(J,q),G=Reflect.get(J,q,Y),E=Reflect.set(J,q,X,Y);if(E&&!Object.is(G,X)){if(H0(z(q),!0),!Z)H0(z(hQ),!0)}return E},deleteProperty(J,q){let X=Reflect.deleteProperty(J,q);if(X)H0(z(q),!0),H0(z(hQ),!0);return X},ownKeys(J){return H0(z(hQ)),Reflect.ownKeys(J)}});return T2.set(_,Q),Q},e0=(_,f)=>{if(f===void 0){let z=p1(_);return z(),()=>yf(z)}let $=p1(()=>{let z=Array.isArray(_)?_.map((Q)=>Q()):_();aZ(()=>f(z))});return $(),()=>yf($)},cQ=(_)=>{if(!_)return;if(_._cleanups)_._cleanups.forEach((f)=>f()),_._cleanups.clear();if(_._ownerEffect)yf(_._ownerEffect);if(_.childNodes)_.childNodes.forEach((f)=>cQ(f))},eZ=/^\s*(javascript|data|vbscript):/i,_4=new Set(["src","href","formaction","action","background","code","archive"]),f4=(_)=>_4.has(_)||_.startsWith("on"),iQ=(_,f)=>{if(f==null||f===!1)return null;if(f4(_)){let $=String(f);if(eZ.test($))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${_}`),"#"}return f},bf=(_,f={},$=[])=>{if(f instanceof Node||If(f)||!r$(f))$=f,f={};if(r_(_)){let q=p1(()=>{let G=_(f,{children:$,emit:(E,...U)=>f[`on${E[0].toUpperCase()}${E.slice(1)}`]?.(...U)});return q._result=G,G});q();let X=q._result;if(X==null)return null;let Y=X instanceof Node||If(X)&&X.every((G)=>G instanceof Node)?X:R0.createTextNode(String(X)),Z=(G)=>{if(r$(G)&&!G._isRuntime)G._mounts=q._mounts||[],G._cleanups=q._cleanups||new Set,G._ownerEffect=q};return If(Y)?Y.forEach(Z):Z(Y),Y}let z=sZ.has(_),Q=z?R0.createElementNS(lZ,_):R0.createElement(_);Q._cleanups=new Set;for(let q of Object.keys(f)){let X=f[q];if(q==="ref"){r_(X)?X(Q):X.current=Q;continue}if(z&&q.startsWith("xlink:")){let Y=iQ(q.slice(6),X);Y==null?Q.removeAttributeNS(I2,q.slice(6)):Q.setAttributeNS(I2,q.slice(6),Y);continue}if(q.startsWith("on")){let Y=q.slice(2).toLowerCase();Q.addEventListener(Y,X);let Z=()=>Q.removeEventListener(Y,X);Q._cleanups.add(Z),o0(Z)}else if(r_(X)){let Y=p1(()=>{let Z=iQ(q,X());if(q==="class")Q.className=Z||"";else if(Z==null)Q.removeAttribute(q);else if(q==="style"&&typeof Z==="string")Q.setAttribute("style",Z);else if(q in Q&&!z)Q[q]=Z;else Q.setAttribute(q,Z===!0?"":Z)});if(Y(),Q._cleanups.add(()=>yf(Y)),o0(()=>yf(Y)),/^(INPUT|TEXTAREA|SELECT)$/.test(Q.tagName)&&(q==="value"||q==="checked")){let Z=q==="checked"?"change":"input";Q.addEventListener(Z,(G)=>X(G.target[q]))}}else{let Y=iQ(q,X);if(Y!=null)if(q==="style"&&typeof Y==="string")Q.setAttribute("style",Y);else if(q in Q&&!z)Q[q]=Y;else Q.setAttribute(q,Y===!0?"":Y)}}let J=(q)=>{if(If(q))return q.forEach(J);if(r_(q)){let X=R0.createTextNode("");Q.appendChild(X);let Y=[],Z=p1(()=>{let G=q(),E=(If(G)?G:[G]).map(v2);Y.forEach((H)=>{if(H._isRuntime)H.destroy();else cQ(H);if(H.parentNode)H.remove()});let U=X;for(let H=E.length-1;H>=0;H--){let W=E[H];if(W.parentNode!==U.parentNode)U.parentNode?.insertBefore(W,U);if(W._mounts)W._mounts.forEach((B)=>B());U=W}Y=E});Z(),Q._cleanups.add(()=>yf(Z)),o0(()=>yf(Z))}else{let X=v2(q);if(Q.appendChild(X),X._mounts)X._mounts.forEach((Y)=>Y())}};return J($),Q},s$=(_)=>{let f=new Set,$=U0,z=k_,Q=R0.createElement("div");Q.style.display="contents",Q.setAttribute("role","presentation"),U0={_cleanups:f},k_=null;let J=(q)=>{if(!q)return;if(q._isRuntime)f.add(q.destroy),Q.appendChild(q.container);else if(If(q))q.forEach(J);else Q.appendChild(q instanceof Node?q:R0.createTextNode(String(q==null?"":q)))};try{J(_({onCleanup:(q)=>f.add(q)}))}finally{U0=$,k_=z}return{_isRuntime:!0,container:Q,destroy:()=>{f.forEach((q)=>q()),cQ(Q),Q.remove()}}},$4=(_,f,$=null)=>{let z=R0.createTextNode(""),Q=bf("div",{style:"display:contents"},[z]),J=null;return e0(()=>!!(r_(_)?_():_),(q)=>{if(J)J.destroy(),J=null;let X=q?f:$;if(X)J=s$(()=>r_(X)?X():X),Q.insertBefore(J.container,z)}),o0(()=>J?.destroy()),Q},z4=(_,f,$)=>{let z=R0.createTextNode(""),Q=bf("div",{style:"display:contents"},[z]),J=new Map;return e0(()=>(r_(_)?_():_)||[],(q)=>{let X=new Map,Y=[],Z=q||[];for(let E=0;Ef(U,E));else J.delete(H);X.set(H,W),Y.push(W)}J.forEach((E)=>E.destroy());let G=z;for(let E=Y.length-1;E>=0;E--){let U=Y[E].container;if(U.nextSibling!==G)Q.insertBefore(U,G);G=U}J=X}),Q},G1=(_)=>{let f=()=>window.location.hash.slice(1)||"/",$=mQ(f()),z=()=>$(f());window.addEventListener("hashchange",z),o0(()=>window.removeEventListener("hashchange",z));let Q=bf("div",{class:"router-hook"}),J=null;return e0([$],()=>{let q=$(),X=_.find((Y)=>{let Z=Y.path.split("/").filter(Boolean),G=q.split("/").filter(Boolean);return Z.length===G.length&&Z.every((E,U)=>E[0]===":"||E===G[U])})||_.find((Y)=>Y.path==="*");if(X){J?.destroy();let Y={};X.path.split("/").filter(Boolean).forEach((Z,G)=>{if(Z[0]===":")Y[Z.slice(1)]=q.split("/").filter(Boolean)[G]}),G1.params(Y),J=s$(()=>r_(X.component)?X.component(Y):X.component),Q.replaceChildren(J.container)}}),Q};G1.params=mQ({});G1.to=(_)=>window.location.hash=_.replace(/^#?\/?/,"#/");G1.back=()=>window.history.back();G1.path=()=>window.location.hash.replace(/^#/,"")||"/";var Q4=(_,f)=>{let $=typeof f==="string"?R0.querySelector(f):f;if(!$)return;if(uQ.has($))uQ.get($).destroy();let z=s$(r_(_)?_:()=>_);return $.replaceChildren(z.container),uQ.set($,z),z};if(typeof window<"u")Object.assign(window,{$:mQ,$$:b2,watch:e0,h:bf,when:$4,each:z4,router:G1,mount:Q4,batch:oZ,onUnmount:o0,isArr:If,isFunc:r_,isObj:r$}),"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video".split(" ").forEach((_)=>{window[_]=(f,$)=>bf(_,f,$)});function b(_){if(!_?.length)return;return _[_.length-1]}function J_(_,f,$){if(_===f)return!0;if(!_||!f)return _==null&&f==null;let z=_.length;if(z!==f.length)return!1;for(let Q=0;Q=0)_.splice($,1)}function K$(_,f){let $=0,z=0;for(;$<_.length;$++)if(!f.includes(_[$]))_[z]=_[$],z++;while(z<_.length)_.pop()}function C2(_,f,$){for(let z=0;z=0;z--)_.splice($,0,f[z])}var T0=(_)=>{if(_==null||_==="")return null;return _};function v(_){return _!=null&&_!==""}function n(_){return!v(_)}var $$=(_)=>{return _!=null&&typeof _.toString==="function"?_.toString():null},wz=(_,f)=>{let $=_?JSON.stringify(_):null,z=f?JSON.stringify(f):null;return $===z},J4=(_,f,$=!1)=>{if(_==null)return f==null?0:-1;if(f==null)return 1;if(typeof _==="object"&&_.toNumber)_=_.toNumber();if(typeof f==="object"&&f.toNumber)f=f.toNumber();if(!$||typeof _!=="string"){if(_>f)return 1;if(_{let Y=z?()=>z.wrapIncoming(X):X;if(f)this.dispatchAsync(Y);else Y()},J=this.getListeners($,f,!1);if((J?.size??0)>0){let X=new Set(J);for(let Y of X){if(!J?.has(Y))continue;Q(()=>Y(_))}}let q=this.getGlobalListeners(f);if(q.size>0){let X=new Set(q);for(let Y of X)Q(()=>Y($,_))}}getGlobalListeners(_){return _?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(_){if(this.asyncFunctionsQueue.push(_),!this.scheduled){let f=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},$=this.frameworkOverrides;if($)$.wrapIncoming(f);else f();this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;let _=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(let f of _)f()}},q4=/[&<>"']/g,X4={"&":"&","<":"<",">":">",'"':""","'":"'"};function L$(_){return _?.toString().toString()??null}function U_(_){return L$(_)?.replace(q4,(f)=>X4[f])??null}function Bz(_){return typeof _==="string"&&_.startsWith("=")&&_.length>1}function Y4(_){if(!_||_==null)return null;let f=/([a-z])([A-Z])/g,$=/([A-Z]+)([A-Z])([a-z])/g;return _.replace(f,"$1 $2").replace($,"$1 $2$3").replace(/\./g," ").split(" ").map((Q)=>Q.substring(0,1).toUpperCase()+(Q.length>1?Q.substring(1,Q.length):"")).join(" ")}function a_(_){return _.eRootDiv.getRootNode()}function d(_){return a_(_).activeElement}function q_(_){let{gos:f,eRootDiv:$}=_,z=null,Q=f.get("getDocument");if(Q&&v(Q))z=Q();else if($)z=$.ownerDocument;if(z&&v(z))return z;return document}function sf(_){let f=d(_);return f===null||f===q_(_).body}function d6(_){return q_(_).defaultView||window}function T1(_){let f=null,$=null;try{f=q_(_).fullscreenElement}catch(z){}finally{if(!f)f=a_(_);let z=f.querySelector("body");if(z)$=z;else if(f instanceof ShadowRoot)$=f;else if(f instanceof Document)$=f?.documentElement;else $=f}return $}function Z4(_){return T1(_)?.clientWidth??(window.innerWidth||-1)}function G4(_){return T1(_)?.clientHeight??(window.innerHeight||-1)}function c_(_,f,$){if($==null||typeof $==="string"&&$=="")t6(_,f);else X0(_,f,$)}function X0(_,f,$){_.setAttribute(d9(f),$.toString())}function t6(_,f){_.removeAttribute(d9(f))}function d9(_){return`aria-${_}`}function Z_(_,f){if(f)_.setAttribute("role",f);else _.removeAttribute("role")}function E4(_){let f=_?.direction;if(f==="asc")return"ascending";else if(f==="desc")return"descending";else if(f==="mixed")return"other";return"none"}function t9(_){return Number.parseInt(_.getAttribute("aria-posinset"),10)}function U4(_){return _.getAttribute("aria-label")}function W_(_,f){c_(_,"label",f)}function z$(_,f){c_(_,"labelledby",f)}function xz(_,f){c_(_,"describedby",f)}function r9(_,f){c_(_,"live",f)}function H4(_,f){c_(_,"atomic",f)}function W4(_,f){c_(_,"relevant",f)}function l9(_,f){c_(_,"invalid",f)}function s9(_,f){c_(_,"level",f)}function a9(_,f){c_(_,"disabled",f)}function Nz(_,f){c_(_,"hidden",f)}function N_(_,f){X0(_,"expanded",f)}function o9(_){t6(_,"expanded")}function gz(_,f){X0(_,"setsize",f)}function hz(_,f){X0(_,"posinset",f)}function B4(_,f){X0(_,"multiselectable",f)}function K4(_,f){X0(_,"rowcount",f)}function Kz(_,f){X0(_,"rowindex",f)}function L4(_,f){X0(_,"colcount",f)}function e9(_,f){X0(_,"colindex",f)}function F4(_,f){X0(_,"colspan",f)}function D4(_,f){X0(_,"sort",f)}function M4(_){t6(_,"sort")}function r6(_,f){c_(_,"selected",f)}function _q(_,f){X0(_,"checked",f===void 0?"mixed":f)}function k4(_,f){c_(_,"controls",f)}function fq(_,f){k4(_,f.id),z$(f,_.id)}function w2(_,f){c_(_,"owns",f)}function $q(_,f){c_(_,"haspopup",f===!1?null:f)}function l6(_,f){return f===void 0?_("ariaIndeterminate","indeterminate"):f===!0?_("ariaChecked","checked"):_("ariaUnchecked","unchecked")}function s6(_,f,$){let z=_.parentElement,Q=z&&z.firstChild;while(Q){if(f)Q.classList.toggle(f,Q===_);if($)Q.classList.toggle($,Q!==_);Q=Q.nextSibling}}var S4="[tabindex], input, select, button, textarea, [href]",zq="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function s1(_){if(!_)return!1;if(!_.matches("input, select, button, textarea"))return!1;if(!_.matches(zq))return!1;return A_(_)}function N(_,f,$={}){let{skipAriaHidden:z}=$;if(_.classList.toggle("ag-hidden",!f),!z)Nz(_,!f)}function A4(_,f,$={}){let{skipAriaHidden:z}=$;if(_.classList.toggle("ag-invisible",!f),!z)Nz(_,!f)}function a6(_,f){let z=f?(J)=>J.setAttribute("disabled",""):(J)=>J.removeAttribute("disabled");z(_);let Q=_.querySelectorAll("input")??[];for(let J of Q)z(J)}function uf(_,f,$){let z=0;while(_){if(_.classList.contains(f))return!0;if(_=_.parentElement,typeof $=="number"){if(++z>$)break}else if(_===$)break}return!1}function I1(_){let{height:f,width:$,borderTopWidth:z,borderRightWidth:Q,borderBottomWidth:J,borderLeftWidth:q,paddingTop:X,paddingRight:Y,paddingBottom:Z,paddingLeft:G,marginTop:E,marginRight:U,marginBottom:H,marginLeft:W,boxSizing:B}=window.getComputedStyle(_),K=Number.parseFloat;return{height:K(f||"0"),width:K($||"0"),borderTopWidth:K(z||"0"),borderRightWidth:K(Q||"0"),borderBottomWidth:K(J||"0"),borderLeftWidth:K(q||"0"),paddingTop:K(X||"0"),paddingRight:K(Y||"0"),paddingBottom:K(Z||"0"),paddingLeft:K(G||"0"),marginTop:K(E||"0"),marginRight:K(U||"0"),marginBottom:K(H||"0"),marginLeft:K(W||"0"),boxSizing:B}}function uz(_){let f=I1(_);if(f.boxSizing==="border-box")return f.height-f.paddingTop-f.paddingBottom-f.borderTopWidth-f.borderBottomWidth;return f.height}function df(_){let f=I1(_);if(f.boxSizing==="border-box")return f.width-f.paddingLeft-f.paddingRight-f.borderLeftWidth-f.borderRightWidth;return f.width}function Qq(_){let{height:f,marginBottom:$,marginTop:z}=I1(_);return Math.floor(f+$+z)}function Jq(_){let{width:f,marginLeft:$,marginRight:z}=I1(_);return Math.floor(f+$+z)}function qq(_){let f=_.getBoundingClientRect(),{borderTopWidth:$,borderLeftWidth:z,borderRightWidth:Q,borderBottomWidth:J}=I1(_);return{top:f.top+($||0),left:f.left+(z||0),right:f.right+(Q||0),bottom:f.bottom+(J||0)}}function Lz(_,f){let $=_.scrollLeft;if(f)$=Math.abs($);return $}function Fz(_,f,$){if($)f*=-1;_.scrollLeft=f}function f_(_){while(_?.firstChild)_.firstChild.remove()}function T_(_){if(_?.parentNode)_.remove()}function Xq(_){return!!_.offsetParent}function A_(_){if(_.checkVisibility)return _.checkVisibility({checkVisibilityCSS:!0});return!(!Xq(_)||window.getComputedStyle(_).visibility!=="visible")}function o6(_){let f=document.createElement("div");return f.innerHTML=(_||"").trim(),f.firstChild}function Yq(_,f,$){if($&&$.nextSibling===f)return;if(!_.firstChild)_.appendChild(f);else if($)if($.nextSibling)_.insertBefore(f,$.nextSibling);else _.appendChild(f);else if(_.firstChild&&_.firstChild!==f)_.prepend(f)}function Zq(_,f){for(let $=0;$`-${f.toLocaleLowerCase()}`)}function F$(_,f){if(!f)return;for(let $ of Object.keys(f)){let z=f[$];if(!$?.length||z==null)continue;let Q=R4($),J=z.toString(),q=J.replace(/\s*!important/g,""),X=q.length!=J.length?"important":void 0;_.style.setProperty(Q,q,X)}}function Q$(_){return()=>{let f=_();if(!f)return!0;return j4(f)||V4(f)}}function j4(_){return _.clientWidth<_.scrollWidth}function V4(_){return _.clientHeight<_.scrollHeight}function Gq(_,f){if(f==="flex")_.style.removeProperty("width"),_.style.removeProperty("minWidth"),_.style.removeProperty("maxWidth"),_.style.flex="1 1 auto";else I0(_,f)}function I0(_,f){f=Eq(f),_.style.width=f,_.style.maxWidth=f,_.style.minWidth=f}function a1(_,f){f=Eq(f),_.style.height=f,_.style.maxHeight=f,_.style.minHeight=f}function Eq(_){return typeof _==="number"?`${_}px`:_}function D$(_){return _ instanceof Node||_ instanceof HTMLElement}function gf(_,f,$){if($==null||$==="")_.removeAttribute(f);else _.setAttribute(f,$.toString())}function O4(_,f){if(!f.isContentEditable)return;let $=d6(_).getSelection();if(!$)return;let z=q_(_).createRange();z.selectNodeContents(f),z.collapse(!1),$.removeAllRanges(),$.addRange(z)}function S0(_,f,$){let Q=d6(_).ResizeObserver,J=Q?new Q($):null;return J?.observe(f),()=>J?.disconnect()}function Y0(_,f){let $=d6(_);if($.requestAnimationFrame)$.requestAnimationFrame(f);else if($.webkitRequestAnimationFrame)$.webkitRequestAnimationFrame(f);else $.setTimeout(f,0)}var Uq="data-ref",pQ;function x2(){return pQ??(pQ=document.createTextNode(" ")),pQ.cloneNode()}function B_(_){let{attrs:f,children:$,cls:z,ref:Q,role:J,tag:q}=_,X=document.createElement(q);if(z)X.className=z;if(Q)X.setAttribute(Uq,Q);if(J)X.setAttribute("role",J);if(f)for(let Y of Object.keys(f))X.setAttribute(Y,f[Y]);if($)if(typeof $==="string")X.textContent=$;else{let Y=!0;for(let Z of $)if(Z)if(typeof Z==="string")X.appendChild(document.createTextNode(Z)),Y=!1;else if(typeof Z==="function")X.appendChild(Z());else{if(Y)X.appendChild(x2()),Y=!1;X.append(B_(Z)),X.appendChild(x2())}}return X}var P4=["touchstart","touchend","touchmove","touchcancel","scroll"],v4=["wheel"],nQ={},D6=(()=>{let _={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return($)=>{if(typeof nQ[$]==="boolean")return nQ[$];let z=document.createElement(_[$]||"div");return $="on"+$,nQ[$]=$ in z}})();function iz(_,f){if(!f||!_)return!1;return I4(f).indexOf(_)>=0}function T4(_){let f=[],$=_.target;while($)f.push($),$=$.parentElement;return f}function I4(_){let f=_;if(f.path)return f.path;if(f.composedPath)return f.composedPath();return T4(f)}function y4(_,f,$){let z=b4(f),Q;if(z!=null)Q={passive:z};_.addEventListener(f,$,Q)}var b4=(_)=>{let f=P4.includes(_),$=v4.includes(_);if(f)return!0;if($)return!1};function Hq(_,f,$){if($===0)return!1;let z=Math.abs(_.clientX-f.clientX),Q=Math.abs(_.clientY-f.clientY);return Math.max(z,Q)<=$}var D1=(_,f)=>{let $=_.identifier;for(let z=0,Q=f.length;z0&&U+_.clientWidth>J+K)U=J+K-_.clientWidth;if(U<0)U=0;if(q>0&&E+_.clientHeight>q+B)E=q+B-_.clientHeight;if(E<0)E=0;_.style.left=`${U}px`,_.style.top=`${E}px`}var qz=(_,...f)=>{for(let $ of f){let[z,Q,J,q]=$;z.addEventListener(Q,J,q),_.push($)}},e6=(_)=>{if(_){for(let[f,$,z,Q]of _)f.removeEventListener($,z,Q);_.length=0}},W1=(_)=>{if(_.cancelable)_.preventDefault()};function w4(_,f){return f}function Wq(_){return _?.getLocaleTextFunc()??w4}function x4(_,f,$,z){let Q=f[$];return _.getLocaleTextFunc()($,typeof Q==="function"?Q(z):Q,z)}var j_=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(_){this.beans=_,this.stubContext=_.context,this.eventSvc=_.eventSvc,this.gos=_.gos}destroy(){let{destroyFunctions:_}=this;for(let f=0;f<_.length;f++)_[f]();_.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(_,f,$){if(!this.localEventService)this.localEventService=new D0;this.localEventService.addEventListener(_,f,$)}removeEventListener(_,f,$){this.localEventService?.removeEventListener(_,f,$)}dispatchLocalEvent(_){this.localEventService?.dispatchEvent(_)}addManagedElementListeners(_,f){return this._setupListeners(_,f)}addManagedEventListeners(_){return this._setupListeners(this.eventSvc,_)}addManagedListeners(_,f){return this._setupListeners(_,f)}_setupListeners(_,f){let $=[];for(let z of Object.keys(f)){let Q=f[z];if(Q)$.push(this._setupListener(_,z,Q))}return $}_setupListener(_,f,$){if(this.destroyed)return()=>null;let z;if(N4(_))_.__addEventListener(f,$),z=()=>{return _.__removeEventListener(f,$),null};else{let Q=g4(_);if(_ instanceof HTMLElement)y4(_,f,$);else if(Q)_.addListener(f,$);else _.addEventListener(f,$);z=Q?()=>{return _.removeListener(f,$),null}:()=>{return _.removeEventListener(f,$),null}}return this.destroyFunctions.push(z),()=>{return z(),this.destroyFunctions=this.destroyFunctions.filter((Q)=>Q!==z),null}}setupPropertyListener(_,f){let{gos:$}=this;$.addPropertyEventListener(_,f);let z=()=>{return $.removePropertyEventListener(_,f),null};return this.destroyFunctions.push(z),()=>{return z(),this.destroyFunctions=this.destroyFunctions.filter((Q)=>Q!==z),null}}addManagedPropertyListener(_,f){if(this.destroyed)return()=>null;return this.setupPropertyListener(_,f)}addManagedPropertyListeners(_,f){if(this.destroyed)return;let $=_.join("-")+this.propertyListenerId++,z=(Q)=>{if(Q.changeSet){if(Q.changeSet&&Q.changeSet.id===this.lastChangeSetIdLookup[$])return;this.lastChangeSetIdLookup[$]=Q.changeSet.id}let J={type:"propertyChanged",changeSet:Q.changeSet,source:Q.source};f(J)};for(let Q of _)this.setupPropertyListener(Q,z)}getLocaleTextFunc(){return Wq(this.beans.localeSvc)}addDestroyFunc(_){if(this.isAlive())this.destroyFunctions.push(_);else _()}createOptionalManagedBean(_,f){return _?this.createManagedBean(_,f):void 0}createManagedBean(_,f){let $=this.createBean(_,f);return this.addDestroyFunc(this.destroyBean.bind(this,_,f)),$}createBean(_,f,$){return(f||this.stubContext).createBean(_,$)}destroyBean(_,f){return(f||this.stubContext).destroyBean(_)}destroyBeans(_,f){return(f||this.stubContext).destroyBeans(_)}};function N4(_){return _.__addEventListener!==void 0}function g4(_){return _.eventServiceType==="global"}var A=class extends j_{},M6=new Set,mz=(_,f)=>{if(!M6.has(f))M6.add(f),_()};mz._set=M6;var h4={pending:!1,funcs:[]},u4={pending:!1,funcs:[]};function k6(_,f="setTimeout",$){let z=f==="raf"?u4:h4;if(z.funcs.push(_),z.pending)return;z.pending=!0;let Q=()=>{let J=z.funcs.slice();z.funcs.length=0,z.pending=!1;for(let q of J)q()};if(f==="raf")Y0($,Q);else window.setTimeout(Q,0)}function c0(_,f,$){let z;return function(...Q){let J=this;return window.clearTimeout(z),z=window.setTimeout(function(){if(_.isAlive())f.apply(J,Q)},$),z}}function N2(_,f){let $=0;return function(...z){let Q=this,J=Date.now();if(J-${if(J!=null)window.clearInterval(J),J=null};_.addDestroyFunc(X);let Y=()=>{let Z=Date.now()-Q>z;if(f()||Z)$(),q=!0,X()};if(Y(),!q)J=window.setInterval(Y,10)}var i4=new Set(["__proto__","constructor","prototype"]);function m4(_,f){if(_==null)return;if(Array.isArray(_)){for(let $=0;$<_.length;$++)f($.toString(),_[$]);return}for(let $ of Object.keys(_).filter((z)=>!i4.has(z)))f($,_[$])}function H_(_,f,$=!0,z=!1){if(!v(f))return;m4(f,(Q,J)=>{let q=_[Q];if(q===J)return;if(z){if(q==null&&J!=null){if(typeof J==="object"&&J.constructor===Object)q={},_[Q]=q}}if(g2(J)&&g2(q)&&!Array.isArray(q))H_(q,J,$,z);else if($||J!==void 0)_[Q]=J})}function g2(_){return typeof _==="object"&&_!==null}var fJ=class _{static applyGlobalGridOptions(f){if(!_.gridOptions)return{...f};let $={};if(H_($,_.gridOptions,!0,!0),_.mergeStrategy==="deep")H_($,f,!0,!0);else $={...$,...f};if(_.gridOptions.context)$.context=_.gridOptions.context;if(f.context){if(_.mergeStrategy==="deep"&&$.context)H_(f.context,$.context,!0,!0);$.context=f.context}return $}static applyGlobalGridOption(f,$){if(_.mergeStrategy==="deep"){let z=c4(f);if(z&&typeof z==="object"&&typeof $==="object")return _.applyGlobalGridOptions({[f]:$})[f]}return $}};fJ.gridOptions=void 0;fJ.mergeStrategy="shallow";var $J=fJ;function c4(_){return $J.gridOptions?.[_]}var p4={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2000,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1000,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},Bq="https://www.ag-grid.com";function q$(_,f,...$){if(_.get("debug"))console.log("AG Grid: "+f,...$)}function Yf(_,...f){mz(()=>Kq(_,...f),_+f?.join(""))}function M1(_,...f){mz(()=>n4(_,...f),_+f?.join(""))}function n4(_,...f){console.error("AG Grid: "+_,...f)}function Kq(_,...f){console.warn("AG Grid: "+_,...f)}var Lq=new Set,Dz={},mf={},Xz,Fq=!1,Dq=!1,d4=!1;function t4(_){let[f,$]=_.version.split(".")||[],[z,Q]=Xz.split(".")||[];return f===z&&$===Q}function r4(_){if(!Xz)Xz=_.version;let f=(z)=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${z} Please update all modules to the same version.`;if(!_.version)M1(f(`'${_.moduleName}' is incompatible.`));else if(!t4(_))M1(f(`'${_.moduleName}' is version ${_.version} but the other modules are version ${Xz}.`));let $=_.validate?.();if($&&!$.isValid)M1(`${$.message}`)}function X$(_,f,$=!1){if(!$)Fq=!0;r4(_);let z=_.rowModels??["all"];Lq.add(_);let Q;if(f!==void 0){if(Dq=!0,mf[f]===void 0)mf[f]={};Q=mf[f]}else Q=Dz;for(let J of z){if(Q[J]===void 0)Q[J]={};Q[J][_.moduleName]=_}if(_.dependsOn)for(let J of _.dependsOn)X$(J,f,$)}function l4(_){delete mf[_]}function S6(_,f,$){let z=(Q)=>!!Dz[Q]?.[_]||!!mf[f]?.[Q]?.[_];return z($)||z("all")}function zJ(){return Dq}function s4(_,f){let $=mf[_]??{};return[...Object.values(Dz.all??{}),...Object.values($.all??{}),...Object.values(Dz[f]??{}),...Object.values($[f]??{})]}function a4(){return new Set(Lq)}function Mq(_,f){let $=mf[_]??{};return[...Object.values($.all??{}),...Object.values($[f]??{})]}function o4(){return Fq}function QJ(){return d4}var kq=class{static register(_){X$(_,void 0)}static registerModules(_){for(let f of _)X$(f,void 0)}};var c="35.2.1",h2=2000,u2=100,Sq="_version_",Aq=null,k1=`${Bq}/javascript-data-grid`;function e4(_){Aq=_}function _7(_){k1=_}function Rq(_,f,$){return Aq?.(_,f)??[Q7(_,f,$)]}function cz(_,f,$,z,Q){_(`${z?"warning":"error"} #${f}`,...Rq(f,$,Q))}function f7(_){if(!_)return String(_);let f={};for(let $ of Object.keys(_))if(typeof _[$]!=="object"&&typeof _[$]!=="function")f[$]=_[$];return JSON.stringify(f)}function $7(_){let f=_;if(_ instanceof Error)f=_.toString();else if(typeof _==="object")f=f7(_);return f}function Yz(_){return _===void 0?"undefined":_===null?"null":_}function A6(_,f){return`${_}?${f.toString()}`}function z7(_,f,$){let z=Array.from(f.entries()).sort((J,q)=>q[1].length-J[1].length),Q=A6(_,f);for(let[J,q]of z){if(J===Sq)continue;let X=Q.length-$;if(X<=0)break;let Y="...",Z=X+Y.length,G=q.length-Z>u2?q.slice(0,q.length-Z)+Y:q.slice(0,u2)+Y;f.set(J,G),Q=A6(_,f)}return Q}function jq(_,f){let $=new URLSearchParams;if($.append(Sq,c),f)for(let J of Object.keys(f))$.append(J,$7(f[J]));let z=`${k1}/errors/${_}`,Q=A6(z,$);return Q.length<=h2?Q:z7(z,$,h2)}var Q7=(_,f,$)=>{let z=jq(_,f),Q=`${$?$+` -`:""}Visit ${z}`;if(QJ())return Q;return`${Q}${$?"":` - Alternatively register the ValidationModule to see the full message in the console.`}`};function j(..._){cz(Yf,_[0],_[1],!0)}function e(..._){cz(M1,_[0],_[1],!1)}function r1(_,f,$){cz(M1,_,f,!1,$)}function Vq(_,f,$){cz(Yf,_,f,!0,$)}function J7(_,f){let $=f[0];return`error #${$} `+Rq($,f[1],_).join(" ")}function $0(..._){return J7(void 0,_)}function Oq(_,f){return _.get("rowModelType")===f}function o(_,f){return Oq(_,"clientSide")}function Kf(_,f){return Oq(_,"serverSide")}function S_(_,f){return _.get("domLayout")===f}function p0(_){return Mz(_)!==void 0}function Pq(_){return typeof _.get("getRowHeight")==="function"}function q7(_,f){if(f)return!_.get("enableStrictPivotColumnOrder");return _.get("maintainColumnOrder")}function X7({gos:_,formula:f}){let $=_.get("rowNumbers");return $||!!f?.active&&$!==!1}function Y$(_,f,$=!1,z){let{gos:Q,environment:J}=_;if(z==null)z=J.getDefaultRowHeight();if(Pq(Q)){if($)return{height:z,estimated:!0};let Y={node:f,data:f.data},Z=Q.getCallback("getRowHeight")(Y);if(R6(Z)){if(Z===0)j(23);return{height:Math.max(1,Z),estimated:!1}}}if(f.detail&&Q.get("masterDetail"))return Y7(Q);let q=Q.get("rowHeight");return{height:q&&R6(q)?q:z,estimated:!1}}function Y7(_){if(_.get("detailRowAutoHeight"))return{height:1,estimated:!1};let f=_.get("detailRowHeight");if(R6(f))return{height:f,estimated:!1};return{height:300,estimated:!1}}function vq(_){let{environment:f,gos:$}=_,z=$.get("rowHeight");if(!z||n(z))return f.getDefaultRowHeight();let Q=f.refreshRowHeightVariable();if(Q!==-1)return Q;return j(24),f.getDefaultRowHeight()}function R6(_){return!isNaN(_)&&typeof _==="number"&&isFinite(_)}function Tq(_,f,$){let z=f[_.getDomDataKey()];return z?z[$]:void 0}function tf(_,f,$,z){let Q=_.getDomDataKey(),J=f[Q];if(n(J))J={},f[Q]=J;J[$]=z}function S1(_){if(_.get("ensureDomOrder"))return!1;return _.get("animateRows")}function y1(_){return!(_.get("paginateChildRows")||_.get("groupHideOpenParents")||S_(_,"print"))}function K0(_){return!_.get("autoGroupColumnDef")?.comparator&&!_.get("treeData")}function C0(_){let f=_.get("groupAggFiltering");if(typeof f==="function")return _.getCallback("groupAggFiltering");if(f===!0)return()=>!0;return}function Lf(_){return _.get("grandTotalRow")}function pz(_){let f=_.get("groupTotalRow");if(typeof f==="function")return _.getCallback("groupTotalRow");return()=>f??void 0}function M$(_){if(!!_.get("groupHideOpenParents"))return!0;return _.get("groupDisplayType")==="multipleColumns"}function JJ(_){return M$(_)&&_.get("groupHideColumnsUntilExpanded")&&o(_)}function nz(_,f){if(f)return!1;return _.get("groupDisplayType")==="groupRows"}function Iq(_,f,$){return!!f.group&&!f.footer&&nz(_,$)}function j6(_){let f=_.getCallback("getRowId");if(f===void 0)return f;return($)=>{let z=f($);if(typeof z!=="string")mz(()=>j(25,{id:z}),"getRowIdString"),z=String(z);return z}}function Z7(_,f){let $=_.get("groupHideParentOfSingleChild");if($===!0)return!0;if($==="leafGroupsOnly"&&f.leafGroup)return!0;if(_.get("groupRemoveSingleChildren"))return!0;if(_.get("groupRemoveLowestSingleChildren")&&f.leafGroup)return!0;return!1}function dz(_,f){let $=_.get("suppressGroupChangesColumnVisibility");if($===!0)return!1;if(f&&$==="suppressHideOnGroup")return!1;if(!f&&$==="suppressShowOnUngroup")return!1;let z=_.get("suppressRowGroupHidesColumns");if(f&&z===!0)return!1;let Q=_.get("suppressMakeColumnVisibleAfterUnGroup");if(!f&&Q===!0)return!1;return!0}function Zf(_){return _?.checkboxes??!0}function Zz(_){return _?.mode==="multiRow"&&(_.headerCheckbox??!0)}function V1(_){if(typeof _!=="object")return;return _.checkboxLocation??"selectionColumn"}function dQ(_){return _?.hideDisabledCheckboxes??!1}function G7(_){return typeof _.get("rowSelection")!=="string"}function yq(_){return _.get("cellSelection")!==void 0}function bq(_){let f=_.get("cellSelection");if(f===void 0)return _.get("suppressMultiRangeSelection");return typeof f!=="boolean"?f?.suppressMultiRanges??!1:!1}function i_(_){let f=_.get("cellSelection");return f!==void 0?!!f:_.get("enableRangeSelection")}function tz(_){let f=_.get("cellSelection");if(f===void 0)return{mode:"fill",setFillValue:_.get("fillOperation"),direction:_.get("fillHandleDirection"),suppressClearOnFillReduction:_.get("suppressClearOnFillReduction")};return typeof f!=="boolean"&&f.handle?.mode==="fill"?f.handle:void 0}function Gf(_){let f=_.get("cellSelection")??!1;return(typeof f==="object"&&f.enableColumnSelection)??!1}function Cq(_){let f=_.get("rowSelection")??"single";if(typeof f==="string"){let $=_.get("suppressRowClickSelection"),z=_.get("suppressRowDeselection");if($&&z)return!1;else if($)return"enableDeselection";else if(z)return"enableSelection";else return!0}return f.mode==="singleRow"||f.mode==="multiRow"?f.enableClickSelection??!1:!1}function E7(_){let f=Cq(_);return f===!0||f==="enableSelection"}function U7(_){let f=Cq(_);return f===!0||f==="enableDeselection"}function V6(_){let f=_.get("rowSelection");if(typeof f==="string")return _.get("isRowSelectable");return f?.isRowSelectable}function Mz(_){let f="beanName"in _&&_.beanName==="gos"?_.get("rowSelection"):_.rowSelection;if(typeof f==="string")switch(f){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(f?.mode){case"multiRow":case"singleRow":return f.mode;default:return}}function Z$(_){return Mz(_)==="multiRow"}function H7(_){let f=_.get("rowSelection");if(typeof f==="string")return _.get("rowMultiSelectWithClick");return f?.enableSelectionWithoutKeys??!1}function kz(_){let f=_.get("rowSelection");if(typeof f==="string"){let $=_.get("groupSelectsChildren"),z=_.get("groupSelectsFiltered");if($&&z)return"filteredDescendants";else if($)return"descendants";else return"self"}return f?.mode==="multiRow"?f.groupSelects:void 0}function wq(_,f=!0){let $=_.get("rowSelection");if(typeof $!=="object")return f?"all":void 0;return $.mode==="multiRow"?$.selectAll:"all"}function W7(_){let f=_.get("rowSelection");if(typeof f==="string")return!1;return f?.mode==="multiRow"?f.ctrlASelectsRows??!1:!1}function G$(_){let f=kz(_);return f==="descendants"||f==="filteredDescendants"}function i2(_){let f=_.get("rowSelection");return typeof f==="object"&&f.masterSelects||"self"}function B7(_){return _.isModuleRegistered("SetFilter")&&!_.get("suppressSetFilterByDefault")}function E_(_){return _.get("columnMenu")==="legacy"}function qJ(_){return!E_(_)}function K7(_){if(!_||_.length<2)return _;return"on"+_[0].toUpperCase()+_.substring(1)}function C(_,f){return _.addCommon(f)}function XJ({gos:_},f){return f.button===2||f.ctrlKey&&_.get("allowContextMenuWithControlKey")}var L7={resizable:!0,sortable:!0},F7=0;function xq(){return F7++}function Q0(_){return _ instanceof Z0}var D7=["asc","desc",null],M7=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],Z0=class extends A{constructor(_,f,$,z){super();this.colDef=_,this.userProvidedColDef=f,this.colId=$,this.primary=z,this.isColumn=!0,this.instanceId=xq(),this.autoHeaderHeight=null,this.sortDef=e_(),this._wasSortExplicitlyRemoved=!1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new D0,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=U_($)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){let{colDef:_,beans:{sortSvc:f,pinnedCols:$,colFlex:z}}=this;f?.initCol(this);let Q=_.hide;if(Q!==void 0)this.visible=!Q;else this.visible=!_.initialHide;$?.initCol(this),z?.initCol(this)}setColDef(_,f,$){let z=_.spanRows!==this.colDef.spanRows;if(this.colDef=_,this.userProvidedColDef=f,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),z)this.beans.rowSpanSvc?.deregister(this),this.initRowSpan();this.dispatchColEvent("colDefChanged",$)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){let{gos:_,colDef:{field:f,tooltipField:$}}=this,z=_.get("suppressFieldDotNotation");this.fieldContainsDots=v(f)&&f.includes(".")&&!z,this.tooltipFieldContainsDots=v($)&&$.includes(".")&&!z}initMinAndMaxWidths(){let _=this.colDef;this.minWidth=_.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=_.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){if(this.colDef.spanRows)this.beans.rowSpanSvc?.register(this)}addPivotListener(){let _=this.beans.pivotColDefSvc,f=this.colDef.pivotValueColumn;if(!_||!f)return;this.addManagedListeners(f,{colDefChanged:($)=>{let z=_.recreateColDef(this.colDef);this.setColDef(z,z,$.source)}})}resetActualWidth(_){let f=this.calculateColInitialWidth(this.colDef);this.setActualWidth(f,_,!0)}calculateColInitialWidth(_){let f=_.width??_.initialWidth??200;return Math.max(Math.min(f,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(_){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,_)??!1}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(_,f){this.colEventSvc.addEventListener(_,f)}__removeEventListener(_,f){this.colEventSvc.removeEventListener(_,f)}addEventListener(_,f){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);let $=this.frameworkEventListenerService?.wrap(_,f)??f;this.colEventSvc.addEventListener(_,$)}removeEventListener(_,f){let $=this.frameworkEventListenerService?.unwrap(_,f)??f;this.colEventSvc.removeEventListener(_,$)}createColumnFunctionCallbackParams(_){return C(this.gos,{node:_,data:_.data,column:this,colDef:this.colDef})}isSuppressNavigable(_){return this.beans.cellNavigation?.isSuppressNavigable(this,_)??!1}isCellEditable(_){return this.beans.editSvc?.isCellEditable({rowNode:_,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(_){return this.isColumnFunc(_,this.colDef.rowDrag)}isDndSource(_){return this.isColumnFunc(_,this.colDef.dndSource)}isCellCheckboxSelection(_){return this.beans.selectionSvc?.isCellCheckboxSelection(this,_)??!1}isSuppressPaste(_){return this.isColumnFunc(_,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(_){return this.colDef[_]??L7[_]}isColumnFunc(_,f){if(typeof f==="boolean")return f;if(typeof f==="function"){let $=this.createColumnFunctionCallbackParams(_);return f($)}return!1}createColumnEvent(_,f){return C(this.gos,{type:_,column:this,columns:[this],source:f})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){if(!this.sortDef.direction)return null;return this.sortDef}getColDefAllowedSortTypes(){let _=[],{sort:f,initialSort:$}=this.colDef,z=f===null?f:M0(f?.type),Q=$===null?$:M0($?.type);if(z)_.push(z);if(Q)_.push(Q);return _}getSortingOrder(){let _=this.getColDefAllowedSortTypes().includes("absolute")?M7:D7;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??_).map((f)=>e_(f))}getAvailableSortTypes(){let _=this.getSortingOrder().reduce((f,$)=>{if($.direction)f.push($.type);return f},this.getColDefAllowedSortTypes());return new Set(_)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(_,f=!1){if(!f)this._wasSortExplicitlyRemoved=!_.direction;this.sortDef=_}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return n(this.getSort())}isSorting(){return v(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(_,f){if(this.oldLeft=this.left,this.left!==_)this.left=_,this.dispatchColEvent("leftChanged",f)}isFilterActive(){return this.filterActive}isHovered(){return j(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(_,f){if(this.firstRightPinned!==_)this.firstRightPinned=_,this.dispatchColEvent("firstRightPinnedChanged",f)}setLastLeftPinned(_,f){if(this.lastLeftPinned!==_)this.lastLeftPinned=_,this.dispatchColEvent("lastLeftPinnedChanged",f)}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(_,f){let $=_===!0;if(this.visible!==$)this.visible=$,this.dispatchColEvent("visibleChanged",f);this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let _=this.getOriginalParent();while(_?.isPadding())_=_.getOriginalParent();return _}getColumnGroupPaddingInfo(){let _=this.getParent();if(!_?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};let f=_.getPaddingLevel()+1,$=!0;while(_){if(!_.isPadding()){$=!1;break}_=_.getParent()}return{numberOfParents:f,isSpanningTotal:$}}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(_){let f=_!==this.autoHeaderHeight;return this.autoHeaderHeight=_,f}createBaseColDefParams(_){return C(this.gos,{node:_,data:_.data,colDef:this.colDef,column:this})}getColSpan(_){if(n(this.colDef.colSpan))return 1;let f=this.createBaseColDefParams(_),$=this.colDef.colSpan(f);return Math.max($,1)}getRowSpan(_){if(n(this.colDef.rowSpan))return 1;let f=this.createBaseColDefParams(_),$=this.colDef.rowSpan(f);return Math.max($,1)}setActualWidth(_,f,$=!1){if(_=Math.max(_,this.minWidth),_=Math.min(_,this.maxWidth),this.actualWidth!==_){if(this.actualWidth=_,this.flex!=null&&f!=="flex"&&f!=="gridInitializing")this.flex=null;if(!$)this.fireColumnWidthChangedEvent(f)}this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(_){this.dispatchColEvent("widthChanged",_)}isGreaterThanMax(_){return _>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.colDef.allowFormula===!0}dispatchColEvent(_,f,$){let z=this.createColumnEvent(_,f);if($)H_(z,$);this.colEventSvc.dispatchEvent(z)}dispatchStateUpdatedEvent(_){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:_})}};function e_(_){if(A1(_))return{direction:_.direction,type:_.type};return{direction:rz(_),type:M0(_)}}function Ef(_){return _==="asc"||_==="desc"||_===null}function YJ(_){return _==="default"||_==="absolute"}function A1(_){if(!_||typeof _!=="object")return!1;let f=_;return YJ(f.type)&&Ef(f.direction)}function Gz(_,f){if(!_)return f?f.direction===null:!0;if(!f)return _?_.direction===null:!0;return _.type===f.type&&_.direction===f.direction}function rz(_){return Ef(_)?_:null}function M0(_){return YJ(_)?_:"default"}function ZJ(_,f,$){let Q=$?.()??f.sortSvc.getDisplaySortForColumn(_),J=M0(Q?.type),q=rz(Q?.direction),X=_.getAvailableSortTypes(),Y=X.has("default"),Z=X.has("absolute");return{isDefaultSortAllowed:Y,isAbsoluteSortAllowed:Z,isAbsoluteSort:J==="absolute",isDefaultSort:J==="default",isAscending:q==="asc",isDescending:q==="desc",direction:q}}function X_(_){return _ instanceof cf}var cf=class extends A{constructor(_,f,$,z){super();this.colGroupDef=_,this.groupId=f,this.padding=$,this.level=z,this.isColumn=!1,this.expandable=!1,this.instanceId=xq(),this.expandableListenerRemoveCallback=null,this.expanded=!!_?.openByDefault}destroy(){if(this.expandableListenerRemoveCallback)this.reset(null,void 0);super.destroy()}reset(_,f){if(this.colGroupDef=_,this.level=f,this.originalParent=null,this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){if(this.children)return this.children.some((_)=>_.isVisible());return!1}isPadding(){return this.padding}setExpanded(_){this.expanded=_===void 0?!1:_,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(_){this.children=_}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){let _=[];return this.addLeafColumns(_),_}forEachLeafColumn(_){if(!this.children)return;for(let f of this.children)if(Q0(f))_(f);else if(X_(f))f.forEachLeafColumn(_)}addLeafColumns(_){if(!this.children)return;for(let f of this.children)if(Q0(f))_.push(f);else if(X_(f))f.addLeafColumns(_)}getColumnGroupShow(){let _=this.colGroupDef;if(!_)return;return _.columnGroupShow}setupExpandable(){if(this.setExpandable(),this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();let _=this.onColumnVisibilityChanged.bind(this);for(let f of this.getLeafColumns())f.__addEventListener("visibleChanged",_);this.expandableListenerRemoveCallback=()=>{for(let f of this.getLeafColumns())f.__removeEventListener("visibleChanged",_);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let _=!1,f=!1,$=!1,z=this.findChildrenRemovingPadding();for(let J=0,q=z.length;J{for(let z of $)if(X_(z)&&z.isPadding())f(z.children);else _.push(z)};return f(this.children),_}onColumnVisibilityChanged(){this.setExpandable()}},k7={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function O6(_,f,$){let z={},Q=_.gos;return Object.assign(z,Q.get("defaultColGroupDef")),Object.assign(z,f),Q.validateColDef(z,$),z}var S7=class{constructor(){this.existingKeys={}}addExistingKeys(_){for(let f=0;f<_.length;f++)this.existingKeys[_[f]]=!0}getUniqueKey(_,f){_=$$(_);let $=0;while(!0){let z=_??f;if(z){if($!==0)z+="_"+$}else z=$;if(!this.existingKeys[z]){let Q=String(z);if(_&&$>0)j(273,{providedId:_,usedId:Q});return this.existingKeys[Q]=!0,Q}$++}}},Nq=(_,f)=>{if(X_(_))_.setupExpandable();_.originalParent=f};function gq(_,f=null,$,z,Q){let{existingCols:J,existingGroups:q}=hq(z),X=new Map(J.map((B)=>[B.getId(),B])),Y=new Map(q.map((B)=>[B.getId(),B])),Z=0,G=(B,K)=>{if(Z=Math.max(Z,K),cq(B)){if(!_.colGroupSvc)return null;let M=B.groupId,k=Y.get(M),R=O6(_,B,M),O=new cf(R,M,!1,K);if(_.context.createBean(O),k)O.setExpanded(k.isExpanded());return O.setChildren(B.children.map((I)=>G(I,K+1))),O}let L=B.colId,F=X.get(L),D=n0(_,B,F?.getColId()??L);if(!F)F=new Z0(D,B,L,$),_.context.createBean(F);else F.setColDef(D,B,Q),mq(_,F,D,Q);return _.dataTypeSvc?.addColumnListeners(F),F},E=f?.map((B)=>G(B,0))??[],U=0,H={getUniqueKey:(B,K)=>String(++U)},W=_.colGroupSvc?_.colGroupSvc.balanceColumnTree(E,0,Z,H):E;return y0(null,W,Nq),{columnTree:W,treeDepth:Z}}function GJ(_,f=null,$,z,Q){let J=new S7,{existingCols:q,existingGroups:X,existingColKeys:Y}=hq(z);J.addExistingKeys(Y);let Z=uq(_,f,0,$,q,J,X,Q),{colGroupSvc:G}=_,E=G?.findMaxDepth(Z,0)??0,U=G?G.balanceColumnTree(Z,0,E,J):Z;return y0(null,U,Nq),{columnTree:U,treeDepth:E}}function hq(_){let f=[],$=[],z=[];if(_)y0(null,_,(Q)=>{if(X_(Q)){let J=Q;$.push(J)}else{let J=Q;z.push(J.getId()),f.push(J)}});return{existingCols:f,existingGroups:$,existingColKeys:z}}function uq(_,f,$,z,Q,J,q,X){if(!f)return[];let{colGroupSvc:Y}=_,Z=Array(f.length);for(let G=0;G0)return;if($.width!=null)f.setActualWidth($.width,z);else{let J=f.getActualWidth();f.setActualWidth(J,z)}}function R7(_,f){if(!f)return;for(let $=0;${for(let Q=0;Qf+$.getActualWidth(),0)}function J0(_,f,$){let z={};if(!f)return;if(y0(null,f,(J)=>{z[J.getInstanceId()]=J}),$)y0(null,$,(J)=>{z[J.getInstanceId()]=null});let Q=Object.values(z).filter((J)=>J!=null);_.context.destroyBeans(Q)}function of(_){return _.getId().startsWith(af)}function x0(_){return(typeof _==="string"?_:("getColId"in _)?_.getColId():_.colId)?.startsWith(pq)??!1}function I_(_){return(typeof _==="string"?_:("getColId"in _)?_.getColId():_.colId)?.startsWith(nq)??!1}function k$(_){return x0(_)||I_(_)}function Sz(_){let f=[];if(_ instanceof Array)f=_;else if(typeof _==="string")f=_.split(",");return f}function S$(_,f){return J_(_,f,($,z)=>$.getColId()===z.getColId())}function A$(_){_.map={};for(let f of _.list)_.map[f.getId()]=f}function Uf(_){return _==="optionsUpdated"?"gridOptionsChanged":_}function b0(_,f){return _===f||_.colId==f||_.getColDef()===f}var O7=(_,f)=>($,z)=>{let Q={value1:void 0,value2:void 0},J=!1;if(_){if(_[$]!==void 0)Q.value1=_[$],J=!0;if(v(z)&&_[z]!==void 0)Q.value2=_[z],J=!0}if(!J&&f){if(f[$]!==void 0)Q.value1=f[$];if(v(z)&&f[z]!==void 0)Q.value2=f[z]}return Q};function EJ(_,f){let $={..._,sort:void 0,colId:f},z=tq(_);if(z)$.sort=z.direction,$.sortType=z.type;return $}function tq(_){let{sort:f,initialSort:$}=_,z=A1(f)||Ef(f),Q=A1($)||Ef($);if(z)return e_(f);if(Q)return e_($);return null}function rq(_,f){return _+"_"+f}function G_(_){return _ instanceof E$}var E$=class extends A{constructor(_,f,$,z){super();this.providedColumnGroup=_,this.groupId=f,this.partId=$,this.pinned=z,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=U_(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return rq(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){let _=this.getProvidedColumnGroup().getLeafColumns();if(!_||_.length===0)return!1;return _.every((f)=>f.isMoving())}checkLeft(){for(let _ of this.displayedChildren)if(G_(_))_.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){let f=b(this.displayedChildren).getLeft();this.setLeft(f)}else{let _=this.displayedChildren[0].getLeft();this.setLeft(_)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(_){if(this.oldLeft=this.left,this.left!==_)this.left=_,this.dispatchLocalEvent({type:"leftChanged"})}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let _=0;for(let f of this.displayedChildren??[])_+=f.getActualWidth();return _}isResizable(){if(!this.displayedChildren)return!1;let _=!1;for(let f of this.displayedChildren)if(f.isResizable())_=!0;return _}getMinWidth(){let _=0;for(let f of this.displayedChildren)_+=f.getMinWidth();return _}addChild(_){if(!this.children)this.children=[];this.children.push(_)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){let _=[];return this.addLeafColumns(_),_}getDisplayedLeafColumns(){let _=[];return this.addDisplayedLeafColumns(_),_}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(_){this.providedColumnGroup.setExpanded(_)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(_){let f=_!==this.autoHeaderHeight;return this.autoHeaderHeight=_,f}addDisplayedLeafColumns(_){for(let f of this.displayedChildren??[])if(Q0(f))_.push(f);else if(G_(f))f.addDisplayedLeafColumns(_)}addLeafColumns(_){for(let f of this.children??[])if(Q0(f))_.push(f);else if(G_(f))f.addLeafColumns(_)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let _=this.getParent();if(!this.isPadding()||!_?.isPadding())return 0;return 1+_.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let _=this;while(_?.isPadding())_=_.getParent();if(!(_?_.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(let $ of this.children??[]){if(G_($)&&!$.displayedChildren?.length)continue;switch($.getColumnGroupShow()){case"open":if(_.getProvidedColumnGroup().isExpanded())this.displayedChildren.push($);break;case"closed":if(!_.getProvidedColumnGroup().isExpanded())this.displayedChildren.push($);break;default:this.displayedChildren.push($);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},S={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},P7=65,v7=67,T7=86,I7=68,y7=90,b7=89;function lq(_){let{keyCode:f}=_,$;switch(f){case P7:$=S.A;break;case v7:$=S.C;break;case T7:$=S.V;break;case I7:$=S.D;break;case y7:$=S.Z;break;case b7:$=S.Y;break;default:$=_.code}return $}function C7(_,f){return new g(($)=>{$(window.setInterval(_,f))})}var g=class _{constructor(f){this.status=0,this.resolution=null,this.waiters=[],f(($)=>this.onDone($),($)=>this.onReject($))}static all(f){return f.length?new _(($)=>{let z=f.length,Q=Array(z);f.forEach((J,q)=>{J.then((X)=>{if(Q[q]=X,z--,z===0)$(Q)})})}):_.resolve()}static resolve(f=null){return new _(($)=>$(f))}then(f){return new _(($)=>{if(this.status===1)$(f(this.resolution));else this.waiters.push((z)=>$(f(z)))})}onDone(f){this.status=1,this.resolution=f;for(let $ of this.waiters)$(f)}onReject(f){}},w7=class extends j_{constructor(){super(...arguments);this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(_,f=!1){let $={capturePointer:!0,dragSource:_,eElement:_.eElement,dragStartPixels:_.dragStartPixels,onDragStart:(z)=>this.onDragStart(_,z),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:f};this.dragSourceAndParamsList.push($),this.beans.dragSvc.addDragSource($)}setDragImageCompIcon(_,f=!1){let $=this.dragImageComp;if($&&(f||this.dragImageLastIcon!==_))this.dragImageLastIcon=_,$.setIcon(_,f)}removeDragSource(_){let{dragSourceAndParamsList:f,beans:$}=this;for(let z=0,Q=f.length;z{for(let Z of Y){let{width:G,height:E,left:U,right:H,top:W,bottom:B}=Z.getBoundingClientRect();if(G===0||E===0)return!1;let K=X.clientX>=U&&X.clientX=W&&X.clientY0}findExternalZone(_){let f=this.dropTargets;for(let $=0,z=f.length;$0?"down":W<0?"up":null,hDirection:H<0?"left":H>0?"right":null,initialSourcePointerOffsetX:X,initialSourcePointerOffsetY:Y,dragSource:z,fromNudge:$,dragItem:Q,dropZoneTarget:Z,dropTarget:J?.dropTarget??null,changed:!!J?.changed});return this.lastDraggingEvent=B,B}positionDragImageComp(_){let f=this.dragImageComp?.getGui();if(f)C4(f,_,this.beans)}removeDragImageComp(_){if(this.dragImageComp===_)this.dragImageComp=null;if(_)_.getGui()?.remove(),this.destroyBean(_)}createAndUpdateDragImageComp(_){let f=this.createDragImageComp(_)??null;this.dragImageCompPromise=f,f?.then(($)=>{let z=this.lastMouseEvent;if(f!==this.dragImageCompPromise||!z||!this.isAlive()){this.destroyBean($);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;let Q=this.dragImageComp;if(Q!==$)this.dragImageComp=$,this.removeDragImageComp(Q);if($)this.appendDragImageComp($),this.updateDragImageComp(),this.positionDragImageComp(z)})}appendDragImageComp(_){let f=_.getGui(),$=f.style;if($.position="absolute",$.zIndex="9999",this.beans.dragSvc?.hasPointerCapture())$.pointerEvents="none";this.gos.setInstanceDomData(f),this.beans.environment.applyThemeClasses(f),$.top="20px",$.left="20px";let z=T1(this.beans);if(!z)this.warnNoBody();else z.appendChild(f)}updateDragImageComp(){let{dragImageComp:_,dragSource:f,lastDropTarget:$,lastDraggingEvent:z,dragImageLastLabel:Q}=this;if(!_)return;this.setDragImageCompIcon($?.getIconName?.(z)??null);let J=f?.dragItemName;if(typeof J==="function")J=J(z);if(J||(J=""),Q!==J)this.dragImageLastLabel=J,_.setLabel(J)}};function sq(_){return typeof _==="object"&&!!_.component}function x7(_){if(!_)return!1;return _.prototype&&"getGui"in _.prototype}function aq(_,f,$,z){let{name:Q}=$,J,q,X,Y,Z,G;if(f){let E=f,U=E[Q+"Selector"],H=U?U(z):null,W=(B)=>{if(typeof B==="string")J=B;else if(B!=null&&B!==!0)if(_.isFrameworkComponent(B))X=B;else q=B};if(H)W(H.component),Y=H.params,Z=H.popup,G=H.popupPosition;else W(E[Q])}return{compName:J,jsComp:q,fwComp:X,paramsFromSelector:Y,popupFromSelector:Z,popupPositionFromSelector:G}}var N7=class extends A{constructor(){super(...arguments);this.beanName="userCompFactory"}wireBeans(_){this.agCompUtils=_.agCompUtils,this.registry=_.registry,this.frameworkCompWrapper=_.frameworkCompWrapper,this.gridOptions=_.gridOptions}getCompDetailsFromGridOptions(_,f,$,z=!1){return this.getCompDetails(this.gridOptions,_,f,$,z)}getCompDetails(_,f,$,z,Q=!1){let{name:J,cellRenderer:q}=f,{compName:X,jsComp:Y,fwComp:Z,paramsFromSelector:G,popupFromSelector:E,popupPositionFromSelector:U}=aq(this.beans.frameworkOverrides,_,f,z),H,W,B=(D)=>{let M=this.registry.getUserComponent(J,D);if(M)Y=!M.componentFromFramework?M.component:void 0,Z=M.componentFromFramework?M.component:void 0,H=M.params,W=M.processParams};if(X!=null)B(X);if(Y==null&&Z==null&&$!=null)B($);if(Y&&q&&!x7(Y))Y=this.agCompUtils?.adaptFunction(f,Y);if(!Y&&!Z){let{validation:D}=this.beans;if(Q&&(X!==$||!$))if(X){if(!D?.isProvidedUserComp(X))e(50,{compName:X})}else if($){if(!D)e(260,{...this.gos.getModuleErrorParams(),propName:J,compName:$})}else e(216,{name:J});else if($&&!D)e(146,{comp:$});return}let K=this.mergeParams(_,f,z,G,H,W),L=Y==null,F=Y??Z;return{componentFromFramework:L,componentClass:F,params:K,type:f,popupFromSelector:E,popupPositionFromSelector:U,newAgStackInstance:()=>this.newAgStackInstance(F,L,K,f)}}newAgStackInstance(_,f,$,z){let Q=!f,J;if(Q)J=new _;else J=this.frameworkCompWrapper.wrap(_,z.mandatoryMethods,z.optionalMethods,z);this.createBean(J);let q=J.init?.($);if(q==null)return g.resolve(J);return q.then(()=>J)}mergeParams(_,f,$,z=null,Q,J){let q={...$,...Q},Y=_?.[f.name+"Params"];if(typeof Y==="function"){let Z=Y($);H_(q,Z)}else if(typeof Y==="object")H_(q,Y);return H_(q,z),J?J(q):q}};var g7={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},h7={name:"headerComponent",optionalMethods:["refresh"]},u7={name:"innerHeaderComponent"},i7={name:"innerHeaderGroupComponent"},m7={name:"headerGroupComponent"},c7={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},p7={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0};var n7={name:"loadingCellRenderer",cellRenderer:!0},d7={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},t7={name:"tooltipComponent"},UJ={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},r7={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},l7={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},s7={name:"loadingCellRenderer",cellRenderer:!0},a7={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},o7={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function e7(_,f){return _.getCompDetailsFromGridOptions(g7,"agDragAndDropImage",f,!0)}function R$(_,f,$){return _.getCompDetails(f,c7,void 0,$)}function _8(_,f,$){return _.getCompDetails(f,h7,"agColumnHeader",$)}function f8(_,f,$){return _.getCompDetails(f,u7,void 0,$)}function $8(_,f){let $=f.columnGroup.getColGroupDef();return _.getCompDetails($,m7,"agColumnGroupHeader",f)}function z8(_,f,$){return _.getCompDetails(f,i7,void 0,$)}function Q8(_,f){return _.getCompDetailsFromGridOptions(l7,void 0,f,!0)}function J8(_,f){return _.getCompDetailsFromGridOptions(s7,"agLoadingCellRenderer",f,!0)}function q8(_,f){return _.getCompDetailsFromGridOptions(a7,"agGroupRowRenderer",f,!0)}function X8(_,f){return _.getCompDetailsFromGridOptions(o7,"agDetailCellRenderer",f,!0)}function U$(_,f,$){return _.getCompDetails(f,p7,void 0,$)}function m2(_,f,$){return _.getCompDetails(f,n7,"agSkeletonCellRenderer",$,!0)}function oq(_,f,$){return _.getCompDetails(f,d7,"agCellEditor",$,!0)}function HJ(_,f,$,z){let Q=f.filter;if(sq(Q))f={filter:Q.component,filterParams:f.filterParams};return _.getCompDetails(f,UJ,z,$,!0)}function Y8(_,f){return _.getCompDetails(f.colDef,t7,"agTooltipComponent",f,!0)}function WJ(_,f,$,z){return _.getCompDetails(f,r7,z,$)}function eq(_,f){return aq(_,f,UJ)}function tQ(_,f,$){return _.mergeParams(f,UJ,$)}var G0=((_)=>{return _[_.ToolPanel=0]="ToolPanel",_[_.HeaderCell=1]="HeaderCell",_[_.RowDrag=2]="RowDrag",_[_.ChartPanel=3]="ChartPanel",_[_.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",_})(G0||{}),Z8=class extends w7{createEvent(_){return C(this.gos,_)}createDragImageComp(_){let{gos:f,beans:$}=this;return e7($.userCompFactory,C(f,{dragSource:_}))?.newAgStackInstance()}handleEnter(_,f){_?.onGridEnter?.(f)}handleExit(_,f){_?.onGridExit?.(f)}warnNoBody(){j(54)}isDropZoneWithinThisGrid(_){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(_.dropZoneTarget)}registerGridDropTarget(_,f){let $={getContainer:_,isInterestedIn:(z)=>z===1||z===0,getIconName:()=>"notAllowed"};this.addDropTarget($),f.addDestroyFunc(()=>this.removeDropTarget($))}};var _X="ag-resizer-wrapper",_f=(_,f)=>({tag:"div",ref:`${_}Resizer`,cls:`ag-resizer ag-resizer-${f}`}),G8={tag:"div",cls:_X,children:[_f("eTopLeft","topLeft"),_f("eTop","top"),_f("eTopRight","topRight"),_f("eRight","right"),_f("eBottomRight","bottomRight"),_f("eBottom","bottom"),_f("eBottomLeft","bottomLeft"),_f("eLeft","left")]},BJ=class extends j_{constructor(_,f){super();this.element=_,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...f}}wireBeans(_){this.popupSvc=_.popupSvc,this.dragSvc=_.dragSvc}center(_){let{clientHeight:f,clientWidth:$}=this.offsetParent,z=$/2-this.getWidth()/2,Q=f/2-this.getHeight()/2;this.offsetElement(z,Q,_)}initialisePosition(_){if(this.positioned)return;let{centered:f,forcePopupParentAsOffsetParent:$,minWidth:z,width:Q,minHeight:J,height:q,x:X,y:Y}=this.config;if(!this.offsetParent)this.setOffsetParent();let Z=0,G=0,E=A_(this.element);if(E){let U=this.findBoundaryElement(),H=window.getComputedStyle(U);if(H.minWidth!=null){let W=U.offsetWidth-this.element.offsetWidth;G=Number.parseInt(H.minWidth,10)-W}if(H.minHeight!=null){let W=U.offsetHeight-this.element.offsetHeight;Z=Number.parseInt(H.minHeight,10)-W}}if(this.minHeight=J||Z,this.minWidth=z||G,Q)this.setWidth(Q);if(q)this.setHeight(q);if(!Q||!q)this.refreshSize();if(f)this.center(_);else if(X||Y)this.offsetElement(X,Y,_);else if(E&&$){let U=this.boundaryEl,H=!0;if(!U)U=this.findBoundaryElement(),H=!1;if(U){let W=Number.parseFloat(U.style.top),B=Number.parseFloat(U.style.left);if(H)this.offsetElement(Number.isNaN(B)?0:B,Number.isNaN(W)?0:W,_);else this.setPosition(B,W)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(_,f){if(!this.config.popup||_===this.movable)return;this.movable=_;let $=this.moveElementDragListener||{eElement:f,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};if(_)this.dragSvc?.addDragSource($),this.moveElementDragListener=$;else this.dragSvc?.removeDragSource($),this.moveElementDragListener=void 0}setResizable(_){if(this.clearResizeListeners(),_)this.addResizers();else this.removeResizers();if(typeof _==="boolean"){if(_===!1)return;_={topLeft:_,top:_,topRight:_,right:_,bottomRight:_,bottom:_,bottomLeft:_,left:_}}for(let f of Object.keys(_)){let $=!!_[f],z=this.getResizerElement(f),Q={dragStartPixels:0,eElement:z,onDragStart:(J)=>this.onResizeStart(J,f),onDragging:this.onResize.bind(this),onDragStop:(J)=>this.onResizeEnd(J,f)};if($||!this.isAlive()&&!$){if($)this.dragSvc?.addDragSource(Q),this.resizeListeners.push(Q),z.style.pointerEvents="all";else z.style.pointerEvents="none";this.resizable[f]=$}}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";let{height:_,width:f}=this.lastSize;if(f!==-1)this.element.style.width=`${f}px`;if(_!==-1)this.element.style.height=`${_}px`}getHeight(){return this.element.offsetHeight}setHeight(_){let{popup:f}=this.config,$=this.element,z=!1;if(typeof _==="string"&&_.includes("%"))a1($,_),_=Qq($),z=!0;else if(_=Math.max(this.minHeight,_),this.positioned){let Q=this.getAvailableHeight();if(Q&&_>Q)_=Q}if(this.getHeight()===_)return;if(z)$.style.maxHeight="unset",$.style.minHeight="unset";else if(f)a1($,_);else $.style.height=`${_}px`,$.style.flex="0 0 auto",this.lastSize.height=typeof _==="number"?_:Number.parseFloat(_)}getAvailableHeight(){let{popup:_,forcePopupParentAsOffsetParent:f}=this.config;if(!this.positioned)this.initialisePosition();let{clientHeight:$}=this.offsetParent;if(!$)return null;let z=this.element.getBoundingClientRect(),Q=this.offsetParent.getBoundingClientRect(),J=_?this.position.y:z.top,q=_?0:Q.top,X=0;if(f){let Z=this.element.parentElement;if(Z){let{bottom:G}=Z.getBoundingClientRect();X=G-z.bottom}}return $+q-J-X}getWidth(){return this.element.offsetWidth}setWidth(_){let f=this.element,{popup:$}=this.config,z=!1;if(typeof _==="string"&&_.includes("%"))I0(f,_),_=Jq(f),z=!0;else if(this.positioned){_=Math.max(this.minWidth,_);let{clientWidth:Q}=this.offsetParent,J=$?this.position.x:this.element.getBoundingClientRect().left;if(Q&&_+J>Q)_=Q-J}if(this.getWidth()===_)return;if(z)f.style.maxWidth="unset",f.style.minWidth="unset";else if(this.config.popup)I0(f,_);else f.style.width=`${_}px`,f.style.flex=" unset",this.lastSize.width=typeof _==="number"?_:Number.parseFloat(_)}offsetElement(_=0,f=0,$){let{forcePopupParentAsOffsetParent:z}=this.config,Q=z?this.boundaryEl:this.element;if(!Q)return;this.popupSvc?.positionPopup({ePopup:Q,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:_,y:f}),postProcessCallback:$}),this.setPosition(Number.parseFloat(Q.style.left),Number.parseFloat(Q.style.top))}constrainSizeToAvailableHeight(_){if(!this.config.forcePopupParentAsOffsetParent)return;let f=()=>{let $=this.getAvailableHeight();this.element.style.setProperty("max-height",`${$}px`)};if(_&&this.popupSvc)this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=S0(this.beans,this.popupSvc?.getPopupParent(),f);else if(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber)this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0}setPosition(_,f){this.position.x=_,this.position.y=f}updateDragStartPosition(_,f){this.dragStartPosition={x:_,y:f}}calculateMouseMovement(_){let{e:f,isLeft:$,isTop:z,anywhereWithin:Q,topBuffer:J}=_,q=f.clientX-this.dragStartPosition.x,X=f.clientY-this.dragStartPosition.y,Y=this.shouldSkipX(f,!!$,!!Q,q)?0:q,Z=this.shouldSkipY(f,!!z,J,X)?0:X;return{movementX:Y,movementY:Z}}shouldSkipX(_,f,$,z){let Q=this.element.getBoundingClientRect(),J=this.offsetParent.getBoundingClientRect(),q=this.boundaryEl.getBoundingClientRect(),X=this.config.popup?this.position.x:Q.left,Y=X<=0&&J.left>=_.clientX||J.right<=_.clientX&&J.right<=q.right;if(Y)return!0;if(f)Y=z<0&&_.clientX>X+J.left||z>0&&_.clientXq.right||z>0&&_.clientXq.right||z>0&&_.clientX=_.clientY||J.bottom<=_.clientY&&J.bottom<=q.bottom;if(Y)return!0;if(f)Y=z<0&&_.clientY>X+J.top+$||z>0&&_.clientYq.bottom||z>0&&_.clientY({element:this.element.querySelector(`[data-ref=${f}Resizer]`)});this.resizerMap={topLeft:_("eTopLeft"),top:_("eTop"),topRight:_("eTopRight"),right:_("eRight"),bottomRight:_("eBottomRight"),bottom:_("eBottom"),bottomLeft:_("eBottomLeft"),left:_("eLeft")}}addResizers(){if(this.resizersAdded)return;let _=this.element;if(!_)return;_.appendChild(B_(G8)),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${_X}`)?.remove(),this.resizersAdded=!1}getResizerElement(_){return this.resizerMap[_].element}onResizeStart(_,f){if(this.boundaryEl=this.findBoundaryElement(),!this.positioned)this.initialisePosition();this.currentResizer={isTop:!!f.match(/top/i),isRight:!!f.match(/right/i),isBottom:!!f.match(/bottom/i),isLeft:!!f.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[f].element.classList.add("ag-active");let{popup:$,forcePopupParentAsOffsetParent:z}=this.config;if(!$&&!z)this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop);this.isResizing=!0,this.updateDragStartPosition(_.clientX,_.clientY)}getSiblings(){let f=this.element.parentElement;if(!f)return null;return Array.prototype.slice.call(f.children).filter(($)=>!$.classList.contains("ag-hidden"))}getMinSizeOfSiblings(){let _=this.getSiblings()||[],f=0,$=0;for(let z of _){let Q=!!z.style.flex&&z.style.flex!=="0 0 auto";if(z===this.element)continue;let J=this.minHeight||0,q=this.minWidth||0;if(Q){let X=window.getComputedStyle(z);if(X.minHeight)J=Number.parseInt(X.minHeight,10);if(X.minWidth)q=Number.parseInt(X.minWidth,10)}else J=z.offsetHeight,q=z.offsetWidth;f+=J,$+=q}return{height:f,width:$}}applySizeToSiblings(_){let f=null,$=this.getSiblings();if(!$)return;for(let z=0;z<$.length;z++){let Q=$[z];if(Q===f)continue;if(_)Q.style.height=`${Q.offsetHeight}px`;else Q.style.width=`${Q.offsetWidth}px`;if(Q.style.flex="0 0 auto",Q===this.element)f=$[z+1]}if(f)f.style.removeProperty("height"),f.style.removeProperty("min-height"),f.style.removeProperty("max-height"),f.style.flex="1 1 auto"}isResizable(){return Object.values(this.resizable).some((_)=>_)}onResize(_){if(!this.isResizing||!this.currentResizer)return;let{popup:f,forcePopupParentAsOffsetParent:$}=this.config,{isTop:z,isRight:Q,isBottom:J,isLeft:q}=this.currentResizer,X=Q||q,Y=J||z,{movementX:Z,movementY:G}=this.calculateMouseMovement({e:_,isLeft:q,isTop:z}),E=this.position.x,U=this.position.y,H=0,W=0;if(X&&Z){let B=q?-1:1,K=this.getWidth(),L=K+Z*B,F=!1;if(q){if(H=K-L,E+H<=0||L<=this.minWidth)F=!0,H=0}if(!F)this.setWidth(L)}if(Y&&G){let B=z?-1:1,K=this.getHeight(),L=K+G*B,F=!1;if(z){if(W=K-L,U+W<=0||L<=this.minHeight)F=!0,W=0}else if(!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&Kthis.element.parentElement.offsetHeight)F=!0;if(!F)this.setHeight(L)}if(this.updateDragStartPosition(_.clientX,_.clientY),(f||$)&&H||W)this.offsetElement(E+H,U+W)}onResizeEnd(_,f){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[f].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){let _=this.element;if(this.config.popup){if(!this.config.width)this.setWidth(_.offsetWidth);if(!this.config.height)this.setHeight(_.offsetHeight)}}onMoveStart(_){if(this.boundaryEl=this.findBoundaryElement(),!this.positioned)this.initialisePosition();this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(_.clientX,_.clientY)}onMove(_){if(!this.isMoving)return;let{x:f,y:$}=this.position,z;if(this.config.calculateTopBuffer)z=this.config.calculateTopBuffer();let{movementX:Q,movementY:J}=this.calculateMouseMovement({e:_,isTop:!0,anywhereWithin:!0,topBuffer:z});this.offsetElement(f+Q,$+J),this.updateDragStartPosition(_.clientX,_.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){if(this.config.forcePopupParentAsOffsetParent&&this.popupSvc)this.offsetParent=this.popupSvc.getPopupParent();else this.offsetParent=this.element.offsetParent}findBoundaryElement(){let _=this.element;while(_){if(window.getComputedStyle(_).position!=="static")return _;_=_.parentElement}return this.element}clearResizeListeners(){while(this.resizeListeners.length){let _=this.resizeListeners.pop();this.dragSvc?.removeDragSource(_)}}destroy(){if(super.destroy(),this.moveElementDragListener)this.dragSvc?.removeDragSource(this.moveElementDragListener);this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},j$=class extends BJ{},V=null;function sz(_){return typeof _?.getGui==="function"}var fX=class{constructor(_){this.cssClassStates={},this.getGui=_}toggleCss(_,f){if(!_)return;if(_.includes(" ")){let z=(_||"").split(" ");if(z.length>1){for(let Q of z)this.toggleCss(Q,f);return}}if(this.cssClassStates[_]!==f&&_.length)this.getGui()?.classList.toggle(_,f),this.cssClassStates[_]=f}},E8=0,p_=class extends j_{constructor(_,f){super();if(this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=E8++,this.cssManager=new fX(()=>this.eGui),this.componentSelectors=new Map((f??[]).map(($)=>[$.selector,$])),_)this.setTemplate(_)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(_,f){if(_&&this.gos)this.applyElementsToComponent(_),this.createChildComponentsFromTags(_,f)}getCompId(){return this.compId}getDataRefAttribute(_){if(_.getAttribute)return _.getAttribute(Uq);return null}applyElementsToComponent(_,f,$,z=null){if(f===void 0)f=this.getDataRefAttribute(_);if(f){let Q=this[f];if(Q===V)this[f]=z??_;else{let J=$?.[f];if(!this.suppressDataRefValidation&&!J)throw Error(`data-ref: ${f} on ${this.constructor.name} with ${Q}`)}}}createChildComponentsFromTags(_,f){let $=[];for(let z of _.childNodes??[])$.push(z);for(let z of $){if(!(z instanceof HTMLElement))continue;let Q=this.createComponentFromElement(z,(J)=>{let q=J.getGui();if(q)for(let X of z.attributes??[])q.setAttribute(X.name,X.value)},f);if(Q){if(Q.addItems&&z.children.length){this.createChildComponentsFromTags(z,f);let J=Array.prototype.slice.call(z.children);Q.addItems(J)}this.swapComponentForNode(Q,_,z)}else if(z.childNodes)this.createChildComponentsFromTags(z,f)}}createComponentFromElement(_,f,$){let z=_.nodeName,Q=this.getDataRefAttribute(_),J=z.indexOf("AG-")===0,q=J?this.componentSelectors.get(z):null,X=null;if(q){let Y=$&&Q?$[Q]:void 0;X=new q.component(Y),X.setParentComponent(this),this.createBean(X,null,f)}else if(J)throw Error(`selector: ${z}`);return this.applyElementsToComponent(_,Q,$,X),X}swapComponentForNode(_,f,$){let z=_.getGui();f.replaceChild(z,$),f.insertBefore(document.createComment($.nodeName),z),this.addDestroyFunc(this.destroyBean.bind(this,_))}activateTabIndex(_,f){let $=f??this.gos.get("tabIndex");if(!_)_=[];if(!_.length)_.push(this.getGui());for(let z of _)z.setAttribute("tabindex",$.toString())}setTemplate(_,f,$){let z;if(typeof _==="string"||_==null)z=o6(_);else z=B_(_);this.setTemplateFromElement(z,f,$)}setTemplateFromElement(_,f,$,z=!1){if(this.eGui=_,this.suppressDataRefValidation=z,f)for(let Q=0;Qthis.eGui.removeEventListener(_,f))}addCss(_){this.cssManager.toggleCss(_,!0)}removeCss(_){this.cssManager.toggleCss(_,!1)}toggleCss(_,f){this.cssManager.toggleCss(_,f)}registerCSS(_){if(this.css===c2)this.css=[_],this.addGlobalCss();else this.css||(this.css=[]),this.css.push(_)}addGlobalCss(){if(Array.isArray(this.css)){let _="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(let f of this.css??[])this.beans.environment.addGlobalCSS(f,_)}this.css=c2}},c2=Symbol(),w=class extends p_{},rQ,lQ,sQ,aQ,P6,v6,oQ;function ef(){if(rQ===void 0)rQ=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return rQ}function az(){if(lQ===void 0)lQ=/(firefox)/i.test(navigator.userAgent);return lQ}function $X(){if(sQ===void 0)sQ=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);return sQ}function pf(){if(aQ===void 0)aQ=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return aQ}function T6(_){if(!_)return null;let f=_.tabIndex,$=_.getAttribute("tabIndex");if(f===-1&&($===null||$===""&&!az()))return null;return f.toString()}function U8(){if(oQ!==void 0)return oQ;if(!document.body)return-1;let _=1e6,f=az()?6000000:1e9,$=document.createElement("div");document.body.appendChild($);while(!0){let z=_*2;if($.style.height=z+"px",z>f||$.clientHeight!==z)break;else _=z}return $.remove(),oQ=_,_}function KJ(){if(v6==null)zX();return v6}function zX(){let _=document.body,f=document.createElement("div");f.style.width=f.style.height="100px",f.style.opacity="0",f.style.overflow="scroll",f.style.msOverflowStyle="scrollbar",f.style.position="absolute",_.appendChild(f);let $=f.offsetWidth-f.clientWidth;if($===0&&f.clientWidth===0)$=null;if(f.parentNode)f.remove();if($!=null)v6=$,P6=$===0}function QX(){if(P6==null)zX();return P6}var I6=!1,Az=0;function H8(_){if(Az>0)return;_.addEventListener("keydown",Rz),_.addEventListener("mousedown",Rz)}function W8(_){if(Az>0)return;_.removeEventListener("keydown",Rz),_.removeEventListener("mousedown",Rz)}function Rz(_){let f=I6,$=_.type==="keydown";if($){if(_.ctrlKey||_.metaKey||_.altKey)return}if(f===$)return;I6=$}function B8(_){let f=q_(_);return H8(f),Az++,()=>{Az--,W8(f)}}function b1(){return I6}function F0(_,f,$=!1){let z=S4,Q=zq;if(f)Q+=", "+f;if($)Q+=', [tabindex="-1"]';let J=Array.prototype.slice.apply(_.querySelectorAll(z)).filter((Y)=>{return A_(Y)}),q=Array.prototype.slice.apply(_.querySelectorAll(Q));if(!q.length)return J;return((Y,Z)=>Y.filter((G)=>Z.indexOf(G)===-1))(J,q)}function F_(_,f=!1,$=!1,z=!1){let Q=F0(_,z?".ag-tab-guard":null,$),J=f?b(Q):Q[0];if(J)return J.focus({preventScroll:!0}),!0;return!1}function V_(_,f,$,z){let Q=F0(f,$?':not([tabindex="-1"])':null),J=d(_),q;if($)q=Q.findIndex((Y)=>Y.contains(J));else q=Q.indexOf(J);let X=q+(z?-1:1);if(X<0||X>=Q.length)return null;return Q[X]}function oz(_,f=5){let $=0;while(_&&T6(_)===null&&++$<=f)_=_.parentElement;if(T6(_)===null)return null;return _}var LJ="ag-focus-managed",JX=class extends j_{constructor(_,f={isStopPropagation:()=>!1,stopPropagation:()=>{}},$={}){super();this.eFocusable=_,this.stopPropagationCallbacks=f,this.callbacks=$,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:(z)=>{if(z.defaultPrevented)return;let Q=V_(this.beans,this.eFocusable,!1,z.shiftKey);if(!Q)return;Q.focus(),z.preventDefault()},...$}}postConstruct(){let{eFocusable:_,callbacks:{onFocusIn:f,onFocusOut:$}}=this;if(_.classList.add(LJ),this.addKeyDownListeners(_),f)this.addManagedElementListeners(_,{focusin:f});if($)this.addManagedElementListeners(_,{focusout:$})}addKeyDownListeners(_){this.addManagedElementListeners(_,{keydown:(f)=>{if(f.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(f))return;let{callbacks:$}=this;if($.shouldStopEventPropagation(f)){this.stopPropagationCallbacks.stopPropagation(f);return}if(f.key===S.TAB)$.onTabKeyDown(f);else if($.handleKeyDown)$.handleKeyDown(f)}})}},qX="__ag_Grid_Stop_Propagation";function n_(_){_[qX]=!0}function z0(_){return _[qX]===!0}var Ff={isStopPropagation:z0,stopPropagation:n_},t0=class extends JX{constructor(_,f){super(_,Ff,f)}},K8={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:(_)=>`(${_[0]}, ${_[1]})`,filterSummaryTextQuote:(_)=>`"${_[0]}"`,minDateValidation:(_)=>`Date must be after ${_[0]}`,maxDateValidation:(_)=>`Date must be before ${_[0]}`,strictMinValueValidation:(_)=>`Must be greater than ${_[0]}`,strictMaxValueValidation:(_)=>`Must be less than ${_[0]}`};function XX(_,f,$){return x4(_,K8,f,$)}function L8(_,f){let{debounceMs:$}=_;if(V$(_)){if($!=null)j(71);return 0}return $??f}function V$(_){return(_.buttons?.indexOf("apply")??-1)>=0}var ez=class extends w{constructor(_,f){super();this.filterNameKey=_,this.cssIdentifier=f,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){let _={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(_,this.getAgComponents()),this.createManagedBean(new t0(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new j$(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(_){}init(_){let f=_;this.setParams(f),this.setModelIntoUi(f.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(_,f){return _===f}refresh(_){let f=_,$=this.params;this.params=f;let{source:z,state:Q,additionalEventAttributes:J}=f;if(z==="colDef")this.updateParams(f,$);let q=this.state;this.state=Q;let X=J?.fromAction;if(X&&X!=="apply"||Q.model!==q.model||!this.areStatesEqual(Q.state,q.state))this.setModelIntoUi(Q.model);return!0}setParams(_){this.params=_,this.state=_.state,this.commonUpdateParams(_)}updateParams(_,f){this.commonUpdateParams(_,f)}commonUpdateParams(_,f){this.applyActive=V$(_),this.setupApplyDebounced()}doesFilterPass(_){j(283);let{getHandler:f,model:$,column:z}=this.params;return f().doesFilterPass({..._,model:$,handlerParams:this.beans.colFilter.getHandlerParams(z)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return j(284),this.params.model!=null}setupApplyDebounced(){let _=L8(this.params,this.defaultDebounceMs),f=c0(this,this.checkApplyDebounce.bind(this),_);this.applyDebounced=()=>{this.debouncePending=!0,f()}}checkApplyDebounce(){if(this.debouncePending)this.debouncePending=!1,this.doApplyModel()}getModel(){return j(285),this.params.model}setModel(_){j(286);let{beans:f,params:$}=this;return f.colFilter.setModelForColumnLegacy($.column,_)}applyModel(_="api"){return this.doApplyModel()}canApply(_){return!0}doApplyModel(_){let{params:f,state:{valid:$=!0,model:z}}=this;if(!$)return!1;let Q=!this.areModelsEqual(f.model,z);if(Q)f.onAction("apply",_);return Q}onNewRowsLoaded(){}onUiChanged(_,f=!1){this.updateUiVisibility();let $=this.getModelFromUi(),z={model:$,state:this.getState(),valid:this.canApply($)};this.state=z;let{params:Q,gos:J,eventSvc:q,applyActive:X}=this;if(Q.onStateChange(z),Q.onUiChange(this.getUiChangeEventParams()),!J.get("enableFilterHandlers"))q.dispatchEvent({type:"filterModified",column:Q.column,filterInstance:this});if(!z.valid)return;if(_??(_=X?void 0:"debounce"),_==="immediately")this.doApplyModel({afterFloatingFilter:f,afterDataChange:!1});else if(_==="debounce")this.applyDebounced()}getState(){return}getUiChangeEventParams(){return}afterGuiAttached(_){this.lastContainerType=_?.container,this.refreshFilterResizer(_?.container)}refreshFilterResizer(_){let{positionableFeature:f,gos:$}=this;if(!f)return;let z=_==="floatingFilter"||_==="columnFilter";if(z)f.restoreLastSize(),f.setResizable($.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0});else f.removeSizeFromEl(),f.setResizable(!1);f.constrainSizeToAvailableHeight(z)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(_,f){return XX(this,_,f)}getPositionableElement(){return this.getGui()}areModelsEqual(_,f){if(_===f||_==null&&f==null)return!0;if(_==null||f==null)return!1;return this.areNonNullModelsEqual(_,f)}};var FJ=class extends p_{isPopup(){return!0}setParentComponent(_){_.addCss("ag-has-popup"),super.setParentComponent(_)}destroy(){let _=this.parentComponent;if(_?.isAlive())_.getGui().classList.remove("ag-has-popup");super.destroy()}},F8=class extends FJ{constructor(){super(...arguments);this.errorMessages=null}init(_){this.params=_,this.initialiseEditor(_),this.eEditor.onValueChange(()=>_.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function DJ(_){let f=_.rowModel;return f.getType()==="clientSide"?f:void 0}var p2="row-group-",D8="t-",M8="b-",k8=0,Df=class{constructor(_){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=k8++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=_}get groupData(){let _=this._groupData;if(_!==void 0)return _;if(this.footer)return this.sibling?.groupData;return this.beans.groupStage?.loadGroupData(this)??null}set groupData(_){this._groupData=_}get primaryRow(){let _=this.footer&&this.sibling?this.sibling:this,{pinnedSibling:f}=_;if(f&&_.rowPinned){if(_=f,_.footer&&_.sibling)_=_.sibling}return _}get allLeafChildren(){let _=this._leafs;return _===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:_}set allLeafChildren(_){this._leafs=_}get expanded(){let _=this.beans.expansionSvc;return _?_.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(_){this._expanded=_}setData(_){this.setDataCommon(_,!1)}updateData(_){this.setDataCommon(_,!0)}setDataCommon(_,f){let{valueCache:$,eventSvc:z}=this.beans,Q=this.data;this.data=_,$?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();let J=this.createDataChangedEvent(_,Q,f);if(this.__localEventService?.dispatchEvent(J),this.sibling){this.sibling.data=_;let X=this.sibling.createDataChangedEvent(_,Q,f);this.sibling.__localEventService?.dispatchEvent(X)}z.dispatchEvent({type:"rowNodeDataChanged",node:this});let q=this.pinnedSibling;if(q)q.data=_,q.__localEventService?.dispatchEvent(q.createDataChangedEvent(_,Q,f)),z.dispatchEvent({type:"rowNodeDataChanged",node:q})}updateDataOnDetailNode(){let _=this.detailNode;if(_)_.data=this.data}createDataChangedEvent(_,f,$){return{type:"dataChanged",node:this,oldData:f,newData:_,update:$}}getRowIndexString(){if(this.rowIndex==null)return e(13),null;if(this.rowPinned==="top")return D8+this.rowIndex;if(this.rowPinned==="bottom")return M8+this.rowIndex;return this.rowIndex.toString()}setDataAndId(_,f){let{selectionSvc:$}=this.beans,z=$?.createDaemonNode?.(this),Q=this.data;if(this.data=_,this.updateDataOnDetailNode(),this.setId(f),$)$.updateRowSelectable(this),$.syncInRowNode(this,z);let J=this.createDataChangedEvent(_,Q,!1);this.__localEventService?.dispatchEvent(J)}setId(_){let f=j6(this.beans.gos);if(f)if(this.data){let $=this.parent?.getRoute()??[];if(this.id=f({data:this.data,parentKeys:$.length>0?$:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(p2))e(14,{groupPrefix:p2})}else this.id=void 0;else this.id=_}setRowTop(_){if(this.oldRowTop=this.rowTop,this.rowTop===_)return;this.rowTop=_,this.dispatchRowEvent("topChanged");let f=_!==null;if(this.displayed!==f)this.displayed=f,this.dispatchRowEvent("displayedChanged")}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(_){this.hovered=_}isHovered(){return this.hovered}setRowHeight(_,f=!1){this.rowHeight=_,this.rowHeightEstimated=f,this.dispatchRowEvent("heightChanged")}setExpanded(_,f,$){this.beans.expansionSvc?.setExpanded(this,_,f,$)}setDataValue(_,f,$){let{colModel:z,valueSvc:Q,gos:J,editSvc:q}=this.beans;if(_==null)return!1;let X=z.getCol(_)??z.getColDefCol(_);if(!X)return!1;if(!this.group){let G=X.getColDef();if(G.pivotValueColumn)X=G.pivotValueColumn}let Y=Q.getValueForDisplay({column:X,node:this,from:"data"}).value;if(J.get("readOnlyEdit")){let{beans:{eventSvc:G},data:E,rowIndex:U,rowPinned:H}=this;return G.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:U,rowPinned:H,column:X,colDef:X.colDef,data:E,node:this,oldValue:Y,newValue:f,value:f,source:$}),!1}if($!=="data"&&q&&!q.committing){let G=q.setDataValue({rowNode:this,column:X},f,$);if(G!=null)return G}let Z=Q.setValue(this,X,f,$);if(this.dispatchCellChangedEvent(X,f,Y),Z)this.pinnedSibling?.dispatchCellChangedEvent(X,f,Y);return Z}getDataValue(_,f="data"){let{colModel:$,valueSvc:z,formula:Q}=this.beans;if(_==null)return;let J=$.getCol(_)??$.getColDefCol(_);if(!J)return;let q=f==="data-raw",X=q||f==="value"?"data":f,Y=z.getValue(J,this,X,q);if(!q){if(Q&&J.isAllowFormula()&&Q.isFormula(Y))Y=Q.resolveValue(J,this);if(f!=="data"&&J.getAggFunc()&&typeof Y==="object"&&Y!=null){if(typeof Y.toNumber==="function")return Y.toNumber();if("value"in Y)return Y.value}}return Y}updateHasChildren(){let _=this.group&&!this.footer||!!this.childrenAfterGroup?.length,{rowChildrenSvc:f}=this.beans;if(f)_=f.getHasChildrenValue(this);if(_!==this.__hasChildren)this.__hasChildren=!!_,this.dispatchRowEvent("hasChildrenChanged")}hasChildren(){if(this.__hasChildren==null)this.updateHasChildren();return this.__hasChildren}dispatchCellChangedEvent(_,f,$){let z={type:"cellChanged",node:this,column:_,newValue:f,oldValue:$};this.__localEventService?.dispatchEvent(z)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();let _=this.rowPinned&&this.pinnedSibling;if(_)return _.isSelected();return this.__selected}depthFirstSearch(_){let f=this.childrenAfterGroup;if(f)for(let $=0,z=f.length;${let $=new Df(f);for(let z of Object.keys(_)){if(S8.has(z))continue;$[z]=_[z]}return $.oldRowTop=null,$},ZX=(_,f,$)=>{if(!$)return;let z=$.rowIndex;if(z==null)return;z+=f;let Q=_.getRowCount();while(z>=0&&z{if(!a$)a$=new WeakSet;else if(a$.has(_))return!1;return a$.add(_),!0},u_=class{constructor(_,f=!1){this.eElement=_,this.preventClick=f,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(_,f){let $=this.eventSvc;if(!$){if($===null)return;this.eventSvc=$=new D0;let z=this.onTouchStart.bind(this);this.startListener=z,this.eElement.addEventListener("touchstart",z,{passive:!0})}$.addEventListener(_,f)}removeEventListener(_,f){this.eventSvc?.removeEventListener(_,f)}onTouchStart(_){if(this.touchStart||!j8(_))return;let f=_.touches[0];this.touchStart=f;let $=this.handlers;if(!$.length){let z=this.eElement,Q=z.ownerDocument,J=this.onTouchMove.bind(this),q=this.onTouchEnd.bind(this),X=this.onTouchCancel.bind(this),Y={passive:!0},Z={passive:!1};qz($,[z,"touchmove",J,Y],[Q,"touchcancel",X,Y],[Q,"touchend",q,Z],[Q,"contextmenu",W1,Z])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{if(this.longPressTimer=0,this.touchStart===f&&!this.moved)this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:f,touchEvent:_})},R8)}onTouchMove(_){let{moved:f,touchStart:$}=this;if(!f&&$){let z=D1($,_.touches);if(z&&!Hq(z,$,4))this.clearLongPress(),this.moved=!0}}onTouchEnd(_){let f=this.touchStart;if(!f||!D1(f,_.changedTouches))return;if(!this.moved)this.eventSvc?.dispatchEvent({type:"tap",touchStart:f}),this.checkDoubleTap(f);if(this.preventClick)W1(_);this.cancel()}onTouchCancel(_){let f=this.touchStart;if(!f||!D1(f,_.changedTouches))return;this.lastTapTime=null,this.cancel()}checkDoubleTap(_){let f=Date.now(),$=this.lastTapTime;if($){if(f-$>A8)this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:_}),f=null}this.lastTapTime=f}cancel(){this.clearLongPress(),e6(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){let _=this.startListener;if(_)this.startListener=null,this.eElement.removeEventListener("touchstart",_);this.cancel(),this.eElement=null,this.eventSvc=null}},N0=((_)=>{return _[_.VALUE=0]="VALUE",_[_.DIMENSION=1]="DIMENSION",_})(N0||{}),V8=1,O8=class{constructor(_){if(this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=V8++,!_?.beanClasses)return;this.beanDestroyComparator=_.beanDestroyComparator,this.init(_)}init(_){this.id=_.id,this.beans.context=this,this.destroyCallback=_.destroyCallback;for(let f of Object.keys(_.providedBeanInstances))this.beans[f]=_.providedBeanInstances[f];for(let f of _.beanClasses){let $=new f;if($.beanName)this.beans[$.beanName]=$;else console.error(`Bean ${f.name} is missing beanName`);this.createdBeans.push($)}for(let f of _.derivedBeans??[]){let{beanName:$,bean:z}=f(this);this.beans[$]=z,this.createdBeans.push(z)}if(_.beanInitComparator)this.createdBeans.sort(_.beanInitComparator);this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(_,f){return this.initBeans([_],f),_}initBeans(_,f){let $=this.beans;for(let z of _)z.preWireBeans?.($),z.wireBeans?.($);for(let z of _)z.preConstruct?.();if(f)_.forEach(f);for(let z of _)z.postConstruct?.()}getBeans(){return this.beans}getBean(_){return this.beans[_]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;let _=this.getBeanInstances();if(this.beanDestroyComparator)_.sort(this.beanDestroyComparator);this.destroyBeans(_),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(_){_?.destroy?.()}destroyBeans(_){if(_)for(let f=0;f<_.length;f++)this.destroyBean(_[f]);return[]}isDestroyed(){return this.destroyed}};function P8(_){return{beanName:"gridApi",bean:_.getBean("apiFunctionSvc").api}}var v8=["licenseManager","environment","eventSvc","gos","paginationAutoPageSizeSvc","apiFunctionSvc","gridApi","registry","agCompUtils","userCompFactory","rowContainerHeight","horizontalResizeSvc","localeSvc","pinnedRowModel","dragSvc","colGroupSvc","visibleCols","popupSvc","selectionSvc","colFilter","quickFilter","filterManager","colModel","headerNavigation","pageBounds","pagination","pageBoundsListener","rowSpanSvc","stickyRowSvc","rowRenderer","expressionSvc","alignedGridsSvc","navigation","valueCache","valueSvc","autoWidthCalc","filterMenuFactory","dragAndDrop","focusSvc","cellNavigation","cellStyles","scrollVisibleSvc","sortSvc","colHover","colAnimation","autoColSvc","selectionColSvc","changeDetectionSvc","animationFrameSvc","undoRedo","colDefFactory","rowStyleSvc","rowNodeBlockLoader","rowNodeSorter","ctrlsSvc","pinnedCols","dataTypeSvc","syncSvc","overlays","stateSvc","expansionSvc","apiEventSvc","ariaAnnounce","menuSvc","colMoves","colAutosize","colFlex","colResize","pivotColsSvc","valueColsSvc","rowGroupColsSvc","colNames","colViewport","pivotResultCols","showRowGroupCols","validation"],n2=Object.fromEntries(v8.map((_,f)=>[_,f]));function T8(_,f){let $=(_.beanName?n2[_.beanName]:void 0)??Number.MAX_SAFE_INTEGER,z=(f.beanName?n2[f.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return $-z}function I8(_,f){if(_?.beanName==="gridDestroySvc")return-1;if(f?.beanName==="gridDestroySvc")return 1;return 0}function g0(_){let{rowIndex:f,rowPinned:$,column:z}=_;return`${f}.${$==null?"null":$}.${z.getId()}`}function C1(_,f){let $=_.column===f.column,z=_.rowPinned===f.rowPinned,Q=_.rowIndex===f.rowIndex;return $&&z&&Q}function Y_(_,f){switch(_.rowPinned){case"top":if(f.rowPinned!=="top")return!0;break;case"bottom":if(f.rowPinned!=="bottom")return!1;break;default:if(v(f.rowPinned))return f.rowPinned!=="top";break}return _.rowIndexE.rowNode.rowIndex===f.rowIndex),Y=X?J:q,Z=($?-1:1)*(X?-1:1),G;for(let E=0;E{if(!z.defaultPrevented&&!x8(z)&&z.key===S.TAB){let Q=z.shiftKey;if(!V_(_,$,!1,Q)){if(q0(_,Q))z.preventDefault()}}}})}function W0(_){return _.gos.get("suppressHeaderFocus")||!!_.overlays?.exclusive}function jz(_){return _.gos.get("suppressCellFocus")||!!_.overlays?.exclusive}function q0(_,f,$=!1){let z=_.ctrlsSvc.get("gridCtrl"),Q=z.focusNextInnerContainer(f);if(Q===!0)return!0;if(Q===!1)return Q;if($||!f&&!z.isDetailGrid()&&z.isFocusInsideGridBody())z.forceFocusOutOfContainer(f);return!1}function C8(_,f){let $=_.focusSvc,z=$.getFocusedCell();if(z&&f&&C1(z,f)){let{rowIndex:Q,rowPinned:J,column:q}=f;if(sf(_))$.setFocusedCell({rowIndex:Q,column:q,rowPinned:J,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!b1()})}}function w8(_,f){let $=_.getFocusableContainerName();if($==="gridBody")return f();return EX(_,()=>F0(_.getGui(),".ag-tab-guard").length>0)?$:null}function EX(_,f){_.setAllowFocus?.(!0);try{return f()}finally{_.setAllowFocus?.(!1)}}var UX="__ag_Grid_Skip_Focusable_Container";function HX(_){_[UX]=!0}function x8(_){return _[UX]===!0}function WX(_){if(!_.cols)return-1;return _.cols.treeDepth+1}function o_(_){return _.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function SJ(_){let f=[],$=_.ctrlsSvc.getHeaderRowContainerCtrls();for(let z of $){if(!z)continue;let Q=z.getGroupRowCount()||0;for(let J=0;JX)f[J]=Y}}}return f}function N8(_,f){let z=_.colModel.isPivotMode()?h8(_):KX(_),Q=f.getHeaderCellCtrls();for(let J of Q){let{column:q}=J,X=q.getAutoHeaderHeight();if(X!=null&&X>z&&q.isAutoHeaderHeight())z=X}return z}function AJ(_){let $=_.colModel.isPivotMode()?g8(_):_Q(_);return _.colModel.forAllCols((z)=>{let Q=z.getAutoHeaderHeight();if(Q!=null&&Q>$&&z.isAutoHeaderHeight())$=Q}),$}function _Q(_){return _.gos.get("headerHeight")??_.environment.getDefaultHeaderHeight()}function BX(_){return _.gos.get("floatingFiltersHeight")??_Q(_)}function KX(_){return _.gos.get("groupHeaderHeight")??_Q(_)}function g8(_){return _.gos.get("pivotHeaderHeight")??_Q(_)}function h8(_){return _.gos.get("pivotGroupHeaderHeight")??KX(_)}function u8(_,f){return _.headerRowIndex===f.headerRowIndex&&_.column===f.column}function i8(_){return _?.headerRowIndex!=null}var m8=class extends A{setComp(_,f,$){this.comp=_,this.eGui=f;let{beans:z}=this,{headerNavigation:Q,touchSvc:J,ctrlsSvc:q}=z;if(Q)this.createManagedBean(new t0($,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)}));this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,z),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,z)}),this.onPivotModeChanged(z),this.setupHeaderHeight();let X=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:X}),J?.mockHeaderContextMenu(this,X),q.register("gridHeaderCtrl",this)}setupHeaderHeight(){let _=this.setHeaderHeight.bind(this);_(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],_),this.addManagedEventListeners({headerRowsChanged:_,columnHeaderHeightChanged:_,columnGroupHeaderHeightChanged:()=>Y0(this.beans,()=>_()),stylesChanged:_,advancedFilterEnabledChanged:_})}setHeaderHeight(){let{beans:_}=this,f=0,$=SJ(_).reduce((q,X)=>q+X,0),z=AJ(_);if(_.filterManager?.hasFloatingFilters())f+=BX(_);f+=$,f+=z;let Q=_.environment.getHeaderRowBorderWidth(),J=f+Q;if(this.headerHeightWithBorder!==J){this.headerHeightWithBorder=J;let q=`${J}px`;this.comp.setHeightAndMinHeight(q)}if(this.headerHeight!==f)this.headerHeight=f,this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(_){let f=_.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",f),this.comp.toggleCss("ag-pivot-off",!f)}onDisplayedColumnsChanged(_){let $=_.visibleCols.allCols.some((z)=>z.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",$)}onTabKeyDown(_){let f=this.gos.get("enableRtl"),$=_.shiftKey,z=$!==f?"LEFT":"RIGHT",{beans:Q}=this,{headerNavigation:J,focusSvc:q}=Q;if(J.navigateHorizontally(z,!0,_)||!$&&q.focusOverlay(!1)||q0(Q,$,!0))_.preventDefault()}handleKeyDown(_){let f=null,{headerNavigation:$}=this.beans;switch(_.key){case S.LEFT:f="LEFT";case S.RIGHT:{if(!v(f))f="RIGHT";if($.navigateHorizontally(f,!1,_))_.preventDefault();break}case S.UP:f="UP";case S.DOWN:{if(!v(f))f="DOWN";if($.navigateVertically(f,_))_.preventDefault();break}default:return}}onFocusOut(_){let{relatedTarget:f}=_,{eGui:$,beans:z}=this;if(!f&&$.contains(d(z)))return;if(!$.contains(f))z.focusSvc.focusedHeader=null}onHeaderContextMenu(_,f,$){let{menuSvc:z,ctrlsSvc:Q}=this.beans;if(!_&&!$||!z?.isHeaderContextMenuEnabled())return;let{target:J}=_??f;if(J===this.eGui||J===Q.getHeaderRowContainerCtrl()?.eViewport)z.showHeaderContextMenu(void 0,_,$)}},RJ=class extends w{constructor(_,f){super(_);this.ctrl=f}getCtrl(){return this.ctrl}},c8={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},p8=class extends RJ{constructor(_){super(c8,_);this.eResize=V,this.eHeaderCompWrapper=V,this.headerCompVersion=0}postConstruct(){let _=this.getGui(),f=()=>{let z=this.ctrl.getSelectAllGui();if(z)this.eResize.insertAdjacentElement("afterend",z),this.addDestroyFunc(()=>z.remove())},$={setWidth:(z)=>_.style.width=z,toggleCss:(z,Q)=>this.toggleCss(z,Q),setUserStyles:(z)=>F$(_,z),setAriaSort:(z)=>z?D4(_,z):M4(_),setUserCompDetails:(z)=>this.setUserCompDetails(z),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:f,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp($,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),f()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){if(this.headerComp)this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0}setUserCompDetails(_){this.headerCompVersion++;let f=this.headerCompVersion;_.newAgStackInstance().then(($)=>this.afterCompCreated(f,$))}afterCompCreated(_,f){if(_!=this.headerCompVersion||!this.isAlive()){this.destroyBean(f);return}this.destroyHeaderComp(),this.headerComp=f,this.headerCompGui=f.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},n8={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},d8=class extends RJ{constructor(_){super(n8,_);this.eResize=V,this.eHeaderCompWrapper=V}postConstruct(){let _=this.getGui(),f=(z,Q)=>Q!=null?_.setAttribute(z,Q):_.removeAttribute(z),$={toggleCss:(z,Q)=>this.toggleCss(z,Q),setUserStyles:(z)=>F$(_,z),setHeaderWrapperHidden:(z)=>{if(z)this.eHeaderCompWrapper.style.setProperty("display","none");else this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:(z)=>{if(z!=null)this.eHeaderCompWrapper.style.setProperty("max-height",`${z}px`);else this.eHeaderCompWrapper.style.removeProperty("max-height");this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",z!=null)},setResizableDisplayed:(z)=>N(this.eResize,z),setWidth:(z)=>_.style.width=z,setAriaExpanded:(z)=>f("aria-expanded",z),setUserCompDetails:(z)=>this.setUserCompDetails(z),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp($,_,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(_){_.newAgStackInstance().then((f)=>this.afterHeaderCompCreated(f))}afterHeaderCompCreated(_){let f=()=>this.destroyBean(_);if(!this.isAlive()){f();return}let $=this.getGui(),z=_.getGui();this.eHeaderCompWrapper.appendChild(z),this.addDestroyFunc(f),this.headerGroupComp=_,this.ctrl.setDragSource($)}},t8={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},r8=class extends RJ{constructor(_){super(t8,_);this.eFloatingFilterBody=V,this.eButtonWrapper=V,this.eButtonShowMainFilter=V}postConstruct(){let _=this.getGui(),f={toggleCss:($,z)=>this.toggleCss($,z),setUserStyles:($)=>F$(_,$),addOrRemoveBodyCssClass:($,z)=>this.eFloatingFilterBody.classList.toggle($,z),setButtonWrapperDisplayed:($)=>N(this.eButtonWrapper,$),setCompDetails:($)=>this.setCompDetails($),getFloatingFilterComp:()=>this.compPromise,setWidth:($)=>_.style.width=$,setMenuIcon:($)=>this.eButtonShowMainFilter.appendChild($)};this.ctrl.setComp(f,_,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(_){if(!_){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=_.newAgStackInstance(),this.compPromise.then((f)=>this.afterCompCreated(f))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(_){if(!_)return;if(!this.isAlive()){this.destroyBean(_);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=_,this.eFloatingFilterBody.appendChild(_.getGui()),_.afterGuiAttached?.()}},l8=class extends w{constructor(_){super({tag:"div",cls:_.headerRowClass,role:"row"});this.ctrl=_,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),Kz(this.getGui(),this.ctrl.getAriaRowIndex());let f={setHeight:($)=>this.getGui().style.height=$,setTop:($)=>this.getGui().style.top=$,setHeaderCtrls:($,z)=>this.setHeaderCtrls($,z),setWidth:($)=>this.getGui().style.width=$,setRowIndex:($)=>Kz(this.getGui(),$)};this.ctrl.setComp(f,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(_,f){if(!this.isAlive())return;let $=this.headerComps;this.headerComps={};for(let z of _){let Q=z.instanceId,J=$[Q];if(delete $[Q],J==null)J=this.createHeaderComp(z),this.getGui().appendChild(J.getGui());this.headerComps[Q]=J}if(Object.values($).forEach((z)=>{z.getGui().remove(),this.destroyBean(z)}),f){let z=Object.values(this.headerComps);z.sort((J,q)=>{let X=J.getCtrl().column.getLeft(),Y=q.getCtrl().column.getLeft();return X-Y});let Q=z.map((J)=>J.getGui());Zq(this.getGui(),Q)}}createHeaderComp(_){let f;switch(this.ctrl.type){case"group":f=new d8(_);break;case"filter":f=new r8(_);break;default:f=new p8(_);break}return this.createBean(f),f.setParentComponent(this),f}},jJ=class extends A{constructor(_,f=!1){super();this.callback=_,this.addSpacer=f}postConstruct(){let _=this.setWidth.bind(this);if(this.addManagedPropertyListener("domLayout",_),this.addManagedEventListeners({columnContainerWidthChanged:_,displayedColumnsChanged:_,leftPinnedWidthChanged:_}),this.addSpacer)this.addManagedEventListeners({rightPinnedWidthChanged:_,scrollVisibilityChanged:_,scrollbarWidthChanged:_});this.setWidth()}setWidth(){let _=S_(this.gos,"print"),{visibleCols:f,scrollVisibleSvc:$}=this.beans,z=f.bodyWidth,Q=f.getColsLeftWidth(),J=f.getDisplayedColumnsRightWidth(),q;if(_)q=z+Q+J;else if(q=z,this.addSpacer){if((this.gos.get("enableRtl")?Q:J)===0&&$.verticalScrollShowing)q+=$.getScrollbarWidth()}this.callback(q)}};function O$(_,f,$){if($)_.addDestroyFunc(()=>f.destroyBean($));return $??_}var VJ=class extends A{constructor(_,f,$,z){super();this.columnOrGroup=_,this.eCell=f,this.colsSpanning=z,this.columnOrGroup=_,this.ariaEl=f.querySelector("[role=columnheader]")||f,this.beans=$}setColsSpanning(_){this.colsSpanning=_,this.onLeftChanged()}getColumnOrGroup(){let{beans:_,colsSpanning:f}=this;if(_.gos.get("enableRtl")&&f)return b(f);return this.columnOrGroup}postConstruct(){let _=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:_}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:_}),this.addManagedPropertyListener("domLayout",_)}setLeftFirstTime(){let{gos:_,colAnimation:f}=this.beans,$=_.get("suppressColumnMoveAnimation"),z=v(this.columnOrGroup.getOldLeft());if(f?.isActive()&&z&&!$)this.animateInLeft();else this.onLeftChanged()}animateInLeft(){let _=this.getColumnOrGroup(),f=this.modifyLeftForPrintLayout(_,_.getOldLeft()),$=this.modifyLeftForPrintLayout(_,_.getLeft());this.setLeft(f),this.actualLeft=$,this.beans.colAnimation.executeNextVMTurn(()=>{if(this.actualLeft===$)this.setLeft($)})}onLeftChanged(){let _=this.getColumnOrGroup(),f=_.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(_,f),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(_,f){let{gos:$,visibleCols:z}=this.beans;if(!S_($,"print"))return f;if(_.getPinned()==="left")return f;let J=z.getColsLeftWidth();if(_.getPinned()==="right"){let q=z.bodyWidth;return J+q+f}return J+f}setLeft(_){if(v(_))this.eCell.style.left=`${_}px`;if(G_(this.columnOrGroup)){let f=this.columnOrGroup.getLeafColumns();if(!f.length)return;if(f.length>1)F4(this.ariaEl,f.length)}}},s8="ag-column-first",a8="ag-column-last";function fQ(_,f,$,z){if(n(_))return[];return FX(_.headerClass,_,f,$,z)}function $Q(_,f,$,z){if(n(_))return[];return FX(_.toolPanelClass,_,f,$,z)}function LX(_,f,$){_.toggleCss(s8,$.isColAtEdge(f,"first")),_.toggleCss(a8,$.isColAtEdge(f,"last"))}function o8(_,f,$,z){return C(f,{colDef:_,column:$,columnGroup:z})}function FX(_,f,$,z,Q){if(n(_))return[];let J;if(typeof _==="function"){let q=o8(f,$,z,Q);J=_(q)}else J=_;if(typeof J==="string")return[J];if(Array.isArray(J))return[...J];return[]}var e8=0,DX="headerCtrl",OJ=class extends A{constructor(_,f){super();this.column=_,this.rowCtrl=f,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=_.getUniqueId()+"-"+e8++}postConstruct(){let _=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],_),this.addManagedEventListeners({overlayExclusiveChanged:_})}setComp(_,f,$,z,Q){if(f.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(_,f,$,z,Q),this.reAttemptToFocus)this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0)}shouldStopEventPropagation(_){let{headerRowIndex:f,column:$}=this.beans.focusSvc.focusedHeader,z=$.getDefinition(),Q=z?.suppressHeaderKeyboardEvent;if(!v(Q))return!1;let J=C(this.gos,{colDef:z,column:$,headerRowIndex:f,event:_});return!!Q(J)}getWrapperHasFocus(){return d(this.beans)===this.eGui}setGui(_,f){this.eGui=_,this.addDomData(f),f.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),f.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){let _=this.column.getDefinition();if(!_)return;let{headerStyle:f}=_,$;if(typeof f==="function"){let z=this.getHeaderClassParams();$=f(z)}else $=f;if($)this.comp.setUserStyles($)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(_){let{wrapperElement:f,checkMeasuringCallback:$,compBean:z}=_,{beans:Q}=this,J=(E)=>{if(!this.isAlive()||!z.isAlive())return;let{paddingTop:U,paddingBottom:H,borderBottomWidth:W,borderTopWidth:B}=I1(this.eGui),K=U+H+W+B,F=f.offsetHeight+K;if(E<5){let M=!q_(Q)?.contains(f),k=F==0;if(M||k){k6(()=>J(E+1),"raf",Q);return}}this.setColHeaderHeight(this.column,F)},q=!1,X,Y=()=>{let E=this.column.isAutoHeaderHeight();if(E&&!q)Z();if(!E&&q)G()},Z=()=>{q=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),J(0),X=S0(this.beans,f,()=>J(0))},G=()=>{if(q=!1,X)X();this.comp.toggleCss("ag-header-cell-auto-height",!1),X=void 0};if(Y(),z.addDestroyFunc(()=>G()),z.addManagedListeners(this.column,{widthChanged:()=>q&&J(0)}),z.addManagedEventListeners({sortChanged:()=>{if(q)window.setTimeout(()=>J(0))}}),$)$(Y)}onDisplayedColumnsChanged(){let{comp:_,column:f,beans:$,eGui:z}=this;if(!_||!f||!z)return;LX(_,f,$.visibleCols),e9(z,$.visibleCols.getAriaColIndex(f))}addResizeAndMoveKeyboardListeners(_){_.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){let _=W0(this.beans);if(this.eGui)gf(this.eGui,"tabindex",_?null:"-1")}onGuiKeyDown(_){let f=d(this.beans),$=_.key===S.LEFT||_.key===S.RIGHT;if(this.isResizing)_.preventDefault(),_.stopImmediatePropagation();if(f!==this.eGui||!_.shiftKey&&!_.altKey&&!_.ctrlKey&&!_.metaKey)return;if(this.isResizing||$)_.preventDefault(),_.stopImmediatePropagation();if((_.ctrlKey||_.metaKey)&&lq(_)===S.C)return this.beans.clipboardSvc?.copyToClipboard();if(!$)return;let J=_.key===S.LEFT!==this.gos.get("enableRtl")?"left":"right";if(_.altKey){this.isResizing=!0,this.resizeMultiplier+=1;let q=this.getViewportAdjustedResizeDiff(_);this.resizeHeader(q,_.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(J)}moveHeader(_){this.beans.colMoves?.moveHeader(_,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(_){let f=this.getResizeDiff(_),{pinnedCols:$}=this.beans;return $?$.getHeaderResizeDiff(f,this.column):f}getResizeDiff(_){let{gos:f,column:$}=this,z=_.key===S.LEFT!==f.get("enableRtl"),Q=$.getPinned(),J=f.get("enableRtl");if(Q){if(J!==(Q==="right"))z=!z}return(z?-1:1)*this.resizeMultiplier}onGuiKeyUp(){if(!this.isResizing)return;if(this.resizeToggleTimeout)window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0;this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150)}handleKeyDown(_){let f=this.getWrapperHasFocus();switch(_.key){case S.PAGE_DOWN:case S.PAGE_UP:case S.PAGE_HOME:case S.PAGE_END:if(f)_.preventDefault()}}addDomData(_){let f=DX,{eGui:$,gos:z}=this;tf(z,$,f,this),_.addDestroyFunc(()=>tf(z,$,f,null))}focus(_){if(!this.isAlive())return!1;let{eGui:f}=this;if(!f)this.reAttemptToFocus=!0;else this.lastFocusEvent=_||null,f.focus();return!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){if(this.dragSource)this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null}handleContextMenuMouseEvent(_,f,$){let z=_??f,{menuSvc:Q,gos:J}=this.beans;if(J.get("preventDefaultOnContextMenu"))z.preventDefault();if(Q?.isHeaderContextMenuEnabled($))Q.showHeaderContextMenu($,_,f);this.dispatchColumnMouseEvent("columnHeaderContextMenu",$)}dispatchColumnMouseEvent(_,f){this.eventSvc.dispatchEvent({type:_,column:f})}setColHeaderHeight(_,f){if(!_.setAutoHeaderHeight(f))return;let{eventSvc:$}=this;if(_.isColumn)$.dispatchEvent({type:"columnHeaderHeightChanged",column:_,columns:[_],source:"autosizeColumnHeaderHeight"});else $.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:_,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},_G=class extends OJ{constructor(){super(...arguments);this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(_,f,$,z,Q){this.comp=_;let{rowCtrl:J,column:q,beans:X}=this,{colResize:Y,context:Z,colHover:G,rangeSvc:E}=X,U=O$(this,Z,Q);if(this.setGui(f,U),this.updateState(),this.setupWidth(U),this.setupMovingCss(U),this.setupMenuClass(U),this.setupSortableClass(U),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:z,checkMeasuringCallback:(W)=>this.setRefreshFunction("measuring",W),compBean:U}),this.addColumnHoverListener(U),this.setupFilterClass(U),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(U),this.setupSelectAll(U),this.setupUserComp(),this.refreshAria(),Y)this.resizeFeature=U.createManagedBean(Y.createResizeFeature(J.pinned,q,$,_,this));else N($,!1);G?.createHoverFeature(U,[q],f),E?.createRangeHighlightFeature(U,q,_),U.createManagedBean(new VJ(q,f,X)),U.createManagedBean(new t0(f,{shouldStopEventPropagation:(W)=>this.shouldStopEventPropagation(W),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(U),U.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),U.addManagedListeners(q,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});let H=()=>this.checkDisplayName();U.addManagedEventListeners({columnValueChanged:H,columnRowGroupChanged:H,columnPivotChanged:H,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),U.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(_,f){this.beans.colResize?.resizeHeader(this.column,_,f)}getHeaderClassParams(){let{column:_,beans:f}=this,$=_.colDef;return C(f.gos,{colDef:$,column:_,floatingFilter:!1})}setupUserComp(){let _=this.lookupUserCompDetails();if(_)this.setCompDetails(_)}setCompDetails(_){this.userCompDetails=_,this.comp.setUserCompDetails(_)}lookupUserCompDetails(){let _=this.createParams(),f=this.column.getColDef();return _8(this.beans.userCompFactory,f,_)}createParams(){let{menuSvc:_,sortSvc:f,colFilter:$,gos:z}=this.beans;return C(z,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!_?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!$&&(!this.openFilterEnabled||E_(this.gos)),showColumnMenu:(J,q)=>{_?.showColumnMenu({column:this.column,buttonElement:J,positionBy:"button",onClosedCallback:q})},showColumnMenuAfterMouseClick:(J,q)=>{_?.showColumnMenu({column:this.column,mouseEvent:J,positionBy:"mouse",onClosedCallback:q})},showFilter:(J)=>{_?.showFilterMenu({column:this.column,buttonElement:J,containerType:"columnFilter",positionBy:"button"})},progressSort:(J)=>{f?.progressSort(this.column,!!J,"uiColumnSorted")},setSort:(J,q)=>{f?.setSortForColumn(this.column,e_(J),!!q,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(J,q)=>{z.assertModuleRegistered("Tooltip",3),this.setupTooltip(J,q)}})}setupSelectAll(_){let{selectionSvc:f}=this.beans;if(!f)return;this.selectAllFeature=_.createOptionalManagedBean(f.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),_.addManagedPropertyListener("rowSelection",()=>{let $=f.createSelectAllFeature(this.column);if($&&!this.selectAllFeature)this.selectAllFeature=_.createManagedBean($),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui();else if(this.selectAllFeature&&!$)this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature)})}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(_){if(super.handleKeyDown(_),_.key===S.SPACE)this.selectAllFeature?.onSpaceKeyDown(_);else if(_.key===S.ENTER)this.onEnterKeyDown(_);else if(_.key===S.DOWN&&_.altKey)this.showMenuOnKeyPress(_,!1)}onEnterKeyDown(_){let{column:f,gos:$,sortable:z,beans:Q}=this,J=!1;if(_.ctrlKey||_.metaKey)J=this.showMenuOnKeyPress(_,!0);if(!J){if(!_.altKey&&Gf($))Q.rangeSvc?.handleColumnSelection(f,_);else if(z)Q.sortSvc?.progressSort(f,_.shiftKey,"uiColumnSorted")}}showMenuOnKeyPress(_,f){let $=this.comp.getUserCompInstance();if(!d2($))return!1;if($.onMenuKeyboardShortcut(f))return _.preventDefault(),!0;return!1}onFocusIn(_){if(!this.eGui.contains(_.relatedTarget))this.focusThis(),this.announceAriaDescription();if(b1())this.setActiveHeader(!0)}onFocusOut(_){if(this.eGui.contains(_.relatedTarget))return;this.setActiveHeader(!1)}setupTooltip(_,f){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,_,f)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){let _=()=>{let f=this.column.getColDef(),$=fQ(f,this.gos,this.column,null),z=this.userHeaderClasses;this.userHeaderClasses=new Set($);for(let Q of $)if(z.has(Q))z.delete(Q);else this.comp.toggleCss(Q,!0);for(let Q of z)this.comp.toggleCss(Q,!1)};this.setRefreshFunction("headerClasses",_),_()}setDragSource(_){if(this.dragSourceElement=_,this.removeDragSource(),!_||!this.draggable)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(_,this.column,this.displayName)??null}updateState(){let{menuSvc:_}=this.beans;this.menuEnabled=!!_?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!_?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(_,f){this.refreshFunctions[_]=f}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(let _ of Object.values(this.refreshFunctions))_()}refreshHeaderComp(){let _=this.lookupUserCompDetails();if(!_)return;if(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==_.componentClass?this.attemptHeaderCompRefresh(_.params):!1)this.setDragSource(this.dragSourceElement);else this.setCompDetails(_)}attemptHeaderCompRefresh(_){let f=this.comp.getUserCompInstance();if(!f)return!1;if(!f.refresh)return!1;return f.refresh(_)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){if(this.displayName!==this.calculateDisplayName())this.refresh()}workOutDraggable(){let _=this.column.getColDef();return!this.gos.get("suppressMovableColumns")&&!_.suppressMovable&&!_.lockPosition||!!_.enableRowGroup||!!_.enablePivot}setupWidth(_){let f=()=>{let $=this.column.getActualWidth();this.comp.setWidth(`${$}px`)};_.addManagedListeners(this.column,{widthChanged:f}),f()}setupMovingCss(_){let f=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};_.addManagedListeners(this.column,{movingChanged:f}),f()}setupMenuClass(_){let f=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};_.addManagedListeners(this.column,{menuVisibleChanged:f}),f()}setupSortableClass(_){let f=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};f(),this.setRefreshFunction("updateSortable",f),_.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(_){let f=()=>{let $=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",$),this.refreshAria()};_.addManagedListeners(this.column,{filterActiveChanged:f}),f()}setupWrapTextClass(){let _=()=>{let f=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",f)};_(),this.setRefreshFunction("wrapText",_)}onHeaderHighlightChanged(){let _=this.column.getHighlighted(),f=_===0,$=_===1;this.comp.toggleCss("ag-header-highlight-before",f),this.comp.toggleCss("ag-header-highlight-after",$)}onDisplayedColumnsChanged(){if(super.onDisplayedColumnsChanged(),!this.isAlive())return;this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){let{eGui:_,column:f,comp:$,beans:z}=this,Q=SJ(this.beans),J=Q.reduce((U,H)=>U+H,0)===0;if($.toggleCss("ag-header-parent-hidden",J),!f.isSpanHeaderHeight()){_.style.removeProperty("top"),_.style.removeProperty("height"),$.toggleCss("ag-header-span-height",!1),$.toggleCss("ag-header-span-total",!1);return}let{numberOfParents:q,isSpanningTotal:X}=this.column.getColumnGroupPaddingInfo();$.toggleCss("ag-header-span-height",q>0);let Y=AJ(z);if(q===0){$.toggleCss("ag-header-span-total",!1),_.style.setProperty("top","0px"),_.style.setProperty("height",`${Y}px`);return}$.toggleCss("ag-header-span-total",X);let Z=(this.column.getFirstRealParent()?.getLevel()??-1)+1,G=Q.length-Z,E=0;for(let U=0;UQ==="filter"?-1:J.charCodeAt(0)-Q.charCodeAt(0)).map((Q)=>$.get(Q)).join(". ");_.ariaAnnounce?.announceValue(z,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(_){this.beans.colHover?.addHeaderColumnHoverListener(_,this.comp,this.column)}addActiveHeaderMouseListeners(_){let f=(Q)=>this.handleMouseOverChange(Q.type==="mouseenter"),$=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},z=(Q)=>this.handleContextMenuMouseEvent(Q,void 0,this.column);_.addManagedListeners(this.eGui,{mouseenter:f,mouseleave:f,click:$,contextmenu:z})}handleMouseOverChange(_){this.setActiveHeader(_),this.eventSvc.dispatchEvent({type:_?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(_){this.comp.toggleCss("ag-header-active",_)}getAnchorElementForMenu(_){let f=this.comp.getUserCompInstance();if(d2(f))return f.getAnchorElementForMenu(_);return this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function d2(_){return typeof _?.getAnchorElementForMenu==="function"&&typeof _.onMenuKeyboardShortcut==="function"}var fG=0,eQ=class extends A{constructor(_,f,$){super();this.rowIndex=_,this.pinned=f,this.type=$,this.instanceId=fG++,this.comp=null,this.allCtrls=[];let z="ag-header-row-column";if($==="group")z="ag-header-row-group";else if($==="filter")z="ag-header-row-filter";this.headerRowClass=`ag-header-row ${z}`}setRowIndex(_){this.rowIndex=_,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=S_(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){if(!this.comp)return!1;return this.allCtrls.every((_)=>_.eGui!=null)}setComp(_,f,$=!0){if(this.comp=_,f=O$(this,this.beans.context,f),$)this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged();this.setWidth(),this.addEventListeners(f)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(_){let f=this.onRowHeightChanged.bind(this),$=this.onDisplayedColumnsChanged.bind(this);_.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:$,virtualColumnsChanged:(z)=>this.onVirtualColumnsChanged(z.afterScroll),columnGroupHeaderHeightChanged:f,columnHeaderHeightChanged:f,stylesChanged:f,advancedFilterEnabledChanged:f}),_.addManagedPropertyListener("domLayout",$),_.addManagedPropertyListener("ensureDomOrder",(z)=>this.isEnsureDomOrder=z.currentValue),_.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],f)}onDisplayedColumnsChanged(){this.isPrintLayout=S_(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;let _=this.getWidthForRow();this.comp.setWidth(`${_}px`)}getWidthForRow(){let{visibleCols:_}=this.beans;if(this.isPrintLayout){if(this.pinned!=null)return 0;return _.getContainerWidth("right")+_.getContainerWidth("left")+_.getContainerWidth(null)}return _.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;let{topOffset:_,rowHeight:f}=this.getTopAndHeight();this.comp.setTop(_+"px"),this.comp.setHeight(f+"px")}getTopAndHeight(){let _=0,f=SJ(this.beans);for(let Q=0;Q{let{focusSvc:Q,visibleCols:J}=this.beans;if(!Q.isHeaderWrapperFocused(z))return!1;return J.isVisible(z.column)};if(_)for(let[z,Q]of _)if($(Q))this.ctrlsById.set(z,Q);else this.destroyBean(Q);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(_,f,$){if(_.isEmptyGroup())return;let z=_.getUniqueId(),Q;if($)Q=$.get(z),$.delete(z);if(Q&&Q.column!=_)this.destroyBean(Q),Q=void 0;if(Q==null)switch(this.type){case"filter":{Q=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,_,this));break}case"group":Q=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,_,this));break;default:Q=this.createBean(new _G(_,this));break}f.set(z,Q)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];let _=[];for(let f of["left",null,"right"])_.push(...this.getComponentsToRender(f));return _}getComponentsToRender(_=this.pinned){if(this.type==="group")return this.beans.colViewport.getHeadersToRender(_,this.rowIndex);return this.beans.colViewport.getColumnHeadersToRender(_)}focusHeader(_,f){let $=this.allCtrls.find((Q)=>Q.column==_);if(!$)return!1;return $.focus(f)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},$G=class extends A{constructor(_){super();this.pinned=_,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(_,f){this.comp=_,this.eViewport=f;let{pinnedCols:$,ctrlsSvc:z,colModel:Q,colMoves:J}=this.beans;this.setupCenterWidth(),$?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(J,this.eViewport);let q=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:q,advancedFilterEnabledChanged:q});let X=`${typeof this.pinned==="string"?this.pinned:"center"}Header`;if(z.register(X,this),Q.ready)this.refresh()}getAllCtrls(){let _=[...this.groupsRowCtrls];if(this.columnsRowCtrl)_.push(this.columnsRowCtrl);if(this.filtersRowCtrl)_.push(this.filtersRowCtrl);return _}refresh(_=!1){let{focusSvc:f,filterManager:$,visibleCols:z}=this.beans,Q=0,J=f.getFocusHeaderToUseAfterRefresh(),q=()=>{let E=z.headerGroupRowCount;if(Q=E,!_)this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);let U=this.groupsRowCtrls.length;if(U===E)return;if(U>E){for(let H=E;H{let E=Q++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}if(this.columnsRowCtrl==null||!_)this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new eQ(E,this.pinned,"column"));else if(this.columnsRowCtrl.rowIndex!==E)this.columnsRowCtrl.setRowIndex(E)},Y=()=>{this.includeFloatingFilter=!!$?.hasFloatingFilters()&&!this.hidden;let E=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){E();return}if(!_)E();let U=Q++;if(this.filtersRowCtrl){if(this.filtersRowCtrl.rowIndex!==U)this.filtersRowCtrl.setRowIndex(U)}else this.filtersRowCtrl=this.createBean(new eQ(U,this.pinned,"filter"))},Z=this.getAllCtrls();q(),X(),Y();let G=this.getAllCtrls();if(this.comp.setCtrls(G),this.restoreFocusOnHeader(f,J),Z.length!==G.length)this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(_){let f=($)=>$?.getHeaderCellCtrls().find((z)=>z.column===_);if(Q0(_))return f(this.columnsRowCtrl);if(this.groupsRowCtrls.length===0)return;for(let $=0;$this.comp.setCenterWidth(`${_}px`),!0))}},zG={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},QG={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},JG={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},_6=class extends w{constructor(_){super();this.eCenterContainer=V,this.headerRowComps={},this.rowCompsList=[],this.pinned=_}postConstruct(){this.selectAndSetTemplate();let _={setDisplayed:($)=>this.setDisplayed($),setCtrls:($)=>this.setCtrls($),setCenterWidth:($)=>this.eCenterContainer.style.width=$,setViewportScrollLeft:($)=>this.getGui().scrollLeft=$,setPinnedContainerWidth:($)=>{let z=this.getGui();z.style.width=$,z.style.maxWidth=$,z.style.minWidth=$}};this.createManagedBean(new $G(this.pinned)).setComp(_,this.getGui())}selectAndSetTemplate(){let _=this.pinned=="left",f=this.pinned=="right",$=_?zG:f?QG:JG;this.setTemplate($),this.eRowContainer=this.eCenterContainer!==V?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(_){this.destroyBean(_),_.getGui().remove()}setCtrls(_){let f=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let $,z=(Q)=>{let J=Q.getGui();if(J.parentElement!=this.eRowContainer)this.eRowContainer.appendChild(J);if($)Yq(this.eRowContainer,J,$);$=J};for(let Q of _){let J=Q.instanceId,q=f[J];delete f[J];let X=q?q:this.createBean(new l8(Q));this.headerRowComps[J]=X,this.rowCompsList.push(X),z(X)}for(let Q of Object.values(f))this.destroyRowComp(Q)}},qG={tag:"div",cls:"ag-header",role:"presentation"},XG=class extends w{constructor(){super(qG)}postConstruct(){let _={toggleCss:(z,Q)=>this.toggleCss(z,Q),setHeightAndMinHeight:(z)=>{this.getGui().style.height=z,this.getGui().style.minHeight=z}};this.createManagedBean(new m8).setComp(_,this.getGui(),this.getFocusableElement());let $=(z)=>{this.createManagedBean(z),this.appendChild(z)};$(new _6("left")),$(new _6(null)),$(new _6("right"))}},YG={selector:"AG-HEADER-ROOT",component:XG},B0={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},PJ=class extends A{constructor(_){super();this.view=_}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){let _=this.gos.get("domLayout"),f={autoHeight:_==="autoHeight",normal:_==="normal",print:_==="print"},$=f.autoHeight?B0.AUTO_HEIGHT:f.print?B0.PRINT:B0.NORMAL;this.view.updateLayoutClasses($,f)}},MX=class extends w{constructor(_,f){super();this.direction=f,this.eViewport=V,this.eContainer=V,this.hideTimeout=0,this.setTemplate(_)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",$X()||pf())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.invisibleScrollbar=QX(),this.invisibleScrollbar)this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()}addActiveListenerToggles(){let _=this.getGui(),f=()=>this.toggleCss("ag-scrollbar-active",!0),$=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(_,{mouseenter:f,mousedown:f,touchstart:f,mouseleave:$,touchend:$})}onScrollVisibilityChanged(){if(this.invisibleScrollbar===void 0)this.initialiseInvisibleScrollbar();Y0(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:(_)=>{if(_.direction===this.direction){if(this.hideTimeout)window.clearTimeout(this.hideTimeout),this.hideTimeout=0;this.toggleCss("ag-scrollbar-scrolling",!0)}},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(_){let f=this.eViewport;_J(this,()=>A_(f),()=>this.setScrollPosition(_),100)}onScrollCallback(_){this.addManagedElementListeners(this.eViewport,{scroll:_})}},ZG={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},GG=class extends MX{constructor(){super(ZG,"horizontal");this.eLeftSpacer=V,this.eRightSpacer=V,this.setScrollVisibleDebounce=0}wireBeans(_){this.visibleCols=_.visibleCols,this.scrollVisibleSvc=_.scrollVisibleSvc}postConstruct(){super.postConstruct();let _=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:_,displayedColumnsWidthChanged:_,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",_),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new jJ((f)=>this.eContainer.style.width=`${f}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar)this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;let _=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${_}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){let _=this.scrollVisibleSvc.verticalScrollShowing,f=this.visibleCols.getDisplayedColumnsRightWidth(),$=!this.enableRtl&&_,z=this.scrollVisibleSvc.getScrollbarWidth();if($)f+=z;I0(this.eRightSpacer,f),this.eRightSpacer.classList.toggle("ag-scroller-corner",f<=z);let Q=this.visibleCols.getColsLeftWidth();if(this.enableRtl&&_)Q+=z;I0(this.eLeftSpacer,Q),this.eLeftSpacer.classList.toggle("ag-scroller-corner",Q<=z)}setScrollVisible(){let _=this.scrollVisibleSvc.horizontalScrollShowing,f=this.invisibleScrollbar,$=this.gos.get("suppressHorizontalScroll"),z=_?this.scrollVisibleSvc.getScrollbarWidth()||0:0,J=!$?z===0&&f?16:z:0,q=()=>{if(this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",f),a1(this.getGui(),J),a1(this.eViewport,J),a1(this.eContainer,J),!J)this.eContainer.style.setProperty("min-height","1px");this.setVisible(_,{skipAriaHidden:!0})};if(window.clearTimeout(this.setScrollVisibleDebounce),!_)q();else this.setScrollVisibleDebounce=window.setTimeout(q,100)}getScrollPosition(){return Lz(this.eViewport,this.enableRtl)}setScrollPosition(_){if(!A_(this.eViewport))this.attemptSettingScrollPosition(_);Fz(this.eViewport,_,this.enableRtl)}},EG={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:GG},kX=class extends A{constructor(_,f){super();this.eContainer=_,this.eViewport=f}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(_){let f=_.uiContainerHeight,$=f!=null?`${f}px`:"";if(this.eContainer.style.height=$,this.eViewport)this.eViewport.style.height=$}},UG={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},HG=class extends MX{constructor(){super(UG,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new kX(this.eContainer));let{ctrlsSvc:_}=this.beans;_.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,_)})}setScrollVisible(){let{scrollVisibleSvc:_}=this.beans,f=_.verticalScrollShowing,$=this.invisibleScrollbar,z=f?_.getScrollbarWidth()||0:0,Q=z===0&&$?16:z;this.toggleCss("ag-scrollbar-invisible",$),I0(this.getGui(),Q),I0(this.eViewport,Q),I0(this.eContainer,Q),this.setDisplayed(f,{skipAriaHidden:!0})}onRowContainerHeightChanged(_){let $=_.getGridBodyCtrl().eBodyViewport,z=this.getScrollPosition(),Q=$.scrollTop;if(z!=Q)this.setScrollPosition(Q,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(_,f){if(!f&&!A_(this.eViewport))this.attemptSettingScrollPosition(_);this.eViewport.scrollTop=_}},WG={selector:"AG-FAKE-VERTICAL-SCROLL",component:HG};var ff="Viewport",t2="fakeVScrollComp",f6=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],r2=100,$6=150,BG=class extends A{constructor(_){super();this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=_,this.resetLastHScrollDebounced=c0(this,()=>this.lastScrollSource[1]=null,$6),this.resetLastVScrollDebounced=c0(this,()=>this.lastScrollSource[0]=null,$6)}wireBeans(_){this.ctrlsSvc=_.ctrlsSvc,this.animationFrameSvc=_.animationFrameSvc,this.visibleCols=_.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");let _=this.invalidateVerticalScroll.bind(this),f=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:_,scrollGapChanged:f}),this.addManagedElementListeners(this.eBodyViewport,{scroll:_}),this.ctrlsSvc.whenReady(this,($)=>{this.centerRowsCtrl=$.center,this.fakeVScrollComp=$.fakeVScrollComp,this.fakeHScrollComp=$.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,ff)});for(let _ of f6){let f=this.ctrlsSvc.get(_);this.registerScrollPartner(f,this.onHScroll.bind(this,_))}}addVerticalScrollListeners(){let _=this.gos.get("debounceVerticalScrollbar"),f=_?c0(this,this.onVScroll.bind(this,ff),r2):this.onVScroll.bind(this,ff),$=_?c0(this,this.onVScroll.bind(this,t2),r2):this.onVScroll.bind(this,t2);this.addManagedElementListeners(this.eBodyViewport,{scroll:f}),this.registerScrollPartner(this.fakeVScrollComp,$)}registerScrollPartner(_,f){_.onScrollCallback(f)}onDisplayedColumnsWidthChanged(){if(this.enableRtl)this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(_){if(this.centerRowsCtrl==null)return;if(_===void 0)_=this.centerRowsCtrl.getCenterViewportScrollLeft();this.setScrollLeftForAllContainersExceptCurrent(Math.abs(_))}setScrollLeftForAllContainersExceptCurrent(_){for(let f of[...f6,ff]){if(this.lastScrollSource[1]===f)continue;let $=this.getViewportForSource(f);Fz($,_,this.enableRtl)}}getViewportForSource(_){if(_===ff)return this.centerRowsCtrl.eViewport;return this.ctrlsSvc.get(_).eViewport}isControllingScroll(_,f){if(this.lastScrollSource[f]==null){if(f===0)this.lastScrollSource[0]=_;else this.lastScrollSource[1]=_;return!0}return this.lastScrollSource[f]===_}onHScroll(_){if(!this.isControllingScroll(_,1))return;let f=this.centerRowsCtrl.eViewport,{scrollLeft:$}=f;if(this.shouldBlockScrollUpdate(1,$,!0))return;let z=Lz(this.getViewportForSource(_),this.enableRtl);this.doHorizontalScroll(z),this.resetLastHScrollDebounced()}onVScroll(_){if(!this.isControllingScroll(_,0))return;let f=_===ff?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition(),$=f;if(this.shouldBlockScrollUpdate(0,$,!0))return;if(_===ff)this.fakeVScrollComp.setScrollPosition($);else if(this.eBodyViewport.scrollTop=f,$=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),$!==f)this.fakeVScrollComp.setScrollPosition($,!0);let{animationFrameSvc:z}=this;if(z?.setScrollTop($),this.nextScrollTop=$,z?.active)z.schedule();else this.scrollGridIfNeeded(!0);this.resetLastVScrollDebounced()}doHorizontalScroll(_){let f=this.fakeHScrollComp.getScrollPosition();if(this.scrollLeft===_&&_===f)return;this.scrollLeft=_,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(_),this.centerRowsCtrl.onHorizontalViewportChanged(!0)}isScrolling(){return this.isScrollActive}fireScrollEvent(_){let f={type:"bodyScroll",direction:_===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(f),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...f,type:"bodyScrollEnd"})},$6)}shouldBlockScrollUpdate(_,f,$=!1){if($&&!pf())return!1;if(_===0)return this.shouldBlockVerticalScroll(f);return this.shouldBlockHorizontalScroll(f)}shouldBlockVerticalScroll(_){let f=uz(this.eBodyViewport),{scrollHeight:$}=this.eBodyViewport;return _<0||_+f>$}shouldBlockHorizontalScroll(_){let f=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:$}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(_>0)return!0}else if(_<0)return!0;return Math.abs(_)+f>$}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){let _=this.scrollLeft,f=!1;for(let $ of f6)if(this.getViewportForSource($).scrollLeft!==_){f=!0;break}if(f)this.onHScroll(ff)}scrollGridIfNeeded(_=!1){let f=this.scrollTop!=this.nextScrollTop;if(f){if(this.scrollTop=this.nextScrollTop,_)this.invalidateVerticalScroll();this.redrawRowsAfterScroll()}return f}setHorizontalScrollPosition(_,f=!1){let z=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();if(!f&&this.shouldBlockScrollUpdate(1,_))if(this.enableRtl)_=_>0?0:z;else _=Math.min(Math.max(_,0),z);Fz(this.centerRowsCtrl.eViewport,Math.abs(_),this.enableRtl),this.doHorizontalScroll(_)}setVerticalScrollPosition(_){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=_}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){let{lastOffsetHeight:$,lastScrollTop:z}=this;return{top:z,bottom:z+$}}this.isVerticalPositionInvalidated=!1;let{scrollTop:_,offsetHeight:f}=this.eBodyViewport;return this.lastScrollTop=_,this.lastOffsetHeight=f,{top:_,bottom:_+f}}getApproximateVScollPosition(){if(this.lastScrollTop>=0&&this.lastOffsetHeight>=0)return{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight};return this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){if(this.isHorizontalPositionInvalidated)this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1;return this.lastIsHorizontalScrollShowing}scrollHorizontally(_){let f=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(f+_),this.centerRowsCtrl.eViewport.scrollLeft-f}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(_,f=null){let{rowModel:$}=this.beans,z=$.getRowCount(),Q=-1;for(let J=0;J=0)this.ensureIndexVisible(Q,f)}ensureIndexVisible(_,f,$=0){if(S_(this.gos,"print"))return;let{rowModel:z}=this.beans,Q=z.getRowCount();if(typeof _!=="number"||_<0||_>=Q){j(88,{index:_});return}this.clearRetryListeners();let{frameworkOverrides:J,pageBounds:q,rowContainerHeight:X,rowRenderer:Y}=this.beans;J.wrapIncoming(()=>{let Z=this.ctrlsSvc.getGridBodyCtrl(),G=z.getRow(_),E,U,H=0;this.invalidateVerticalScroll();do{let{stickyTopHeight:W,stickyBottomHeight:B}=Z,K=G.rowTop,L=G.rowHeight,F=q.getPixelOffset(),D=G.rowTop-F,M=D+G.rowHeight,k=this.getVScrollPosition(),R=X.divStretchOffset,O=k.top+R,I=k.bottom+R,T=I-O,y=X.getScrollPositionForPixel(D),i=X.getScrollPositionForPixel(M-T),x=Math.min((y+i)/2,D),a=O+W>D,t=I-BT)u=y-W;else u=i+B;if(u!==null)this.setVerticalScrollPosition(u),Y.redraw({afterScroll:!0});E=K!==G.rowTop||L!==G.rowHeight,U=W!==Z.stickyTopHeight||B!==Z.stickyBottomHeight,H++}while((E||U)&&H<10);if(this.animationFrameSvc?.flushAllFrames(),$<10&&(G?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){let W=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{let B=this.getVScrollPosition().top;if(W===B)return;this.clearRetryListeners()},modelUpdated:()=>{if(this.clearRetryListeners(),_>=z.getRowCount())return;this.ensureIndexVisible(_,f,$+1)}})}})}clearRetryListeners(){for(let _ of this.clearRetryListenerFncs)_();this.clearRetryListenerFncs=[]}ensureColumnVisible(_,f="auto"){let{colModel:$,frameworkOverrides:z}=this.beans,Q=$.getCol(_);if(!Q)return;if(Q.isPinned())return;if(!this.visibleCols.isColDisplayed(Q))return;let J=this.getPositionedHorizontalScroll(Q,f);z.wrapIncoming(()=>{if(J!==null)this.centerRowsCtrl.setCenterViewportScrollLeft(J);this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(_,f){let{columnBeforeStart:$,columnAfterEnd:z}=this.isColumnOutsideViewport(_),Q=this.centerRowsCtrl.getCenterWidth()<_.getActualWidth(),J=this.centerRowsCtrl.getCenterWidth(),q=this.enableRtl,X=(q?$:z)||Q,Y=q?z:$;if(f!=="auto")X=f==="start",Y=f==="end";let Z=f==="middle";if(X||Y||Z){let{colLeft:G,colMiddle:E,colRight:U}=this.getColumnBounds(_);if(Z)return E-J/2;if(X)return q?U:G;return q?G-J:U-J}return null}isColumnOutsideViewport(_){let{start:f,end:$}=this.getViewportBounds(),{colLeft:z,colRight:Q}=this.getColumnBounds(_),J=this.enableRtl,q=J?f>Q:$z;return{columnBeforeStart:q,columnAfterEnd:X}}getColumnBounds(_){let f=this.enableRtl,$=this.visibleCols.bodyWidth,z=_.getActualWidth(),Q=_.getLeft(),J=f?-1:1,q=f?$-Q:Q,X=q+z*J,Y=q+z/2*J;return{colLeft:q,colMiddle:Y,colRight:X}}getViewportBounds(){let _=this.centerRowsCtrl.getCenterWidth(),f=this.centerRowsCtrl.getCenterViewportScrollLeft(),$=f,z=_+f;return{start:$,end:z,width:_}}},l2={horizontal:{overflow:(_)=>_.scrollWidth-_.clientWidth,scrollSize:(_)=>_.scrollWidth,clientSize:(_)=>_.clientWidth,opposite:"vertical"},vertical:{overflow:(_)=>_.scrollHeight-_.clientHeight,scrollSize:(_)=>_.scrollHeight,clientSize:(_)=>_.clientHeight,opposite:"horizontal"}};function KG(_,f,$=KJ()||0,z,Q){return SX(_,f,"horizontal",$,z,Q)}function LG(_,f,$=KJ()||0,z,Q){return SX(_,f,"vertical",$,z,Q)}function SX(_,f,$,z,Q,J){let q=l2[$],X=l2[q.opposite],Y=Q?A_(Q):!0,Z=J?A_(J):!0,G=q.overflow(_);if(G<=0)return!1;if(!f||z===0)return!0;let E=X.overflow(f);if(E<=0)return!0;if(G<=z){if(Y&&Z&&FG({candidateOverflow:E,candidateScrollSize:X.scrollSize(f),candidateClientSize:X.clientSize(f),scrollbarWidth:z}))return!1;let U=q.clientSize(_)+z;return q.scrollSize(_)<=U}return!0}function FG({candidateOverflow:_,candidateScrollSize:f,candidateClientSize:$,scrollbarWidth:z}){if(_<=0||_>z)return!1;let Q=$+z;return f>$&&f<=Q}var DG=class extends A{constructor(_){super();this.centerContainerCtrl=_}wireBeans(_){this.scrollVisibleSvc=_.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCtrl=_.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){let{beans:_,centerContainerCtrl:f,gridBodyCtrl:$}=this,z=()=>{Y0(_,()=>{this.onCenterViewportResized()})};f.registerViewportResizeListener(z),$.registerBodyViewportResizeListener(z)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){let{pinnedCols:_,colFlex:f}=this.beans;_?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();let $=this.centerContainerCtrl.getCenterWidth();if($!==this.centerWidth)this.centerWidth=$,f?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0})}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){let _=this.gridBodyCtrl.eBodyViewport,f=uz(_);if(this.bodyHeight!==f)this.bodyHeight=f,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"})}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;let _={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(_)}onHorizontalViewportChanged(){let{centerContainerCtrl:_,beans:f}=this,$=_.getCenterWidth(),z=_.getViewportScrollLeft();f.colViewport.setScrollPosition($,z)}};function AX(_){if(_.altKey||_.ctrlKey||_.metaKey)return!1;return _.key?.length===1}function Ez(_,f,$,z){let Q=f.getColDef().cellRendererParams?.suppressMouseEventHandling;return RX(_,f,$,z,Q)}function MG(_,f,$,z){let Q=f?.suppressMouseEventHandling;return RX(_,void 0,$,z,Q)}function RX(_,f,$,z,Q){if(!Q)return!1;return Q(C(_,{column:f,node:$,event:z}))}function jX(_,f,$){let z=f;while(z){let Q=Tq(_,z,$);if(Q)return Q;z=z.parentElement}return null}var Vz="cellCtrl";function P$(_,f){return jX(_,f,Vz)}var Oz="renderedRow";function vJ(_,f){return jX(_,f,Oz)}function y6(_,f,$,z,Q){let J=z?z.getColDef().suppressKeyboardEvent:void 0;if(!J)return!1;let q=C(_,{event:f,editing:Q,column:z,node:$,data:$.data,colDef:z.getColDef()});if(J){if(J(q))return!0}return!1}function kG(_){let{pinnedRowModel:f,rowModel:$,rangeSvc:z,visibleCols:Q}=_;if(!z||Q.allCols.length===0)return;let J=f?.isEmpty("top")??!0,q=f?.isEmpty("bottom")??!0,X=J?null:"top",Y,Z;if(q)Y=null,Z=$.getRowCount()-1;else Y="bottom",Z=f?.getPinnedBottomRowCount()??-1;z.setCellRange({rowStartIndex:0,rowStartPinned:X,rowEndIndex:Z,rowEndPinned:Y})}var SG=class extends A{constructor(_){super();this.element=_}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){let f=this.processKeyboardEvent.bind(this,"keydown");this.addManagedElementListeners(this.element,{["keydown"]:f})}addMouseListeners(){let _="mousedown";if(D6("pointerdown"))_="pointerdown";else if(D6("touchstart"))_="touchstart";let f=["dblclick","contextmenu","mouseover","mouseout","click",_];for(let $ of f){let z=this.processMouseEvent.bind(this,$);this.addManagedElementListeners(this.element,{[$]:z})}}processMouseEvent(_,f){if(!J$(this.beans,f)||z0(f))return;let{cellCtrl:$,rowCtrl:z}=this.getControlsForEventTarget(f.target);if(_==="contextmenu"){if($?.column)$.dispatchCellContextMenuEvent(f);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(f,void 0,z,$)}else{if($)$.onMouseEvent(_,f);if(z)z.onMouseEvent(_,f)}}getControlsForEventTarget(_){let{gos:f}=this;return{cellCtrl:P$(f,_),rowCtrl:vJ(f,_)}}processKeyboardEvent(_,f){let{cellCtrl:$,rowCtrl:z}=this.getControlsForEventTarget(f.target);if(f.defaultPrevented)return;if($)this.processCellKeyboardEvent($,_,f);else if(z?.isFullWidth())this.processFullWidthRowKeyboardEvent(z,_,f)}processCellKeyboardEvent(_,f,$){let z=this.editSvc?.isEditing(_,{withOpenEditor:!0})??!1;if(!y6(this.gos,$,_.rowNode,_.column,z)){if(f==="keydown"){if(!(!z&&this.beans.navigation?.handlePageScrollingKey($)))_.onKeyDown($);if(this.doGridOperations($,z),AX($))_.processCharacter($)}}if(f==="keydown")this.eventSvc.dispatchEvent(_.createEvent($,"cellKeyDown"))}processFullWidthRowKeyboardEvent(_,f,$){let{rowNode:z}=_,{focusSvc:Q,navigation:J}=this.beans,X=Q.getFocusedCell()?.column;if(!y6(this.gos,$,z,X,!1)){let Z=$.key;if(f==="keydown")switch(Z){case S.PAGE_HOME:case S.PAGE_END:case S.PAGE_UP:case S.PAGE_DOWN:J?.handlePageScrollingKey($,!0);break;case S.LEFT:case S.RIGHT:if(!this.gos.get("embedFullWidthRows"))break;case S.UP:case S.DOWN:_.onKeyboardNavigate($);break;case S.TAB:_.onTabKeyDown($);break;default:}}if(f==="keydown")this.eventSvc.dispatchEvent(_.createRowEvent("cellKeyDown",$))}doGridOperations(_,f){if(!_.ctrlKey&&!_.metaKey)return;if(f)return;if(!J$(this.beans,_))return;let $=lq(_),{clipboardSvc:z,undoRedo:Q}=this.beans;if($===S.A)return this.onCtrlAndA(_);if($===S.C)return this.onCtrlAndC(z,_);if($===S.D)return this.onCtrlAndD(z,_);if($===S.V)return this.onCtrlAndV(z,_);if($===S.X)return this.onCtrlAndX(z,_);if($===S.Y)return this.onCtrlAndY(Q);if($===S.Z)return this.onCtrlAndZ(Q,_)}onCtrlAndA(_){let{beans:{rowModel:f,rangeSvc:$,selectionSvc:z},gos:Q}=this;if($&&i_(Q)&&!W7(Q)&&f.isRowsToRender())kG(this.beans);else if(z)z.selectAllRowNodes({source:"keyboardSelectAll",selectAll:wq(Q)});_.preventDefault()}onCtrlAndC(_,f){if(!_||this.gos.get("enableCellTextSelection"))return;let{cellCtrl:$}=this.getControlsForEventTarget(f.target);if(this.editSvc?.isEditing($,{withOpenEditor:!0}))return;f.preventDefault(),_.copyToClipboard()}onCtrlAndX(_,f){if(!_||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;let{cellCtrl:$}=this.getControlsForEventTarget(f.target);if(this.editSvc?.isEditing($,{withOpenEditor:!0}))return;f.preventDefault(),_.cutToClipboard(void 0,"ui")}onCtrlAndV(_,f){let{cellCtrl:$}=this.getControlsForEventTarget(f.target);if(this.editSvc?.isEditing($,{withOpenEditor:!0}))return;if(_&&!this.gos.get("suppressClipboardPaste"))_.pasteFromClipboard()}onCtrlAndD(_,f){if(_&&!this.gos.get("suppressClipboardPaste"))_.copyRangeDown();f.preventDefault()}onCtrlAndZ(_,f){if(!this.gos.get("undoRedoCellEditing")||!_)return;if(f.preventDefault(),f.shiftKey)_.redo("ui");else _.undo("ui")}onCtrlAndY(_){_?.redo("ui")}},o$=(_)=>_.topRowCtrls,e$=(_)=>_.getStickyTopRowCtrls(),_z=(_)=>_.getStickyBottomRowCtrls(),fz=(_)=>_.bottomRowCtrls,$z=(_)=>_.allRowCtrls,z6=(_)=>_.getCtrls("top"),Q6=(_)=>_.getCtrls("center"),J6=(_)=>_.getCtrls("bottom"),AG={center:{type:"center",name:"center-cols",getRowCtrls:$z,getSpannedRowCtrls:Q6},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:$z,getSpannedRowCtrls:Q6},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:$z,getSpannedRowCtrls:Q6},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:$z},topCenter:{type:"center",name:"floating-top",getRowCtrls:o$,getSpannedRowCtrls:z6},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:o$,getSpannedRowCtrls:z6},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:o$,getSpannedRowCtrls:z6},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:o$},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:e$},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:e$},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:e$},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:e$},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:_z},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:_z},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:_z},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:_z},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:fz,getSpannedRowCtrls:J6},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:fz,getSpannedRowCtrls:J6},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:fz,getSpannedRowCtrls:J6},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:fz}};function VX(_){return`ag-${v$(_).name}-viewport`}function OX(_){let f=v$(_);return f.container??`ag-${f.name}-container`}function RG(_){return`ag-${v$(_).name}-spanned-cells-container`}function v$(_){return AG[_]}var jG=["topCenter","topLeft","topRight"],VG=["bottomCenter","bottomLeft","bottomRight"],OG=["center","left","right"],PG=["center","left","right","fullWidth"],vG=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],TG=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],IG=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],PX=["stickyTopCenter","stickyTopLeft","stickyTopRight"],vX=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],yG=[...PX,"stickyTopFullWidth",...vX,"stickyBottomFullWidth"],bG=[...jG,...VG,...OG,...PX,...vX],CG=class extends A{constructor(_){super();this.name=_,this.visible=!0,this.EMPTY_CTRLS=[],this.options=v$(_)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new DG(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(_){this.comp.setOffsetTop(`${_.offset}px`)}registerWithCtrlsService(){if(this.options.fullWidth)return;this.beans.ctrlsSvc.register(this.name,this)}forContainers(_,f){if(_.indexOf(this.name)>=0)f()}setComp(_,f,$,z){this.comp=_,this.eContainer=f,this.eSpannedContainer=$,this.eViewport=z,this.createManagedBean(new SG(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();let{pinnedCols:Q,rangeSvc:J}=this.beans,q=()=>this.onPinnedWidthChanged();if(this.forContainers(TG,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(Q?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:q})}),this.forContainers(IG,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(Q?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:q})}),this.forContainers(PG,()=>this.createManagedBean(new kX(this.eContainer,this.name==="center"?z:void 0))),J)this.forContainers(bG,()=>this.createManagedBean(J.createDragListenerFeature(this.eContainer)));this.forContainers(vG,()=>this.createManagedBean(new jJ((X)=>this.comp.setContainerWidth(`${X}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(_){this.addManagedElementListeners(this.eViewport,{scroll:_})}addListeners(){let{spannedRowRenderer:_,gos:f}=this.beans,$=this.onDisplayedColumnsChanged.bind(this);if(this.addManagedEventListeners({displayedColumnsChanged:$,displayedColumnsWidthChanged:$,displayedRowsChanged:(z)=>this.onDisplayedRowsChanged(z.afterScroll)}),$(),this.onDisplayedRowsChanged(),_&&this.options.getSpannedRowCtrls&&f.get("enableCellSpan"))this.addManagedListeners(_,{spannedRowsUpdated:()=>{let z=this.options.getSpannedRowCtrls(_);if(!z)return;this.comp.setSpannedRowCtrls(z,!1)}})}listenOnDomOrder(){if(yG.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}let f=()=>{let $=this.gos.get("ensureDomOrder"),z=S_(this.gos,"print");this.comp.setDomOrder($||z)};this.addManagedPropertyListener("domLayout",f),f()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){let{dragSvc:_}=this.beans;if(!_)return;let f=($)=>{if(_.dragging){if($.cancelable)$.preventDefault()}};this.eContainer.addEventListener("touchmove",f,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",f))}onHorizontalViewportChanged(_=!1){let f=this.getCenterWidth(),$=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(f,$,_)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return df(this.eViewport)}getCenterViewportScrollLeft(){return Lz(this.eViewport,this.enableRtl)}registerViewportResizeListener(_){let f=S0(this.beans,this.eViewport,_);this.addDestroyFunc(()=>f())}isViewportInTheDOMTree(){return Xq(this.eViewport)}getViewportScrollLeft(){return Lz(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){let{beans:_,gos:f,eViewport:$}=this,z=f.get("alwaysShowHorizontalScroll"),{ctrlsSvc:Q}=_,J=Q.getGridBodyCtrl()?.eBodyViewport,q=Q.get("fakeHScrollComp")?.getGui(),X=Q.get("fakeVScrollComp")?.getGui();return z||KG($,J,void 0,q,X)}setHorizontalScroll(_){this.comp.setHorizontalScroll(_)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(_){Fz(this.eViewport,_,this.enableRtl)}isContainerVisible(){return this.options.pinnedType==null||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){let _=this.isContainerVisible();if(this.visible!=_)this.visible=_,this.onDisplayedRowsChanged()}onDisplayedRowsChanged(_=!1){let f=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||f.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}let $=S_(this.gos,"print"),Q=this.gos.get("embedFullWidthRows")||$,J=f.filter((q)=>{let X=q.isFullWidth();return this.options.fullWidth?!Q&&X:Q||!X});this.comp.setRowCtrls({rowCtrls:J,useFlushSync:_})}},TX="ag-force-vertical-scroll",wG="ag-selectable",xG="ag-column-moving",NG=class extends A{constructor(){super(...arguments);this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(_){this.ctrlsSvc=_.ctrlsSvc,this.colModel=_.colModel,this.scrollVisibleSvc=_.scrollVisibleSvc,this.pinnedRowModel=_.pinnedRowModel,this.filterManager=_.filterManager,this.rowGroupColsSvc=_.rowGroupColsSvc}setComp(_,f,$,z,Q,J,q){this.comp=_,this.eGridBody=f,this.eBodyViewport=$,this.eTop=z,this.eBottom=Q,this.eStickyTop=J,this.eStickyBottom=q,this.eCenterColsViewport=$.querySelector(`.${VX("center")}`),this.eFullWidthContainer=$.querySelector(`.${OX("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(X)=>this.setCellTextSelection(X.currentValue)),this.createManagedBean(new PJ(this.comp)),this.scrollFeature=this.createManagedBean(new BG($)),this.beans.rowDragSvc?.setupRowDrag($,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([z,$,Q,J,q]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(z),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){let _=this.setFloatingHeights.bind(this),f=this.setGridRootRole.bind(this),$=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:_,pinnedHeightChanged:_,pinnedRowsChanged:_,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:f,columnPivotChanged:f,rowResizeStarted:$,rowResizeEnded:$}),this.addManagedPropertyListener("treeData",f)}toggleRowResizeStyles(_){let f=_.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",f)}onGridColumnsChanged(){let _=this.beans.colModel.getCols();this.comp.setColumnCount(_.length)}onScrollVisibilityChanged(){let{scrollVisibleSvc:_}=this,f=_.verticalScrollShowing;this.setVerticalScrollPaddingVisible(f),this.setStickyWidth(f),this.setStickyBottomOffsetBottom();let $=f?_.getScrollbarWidth()||0:0,z=QX()?16:0,Q=`calc(100% + ${$+z}px)`;Y0(this.beans,()=>this.comp.setBodyViewportWidth(Q)),this.updateScrollingClasses()}setGridRootRole(){let{rowGroupColsSvc:_,colModel:f,gos:$}=this,z=$.get("treeData");if(!z){let Q=f.isPivotMode();z=(!_?0:_.columns.length)>=(Q?2:1)}this.comp.setGridRootRole(z?"treegrid":"grid")}addFocusListeners(_){for(let f of _)this.addManagedElementListeners(f,{focusin:($)=>{let{target:z}=$,Q=uf(z,"ag-root",f);f.classList.toggle("ag-has-focus",!Q)},focusout:($)=>{let{target:z,relatedTarget:Q}=$,J=f.contains(Q),q=uf(Q,"ag-root",f);if(uf(z,"ag-root",f))return;if(!J||q)f.classList.remove("ag-has-focus")}})}setColumnMovingCss(_){this.comp.setColumnMovingCss(xG,_)}setCellTextSelection(_=!1){this.comp.setCellSelectableCss(wG,_)}updateScrollingClasses(){let{eGridBody:{classList:_},scrollVisibleSvc:f}=this;_.toggle("ag-body-vertical-content-no-gap",!f.verticalScrollGap),_.toggle("ag-body-horizontal-content-no-gap",!f.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:(_)=>{if(_.target instanceof HTMLImageElement)return _.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){let _=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:f}=this.beans,$=f.isLastRowIndexKnown()?f.getRowCount():-1,z=$===-1?-1:_+$;this.comp.setRowCount(z)}registerBodyViewportResizeListener(_){this.comp.registerBodyViewportResizeListener(_)}setVerticalScrollPaddingVisible(_){let f=_?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(f)}isVerticalScrollShowing(){let{gos:_,comp:f,ctrlsSvc:$}=this,z=_.get("alwaysShowVerticalScroll"),Q=z?TX:null,J=S_(_,"normal");f.setAlwaysVerticalScrollClass(Q,z);let q=$.get("center")?.eViewport,X=$.get("fakeHScrollComp")?.getGui(),Y=$.get("fakeVScrollComp")?.getGui();return z||J&&LG(this.eBodyViewport,q,void 0,Y,X)}setupRowAnimationCssClass(){let{rowContainerHeight:_,environment:f}=this.beans,$=f.sizesMeasured,z=()=>{let Q=$&&S1(this.gos)&&!_.stretching,J=Q?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(J,Q)};z(),this.addManagedEventListeners({heightScaleChanged:z}),this.addManagedPropertyListener("animateRows",z),this.addManagedEventListeners({stylesChanged:()=>{if(!$&&f.sizesMeasured)$=!0,z()}})}addBodyViewportListener(){let{eBodyViewport:_,eStickyTop:f,eStickyBottom:$,eTop:z,eBottom:Q,beans:{popupSvc:J,touchSvc:q}}=this,X=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(_,{contextmenu:X}),q?.mockBodyContextMenu(this,X),this.addManagedElementListeners(_,{wheel:this.onBodyViewportWheel.bind(this,J)});let Y=this.onStickyWheel.bind(this);for(let G of[f,$,z,Q])this.addManagedElementListeners(G,{wheel:Y});let Z=this.onHorizontalWheel.bind(this);for(let G of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(G).eContainer,{wheel:Z});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:(_)=>this.onFullWidthContainerWheel(_)})}onFullWidthContainerWheel(_){let{deltaX:f,deltaY:$,shiftKey:z}=_;if((z||Math.abs(f)>Math.abs($))&&J$(this.beans,_))this.scrollGridBodyToMatchEvent(_)}onStickyWheel(_){let{deltaY:f}=_;if(this.scrollVertically(f)>0)_.preventDefault()}onHorizontalWheel(_){let{deltaX:f,deltaY:$,shiftKey:z}=_;if(!(z||Math.abs(f)>Math.abs($)))return;this.scrollGridBodyToMatchEvent(_)}scrollGridBodyToMatchEvent(_){let{deltaX:f,deltaY:$}=_;_.preventDefault(),this.eCenterColsViewport.scrollBy({left:f||$})}onBodyViewportContextMenu(_,f,$){if(!_&&!$)return;if(this.gos.get("preventDefaultOnContextMenu"))(_||$).preventDefault();let{target:z}=_||f;if(z===this.eBodyViewport||z===this.ctrlsSvc.get("center").eViewport)this.beans.contextMenuSvc?.showContextMenu({mouseEvent:_,touchEvent:$,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(_,f){if(!this.gos.get("suppressScrollWhenPopupsAreOpen"))return;if(_?.hasAnchoredPopup())f.preventDefault()}scrollVertically(_){let f=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(f+_),this.eBodyViewport.scrollTop-f}setFloatingHeights(){let{pinnedRowModel:_,beans:{environment:f}}=this,$=_?.getPinnedTopTotalHeight(),z=_?.getPinnedBottomTotalHeight(),Q=f.getPinnedRowBorderWidth(),J=f.getRowBorderWidth(),q=Q-J,X=!$?0:q+$,Y=!z?0:q+z;this.comp.setTopHeight(X),this.comp.setBottomHeight(Y),this.comp.setTopInvisible(X<=0),this.comp.setBottomInvisible(Y<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(_=0){this.comp.setStickyTopHeight(`${_}px`),this.stickyTopHeight=_}setStickyBottomHeight(_=0){this.comp.setStickyBottomHeight(`${_}px`),this.stickyBottomHeight=_}setStickyWidth(_){if(!_)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{let f=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${f}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${f}px)`)}}setStickyTopOffsetTop(){let f=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),$=this.pinnedRowModel?.getPinnedTopTotalHeight()??0,z=0;if(f>0)z+=f;if($>0)z+=$;if(z>0)z+=1;this.comp.setStickyTopTop(`${z}px`)}setStickyBottomOffsetBottom(){let{pinnedRowModel:_,scrollVisibleSvc:f,comp:$}=this,z=_?.getPinnedBottomTotalHeight()??0,J=f.horizontalScrollShowing?f.getScrollbarWidth()||0:0,q=z+J;$.setStickyBottomBottom(`${q}px`)}};function z_(_){return B_(_)}var gG=class extends w{constructor(_,f,$,z,Q){super();this.cellCtrl=f,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=_,this.gos=_.gos,this.column=f.column,this.rowNode=f.rowNode,this.eRow=z;let J=z_({tag:"div",role:f.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":f.column.colIdSanitised}});this.eCell=J;let q;if(f.isCellSpanning())q=z_({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),q.appendChild(J),this.setTemplateFromElement(q);else this.setTemplateFromElement(J);this.cellCssManager=new fX(()=>J),this.forceWrapper=f.isForceWrapper(),this.refreshWrapper(!1);let X={toggleCss:(Y,Z)=>this.cellCssManager.toggleCss(Y,Z),setUserStyles:(Y)=>F$(J,Y),getFocusableElement:()=>J,setIncludeSelection:(Y)=>this.includeSelection=Y,setIncludeRowDrag:(Y)=>this.includeRowDrag=Y,setIncludeDndSource:(Y)=>this.includeDndSource=Y,setRowResizerElement:(Y)=>this.setRowResizerElement(Y),setRenderDetails:(Y,Z,G)=>this.setRenderDetails(Y,Z,G),setEditDetails:(Y,Z,G)=>this.setEditDetails(Y,Z,G),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(Y,Z)=>this.refreshEditStyles(Y,Z)};f.setComp(X,J,q,this.eCellWrapper,$,Q,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(_){if(this.rowResizerElement)T_(this.rowResizerElement);if(this.rowResizerElement=_,_)this.eCell.appendChild(_)}setRenderDetails(_,f,$){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;let Q=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),_){if(!($||Q?!1:this.refreshCellRenderer(_)))this.destroyRenderer(),this.createCellRendererInstance(_)}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(f);if(this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement)this.eCell.appendChild(this.rowResizerElement)}setEditDetails(_,f,$){if(_)this.createCellEditorInstance(_,f,$);else this.destroyEditor()}removeControls(){let _=this.beans.context;this.checkboxSelectionComp=_.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=_.destroyBean(this.dndSourceComp),this.rowDraggingComp=_.destroyBean(this.rowDraggingComp)}refreshWrapper(_){let f=this.includeRowDrag||this.includeDndSource||this.includeSelection,$=f||this.forceWrapper,z=$&&this.eCellWrapper==null;if(z)this.eCellWrapper=z_({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper);let Q=!$&&this.eCellWrapper!=null;if(Q)T_(this.eCellWrapper),this.eCellWrapper=void 0;this.cellCssManager.toggleCss("ag-cell-value",!$);let J=!_&&$,q=J&&this.eCellValue==null;if(q){let Z=this.cellCtrl.getCellValueClass();this.eCellValue=z_({tag:"span",cls:Z,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}let X=!J&&this.eCellValue!=null;if(X)T_(this.eCellValue),this.eCellValue=void 0;let Y=z||Q||q||X;if(Y)this.removeControls();if(!_&&f)this.addControls();return Y}addControls(){let{cellCtrl:_,eCellWrapper:f,eCellValue:$,includeRowDrag:z,includeDndSource:Q,includeSelection:J}=this,q=(X)=>{if(X)f.insertBefore(X.getGui(),$)};if(z&&this.rowDraggingComp==null)this.rowDraggingComp=_.createRowDragComp(),q(this.rowDraggingComp);if(Q&&this.dndSourceComp==null)this.dndSourceComp=_.createDndSource(),q(this.dndSourceComp);if(J&&this.checkboxSelectionComp==null)this.checkboxSelectionComp=_.createSelectionCheckbox(),q(this.checkboxSelectionComp)}createCellEditorInstance(_,f,$){let z=this.editorVersion,Q=_.newAgStackInstance(),{params:J}=_;if(Q.then((X)=>this.afterCellEditorCreated(z,X,J,f,$)),n(this.cellEditor)&&J.cellStartedEdit)this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(_){let f=this.getParentOfValue();f_(f);let $=L$(_);if($!=null)f.textContent=$}destroyRenderer(){let{context:_}=this.beans;this.cellRenderer=_.destroyBean(this.cellRenderer),T_(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){let{context:_}=this.beans;if(this.cellEditorPopupWrapper?.getGui().contains(d(this.beans))||this.cellCtrl.hasBrowserFocus())this.eCell.focus({preventScroll:!0});this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=_.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=_.destroyBean(this.cellEditorPopupWrapper),T_(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(_){if(this.cellRenderer?.refresh==null)return!1;if(this.cellRendererClass!==_.componentClass)return!1;let f=this.cellRenderer.refresh(_.params);return f===!0||f===void 0}createCellRendererInstance(_){let f=this.rendererVersion,$=(J)=>(q)=>{if(this.rendererVersion!==f||!this.isAlive())return;let Y=J.newAgStackInstance(),Z=this.afterCellRendererCreated.bind(this,f,J.componentClass);Y?.then(Z)},{animationFrameSvc:z}=this.beans,Q;if(z?.active&&this.firstRender)Q=(J,q=!1)=>{z.createTask($(J),this.rowNode.rowIndex,"p2",J.componentFromFramework,q)};else Q=(J)=>$(J)();if(_.params?.deferRender&&!this.cellCtrl.rowNode.group){let{loadingComp:J,onReady:q}=this.cellCtrl.getDeferLoadingCellRenderer();if(J)Q(J),q.then(()=>Q(_,!0))}else Q(_)}afterCellRendererCreated(_,f,$){if(!this.isAlive()||_!==this.rendererVersion){this.beans.context.destroyBean($);return}this.cellRenderer=$,this.cellRendererClass=f;let Q=$.getGui();if(this.cellRendererGui=Q,Q!=null){let J=this.getParentOfValue();f_(J),J.appendChild(Q)}}afterCellEditorCreated(_,f,$,z,Q){let J=_!==this.editorVersion,{context:q}=this.beans;if(J){q.destroyBean(f);return}if(f.isCancelBeforeStart?.()){q.destroyBean(f),this.cellCtrl.stopEditing(!0);return}if(!f.getGui){j(97,{colId:this.column.getId()}),q.destroyBean(f);return}this.cellEditor=f,this.cellEditorGui=f.getGui();let Y=z||f.isPopup?.();if(Y)this.addPopupCellEditor($,Q);else this.addInCellEditor();this.refreshEditStyles(!0,Y),f.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(f),this.cellCtrl.cellEditorAttached()}refreshEditStyles(_,f){let{cellCssManager:$}=this;$.toggleCss("ag-cell-inline-editing",_&&!f),$.toggleCss("ag-cell-popup-editing",_&&!!f),$.toggleCss("ag-cell-not-inline-editing",!_||!!f)}addInCellEditor(){let{eCell:_}=this;if(_.contains(d(this.beans)))_.focus();if(this.destroyRenderer(),this.refreshWrapper(!0),f_(this.getParentOfValue()),this.cellEditorGui)this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(_,f){let{gos:$,context:z,popupSvc:Q,editSvc:J}=this.beans;if($.get("editType")==="fullRow")j(98);let q=this.cellEditorPopupWrapper=z.createBean(J.createPopupEditorWrapper(_)),{cellEditor:X,cellEditorGui:Y,eCell:Z,rowNode:G,column:E,cellCtrl:U}=this,H=q.getGui();if(Y)H.appendChild(Y);let W=$.get("stopEditingWhenCellsLoseFocus"),B=f!=null?f:X.getPopupPosition?.()??"over",K=$.get("enableRtl"),L={ePopup:H,additionalParams:{column:E,rowNode:G},type:"popupCellEditor",eventSource:Z,position:B,alignSide:K?"right":"left",keepWithinBounds:!0},F=Q.positionPopupByComponent.bind(Q,L),D=Q.addPopup({modal:W,eChild:H,closeOnEsc:!0,closedCallback:(M)=>{U.onPopupEditorClosed(M)},anchorToElement:Z,positionCallback:F,ariaOwns:Z});if(D)this.hideEditorPopup=D.hideFunc}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},hG=class extends w{constructor(_,f,$){super();this.cellComps=new Map,this.beans=f,this.rowCtrl=_;let z=z_({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(z,$),this.setTemplateFromElement(z);let Q=z.style;this.domOrder=this.rowCtrl.getDomOrder();let J={setDomOrder:(q)=>this.domOrder=q,setCellCtrls:(q)=>this.setCellCtrls(q),showFullWidth:(q)=>this.showFullWidth(q),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(q,X)=>this.toggleCss(q,X),setUserStyles:(q)=>F$(z,q),setTop:(q)=>Q.top=q,setTransform:(q)=>Q.transform=q,setRowIndex:(q)=>z.setAttribute("row-index",q),setRowId:(q)=>z.setAttribute("row-id",q),setRowBusinessKey:(q)=>z.setAttribute("row-business-key",q),refreshFullWidth:(q)=>{let X=q();return this.fullWidthCellRendererParams=X,this.fullWidthCellRenderer?.refresh?.(X)??!1}};_.setComp(J,this.getGui(),$,void 0),this.addDestroyFunc(()=>{_.unsetComp($)})}setInitialStyle(_,f){let $=this.rowCtrl.getInitialTransform(f);if($)_.style.setProperty("transform",$);else{let z=this.rowCtrl.getInitialRowTop(f);if(z)_.style.setProperty("top",z)}}showFullWidth(_){let f=(z)=>{if(this.isAlive()){let Q=z.getGui();this.getGui().appendChild(Q),this.rowCtrl.setupDetailRowAutoHeight(Q),this.setFullWidthRowComp(z,_.params)}else this.beans.context.destroyBean(z)};_.newAgStackInstance().then(f)}setCellCtrls(_){let f=new Map(this.cellComps);for(let $ of _){let z=$.instanceId;if(!this.cellComps.has(z))this.newCellComp($);else f.delete(z)}this.destroyCells(f),this.ensureDomOrder(_)}ensureDomOrder(_){if(!this.domOrder)return;let f=[];for(let $ of _){let z=this.cellComps.get($.instanceId);if(z)f.push(z.getGui())}Zq(this.getGui(),f)}newCellComp(_){let f=this.beans.editSvc?.isEditing(_,{withOpenEditor:!0})??!1,$=new gG(this.beans,_,this.rowCtrl.printLayout,this.getGui(),f);this.cellComps.set(_.instanceId,$),this.getGui().appendChild($.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(_,f){this.fullWidthCellRenderer=_,this.fullWidthCellRendererParams=f,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(_){for(let f of _.values()){if(!f)continue;let $=f.cellCtrl.instanceId;if(this.cellComps.get($)!==f)continue;f.detach(),f.destroy(),this.cellComps.delete($)}}};function uG(_,f,$){let z=!!$.gos.get("enableCellSpan")&&!!f.getSpannedRowCtrls,Q={tag:"div",ref:"eContainer",cls:OX(_),role:"rowgroup"};if(f.type==="center"||z){let J={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${RG(_)}`,role:"presentation"};return Q.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${VX(_)}`,role:"rowgroup",children:[Q,z?J:null]}}return Q}var iG=class extends w{constructor(_){super();this.eViewport=V,this.eContainer=V,this.eSpannedContainer=V,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=_?.name,this.options=v$(this.name)}postConstruct(){this.setTemplate(uG(this.name,this.options,this.beans));let _={setHorizontalScroll:($)=>this.eViewport.scrollLeft=$,setViewportHeight:($)=>this.eViewport.style.height=$,setRowCtrls:({rowCtrls:$})=>this.setRowCtrls($),setSpannedRowCtrls:($)=>this.setRowCtrls($,!0),setDomOrder:($)=>{this.domOrder=$},setContainerWidth:($)=>{if(this.eContainer.style.width=$,this.eSpannedContainer)this.eSpannedContainer.style.width=$},setOffsetTop:($)=>{let z=`translateY(${$})`;if(this.eContainer.style.transform=z,this.eSpannedContainer)this.eSpannedContainer.style.transform=z}};this.createManagedBean(new CG(this.name)).setComp(_,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(_,f){let{beans:$,options:z}=this,Q=f?this.eSpannedContainer:this.eContainer,J=f?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},q={};if(f)this.rowCompsWithSpan=q;else this.rowCompsNoSpan=q;this.lastPlacedElement=null;let X=[];for(let Y of _){let Z=Y.instanceId,G=J[Z],E;if(G)E=G,delete J[Z];else{if(!Y.rowNode.displayed)continue;E=new hG(Y,$,z.type)}q[Z]=E,X.push([E,!G])}this.removeOldRows(Object.values(J)),this.addRowNodes(X,Q)}addRowNodes(_,f){let{domOrder:$}=this;for(let[z,Q]of _){let J=z.getGui();if(!$){if(Q)f.appendChild(J)}else this.ensureDomOrder(J,f)}}removeOldRows(_){for(let f of _)f.getGui().remove(),f.destroy()}ensureDomOrder(_,f){Yq(f,_,this.lastPlacedElement),this.lastPlacedElement=_}},mG={selector:"AG-ROW-CONTAINER",component:iG};function d1(_,f){return f.map(($)=>{let z=`e${$[0].toUpperCase()+$.substring(1)}RowContainer`;return _[z]={name:$},{tag:"ag-row-container",ref:z,attrs:{name:$}}})}function cG(_){let f={},$={tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:d1(f,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:d1(f,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:d1(f,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:d1(f,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:d1(f,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},_?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:f,elementParams:$}}var pG=class extends w{constructor(){super(...arguments);this.eGridRoot=V,this.eBodyViewport=V,this.eStickyTop=V,this.eStickyBottom=V,this.eTop=V,this.eBottom=V,this.eBody=V}postConstruct(){let{overlays:_,rangeSvc:f}=this.beans,$=_?.getOverlayWrapperSelector(),{paramsMap:z,elementParams:Q}=cG(!!$);this.setTemplate(Q,[...$?[$]:[],EG,WG,YG,mG],z);let J=(X,Y)=>{let Z=`${X}px`;Y.style.minHeight=Z,Y.style.height=Z},q={setRowAnimationCssOnBodyViewport:(X,Y)=>this.setRowAnimationCssOnBodyViewport(X,Y),setColumnCount:(X)=>L4(this.getGui(),X),setRowCount:(X)=>K4(this.getGui(),X),setTopHeight:(X)=>J(X,this.eTop),setBottomHeight:(X)=>J(X,this.eBottom),setTopInvisible:(X)=>this.eTop.classList.toggle("ag-invisible",X),setBottomInvisible:(X)=>this.eBottom.classList.toggle("ag-invisible",X),setStickyTopHeight:(X)=>this.eStickyTop.style.height=X,setStickyTopTop:(X)=>this.eStickyTop.style.top=X,setStickyTopWidth:(X)=>this.eStickyTop.style.width=X,setStickyBottomHeight:(X)=>{this.eStickyBottom.style.height=X,this.eStickyBottom.classList.toggle("ag-invisible",X==="0px")},setStickyBottomBottom:(X)=>this.eStickyBottom.style.bottom=X,setStickyBottomWidth:(X)=>this.eStickyBottom.style.width=X,setColumnMovingCss:(X,Y)=>this.toggleCss(X,Y),updateLayoutClasses:(X,Y)=>{let Z=[this.eBodyViewport.classList,this.eBody.classList];for(let G of Z)G.toggle(B0.AUTO_HEIGHT,Y.autoHeight),G.toggle(B0.NORMAL,Y.normal),G.toggle(B0.PRINT,Y.print);this.toggleCss(B0.AUTO_HEIGHT,Y.autoHeight),this.toggleCss(B0.NORMAL,Y.normal),this.toggleCss(B0.PRINT,Y.print)},setAlwaysVerticalScrollClass:(X,Y)=>this.eBodyViewport.classList.toggle(TX,Y),registerBodyViewportResizeListener:(X)=>{let Y=S0(this.beans,this.eBodyViewport,X);this.addDestroyFunc(()=>Y())},setPinnedTopBottomOverflowY:(X)=>this.eTop.style.overflowY=this.eBottom.style.overflowY=X,setCellSelectableCss:(X,Y)=>{for(let Z of[this.eTop,this.eBodyViewport,this.eBottom])Z.classList.toggle(X,Y)},setBodyViewportWidth:(X)=>this.eBodyViewport.style.width=X,setGridRootRole:(X)=>Z_(this.eGridRoot,X)};if(this.ctrl=this.createManagedBean(new NG),this.ctrl.setComp(q,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),f&&i_(this.gos)||Z$(this.gos))B4(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(_,f){let $=this.eBodyViewport.classList;$.toggle("ag-row-animation",f),$.toggle("ag-row-no-animation",!f)}getFocusableContainerName(){return"gridBody"}},nG={selector:"AG-GRID-BODY",component:pG},o1={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},dG=class extends j_{constructor(_,f){super();this.stopPropagationCallbacks=f,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;let{comp:$,eTopGuard:z,eBottomGuard:Q,focusTrapActive:J,forceFocusOutWhenTabGuardsAreEmpty:q,isFocusableContainer:X,focusInnerElement:Y,onFocusIn:Z,onFocusOut:G,shouldStopEventPropagation:E,onTabKeyDown:U,handleKeyDown:H,isEmpty:W,eFocusableElement:B}=_;this.comp=$,this.eTopGuard=z,this.eBottomGuard=Q,this.providedFocusInnerElement=Y,this.eFocusableElement=B,this.focusTrapActive=!!J,this.forceFocusOutWhenTabGuardsAreEmpty=!!q,this.isFocusableContainer=!!X,this.providedFocusIn=Z,this.providedFocusOut=G,this.providedShouldStopEventPropagation=E,this.providedOnTabKeyDown=U,this.providedHandleKeyDown=H,this.providedIsEmpty=W}postConstruct(){this.createManagedBean(new JX(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.handleKeyDown(_),onFocusIn:(_)=>this.onFocusIn(_),onFocusOut:(_)=>this.onFocusOut(_)})),this.activateTabGuards();for(let _ of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(_,{focus:this.onFocus.bind(this)})}handleKeyDown(_){if(this.providedHandleKeyDown)this.providedHandleKeyDown(_)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){if(this.providedShouldStopEventPropagation)return this.providedShouldStopEventPropagation();return!1}activateTabGuards(){if(this.forcingFocusOut)return;let _=this.gos.get("tabIndex");this.comp.setTabIndex(_.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(_){if(this.isFocusableContainer&&!this.eFocusableElement.contains(_.relatedTarget)){if(!this.allowFocus){this.findNextElementOutsideAndFocus(_.target===this.eBottomGuard);return}}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty){if(this.providedIsEmpty?this.providedIsEmpty():F0(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(_.target===this.eBottomGuard);return}}if(this.isFocusableContainer&&this.eFocusableElement.contains(_.relatedTarget))return;let f=_.target===this.eBottomGuard;if(!(this.providedFocusInnerElement?this.providedFocusInnerElement(f):this.focusInnerElement(f))&&this.forceFocusOutWhenTabGuardsAreEmpty)this.findNextElementOutsideAndFocus(_.target===this.eBottomGuard)}findNextElementOutsideAndFocus(_){let f=q_(this.beans),$=F0(f.body,null,!0),z=$.indexOf(_?this.eTopGuard:this.eBottomGuard);if(z===-1)return;let Q,J;if(_)Q=0,J=z;else Q=z+1,J=$.length;let q=$.slice(Q,J),X=this.gos.get("tabIndex");q.sort((Y,Z)=>{let G=Number.parseInt(Y.getAttribute("tabindex")||"0"),E=Number.parseInt(Z.getAttribute("tabindex")||"0");if(E===X)return 1;if(G===X)return-1;if(G===0)return 1;if(E===0)return-1;return G-E}),q[_?q.length-1:0]?.focus()}onFocusIn(_){if(this.focusTrapActive||this.forcingFocusOut)return;if(this.providedFocusIn)this.providedFocusIn(_);if(!this.isFocusableContainer)this.deactivateTabGuards()}onFocusOut(_){if(this.focusTrapActive)return;if(this.providedFocusOut)this.providedFocusOut(_);if(!this.eFocusableElement.contains(_.relatedTarget))this.activateTabGuards()}onTabKeyDown(_){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(_);return}if(this.focusTrapActive)return;if(_.defaultPrevented)return;let f=this.tabGuardsAreActive();if(f)this.deactivateTabGuards();let $=this.getNextFocusableElement(_.shiftKey);if(f)setTimeout(()=>this.activateTabGuards(),0);if(!$)return;$.focus(),_.preventDefault()}focusInnerElement(_=!1){let f=F0(this.eFocusableElement);if(this.tabGuardsAreActive())f.splice(0,1),f.splice(-1,1);if(!f.length)return!1;return f[_?f.length-1:0].focus({preventScroll:!0}),!0}getNextFocusableElement(_){return V_(this.beans,this.eFocusableElement,!1,_)}forceFocusOutOfContainer(_=!1){if(this.forcingFocusOut)return;let f=_?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,f.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(_,f){return _===this.eTopGuard&&!f||_===this.eBottomGuard&&(f??!0)}setAllowFocus(_){this.allowFocus=_}},TJ=class extends j_{constructor(_,f){super();this.comp=_,this.stopPropagationCallbacks=f}initialiseTabGuard(_){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();let{eTopGuard:f,eBottomGuard:$,eFocusableElement:z,stopPropagationCallbacks:Q}=this,J=[f,$],q={setTabIndex:(L)=>{for(let F of J)if(L==null)F.removeAttribute("tabindex");else F.setAttribute("tabindex",L)}};this.addTabGuards(f,$);let{focusTrapActive:X=!1,onFocusIn:Y,onFocusOut:Z,focusInnerElement:G,handleKeyDown:E,onTabKeyDown:U,shouldStopEventPropagation:H,isEmpty:W,forceFocusOutWhenTabGuardsAreEmpty:B,isFocusableContainer:K}=_;this.tabGuardCtrl=this.createManagedBean(new dG({comp:q,focusTrapActive:X,eTopGuard:f,eBottomGuard:$,eFocusableElement:z,onFocusIn:Y,onFocusOut:Z,focusInnerElement:G,handleKeyDown:E,onTabKeyDown:U,shouldStopEventPropagation:H,isEmpty:W,forceFocusOutWhenTabGuardsAreEmpty:B,isFocusableContainer:K},Q))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(_){let f=q_(this.beans).createElement("div"),$=_==="top"?o1.TAB_GUARD_TOP:o1.TAB_GUARD_BOTTOM;return f.classList.add(o1.TAB_GUARD,$),Z_(f,"presentation"),f}addTabGuards(_,f){let $=this.eFocusableElement;$.prepend(_),$.append(f)}removeAllChildrenExceptTabGuards(){let _=[this.eTopGuard,this.eBottomGuard];f_(this.comp.getFocusableElement()),this.addTabGuards(..._)}forceFocusOutOfContainer(_=!1){this.tabGuardCtrl.forceFocusOutOfContainer(_)}appendChild(_,f,$){if(!D$(f))f=f.getGui();let{eBottomGuard:z}=this;if(z)z.before(f);else _(f,$)}destroy(){let{eTopGuard:_,eBottomGuard:f}=this;T_(_),T_(f),super.destroy()}},r0=class extends p_{initialiseTabGuard(_,f){this.tabGuardFeature=this.createManagedBean(new TJ(this,f)),this.tabGuardFeature.initialiseTabGuard(_)}forceFocusOutOfContainer(_=!1){this.tabGuardFeature.forceFocusOutOfContainer(_)}appendChild(_,f){this.tabGuardFeature.appendChild(super.appendChild.bind(this),_,f)}},IJ=class extends r0{initialiseTabGuard(_){super.initialiseTabGuard(_,Ff)}},s2=(_,f)=>{return EX(_,()=>F_(_.getGui(),f,!1,!0))},a2=(_)=>{return _?.getFocusableContainerName()??"external"},tG=(_)=>{if(_==null)return"external";return typeof _==="string"?_:"gridBody"},rG=class extends A{constructor(){super(...arguments);this.additionalFocusableContainers=new Set}setComp(_,f,$){this.view=_,this.eGridHostDiv=f,this.eGui=$,this.eGui.setAttribute("grid-id",this.beans.context.getId());let{dragAndDrop:z,ctrlsSvc:Q}=this.beans;z?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new PJ(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let J=S0(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>J()),Q.register("gridCtrl",this)}isDetailGrid(){return oz(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){let _=this.beans;return{paginationSelector:_.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:_.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:_.sideBar?.getSelector(),statusBarSelector:_.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:_.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(_){let{view:f}=this;if(_===!1)f.setCursor(null);else f.setCursor(_===1?"ew-resize":"ns-resize")}disableUserSelect(_){this.view.setUserSelect(_?"none":null)}focusNextInnerContainer(_){let f=this.getFocusableContainers(),{indexWithFocus:$,nextIndex:z}=this.getNextFocusableIndex(f,_),Q=$===-1?_?f.length-1:0:z,{gos:J,beans:{focusSvc:q,navigation:X}}=this,Y=J.getCallback("tabToNextGridContainer");if(Y){let Z=q.getDefaultTabToNextGridContainerTarget({backwards:_,focusableContainers:f,nextIndex:Q}),G=a2(f[Q]),E=Z==null&&G==="gridBody"?"gridBody":tG(Z),U=Y({backwards:_,previousContainer:a2(f[$]),nextContainer:E,defaultTarget:Z});if(U!==void 0){if(typeof U==="boolean")return U;if(typeof U==="string"){if(U==="gridBody")return this.focusGridBodyDefault(_)||void 0;let H=f.find((W)=>W.getFocusableContainerName()===U);if(!H){Kq(`tabToNextGridContainer - ${U} container not found`);return}return s2(H,_)?!0:void 0}if(i8(U))return q.focusHeaderPosition({headerPosition:U})||void 0;return X?.ensureCellVisible(U),q.setFocusedCell({...U,forceBrowserFocus:!0}),q.isCellFocused(U)||void 0}}return this.focusNextInnerContainerDefault({backwards:_,focusableContainers:f,indexWithFocus:$,nextIndex:Q})||void 0}focusInnerElement(_){let{gos:f,beans:$,beans:{focusSvc:z,visibleCols:Q}}=this;if(f.getCallback("focusGridInnerElement")?.({fromBottom:!!_}))return!0;let q=this.getFocusableContainers();if(_){if(this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:q,indexWithFocus:q.length,nextIndex:q.length-1}))return!0;return z.focusGridView({column:b(Q.allCols),backwards:!0})}let X=Q.allCols;if(f.get("headerHeight")===0||W0($)){if(z.focusGridView({column:X[0],backwards:_}))return!0;for(let Y=1;YQ.getGui().contains($));return{indexWithFocus:z,nextIndex:z+(f?-1:1)}}focusGridBodyDefault(_){let{gos:f,beans:$,beans:{focusSvc:z,visibleCols:{allCols:Q}}}=this;if(_)return z.focusGridView({column:b(Q),backwards:!0});if(f.get("headerHeight")===0||W0($))return z.focusGridView({column:Q[0]});return z.focusFirstHeader()}focusNextInnerContainerDefault(_){let{backwards:f,focusableContainers:$,indexWithFocus:z}=_,Q=f?-1:1;for(let J=_.nextIndex;J>=0&&J<$.length;J+=Q){let q=$[J];if(q.getFocusableContainerName()==="gridBody"){if(z===-1||(f?z>J:zthis.destroyBean(this),setRtlClass:(J)=>this.addCss(J),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:(J)=>{this.getGui().style.userSelect=J!=null?J:"",this.getGui().style.webkitUserSelect=J!=null?J:""},setCursor:(J)=>{this.getGui().style.cursor=J!=null?J:""}},f=this.createManagedBean(new rG),$=f.getOptionalSelectors(),z=this.createTemplate($),Q=[nG,...Object.values($).filter((J)=>!!J)];this.setTemplate(z,Q),f.setComp(_,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{return},focusInnerElement:(J)=>f.focusInnerElement(J),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!f.isFocusable()})}insertGridIntoDom(){let _=this.getGui();this.eGridDiv.appendChild(_),this.addDestroyFunc(()=>{_.remove(),q$(this.gos,"Grid removed from DOM")})}updateLayoutClasses(_,f){let $=this.rootWrapperBody.classList,{AUTO_HEIGHT:z,NORMAL:Q,PRINT:J}=B0,{autoHeight:q,normal:X,print:Y}=f;$.toggle(z,q),$.toggle(Q,X),$.toggle(J,Y),this.toggleCss(z,q),this.toggleCss(Q,X),this.toggleCss(J,Y)}createTemplate(_){let f=_.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,$=_.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,z=_.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,Q=_.watermarkSelector?{tag:"ag-watermark"}:null,J=_.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[f,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},$]},z,J,Q]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(_=!1){if(!_&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(_);return}super.forceFocusOutOfContainer(_)}getFocusableContainers(){let _=[...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody];for(let f of[this.sideBar,this.statusBar,this.pagination])if(f)_.push(f);return _.filter((f)=>A_(f.getGui()))}},m=(_,f)=>{for(let $ of Object.keys(f))f[$]=_;return f},o2={dispatchEvent:"CommunityCore",...m("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...m("GridState",{getState:0,setState:0}),...m("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...m("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...m("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...m("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...m("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...m("ValueCache",{expireValueCache:0}),...m("CellApi",{getCellValue:0}),...m("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...m("Sort",{onSortChanged:0}),...m("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...m("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...m("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...m("HighlightChanges",{flashCells:0}),...m("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...m("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...m("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...m("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...m("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...m("ColumnResize",{setColumnWidths:0}),...m("ColumnHover",{isColumnHovered:0}),...m("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...m("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...m("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...m("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...m("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...m("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...m("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...m("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...m("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...m("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...m("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...m("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...m("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...m("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...m("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...m("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...m("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...m("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...m("ContextMenu",{showContextMenu:0}),...m("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...m("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...m("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...m("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...m("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...m("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...m("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...m("StatusBar",{getStatusPanel:0}),...m("AiToolkit",{getStructuredSchema:0})},q6={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},sG=(_,f)=>_.eventSvc.dispatchEvent(f),IX=class{};Reflect.defineProperty(IX,"name",{value:"GridApi"});var aG=class extends A{constructor(){super();this.beanName="apiFunctionSvc",this.api=new IX,this.fns={...q6,dispatchEvent:sG},this.preDestroyLink="";let{api:_}=this;for(let f of Object.keys(o2))_[f]=this.makeApi(f)[f]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(_,f){let{fns:$,beans:z}=this;if($!==q6)$[_]=z?.validation?.validateApiFunction(_,f)??f}makeApi(_){return{[_]:(...f)=>{let{beans:$,fns:{[_]:z}}=this;return z?z($,...f):this.apiNotFound(_)}}}apiNotFound(_){let{beans:f,gos:$,preDestroyLink:z}=this;if(!f)j(26,{fnName:_,preDestroyLink:z});else{let Q=o2[_];if($.assertModuleRegistered(Q,`api.${_}`))j(27,{fnName:_,module:Q})}}destroy(){super.destroy(),this.fns=q6,this.beans=null}};function oG(_){return _.context.getId()}function eG(_){_.gridDestroySvc.destroy()}function _E(_){return _.gridDestroySvc.destroyCalled}function fE(_,f){return _.gos.get(f)}function $E(_,f,$){yX(_,{[f]:$})}function yX(_,f){_.gos.updateGridOptions({options:f})}function zE(_,f){let $=f.replace(/Module$/,"");return _.gos.isModuleRegistered($)}function zQ(_,f,$){let z=h(_,f,$);if(z){let{className:J}=z;if(typeof J==="string"&&J.includes("ag-icon")||typeof J==="object"&&J["ag-icon"])return z}let Q=z_({tag:"span"});return Q.appendChild(z),Q}function h(_,f,$){let z=null;if(_==="smallDown")j(262);else if(_==="smallLeft")j(263);else if(_==="smallRight")j(264);let Q=$?.getColDef().icons;if(Q)z=Q[_];if(f.gos&&!z){let J=f.gos.get("icons");if(J)z=J[_]}if(z){let J;if(typeof z==="function")J=z();else if(typeof z==="string")J=z;else{j(38,{iconName:_});return}if(typeof J==="string")return o6(J);if(D$(J))return J;j(133,{iconName:_});return}else{let J=f.registry.getIcon(_);if(!J)f.validation?.validateIcon(_);return z_({tag:"span",cls:`ag-icon ag-icon-${J??_}`,role:"presentation",attrs:{unselectable:"on"}})}}var QE=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}",JE={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},qE=class extends w{constructor(){super();this.dragSource=null,this.eIcon=V,this.eLabel=V,this.eGhost=V,this.registerCSS(QE)}postConstruct(){let _=(f)=>zQ(f,this.beans,null);this.dropIconMap={pinned:_("columnMovePin"),hide:_("columnMoveHide"),move:_("columnMoveMove"),left:_("columnMoveLeft"),right:_("columnMoveRight"),group:_("columnMoveGroup"),aggregate:_("columnMoveValue"),pivot:_("columnMovePivot"),notAllowed:_("dropNotAllowed")}}init(_){this.dragSource=_.dragSource,this.setTemplate(JE),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(_,f){let{eGhost:$,eIcon:z,dragSource:Q,dropIconMap:J,gos:q}=this;f_(z);let X=null;if(!_)_=Q?.getDefaultIconName?Q.getDefaultIconName():"notAllowed";if(X=J[_],$.classList.toggle("ag-dnd-ghost-not-allowed",_==="notAllowed"),z.classList.toggle("ag-shake-left-to-right",f),X===J.hide&&q.get("suppressDragLeaveHidesColumns"))return;if(X)z.appendChild(X)}setLabel(_){this.eLabel.textContent=_}};var bX=(_,f)=>{if(f!=null&&_?.setPointerCapture)try{return _.setPointerCapture(f),_.hasPointerCapture(f)}catch{}return!1},XE=(_,f)=>{if(typeof PointerEvent>"u"||!(f instanceof PointerEvent))return null;let $=f.pointerId;if(!bX(_,$))return null;let z={eElement:_,pointerId:$,onLost(Q){ZE(z,Q)}};return _.addEventListener("lostpointercapture",z.onLost),z},YE=(_)=>{if(!_)return;CX(_);let{eElement:f,pointerId:$}=_;if(!f)return;try{f.releasePointerCapture($)}catch{}_.eElement=null},CX=(_)=>{let{eElement:f,onLost:$}=_;if(f&&$)f.removeEventListener("lostpointercapture",$),_.onLost=null},ZE=(_,f)=>{CX(_);let{eElement:$,pointerId:z}=_;if($&&f.pointerId===z)bX($,z)},E1,B1,X6={passive:!0},$f={passive:!1},j0=(_)=>{if(!B1)B1=new WeakSet;else if(B1.has(_))return!1;return B1.add(_),!0},GE=class extends j_{constructor(){super(...arguments);this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!E1?.has(a_(this.beans))}hasPointerCapture(){let _=this.drag?.pointerCapture;return!!(_&&this.beans.eRootDiv.hasPointerCapture?.(_.pointerId))}destroy(){if(this.drag)this.cancelDrag();let _=this.dragSources;for(let f of _)e2(f);_.length=0,super.destroy()}removeDragSource(_){let f=this.dragSources;for(let $=0,z=f.length;$this.onPointerDown(_,Z),$f],[f,"mousedown",(Z)=>this.onMouseDown(_,Z)]);let Y=this.gos.get("suppressTouch");if($&&!Y)qz(z,[f,"touchstart",(G)=>this.onTouchStart(_,G),$f])}cancelDrag(_){let f=this.drag;if(_??(_=f?.eElement),_)this.eventSvc.dispatchEvent({type:"dragCancelled",target:_});f?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(_){let f=_.type;return(f==="mousemove"||f==="pointermove")&&_.cancelable&&J$(this.beans,_)&&!s1(Z6(_))}initDrag(_,...f){this.drag=_;let $=this.beans,z=(X)=>this.onScroll(X),Q=(X)=>this.onKeyDown(X),J=a_($),q=q_($);qz(_.handlers,[J,"contextmenu",W1],[J,"keydown",Q],[q,"scroll",z,{capture:!0}],[q.defaultView||window,"scroll",z],...f)}destroyDrag(){this.dragging=!1;let _=this.drag;if(_){let f=_.rootEl;if(E1?.get(f)===_)E1.delete(f);this.drag=null,YE(_.pointerCapture),e6(_.handlers)}}onPointerDown(_,f){if(this.isPointer())return;let $=this.beans;if(B1?.has(f))return;let z=f.pointerType;if(z==="touch"){if($.gos.get("suppressTouch")||!_.includeTouch)return;if(_.stopPropagationForTouch)f.stopPropagation();if(s1(Z6(f)))return}if(!f.isPrimary)return;if(z==="mouse"&&f.button!==0)return;this.destroyDrag();let Q=a_($),J=_.eElement,q=f.pointerId,X=new Y6(Q,_,f,q);E1??(E1=new WeakMap),E1.set(Q,X);let Y=(U)=>{if(U.pointerId===q)this.onMouseOrPointerMove(U)},Z=(U)=>{if(U.pointerId===q)this.onMouseOrPointerUp(U)},G=(U)=>{if(U.pointerId===q&&j0(U))this.cancelDrag()},E=(U)=>this.draggingPreventDefault(U);if(this.initDrag(X,[Q,"pointerup",Z],[Q,"pointercancel",G],[Q,"pointermove",Y,$f],[Q,"touchmove",E,$f],[J,"mousemove",E,$f]),_.dragStartPixels===0)this.onMouseOrPointerMove(f);else j0(f)}onTouchStart(_,f){if(this.gos.get("suppressTouch")||!_.includeTouch)return;if(!j0(f))return;if(s1(Z6(f)))return;if(_.stopPropagationForTouch)f.stopPropagation();if(this.isPointer()){if(this.dragging)W1(f);return}this.destroyDrag();let z=this.beans,Q=a_(z),J=new Y6(Q,_,f.touches[0]),q=(U)=>this.onTouchMove(U),X=(U)=>this.onTouchUp(U),Y=(U)=>this.onTouchCancel(U),Z=(U)=>this.draggingPreventDefault(U),G=a_(z),E=f.target??_.eElement;if(this.initDrag(J,[E,"touchmove",q,X6],[E,"touchend",X,X6],[E,"touchcancel",Y,X6],[G,"touchmove",Z,$f],[G,"touchend",X,$f],[G,"touchcancel",Y,$f]),_.dragStartPixels===0)this.onMove(J.start)}draggingPreventDefault(_){if(this.dragging)W1(_)}onMouseDown(_,f){if(f.button!==0)return;if(B1?.has(f))return;if(this.isPointer())return;let $=this.beans;this.destroyDrag();let z=new Y6(a_($),_,f),Q=(X)=>this.onMouseOrPointerMove(X),J=(X)=>this.onMouseOrPointerUp(X),q=a_($);if(this.initDrag(z,[q,"mousemove",Q],[q,"mouseup",J]),_.dragStartPixels===0)this.onMouseOrPointerMove(f);else j0(f)}onScroll(_){if(!j0(_))return;let f=this.drag,$=f?.lastDrag;if($&&this.dragging)f.params?.onDragging?.($)}onMouseOrPointerMove(_){if(!j0(_))return;if(ef())q_(this.beans).getSelection()?.removeAllRanges();if(this.shouldPreventMouseEvent(_))W1(_);this.onMove(_)}onTouchCancel(_){let f=this.drag;if(!f||!j0(_))return;if(!D1(f.start,_.changedTouches))return;this.cancelDrag()}onTouchMove(_){let f=this.drag;if(!f||!j0(_))return;let $=D1(f.start,_.touches);if($)this.onMove($),this.draggingPreventDefault(_)}onMove(_){let f=this.drag;if(!f)return;f.lastDrag=_;let $=f.params;if(!this.dragging){let z=f.start,J=$.dragStartPixels??4;if(Hq(_,z,J))return;if(this.dragging=!0,$.capturePointer)f.pointerCapture=XE(this.beans.eRootDiv,_);if(this.eventSvc.dispatchEvent({type:"dragStarted",target:$.eElement}),$.onDragStart?.(z),this.drag!==f)return;if($.onDragging?.(z),this.drag!==f)return}$.onDragging?.(_)}onTouchUp(_){let f=this.drag;if(f&&j0(_))this.onUp(D1(f.start,_.changedTouches))}onMouseOrPointerUp(_){if(j0(_))this.onUp(_)}onUp(_){let f=this.drag;if(!f)return;if(!_)_=f.lastDrag;if(_&&this.dragging)this.dragging=!1,f.params.onDragStop?.(_),this.eventSvc.dispatchEvent({type:"dragStopped",target:f.params.eElement});this.destroyDrag()}onKeyDown(_){if(_.key===S.ESCAPE)this.cancelDrag()}},e2=(_)=>{e6(_.handlers);let f=_.oldTouchAction;if(f!=null){let $=_.params.eElement.style;if($)$.touchAction=f}},Y6=class{constructor(_,f,$,z=null){this.rootEl=_,this.params=f,this.start=$,this.pointerId=z,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=f.eElement}},Z6=(_)=>{let f=_.target;return f instanceof Element?f:null},EE=class extends GE{shouldPreventMouseEvent(_){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(_)}},UE=class extends A{constructor(){super(...arguments);this.beanName="horizontalResizeSvc"}addResizeBar(_){let f={dragStartPixels:_.dragStartPixels||0,eElement:_.eResizeBar,onDragStart:this.onDragStart.bind(this,_),onDragStop:this.onDragStop.bind(this,_),onDragging:this.onDragging.bind(this,_),onDragCancel:this.onDragStop.bind(this,_),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:$}=this.beans;return $.addDragSource(f),()=>$.removeDragSource(f)}onDragStart(_,f){this.dragStartX=f.clientX,this.setResizeIcons();let $=f instanceof MouseEvent&&f.shiftKey===!0;_.onResizeStart($)}setResizeIcons(){let _=this.beans.ctrlsSvc.get("gridCtrl");_.setResizeCursor(1),_.disableUserSelect(!0)}onDragStop(_){_.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){let _=this.beans.ctrlsSvc.get("gridCtrl");_.setResizeCursor(!1),_.disableUserSelect(!1)}onDragging(_,f){this.resizeAmount=f.clientX-this.dragStartX,_.onResizing(this.resizeAmount)}};var QQ=class{constructor(_){if(this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=_.scrollContainer,this.scrollHorizontally=_.scrollAxis.includes("x"),this.scrollVertically=_.scrollAxis.includes("y"),this.scrollByTick=_.scrollByTick??20,_.onScrollCallback)this.onScrollCallback=_.onScrollCallback;if(this.scrollVertically)this.getVerticalPosition=_.getVerticalPosition,this.setVerticalPosition=_.setVerticalPosition;if(this.scrollHorizontally)this.getHorizontalPosition=_.getHorizontalPosition,this.setHorizontalPosition=_.setHorizontalPosition;this.shouldSkipVerticalScroll=_.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=_.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(_,f=!1){let $=!this.scrollVertically||f||this.shouldSkipVerticalScroll(),z=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if($&&z)return;let Q=this.scrollContainer.getBoundingClientRect(),J=this.scrollByTick;if(this.tickLeft=!z&&_.clientXQ.right-J,this.tickUp=!$&&_.clientYQ.bottom-J,this.tickLeft||this.tickRight||this.tickUp||this.tickDown)this.ensureTickingStarted();else this.ensureCleared()}ensureTickingStarted(){if(this.tickingInterval===null)this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0}doTick(){this.tickCount++;let _=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){let f=this.getVerticalPosition();if(this.tickUp)this.setVerticalPosition(f-_);if(this.tickDown)this.setVerticalPosition(f+_)}if(this.scrollHorizontally){let f=this.getHorizontalPosition();if(this.tickLeft)this.setHorizontalPosition(f-_);if(this.tickRight)this.setHorizontalPosition(f+_)}if(this.onScrollCallback)this.onScrollCallback()}ensureCleared(){if(this.tickingInterval)window.clearInterval(this.tickingInterval),this.tickingInterval=null}},R1=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},_1=(_)=>{let f=_.childrenAfterGroup;while(f?.length){let $=f[0];if($.sourceRowIndex>=0)return $;f=$.childrenAfterGroup}},wX=(_,f,$,z)=>{if(!f.size||!_)return!1;let Q=!1,J=_.length??0,q=-1;if($){if(q=$.sourceRowIndex,$=q<0?_1($):null,$)q=$.sourceRowIndex}if(q<0||q>=J)q=J;else if(!z)++q;let X=q,Y=Math.min(q,J-1);for(let E of f){let U=E.sourceRowIndex;if(UY)Y=U}let Z=X;for(let E=X;E=q;--E){let U=_[E];if(f.has(U))continue;if(U.sourceRowIndex!==G)U.sourceRowIndex=G,_[G]=U,Q=!0;--G}for(let E of f){if(E.sourceRowIndex!==Z)E.sourceRowIndex=Z,_[Z]=E,Q=!0;++Z}return Q};function yJ(_,f){return P$(_,f.target)?.getFocusedCellPosition()??null}function bJ(_,f){let $=S_(_.gos,"normal"),z=f,Q,J;if(z.clientX!=null||z.clientY!=null)Q=z.clientX,J=z.clientY;else Q=z.x,J=z.y;let{pageFirstPixel:q}=_.pageBounds.getCurrentPagePixelRange();if(J+=q,$){let X=_.ctrlsSvc.getScrollFeature(),Y=X.getVScrollPosition(),Z=X.getHScrollPosition();Q+=Z.left,J+=Y.top}return{x:Q,y:J}}var JQ={moduleName:"Drag",version:c,beans:[EE]};var T$={moduleName:"SharedDragAndDrop",version:c,beans:[Z8],dependsOn:[JQ],userComponents:{agDragAndDropImage:qE},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}};var CJ={moduleName:"HorizontalResize",version:c,beans:[UE],dependsOn:[JQ]},HE=":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}",WE=class extends A{constructor(){super(...arguments);this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>this.gridBodyCtrl=_.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(_){this.suppressAnimation=_}start(){if(this.active)return;let{gos:_}=this;if(_.get("suppressColumnMoveAnimation"))return;if(_.get("enableRtl"))return;this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0}finish(){if(!this.active)return;this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(_){if(this.activeNext)this.executeNextFuncs.push(_);else _()}executeLaterVMTurn(_){if(this.active)this.executeLaterFuncs.push(_);else _()}ensureAnimationCssClassPresent(){this.animationThreadCount++;let _=this.animationThreadCount,{gridBodyCtrl:f}=this;f.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{if(this.animationThreadCount===_)f.setColumnMovingCss(!1)})}flush(_,f){let{executeNextFuncs:$,executeLaterFuncs:z}=this;if($.length===0&&z.length===0){_(),f();return}let Q=(J)=>{while(J.length){let q=J.pop();if(q)q()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{_(),Q($)},0),window.setTimeout(()=>{f(),Q(z)},200)})}};function BE(_,f,$){_.colMoves?.moveColumnByIndex(f,$,"api")}function KE(_,f,$){_.colMoves?.moveColumns(f,$,"api")}var LE=class extends A{constructor(_){super();this.pinned=_,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(_){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;let f=_.dragItem.columns;if(!f)return;for(let $ of f){if(!$.isPrimary())continue;if($.isAnyFunctionActive())continue;if($.isAllowValue())this.columnsToAggregate.push($);else if($.isAllowRowGroup())this.columnsToGroup.push($);else if($.isAllowPivot())this.columnsToPivot.push($)}}getIconName(){if(this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0)return this.pinned?"pinned":"move";return null}onDragLeave(_){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(_){}onDragStop(_){let{valueColsSvc:f,rowGroupColsSvc:$,pivotColsSvc:z}=this.beans;if(this.columnsToAggregate.length>0)f?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop");if(this.columnsToGroup.length>0)$?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop");if(this.columnsToPivot.length>0)z?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function FE(_,f){if(!f||f.length<=1)return;if(f.filter((z)=>_.indexOf(z)<0).length>0)return;f.sort((z,Q)=>{let J=_.indexOf(z),q=_.indexOf(Q);return J-q})}function DE(_){let f=[..._];for(let $ of _){let z=null,Q=$.getParent();while(Q!=null&&Q.getDisplayedLeafColumns().length===1)z=Q,Q=Q.getParent();if(z!=null){let q=z.getColGroupDef()?.marryChildren?z.getProvidedColumnGroup().getLeafColumns():z.getLeafColumns();for(let X of q)if(!f.includes(X))f.push(X)}}return f}function ME(_,f,$,z){let Q=z.allCols,J=null,q=null;for(let X=0;X<_.length;X++){let Y=_[X],Z=$.getProposedColumnOrder(f,Y);if(!$.doesOrderPassRules(Z))continue;let G=Z.filter((U)=>Q.includes(U));if(q===null)q=G;else if(!J_(G,q))break;let E=SE(Z);if(J===null||E=W)return;if($&&B<=W)return}let L=ME(H,U,Z,G);if(!L)return;let F=L.move;if(F>Y.getCols().length-U.length)return;return{columns:U,toIndex:F}}function NX(_){let{columns:f,toIndex:$}=xX(_)||{},{finished:z,colMoves:Q}=_;if(!f||$==null)return null;return Q.moveColumns(f,$,"uiColumnMoved",z),z?null:{columns:f,toIndex:$}}function kE(_,f){let $=f.getCols(),z=_.map((Y)=>$.indexOf(Y)).sort((Y,Z)=>Y-Z),Q=z[0];return b(z)-Q!==z.length-1?null:Q}function SE(_){function f(z){let Q=[],J=z.getOriginalParent();while(J!=null)Q.push(J),J=J.getOriginalParent();return Q}let $=0;for(let z=0;z<_.length-1;z++){let Q=f(_[z]),J=f(_[z+1]);[Q,J]=Q.length>J.length?[Q,J]:[J,Q];for(let q of Q)if(J.indexOf(q)===-1)$++}return $}function AE(_,f){switch(f){case"left":return _.leftCols;case"right":return _.rightCols;default:return _.centerCols}}function RE(_){let{movingCols:f,draggingRight:$,xPosition:z,pinned:Q,gos:J,colModel:q,visibleCols:X}=_;if(J.get("suppressMovableColumns")||f.some((D)=>D.getColDef().suppressMovable))return[];let Z=AE(X,Q),G=q.getCols(),E=Z.filter((D)=>f.includes(D)),U=Z.filter((D)=>!f.includes(D)),H=G.filter((D)=>!f.includes(D)),W=0,B=z;if($){let D=0;for(let M of E)D+=M.getActualWidth();B-=D}if(B>0){for(let D=0;D0){let D=U[W-1];K=H.indexOf(D)+1}else if(K=H.indexOf(U[0]),K===-1)K=0;let L=[K],F=(D,M)=>D-M;if($){let D=K+1,M=G.length-1;while(D<=M)L.push(D),D++;L.sort(F)}else{let D=K,M=G.length-1,k=G[D];while(D<=M&&Z.indexOf(k)<0)D++,L.push(D),k=G[D];D=K-1;let R=0;while(D>=R)L.push(D),D--;L.sort(F).reverse()}return L}function b6(_){let{pinned:f,fromKeyboard:$,gos:z,ctrlsSvc:Q,useHeaderRow:J,skipScrollPadding:q}=_,X=Q.getHeaderRowContainerCtrl(f)?.eViewport,{x:Y}=_;if(!X)return 0;if($)Y-=X.getBoundingClientRect().left;if(z.get("enableRtl")){if(J)X=X.querySelector(".ag-header-row");Y=X.clientWidth-Y}if(f==null&&!q)Y+=Q.get("center").getCenterViewportScrollLeft();return Y}function G6(_,f){for(let $ of _)$.moving=f,$.dispatchColEvent("movingChanged","uiColumnMoved")}var _9=7,C6=100,zz=C6/2,jE=5,VE=100,OE=class extends A{constructor(_){super();this.pinned=_,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!v(_)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCon=_.gridBodyCtrl})}getIconName(){let{pinned:_,lastDraggingEvent:f}=this,{dragItem:$}=f||{},z=$?.columns??[];for(let Q of z){let J=Q.getPinned();if(Q.getColDef().lockPinned){if(J==_)return"move";continue}let q=$?.containerType;if(q===_||!_)return"move";if(_&&(!J||q!==_))return"pinned"}return"notAllowed"}onDragEnter(_){let f=_.dragItem,$=f.columns;if(_.dragSource.type===0)this.setColumnsVisible($,!0,"uiColumnDragged");else{let Q=f.visibleState,J=($||[]).filter((q)=>Q[q.getId()]&&!q.isVisible());this.setColumnsVisible(J,!0,"uiColumnDragged")}if(!this.gos.get("suppressMoveWhenColumnDragging"))this.attemptToPinColumns($,this.pinned);this.onDragging(_,!0,!0)}onDragging(_=this.lastDraggingEvent,f=!1,$=!1,z=!1){let{gos:Q,ctrlsSvc:J}=this.beans,q=Q.get("suppressMoveWhenColumnDragging");if(z&&!q){this.finishColumnMoving();return}if(this.lastDraggingEvent=_,!_||!z&&n(_.hDirection))return;let X=b6({x:_.x,pinned:this.pinned,gos:Q,ctrlsSvc:J});if(!f)this.checkCenterForScrolling(X);if(q)this.handleColumnDragWhileSuppressingMovement(_,f,$,X,z);else this.handleColumnDragWhileAllowingMovement(_,f,$,X,z)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(_,f,$){if(!_?.length)return;let z=_.filter((Q)=>!Q.getColDef().lockVisible);if(!z.length)return;this.beans.colModel.setColsVisible(z,f,$)}finishColumnMoving(){this.clearHighlighted();let _=this.lastMovedInfo;if(!_)return;let{columns:f,toIndex:$}=_;this.beans.colMoves.moveColumns(f,$,"uiColumnMoved",!0)}updateDragItemContainerType(){let{lastDraggingEvent:_}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!_)return;let f=_.dragItem;if(!f)return;f.containerType=this.pinned}handleColumnDragWhileSuppressingMovement(_,f,$,z,Q){let J=this.getAllMovingColumns(_,!0);if(Q){let q=this.isAttemptingToPin(J);if(q)this.attemptToPinColumns(J,void 0,!0);let{fromLeft:X,xPosition:Y}=this.getNormalisedXPositionInfo(J,q)||{};if(X==null||Y==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:J,xPosition:Y,fromEnter:f,fakeEvent:$,fromLeft:X})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(_))return;this.highlightHoveredColumn(J,z)}}handleColumnDragWhileAllowingMovement(_,f,$,z,Q){let J=this.getAllMovingColumns(_),q=this.normaliseDirection(_.hDirection)==="right",X=_.dragSource.type===1,Y=this.getMoveColumnParams({allMovingColumns:J,isFromHeader:X,xPosition:z,fromLeft:q,fromEnter:f,fakeEvent:$}),Z=NX({...Y,finished:Q});if(Z)this.lastMovedInfo=Z}getAllMovingColumns(_,f=!1){let $=_.dragSource.getDragItem(),z=null;if(f){if(z=$.columnsInSplit,!z)z=$.columns}else z=$.columns;let Q=(J)=>J.getColDef().lockPinned?J.getPinned()==this.pinned:!0;if(!z)return[];return z.filter(Q)}getMoveColumnParams(_){let{allMovingColumns:f,isFromHeader:$,xPosition:z,fromLeft:Q,fromEnter:J,fakeEvent:q}=_,{gos:X,colModel:Y,colMoves:Z,visibleCols:G}=this.beans;return{allMovingColumns:f,isFromHeader:$,fromLeft:Q,xPosition:z,pinned:this.pinned,fromEnter:J,fakeEvent:q,gos:X,colModel:Y,colMoves:Z,visibleCols:G}}highlightHoveredColumn(_,f){let{gos:$,colModel:z}=this.beans,Q=$.get("enableRtl"),J=z.getCols().filter((G)=>G.isVisible()&&G.getPinned()===this.pinned),q=null,X=null,Y=null;for(let G of J){if(X=G.getActualWidth(),q=this.getNormalisedColumnLeft(G,0,Q),q!=null){let E=q+X;if(q<=f&&E>=f){Y=G;break}}q=null,X=null}if(!Y){for(let G=J.length-1;G>=0;G--){let E=J[G],U=J[G].getParent();if(!U){Y=E;break}let H=U?.getDisplayedLeafColumns();if(H.length){Y=b(H);break}}if(!Y)return;q=this.getNormalisedColumnLeft(Y,0,Q),X=Y.getActualWidth()}else if(_.indexOf(Y)!==-1)Y=null;if(Y==null||q==null||X==null){if(this.lastHighlightedColumn?.column!==Y)this.clearHighlighted();return}let Z;if(f-q_9;return f&&$||_.some((z)=>z.getPinned()!==this.pinned)}moveColumnsAfterHighlight(_){let{allMovingColumns:f,xPosition:$,fromEnter:z,fakeEvent:Q,fromLeft:J}=_,q=this.getMoveColumnParams({allMovingColumns:f,isFromHeader:!0,xPosition:$,fromLeft:J,fromEnter:z,fakeEvent:Q}),{columns:X,toIndex:Y}=xX(q)||{};if(X&&Y!=null)this.lastMovedInfo={columns:X,toIndex:Y};this.finishColumnMoving()}clearHighlighted(){let{lastHighlightedColumn:_}=this;if(!_)return;f9(_.column,null),this.lastHighlightedColumn=null}checkCenterForScrolling(_){if(!this.isCenterContainer)return;let f=this.beans.ctrlsSvc.get("center"),$=f.getCenterViewportScrollLeft(),z=$+f.getCenterWidth(),Q,J;if(this.gos.get("enableRtl"))Q=_<$+zz,J=_>z-zz;else J=_<$+zz,Q=_>z-zz;if(this.needToMoveRight=Q,this.needToMoveLeft=J,J||Q)this.ensureIntervalStarted();else this.ensureIntervalCleared()}ensureIntervalStarted(){if(this.movingIntervalId)return;this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),VE),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0)}ensureIntervalCleared(){if(!this.movingIntervalId)return;window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName())}moveInterval(){let _;if(this.intervalCount++,_=10+this.intervalCount*jE,_>C6)_=C6;let f=null,$=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft)f=$.scrollHorizontally(-_);else if(this.needToMoveRight)f=$.scrollHorizontally(_);if(f!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;let{pinnedCols:z,dragAndDrop:Q,gos:J}=this.beans;if(this.failedMoveAttempts<=_9+1||!z)return;if(Q.setDragImageCompIcon("pinned"),!J.get("suppressMoveWhenColumnDragging")){let q=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(q,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(_,f,$=!1){let z=(_||[]).filter((q)=>!q.getColDef().lockPinned);if(!z.length)return 0;if($)f=this.getPinDirection();let{pinnedCols:Q,dragAndDrop:J}=this.beans;if(Q?.setColsPinned(z,f,"uiColumnDragged"),$)J.nudge();return z.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function f9(_,f){if(_.highlighted===f)return;_.highlighted=f,_.dispatchColEvent("headerHighlightChanged","uiColumnMoved")}function PE(_){let f=_.length,$,z;for(let Q=0;Q{let Q,J=z.gridBodyCtrl.eBodyViewport;switch($){case"left":Q=[[J,z.left.eContainer],[z.bottomLeft.eContainer],[z.topLeft.eContainer]];break;case"right":Q=[[J,z.right.eContainer],[z.bottomRight.eContainer],[z.topRight.eContainer]];break;default:Q=[[J,z.center.eViewport],[z.bottomCenter.eViewport],[z.topCenter.eViewport]];break}this.eSecondaryContainers=Q}),this.moveColumnFeature=this.createManagedBean(new OE($)),this.bodyDropPivotTarget=this.createManagedBean(new LE($)),f.addDropTarget(this),this.addDestroyFunc(()=>f.removeDropTarget(this))}isInterestedIn(_){return _===1||_===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(_){return this.beans.colModel.isPivotMode()&&_.dragSource.type===0}onDragEnter(_){this.currentDropListener=this.isDropColumnInPivotMode(_)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(_)}onDragLeave(_){this.currentDropListener.onDragLeave(_)}onDragging(_){this.currentDropListener.onDragging(_)}onDragStop(_){this.currentDropListener.onDragStop(_)}onDragCancel(){this.currentDropListener.onDragCancel()}};function gX(_,f){let $=[],z=[],Q=[];if(_.forEach((q)=>{let X=q.getColDef().lockPosition;if(X==="right")Q.push(q);else if(X==="left"||X===!0)$.push(q);else z.push(q)}),f.get("enableRtl"))return[...Q,...z,...$];return[...$,...z,...Q]}function hX(_,f){let $=!0;return y0(null,f,(z)=>{if(!X_(z))return;let Q=z;if(!Q.getColGroupDef()?.marryChildren)return;let X=[];for(let U of Q.getLeafColumns()){let H=_.indexOf(U);X.push(H)}let Y=Math.max.apply(Math,X),Z=Math.min.apply(Math,X),G=Y-Z,E=Q.getLeafColumns().length-1;if(G>E)$=!1}),$}var TE=class extends A{constructor(){super(...arguments);this.beanName="colMoves"}moveColumnByIndex(_,f,$){let z=this.beans.colModel.getCols();if(!z)return;let Q=z[_];this.moveColumns([Q],f,$)}moveColumns(_,f,$,z=!0){let{colModel:Q,colAnimation:J,visibleCols:q,eventSvc:X}=this.beans,Y=Q.getCols();if(!Y)return;if(f>Y.length-_.length){j(30,{toIndex:f});return}J?.start();let Z=Q.getColsForKeys(_);if(this.doesMovePassRules(Z,f))C2(Q.getCols(),Z,f),q.refresh($),X.dispatchEvent({type:"columnMoved",columns:Z,column:Z.length===1?Z[0]:null,toIndex:f,finished:z,source:$});J?.finish()}doesMovePassRules(_,f){let $=this.getProposedColumnOrder(_,f);return this.doesOrderPassRules($)}doesOrderPassRules(_){let{colModel:f,gos:$}=this.beans;if(!hX(_,f.getColTree()))return!1;if(!((Q)=>{let J=(Z)=>{if(!Z)return 0;return Z==="left"||Z===!0?-1:1},q=$.get("enableRtl"),X=q?1:-1,Y=!0;for(let Z of Q){let G=J(Z.getColDef().lockPosition);if(q){if(G>X)Y=!1}else if(GX?"hide":"notAllowed",getDragItem:Y?()=>bE(f,q.allCols):()=>yE(f),dragItemName:$,onDragStarted:()=>{X=!z.get("suppressDragLeaveHidesColumns"),G6(Z,!0)},onDragStopped:()=>G6(Z,!1),onDragCancelled:()=>G6(Z,!1),onGridEnter:(U)=>{if(X){let{columns:H=[],visibleState:W}=U??{},B=Y?(L)=>!W||W[L.getColId()]:()=>!0,K=H.filter((L)=>!L.getColDef().lockVisible&&B(L));Q.setColsVisible(K,!0,"uiColumnMoved")}},onGridExit:(U)=>{if(X){let H=U?.columns?.filter((W)=>!W.getColDef().lockVisible)||[];Q.setColsVisible(H,!1,"uiColumnMoved")}}};return J.addDragSource(E,!0),E}};function IE(_,f){while(_){if(_.getGroupId()===f)return _;_=_.getParent()}return}function yE(_){let f={};return f[_.getId()]=_.isVisible(),{columns:[_],visibleState:f,containerType:_.pinned}}function bE(_,f){let $=_.getProvidedColumnGroup().getLeafColumns(),z={};for(let X of $)z[X.getId()]=X.isVisible();let Q=[];for(let X of f)if($.indexOf(X)>=0)Q.push(X),Q_($,X);for(let X of $)Q.push(X);let J=[],q=_.getLeafColumns();for(let X of Q)if(q.indexOf(X)!==-1)J.push(X);return{columns:Q,columnsInSplit:J,visibleState:z,containerType:J[0]?.pinned}}var I$={moduleName:"ColumnMove",version:c,beans:[TE,WE],apiFunctions:{moveColumnByIndex:BE,moveColumns:KE},dependsOn:[T$],css:[HE]},CE=class extends A{constructor(){super(...arguments);this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.centerRowContainerCtrl=_.center})}getPreferredWidthForColumn(_,f){let $=this.getHeaderCellForColumn(_);if(!$)return-1;let z=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(_);if(!f)z.push($);return this.getPreferredWidthForElements(z)}getPreferredWidthForColumnGroup(_){let f=this.getHeaderCellForColumn(_);if(!f)return-1;return this.getPreferredWidthForElements([f])}getPreferredWidthForElements(_,f){let $=document.createElement("form");$.style.position="fixed";let z=this.centerRowContainerCtrl.eContainer;for(let J of _)this.cloneItemIntoDummy(J,$);z.appendChild($);let Q=Math.ceil($.getBoundingClientRect().width);return $.remove(),f=f??this.gos.get("autoSizePadding"),Q+f}getHeaderCellForColumn(_){let f=null;for(let $ of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){let z=$.getHtmlElementForColumnHeader(_);if(z!=null)f=z}return f}cloneItemIntoDummy(_,f){let $=_.cloneNode(!0);$.style.width="",$.style.position="static",$.style.left="";let z=document.createElement("div"),Q=z.classList;if(["ag-header-cell","ag-header-group-cell"].some((X)=>$.classList.contains(X)))Q.add("ag-header","ag-header-row"),z.style.position="static";else Q.add("ag-row");let q=_.parentElement;while(q){if(["ag-header-row","ag-row"].some((Y)=>q.classList.contains(Y))){for(let Y=0;YJ.getPinned());_.dispatchEvent({type:"columnPinned",pinned:Q!=null?Q:null,columns:f,column:z,source:$})}function xE(_,f,$){if(!f.length)return;let z=f.length===1?f[0]:null,Q=iX(f,(J)=>J.isVisible());_.dispatchEvent({type:"columnVisible",visible:Q,columns:f,column:z,source:$})}function cX(_,f,$,z){_.dispatchEvent({type:f,columns:$,column:$&&$.length==1?$[0]:null,source:z})}function P1(_,f,$,z,Q=null){if(f?.length)_.dispatchEvent({type:"columnResized",columns:f,column:f.length===1?f[0]:null,flexColumns:Q,finished:$,source:z})}var NE=class extends A{constructor(_,f,$,z){super();this.comp=_,this.eResize=f,this.pinned=$,this.columnGroup=z}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}let{horizontalResizeSvc:_,gos:f,colAutosize:$}=this.beans,z=_.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(z),!f.get("suppressAutoSize")&&$)this.addDestroyFunc($.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(_){let{columnsToResize:f,resizeStartWidth:$,resizeRatios:z,groupAfterColumns:Q,groupAfterStartWidth:J,groupAfterRatios:q}=this.getInitialValues(_);this.resizeCols=f,this.resizeStartWidth=$,this.resizeRatios=z,this.resizeTakeFromCols=Q,this.resizeTakeFromStartWidth=J,this.resizeTakeFromRatios=q,this.toggleColumnResizing(!0)}onResizing(_,f,$="uiColumnResized"){let z=this.normaliseDragChange(f),Q=this.resizeStartWidth+z;this.resizeColumnsFromLocalValues(Q,$,_)}getInitialValues(_){let f=(Y)=>Y.reduce((Z,G)=>Z+G.getActualWidth(),0),$=(Y,Z)=>Y.map((G)=>G.getActualWidth()/Z),z=this.getColumnsToResize(),Q=f(z),J=$(z,Q),q={columnsToResize:z,resizeStartWidth:Q,resizeRatios:J},X=null;if(_)X=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null;if(X){let Y=X.getDisplayedLeafColumns(),Z=q.groupAfterColumns=Y.filter((E)=>E.isResizable()),G=q.groupAfterStartWidth=f(Z);q.groupAfterRatios=$(Z,G)}else q.groupAfterColumns=void 0,q.groupAfterStartWidth=void 0,q.groupAfterRatios=void 0;return q}resizeLeafColumnsToFit(_){let f=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),$=this.getInitialValues();if(f>$.resizeStartWidth)this.resizeColumns($,f,_,!0)}resizeColumnsFromLocalValues(_,f,$=!0){if(!this.resizeCols||!this.resizeRatios)return;let z={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(z,_,f,$)}resizeColumns(_,f,$,z=!0){let{columnsToResize:Q,resizeStartWidth:J,resizeRatios:q,groupAfterColumns:X,groupAfterStartWidth:Y,groupAfterRatios:Z}=_,G=[];if(G.push({columns:Q,ratios:q,width:f}),X){let E=f-J;G.push({columns:X,ratios:Z,width:Y-E})}if(this.beans.colResize?.resizeColumnSets({resizeSets:G,finished:z,source:$}),z)this.toggleColumnResizing(!1)}toggleColumnResizing(_){this.comp.toggleCss("ag-column-resizing",_)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((f)=>f.isResizable())}normaliseDragChange(_){let f=_;if(this.gos.get("enableRtl")){if(this.pinned!=="left")f*=-1}else if(this.pinned==="right")f*=-1;return f}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},gE=class extends A{constructor(_,f,$,z,Q){super();this.pinned=_,this.column=f,this.eResize=$,this.comp=z,this.ctrl=Q}postConstruct(){let _=[],f,$,z=()=>{if(N(this.eResize,f),!f)return;let{horizontalResizeSvc:q,colAutosize:X}=this.beans,Y=q.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(_.push(Y),$&&X)_.push(X.addColumnAutosizeListeners(this.eResize,this.column))},Q=()=>{for(let q of _)q();_.length=0},J=()=>{let q=this.column.isResizable(),X=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;if(q!==f||X!==$)f=q,$=X,Q(),z()};J(),this.addDestroyFunc(Q),this.ctrl.setRefreshFunction("resize",J)}onResizing(_,f){let{column:$,lastResizeAmount:z,resizeStartWidth:Q,beans:J}=this,q=this.normaliseResizeAmount(f),X=Q+q,Y=[{key:$,newWidth:X}],{pinnedCols:Z,ctrlsSvc:G,colResize:E}=J;if(this.column.getPinned()){let U=Z?.leftWidth??0,H=Z?.rightWidth??0,W=df(G.getGridBodyCtrl().eBodyViewport)-50;if(U+H+(q-z)>W)return}if(this.lastResizeAmount=q,E?.setColumnWidths(Y,this.resizeWithShiftKey,_,"uiColumnResized"),_)this.toggleColumnResizing(!1)}onResizeStart(_){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=_,this.toggleColumnResizing(!0)}toggleColumnResizing(_){this.column.resizing=_,this.comp.toggleCss("ag-column-resizing",_)}normaliseResizeAmount(_){let f=_,$=this.pinned!=="left",z=this.pinned==="right";if(this.gos.get("enableRtl")){if($)f*=-1}else if(z)f*=-1;return f}},hE=class extends A{constructor(){super(...arguments);this.beanName="colResize"}setColumnWidths(_,f,$,z){let Q=[],{colModel:J,gos:q,visibleCols:X}=this.beans;for(let Y of _){let Z=J.getColDefCol(Y.key)||J.getCol(Y.key);if(!Z)continue;if(Q.push({width:Y.newWidth,ratios:[1],columns:[Z]}),q.get("colResizeDefault")==="shift")f=!f;if(f){let E=X.getColAfter(Z);if(!E)continue;let U=Z.getActualWidth()-Y.newWidth,H=E.getActualWidth()+U;Q.push({width:H,ratios:[1],columns:[E]})}}if(Q.length===0)return;this.resizeColumnSets({resizeSets:Q,finished:$,source:z})}resizeColumnSets(_){let{resizeSets:f,finished:$,source:z}=_;if(!(!f||f.every((G)=>uE(G)))){if($){let G=f&&f.length>0?f[0].columns:null;P1(this.eventSvc,G,$,z)}return}let J=[],q=[];for(let G of f){let{width:E,columns:U,ratios:H}=G,W={},B={};for(let F of U)q.push(F);let K=!0,L=0;while(K){if(L++,L>1000){e(31);break}K=!1;let F=[],D=0,M=E;U.forEach((R,O)=>{if(B[R.getId()])M-=W[R.getId()];else{F.push(R);let T=H[O];D+=T}});let k=1/D;F.forEach((R,O)=>{let I=O===F.length-1,T;if(I)T=M;else T=Math.round(H[O]*E*k),M-=T;let y=R.getMinWidth(),i=R.getMaxWidth();if(T0&&T>i)T=i,B[R.getId()]=!0,K=!0;W[R.getId()]=T})}for(let F of U){let D=W[F.getId()];if(F.getActualWidth()!==D)F.setActualWidth(D,z),J.push(F)}}let X=J.length>0,Y=[];if(X){let{colFlex:G,visibleCols:E,colViewport:U}=this.beans;Y=G?.refreshFlexedColumns({resizingCols:q,skipSetLeft:!0})??[],E.setLeftValues(z),E.updateBodyWidths(),U.checkViewportColumns()}let Z=q.concat(Y);if(X||$)P1(this.eventSvc,Z,$,z,Y)}resizeHeader(_,f,$){if(!_.isResizable())return;let z=_.getActualWidth(),Q=_.getMinWidth(),J=_.getMaxWidth(),q=Math.min(Math.max(z+f,Q),J);this.setColumnWidths([{key:_,newWidth:q}],$,!0,"uiColumnResized")}createResizeFeature(_,f,$,z,Q){return new gE(_,f,$,z,Q)}createGroupResizeFeature(_,f,$,z){return new NE(_,f,$,z)}};function uE(_){let{columns:f,width:$}=_,z=0,Q=0,J=!0;for(let Y of f){let Z=Y.getMinWidth();z+=Z||0;let G=Y.getMaxWidth();if(G>0)Q+=G;else J=!1}let q=$>=z,X=!J||$<=Q;return q&&X}var iE={moduleName:"ColumnResize",version:c,beans:[hE],apiFunctions:{setColumnWidths:wE},dependsOn:[CJ,uX]},mE=class extends A{constructor(_,f){super();this.removeChildListenersFuncs=[],this.columnGroup=f,this.comp=_}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();let _=this.onWidthChanged.bind(this);for(let f of this.columnGroup.getLeafColumns())f.__addEventListener("widthChanged",_),f.__addEventListener("visibleChanged",_),this.removeChildListenersFuncs.push(()=>{f.__removeEventListener("widthChanged",_),f.__removeEventListener("visibleChanged",_)})}removeListenersOnChildrenColumns(){for(let _ of this.removeChildListenersFuncs)_();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){let _=this.columnGroup.getActualWidth();this.comp.setWidth(`${_}px`),this.comp.toggleCss("ag-hidden",_===0)}},cE=class extends OJ{constructor(){super(...arguments);this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource)this.setDragSource(this.eGui)}}wireComp(_,f,$,z,Q){let{column:J,beans:q}=this,{context:X,colNames:Y,colHover:Z,rangeSvc:G,colResize:E}=q;this.comp=_,Q=O$(this,X,Q),this.setGui(f,Q),this.displayName=Y.getDisplayNameForColumnGroup(J,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(Q),this.setupExpandable(Q),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:z,compBean:Q}),this.setupUserComp(),this.addHeaderMouseListeners(Q,z),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();let U=this.rowCtrl.pinned,H=J.getProvidedColumnGroup().getLeafColumns();if(Z?.createHoverFeature(Q,H,f),G?.createRangeHighlightFeature(Q,J,_),Q.createManagedBean(new VJ(J,f,q)),Q.createManagedBean(new mE(_,J)),E)this.resizeFeature=Q.createManagedBean(E.createGroupResizeFeature(_,$,U,J));else _.setResizableDisplayed(!1);Q.createManagedBean(new t0(f,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{return},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(Q,H),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),Q.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(Q),Q.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){let{column:_,beans:f}=this,$=_.getDefinition();return C(f.gos,{colDef:$,columnGroup:_,floatingFilter:!1})}refreshMaxHeaderHeight(){let{gos:_,comp:f}=this,$=_.get("groupHeaderHeight");if($!=null)if($===0)f.setHeaderWrapperHidden(!0);else f.setHeaderWrapperMaxHeight($);else f.setHeaderWrapperHidden(!1),f.setHeaderWrapperMaxHeight(null)}addHighlightListeners(_,f){if(!this.beans.gos.get("suppressMoveWhenColumnDragging"))return;for(let $ of f)_.addManagedListeners($,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,$)})}onLeafColumnHighlightChanged(_){let f=this.column.getDisplayedLeafColumns(),$=f[0]===_,z=b(f)===_;if(!$&&!z)return;let Q=_.getHighlighted(),J=!!this.rowCtrl.getHeaderCellCtrls().find((Y)=>{return Y.column.isMoving()}),q=!1,X=!1;if(J){let Y=this.beans.gos.get("enableRtl"),Z=Q===1,G=Q===0;if($)if(Y)X=Z;else q=G;if(z)if(Y)q=G;else X=Z}this.comp.toggleCss("ag-header-highlight-before",q),this.comp.toggleCss("ag-header-highlight-after",X)}resizeHeader(_,f){let{resizeFeature:$}=this;if(!$)return;let z=$.getInitialValues(f);$.resizeColumns(z,z.resizeStartWidth+_,"uiColumnResized",!0)}resizeLeafColumnsToFit(_){this.resizeFeature?.resizeLeafColumnsToFit(_)}setupUserComp(){let{colGroupSvc:_,userCompFactory:f,gos:$,enterpriseMenuFactory:z}=this.beans,Q=this.column,J=Q.getProvidedColumnGroup(),q=C($,{displayName:this.displayName,columnGroup:Q,setExpanded:(Y)=>{_.setColumnGroupOpened(J,Y,"gridInitializing")},setTooltip:(Y,Z)=>{$.assertModuleRegistered("Tooltip",3),this.setupTooltip(Y,Z)},showColumnMenu:(Y,Z)=>z?.showMenuAfterButtonClick(J,Y,"columnMenu",Z),showColumnMenuAfterMouseClick:(Y,Z)=>z?.showMenuAfterMouseEvent(J,Y,"columnMenu",Z),eGridHeader:this.eGui}),X=$8(f,q);if(X)this.comp.setUserCompDetails(X)}addHeaderMouseListeners(_,f){let{column:$,comp:z,beans:{rangeSvc:Q},gos:J}=this,q=(G)=>this.handleMouseOverChange(G.type==="mouseenter"),X=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",$.getProvidedColumnGroup()),Y=(G)=>this.handleContextMenuMouseEvent(G,void 0,$.getProvidedColumnGroup());_.addManagedListeners(this.eGui,{mouseenter:q,mouseleave:q,click:X,contextmenu:Y}),z.toggleCss("ag-header-group-cell-selectable",Gf(J));let Z=Q?.createHeaderGroupCellMouseListenerFeature(this.column,f);if(Z)this.createManagedBean(Z)}handleMouseOverChange(_){this.eventSvc.dispatchEvent({type:_?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(_,f){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,_,f)}setupExpandable(_){let f=this.column.getProvidedColumnGroup();this.refreshExpanded();let $=this.refreshExpanded.bind(this);_.addManagedListeners(f,{expandedChanged:$,expandableChanged:$})}refreshExpanded(){let{column:_}=this;this.expandable=_.isExpandable();let f=_.isExpanded();if(this.expandable)this.comp.setAriaExpanded(f?"true":"false");else this.comp.setAriaExpanded(void 0);this.refreshHeaderStyles()}addClasses(){let{column:_}=this,f=_.getColGroupDef(),$=fQ(f,this.gos,null,_);if(_.isPadding()){if($.push("ag-header-group-cell-no-group"),_.getLeafColumns().every((Q)=>Q.isSpanHeaderHeight()))$.push("ag-header-span-height")}else if($.push("ag-header-group-cell-with-group"),f?.wrapHeaderText)$.push("ag-header-cell-wrap-text");for(let z of $)this.comp.toggleCss(z,!0)}setupMovingCss(_){let{column:f}=this,z=f.getProvidedColumnGroup().getLeafColumns(),Q=()=>this.comp.toggleCss("ag-header-cell-moving",f.isMoving());for(let J of z)_.addManagedListeners(J,{movingChanged:Q});Q()}onFocusIn(_){if(!this.eGui.contains(_.relatedTarget))this.focusThis(),this.announceAriaDescription()}handleKeyDown(_){if(super.handleKeyDown(_),!this.getWrapperHasFocus())return;let{column:$,expandable:z,gos:Q,beans:J}=this,q=Gf(Q);if(_.key!=S.ENTER)return;if(q&&!_.altKey)J.rangeSvc?.handleColumnSelection($,_);else if(z){let X=!$.isExpanded();J.colGroupSvc.setColumnGroupOpened($.getProvidedColumnGroup(),X,"uiColumnExpanded")}}refreshAnnouncement(){let _,{gos:f}=this;if(Gf(f))_=this.getLocaleTextFunc()("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group");this.ariaAnnouncement=_}announceAriaDescription(){let{beans:_,eGui:f,ariaAnnouncement:$}=this;if(!$||!f.contains(d(_)))return;_.ariaAnnounce?.announceValue($,"columnHeader")}setDragSource(_){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!_)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(_,this.column,this.displayName)??null}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some((_)=>_.getColDef().suppressMovable||_.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function pE(_,f,$){_.colGroupSvc?.setColumnGroupOpened(f,$,"api")}function nE(_,f,$){return _.colGroupSvc?.getColumnGroup(f,$)??null}function dE(_,f){return _.colGroupSvc?.getProvidedColGroup(f)??null}function tE(_,f,$){return _.colNames.getDisplayNameForColumnGroup(f,$)||""}function rE(_){return _.colGroupSvc?.getColumnGroupState()??[]}function lE(_,f){_.colGroupSvc?.setColumnGroupState(f,"api")}function sE(_){_.colGroupSvc?.resetColumnGroupState("api")}function aE(_){return _.visibleCols.treeLeft}function oE(_){return _.visibleCols.treeCenter}function eE(_){return _.visibleCols.treeRight}function _U(_){return _.visibleCols.getAllTrees()}var pX=class{constructor(){this.existingIds={}}getInstanceIdForKey(_){let f=this.existingIds[_],$;if(typeof f!=="number")$=0;else $=f+1;return this.existingIds[_]=$,$}};function fU(_,f){for(let $=0;$=0)_[z]=_[_.length-1],_.pop()}}var $U=class extends A{constructor(){super(...arguments);this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(_,f=!1){let{colFlex:$,colModel:z,colGroupSvc:Q,colViewport:J,selectionColSvc:q}=this.beans;if(!f)this.buildTrees(z,Q);Q?.updateOpenClosedVisibility(),this.leftCols=E6(this.treeLeft),this.centerCols=E6(this.treeCenter),this.rightCols=E6(this.treeRight),q?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(z),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(_),this.autoHeightCols=this.allCols.filter((X)=>X.isAutoHeight()),$?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(z,this.leftCols,this.rightCols,_),J.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:_})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let _=0;for(let f of this.allCols){let $=f.getParent();while($){if(!$.isPadding()){let z=$.getProvidedColumnGroup().getLevel()+1;if(z>_)_=z;break}$=$.getParent()}}return _}updateBodyWidths(){let _=m0(this.centerCols),f=m0(this.leftCols),$=m0(this.rightCols);if(this.isBodyWidthDirty=this.bodyWidth!==_,this.bodyWidth!==_||this.leftWidth!==f||this.rightWidth!==$)this.bodyWidth=_,this.leftWidth=f,this.rightWidth=$,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"})}setLeftValues(_){this.setLeftValuesOfCols(_),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(_,f,$,z){let Q,J;if(this.gos.get("enableRtl"))Q=f?f[0]:null,J=$?b($):null;else Q=f?b(f):null,J=$?$[0]:null;for(let q of _.getCols())q.setLastLeftPinned(q===Q,z),q.setFirstRightPinned(q===J,z)}buildTrees(_,f){let $=_.getColsToShow(),z=$.filter((Y)=>Y.getPinned()=="left"),Q=$.filter((Y)=>Y.getPinned()=="right"),J=$.filter((Y)=>Y.getPinned()!="left"&&Y.getPinned()!="right"),q=new pX,X=(Y)=>{return f?f.createColumnGroups(Y):Y.columns};this.treeLeft=X({columns:z,idCreator:q,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=X({columns:Q,idCreator:q,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=X({columns:J,idCreator:q,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(_){let f=_.getCols(),$=[],z=[],Q=[];for(let J of f){let q=J.getPinned();if(!q)z.push(J);else if(q===!0||q==="left")$.push(J);else Q.push(J)}this.ariaOrderColumns=$.concat(z).concat(Q)}getAriaColIndex(_){let f;if(G_(_))f=_.getLeafColumns()[0];else f=_;return this.ariaOrderColumns.indexOf(f)+1}setLeftValuesOfGroups(){for(let _ of[this.treeLeft,this.treeRight,this.treeCenter])for(let f of _)if(G_(f))f.checkLeft()}setLeftValuesOfCols(_){let{colModel:f}=this.beans;if(!f.getColDefCols())return;let z=f.getCols().slice(0),Q=this.gos.get("enableRtl");for(let J of[this.leftCols,this.rightCols,this.centerCols]){if(Q){let q=m0(J);for(let X of J)q-=X.getActualWidth(),X.setLeft(q,_)}else{let q=0;for(let X of J)X.setLeft(q,_),q+=X.getActualWidth()}fU(z,J)}for(let J of z)J.setLeft(null,_)}joinCols(){if(this.gos.get("enableRtl"))this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols);else this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){if(this.treeLeft&&this.treeRight&&this.treeCenter)return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);return null}isColDisplayed(_){return this.allCols.indexOf(_)>=0}getLeftColsForRow(_){let{leftCols:f,beans:{colModel:$}}=this;if(!$.colSpanActive)return f;return this.getColsForRow(_,f)}getRightColsForRow(_){let{rightCols:f,beans:{colModel:$}}=this;if(!$.colSpanActive)return f;return this.getColsForRow(_,f)}getColsForRow(_,f,$,z){let Q=[],J=null;for(let q=0;q1){let U=Z-1;for(let H=1;H<=U;H++)G.push(f[q+H]);q+=U}let E;if($){E=!1;for(let U of G)if($(U))E=!0}else E=!0;if(E){if(Q.length===0&&J){if(z?z(X):!1)Q.push(J)}Q.push(X)}J=X}return Q}getContainerWidth(_){switch(_){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(_){let f=this.allCols,$=f.indexOf(_);if($>0)return f[$-1];return null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};let _=(f)=>{this.colsAndGroupsMap[f.getUniqueId()]=f};nf(this.treeCenter,!1,_),nf(this.treeLeft,!1,_),nf(this.treeRight,!1,_)}isVisible(_){return this.colsAndGroupsMap[_.getUniqueId()]===_}getFirstColumn(){let _=this.gos.get("enableRtl"),f=["leftCols","centerCols","rightCols"];if(_)f.reverse();for(let $=0;${if(Q0($))f.push($)}),f}var zU=class extends A{constructor(){super(...arguments);this.beanName="colGroupSvc"}getColumnGroupState(){let _=[],f=this.beans.colModel.getColTree();return y0(null,f,($)=>{if(X_($))_.push({groupId:$.getGroupId(),open:$.isExpanded()})}),_}resetColumnGroupState(_){let f=this.beans.colModel.getColDefColTree();if(!f)return;let $=[];y0(null,f,(z)=>{if(X_(z)){let Q=z.getColGroupDef(),J={groupId:z.getGroupId(),open:!Q?void 0:Q.openByDefault};$.push(J)}}),this.setColumnGroupState($,_)}setColumnGroupState(_,f){let{colModel:$,colAnimation:z,visibleCols:Q,eventSvc:J}=this.beans;if(!$.getColTree().length)return;z?.start();let X=[];for(let Y of _){let{groupId:Z,open:G}=Y,E=this.getProvidedColGroup(Z);if(!E)continue;if(E.isExpanded()===G)continue;E.setExpanded(G),X.push(E)}if(Q.refresh(f,!0),X.length)J.dispatchEvent({type:"columnGroupOpened",columnGroup:X.length===1?X[0]:void 0,columnGroups:X});z?.finish()}setColumnGroupOpened(_,f,$){let z;if(X_(_))z=_.getId();else z=_||"";this.setColumnGroupState([{groupId:z,open:f}],$)}getProvidedColGroup(_){let f=null;return y0(null,this.beans.colModel.getColTree(),($)=>{if(X_($)){if($.getId()===_)f=$}}),f}getGroupAtDirection(_,f){let $=_.getProvidedColumnGroup().getLevel()+_.getPaddingLevel(),z=_.getDisplayedLeafColumns(),Q=f==="After"?b(z):z[0],J=`getCol${f}`;while(!0){let q=this.beans.visibleCols[J](Q);if(!q)return null;let X=this.getColGroupAtLevel(q,$);if(X!==_)return X}}getColGroupAtLevel(_,f){let $=_.getParent(),z,Q;while(!0){if(z=$.getProvidedColumnGroup().getLevel(),Q=$.getPaddingLevel(),z+Q<=f)break;$=$.getParent()}return $}updateOpenClosedVisibility(){let _=this.beans.visibleCols.getAllTrees();nf(_,!1,(f)=>{if(G_(f))f.calculateDisplayedColumns()})}getColumnGroup(_,f){if(!_)return null;if(G_(_))return _;let $=this.beans.visibleCols.getAllTrees(),z=typeof f==="number",Q=null;return nf($,!1,(J)=>{if(G_(J)){let q=J,X;if(z)X=_===q.getGroupId()&&f===q.getPartId();else X=_===q.getGroupId();if(X)Q=q}}),Q}createColumnGroups(_){let{columns:f,idCreator:$,pinned:z,oldDisplayedGroups:Q,isStandaloneStructure:J}=_,q=this.mapOldGroupsById(Q),X=[],Y=f;while(Y.length){let Z=Y;Y=[];let G=0,E=(U)=>{let H=G;G=U;let W=Z[H],K=(G_(W)?W.getProvidedColumnGroup():W).getOriginalParent();if(K==null){for(let F=H;FX_(G))){Y.setChildren([q]);continue}else{Y.setChildren(_);break}Q.push(q)}}return Q}findDepth(_){let f=0,$=_;while($?.[0]&&X_($[0]))f++,$=$[0].getChildren();return f}findMaxDepth(_,f){let $=f;for(let z=0;z<_.length;z++){let Q=_[z];if(X_(Q)){let J=Q,q=this.findMaxDepth(J.getChildren(),f+1);if($=0;J--){let q=new cf(null,`FAKE_PATH_${z.getId()}_${J}`,!0,J);this.createBean(q),q.setChildren([Q]),Q.originalParent=q,Q=q}if(f===0)z.originalParent=null;$.push(Q)}return $}findExistingGroup(_,f){if(_.groupId==null)return;for(let z=0;z{for(let Q of z)if(G_(Q)){let J=Q;f[Q.getUniqueId()]=J,$(J.getChildren())}};if(_)$(_);return f}setupParentsIntoCols(_,f){for(let $ of _??[]){if($.parent!==f)this.beans.colViewport.colsWithinViewportHash="";if($.parent=f,G_($)){let z=$;this.setupParentsIntoCols(z.getChildren(),z)}}}},wJ={moduleName:"ColumnGroup",version:c,dynamicBeans:{headerGroupCellCtrl:cE},beans:[zU],apiFunctions:{getAllDisplayedColumnGroups:_U,getCenterDisplayedColumnGroups:oE,getColumnGroup:nE,getColumnGroupState:rE,getDisplayNameForColumnGroup:tE,getLeftDisplayedColumnGroups:aE,getProvidedColumnGroup:dE,getRightDisplayedColumnGroups:eE,resetColumnGroupState:sE,setColumnGroupOpened:pE,setColumnGroupState:lE}};function d_(_,f,$){let{colModel:z,rowGroupColsSvc:Q,pivotColsSvc:J,autoColSvc:q,selectionColSvc:X,colAnimation:Y,visibleCols:Z,pivotResultCols:G,environment:E,valueColsSvc:U,eventSvc:H,gos:W}=_,B=z.getColDefCols()??[],K=X?.getColumns();if(!B.length&&!K?.length)return!1;if(f?.state&&!f.state.forEach)return j(32),!1;let L=(k,R,O,I,T)=>{if(!k)return;let y=O7(R,f.defaultState),i=y("flex").value1,x=y("sort").value1,a=y("sortType").value1,t=Ef(x)||YJ(a),u=M0(a),__=rz(x),r=t?{type:u,direction:__}:void 0;if(iq(_,k,y("hide").value1,r,y("sortIndex").value1,y("pinned").value1,i,$),i==null){let O_=y("width").value1;if(O_!=null){let P_=k.getColDef().minWidth??E.getDefaultColumnMinWidth();if(P_!=null&&O_>=P_)k.setActualWidth(O_,$)}}if(T||!k.isPrimary())return;U?.syncColumnWithState(k,$,y),Q?.syncColumnWithState(k,$,y,O),J?.syncColumnWithState(k,$,y,I)},F=(k,R,O)=>{let I=dX(_,$),T=R.slice(),y={},i={},x=[],a=[],t=[],u=0,__=Q?.columns.slice()??[],r=J?.columns.slice()??[];for(let M_ of k){let Tf=M_.colId;if(Tf.startsWith(af)){x.push(M_),t.push(M_);continue}if(x0(Tf)){a.push(M_),t.push(M_);continue}let Z1=O(Tf);if(!Z1)t.push(M_),u+=1;else L(Z1,M_,y,i,!1),Q_(T,Z1)}let O_=(M_)=>L(M_,null,y,i,!1);T.forEach(O_),Q?.sortColumns(z9.bind(Q,y,__)),J?.sortColumns(z9.bind(J,i,r)),z.refreshCols(!1,$);let P_=(M_,Tf,gQ=[])=>{for(let Z1 of Tf){let P2=M_(Z1.colId);Q_(gQ,P2),L(P2,Z1,null,null,!0)}gQ.forEach(O_)};return P_((M_)=>q?.getColumn(M_)??null,x,q?.getColumns()?.slice()),P_((M_)=>X?.getColumn(M_)??null,a,X?.getColumns()?.slice()),QU(f,z,W),Z.refresh($),H.dispatchEvent({type:"columnEverythingChanged",source:$}),I(),{unmatchedAndAutoStates:t,unmatchedCount:u}};Y?.start();let{unmatchedAndAutoStates:D,unmatchedCount:M}=F(f.state||[],B,(k)=>z.getColDefCol(k));if(D.length>0||v(f.defaultState)){let k=G?.getPivotResultCols()?.list??[];M=F(D,k,(R)=>G?.getPivotResultCol(R)??null).unmatchedCount}return Y?.finish(),M===0}function nX(_,f){let{colModel:$,autoColSvc:z,selectionColSvc:Q,eventSvc:J,gos:q}=_,X=$.getColDefCols();if(!X?.length)return;let Y=$.getColDefColTree(),Z=lz(Y),G=[],E=1000,U=1000,H=(F)=>{let D=tX(F);if(n(D.rowGroupIndex)&&D.rowGroup)D.rowGroupIndex=E++;if(n(D.pivotIndex)&&D.pivot)D.pivotIndex=U++;G.push(D)};z?.getColumns()?.forEach(H),Q?.getColumns()?.forEach(H),Z?.forEach(H),d_(_,{state:G},f);let W=z?.getColumns()??[],L=[...Q?.getColumns()??[],...W,...X].map((F)=>({colId:F.colId}));d_(_,{state:L,applyOrder:!0},f),J.dispatchEvent(C(q,{type:"columnsReset",source:f}))}function dX(_,f){let{rowGroupColsSvc:$,pivotColsSvc:z,valueColsSvc:Q,colModel:J,sortSvc:q,eventSvc:X}=_,Y={rowGroupColumns:$?.columns.slice()??[],pivotColumns:z?.columns.slice()??[],valueColumns:Q?.columns.slice()??[]},Z=$9(_),G={};for(let E of Z)G[E.colId]=E;return()=>{let E=(R,O,I,T)=>{let y=O.map(T),i=I.map(T);if(J_(y,i))return;let a=new Set(O);for(let u of I)if(!a.delete(u))a.add(u);let t=[...a];X.dispatchEvent({type:R,columns:t,column:t.length===1?t[0]:null,source:f})},U=(R)=>{let O=[];return J.forAllCols((I)=>{let T=G[I.getColId()];if(T&&R(T,I))O.push(I)}),O},H=(R)=>R.getColId();E("columnRowGroupChanged",Y.rowGroupColumns,$?.columns??[],H),E("columnPivotChanged",Y.pivotColumns,z?.columns??[],H);let B=U((R,O)=>{let I=R.aggFunc!=null,T=I!=O.isValueActive(),y=I&&R.aggFunc!=O.getAggFunc();return T||y});if(B.length>0)cX(X,"columnValueChanged",B,f);P1(X,U((R,O)=>R.width!=O.getActualWidth()),!0,f),mX(X,U((R,O)=>R.pinned!=O.getPinned()),f),xE(X,U((R,O)=>R.hide==O.isVisible()),f);let M=U((R,O)=>!Gz(O.getSortDef(),{type:M0(R.sortType),direction:rz(R.sort)})||R.sortIndex!=O.getSortIndex());if(M.length>0)q?.dispatchSortChangedEvents(f,M);let k=$9(_);qU(Z,k,f,J,X)}}function $9(_){let{colModel:f,rowGroupColsSvc:$,pivotColsSvc:z}=_,Q=f.getColDefCols();if(n(Q)||!f.isAlive())return[];let J=$?.columns,q=z?.columns,X=[],Y=(G)=>{let E=G.isRowGroupActive()&&J?J.indexOf(G):null,U=G.isPivotActive()&&q?q.indexOf(G):null,H=G.isValueActive()?G.getAggFunc():null,W=G.getSortIndex()!=null?G.getSortIndex():null;X.push({colId:G.getColId(),width:G.getActualWidth(),hide:!G.isVisible(),pinned:G.getPinned(),sort:G.getSort(),sortType:G.getSortDef()?.type,sortIndex:W,aggFunc:H,rowGroup:G.isRowGroupActive(),rowGroupIndex:E,pivot:G.isPivotActive(),pivotIndex:U,flex:G.getFlex()??null})};f.forAllCols((G)=>Y(G));let Z=new Map(f.getCols().map((G,E)=>[G.getColId(),E]));return X.sort((G,E)=>{let U=Z.has(G.colId)?Z.get(G.colId):-1,H=Z.has(E.colId)?Z.get(E.colId):-1;return U-H}),X}function tX(_){let f=(K,L)=>K!=null?K:L!=null?L:null,$=_.getColDef(),z=e_(f($.sort,$.initialSort)),Q=z.direction,J=z.type,q=f($.sortIndex,$.initialSortIndex),X=f($.hide,$.initialHide),Y=f($.pinned,$.initialPinned),Z=f($.width,$.initialWidth),G=f($.flex,$.initialFlex),E=f($.rowGroupIndex,$.initialRowGroupIndex),U=f($.rowGroup,$.initialRowGroup);if(E==null&&!U)E=null,U=null;let H=f($.pivotIndex,$.initialPivotIndex),W=f($.pivot,$.initialPivot);if(H==null&&!W)H=null,W=null;let B=f($.aggFunc,$.initialAggFunc);return{colId:_.getColId(),sort:Q,sortType:J,sortIndex:q,hide:X,pinned:Y,width:Z,flex:G,rowGroup:U,rowGroupIndex:E,pivot:W,pivotIndex:H,aggFunc:B}}function QU(_,f,$){if(!_.applyOrder||!_.state)return;let z=[];for(let Q of _.state)if(Q.colId!=null)z.push(Q.colId);JU(f.cols,z,f,$)}function JU(_,f,$,z){if(_==null)return;let Q=[],J={};for(let X of f){if(J[X])continue;let Y=_.map[X];if(Y)Q.push(Y),J[X]=!0}let q=0;for(let X of _.list){let Y=X.getColId();if(J[Y]!=null)continue;if(Y.startsWith(af))Q.splice(q++,0,X);else Q.push(X)}if(Q=gX(Q,z),!hX(Q,$.getColTree())){j(39);return}_.list=Q}function qU(_,f,$,z,Q){let J={};for(let G of f)J[G.colId]=G;let q={};for(let G of _)if(J[G.colId])q[G.colId]=!0;let X=_.filter((G)=>q[G.colId]),Y=f.filter((G)=>q[G.colId]),Z=[];if(Y.forEach((G,E)=>{let U=X?.[E];if(U&&U.colId!==G.colId){let H=z.getCol(U.colId);if(H)Z.push(H)}}),!Z.length)return;Q.dispatchEvent({type:"columnMoved",columns:Z,column:Z.length===1?Z[0]:null,finished:!0,source:$})}var z9=(_,f,$,z)=>{let Q=_[$.getId()],J=_[z.getId()],q=Q!=null,X=J!=null;if(q&&X)return Q-J;if(q)return-1;if(X)return 1;let Y=f.indexOf($),Z=f.indexOf(z),G=Y>=0,E=Z>=0;if(G&&E)return Y-Z;if(G)return-1;return 1},XU=class extends A{constructor(){super(...arguments);this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","groupHideColumnsUntilExpanded","rowNumbers","hidePaddedHeaderRows"],(_)=>this.refreshAll(Uf(_.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",(_)=>this.setPivotMode(this.gos.get("pivotMode"),Uf(_.source)))}createColsFromColDefs(_){let{beans:f}=this,{valueCache:$,colAutosize:z,rowGroupColsSvc:Q,pivotColsSvc:J,valueColsSvc:q,visibleCols:X,eventSvc:Y,groupHierarchyColSvc:Z}=f,G=this.colDefs?dX(f,_):void 0;$?.expire();let E=this.colDefCols?.list,U=this.colDefCols?.tree,H=GJ(f,this.colDefs,!0,U,_);J0(f,this.colDefCols?.tree,H.columnTree);let{columnTree:W,treeDepth:B}=H,K=lz(W),L={};for(let F of K)L[F.getId()]=F;if(this.colDefCols={tree:W,treeDepth:B,list:K,map:L},this.createColumnsForService([Z],this.colDefCols,_),Q?.extractCols(_,E),J?.extractCols(_,E),q?.extractCols(_,E),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,_),this.changeEventsDispatching=!1,X.refresh(_),Y.dispatchEvent({type:"columnEverythingChanged",source:_}),G)this.changeEventsDispatching=!0,G(),this.changeEventsDispatching=!1;if(Y.dispatchEvent({type:"newColumnsLoaded",source:_}),_==="gridInitializing")z?.applyAutosizeStrategy()}refreshCols(_,f){if(!this.colDefCols)return;let $=this.cols?.tree;this.saveColOrder();let{autoColSvc:z,selectionColSvc:Q,rowNumbersSvc:J,quickFilter:q,pivotResultCols:X,showRowGroupCols:Y,rowAutoHeight:Z,visibleCols:G,colViewport:E,eventSvc:U,formula:H}=this.beans,W=this.selectCols(X,this.colDefCols);H?.setFormulasActive(W),this.createColumnsForService([z,Q,J],W,f);let B=q7(this.gos,this.showingPivotResult);if(!_||B)this.restoreColOrder(W);if(this.positionLockedCols(W),Y?.refresh(),q?.refreshCols(),this.setColSpanActive(),Z?.setAutoHeightActive(W),G.clear(),E.clear(),!J_($,this.cols.tree))U.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(_,f,$){for(let z of _){if(!z)continue;z.createColumns(f,(Q)=>{this.lastOrder=Q(this.lastOrder),this.lastPivotOrder=Q(this.lastPivotOrder)},$),z.addColumns(f)}}selectCols(_,f){let $=_?.getPivotResultCols()??null;this.showingPivotResult=$!=null;let{map:z,list:Q,tree:J,treeDepth:q}=$??f;if(this.cols={list:Q.slice(),map:{...z},tree:J.slice(),treeDepth:q},$){if(!$.list.some((Y)=>this.cols?.map[Y.getColId()]!==void 0))this.lastPivotOrder=null}return this.cols}getColsToShow(){if(!this.cols)return[];let{beans:_,showingPivotResult:f,cols:$}=this,{valueColsSvc:z,selectionColSvc:Q,gos:J}=_,q=this.isPivotMode()&&!f,X=Q?.isSelectionColumnEnabled(),Y=X7(_),Z=z?.columns,G=JJ(J);return $.list.filter((U)=>{let H=of(U);if(q)return Z?.includes(U)||H&&(!G||U.isVisible())||X&&x0(U)||Y&&I_(U);else return H&&!G||U.isVisible()})}refreshAll(_){if(!this.ready)return;this.refreshCols(!1,_),this.beans.visibleCols.refresh(_)}setColsVisible(_,f=!1,$){d_(this.beans,{state:_.map((z)=>({colId:typeof z==="string"?z:z.getColId(),hide:!f}))},$)}restoreColOrder(_){let f=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!f)return;let $=f.filter((E)=>_.map[E.getId()]!=null);if($.length===0)return;if($.length===_.list.length){_.list=$;return}let z=(E)=>{let U=E.getOriginalParent();if(!U)return!1;if(U.getChildren().length>1)return!0;return z(U)};if(!$.some((E)=>z(E))){let E=new Set($);for(let U of _.list)if(!E.has(U))$.push(U);_.list=$;return}let Q=new Map;for(let E=0;E<$.length;E++){let U=$[E];Q.set(U,E)}let J=_.list.filter((E)=>!Q.has(E));if(J.length===0){_.list=$;return}let q=(E,U)=>{let H=U?U.getOriginalParent():E.getOriginalParent();if(!H)return null;let W=null,B=null;for(let K of H.getChildren()){if(K===U||K===E)continue;if(K instanceof Z0){let L=Q.get(K);if(L==null)continue;if(W==null||W{let F=Q.get(L);if(F==null)return;if(W==null||W=0;E--)Z[G--]=X[E];for(let E=$.length-1;E>=0;E--){let U=$[E],H=Y.get(U);if(H)if(Array.isArray(H))for(let W=H.length-1;W>=0;W--){let B=H[W];Z[G--]=B}else Z[G--]=H;Z[G--]=U}_.list=Z}positionLockedCols(_){_.list=gX(_.list,this.gos)}saveColOrder(){if(this.showingPivotResult)this.lastPivotOrder=this.cols?.list??null;else this.lastOrder=this.cols?.list??null}getColumnDefs(_){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],_)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some((_)=>_.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(_,f){if(_===this.pivotMode)return;if(this.pivotMode=_,!this.ready)return;this.refreshCols(!1,f);let{visibleCols:$,eventSvc:z}=this.beans;$.refresh(f),z.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){let _=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!_?.length}recreateColumnDefs(_){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(_);let f=Uf(_.source);this.createColsFromColDefs(f)}setColumnDefs(_,f){this.colDefs=_,this.createColsFromColDefs(f)}destroy(){J0(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(_){let{pivotResultCols:f,autoColSvc:$,selectionColSvc:z,groupHierarchyColSvc:Q}=this.beans;if(n1(this.colDefCols?.list,_))return;if(n1($?.columns?.list,_))return;if(n1(z?.columns?.list,_))return;if(n1(Q?.columns?.list,_))return;if(n1(f?.getPivotResultCols()?.list,_))return}getColsForKeys(_){if(!_)return[];return _.map((f)=>this.getCol(f)).filter((f)=>f!=null)}getColDefCol(_){if(!this.colDefCols?.list)return null;return this.getColFromCollection(_,this.colDefCols)}getCol(_){if(_==null)return null;return this.getColFromCollection(_,this.cols)}getColById(_){return this.cols?.map[_]??null}getColFromCollection(_,f){if(f==null)return null;let{map:$,list:z}=f;if(typeof _=="string"&&$[_])return $[_];for(let X=0;X_(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(_){return I0(this.getGui(),_),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(_,f){if(this.value===_)return this;if(this.previousValue=this.value,this.value=_,!f)this.dispatchLocalEvent({type:"fieldValueChanged"});return this}};function EU(_){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:_,ref:"eInput",cls:"ag-input-field-input"}]}]}}var rX=class extends GU{constructor(_,f,$="text",z="input"){super(_,_?.template??EU(z),[],f);this.inputType=$,this.displayFieldTag=z,this.eLabel=V,this.eWrapper=V,this.eInput=V}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);let{eLabel:_,eWrapper:f,eInput:$,className:z}=this;_.classList.add(`${z}-label`),f.classList.add(`${z}-input-wrapper`),$.classList.add(`${z}-input`),this.addCss("ag-input-field"),$.id=$.id||`ag-${this.getCompId()}-input`;let{inputName:Q,inputWidth:J,inputPlaceholder:q,autoComplete:X,tabIndex:Y}=this.config;if(Q!=null)this.setInputName(Q);if(J!=null)this.setInputWidth(J);if(q!=null)this.setInputPlaceholder(q);if(X!=null)this.setAutoComplete(X);this.addInputListeners(),this.activateTabIndex([$],Y)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:(_)=>this.setValue(_.target.value)})}setInputType(_){if(this.displayFieldTag==="input")this.inputType=_,gf(this.eInput,"type",_)}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(_){return Gq(this.eWrapper,_),this}setInputName(_){return this.getInputElement().setAttribute("name",_),this}getFocusableElement(){return this.eInput}setMaxLength(_){let f=this.eInput;return f.maxLength=_,this}setInputPlaceholder(_){return gf(this.eInput,"placeholder",_),this}setInputAriaLabel(_){return W_(this.eInput,_),this.refreshAriaLabelledBy(),this}setDisabled(_){return a6(this.eInput,_),super.setDisabled(_)}setAutoComplete(_){if(_===!0)gf(this.eInput,"autocomplete",null);else{let f=typeof _==="string"?_:"off";gf(this.eInput,"autocomplete",f)}return this}},xJ=class extends rX{constructor(_,f="ag-checkbox",$="checkbox"){super(_,f,$);this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();let{readOnly:_,passive:f,name:$}=this.config;if(typeof _==="boolean")this.setReadOnly(_);if(typeof f==="boolean")this.setPassive(f);if($!=null)this.setName($)}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(_){this.passive=_}isReadOnly(){return this.readOnly}setReadOnly(_){this.eWrapper.classList.toggle("ag-disabled",_),this.eInput.disabled=_,this.readOnly=_}setDisabled(_){return this.eWrapper.classList.toggle("ag-disabled",_),super.setDisabled(_)}toggle(){if(this.eInput.disabled)return;let _=this.isSelected(),f=this.getNextValue();if(this.passive)this.dispatchChange(f,_);else this.setValue(f)}getValue(){return this.isSelected()}setValue(_,f){return this.refreshSelectedClass(_),this.setSelected(_,f),this}setName(_){let f=this.getInputElement();return f.name=_,this}isSelected(){return this.selected}setSelected(_,f){if(this.isSelected()===_)return;this.previousValue=this.isSelected(),_=this.selected=typeof _==="boolean"?_:void 0;let $=this.eInput;if($.checked=_,$.indeterminate=_===void 0,!f)this.dispatchChange(this.selected,this.previousValue)}dispatchChange(_,f,$){this.dispatchLocalEvent({type:"fieldValueChanged",selected:_,previousValue:f,event:$});let z=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:z.id,name:z.name,selected:_,previousValue:f})}onCheckboxClick(_){if(this.passive||this.eInput.disabled)return;let f=this.isSelected(),$=this.selected=_.target.checked;this.refreshSelectedClass($),this.dispatchChange($,f,_)}refreshSelectedClass(_){let f=this.eWrapper.classList;f.toggle("ag-checked",_===!0),f.toggle("ag-indeterminate",_==null)}},h0={selector:"AG-CHECKBOX",component:xJ},UU=".ag-checkbox-cell{height:100%}",HU={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},WU=class extends w{constructor(){super(HU,[h0]);this.eCheckbox=V,this.registerCSS(UU)}init(_){this.refresh(_);let{eCheckbox:f,beans:$}=this,z=f.getInputElement();z.setAttribute("tabindex","-1"),r9(z,"polite"),this.addManagedListeners(z,{click:(Q)=>{if(n_(Q),f.isDisabled())return;let J=f.getValue();this.onCheckboxChanged(J)},dblclick:(Q)=>{n_(Q)}}),this.addManagedElementListeners(_.eGridCell,{keydown:(Q)=>{if(Q.key===S.SPACE&&!f.isDisabled()){if(_.eGridCell===d($))f.toggle();let J=f.getValue();this.onCheckboxChanged(J),Q.preventDefault()}}})}refresh(_){return this.params=_,this.updateCheckbox(_),!0}updateCheckbox(_){let f,$=!0,{value:z,column:Q,node:J}=_;if(J.group&&Q)if(typeof z==="boolean")f=z;else{let E=Q.getColId();if(E.startsWith(af))f=z==null||z===""?void 0:z==="true";else if(J.aggData&&J.aggData[E]!==void 0)f=z??void 0;else if(J.sourceRowIndex>=0)f=z??void 0;else $=!1}else f=z??void 0;let{eCheckbox:q}=this;if(!$){q.setDisplayed(!1);return}q.setValue(f);let X=_.disabled??!Q?.isCellEditable(J);q.setDisabled(X);let Y=this.getLocaleTextFunc(),Z=l6(Y,f),G=X?Z:`${Y("ariaToggleCellValue","Press SPACE to toggle cell value")} (${Z})`;q.setInputAriaLabel(G)}onCheckboxChanged(_){let{params:f}=this,{column:$,node:z,value:Q}=f,{editSvc:J}=this.beans;if(!$)return;let q={rowNode:z,column:$};J?.dispatchCellEvent(q,null,"cellEditingStarted",{value:Q});let X=z.setDataValue($,_,"ui");if(J?.dispatchCellEvent(q,null,"cellEditingStopped",{oldValue:Q,newValue:_,valueChanged:X}),!X)this.updateCheckbox(f)}},BU={tag:"div",cls:"ag-skeleton-container"},KU=class extends w{constructor(){super(BU)}init(_){let f=`ag-cell-skeleton-renderer-${this.getCompId()}`;if(this.getGui().setAttribute("id",f),this.addDestroyFunc(()=>z$(_.eParentOfValue)),z$(_.eParentOfValue,f),_.deferRender)this.setupLoading(_);else if(_.node.failedLoad)this.setupFailed();else this.setupLoading(_)}setupFailed(){let _=this.getLocaleTextFunc();this.getGui().textContent=_("loadingError","ERR");let f=_("ariaSkeletonCellLoadingFailed","Row failed to load");W_(this.getGui(),f)}setupLoading(_){let f=z_({tag:"div",cls:"ag-skeleton-effect"}),$=_.node.rowIndex;if($!=null){let J=75+25*($%2===0?Math.sin($):Math.cos($));f.style.width=`${J}%`}this.getGui().appendChild(f);let z=this.getLocaleTextFunc(),Q=_.deferRender?z("ariaDeferSkeletonCellLoading","Cell is loading"):z("ariaSkeletonCellLoading","Row data is loading");W_(this.getGui(),Q)}refresh(_){return!1}},LU={moduleName:"CheckboxCellRenderer",version:c,userComponents:{agCheckboxCellRenderer:WU}},FU={moduleName:"SkeletonCellRenderer",version:c,userComponents:{agSkeletonCellRenderer:KU}};var DU=class extends A{constructor(){super(...arguments);this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(_={}){let f=_.source??"flex";if(_.viewportWidth!=null)this.flexViewportWidth=_.viewportWidth;let $=this.flexViewportWidth,{visibleCols:z,colDelayRenderSvc:Q}=this.beans,J=z.centerCols,q=-1;if(_.resizingCols){let B=new Set(_.resizingCols);for(let K=J.length-1;K>=0;K--)if(B.has(J[K])){q=K;break}}let X=!1,Y=J.map((B,K)=>{let L=B.getFlex(),F=L!=null&&L>0&&K>q;return X||(X=F),{col:B,isFlex:F,flex:Math.max(0,L??0),initialSize:B.getActualWidth(),min:B.getMinWidth(),max:B.getMaxWidth(),targetSize:0}});if(X)Q?.hideColumns("colFlex"),this.columnsHidden=!0;else if(this.columnsHidden)this.revealColumns(Q);if(!$||!X)return[];let Z=Y.length,G=Y.reduce((B,K)=>B+K.flex,0),E=$,U=(B,K)=>{B.frozenSize=K,B.col.setActualWidth(K,f),E-=K,G-=B.flex,Z-=1},H=(B)=>B.frozenSize!=null;for(let B of Y)if(!B.isFlex)U(B,B.initialSize);while(Z>0){let B=Math.round(G<1?E*G:E),K,L=0,F=0;for(let k of Y){if(H(k))continue;K=k,F+=B*(k.flex/G);let R=F-L,O=Math.round(R);k.targetSize=O,L+=O}if(K)K.targetSize+=B-L;let D=0;for(let k of Y){if(H(k))continue;let R=k.targetSize,O=Math.min(Math.max(R,k.min),k.max);D+=O-R,k.violationType=O===R?void 0:O0?"min":"max";for(let k of Y){if(H(k))continue;if(M==="all"||k.violationType===M)U(k,k.targetSize)}}if(!_.skipSetLeft)z.setLeftValues(f);if(_.updateBodyWidths)z.updateBodyWidths();let W=Y.filter((B)=>B.isFlex&&!B.violationType).map((B)=>B.col);if(_.fireResizedEvent){let B=Y.filter((L)=>L.initialSize!==L.frozenSize).map((L)=>L.col),K=Y.filter((L)=>L.flex).map((L)=>L.col);P1(this.eventSvc,B,!0,f,K)}return this.revealColumns(Q),W}revealColumns(_){if(this.columnsHidden)_?.revealColumns("colFlex"),this.columnsHidden=!1}initCol(_){let{flex:f,initialFlex:$}=_.colDef;if(f!==void 0)_.flex=f;else if($!==void 0)_.flex=$}setColFlex(_,f){_.flex=f??null,_.dispatchStateUpdatedEvent("flex")}},Bf=(_)=>{if(typeof _==="bigint")return _;let f;if(typeof _==="number")f=_;else if(typeof _==="string"){if(f=_.trim(),f==="")return null;if(f.endsWith("n"))f=f.slice(0,-1);if(!/^[+-]?\d+$/.test(f))return null}if(f==null)return null;try{return BigInt(f)}catch{return null}},NJ="T",MU=new RegExp(`[${NJ} ]`),kU=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${NJ}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function xf(_,f){return _.toString().padStart(f,"0")}function Q9(_,f=!0,$=NJ){if(!_)return null;let z=[_.getFullYear(),_.getMonth()+1,_.getDate()].map((Q)=>xf(Q,2)).join("-");if(f)z+=$+[_.getHours(),_.getMinutes(),_.getSeconds()].map((Q)=>xf(Q,2)).join(":");return z}function K1(_,f=!0){if(!_)return null;if(f)return[String(_.getFullYear()),String(_.getMonth()+1),xf(_.getDate(),2),xf(_.getHours(),2),`:${xf(_.getMinutes(),2)}`,`:${xf(_.getSeconds(),2)}`];return[_.getFullYear(),_.getMonth()+1,xf(_.getDate(),2)].map(String)}var gJ=["January","February","March","April","May","June","July","August","September","October","November","December"];function Uz(_,f=!1){return!!H$(_,f)}function SU(_){return Uz(_,!0)}function H$(_,f=!1,$){if(!_)return null;if(!$&&!kU.test(_))return null;let[z,Q]=_.split(MU);if(!z)return null;let J=z.split("-").map((H)=>Number.parseInt(H,10));if(J.filter((H)=>!isNaN(H)).length!==3)return null;let[q,X,Y]=J,Z=new Date(q,X-1,Y);if(Z.getFullYear()!==q||Z.getMonth()!==X-1||Z.getDate()!==Y)return null;if(!Q&&f)return null;if(!Q||Q==="00:00:00")return Z;let[G,E,U]=Q.split(":").map((H)=>Number.parseInt(H,10));if(G>=0&&G<24)Z.setHours(G);else if(f)return null;if(E>=0&&E<60)Z.setMinutes(E);else if(f)return null;if(U>=0&&U<60)Z.setSeconds(U);else if(f)return null;return Z}function e1(_,f,$){if(!f||!_)return;if(!$)return _[f];let z=f.split("."),Q=_;for(let J=0;Jnull,suppressKeyboardEvent:({node:_,event:f,column:$})=>f.key===S.SPACE&&$.isCellEditable(_)}},date({formatValue:_}){return{cellEditor:"agDateCellEditor",keyCreator:_}},dateString({formatValue:_}){return{cellEditor:"agDateStringCellEditor",keyCreator:_}},dateTime(_){return this.date(_)},dateTimeString(_){return this.dateString(_)},object({formatValue:_,colModel:f,colId:$}){return{cellEditorParams:{useFormatter:!0},comparator:(z,Q)=>{let J=f.getColDefCol($),q=J?.getColDef();if(!J||!q)return 0;let X=z==null?"":_({column:J,node:null,value:z}),Y=Q==null?"":_({column:J,node:null,value:Q});if(X===Y)return 0;return X>Y?1:-1},keyCreator:_}},text(){return{}}}}wireBeans(_){this.colModel=_.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(_)=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(_)})}processDataTypeDefinitions(){let _=this.getDefaultDataTypes(),f={},$={},z=(G)=>{return(E)=>{let{column:U,node:H,value:W}=E,B=U.getColDef().valueFormatter;if(B===G.groupSafeValueFormatter)B=G.valueFormatter;return this.beans.valueSvc.formatValue(U,H,W,B)}};for(let G of Object.keys(_)){let E=_[G],U={...E,groupSafeValueFormatter:X9(E,this.gos)};f[G]=U,$[G]=z(U)}let Q=this.gos.get("dataTypeDefinitions")??{},J={};for(let G of Object.keys(Q)){let E=Q[G],U=this.processDataTypeDefinition(E,Q,[G],_);if(U){if(f[G]=U,E.dataTypeMatcher)J[G]=E.dataTypeMatcher;$[G]=z(U)}}let{valueParser:q,valueFormatter:X}=_.object,{valueParser:Y,valueFormatter:Z}=f.object;this.hasObjectValueParser=Y!==q,this.hasObjectValueFormatter=Z!==X,this.formatValueFuncs=$,this.dataTypeDefinitions=f,this.dataTypeMatchers=this.sortKeysInMatchers(J,_)}sortKeysInMatchers(_,f){let $={..._};for(let z of AU)delete $[z],$[z]=_[z]??f[z].dataTypeMatcher;return $}processDataTypeDefinition(_,f,$,z){let Q,J=_.extendsDataType;if(_.columnTypes)this.isColumnTypeOverrideInDataTypeDefinitions=!0;if(_.extendsDataType===_.baseDataType){let q=z[J],X=f[J];if(q&&X)q=X;if(!q9(_,q,J))return;Q=J9(q,_)}else{if($.includes(J)){j(44);return}let q=f[J];if(!q9(_,q,J))return;let X=this.processDataTypeDefinition(q,f,[...$,J],z);if(!X)return;Q=J9(X,_)}return{...Q,groupSafeValueFormatter:X9(Q,this.gos)}}updateColDefAndGetColumnType(_,f,$){let{cellDataType:z}=f;if(z===void 0)z=_.cellDataType;let{field:Q}=f;if(z==null||z===!0)z=this.canInferCellDataType(_,f)?this.inferCellDataType(Q,$):!1;if(this.addFormulaCellEditorToColDef(_,f),!z){_.cellDataType=!1;return}let J=this.dataTypeDefinitions[z];if(!J){j(47,{cellDataType:z});return}if(_.cellDataType=z,J.groupSafeValueFormatter)_.valueFormatter=J.groupSafeValueFormatter;if(J.valueParser)_.valueParser=J.valueParser;if(!J.suppressDefaultProperties)this.setColDefPropertiesForBaseDataType(_,z,J,$);return J.columnTypes}addFormulaCellEditorToColDef(_,f){if(!(f.allowFormula??_.allowFormula)||f.cellEditor)return;_.cellEditor="agFormulaCellEditor"}addColumnListeners(_){if(!this.isPendingInference)return;let f=this.columnStateUpdatesPendingInference[_.getColId()];if(!f)return;let $=(z)=>{f.add(z.key)};_.__addEventListener("columnStateUpdated",$),this.columnStateUpdateListenerDestroyFuncs.push(()=>_.__removeEventListener("columnStateUpdated",$))}canInferCellDataType(_,f){let{gos:$}=this;if(!o($))return!1;let z={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(U6(f,z))return!1;let Q=f.type===null?_.type:f.type;if(Q){let J=$.get("columnTypes")??{};if(Sz(Q).some((X)=>{let Y=J[X.trim()];return Y&&U6(Y,z)}))return!1}return!U6(_,z)}inferCellDataType(_,f){if(!_)return;let $,z=this.getInitialData();if(z){let J=_.includes(".")&&!this.gos.get("suppressFieldDotNotation");$=e1(z,_,J)}else this.initWaitForRowData(f);if($==null)return;return Object.keys(this.dataTypeMatchers).find((J)=>this.dataTypeMatchers[J]($))??"object"}getInitialData(){let _=this.gos.get("rowData");if(_?.length)return _[0];else if(this.initialData)return this.initialData;else{let f=this.beans.rowModel.rootNode?._leafs;if(f?.length)return f[0].data}return null}initWaitForRowData(_){if(this.columnStateUpdatesPendingInference[_]=new Set,this.isPendingInference)return;this.isPendingInference=!0;let f=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:$,eventSvc:z}=this.beans;if(f&&$)$.shouldQueueResizeOperations=!0;let[Q]=this.addManagedEventListeners({rowDataUpdateStarted:(J)=>{let{firstRowData:q}=J;if(!q)return;if(Q?.(),this.isPendingInference=!1,this.processColumnsPendingInference(q,f),this.columnStateUpdatesPendingInference={},f)$?.processResizeOperations();z.dispatchEvent({type:"dataTypesInferred"})}})}processColumnsPendingInference(_,f){this.initialData=_;let $=[];this.destroyColumnStateUpdateListeners();let z={},Q={};for(let J of Object.keys(this.columnStateUpdatesPendingInference)){let q=this.columnStateUpdatesPendingInference[J],X=this.colModel.getCol(J);if(!X)continue;let Y=X.getColDef();if(!this.resetColDefIntoCol(X,"cellDataTypeInferred"))continue;let Z=X.getColDef();if(f&&Z.type&&Z.type!==Y.type){let G=TU(X,q);if(G.rowGroup&&G.rowGroupIndex==null)z[J]=G;if(G.pivot&&G.pivotIndex==null)Q[J]=G;$.push(G)}}if(f)$.push(...this.generateColumnStateForRowGroupAndPivotIndexes(z,Q));if($.length)d_(this.beans,{state:$},"cellDataTypeInferred");this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(_,f){let $={},{rowGroupColsSvc:z,pivotColsSvc:Q}=this.beans;return z?.restoreColumnOrder($,_),Q?.restoreColumnOrder($,f),Object.values($)}resetColDefIntoCol(_,f){let $=_.getUserProvidedColDef();if(!$)return!1;let z=n0(this.beans,$,_.getColId());return _.setColDef(z,$,f),!0}getDateStringTypeDefinition(_){let{dateString:f}=this.dataTypeDefinitions;if(!_)return f;return this.getDataTypeDefinition(_)??f}getDateParserFunction(_){return this.getDateStringTypeDefinition(_).dateParser}getDateFormatterFunction(_){return this.getDateStringTypeDefinition(_).dateFormatter}getDateIncludesTimeFlag(_){return _==="dateTime"||_==="dateTimeString"}getDataTypeDefinition(_){let f=_.getColDef();if(!f.cellDataType)return;return this.dataTypeDefinitions[f.cellDataType]}getBaseDataType(_){return this.getDataTypeDefinition(_)?.baseDataType}checkType(_,f){if(f==null)return!0;let $=this.getDataTypeDefinition(_)?.dataTypeMatcher;if(!$)return!0;if(_.getColDef().allowFormula&&this.beans.formula?.isFormula(f))return!0;return $(f)}validateColDef(_,f,$,z){if(_.cellDataType==="object"){let Q=(Y)=>{return Y?.cellDataType==null||Y?.cellDataType===!0},J=Q(f)&&Q($),q=(Y)=>j(48,{property:Y,inferred:J,colId:z}),{object:X}=this.dataTypeDefinitions;if(_.valueFormatter===X.groupSafeValueFormatter&&!this.hasObjectValueFormatter)q("Formatter");if(_.editable&&_.valueParser===X.valueParser&&!this.hasObjectValueParser)q("Parser")}}postProcess(_){let f=_.cellDataType;if(!f||typeof f!=="string")return;let{dataTypeDefinitions:$,beans:z,formatValueFuncs:Q}=this,J=$[f];if(!J)return;z.colFilter?.setColDefPropsForDataType(_,J,Q[f])}getFormatValue(_){return this.formatValueFuncs[_]}isColPendingInference(_){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[_]}setColDefPropertiesForBaseDataType(_,f,$,z){let Q=this.formatValueFuncs[f],J=this.columnDefinitionPropsPerDataType[$.baseDataType]({colDef:_,cellDataType:f,colModel:this.colModel,dataTypeDefinition:$,colId:z,formatValue:Q,filterModuleBean:this.beans.filterManager});if(_.cellEditor==="agFormulaCellEditor"&&J.cellEditor!==_.cellEditor)J.cellEditor=_.cellEditor;Object.assign(_,J)}getDateObjectTypeDef(_){let f=this.getLocaleTextFunc(),$=this.getDateIncludesTimeFlag(_);return{baseDataType:_,valueParser:(z)=>H$(z.newValue&&String(z.newValue)),valueFormatter:(z)=>{if(z.value==null)return"";if(!(z.value instanceof Date)||isNaN(z.value.getTime()))return f("invalidDate","Invalid Date");return Q9(z.value,$)??""},dataTypeMatcher:(z)=>z instanceof Date}}getDateStringTypeDef(_){let f=this.getDateIncludesTimeFlag(_);return{baseDataType:_,dateParser:($)=>H$($)??void 0,dateFormatter:($)=>Q9($??null,f)??void 0,valueParser:($)=>Uz(String($.newValue))?$.newValue:null,valueFormatter:($)=>Uz(String($.value))?String($.value):"",dataTypeMatcher:($)=>typeof $==="string"&&Uz($)}}getDefaultDataTypes(){let _=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:(f)=>f.newValue?.trim?.()===""?null:Number(f.newValue),valueFormatter:(f)=>{if(f.value==null)return"";if(typeof f.value!=="number"||isNaN(f.value))return _("invalidNumber","Invalid Number");return String(f.value)},dataTypeMatcher:(f)=>typeof f==="number"},bigint:{baseDataType:"bigint",valueParser:(f)=>{let{newValue:$}=f;if($==null)return null;if(typeof $==="string"&&$.trim()==="")return null;return Bf($)},valueFormatter:(f)=>{if(f.value==null)return"";if(typeof f.value!=="bigint")return _("invalidBigInt","Invalid BigInt");return String(f.value)},dataTypeMatcher:(f)=>typeof f==="bigint"},text:{baseDataType:"text",valueParser:(f)=>f.newValue===""?null:$$(f.newValue),dataTypeMatcher:(f)=>typeof f==="string"},boolean:{baseDataType:"boolean",valueParser:(f)=>{if(f.newValue==null)return f.newValue;return f.newValue?.trim?.()===""?null:String(f.newValue).toLowerCase()==="true"},valueFormatter:(f)=>f.value==null?"":String(f.value),dataTypeMatcher:(f)=>typeof f==="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:(f)=>typeof f==="string"&&SU(f)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:(f)=>$$(f.value)??""}}}destroyColumnStateUpdateListeners(){for(let _ of this.columnStateUpdateListenerDestroyFuncs)_();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function J9(_,f){let $={..._,...f};if(_.columnTypes&&f.columnTypes&&f.appendColumnTypes)$.columnTypes=[...Sz(_.columnTypes),...Sz(f.columnTypes)];return $}function q9(_,f,$){if(!f)return j(45,{parentCellDataType:$}),!1;if(f.baseDataType!==_.baseDataType)return j(46),!1;return!0}var jU=(_)=>typeof _==="bigint"||typeof _==="number",VU=(_)=>_==="number"||_==="bigint";function X9(_,f){if(!_.valueFormatter)return;return($)=>{let{node:z,colDef:Q,column:J,value:q}=$;if(z?.group){let X=(Q.pivotValueColumn??J).getAggFunc();if(X){if(X==="first"||X==="last")return _.valueFormatter($);let{baseDataType:Y}=_;if(VU(Y)&&X!=="count"){if(jU(q))return _.valueFormatter($);if(q==null)return;if(typeof q==="object"){if(typeof q.toNumber==="function")return _.valueFormatter({...$,value:q.toNumber()});if("value"in q)return _.valueFormatter({...$,value:q.value})}}return}}else if(f.get("groupHideOpenParents")&&$.column.isRowGroupActive()){if(typeof $.value==="string"&&!_.dataTypeMatcher?.($.value))return}return _.valueFormatter($)}}function OU(_,f,$,z){if(!f[$])return!1;let Q=_[$];if(Q===null)return f[$]=!1,!1;else return z===void 0?!!Q:Q===z}function PU(_,f){if(_==null)return f==null?0:-1;if(f==null)return 1;let $=Bf(_),z=Bf(f);if($!=null&&z!=null){if($===z)return 0;return $>z?1:-1}return 0}function vU(_,f){if(_==null)return f==null?0:-1;if(f==null)return 1;let $=Y9(_),z=Y9(f);if($!=null&&z!=null){if($===z)return 0;return $>z?1:-1}return 0}function Y9(_){let f=Bf(_);if(f==null)return null;return f<0n?-f:f}function U6(_,f){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([$,z])=>OU(_,f,$,z))}function TU(_,f){let $=tX(_);for(let z of f)if(delete $[z],z==="rowGroup")delete $.rowGroupIndex;else if(z==="pivot")delete $.pivotIndex;return $}var IU={moduleName:"DataType",version:c,beans:[RU],dependsOn:[LU]},yU={moduleName:"ColumnFlex",version:c,beans:[DU]};var bU=class extends A{constructor(){super(...arguments);this.beanName="colNames"}getDisplayNameForColumn(_,f,$=!1){if(!_)return null;let z=this.getHeaderName(_.getColDef(),_,null,null,f),{aggColNameSvc:Q}=this.beans;if($&&Q)return Q.getHeaderName(_,z);return z}getDisplayNameForProvidedColumnGroup(_,f,$){let z=f?.getColGroupDef();if(z)return this.getHeaderName(z,null,_,f,$);return null}getDisplayNameForColumnGroup(_,f){return this.getDisplayNameForProvidedColumnGroup(_,_.getProvidedColumnGroup(),f)}getHeaderName(_,f,$,z,Q){let J=_.headerValueGetter;if(J){let q=C(this.gos,{colDef:_,column:f,columnGroup:$,providedColumnGroup:z,location:Q});if(typeof J==="function")return J(q);else if(typeof J==="string")return this.beans.expressionSvc?.evaluate(J,q)??null;return""}else if(_.headerName!=null)return _.headerName;else if(_.field)return Y4(_.field);return""}},CU=class extends A{constructor(){super(...arguments);this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(_){this.visibleCols=_.visibleCols,this.colModel=_.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(_,f,$=!1){let{visibleCols:z}=this,Q=z.isBodyWidthDirty;if(_===this.scrollWidth&&f===this.scrollPosition&&!Q)return;if(this.scrollWidth=_,this.scrollPosition=f,z.isBodyWidthDirty=!0,this.gos.get("enableRtl")){let q=z.bodyWidth;this.viewportLeft=q-f-_,this.viewportRight=q-f}else this.viewportLeft=f,this.viewportRight=_+f;if(this.colModel.ready)this.checkViewportColumns($)}getColumnHeadersToRender(_){switch(_){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(_,f){let $;switch(_){case"left":$=this.rowsOfHeadersToRenderLeft[f];break;case"right":$=this.rowsOfHeadersToRenderRight[f];break;default:$=this.rowsOfHeadersToRenderCenter[f];break}return $??[]}extractViewportColumns(){let _=this.visibleCols.centerCols;if(this.isColumnVirtualisationSuppressed())this.colsWithinViewport=_,this.headerColsWithinViewport=_;else this.colsWithinViewport=_.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=_.filter(this.isColumnInHeaderViewport.bind(this))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(_){if(_.isAutoHeaderHeight()||wU(_))return!0;return this.isColumnInRowViewport(_)}isColumnInRowViewport(_){if(_.isAutoHeight())return!0;let f=_.getLeft()||0,$=f+_.getActualWidth(),z=this.viewportLeft-200,Q=this.viewportRight+200,J=fQ&&$>Q;return!J&&!q}getViewportColumns(){let{leftCols:_,rightCols:f}=this.visibleCols;return this.colsWithinViewport.concat(_).concat(f)}getColsWithinViewport(_){if(!this.colModel.colSpanActive)return this.colsWithinViewport;let f=(J)=>{let q=J.getLeft();return v(q)&&q>this.viewportLeft},$=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:z}=this,Q=z.centerCols;return z.getColsForRow(_,Q,$,f)}checkViewportColumns(_=!1){if(this.extractViewport())this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:_})}calculateHeaderRows(){let{leftCols:_,rightCols:f}=this.visibleCols;this.columnsToRenderLeft=_,this.columnsToRenderRight=f,this.columnsToRenderCenter=this.colsWithinViewport;let $=(z)=>{let Q=new Set,J={};for(let q of z){let X=q.getParent(),Y=q.isSpanHeaderHeight();while(X){if(Q.has(X))break;if(Y&&X.isPadding()){X=X.getParent();continue}let G=X.getProvidedColumnGroup().getLevel();J[G]??(J[G]=[]),J[G].push(X),Q.add(X),X=X.getParent()}}return J};this.rowsOfHeadersToRenderLeft=$(_),this.rowsOfHeadersToRenderRight=$(f),this.rowsOfHeadersToRenderCenter=$(this.headerColsWithinViewport)}extractViewport(){let _=(z)=>`${z.getId()}-${z.getPinned()||"normal"}`;this.extractViewportColumns();let f=this.getViewportColumns().map(_).join("#"),$=this.colsWithinViewportHash!==f;if($)this.colsWithinViewportHash=f,this.calculateHeaderRows();return $}};function wU(_){while(_){if(_.isAutoHeaderHeight())return!0;_=_.getParent()}return!1}var xU=class extends A{constructor(){super(...arguments);this.beanName="agCompUtils"}adaptFunction(_,f){if(!_.cellRenderer)return null;class ${refresh(){return!1}getGui(){return this.eGui}init(z){let Q=f(z),J=typeof Q;if(J==="string"||J==="number"||J==="boolean"){this.eGui=o6(""+Q+"");return}if(Q==null){this.eGui=z_({tag:"span"});return}this.eGui=Q}}return $}},NU={moduleName:"CellRendererFunction",version:c,beans:[xU]},gU=class extends j_{constructor(){super(...arguments);this.beanName="registry"}registerDynamicBeans(_){if(_){this.dynamicBeans??(this.dynamicBeans={});for(let f of Object.keys(_))this.dynamicBeans[f]=_[f]}}createDynamicBean(_,f,...$){if(!this.dynamicBeans)throw Error(this.getDynamicError(_,!0));let z=this.dynamicBeans[_];if(z==null){if(f)throw Error(this.getDynamicError(_,!1));return}return new z(...$)}};function hU(_){return typeof _==="object"&&!!_.getComp}var uU=class extends gU{constructor(){super(...arguments);this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){let _=this.gos.get("components");if(_!=null)for(let f of Object.keys(_))this.jsComps[f]=_[f]}registerModule(_){let{icons:f,userComponents:$,dynamicBeans:z,selectors:Q}=_;if($){let J=(q,X,Y,Z)=>{if(this.agGridDefaults[q]=X,Y||Z)this.agGridDefaultOverrides[q]={params:Y,processParams:Z}};for(let q of Object.keys($)){let X=$[q];if(hU(X))X=X.getComp(this.beans);if(typeof X==="object"){let{classImp:Y,params:Z,processParams:G}=X;J(q,Y,Z,G)}else J(q,X)}}this.registerDynamicBeans(z);for(let J of Q??[])this.selectors[J.selector]=J;if(f)for(let J of Object.keys(f))this.icons[J]=f[J]}getUserComponent(_,f){let $=(X,Y,Z,G)=>({componentFromFramework:Y,component:X,params:Z,processParams:G}),{frameworkOverrides:z}=this.beans,Q=z.frameworkComponent(f,this.gos.get("components"));if(Q!=null)return $(Q,!0);let J=this.jsComps[f];if(J){let X=z.isFrameworkComponent(J);return $(J,X)}let q=this.agGridDefaults[f];if(q){let X=this.agGridDefaultOverrides[f];return $(q,!1,X?.params,X?.processParams)}return this.beans.validation?.missingUserComponent(_,f,this.agGridDefaults,this.jsComps),null}getSelector(_){return this.selectors[_]}getIcon(_){return this.icons[_]}getDynamicError(_,f){if(f)return $0(279,{name:_});return this.beans.validation?.missingDynamicBean(_)??$0(256)}},iU=23,mU=class extends A{constructor(){super(...arguments);this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(let _ of this.readyCallbacks)_(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){let _=Object.values(this.params);this.ready=_.length===iU&&_.every((f)=>{return f?.isAlive()??!1})}whenReady(_,f){if(this.ready)f(this.params);else this.readyCallbacks.push(f);_.addDestroyFunc(()=>{let $=this.readyCallbacks.indexOf(f);if($>=0)this.readyCallbacks.splice($,1)})}register(_,f){if(this.params[_]=f,this.updateReady(),this.ready)this.dispatchLocalEvent({type:"ready"});f.addDestroyFunc(()=>{this.updateReady()})}get(_){return this.params[_]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){let{leftHeader:_,centerHeader:f,rightHeader:$}=this.params;return[_,$,f]}getHeaderRowContainerCtrl(_){let f=this.params;switch(_){case"left":return f.leftHeader;case"right":return f.rightHeader;default:return f.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},cU=':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',hJ=typeof window!=="object"||!window?.document?.fonts?.forEach,Pz=!1,rf=(_,f,$,z,Q,J,q=!1)=>{if(hJ||Pz)return;let X=_;if(z)X=`@layer ${CSS.escape(z).replaceAll("\\.",".")} { ${_} }`;let Y=v0.map.get(f);if(!Y)Y=[],v0.map.set(f,Y);if(Y.some((U)=>U.injectedCss===X))return;let Z=document.createElement("style");if(J)Z.setAttribute("nonce",J);Z.dataset.agCss=$,Z.dataset.agCssVersion=c,Z.textContent=X;let G={rawCss:_,injectedCss:X,el:Z,priority:Q,isParams:q},E;for(let U of Y){if(U.priority>Q)break;E=U}if(E){E.el.after(Z);let U=Y.indexOf(E);Y.splice(U+1,0,G)}else{if(f.nodeName==="STYLE")f.after(Z);else f.insertBefore(Z,f.querySelector(":not(title, meta)"));Y.push(G)}},lX=(_,f,$,z)=>{rf(cU,_,"shared",f,0,$),z?.forEach((Q,J)=>Q.forEach((q)=>rf(q,_,J,f,0,$)))},pU=(_,f,$,z,Q,J)=>{if(hJ||Pz)return;let q=v0.grids.get(_);if(!q)v0.grids.set(_,{styleContainer:z,paramsCss:f});else q.paramsCss=f;if(w6(z),f&&$)rf(f,z,$,Q,2,J,!0)},nU=(_)=>{let f=v0.grids.get(_)?.styleContainer;if(!f)return;if(v0.grids.delete(_),Array.from(v0.grids.values()).some((z)=>z.styleContainer===f))w6(f);else w6(f,!0),v0.map.delete(f)},w6=(_,f=!1)=>{let $=new Set;for(let Q of v0.grids.values())if(Q.styleContainer===_)$.add(Q.paramsCss);let z=v0.map.get(_)??[];for(let Q=z.length-1;Q>=0;Q--)if(f||z[Q].isParams&&!$.has(z[Q].rawCss))z[Q].el.remove(),z.splice(Q,1)},sX=()=>{let _=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map),f=_.get(c);if(!f)f={map:new WeakMap,grids:new Map,paramsId:0},_.set(c,f);return f},v0=sX(),k0=(_)=>{return new aX(_)},Jf="$default",dU=0,aX=class{constructor({feature:_,params:f,modeParams:$={},css:z,cssImports:Q}){this.feature=_,this.css=z,this.cssImports=Q,this.modeParams={[Jf]:{...$[Jf]??{},...f??{}},...$}}use(_,f,$){let z=this._inject;if(z==null){let{css:Q}=this;if(Q){let J=`ag-theme-${this.feature??"part"}-${++dU}`;if(typeof Q==="function")Q=Q();Q=`:where(.${J}) { -${Q} -} -`;for(let q of this.cssImports??[])Q=`@import url(${JSON.stringify(q)}); -${Q}`;z={css:Q,class:J}}else z=!1;this._inject=z}if(z&&_)rf(z.css,_,z.class,f,1,$);return z?z.class:!1}},tU=(_)=>_.replace(/[A-Z]|\d+/g,(f)=>`-${f}`).toLowerCase(),uJ=(_)=>`--ag-${tU(_)}`,w0=(_)=>`var(${uJ(_)})`,rU=(_,f,$)=>Math.max(f,Math.min($,_)),lU=(_)=>{let f=new Map;return($)=>{let z=$;if(!f.has(z))f.set(z,_($));return f.get(z)}},O0=(_)=>({ref:"accentColor",mix:_}),s_=(_)=>({ref:"foregroundColor",mix:_}),_0=(_)=>({ref:"foregroundColor",mix:_,onto:"backgroundColor"}),sU=(_)=>({ref:"foregroundColor",mix:_,onto:"headerBackgroundColor"}),x_={ref:"backgroundColor"},hf={ref:"foregroundColor"},P0={ref:"accentColor"},vz={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:s_(0.15),chromeBackgroundColor:_0(0.02),browserColorScheme:"light"},aU={...vz,textColor:hf,accentColor:"#2196f3",invalidColor:"#e02525",fontFamily:["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],subtleTextColor:{ref:"textColor",mix:0.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,fontWeight:"inherit",focusShadow:{spread:3,color:O0(0.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:0.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:x_,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:0.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:P0,toggleButtonOffBackgroundColor:_0(0.3),toggleButtonSwitchBackgroundColor:x_,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:0.25}},panelBackgroundColor:x_,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,dialogShadow:{ref:"popupShadow"},dialogBorder:{color:s_(0.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:s_(0.2)},menuBackgroundColor:_0(0.03),menuTextColor:_0(0.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},oU=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],eU=lU((_)=>{return _=_.toLowerCase(),oU.find((f)=>_.endsWith(f.toLowerCase()))??"length"}),qQ=(_)=>{if(typeof _==="object"&&_?.ref)return w0(_.ref);if(typeof _==="string")return _;if(typeof _==="number")return String(_);return!1},iJ=(_)=>{if(typeof _==="string")return _;if(typeof _==="object"&&_&&"ref"in _){let f=w0(_.ref);if(_.mix==null)return f;return`color-mix(in srgb, ${_.onto?w0(_.onto):"transparent"}, ${f} ${rU(_.mix*100,0,100)}%)`}return!1},_H=qQ,L1=(_)=>{if(typeof _==="string")return _;if(typeof _==="number")return`${_}px`;if(typeof _==="object"&&_&&"calc"in _)return`calc(${_.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,($)=>$[0]==="-"?$:" "+w0($)+" ")})`;if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return!1},fH=qQ,x6=(_,f)=>{if(typeof _==="string")return _;if(_===!0)return x6({},f);if(_===!1)return f==="columnBorder"?x6({color:"transparent"},f):"none";if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return oX(_.style??"solid")+" "+L1(_.width??{ref:"borderWidth"})+" "+iJ(_.color??{ref:"borderColor"})},Z9=(_)=>{return[L1(_.offsetX??0),L1(_.offsetY??0),L1(_.radius??0),L1(_.spread??0),iJ(_.color??{ref:"foregroundColor"}),..._.inset?["inset"]:[]].join(" ")},$H=(_)=>{if(typeof _==="string")return _;if(_===!1)return"none";if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);if(Array.isArray(_))return _.map(Z9).join(", ");return Z9(_)},oX=qQ,eX=(_)=>{if(typeof _==="string")return _.includes(",")?_:G9(_);if(typeof _==="object"&&_&&"googleFont"in _)return eX(_.googleFont);if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);if(Array.isArray(_))return _.map((f)=>{if(typeof f==="object"&&"googleFont"in f)f=f.googleFont;return G9(f)}).join(", ");return!1},G9=(_)=>/^[\w-]+$|\w\(/.test(_)?_:JSON.stringify(_),zH=qQ,_5=(_)=>{if(typeof _==="string")return _;if(typeof _==="object"&&_&&"url"in _)return`url(${JSON.stringify(_.url)})`;if(typeof _==="object"&&_&&"svg"in _)return _5({url:`data:image/svg+xml,${encodeURIComponent(_.svg)}`});if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return!1},QH=(_,f,$)=>{if(typeof _==="string")return _;if(typeof _==="number"){if(_>=10)$?.warn(104,{value:_,param:f});return`${_}s`}if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return!1},JH={color:iJ,colorScheme:_H,length:L1,scale:fH,border:x6,borderStyle:oX,shadow:$H,image:_5,fontFamily:eX,fontWeight:zH,duration:QH},qH=(_,f,$)=>{let z=eU(_);return JH[z](f,_,$)};var XH=(_,f)=>new f5({themeLogger:_,overridePrefix:f}),f5=class _{constructor(f,$=[]){this.params=f,this.parts=$}withPart(f){if(typeof f==="function")f=f();if(!(f instanceof aX))return this.params.themeLogger.preInitErr(259,"Invalid part",{part:f}),this;return new _(this.params,[...this.parts,f])}withoutPart(f){return this.withPart(k0({feature:f}))}withParams(f,$=Jf){return this.withPart(k0({modeParams:{[$]:f}}))}_startUse({styleContainer:f,cssLayer:$,nonce:z,loadThemeGoogleFonts:Q,moduleCss:J}){if(hJ)return;if(Pz)return;ZH(),lX(f,$,z,J);let q=YH(this);if(q.length>0){for(let X of q)if(Q)GH(X,z)}for(let X of this.parts)X.use(f,$,z)}_getCssClass(){if(Pz)return"ag-theme-quartz";return this._cssClassCache??(this._cssClassCache=E9(this.parts).map((f)=>f.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName=`ag-theme-params-${++sX().paramsId}`)}_getModeParams(){let f=this._paramsCache;if(!f){let $={[Jf]:{...aU}};for(let z of E9(this.parts))for(let Q of Object.keys(z.modeParams)){let J=z.modeParams[Q];if(J){let q=$[Q]??($[Q]={}),X=new Set;for(let Y of Object.keys(J)){let Z=J[Y];if(Z!==void 0)q[Y]=Z,X.add(Y)}if(Q===Jf)for(let Y of Object.keys($)){let Z=$[Y];if(Y!==Jf)for(let G of X)delete Z[G]}}}this._paramsCache=f=$}return f}_getParamsCss(){if(!this._paramsCssCache){let f="",$="",z=this._getModeParams(),{overridePrefix:Q,themeLogger:J}=this.params,q=Q?`--ag-${Q}-`:void 0;for(let Z of Object.keys(z)){let G=z[Z];if(Z!==Jf){let U=`:where([data-ag-theme-mode="${typeof CSS==="object"?CSS.escape(Z):Z}"]) & { -`;f+=U,$+=U}for(let E of Object.keys(G).sort()){let U=G[E],H=qH(E,U,J);if(H===!1)J.error(107,{key:E,value:U});else{let W=uJ(E),B=q?W.replace("--ag-",q):W,K=W.replace("--ag-","--ag-inherited-");f+=` ${W}: var(${K}, ${H}); -`,$+=` ${K}: var(${B}); -`}}if(Z!==Jf)f+=`} -`,$+=`} -`}let X=`:where(.${this._getParamsClassName()})`,Y=`${X} { -${f}} -`;Y+=`:has(> ${X}):not(${X}) { -${$}} -`,this._paramsCssCache=Y}return this._paramsCssCache}},E9=(_)=>{let f=new Map;for(let z of _)f.set(z.feature,z);let $=[];for(let z of _)if(!z.feature||f.get(z.feature)===z)$.push(z);return $},YH=(_)=>{let f=new Set,$=(J)=>{if(Array.isArray(J))J.forEach($);else{let q=J?.googleFont;if(typeof q==="string")f.add(q)}};return Object.values(_._getModeParams()).flatMap((J)=>Object.values(J)).forEach($),Array.from(f).sort()},U9=!1,ZH=()=>{if(U9)return;U9=!0;for(let _ of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))_.remove()},GH=async(_,f)=>{let $=`@import url('https://${EH}/css2?family=${encodeURIComponent(_)}:wght@100;200;300;400;500;600;700;800;900&display=swap'); -`;rf($,document.head,`googleFont:${_}`,void 0,0,f)},EH="fonts.googleapis.com",H9={changeKey:"listItemHeight",type:"length",defaultValue:24},UH=class extends j_{constructor(){super(...arguments);this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(_){this.eRootDiv=_.eRootDiv}postConstruct(){let{gos:_,eRootDiv:f}=this;_.setInstanceDomData(f);let $=_.get("themeStyleContainer"),z=typeof ShadowRoot<"u",Q=z&&f.getRootNode()instanceof ShadowRoot;if(this.eStyleContainer=(typeof $==="function"?$():$)??(Q?f:document.head),!$&&!Q&&z)HH(f,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this));this.cssLayer=_.get("themeCssLayer"),this.styleNonce=_.get("styleNonce"),this.addManagedPropertyListener("theme",()=>this.handleThemeChange()),this.handleThemeChange(),this.getSizeEl(H9),this.initVariables(),this.addDestroyFunc(()=>nU(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(_,f=[]){let{theme:$}=this,z=$?$._getCssClass():this.applyLegacyThemeClasses();for(let Q of Array.from(_.classList))if(Q.startsWith("ag-theme-"))_.classList.remove(Q);if(z){let Q=_.className;_.className=`${Q}${Q?" ":""}${z}${f?.length?" "+f.join(" "):""}`}}applyLegacyThemeClasses(){let _="";this.mutationObserver.disconnect();let f=this.eRootDiv;while(f){let $=!1;for(let z of Array.from(f.classList))if(z.startsWith("ag-theme-"))$=!0,_=_?`${_} ${z}`:z;if($)this.mutationObserver.observe(f,{attributes:!0,attributeFilter:["class"]});f=f.parentElement}return _}addGlobalCSS(_,f){if(this.theme)rf(_,this.eStyleContainer,f,this.cssLayer,0,this.styleNonce);else this.globalCSS.push([_,f])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(H9)}getCSSVariablePixelValue(_){let f=this.lastKnownValues.get(_);if(f!=null)return f;let $=this.measureSizeEl(_);if($==="detached"||$==="no-styles"){if(_.cacheDefault)this.lastKnownValues.set(_,_.defaultValue);return _.defaultValue}return this.lastKnownValues.set(_,$),$}measureSizeEl(_){let f=this.getSizeEl(_);if(f.offsetParent==null)return"detached";let $=f.offsetWidth;if($===H6)return"no-styles";return this.sizesMeasured=!0,$}getMeasurementContainer(){let _=this.eMeasurementContainer;if(!_)_=this.eMeasurementContainer=B_({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(_);return _}getSizeEl(_){let f=this.sizeEls.get(_);if(f)return f;let $=this.getMeasurementContainer();f=B_({tag:"div"});let z=this.setSizeElStyles(f,_);$.appendChild(f),this.sizeEls.set(_,f);let{type:Q,noWarn:J}=_;if(Q!=="length"&&Q!=="border")return f;let q=this.measureSizeEl(_);if(q==="no-styles"&&!J)this.varError(z,_.defaultValue);let X=S0(this.beans,f,()=>{let Y=this.measureSizeEl(_);if(Y==="detached"||Y==="no-styles")return;if(this.lastKnownValues.set(_,Y),Y!==q)q=Y,this.fireStylesChangedEvent(_.changeKey)});return this.addDestroyFunc(()=>X()),f}setSizeElStyles(_,f){let{changeKey:$,type:z}=f,Q=uJ($);if(z==="border"){if(Q.endsWith("-width"))Q=Q.slice(0,-6);_.className="ag-measurement-element-border",_.style.setProperty("--ag-internal-measurement-border",`var(${Q}, solid ${H6}px)`)}else _.style.width=`var(${Q}, ${H6}px)`;return Q}handleThemeChange(){let{gos:_,theme:f}=this,$=_.get("theme"),z;if($==="legacy")z=void 0;else{let Q=$??this.getDefaultTheme();if(Q instanceof f5)z=Q;else this.themeError(Q)}if(z!==f)this.handleNewTheme(z);this.postProcessThemeChange(z,$)}handleNewTheme(_){let{gos:f,eRootDiv:$,globalCSS:z}=this,Q=this.getAdditionalCss();if(_){lX(this.eStyleContainer,this.cssLayer,this.styleNonce,Q);for(let[J,q]of z)rf(J,this.eStyleContainer,q,this.cssLayer,0,this.styleNonce);z.length=0}this.theme=_,_?._startUse({loadThemeGoogleFonts:f.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:Q}),pU(this,_?._getParamsCss()??null,_?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses($),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(_){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${_}Changed`]:!0})}},H6=15538,HH=(_,f,$)=>{let z=60,Q=setInterval(()=>{if(typeof ShadowRoot<"u"&&_.getRootNode()instanceof ShadowRoot)f(),clearInterval(Q);if(_.isConnected||--z<0)clearInterval(Q)},1000);$(()=>clearInterval(Q))},WH=".ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:\"\";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:\"\";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:\"\";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:\"\";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:\"\";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:\"\";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:\"\";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:\"\";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path(\"M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z\");color:var(--ag-icon-button-active-color)}}",BH={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarPanelAnimationDuration:0,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:x_,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},cellFontSize:{ref:"dataFontSize"},cellFontWeight:{ref:"fontWeight"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:P0,rangeSelectionBackgroundColor:O0(0.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:O0(0.5),rangeHeaderHighlightColor:sU(0.08),rowNumbersSelectedColor:O0(0.5),rowHoverColor:O0(0.08),columnHoverColor:O0(0.05),selectedRowBackgroundColor:O0(0.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:0.66},dataBackgroundColor:x_,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{ref:"rowHeight",calc:"max(rowHeight, 22px)"},dragHandleColor:s_(0.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:s_(0.1),iconButtonActiveColor:P0,iconButtonActiveBackgroundColor:O0(0.28),iconButtonActiveIndicatorColor:P0,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:s_(0.8),cellEditingBorder:{color:P0},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.25},columnSelectIndentSize:{ref:"iconSize"},toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:s_(0.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:s_(0.13)},selectCellBackgroundColor:s_(0.07),selectCellBorder:{color:s_(0.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:x_,filterPanelApplyButtonBackgroundColor:P0,columnPanelApplyButtonColor:x_,columnPanelApplyButtonBackgroundColor:P0,filterPanelCardSubtleColor:{ref:"textColor",mix:0.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:hf,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:hf,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:s_(0.15),statusBarLabelColor:hf,statusBarLabelFontWeight:500,statusBarValueColor:hf,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2},KH=".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}",$5={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},LH={...$5,cellBatchEditTextColor:"#f3d0b3"},FH=()=>k0({feature:"batchEditStyle",params:$5,css:KH}),DH=FH(),MH=":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}",kH={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}};var SH=()=>k0({feature:"buttonStyle",params:{...kH,buttonBackgroundColor:x_,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:P0}},css:MH}),AH=SH();var RH=".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}";var jH=()=>{return k0({feature:"columnDropStyle",css:RH})},z5=jH();var VH={formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:0.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:0.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:0.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:0.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:0.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:0.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:0.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}}},OH=()=>k0({feature:"formulaStyle",params:VH}),PH=OH(),vH={warn:(..._)=>{j(_[0],_[1])},error:(..._)=>{e(_[0],_[1])},preInitErr:(..._)=>{r1(_[0],_[2],_[1])}},TH=()=>XH(vH).withParams(BH).withPart(AH).withPart(z5).withPart(DH).withPart(PH),IH='.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}',yH=()=>k0({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:x_,checkboxUncheckedBorderColor:_0(0.3),checkboxCheckedBackgroundColor:P0,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:''},checkboxCheckedShapeColor:x_,checkboxIndeterminateBackgroundColor:_0(0.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:''},checkboxIndeterminateShapeColor:x_,radioCheckedShapeImage:{svg:''}},css:IH}),bH=yH();var Q5=()=>({...vz,...LH,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:_0(0.05),rowHoverColor:O0(0.15),selectedRowBackgroundColor:O0(0.2),menuBackgroundColor:_0(0.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:hf,columnPanelApplyButtonColor:hf,findMatchColor:x_,findActiveMatchColor:x_,checkboxUncheckedBorderColor:_0(0.4),toggleButtonOffBackgroundColor:_0(0.4),rowBatchEditBackgroundColor:_0(0.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"});var CH=()=>({...Q5(),backgroundColor:"#1f2836"});var wH=()=>k0({feature:"colorScheme",params:vz,modeParams:{light:vz,dark:Q5(),"dark-blue":CH()}}),xH=wH();var J5={aggregation:'',arrows:'',asc:'',cancel:'',chart:'',"color-picker":'',columns:'',contracted:'',copy:'',cross:'',csv:'',cut:'',desc:'',down:'',excel:'',expanded:'',eye:'',"eye-slash":'',filter:'',first:'',grip:'',group:'',last:'',left:'',linked:'',loading:'',maximize:'',menu:'',"menu-alt":'',minimize:'',minus:'',next:'',none:'',"not-allowed":'',paste:'',pin:'',pivot:'',plus:'',previous:'',right:'',save:'',settings:'',"small-left":'',"small-right":'',tick:'',"tree-closed":'',"tree-indeterminate":'',"tree-open":'',unlinked:'',up:''},q5={aasc:'',adesc:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"column-arrow":'',edit:'',"filter-add":'',"pinned-bottom":'',"pinned-top":'',"small-down":'',"small-up":'',"un-pin":''},NH=(_={})=>{let f="";for(let $ of[...Object.keys(J5),...Object.keys(q5)]){let z=gH($,_.strokeWidth);f+=`.ag-icon-${$}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(z)}'); } -`}return f},gH=(_,f=1.5)=>{let $=q5[_];if($)return $;let z=J5[_];if(!z)throw Error(`Missing icon data for ${_}`);return``+z+""},X5=(_={})=>{return k0({feature:"iconSet",css:()=>NH(_)})},hH=X5({strokeWidth:1}),uH=X5();var iH=":where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:\"\";display:block;height:12px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}",mH=".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}";var cH={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:0.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4};var pH=()=>k0({feature:"inputStyle",params:{...cH,inputBackgroundColor:x_,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:P0},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:_0(0.06),inputDisabledTextColor:{ref:"textColor",mix:0.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>iH+mH}),nH=pH();var dH=".ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:\"\";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}";var tH={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1};var rH=()=>k0({feature:"tabStyle",params:{...tH,tabBarBorder:!0,tabBarBackgroundColor:s_(0.05),tabTextColor:{ref:"textColor",mix:0.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:x_},css:dH}),lH=rH();var sH=()=>({fontFamily:[{googleFont:"IBM Plex Sans"},"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu"]}),aH=()=>TH().withPart(bH).withPart(xH).withPart(uH).withPart(lH).withPart(nH).withPart(z5).withParams(sH()),Y5=aH();var kf=(_,f,$,z,Q)=>({changeKey:_,type:f,defaultValue:$,noWarn:z,cacheDefault:Q}),oH=kf("cellHorizontalPadding","length",16),eH=kf("indentationLevel","length",0,!0,!0),_W=kf("rowGroupIndentSize","length",0),W9=kf("rowHeight","length",42),B9=kf("headerHeight","length",48),W6=kf("rowBorderWidth","border",1),K9=kf("pinnedRowBorderWidth","border",1),fW=kf("headerRowBorderWidth","border",1);function $W(_,f){for(let $ of f.sort((z,Q)=>z.moduleName.localeCompare(Q.moduleName))){let z=$.css;if(z)_.set(`module-${$.moduleName}`,z)}}var zW=class extends UH{initVariables(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.getSizeEl(W9),this.getSizeEl(B9),this.getSizeEl(W6),this.getSizeEl(K9),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(K9)}getRowBorderWidth(){return this.getCSSVariablePixelValue(W6)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(fW)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(W9)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(B9)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(oH)}getCellPaddingLeft(){let _=this.getDefaultCellHorizontalPadding(),f=this.getCSSVariablePixelValue(eH),$=this.getCSSVariablePixelValue(_W);return _-1+$*f}getCellPadding(){let _=this.getDefaultCellHorizontalPadding()-1;return this.getCellPaddingLeft()+_}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){let{eRootDiv:_}=this,f=_.style.getPropertyValue("--ag-line-height").trim(),$=this.gos.get("rowHeight");if($==null||isNaN($)||!isFinite($)){if(f!==null)_.style.setProperty("--ag-line-height",null);return-1}let z=`${$}px`;if(f!=z)return _.style.setProperty("--ag-line-height",z),$;return f!=""?Number.parseFloat(f):-1}fireStylesChangedEvent(_){if(_==="rowBorderWidth")this.refreshRowBorderWidthVariable();super.fireStylesChangedEvent(_)}refreshRowBorderWidthVariable(){let _=this.getCSSVariablePixelValue(W6);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${_}px`)}postProcessThemeChange(_,f){if(_&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded"))if(f)e(106);else e(239)}getAdditionalCss(){let _=new Map;return _.set("core",[WH]),$W(_,Array.from(a4())),_}getDefaultTheme(){return Y5}varError(_,f){j(9,{variable:{cssName:_,defaultValue:f}})}themeError(_){e(240,{theme:_})}shadowRootError(){e(293)}},QW=class extends j_{constructor(){super(...arguments);this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new D0}addListener(_,f,$){this.globalSvc.addEventListener(_,f,$)}removeListener(_,f,$){this.globalSvc.removeEventListener(_,f,$)}addGlobalListener(_,f=!1){this.globalSvc.addGlobalListener(_,f)}removeGlobalListener(_,f=!1){this.globalSvc.removeGlobalListener(_,f)}dispatchEvent(_){this.globalSvc.dispatchEvent(this.gos.addCommon(_))}dispatchEventOnce(_){this.globalSvc.dispatchEventOnce(this.gos.addCommon(_))}},JW=class extends QW{postConstruct(){let{globalListener:_,globalSyncListener:f}=this.beans;if(_)this.addGlobalListener(_,!0);if(f)this.addGlobalListener(f,!1)}};function N6(_,f,$){let z=_.visibleCols.headerGroupRowCount;if($>=z)return{column:f,headerRowIndex:$};let Q=f.getParent();while(Q&&Q.getProvidedColumnGroup().getLevel()>$)Q=Q.getParent();let J=f.isSpanHeaderHeight();if(!Q||J&&Q.isPadding())return{column:f,headerRowIndex:z};return{column:Q,headerRowIndex:Q.getProvidedColumnGroup().getLevel()}}var qW=class extends A{constructor(){super(...arguments);this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){let _=this.beans;_.ctrlsSvc.whenReady(this,($)=>{this.gridBodyCon=$.gridBodyCtrl});let f=q_(_);this.addManagedElementListeners(f,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(_,f){let $,{colModel:z,colGroupSvc:Q,ctrlsSvc:J}=this.beans;if(typeof _==="string"){if($=z.getCol(_),!$)$=Q?.getColumnGroup(_)??null}else $=_;if(!$)return null;let X=J.getHeaderRowContainerCtrl()?.getAllCtrls(),Y=b(X||[]).type==="filter",Z=o_(this.beans)-1,G=-1,E=$;while(E)G++,E=E.getParent();let U=G;if(f&&Y&&U===Z-1)U++;return U===-1?null:{headerRowIndex:U,column:$}}navigateVertically(_,f){let{focusSvc:$,visibleCols:z}=this.beans,{focusedHeader:Q}=$;if(!Q)return!1;let{headerRowIndex:J}=Q,q=Q.column,X=o_(this.beans),Y=this.getHeaderRowType(J),Z=z.headerGroupRowCount,{headerRowIndex:G,column:E,headerRowIndexWithoutSpan:U}=_==="UP"?XW(Y,q,J):YW(q,J,Z),H=!1;if(G<0)G=0,E=q,H=!0;if(G>=X)G=-1,this.currentHeaderRowWithoutSpan=-1;else if(U!==void 0)this.currentHeaderRowWithoutSpan=U;if(!H&&!E)return!1;return $.focusHeaderPosition({headerPosition:{headerRowIndex:G,column:E},allowUserOverride:!0,event:f})}navigateHorizontally(_,f=!1,$){let{focusSvc:z,gos:Q}=this.beans,J={...z.focusedHeader},q,X;if(this.currentHeaderRowWithoutSpan!==-1)J.headerRowIndex=this.currentHeaderRowWithoutSpan;else this.currentHeaderRowWithoutSpan=J.headerRowIndex;if(_==="LEFT"!==Q.get("enableRtl"))X="Before",q=this.findHeader(J,X);else X="After",q=this.findHeader(J,X);let Y=Q.getCallback("tabToNextHeader");if(f&&Y){let Z=z.focusHeaderPositionFromUserFunc({userFunc:Y,headerPosition:q,direction:X});if(Z){let{headerRowIndex:G}=z.focusedHeader||{};if(G!=null&&G!=J.headerRowIndex)this.currentHeaderRowWithoutSpan=G}return Z}if(q||!f)return z.focusHeaderPosition({headerPosition:q,direction:X,fromTab:f,allowUserOverride:!0,event:$});return this.focusNextHeaderRow(J,X,$)}focusNextHeaderRow(_,f,$){let z=this.beans,Q=_.headerRowIndex,J=null,q,X=o_(z),Y=this.beans.visibleCols.allCols;if(f==="Before"){if(Q<=0)return!1;J=b(Y),q=Q-1,this.currentHeaderRowWithoutSpan-=1}else if(J=Y[0],q=Q+1,this.currentHeaderRowWithoutSpan=X)G=-1;return z.focusSvc.focusHeaderPosition({headerPosition:{column:Z,headerRowIndex:G},direction:f,fromTab:!0,allowUserOverride:!0,event:$})}scrollToColumn(_,f="After"){if(_.getPinned())return;let $;if(G_(_)){let z=_.getDisplayedLeafColumns();$=f==="Before"?b(z):z[0]}else $=_;this.gridBodyCon.scrollFeature.ensureColumnVisible($)}findHeader(_,f){let{colGroupSvc:$,visibleCols:z}=this.beans,Q=_.column;if(Q instanceof E$){let Y=Q.getDisplayedLeafColumns();Q=f==="Before"?Y[0]:Y[Y.length-1]}let J=f==="Before"?z.getColBefore(Q):z.getColAfter(Q);if(!J)return;let q=z.headerGroupRowCount;if(_.headerRowIndex>=q)return{headerRowIndex:_.headerRowIndex,column:J};let X=$?.getColGroupAtLevel(J,_.headerRowIndex);if(!X)return{headerRowIndex:J instanceof Z0&&J.isSpanHeaderHeight()?z.headerGroupRowCount:_.headerRowIndex,column:J};if(X.isPadding()&&J.isSpanHeaderHeight())return{headerRowIndex:z.headerGroupRowCount,column:J};return{headerRowIndex:_.headerRowIndex,column:X??J}}getHeaderRowType(_){let f=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(f)return f.getRowType(_)}};function XW(_,f,$){let z=$-1;if(_!=="filter"){let Q=f instanceof Z0&&f.isSpanHeaderHeight(),J=f.getParent();while(J&&(J.getProvidedColumnGroup().getLevel()>z||Q&&J.isPadding()))J=J.getParent();if(J)if(Q)return{column:J,headerRowIndex:J.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:z};else return{column:J,headerRowIndex:z,headerRowIndexWithoutSpan:z}}return{column:f,headerRowIndex:z,headerRowIndexWithoutSpan:z}}function YW(_,f,$){let z=f+1,Q={column:_,headerRowIndex:z,headerRowIndexWithoutSpan:z};if(_ instanceof E$){if(z>=$)return{column:_.getDisplayedLeafColumns()[0],headerRowIndex:$,headerRowIndexWithoutSpan:z};let q=_.getDisplayedChildren()[0];if(q instanceof E$&&q.isPadding()){let Y=q.getDisplayedLeafColumns()[0];if(Y.isSpanHeaderHeight())q=Y}if(Q.column=q,q instanceof Z0&&q.isSpanHeaderHeight())Q.headerRowIndex=$,Q.headerRowIndexWithoutSpan=z}return Q}var ZW=class extends A{constructor(){super(...arguments);this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(_){this.colModel=_.colModel,this.visibleCols=_.visibleCols,this.rowRenderer=_.rowRenderer,this.navigation=_.navigation,this.filterManager=_.filterManager,this.overlays=_.overlays}postConstruct(){let _=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:_,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:_,columnRowGroupChanged:_}),this.addDestroyFunc(B8(this.beans))}attemptToRecoverFocus(){if(this.needsFocusRestored=!0,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout);this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){if(this.needsFocusRestored=!1,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null}shouldTakeFocus(){if(this.gos.get("suppressFocusAfterRefresh"))return this.setFocusRecovered(),!1;if(this.needsFocusRestored)return this.setFocusRecovered(),!0;return this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;let _=this.focusedCell.column,f=this.colModel.getCol(_.getId());if(_!==f)this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){let{gos:_,focusedCell:f}=this;if(_.get("suppressFocusAfterRefresh")||_.get("suppressCellFocus")||!f)return null;if(!this.doesRowOrCellHaveBrowserFocus())return null;return f}getFocusHeaderToUseAfterRefresh(){if(this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader)return null;if(!this.isDomDataPresentInHierarchy(d(this.beans),DX))return null;return this.focusedHeader}doesRowOrCellHaveBrowserFocus(){let _=d(this.beans);if(this.isDomDataPresentInHierarchy(_,Vz,!0))return!0;return this.isDomDataPresentInHierarchy(_,Oz,!0)}isDomDataPresentInHierarchy(_,f,$){let z=_;while(z){let Q=Tq(this.gos,z,f);if(Q){if(Q.destroyed&&$)return this.attemptToRecoverFocus(),!1;return!0}z=z.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(_){let{rowIndex:f,rowPinned:$,column:z}=_,Q={rowIndex:f,rowPinned:$,column:z,isFullWidthCell:!1},J=this.rowRenderer.getRowByPosition({rowIndex:f,rowPinned:$});if(J)Q.isFullWidthCell=J.isFullWidth();return Q}clearFocusedCell(){if(this.focusedCell==null)return;let _=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",..._})}setFocusedCell(_){this.setFocusRecovered();let{column:f,rowIndex:$,rowPinned:z,forceBrowserFocus:Q=!1,preventScrollOnBrowserFocus:J=!1,sourceEvent:q}=_,X=this.colModel.getCol(f);if(!X){this.focusedCell=null;return}this.focusedCell={rowIndex:$,rowPinned:T0(z),column:X};let Y=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...Y,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:Q,preventScrollOnBrowserFocus:J,sourceEvent:q}),this.previousCellFocusParams=Y}isCellFocused(_){if(this.focusedCell==null)return!1;return C1(_,this.focusedCell)}isHeaderWrapperFocused(_){if(this.focusedHeader==null)return!1;let{column:f,rowCtrl:{rowIndex:$,pinned:z}}=_,{column:Q,headerRowIndex:J}=this.focusedHeader;return f===Q&&$===J&&z==Q.getPinned()}focusHeaderPosition(_){if(this.setFocusRecovered(),W0(this.beans))return!1;let{direction:f,fromTab:$,allowUserOverride:z,event:Q,fromCell:J,rowWithoutSpanValue:q,scroll:X=!0}=_,{headerPosition:Y}=_;if(J&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(Y);if(z){let Z=this.focusedHeader,G=o_(this.beans);if($){let E=this.gos.getCallback("tabToNextHeader");if(E)Y=this.getHeaderPositionFromUserFunc({userFunc:E,direction:f,currentPosition:Z,headerPosition:Y,headerRowCount:G})}else{let E=this.gos.getCallback("navigateToNextHeader");if(E&&Q){let U={key:Q.key,previousHeaderPosition:Z,nextHeaderPosition:Y,headerRowCount:G,event:Q},H=E(U);Y=H===null?Z:H}}}if(!Y)return!1;return this.focusProvidedHeaderPosition({headerPosition:Y,direction:f,event:Q,fromCell:J,rowWithoutSpanValue:q,scroll:X})}focusHeaderPositionFromUserFunc(_){if(W0(this.beans))return!1;let{userFunc:f,headerPosition:$,direction:z,event:Q}=_,J=this.focusedHeader,q=o_(this.beans),X=this.getHeaderPositionFromUserFunc({userFunc:f,direction:z,currentPosition:J,headerPosition:$,headerRowCount:q});return!!X&&this.focusProvidedHeaderPosition({headerPosition:X,direction:z,event:Q})}getHeaderPositionFromUserFunc(_){let{userFunc:f,direction:$,currentPosition:z,headerPosition:Q,headerRowCount:J}=_,X=f({backwards:$==="Before",previousHeaderPosition:z,nextHeaderPosition:Q,headerRowCount:J});if(X===!0)return z;if(X===!1)return null;return X}focusProvidedHeaderPosition(_){let{headerPosition:f,direction:$,fromCell:z,rowWithoutSpanValue:Q,event:J,scroll:q=!0}=_,{column:X,headerRowIndex:Y}=f,{filterManager:Z,ctrlsSvc:G,headerNavigation:E}=this.beans;if(this.focusedHeader&&u8(_.headerPosition,this.focusedHeader))return!1;if(Y===-1){if(Z?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(f);return this.focusGridView({column:X,event:J})}if(q)E?.scrollToColumn(X,$);let H=G.getHeaderRowContainerCtrl(X.getPinned())?.focusHeader(f.headerRowIndex,X,J)||!1;if(E&&H&&(Q!=null||z))E.currentHeaderRowWithoutSpan=Q??-1;return H}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;let _=this.visibleCols.allCols[0];if(!_)return!1;let f=N6(this.beans,_,0);return this.focusHeaderPosition({headerPosition:f,rowWithoutSpanValue:0})}focusLastHeader(_){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;let f=o_(this.beans)-1,$=b(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:f,column:$},rowWithoutSpanValue:-1,event:_})}focusPreviousFromFirstCell(_){if(this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(null);return this.focusLastHeader(_)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(_,f){if(this.focusedCell==null)return!1;return this.focusedCell.rowIndex===_&&this.focusedCell.rowPinned===T0(f)}focusOverlay(_){let f=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!f&&F_(f,_)}getDefaultTabToNextGridContainerTarget(_){let{backwards:f,focusableContainers:$}=_,z=f?-1:1,Q,J=()=>{if(Q===void 0)Q=this.getGridBodyTabTarget(f);return Q};for(let q=_.nextIndex;q>=0&&q<$.length;q+=z){let X=w8($[q],J);if(X)return X}return null}getGridBodyTabTarget(_){if(_)return this.getGridViewTabTarget({column:b(this.visibleCols.allCols),backwards:!0});let f=this.visibleCols.allCols[0];if(this.gos.get("headerHeight")===0||W0(this.beans))return this.getGridViewTabTarget({column:f});if(!f)return null;return N6(this.beans,f,0)}getGridViewTabTarget(_){let{backwards:f=!1}=_,$=_.column??this.focusedHeader?.column;if(!$)return null;if(this.overlays?.exclusive)return null;if(jz(this.beans))return f&&!W0(this.beans)?{headerRowIndex:o_(this.beans)-1,column:$}:null;let z=f?Wf(this.beans):O1(this.beans);if(z?.rowIndex==null){if(this.overlays?.isVisible())return null;if(f&&!W0(this.beans)){let J=b(this.visibleCols.allCols);if(J)return{headerRowIndex:o_(this.beans)-1,column:J}}return null}let Q=D_(this.beans,z);if(!Q||$.isSuppressNavigable(Q))return null;if(f){if(this.rowRenderer.getRowByPosition(z)?.isFullWidth())return null}return{rowIndex:z.rowIndex,rowPinned:z.rowPinned,column:$}}focusGridView(_){let{backwards:f=!1,canFocusOverlay:$=!0,event:z}=_;if(this.overlays?.exclusive)return $&&this.focusOverlay(f);if(jz(this.beans)){if(f){if(!W0(this.beans))return this.focusLastHeader()}if($&&this.focusOverlay(f))return!0;if(f)return!1;return q0(this.beans,f)}let Q=f?Wf(this.beans):O1(this.beans);if(Q){let J=_.column??this.focusedHeader?.column,{rowIndex:q,rowPinned:X}=Q,Y=D_(this.beans,Q);if(!J||!Y||q==null)return!1;if(J.isSuppressNavigable(Y)){let Z=this.gos.get("enableRtl"),G;if(!z||z.key===S.TAB)G=Z?S.LEFT:S.RIGHT;else G=z.key;return this.beans.navigation?.navigateToNextCell(null,G,{rowIndex:q,column:J,rowPinned:X||null},!0),!0}if(this.navigation?.ensureCellVisible({rowIndex:q,column:J,rowPinned:X}),f){if(this.rowRenderer.getRowByPosition(Q)?.isFullWidth()&&this.navigation?.tryToFocusFullWidthRow(Q,f))return!0}if(this.setFocusedCell({rowIndex:q,column:J,rowPinned:T0(X),forceBrowserFocus:!0}),!I_(J))this.beans.rangeSvc?.setRangeToCell({rowIndex:q,rowPinned:X,column:J});return!0}if($&&this.focusOverlay(f))return!0;if(f&&this.focusLastHeader())return!0;return!1}focusAdvancedFilter(_){return this.advFilterFocusColumn=_?.column,this.beans.advancedFilter?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(_,f){let $=(f?void 0:this.advFilterFocusColumn)??this.visibleCols.allCols?.[0];if(_)return this.focusHeaderPosition({headerPosition:{column:$,headerRowIndex:o_(this.beans)-1}});return this.focusGridView({column:$})}clearAdvancedFilterColumn(){this.advFilterFocusColumn=void 0}},GW=class extends A{constructor(){super(...arguments);this.beanName="scrollVisibleSvc"}wireBeans(_){this.ctrlsSvc=_.ctrlsSvc,this.colAnimation=_.colAnimation}postConstruct(){let{gos:_}=this;this.horizontalScrollShowing=_.get("alwaysShowHorizontalScroll")===!0,this.verticalScrollShowing=_.get("alwaysShowVerticalScroll")===!0,this.getScrollbarWidth();let f=this.updateScrollVisible.bind(this);this.addManagedEventListeners({displayedColumnsChanged:f,displayedColumnsWidthChanged:f,newColumnsLoaded:f})}updateScrollVisible(){let{colAnimation:_}=this;if(_?.isActive())_.executeLaterVMTurn(()=>{_.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())});else this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){let _=this.ctrlsSvc.get("center");if(!_||this.colAnimation?.isActive())return;let f={horizontalScrollShowing:_.isHorizontalScrollShowing(),verticalScrollShowing:this.verticalScrollShowing};this.setScrollsVisible(f),this.updateScrollGap()}updateScrollGap(){let _=this.ctrlsSvc.get("center"),f=_.hasHorizontalScrollGap(),$=_.hasVerticalScrollGap();if(this.horizontalScrollGap!==f||this.verticalScrollGap!==$)this.horizontalScrollGap=f,this.verticalScrollGap=$,this.eventSvc.dispatchEvent({type:"scrollGapChanged"})}setScrollsVisible(_){if(this.horizontalScrollShowing!==_.horizontalScrollShowing||this.verticalScrollShowing!==_.verticalScrollShowing)this.horizontalScrollShowing=_.horizontalScrollShowing,this.verticalScrollShowing=_.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"})}getScrollbarWidth(){if(this.scrollbarWidth==null){let _=this.gos.get("scrollbarWidth"),$=typeof _==="number"&&_>=0?_:KJ();if($!=null)this.scrollbarWidth=$,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"})}return this.scrollbarWidth}},EW=class extends A{constructor(){super(...arguments);this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;let{stateSvc:_,ctrlsSvc:f,context:$}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:_?.getState()??{}}),this.destroyCalled=!0,f.get("gridCtrl")?.destroyGridUi(),$.destroy(),super.destroy()}},UW=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","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","filterUiChanged","filterOpened","floatingFilterUiChanged","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","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped"];var Hz=new Set(["gridPreDestroyed","fillStart","pasteStart"]),mJ=UW.reduce((_,f)=>{return _[f]=K7(f),_},{}),j1={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find"};function L9(_){return`"${_}"`}var HW=()=>({checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."},rowGroupingHierarchy:{version:"34.3",message:"Use `colDef.groupHierarchy` instead."}}),WW={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:_,editable:f,groupRowEditable:$})=>{if(!(!!f||!!$))return null;if(typeof _==="string")return j1[_]??"CustomEditor";return"CustomEditor"},cellRenderer:({cellRenderer:_})=>{if(typeof _!=="string")return null;return j1[_]},cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:_,cellEditor:f})=>{if(_&&!f)return"TextEditor";return null},groupRowEditable:({groupRowEditable:_,cellEditor:f})=>{if(!_)return null;return f?"RowGroupingEdit":["RowGroupingEdit","TextEditor"]},groupRowValueSetter:({groupRowValueSetter:_})=>_?"RowGroupingEdit":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:_})=>{if(_&&typeof _!=="string"&&typeof _!=="boolean")return"CustomFilter";if(typeof _==="string")return j1[_]??"ColumnFilter";return"ColumnFilter"},floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:(_)=>{let f=["columnsMenuTab","generalMenuTab"];if(_.menuTabs?.some(($)=>f.includes($)))return"ColumnMenu";return null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},BW=()=>{return{autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(f,{paginationAutoPageSize:$})=>{if($)return"colDef.autoHeight is not supported with paginationAutoPageSize.";return null}},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:(f)=>{if((f.rowGroup!=null||f.rowGroupIndex!=null||f.cellRenderer==="agGroupCellRenderer")&&"checkbox"in f.cellRendererParams)return'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.';return null}},flex:{validate:(f,$)=>{if($.autoSizeStrategy)return"colDef.flex is not supported with gridOptions.autoSizeStrategy";return null}},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(f,{rowSelection:$})=>$==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(f,{rowSelection:$})=>$==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(f,{rowSelection:$})=>$==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:(f)=>{let $=f.headerValueGetter;if(typeof $==="function"||typeof $==="string")return null;return"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:f})=>{if(f){if(f.smallDown)return $0(262);if(f.smallLeft)return $0(263);if(f.smallRight)return $0(264)}return null}},sort:{validate:(f)=>{if(A1(f.sort)||Ef(f.sort))return null;return`sort must be of type (SortDirection | SortDef), currently it is ${typeof f.sort==="object"?JSON.stringify(f.sort):Yz(f.sort)}`}},initialSort:{validate:(f)=>{if(A1(f.initialSort)||Ef(f.initialSort))return null;return`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof f.initialSort==="object"?JSON.stringify(f.initialSort):Yz(f.initialSort)}`}},sortingOrder:{validate:(f)=>{let $=f.sortingOrder;if(Array.isArray($)&&$.length>0){let z=$.filter((Q)=>{return!(A1(Q)||Ef(Q))});if(z.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${z.map((Q)=>typeof Q==="string"||Q==null?Yz(Q):JSON.stringify(Q)).join(", ")}]`}else if(!Array.isArray($)||!$.length)return`sortingOrder must be an array with at least one element, currently it is [${$}]`;return null}},type:{validate:(f)=>{let $=f.type;if($ instanceof Array){if($.some((Q)=>typeof Q!=="string"))return"if colDef.type is supplied an array it should be of type 'string[]'";return null}if(typeof $==="string")return null;return"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(f,{suppressRowTransform:$})=>{if(!$)return"colDef.rowSpan requires suppressRowTransform to be enabled.";return null}},spanRows:{dependencies:{editable:{required:[!1,void 0]},groupRowEditable:{required:[!1,void 0]},rowDrag:{required:[!1,void 0]},colSpan:{required:[void 0]},rowSpan:{required:[void 0]}},validate:(f,{rowSelection:$,cellSelection:z,suppressRowTransform:Q,enableCellSpan:J,rowDragEntireRow:q,enableCellTextSelection:X})=>{if(typeof $==="object"){if($?.mode==="singleRow"&&$?.enableClickSelection)return"colDef.spanRows is not supported with rowSelection.clickSelection"}if(z)return"colDef.spanRows is not supported with cellSelection.";if(Q)return"colDef.spanRows is not supported with suppressRowTransform.";if(!J)return"colDef.spanRows requires enableCellSpan to be enabled.";if(q)return"colDef.spanRows is not supported with rowDragEntireRow.";if(X)return"colDef.spanRows is not supported with enableCellTextSelection.";return null}},groupHierarchy:{validate(f,{groupHierarchyConfig:$={}},z){let Q=new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),J=[];for(let q of f.groupHierarchy??[]){if(typeof q==="object"){z.validation?.validateColDef(q);continue}if(!Q.has(q)&&!(q in $))J.push(L9(q))}if(J.length>0){let q=`The following parts of colDef.groupHierarchy are not recognised: ${J.join(", ")}.`,X=`Choose one of ${[...Q].map(L9).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`;return`${q} -${X}`}return null}}}},KW={headerName:void 0,columnGroupShow:void 0,headerStyle:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,headerTooltipValueGetter:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,groupRowEditable:void 0,groupRowValueSetter:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,spanRows:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,tooltipComponentSelector:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0,dateComponent:void 0,dateComponentParams:void 0,getFindText:void 0,rowGroupingHierarchy:void 0,groupHierarchy:void 0,allowFormula:void 0},LW=()=>Object.keys(KW),FW=()=>({objectName:"colDef",allProperties:LW(),docsUrl:"column-properties/",deprecations:HW(),validations:BW()}),DW=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","treeDataChildrenField","treeDataParentIdField","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","invalidEditValueMode","grandTotalRow","themeCssLayer","findSearchValue","styleNonce","renderingMode"],MW=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","activeOverlayParams","popupParent","themeStyleContainer","statusBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterParent","advancedFilterBuilderParams","advancedFilterParams","formulaDataSource","formulaFuncs","initialState","autoSizeStrategy","selectionColumnDef","findOptions","filterHandlers","groupHierarchyConfig"],kW=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","suppressOverlays"],Z5=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipSwitchShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns","rowDragInsertDelay"],SW=["theme","rowSelection"],AW=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],G5=["loadThemeGoogleFonts","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","allowContextMenuWithControlKey","suppressContextMenu","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","enableCellSpan","suppressClickEdit","rowDragEntireRow","rowDragManaged","refreshAfterGroupEdit","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupHideColumnsUntilExpanded","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","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault","enableFilterHandlers","suppressStartEditOnTab","hidePaddedHeaderRows","ssrmExpandAllAffectsAllRows","animateColumnResizing"],RW=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","overlayComponent","loadingOverlayComponent","noRowsOverlayComponent","overlayComponentSelector","activeOverlay","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getFullRowEditValidationErrors","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","tabToNextGridContainer","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","chartMenuItems","groupTotalRow","alwaysPassFilter","isRowPinnable","isRowPinned","isRowValidDropPosition"],jW=()=>[...kW,...MW,...DW,...Z5,...RW,...G5,...AW,...SW];var VW=()=>({suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."},groupRemoveSingleChildren:{version:"33",message:"Use `groupHideParentOfSingleChild` instead."},groupRemoveLowestSingleChildren:{version:"33",message:'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'},suppressRowGroupHidesColumns:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'},suppressMakeColumnVisibleAfterUnGroup:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'},unSortIcon:{version:"33",message:"Use `defaultColDef.unSortIcon` instead."},sortingOrder:{version:"33",message:"Use `defaultColDef.sortingOrder` instead."},suppressPropertyNamesCheck:{version:"33",message:"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."},suppressAdvancedFilterEval:{version:"34",message:"Advanced filter no longer uses function evaluation, so this option has no effect."}});function V0(_,f,$){if(typeof f==="number"||f==null){if(f==null)return null;return f>=$?null:`${_}: value should be greater than or equal to ${$}`}return`${_}: value should be a number`}var OW={alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:"SharedRowGrouping",grandTotalRow:"ClientSideRowModelHierarchy",initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDetail:"SharedMasterDetail",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:"SharedPivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:"SharedRowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:"SharedTreeData",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},PW=()=>{let _={autoSizePadding:{validate({autoSizePadding:$}){return V0("autoSizePadding",$,0)}},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate({cacheBlockSize:$}){return V0("cacheBlockSize",$,1)}},cacheOverflowSize:{validate({cacheOverflowSize:$}){return V0("cacheOverflowSize",$,1)}},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:($)=>{let z=$.domLayout,Q=["autoHeight","normal","print"];if(z&&!Q.includes(z))return`domLayout must be one of [${Q.join()}], currently it's ${z}`;return null}},enableFillHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableCellSpan:{supportedRowModels:["clientSide","serverSide"]},enableRangeSelection:{dependencies:{rowDragEntireRow:{required:[!1,void 0]}}},enableRowPinning:{supportedRowModels:["clientSide"],validate({enableRowPinning:$,pinnedTopRowData:z,pinnedBottomRowData:Q}){if($&&(z||Q))return"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";return null}},isRowPinnable:{supportedRowModels:["clientSide"],validate({enableRowPinning:$,isRowPinnable:z,pinnedTopRowData:Q,pinnedBottomRowData:J}){if(z&&(Q||J))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!$&&z)return"`isRowPinnable` requires `enableRowPinning` to be set.";return null}},isRowPinned:{supportedRowModels:["clientSide"],validate({enableRowPinning:$,isRowPinned:z,pinnedTopRowData:Q,pinnedBottomRowData:J}){if(z&&(Q||J))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!$&&z)return"`isRowPinned` requires `enableRowPinning` to be set.";return null}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideColumnsUntilExpanded:{supportedRowModels:["clientSide"],validate({groupHideColumnsUntilExpanded:$,groupHideOpenParents:z,groupDisplayType:Q}){if($&&!z&&Q!=="multipleColumns")return"`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`";return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:{required:[void 0,"bottom"]},treeData:{required:[void 0,!1],reason:"Tree Data has values at the group level so it doesn't make sense to hide them."}}},groupHideParentOfSingleChild:{dependencies:{groupHideOpenParents:{required:[void 0,!1]}}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveSingleChildren:{required:[void 0,!1]}}},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveLowestSingleChildren:{required:[void 0,!1]}}},groupSelectsChildren:{dependencies:{rowSelection:{required:["multiple"]}}},groupHierarchyConfig:{validate({groupHierarchyConfig:$={}},z,Q){for(let J of Object.keys($))Q.validation?.validateColDef($[J]);return null}},icons:{validate:({icons:$})=>{if($){if($.smallDown)return $0(262);if($.smallLeft)return $0(263);if($.smallRight)return $0(264)}return null}},infiniteInitialRowCount:{validate({infiniteInitialRowCount:$}){return V0("infiniteInitialRowCount",$,1)}},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:($)=>{if(typeof $.ssrmExpandAllAffectsAllRows==="boolean"){if($.rowModelType!=="serverSide")return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if($.ssrmExpandAllAffectsAllRows&&typeof $.getRowId!=="function")return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate({keepDetailRowsCount:$}){return V0("keepDetailRowsCount",$,1)}},paginationPageSize:{validate({paginationPageSize:$}){return V0("paginationPageSize",$,1)}},paginationPageSizeSelector:{validate:($)=>{let z=$.paginationPageSizeSelector;if(typeof z==="boolean"||z==null)return null;if(!z.length)return`'paginationPageSizeSelector' cannot be an empty array. - If you want to hide the page size selector, set paginationPageSizeSelector to false.`;return null}},pivotMode:{dependencies:{treeData:{required:[!1,void 0],reason:"Pivot Mode is not supported with Tree Data."}}},quickFilterText:{supportedRowModels:["clientSide"]},rowBuffer:{validate({rowBuffer:$}){return V0("rowBuffer",$,0)}},rowClass:{validate:($)=>{if(typeof $.rowClass==="function")return"rowClass should not be a function, please use getRowClass instead";return null}},rowData:{supportedRowModels:["clientSide"]},rowDragManaged:{supportedRowModels:["clientSide"],dependencies:{pagination:{required:[!1,void 0]}}},rowSelection:{validate({rowSelection:$}){if($&&typeof $==="string")return'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.';if($&&typeof $!=="object")return"Expected `RowSelectionOptions` object for the `rowSelection` property.";if($&&$.mode!=="multiRow"&&$.mode!=="singleRow")return`Selection mode "${$.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`;return null}},rowStyle:{validate:($)=>{let z=$.rowStyle;if(z&&typeof z==="function")return"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead";return null}},serverSideDatasource:{supportedRowModels:["serverSide"]},serverSideInitialRowCount:{supportedRowModels:["serverSide"],validate({serverSideInitialRowCount:$}){return V0("serverSideInitialRowCount",$,1)}},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:($)=>{let z=$.sortingOrder;if(Array.isArray(z)&&z.length>0){let Q=z.filter((J)=>!e_(J));if(Q.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${Q.map((J)=>typeof J==="string"||J==null?Yz(J):JSON.stringify(J))}]`}else if(!Array.isArray(z)||!z.length)return`sortingOrder must be an array with at least one element, currently it's ${z}`;return null}},tooltipHideDelay:{validate:($)=>{if($.tooltipHideDelay&&$.tooltipHideDelay<0)return"tooltipHideDelay should not be lower than 0";return null}},tooltipShowDelay:{validate:($)=>{if($.tooltipShowDelay&&$.tooltipShowDelay<0)return"tooltipShowDelay should not be lower than 0";return null}},tooltipSwitchShowDelay:{validate:($)=>{if($.tooltipSwitchShowDelay&&$.tooltipSwitchShowDelay<0)return"tooltipSwitchShowDelay should not be lower than 0";return null}},treeData:{supportedRowModels:["clientSide","serverSide"],validate:($)=>{let z=$.rowModelType??"clientSide";switch(z){case"clientSide":{let{treeDataChildrenField:Q,treeDataParentIdField:J,getDataPath:q,getRowId:X}=$;if(!Q&&!J&&!q)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if(Q){if(q)return"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";if(J)return"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."}if(J){if(!X)return"getRowId callback not provided, tree data with parent id cannot be built.";if(q)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{let Q=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${z} row model.`;return $.isServerSideGroup&&$.getServerSideGroupKey?null:Q}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate({viewportRowModelBufferSize:$}){return V0("viewportRowModelBufferSize",$,0)}},viewportRowModelPageSize:{validate({viewportRowModelPageSize:$}){return V0("viewportRowModelPageSize",$,1)}},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate({autoGroupColumnDef:$,showOpenedGroup:z}){if($?.field&&z)return"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.";if($?.valueGetter&&z)return"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.";return null}},renderingMode:{validate:($)=>{let z=$.renderingMode,Q=["default","legacy"];if(z&&!Q.includes(z))return`renderingMode must be one of [${Q.join()}], currently it's ${z}`;return null}},autoSizeStrategy:{validate:({autoSizeStrategy:$})=>{if(!$)return null;let z=["fitCellContents","fitGridWidth","fitProvidedWidth"],Q=$.type;if(Q!=="fitCellContents"&&Q!=="fitGridWidth"&&Q!=="fitProvidedWidth")return`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${z.map((J)=>'"'+J+'"').join(", ")}, currently it's ${Q}`;if(Q==="fitProvidedWidth"&&typeof $.width!="number")return`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${$.width}`;return null}}},f={};for(let $ of G5)f[$]={expectedType:"boolean"};for(let $ of Z5)f[$]={expectedType:"number"};return H_(f,_),f},vW=()=>({objectName:"gridOptions",allProperties:[...jW(),...Object.values(mJ)],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:VW(),validations:PW()}),TW=0,IW=0,F9="__ag_grid_instance",yW=class extends A{constructor(){super(...arguments);this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.instanceId=IW++,this.gridReadyFired=!1,this.queueEvents=[],this.propEventSvc=new D0,this.globalEventHandlerFactory=(_)=>{return(f,$)=>{if(!this.isAlive())return;let z=Hz.has(f);if(z&&!_||!z&&_)return;if(!bW(f))return;let Q=(J,q)=>{let X=mJ[J],Y=this.gridOptions[X];if(typeof Y==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>Y(q))};if(this.gridReadyFired)Q(f,$);else if(f==="gridReady"){Q(f,$),this.gridReadyFired=!0;for(let J of this.queueEvents)Q(J.eventName,J.event);this.queueEvents=[]}else this.queueEvents.push({eventName:f,event:$})}}}wireBeans(_){this.gridOptions=_.gridOptions,this.validation=_.validation,this.api=_.gridApi,this.gridId=_.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:_})=>{this.updateGridOptions({options:_,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(_){return this.gridOptions[_]??p4[_]}getCallback(_){return this.mergeGridCommonParams(this.gridOptions[_])}exists(_){return v(this.gridOptions[_])}mergeGridCommonParams(_){if(_)return($)=>{return _(this.addCommon($))};return _}updateGridOptions({options:_,force:f,source:$="api"}){let z={id:TW++,properties:[]},Q=[],{gridOptions:J,validation:q}=this;for(let X of Object.keys(_)){let Y=$J.applyGlobalGridOption(X,_[X]);q?.warnOnInitialPropertyUpdate($,X);let Z=f||typeof Y==="object"&&$==="api",G=J[X];if(Z||G!==Y){J[X]=Y;let E={type:X,currentValue:Y,previousValue:G,changeSet:z,source:$};Q.push(E)}}this.validateGridOptions(this.gridOptions),z.properties=Q.map((X)=>X.type);for(let X of Q)q$(this,`Updated property ${X.type} from`,X.previousValue," to ",X.currentValue),this.propEventSvc.dispatchEvent(X)}addPropertyEventListener(_,f){this.propEventSvc.addEventListener(_,f)}removePropertyEventListener(_,f){this.propEventSvc.removeEventListener(_,f)}getDomDataKey(){return this.domDataKey}addCommon(_){return _.api=this.api,_.context=this.gridOptionsContext,_}validateOptions(_,f){for(let $ of Object.keys(_)){let z=_[$];if(z==null||z===!1)continue;let Q=f[$];if(typeof Q==="function")Q=Q(_,this.gridOptions,this.beans);if(Q)this.assertModuleRegistered(Q,$)}}validateGridOptions(_){this.validateOptions(_,OW),this.validation?.processGridOptions(_)}validateColDef(_,f,$){if($||!this.beans.dataTypeSvc?.isColPendingInference(f))this.validateOptions(_,WW),this.validation?.validateColDef(_)}assertModuleRegistered(_,f){let $=Array.isArray(_)?_.some((z)=>this.isModuleRegistered(z)):this.isModuleRegistered(_);if(!$)e(200,{...this.getModuleErrorParams(),moduleName:_,reasonOrId:f});return $}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:zJ(),rowModelType:this.get("rowModelType"),isUmd:QJ()}}isModuleRegistered(_){return S6(_,this.gridId,this.get("rowModelType"))}setInstanceDomData(_){_[F9]=this.instanceId}isElementInThisInstance(_){let f=_;while(f){let $=f[F9];if(v($))return $===this.instanceId;f=f.parentElement}return!1}};function bW(_){return!!mJ[_]}var CW=class extends A{constructor(_,f){super();this.column=_,this.eGui=f,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(_)=>_&&this.onClick(_)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(_){let{sortSvc:f,rangeSvc:$,gos:z}=this.beans;if(!(Gf(z)?_.altKey:!0))$?.handleColumnSelection(this.column,_);else if(this.column.isSortable()){let J=this.column.isMoving(),X=Date.now()-this.lastMovingChanged<50;if(!(J||X))f?.progressSortFromEvent(this.column,_)}}};function wW(_,f){let $={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:$},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:$},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[_?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:$},f?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}var xW=class extends w{constructor(){super(...arguments);this.eFilter=V,this.eFilterButton=V,this.eSortIndicator=V,this.eMenu=V,this.eLabel=V,this.eText=V,this.eColRef=V,this.eSortOrder=V,this.eSortAsc=V,this.eSortDesc=V,this.eSortMixed=V,this.eSortNone=V,this.eSortAbsoluteAsc=V,this.eSortAbsoluteDesc=V,this.isLoadingInnerComponent=!1}refresh(_){let f=this.params;if(this.params=_,this.workOutTemplate(_,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||_.enableSorting!=this.currentSort||_.column.formulaRef!=this.currentRef||this.currentSuppressMenuHide!=null&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||f.enableFilterButton!=_.enableFilterButton||f.enableFilterIcon!=_.enableFilterIcon)return!1;if(this.innerHeaderComponent){let $={..._};H_($,_.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.($)}else this.setDisplayName(_);return!0}workOutTemplate(_,f){let{formula:$}=this.beans,z=_.template;if(z)return z?.trim?z.trim():z;return wW(!!$?.active,f)}init(_){this.params=_;let{sortSvc:f,touchSvc:$,rowNumbersSvc:z,userCompFactory:Q}=this.beans,J=f?.getSortIndicatorSelector();if(this.currentTemplate=this.workOutTemplate(_,!!J),this.setTemplate(this.currentTemplate,J?[J]:void 0),this.eLabel)this.mouseListener??(this.mouseListener=this.createManagedBean(new CW(_.column,this.eLabel)));$?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),z?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent(Q,_),this.setDisplayName(_)}workOutInnerHeaderComponent(_,f){let $=f8(_,f,f);if(!$)return;this.isLoadingInnerComponent=!0,$.newAgStackInstance().then((z)=>{if(this.isLoadingInnerComponent=!1,!z)return;if(this.isAlive()){if(this.innerHeaderComponent=z,this.eText)this.eText.appendChild(z.getGui())}else this.destroyBean(z)})}setDisplayName(_){let{displayName:f}=_,$=this.currentDisplayName;if(this.currentDisplayName=f,!this.eText||$===f||this.innerHeaderComponent||this.isLoadingInnerComponent)return;this.eText.textContent=L$(f)}addInIcon(_,f,$){let z=h(_,this.beans,$);if(z)f.appendChild(z)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){T_(this.eMenu),this.eMenu=void 0;return}let{gos:_,eMenu:f,params:$}=this,z=E_(_);this.addInIcon(z?"menu":"menuAlt",f,$.column),f.classList.toggle("ag-header-menu-icon",!z);let Q=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=Q,this.addManagedElementListeners(f,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow(Q)}toggleMenuAlwaysShow(_){this.eMenu?.classList.toggle("ag-header-menu-always-show",_)}showColumnMenu(_){let{currentSuppressMenuHide:f,params:$}=this;if(!f)this.toggleMenuAlwaysShow(!0);$.showColumnMenu(_,()=>{if(!f)this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(_){let{params:f,gos:$,beans:z,eMenu:Q,eFilterButton:J}=this,q=f.column,X=E_($);if(_&&!X){if(z.menuSvc?.isFilterMenuInHeaderEnabled(q))return f.showFilter(J??Q??this.getGui()),!0}else if(f.enableMenu)return this.showColumnMenu(Q??J??this.getGui()),!0;return!1}setupSort(){let{sortSvc:_}=this.beans;if(!_)return;let{enableSorting:f,column:$}=this.params;if(this.currentSort=f,!this.eSortIndicator){this.eSortIndicator=this.createBean(_.createSortIndicator(!0));let{eSortIndicator:z,eSortOrder:Q,eSortAsc:J,eSortDesc:q,eSortMixed:X,eSortNone:Y,eSortAbsoluteAsc:Z,eSortAbsoluteDesc:G}=this;z.attachCustomElements(Q,J,q,X,Y,Z,G)}if(this.eSortIndicator.setupSort($),!this.currentSort)return;_.setupHeader(this,$)}setupColumnRefIndicator(){let{eColRef:_,beans:{editModelSvc:f},params:$}=this;if(!_)return;this.currentRef=$.column.formulaRef,_.textContent=this.currentRef,N(_,!1),this.addManagedEventListeners({cellEditingStarted:()=>{let z=f?.getEditPositions(),Q=!!this.currentRef&&!!z?.some((J)=>J.column.isAllowFormula());N(_,Q)},cellEditingStopped:()=>{N(_,!1)}})}setupFilterIcon(){let{eFilter:_,params:f}=this;if(!_)return;let $=()=>{let z=f.column.isFilterActive();N(_,z,{skipAriaHidden:!0})};this.configureFilter(f.enableFilterIcon,_,$,"filterActive")}setupFilterButton(){let{eFilterButton:_,params:f}=this;if(!_)return;if(this.configureFilter(f.enableFilterButton,_,this.onFilterChangedButton.bind(this),"filter"))this.addManagedElementListeners(_,{click:()=>f.showFilter(_)});else this.eFilterButton=void 0}configureFilter(_,f,$,z){if(!_)return T_(f),!1;let Q=this.params.column;return this.addInIcon(z,f,Q),this.addManagedListeners(Q,{filterChanged:$}),$(),!0}onFilterChangedButton(){let _=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",_)}getAnchorElementForMenu(_){let{eFilterButton:f,eMenu:$}=this;if(_)return f??$??this.getGui();return $??f??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}},NW=class extends A{constructor(_,f){super();this.eLabel=_,this.columnGroup=f,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){let{columnGroup:_,beans:f}=this,{ctrlsSvc:$}=f;$.whenReady(this,()=>{let z=this.refreshPosition.bind(this);if(_.getPinned()==null)this.addManagedEventListeners({bodyScroll:(Q)=>{if(Q.direction==="horizontal")this.updateSticky(Q.left)}});this.addManagedListeners(_,{leftChanged:z,displayedChildrenChanged:z}),this.addManagedEventListeners({columnResized:z}),this.refreshPosition()})}refreshPosition(){let{columnGroup:_,beans:f}=this,$=_.getLeft(),z=_.getActualWidth();if($==null||z===0){this.left=null,this.right=null,this.setSticky(!1);return}this.left=$,this.right=$+z;let Q=f.colViewport.getScrollPosition();if(Q!=null)this.updateSticky(Q)}updateSticky(_){let{beans:f,left:$,right:z}=this;if($==null||z==null){this.setSticky(!1);return}let{gos:Q,visibleCols:J}=f,X=Q.get("enableRtl")?J.bodyWidth-_:_;this.setSticky($X)}setSticky(_){let{isSticky:f,eLabel:$}=this;if(f===_)return;this.isSticky=_,$.classList.toggle("ag-sticky-label",_)}},gW={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},hW=class extends w{constructor(){super(gW);this.agOpened=V,this.agClosed=V,this.agLabel=V,this.isLoadingInnerComponent=!1}init(_){let{userCompFactory:f,touchSvc:$}=this.beans;this.params=_,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(f,_),this.setupLabel(_),this.addGroupExpandIcon(_),this.setupExpandIcons(),$?.setupForHeaderGroup(this)}checkWarnings(){if(this.params.template)j(89)}workOutInnerHeaderGroupComponent(_,f){let $=z8(_,f,f);if(!$)return;this.isLoadingInnerComponent=!0,$.newAgStackInstance().then((z)=>{if(this.isLoadingInnerComponent=!1,!z)return;if(this.isAlive())this.innerHeaderGroupComponent=z,this.agLabel.appendChild(z.getGui());else this.destroyBean(z)})}setupExpandIcons(){let{agOpened:_,agClosed:f,params:{columnGroup:$},beans:{colGroupSvc:z}}=this;this.addInIcon("columnGroupOpened",_),this.addInIcon("columnGroupClosed",f);let Q=(Y)=>{if(z0(Y))return;let Z=!$.isExpanded();z.setColumnGroupOpened($.getProvidedColumnGroup(),Z,"uiColumnExpanded")};this.addTouchAndClickListeners(f,Q),this.addTouchAndClickListeners(_,Q);let J=(Y)=>{n_(Y)};this.addManagedElementListeners(f,{dblclick:J}),this.addManagedElementListeners(_,{dblclick:J}),this.addManagedElementListeners(this.getGui(),{dblclick:Q}),this.updateIconVisibility();let q=$.getProvidedColumnGroup(),X=this.updateIconVisibility.bind(this);this.addManagedListeners(q,{expandedChanged:X,expandableChanged:X})}addTouchAndClickListeners(_,f){this.beans.touchSvc?.setupForHeaderGroupElement(this,_,f),this.addManagedElementListeners(_,{click:f})}updateIconVisibility(){let{agOpened:_,agClosed:f,params:{columnGroup:$}}=this;if($.isExpandable()){let z=$.isExpanded();N(_,z),N(f,!z)}else N(_,!1),N(f,!1)}addInIcon(_,f){let $=h(_,this.beans,null);if($)f.appendChild($)}addGroupExpandIcon(_){if(!_.columnGroup.isExpandable()){let{agOpened:f,agClosed:$}=this;N(f,!1),N($,!1)}}setupLabel(_){let{displayName:f,columnGroup:$}=_,{innerHeaderGroupComponent:z,isLoadingInnerComponent:Q}=this,J=z||Q;if(v(f)&&!J)this.agLabel.textContent=L$(f);if(!$.getColGroupDef()?.suppressStickyLabel)this.createManagedBean(new NW(this.getGui(),$))}destroy(){if(super.destroy(),this.innerHeaderGroupComponent)this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0}},uW={moduleName:"ColumnHeaderComp",version:c,userComponents:{agColumnHeader:xW},icons:{menu:"menu",menuAlt:"menu-alt"}},iW={moduleName:"ColumnGroupHeaderComp",version:c,userComponents:{agColumnGroupHeader:hW},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},mW=class extends A{constructor(){super(...arguments);this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(_){if(this.scrollGoingDown=_>=this.lastScrollTop,_===0)this.scrollGoingDown=!0;this.lastScrollTop=_}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){if(this.active===!1)j(92)}createTask(_,f,$,z,Q=!1){this.verify();let J=$;if(z&&this.batchFrameworkComps)J="f1";let q={task:_,index:f,createOrder:++this.taskCount,deferred:Q};this.addTaskToList(this[J],q),this.schedule()}addTaskToList(_,f){_.list.push(f),_.sorted=!1}sortTaskList(_){if(_.sorted)return;let f=this.scrollGoingDown?1:-1;_.list.sort(($,z)=>{if($.deferred!==z.deferred)return $.deferred?-1:1;if($.index!==z.index)return f*(z.index-$.index);return z.createOrder-$.createOrder}),_.sorted=!0}addDestroyTask(_){this.verify(),this.destroyTasks.push(_),this.schedule()}executeFrame(_){let{p1:f,p2:$,f1:z,destroyTasks:Q,beans:J}=this,{ctrlsSvc:q,frameworkOverrides:X}=J,Y=f.list,Z=$.list,G=z.list,E=Date.now(),U=0,H=_<=0,W=q.getScrollFeature();while(H||U<_){if(!W.scrollGridIfNeeded()){let K;if(Y.length)this.sortTaskList(f),K=Y.pop().task;else if(Z.length)this.sortTaskList($),K=Z.pop().task;else if(G.length)X.wrapOutgoing(()=>{while(H||U<_){if(!W.scrollGridIfNeeded())if(G.length)this.sortTaskList(z),K=G.pop().task,K();else break;else break;U=Date.now()-E}}),K=()=>{};else if(Q.length)K=Q.pop();else break;K()}U=Date.now()-E}if(Y.length||Z.length||G.length||Q.length)this.requestFrame();else this.ticking=!1}flushAllFrames(){if(!this.active)return;this.executeFrame(-1)}schedule(){if(!this.active)return;if(!this.ticking)this.ticking=!0,this.requestFrame()}requestFrame(){let _=this.executeFrame.bind(this,60);Y0(this.beans,_)}isQueueEmpty(){return!this.ticking}},cW={moduleName:"AnimationFrame",version:c,beans:[mW]},pW=class extends A{constructor(){super(...arguments);this.beanName="iconSvc"}createIconNoSpan(_,f){return h(_,this.beans,f?.column)}},nW=(_,f,$)=>f||_&&$,dW=class extends A{constructor(){super(...arguments);this.beanName="touchSvc"}mockBodyContextMenu(_,f){this.mockContextMenu(_,_.eBodyViewport,f)}mockHeaderContextMenu(_,f){this.mockContextMenu(_,_.eGui,f)}mockRowContextMenu(_){if(!pf())return;let f=($,z,Q)=>{let{rowCtrl:J,cellCtrl:q}=_.getControlsForEventTarget(Q?.target??null);if(q?.column)q.dispatchCellContextMenuEvent(Q??null);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,Q,J,q)};this.mockContextMenu(_,_.element,f)}handleCellDoubleClick(_,f){if((()=>{if(!pf()||D6("dblclick"))return!1;let z=Date.now(),Q=z-_.lastIPadMouseClickEvent<200;return _.lastIPadMouseClickEvent=z,Q})())return _.onCellDoubleClicked(f),f.preventDefault(),!0;return!1}setupForHeader(_){let{gos:f,sortSvc:$,menuSvc:z}=this.beans;if(f.get("suppressTouch"))return;let{params:Q,eMenu:J,eFilterButton:q}=_,X=new u_(_.getGui(),!0);_.addDestroyFunc(()=>X.destroy());let Y=_.shouldSuppressMenuHide(),Z=Y&&v(J)&&Q.enableMenu,G=!!z?.isHeaderContextMenuEnabled(Q.column),E=nW(Q.enableMenu,G,E_(f)),U=X;if(Z)U=new u_(J,!0),_.addDestroyFunc(()=>U.destroy());let H=(W)=>Q.showColumnMenuAfterMouseClick(W.touchStart);if(Z&&Q.enableMenu)_.addManagedListeners(U,{tap:H});if(E)_.addManagedListeners(X,{longTap:H});if(Q.enableSorting){let W=(B)=>{let K=B.touchStart.target;if(Y&&(J?.contains(K)||q?.contains(K)))return;$?.progressSort(Q.column,!1,"uiColumnSorted")};_.addManagedListeners(X,{tap:W})}if(Q.enableFilterButton&&q){let W=new u_(q,!0);_.addManagedListeners(W,{tap:()=>Q.showFilter(q)}),_.addDestroyFunc(()=>W.destroy())}}setupForHeaderGroup(_){let f=_.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(f.columnGroup.getProvidedColumnGroup())){let $=new u_(f.eGridHeader,!0),z=(Q)=>f.showColumnMenuAfterMouseClick(Q.touchStart);_.addManagedListeners($,{longTap:z}),_.addDestroyFunc(()=>$.destroy())}}setupForHeaderGroupElement(_,f,$){let z=new u_(f,!0);_.addManagedListeners(z,{tap:$}),_.addDestroyFunc(()=>z.destroy())}mockContextMenu(_,f,$){if(!pf())return;let z=new u_(f),Q=(J)=>{if(!J$(this.beans,J.touchEvent))return;$(void 0,J.touchStart,J.touchEvent)};_.addManagedListeners(z,{longTap:Q}),_.addDestroyFunc(()=>z.destroy())}},tW={moduleName:"Touch",version:c,beans:[dW]},rW=class extends A{constructor(){super(...arguments);this.beanName="cellNavigation"}wireBeans(_){this.rowSpanSvc=_.rowSpanSvc}getNextCellToFocus(_,f,$=!1){if($)return this.getNextCellToFocusWithCtrlPressed(_,f);return this.getNextCellToFocusWithoutCtrlPressed(_,f)}getNextCellToFocusWithCtrlPressed(_,f){let $=_===S.UP,z=_===S.DOWN,Q=_===S.LEFT,J,q,{pageBounds:X,gos:Y,visibleCols:Z,pinnedRowModel:G}=this.beans,{rowPinned:E}=f;if($||z){if(E&&G)if($)q=0;else q=E==="top"?G.getPinnedTopRowCount()-1:G.getPinnedBottomRowCount()-1;else q=$?X.getFirstRow():X.getLastRow();J=f.column}else{let U=Y.get("enableRtl");q=f.rowIndex,J=(Q!==U?Z.allCols:[...Z.allCols].reverse()).find((W)=>!I_(W)&&this.isCellGoodToFocusOn({rowIndex:q,rowPinned:null,column:W}))}return J?{rowIndex:q,rowPinned:E,column:J}:null}getNextCellToFocusWithoutCtrlPressed(_,f){let $=f,z=!1;while(!z){switch(_){case S.UP:$=this.getCellAbove($);break;case S.DOWN:$=this.getCellBelow($);break;case S.RIGHT:$=this.gos.get("enableRtl")?this.getCellToLeft($):this.getCellToRight($);break;case S.LEFT:$=this.gos.get("enableRtl")?this.getCellToRight($):this.getCellToLeft($);break;default:$=null,j(8,{key:_});break}if($)z=this.isCellGoodToFocusOn($);else z=!0}return $}isCellGoodToFocusOn(_){let f=_.column,$,{pinnedRowModel:z,rowModel:Q}=this.beans;switch(_.rowPinned){case"top":$=z?.getPinnedTopRow(_.rowIndex);break;case"bottom":$=z?.getPinnedBottomRow(_.rowIndex);break;default:$=Q.getRow(_.rowIndex);break}if(!$)return!1;return!this.isSuppressNavigable(f,$)}getCellToLeft(_){if(!_)return null;let f=this.beans.visibleCols.getColBefore(_.column);if(!f)return null;return{rowIndex:_.rowIndex,column:f,rowPinned:_.rowPinned}}getCellToRight(_){if(!_)return null;let f=this.beans.visibleCols.getColAfter(_.column);if(!f)return null;return{rowIndex:_.rowIndex,column:f,rowPinned:_.rowPinned}}getCellBelow(_){if(!_)return null;let f=this.rowSpanSvc?.getCellEnd(_)??_,$=K_(this.beans,f,!0);if($)return{rowIndex:$.rowIndex,column:_.column,rowPinned:$.rowPinned};return null}getCellAbove(_){if(!_)return null;let f=this.rowSpanSvc?.getCellStart(_)??_,$=m_(this.beans,{rowIndex:f.rowIndex,rowPinned:f.rowPinned},!0);if($)return{rowIndex:$.rowIndex,column:_.column,rowPinned:$.rowPinned};return null}getNextTabbedCell(_,f){if(f)return this.getNextTabbedCellBackwards(_);return this.getNextTabbedCellForwards(_)}getNextTabbedCellForwards(_){let{visibleCols:f,pagination:$}=this.beans,z=f.allCols,Q=_.rowIndex,J=_.rowPinned,q=f.getColAfter(_.column);if(!q){q=z[0];let X=K_(this.beans,_,!0);if(n(X))return null;if(!X.rowPinned&&!($?.isRowInPage(X.rowIndex)??!0))return null;Q=X?X.rowIndex:null,J=X?X.rowPinned:null}return{rowIndex:Q,column:q,rowPinned:J}}getNextTabbedCellBackwards(_){let{beans:f}=this,{visibleCols:$,pagination:z}=f,Q=$.allCols,J=_.rowIndex,q=_.rowPinned,X=$.getColBefore(_.column);if(!X){X=b(Q);let Y=m_(f,{rowIndex:_.rowIndex,rowPinned:_.rowPinned},!0);if(n(Y))return null;if(!Y.rowPinned&&!(z?.isRowInPage(Y.rowIndex)??!0))return null;J=Y?Y.rowIndex:null,q=Y?Y.rowPinned:null}return{rowIndex:J,column:X,rowPinned:q}}isSuppressNavigable(_,f){let{suppressNavigable:$}=_.colDef;if(typeof $==="boolean")return $;if(typeof $==="function"){let z=_.createColumnFunctionCallbackParams(f);return $(z)}return!1}};function lW(_){return _.focusSvc.getFocusedCell()}function sW(_){return _.focusSvc.clearFocusedCell()}function aW(_,f,$,z){_.focusSvc.setFocusedCell({rowIndex:f,column:$,rowPinned:z,forceBrowserFocus:!0})}function oW(_,f){return _.navigation?.tabToNextCell(!1,f)??!1}function eW(_,f){return _.navigation?.tabToNextCell(!0,f)??!1}function _B(_,f,$=!1){let z=_.headerNavigation?.getHeaderPositionForColumn(f,$);if(!z)return;_.focusSvc.focusHeaderPosition({headerPosition:z})}function d0(_){let f=_;return f?.getFrameworkComponentInstance!=null?f.getFrameworkComponentInstance():_}var fB=class extends A{constructor(){super(...arguments);this.beanName="editModelSvc",this.edits=new Map,this.cellValidations=new E5,this.rowValidations=new U5,this.suspendEdits=!1}suspend(_){this.suspendEdits=_}removeEdits({rowNode:_,column:f}){if(!this.hasEdits({rowNode:_})||!_)return;let $=this.getEditRow(_);if(f)$.delete(f);else $.clear();if($.size===0)this.edits.delete(_)}getEditRow(_,f={}){if(this.suspendEdits)return;if(this.edits.size===0)return;let $=_&&this.edits.get(_);if($)return $;if(f.checkSiblings){let z=_.pinnedSibling;if(z)return this.getEditRow(z)}return}getEditRowDataValue(_,{checkSiblings:f}={}){if(!_||this.edits.size===0)return;let $=this.getEditRow(_),z=_.pinnedSibling,Q=f&&z&&this.getEditRow(z);if(!$&&!Q)return;let J={..._.data},q=(X,Y)=>X.forEach(({editorValue:Z,pendingValue:G},E)=>{let U=Z===void 0?G:Z;if(U!==v_)Y[E.getColId()]=U});if($)q($,J);if(Q)q(Q,J);return J}getEdit(_={},f){let{rowNode:$,column:z}=_,Q=this.edits;if(this.suspendEdits||Q.size===0||!$||!z)return;let J=Q.get($)?.get(z);if(J)return J;if(f?.checkSiblings){let q=$.pinnedSibling;if(q)return Q.get(q)?.get(z)}return}getEditMap(_=!0){if(this.suspendEdits||this.edits.size===0)return new Map;if(!_)return this.edits;let f=new Map;return this.edits.forEach(($,z)=>{let Q=new Map;$.forEach(({editorState:J,...q},X)=>Q.set(X,{...q})),f.set(z,Q)}),f}setEditMap(_){this.edits.clear(),_.forEach((f,$)=>{let z=new Map;f.forEach((Q,J)=>z.set(J,{...Q})),this.edits.set($,z)})}setEdit(_,f){let $=this.edits;if($.size===0||!$.has(_.rowNode))$.set(_.rowNode,new Map);let z=this.getEdit(_),Q={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...z,...f};return this.getEditRow(_.rowNode).set(_.column,Q),Q}clearEditValue(_){let{rowNode:f,column:$}=_;if(!f)return;let z=(J)=>{J.editorValue=void 0,J.pendingValue=J.sourceValue,J.state="changed"};if(!$){this.getEditRow(f)?.forEach(z);return}let Q=this.getEdit(_);if(Q)z(Q)}getState(_){if(this.suspendEdits)return;return this.getEdit(_)?.state}getEditPositions(_){if(this.suspendEdits||(_??this.edits).size===0)return[];let f=[];return(_??this.edits).forEach(($,z)=>{for(let Q of $.keys()){let{editorState:J,...q}=$.get(Q);f.push({rowNode:z,column:Q,...q})}}),f}hasRowEdits(_,f){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;return!!this.getEditRow(_,f)}hasEdits(_={},f={}){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;let{rowNode:$,column:z}=_,{withOpenEditor:Q}=f;if($){let J=this.getEditRow($,f);if(!J)return!1;if(z){if(Q)return this.getEdit(_)?.state==="editing";return J.has(z)}if(J.size!==0){if(Q)return Array.from(J.values()).some(({state:q})=>q==="editing");return!0}return!1}if(Q)return this.getEditPositions().some(({state:J})=>J==="editing");return this.edits.size>0}start(_){let f=this.getEditRow(_.rowNode)??new Map,{rowNode:$,column:z}=_;if(z&&!f.has(z))f.set(z,{editorValue:void 0,pendingValue:v_,sourceValue:this.beans.valueSvc.getValue(z,$,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}});this.edits.set($,f)}stop(_,f,$){if(!this.hasEdits(_))return;if(f){let z=this.getEditRow(_.rowNode)?.get(_.column);if(z&&(z.pendingValue===v_||z.pendingValue===z.sourceValue))this.removeEdits(_);else if(z&&$)z.editorValue=void 0}else this.removeEdits(_)}clear(){for(let _ of this.edits.values())_.clear();this.edits.clear()}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(_){this.cellValidations=_}setRowValidationModel(_){this.rowValidations=_}destroy(){super.destroy(),this.clear()}},E5=class{constructor(){this.cellValidations=new Map}getCellValidation(_){let{rowNode:f,column:$}=_||{};return this.cellValidations?.get(f)?.get($)}hasCellValidation(_){if(!_?.rowNode||!_.column)return this.cellValidations.size>0;return!!this.getCellValidation(_)}setCellValidation(_,f){let{rowNode:$,column:z}=_;if(!this.cellValidations.has($))this.cellValidations.set($,new Map);this.cellValidations.get($).set(z,f)}clearCellValidation(_){let{rowNode:f,column:$}=_;this.cellValidations.get(f)?.delete($)}setCellValidationMap(_){this.cellValidations=_}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},U5=class{constructor(){this.rowValidations=new Map}getRowValidation(_){let{rowNode:f}=_||{};return this.rowValidations.get(f)}hasRowValidation(_){if(!_?.rowNode)return this.rowValidations.size>0;return!!this.getRowValidation(_)}setRowValidation({rowNode:_},f){this.rowValidations.set(_,f)}clearRowValidation({rowNode:_}){this.rowValidations.delete(_)}setRowValidationMap(_){this.rowValidations=_}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}};function Tz(_,f={}){let{rowIndex:$,rowId:z,rowCtrl:Q,rowPinned:J}=f;if(Q)return Q;let{rowModel:q,rowRenderer:X}=_,{rowNode:Y}=f;if(!Y){if(z)Y=y8(_,z,J);else if($!=null)Y=q.getRow($)}return Y?X.getRowCtrlByNode(Y):void 0}function l(_,f={}){let{cellCtrl:$,colId:z,columnId:Q,column:J}=f;if($)return $;let q=_.colModel.getCol(z??Q??g6(J)),X=f.rowCtrl??Tz(_,f),Y=X?.getCellCtrl(q)??void 0;if(Y)return Y;let Z=f.rowNode??X?.rowNode;if(Z)return _.rowRenderer.getCellCtrls([Z],[q])?.[0];return}function D9(_){let{editSvc:f}=_;if(f?.isBatchEditing())Xf(_,{persist:!0}),qf(_);else f?.stopEditing(void 0,{source:"api"})}function $B(_,f,$){let{gos:z,popupSvc:Q}=f;if(!z.get("stopEditingWhenCellsLoseFocus"))return;let J=(q)=>{let X=q.relatedTarget;if(T6(X)===null){D9(f);return}let Y=$.some((Z)=>Z.contains(X))&&z.isElementInThisInstance(X);if(!Y)Y=!!Q&&(Q.getActivePopups().some((Z)=>Z.contains(X))||Q.isElementWithinCustomPopup(X));if(!Y)D9(f)};for(let q of $)_.addManagedElementListeners(q,{focusout:J})}function g6(_){if(!_)return;if(typeof _==="string")return _;return _.getColId()}var v_=Symbol("unedited"),zB=(_,f={})=>{let $=_.rowRenderer.getCellCtrls(f.rowNodes,f.columns),z=Array($.length),Q=0;for(let J=0,q=$.length;J0)f.set($,Q)}return f}function lf(_,f,$){let{key:z,event:Q,cellStartedEdit:J,silent:q}=$??{},{editModelSvc:X,gos:Y,userCompFactory:Z}=_,G=l(_,f),E=G?.comp?.getCellEditor(),U=W5(_,f,z,J&&!q),H=X?.getEdit(f),W=U.value??H?.sourceValue;if(E){X?.setEdit(f,{editorValue:v1(_,W,!0,f.column),state:"editing"}),E.refresh?.(U);return}let B=f.column.getColDef(),K=oq(Z,B,U);if(!K)return;let{popupFromSelector:L,popupPositionFromSelector:F}=K,D=L??!!B.cellEditorPopup,M=F??B.cellEditorPopupPosition;if(B5(K.params,Q),!G)return;let{rangeFeature:k,rowCtrl:R,comp:O,onEditorAttachedFuncs:I}=G;X?.setEdit(f,{editorValue:v1(_,W,!0,f.column),state:"editing",editorState:{cellStartedEditing:void 0,cellStoppedEditing:void 0}}),G.editCompDetails=K,I.push(()=>k?.unsetComp()),O?.setEditDetails(K,D,M,Y.get("reactiveCustomComponents")),R?.refreshRow({suppressFlash:!0}),qB(_,f,Q,W,q)}function qB(_,f,$,z,Q){let{editSvc:J,editModelSvc:q}=_,X=q?.getEdit(f);if(!Q&&X?.state==="editing"&&!X?.editorState?.cellStartedEditing)J?.dispatchCellEvent(f,$,"cellEditingStarted",{value:z}),q?.setEdit(f,{editorState:{cellStartedEditing:!0}})}function H5(_,f,$){let z={editorValueExists:!1};if(cJ(_)){if((f.getValidationErrors?.()?.length??0)>0)return z}if($?.isCancelling)return z;if($?.isStopping){let J=f?.isCancelAfterEnd?.();if(J)return{...z,isCancelAfterEnd:J}}return{editorValue:f.getValue(),editorValueExists:!0}}function W5(_,f,$,z){let{valueSvc:Q,gos:J,editSvc:q}=_,X=_.gos.get("enableGroupEdit"),Y=l(_,f),Z=f.rowNode?.rowIndex??void 0,G=q?.isBatchEditing(),E=_.colModel.getCol(f.column.getId()),{rowNode:U,column:H}=f,W=Y.comp?.getCellEditor(),B=q?.getCellDataValue(f),K=B===void 0?W?H5(_,W)?.editorValue:void 0:B,L=K===v_?Q.getValueForDisplay({column:E,node:U,from:"edit"})?.value:K,F=X?K:L;if(H.isAllowFormula()&&_.formula?.isFormula(F))F=_.formula?.normaliseFormula(F,!0)??F;return C(J,{value:F,eventKey:$??null,column:H,colDef:H.getColDef(),rowIndex:Z,node:U,data:U.data,cellStartedEdit:!!z,onKeyDown:Y?.onKeyDown.bind(Y),stopEditing:(D)=>{q.stopEditing(f,{source:G?"ui":"api",suppressNavigateAfterEdit:D}),W$(_,f,{})},eGridCell:Y?.eGui,parseValue:(D)=>Q.parseValue(E,U,D,Y?.value),formatValue:Y?.formatValue.bind(Y),validate:()=>{q?.validateEdit()}})}function l1(_,f){let{editModelSvc:$}=_;$?.getEditMap().forEach((z,Q)=>{z.forEach((J,q)=>{if(!f&&(J.state==="editing"||J.pendingValue===v_))return;if(!L0(J)&&(J.state!=="editing"||f))$?.removeEdits({rowNode:Q,column:q})})})}function XB(_,f){let $=f.comp?.getCellEditor();if(!$?.refresh)return;let{eventKey:z,cellStartedEdit:Q}=f.editCompDetails.params,{column:J}=f,q=W5(_,f,z,Q),X=J.getColDef(),Y=oq(_.userCompFactory,X,q);$.refresh(B5(Y.params,z))}function B5(_,f){if(f instanceof KeyboardEvent&&_.column.getColDef().cellEditor==="agNumberCellEditor")_.suppressPreventDefault=["-","+",".","e"].includes(f?.key??"")||_.suppressPreventDefault;else f?.preventDefault?.();return _}function Xf(_,f){for(let $ of _.editModelSvc?.getEditPositions()??[]){let z=l(_,$);if(!z)continue;let Q=z.comp?.getCellEditor();if(!Q)continue;let{editorValue:J,editorValueExists:q,isCancelAfterEnd:X}=H5(_,Q,f);if(X){let{cellStartedEditing:Y,cellStoppedEditing:Z}=_.editModelSvc?.getEdit($)?.editorState||{};_.editModelSvc?.setEdit($,{editorState:{isCancelAfterEnd:X,cellStartedEditing:Y,cellStoppedEditing:Z}})}H1(_,$,J,void 0,!q,f)}}function H1(_,f,$,z,Q,J){let{editModelSvc:q,valueSvc:X}=_;if(!q)return;let{rowNode:Y,column:Z}=f;if(!(Y&&Z))return;let G=q.getEdit(f);if(G?.sourceValue===void 0){let E=G?v1(_,G.editorValue,!1,Z):v_,U={sourceValue:X.getValue(Z,Y,"data"),pendingValue:E};if(J?.persist)U.state="changed";G=q.setEdit(f,U)}if(q.setEdit(f,{editorValue:Q?v1(_,G.sourceValue,!0,Z):$}),J?.persist)YB(_,f)}function v1(_,f,$,z){let{formula:Q}=_;if(z.isAllowFormula()&&Q?.isFormula(f))return Q?.normaliseFormula(f,$)??f;return f}function YB(_,f){let{editModelSvc:$}=_,z=$?.getEdit(f),J={pendingValue:v1(_,z?.editorValue,!1,f.column)};if(!z?.editorState?.cellStoppedEditing&&z?.state!=="editing")J.state="changed";$?.setEdit(f,J)}function qf(_,f,$={}){if(!f)f=_.editModelSvc?.getEditPositions();if(f)for(let z of f)W$(_,z,$)}function W$(_,f,$,z=l(_,f)){let Q=_.editModelSvc,J=Q?.getEdit(f),q;if(J&&J.state!=="editing"&&J.editorState?.cellStoppedEditing)q=J.state;else q="changed";if(!z){if(J)Q?.setEdit(f,{state:q});return}let X=z.comp,Y=X?.getCellEditor();if(X&&!Y){if(z?.refreshCell(),J){Q?.setEdit(f,{state:q});let G=_.gos.get("enableGroupEdit")?M9(J,$?.cancel):{valueChanged:!1,newValue:void 0,oldValue:J.sourceValue};k9(_,f,G,$)}return}if(cJ(_)){let G=J&&Y?.getValidationErrors?.(),E=Q?.getCellValidationModel();if(G?.length)E?.setCellValidation(f,{errorMessages:G});else E?.clearCellValidation(f)}if(J)Q?.setEdit(f,{state:q});X?.setEditDetails(),X?.refreshEditStyles(!1,!1),z?.refreshCell({force:!0,suppressFlash:!0});let Z=Q?.getEdit(f);if(Z&&Z.state!=="editing"){let G=$?.cancel,E=_.gos.get("enableGroupEdit")?M9(Z,G):ZB(Z,J,G);k9(_,f,E,$)}}function M9(_,f){let{sourceValue:$,pendingValue:z}=_,Q;if(!f&&z!==v_)Q=z;return{valueChanged:!f&&L0(_),newValue:Q,oldValue:$,value:$}}function ZB(_,f,$){if($||_.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:_.sourceValue};let z=_.editorValue;if(z==null||z===v_)z=f?.pendingValue;if(z===v_)z=void 0;return{valueChanged:L0(_),newValue:z,oldValue:_.sourceValue}}function k9(_,f,$,{silent:z,event:Q}={}){let{editSvc:J,editModelSvc:q}=_,X=q?.getEdit(f),{editorState:Y}=X||{},{isCancelBeforeStart:Z,cellStartedEditing:G,cellStoppedEditing:E}=Y||{};if(!z&&!Z&&G&&!E)J?.dispatchCellEvent(f,Q,"cellEditingStopped",$),q?.setEdit(f,{editorState:{cellStoppedEditing:!0}})}function GB(_){if(!_)return!1;for(let f=0,$=_.length;f<$;++f){let z=_[f],Q=z.cellEditorParams;if(!Q||!z.editable&&!z.groupRowEditable)continue;if(Q.minLength!==void 0||Q.maxLength!==void 0||Q.getValidationErrors!==void 0||Q.min!==void 0||Q.max!==void 0)return!0}return!1}function EB(_){let f=_.rowRenderer.getCellCtrls();for(let $=0,z=f.length;$0,D=F?K.join(". "):"";if(l9(L,F),F)z.announceValue(`${Z} ${K}`,"editorValidation");if(L instanceof HTMLInputElement)L.setCustomValidity(D);else L.classList.toggle("invalid",F)}if(K?.length>0)$.setCellValidation({rowNode:W,column:B},{errorMessages:K});G.add(E.rowCtrl)}if(Xf(_,{persist:!1}),J?.setCellValidationModel($),X){let E=UB(_);J?.setRowValidationModel(E)}for(let E of G.values()){E.rowEditStyleFeature?.applyRowStyles();for(let U of E.getAllCellCtrls())U.tooltipFeature?.refreshTooltip(!0),U.editorTooltipFeature?.refreshTooltip(!0),U.editStyleFeature?.applyCellStyles?.()}}var UB=(_)=>{let f=new U5,$=_.gos.get("getFullRowEditValidationErrors"),z=_.editModelSvc?.getEditMap();if(!z)return f;for(let Q of z.keys()){let J=z.get(Q);if(!J)continue;let q=[],{rowIndex:X,rowPinned:Y}=Q;for(let G of J.keys()){let E=J.get(G);if(!E)continue;let{editorValue:U,pendingValue:H,sourceValue:W}=E,B=U??(H===v_?void 0:H)??W;q.push({column:G,colId:G.getColId(),rowIndex:X,rowPinned:Y,oldValue:W,newValue:B})}let Z=$?.({editorsState:q})??[];if(Z.length>0)f.setRowValidation({rowNode:Q},{errorMessages:Z})}return f};function HB(_){Hf(_,!0);let f=_.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!f)return null;let $=[];return f.forEach((z,Q)=>{z.forEach(({errorMessages:J},q)=>{$.push({column:q,rowIndex:Q.rowIndex,rowPinned:Q.rowPinned,messages:J??null})})}),$}function XQ(_){return!!(_.rowPinned&&_.pinnedSibling)}function l_(_,f,$,z){let Q=f==="top";if(!$)return l_(_,f,Q?_.getPinnedTopRow(0):_.getPinnedBottomRow(0),z);if(!z){let Y=Q?_.getPinnedTopRowCount():_.getPinnedBottomRowCount();return l_(_,f,$,Q?_.getPinnedTopRow(Y-1):_.getPinnedBottomRow(Y-1))}let J=!1,q=!1,X=[];return _.forEachPinnedRow(f,(Y)=>{if(Y===$&&!J){J=!0,X.push(Y);return}if(J&&Y===z){q=!0,X.push(Y);return}if(J&&!q)X.push(Y)}),X}function WB(_,f,$,{rowNode:z,column:Q},J){return C(_.gos,{type:$,node:z,data:z.data,value:J,column:Q,colDef:Q.getColDef(),rowPinned:z.rowPinned,event:f,rowIndex:z.rowIndex})}function BB(_,f=!1){if(_===S.DELETE)return!0;if(!f&&_===S.BACKSPACE)return $X();return!1}var KB=class extends A{constructor(_,f,$,z){super();this.cellCtrl=_,this.rowNode=$,this.rowCtrl=z,this.beans=f}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(_){let f=_.key;if(f===S.ENTER&&I_(this.cellCtrl.column)&&this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition,_))return;switch(f){case S.ENTER:this.onEnterKeyDown(_);break;case S.F2:this.onF2KeyDown(_);break;case S.ESCAPE:this.onEscapeKeyDown(_);break;case S.TAB:this.onTabKeyDown(_);break;case S.BACKSPACE:case S.DELETE:this.onBackspaceOrDeleteKeyDown(f,_);break;case S.DOWN:case S.UP:case S.RIGHT:case S.LEFT:this.onNavigationKeyDown(_,f);break}}onNavigationKeyDown(_,f){let{cellCtrl:$,beans:z}=this;if(z.editSvc?.isEditing($,{withOpenEditor:!0}))return;if(_.shiftKey&&$.isRangeSelectionEnabled())this.onShiftRangeSelect(_);else{let Q=$.getFocusedCellPosition();z.navigation?.navigateToNextCell(_,f,Q,!0)}_.preventDefault()}onShiftRangeSelect(_){let{rangeSvc:f,navigation:$}=this.beans;if(!f)return;let z=f.extendLatestRangeInDirection(_);if(!z)return;if(_.key===S.LEFT||_.key===S.RIGHT)$?.ensureColumnVisible(z.column);else $?.ensureRowVisible(z.rowIndex)}onTabKeyDown(_){this.beans.navigation?.onTabKeyDown(this.cellCtrl,_)}onBackspaceOrDeleteKeyDown(_,f){let{cellCtrl:$,beans:z,rowNode:Q}=this,{gos:J,rangeSvc:q,eventSvc:X,editSvc:Y}=z;if(X.dispatchEvent({type:"keyShortcutChangedCellStart"}),BB(_,J.get("enableCellEditingOnBackspace"))&&!Y?.isEditing($,{withOpenEditor:!0})){if(q&&i_(J))q.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if($.isCellEditable()){let Z=z.valueSvc.getDeleteValue($.column,Q);Q.setDataValue($.column,Z,"cellClear")}}else if(!Y?.isEditing($,{withOpenEditor:!0}))z.editSvc?.startEditing($,{startedEdit:!0,event:f});X.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(_){let{cellCtrl:f,beans:$}=this,{editSvc:z,navigation:Q}=$,J=z?.isEditing(f,{withOpenEditor:!0}),q=f.rowNode,X=z?.isRowEditing(q,{withOpenEditor:!0}),Y=(Z)=>{if(z?.startEditing(Z,{startedEdit:!0,event:_,source:"edit"}))_.preventDefault()};if(J||X){if(this.isCtrlEnter(_)){z?.applyBulkEdit(f,$?.rangeSvc?.getCellRanges()||[]);return}if(Hf($),z?.checkNavWithValidation(void 0,_)==="block-stop")return;if(z?.isEditing(f,{withOpenEditor:!0}))z?.stopEditing(f,{event:_,source:"edit"});else if(X&&!f.isCellEditable())z?.stopEditing({rowNode:q},{event:_,source:"edit"});else Y(f)}else if($.gos.get("enterNavigatesVertically")){let Z=_.shiftKey?S.UP:S.DOWN;Q?.navigateToNextCell(null,Z,f.cellPosition,!1)}else{if(z?.hasValidationErrors())return;if(z?.hasValidationErrors(f))z.revertSingleCellEdit(f,!0);Y(f)}}isCtrlEnter(_){return(_.ctrlKey||_.metaKey)&&_.key===S.ENTER}onF2KeyDown(_){let{cellCtrl:f,beans:{editSvc:$}}=this;if($?.isEditing()){if(Hf(this.beans),$?.checkNavWithValidation(void 0,_)==="block-stop")return}$?.startEditing(f,{startedEdit:!0,event:_})}onEscapeKeyDown(_){let{cellCtrl:f,beans:{editSvc:$}}=this;if($?.checkNavWithValidation(f,_)==="block-stop")$.revertSingleCellEdit(f);setTimeout(()=>{$?.stopEditing(f,{event:_,cancel:!0})})}processCharacter(_){let $=_.target!==this.eGui,{beans:{editSvc:z},cellCtrl:Q}=this;if($)return;if(z?.isEditing(Q,{withOpenEditor:!0}))return;if(_.key===S.SPACE)this.onSpaceKeyDown(_);else if(z?.isCellEditable(Q,"ui")){if(z?.hasValidationErrors()&&!z?.hasValidationErrors(Q))return;if(z?.startEditing(Q,{startedEdit:!0,event:_,source:"api",editable:!0}),!Q.editCompDetails?.params?.suppressPreventDefault)_.preventDefault()}}onSpaceKeyDown(_){let{gos:f,editSvc:$}=this.beans,{rowNode:z}=this.cellCtrl;if(!$?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&p0(f))this.beans.selectionSvc?.handleSelectionEvent(_,z,"spaceKey");_.preventDefault()}},LB=class extends A{constructor(_,f,$){super();this.cellCtrl=_,this.column=$,this.beans=f}onMouseEvent(_,f){if(z0(f))return;switch(_){case"click":this.onCellClicked(f);break;case"pointerdown":case"mousedown":case"touchstart":this.onMouseDown(f);break;case"dblclick":this.onCellDoubleClicked(f);break;case"mouseout":this.onMouseOut(f);break;case"mouseover":this.onMouseOver(f);break}}onCellClicked(_){if(this.beans.touchSvc?.handleCellDoubleClick(this,_))return;let{eventSvc:f,rangeSvc:$,editSvc:z,editModelSvc:Q,frameworkOverrides:J,gos:q}=this.beans,X=_.ctrlKey||_.metaKey,{cellCtrl:Y}=this,{column:Z,cellPosition:G,rowNode:E}=Y,U=Ez(q,Z,E,_);if($&&X&&!U){if($.getCellRangeCount(G)>1)$.intersectLastRange(!0)}let H=Y.createEvent(_,"cellClicked");H.isEventHandlingSuppressed=U,f.dispatchEvent(H);let W=Z.getColDef();if(W.onCellClicked)window.setTimeout(()=>{J.wrapOutgoing(()=>{W.onCellClicked(H)})},0);if(U)return;if(Q?.getState(Y)!=="editing"){let B=z?.isEditing(),K=z?.isRangeSelectionEnabledWhileEditing(),L=Q?.getCellValidationModel().getCellValidationMap().size??0,F=Q?.getRowValidationModel().getRowValidationMap().size??0;if(B&&(K||L>0||F>0))return;if(z?.shouldStartEditing(Y,_))z?.startEditing(Y,{event:_});else if(z?.shouldStopEditing(Y,_))if(this.beans.gos.get("editType")==="fullRow")z?.stopEditing(Y,{event:_,source:"edit"});else z?.stopEditing(void 0,{event:_,source:"edit"})}}onCellDoubleClicked(_){let{column:f,beans:$,cellCtrl:z}=this,{eventSvc:Q,frameworkOverrides:J,editSvc:q,editModelSvc:X,gos:Y}=$,Z=Ez(Y,z.column,z.rowNode,_),G=f.getColDef(),E=z.createEvent(_,"cellDoubleClicked");if(E.isEventHandlingSuppressed=Z,Q.dispatchEvent(E),typeof G.onCellDoubleClicked==="function")window.setTimeout(()=>{J.wrapOutgoing(()=>{G.onCellDoubleClicked(E)})},0);if(Z)return;if(q?.shouldStartEditing(z,_)&&X?.getState(z)!=="editing"){let U=q?.isEditing(),H=q?.isRangeSelectionEnabledWhileEditing(),W=X?.getCellValidationModel().getCellValidationMap().size??0,B=X?.getRowValidationModel().getRowValidationMap().size??0;if(U&&(H||W>0||B>0))return;q?.startEditing(z,{event:_})}}onMouseDown(_){let{shiftKey:f}=_,$=_.target,{cellCtrl:z,beans:Q}=this,{eventSvc:J,rangeSvc:q,rowNumbersSvc:X,focusSvc:Y,gos:Z,editSvc:G}=Q,{column:E,rowNode:U,cellPosition:H}=z,W=Ez(Z,E,U,_),B=()=>{let D=z.createEvent(_,"cellMouseDown");D.isEventHandlingSuppressed=W,J.dispatchEvent(D)};if(W){B();return}if(this.isRightClickInExistingRange(_))return;let K=q&&!q.isEmpty(),L=this.containsWidget($),F=I_(E);if(X&&F&&!X.handleMouseDownOnCell(H,_))return;if(!f||!K){let D=G?.isEditing(z),k=Z.get("enableCellTextSelection")&&_.defaultPrevented,R=(ef()||k)&&!D&&!s1($)&&!L;z.focusCell(R,_)}if(f&&K&&!Y.isCellFocused(H)){_.preventDefault();let D=Y.getFocusedCell();if(D){let{column:M,rowIndex:k,rowPinned:R}=D,O=!!G?.isRangeSelectionEnabledWhileEditing?.();if(G?.isEditing(D)&&!O)G?.stopEditing(D);if(!O)Y.setFocusedCell({column:M,rowIndex:k,rowPinned:R,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:_})}}if(L)return;q?.handleCellMouseDown(_,H),B()}isRightClickInExistingRange(_){let{rangeSvc:f}=this.beans;if(f){let $=f.isCellInAnyRange(this.cellCtrl.cellPosition),z=XJ(this.beans,_);if($&&z)return!0}return!1}containsWidget(_){return uf(_,"ag-selection-checkbox",3)||uf(_,"ag-drag-handle",3)}onMouseOut(_){if(this.mouseStayingInsideCell(_))return;let{eventSvc:f,colHover:$}=this.beans;f.dispatchEvent(this.cellCtrl.createEvent(_,"cellMouseOut")),$?.clearMouseOver()}onMouseOver(_){if(this.mouseStayingInsideCell(_))return;let{eventSvc:f,colHover:$}=this.beans;f.dispatchEvent(this.cellCtrl.createEvent(_,"cellMouseOver")),$?.setMouseOver([this.column])}mouseStayingInsideCell(_){if(!_.target||!_.relatedTarget)return!1;let f=this.cellCtrl.eGui,$=f.contains(_.target),z=f.contains(_.relatedTarget);return $&&z}},FB=class extends A{constructor(_,f){super();this.cellCtrl=_,this.beans=f,this.column=_.column,this.rowNode=_.rowNode}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.eSetLeft=this.cellCtrl.getRootElement(),this.eContent=this.cellCtrl.eGui;let _=this.cellCtrl.getCellSpan();if(!_)this.setupColSpan(),this.setupRowSpan();if(this.onLeftChanged(),this.onWidthChanged(),!_)this._legacyApplyRowSpan();if(_){let f=this.refreshSpanHeight.bind(this,_);f(),this.addManagedListeners(this.beans.eventSvc,{paginationChanged:f,recalculateRowBounds:f,pinnedHeightChanged:f})}}refreshSpanHeight(_){let f=_.getCellHeight();if(f!=null)this.eContent.style.height=`${f}px`}onNewColumnsLoaded(){let _=this.column.getRowSpan(this.rowNode);if(this.rowSpan===_)return;this.rowSpan=_,this._legacyApplyRowSpan(!0)}onDisplayColumnsChanged(){let _=this.getColSpanningList();if(!J_(this.colsSpanning,_))this.colsSpanning=_,this.onWidthChanged(),this.onLeftChanged()}setupColSpan(){if(this.column.getColDef().colSpan==null)return;this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)})}onWidthChanged(){if(!this.eContent)return;let _=this.getCellWidth();this.eContent.style.width=`${_}px`}getCellWidth(){if(!this.colsSpanning)return this.column.getActualWidth();return this.colsSpanning.reduce((_,f)=>_+f.getActualWidth(),0)}getColSpanningList(){let{column:_,rowNode:f}=this,$=_.getColSpan(f),z=[];if($===1)z.push(_);else{let Q=_,J=_.getPinned();for(let q=0;Q&&q<$;q++){if(z.push(Q),Q=this.beans.visibleCols.getColAfter(Q),!Q||n(Q))break;if(J!==Q.getPinned())break}}return z}onLeftChanged(){if(!this.eSetLeft)return;let _=this.modifyLeftForPrintLayout(this.getCellLeft());this.eSetLeft.style.left=_+"px"}getCellLeft(){let _;if(this.beans.gos.get("enableRtl")&&this.colsSpanning)_=b(this.colsSpanning);else _=this.column;return _.getLeft()}modifyLeftForPrintLayout(_){if(!this.cellCtrl.printLayout||this.column.getPinned()==="left")return _;let{visibleCols:f}=this.beans,$=f.getColsLeftWidth();if(this.column.getPinned()==="right"){let z=f.bodyWidth;return $+z+(_||0)}return $+(_||0)}_legacyApplyRowSpan(_){if(this.rowSpan===1&&!_)return;let $=vq(this.beans)*this.rowSpan;this.eContent.style.height=`${$}px`,this.eContent.style.zIndex="1"}destroy(){super.destroy()}},DB="ag-cell",MB="ag-cell-auto-height",kB="ag-cell-normal-height",SB="ag-cell-focus",AB="ag-cell-first-right-pinned",RB="ag-cell-last-left-pinned",jB="ag-cell-not-inline-editing",VB="ag-cell-wrap-text",OB=0,_$=class extends A{constructor(_,f,$,z){super();this.column=_,this.rowNode=f,this.rowCtrl=z,this.rangeFeature=void 0,this.rowResizeFeature=void 0,this.positionFeature=void 0,this.customStyleFeature=void 0,this.editStyleFeature=void 0,this.mouseListener=void 0,this.keyboardListener=void 0,this.suppressRefreshCell=!1,this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.focusEventWhileNotReady=null,this.hasBeenFocused=!1,this.hasEdit=!1,this.tooltipFeature=void 0,this.editorTooltipFeature=void 0,this.beans=$,this.gos=$.gos,this.editSvc=$.editSvc,this.hasEdit=!!$.editSvc;let{colId:Q}=_;this.instanceId=Q+"-"+OB++,this.createCellPosition(),this.updateAndFormatValue(!1)}addFeatures(){let{beans:_}=this;this.positionFeature=new FB(this,_),this.customStyleFeature=_.cellStyles?.createCellCustomStyleFeature(this),this.editStyleFeature=_.editSvc?.createCellStyleFeature(this),this.mouseListener=new LB(this,_,this.column),this.keyboardListener=new KB(this,_,this.rowNode,this.rowCtrl),this.enableTooltipFeature();let{rangeSvc:f}=_;if(f&&i_(_.gos))this.rangeFeature=f.createCellRangeFeature(this);if(I_(this.column))this.rowResizeFeature=this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(this)}isCellSpanning(){return!1}getCellSpan(){return}removeFeatures(){let _=this.beans.context;this.positionFeature=_.destroyBean(this.positionFeature),this.editorTooltipFeature=_.destroyBean(this.editorTooltipFeature),this.customStyleFeature=_.destroyBean(this.customStyleFeature),this.editStyleFeature=_.destroyBean(this.editStyleFeature),this.mouseListener=_.destroyBean(this.mouseListener),this.keyboardListener=_.destroyBean(this.keyboardListener),this.rangeFeature=_.destroyBean(this.rangeFeature),this.rowResizeFeature=_.destroyBean(this.rowResizeFeature),this.disableTooltipFeature()}enableTooltipFeature(_,f){this.tooltipFeature=this.beans.tooltipSvc?.enableCellTooltipFeature(this,_,f)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature)}enableEditorTooltipFeature(_){if(this.editorTooltipFeature)this.disableEditorTooltipFeature();this.editorTooltipFeature=this.beans.tooltipSvc?.setupCellEditorTooltip(this,_),Hf(this.beans)}disableEditorTooltipFeature(){this.editorTooltipFeature=this.beans.context.destroyBean(this.editorTooltipFeature)}setComp(_,f,$,z,Q,J,q){this.comp=_,this.eGui=f,this.printLayout=Q,q??(q=this),this.addDomData(q),this.addFeatures(),q.addDestroyFunc(()=>this.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(z,q),this.refreshFirstAndLastStyles(),this.checkFormulaError(),this.refreshAriaRowIndex(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(_),this.editStyleFeature?.setComp(_),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(_),this.rowResizeFeature?.refreshRowResizer();let X=J?this.isCellEditable():void 0,Y=!X&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(X||Y)this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:X});else this.showValue(!1,!0);if(this.onCompAttachedFuncs.length){for(let Z of this.onCompAttachedFuncs)Z();this.onCompAttachedFuncs=[]}}checkFormulaError(){let _=!!this.beans.formula?.getFormulaError(this.column,this.rowNode);this.eGui.classList.toggle("formula-error",_)}setupAutoHeight(_,f){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,_,f)??!1}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){let _=this.column.getColDef();return _.cellRenderer!=null||_.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){let{beans:_,column:f}=this,{userCompFactory:$,ctrlsSvc:z,eventSvc:Q}=_,J=f.getColDef(),q=this.createCellRendererParams();q.deferRender=!0;let X=m2($,J,q);if(z.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let Y,Z=new g((E)=>{Y=E}),[G]=this.addManagedListeners(Q,{bodyScrollEnd:()=>{Y(),G()}});return{loadingComp:X,onReady:Z}}return{loadingComp:X,onReady:g.resolve()}}showValue(_,f){let{beans:$,column:z,rowNode:Q,rangeFeature:J}=this,{userCompFactory:q}=$,X=this.getValueToDisplay(),Y,Z=Q.stub&&Q.groupData?.[z.getId()]==null,G=z.getColDef();if(Z||this.isCellRenderer()){let E=this.createCellRendererParams();if(!Z||I_(z))Y=U$(q,G,E);else Y=m2(q,G,E)}if(!Y&&!Z&&$.findSvc?.isMatch(Q,z)){let E=this.createCellRendererParams();Y=U$(q,{...z.getColDef(),cellRenderer:"agFindCellRenderer"},E)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing(Q,{checkSiblings:!0})){let E=this.editSvc.prepDetailsDuringBatch(this,{compDetails:Y,valueToDisplay:X});if(E){if(E.compDetails)Y=E.compDetails;else if(E.valueToDisplay)X=E.valueToDisplay}}if(this.comp.setRenderDetails(Y,X,_),this.customRowDragComp?.refreshVisibility(),!f&&J)Y0($,()=>J?.refreshRangeStyleAndHandle());this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){let _=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(_),!0),this.includeRowDrag=this.isIncludeControl(_.rowDrag),this.includeDndSource=this.isIncludeControl(_.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){let f=this.column.getColDef().cellRenderer==="agCheckboxCellRenderer",$="";if(f)$=" ag-allow-overflow";return`ag-cell-value${$}`}isIncludeControl(_,f=!1){return(this.rowNode.rowPinned==null||f&&XQ(this.rowNode))&&!!_}isCheckboxSelection(_){let{rowSelection:f,groupDisplayType:$}=this.beans.gridOptions,z=V1(f),Q=x0(this.column);if($==="custom"&&z!=="selectionColumn"&&Q)return!1;return _.checkboxSelection||Q&&typeof f==="object"&&Zf(f)}refreshShouldDestroy(){let _=this.column.getColDef(),f=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(_),!0),$=this.includeRowDrag!=this.isIncludeControl(_.rowDrag),z=this.includeDndSource!=this.isIncludeControl(_.dndSource),Q=this.isAutoHeight!=this.column.isAutoHeight();return f||$||z||Q}onPopupEditorClosed(_){let{editSvc:f}=this.beans;if(!f?.isEditing(this,{withOpenEditor:!0}))return;let $=_ instanceof KeyboardEvent,z=_ instanceof MouseEvent,Q=$&&_.key===S.ESCAPE;if(f.stopEditing(this,{source:f.isBatchEditing()?"ui":"api",cancel:Q,event:$||z?_:void 0}),Q)this.focusCell(!0,_)}stopEditing(_=!1){let{editSvc:f}=this.beans;return f?.stopEditing(this,{cancel:_,source:f?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){let{value:_,valueFormatted:f,column:$,rowNode:z,comp:Q,eGui:J,beans:{valueSvc:q,gos:X,editSvc:Y}}=this;return C(X,{value:_,valueFormatted:f,getValue:()=>q.getValueForDisplay({column:$,node:z,from:"edit"}).value,setValue:(G)=>Y?.setDataValue({rowNode:z,column:$},G)||z.setDataValue($,G),formatValue:this.formatValue.bind(this),data:z.data,node:z,pinned:$.getPinned(),colDef:$.getColDef(),column:$,refreshCell:this.refreshCell.bind(this),eGridCell:J,eParentOfValue:Q.getParentOfValue(),registerRowDragger:(G,E,U,H)=>this.registerRowDragger(G,E,H),setTooltip:(G,E)=>{if(X.assertModuleRegistered("Tooltip",3),this.tooltipFeature)this.disableTooltipFeature();this.enableTooltipFeature(G,E),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(_){if(_.column===this.column)this.refreshCell()}refreshOrDestroyCell(_){if(this.refreshShouldDestroy())this.rowCtrl?.recreateCell(this);else this.refreshCell(_);if(this.hasEdit&&this.editCompDetails){let{editSvc:f,comp:$}=this;if(!$?.getCellEditor()&&f.isEditing(this,{withOpenEditor:!0}))f.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(_){let{editStyleFeature:f,customStyleFeature:$,rowCtrl:{rowEditStyleFeature:z},beans:{cellFlashSvc:Q,filterManager:J},column:q,comp:X,suppressRefreshCell:Y,tooltipFeature:Z}=this;if(Y)return;let{field:G,valueGetter:E,showRowGroup:U,enableCellChangeFlash:H}=q.getColDef(),W=G==null&&E==null&&U==null,B=_?.newData??!1,K=W||_&&(_.force||B),L=!!X,F=this.updateAndFormatValue(L),D=K||F;if(!L)return;if(D){this.showValue(!!B,!1);let M=J?.isSuppressFlashingCellsBecauseFiltering();if(!_?.suppressFlash&&!M&&H)Q?.flashCell(this);f?.applyCellStyles?.(),$?.applyUserStyles(),$?.applyClassesFromColDef(),z?.applyRowStyles(),this.checkFormulaError()}Z?.refreshTooltip(),$?.applyCellClassRules()}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(_){return this.callValueFormatter(_)??_}callValueFormatter(_){return this.beans.valueSvc.formatValue(this.column,this.rowNode,_)}updateAndFormatValue(_){let f=this.value,$=this.valueFormatted,{value:z,valueFormatted:Q}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});if(this.value=z,this.valueFormatted=Q,_)return!this.valuesAreEqual(f,this.value)||this.valueFormatted!=$;return!0}valuesAreEqual(_,f){let $=this.column.getColDef();return $.equals?$.equals(_,f):_===f}addDomData(_){let f=this.eGui;tf(this.beans.gos,f,Vz,this),_.addDestroyFunc(()=>tf(this.beans.gos,f,Vz,null))}createEvent(_,f){let{rowNode:$,column:z,value:Q,beans:J}=this;return WB(J,_,f,{rowNode:$,column:z},Q)}processCharacter(_){this.keyboardListener?.processCharacter(_)}onKeyDown(_){this.keyboardListener?.onKeyDown(_)}onMouseEvent(_,f){this.mouseListener?.onMouseEvent(_,f)}getColSpanningList(){return this.positionFeature?.getColSpanningList()??[]}onLeftChanged(){if(!this.comp)return;this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){if(!this.eGui)return;this.refreshAriaColIndex(),this.refreshFirstAndLastStyles()}refreshFirstAndLastStyles(){let{comp:_,column:f,beans:$}=this;LX(_,f,$.visibleCols)}refreshAriaColIndex(){let _=this.beans.visibleCols.getAriaColIndex(this.column);e9(this.eGui,_)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){let{rowIndex:_,rowPinned:f}=this.cellPosition;return{rowIndex:_,rowPinned:f}}updateRangeBordersIfRangeCount(){if(!this.comp)return;this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){if(!this.comp)return;this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.rangeFeature!=null}focusCell(_=!1,f){let $=this.editSvc?.allowedFocusTargetOnValidation(this);if($&&$!==this)return;this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:_,sourceEvent:f})}restoreFocus(_=!1){let{beans:{editSvc:f,focusSvc:$},comp:z}=this;if(!z||f?.isEditing(this)||!this.isCellFocused()||!$.shouldTakeFocus())return;let Q=()=>{if(!this.isAlive())return;let J=z.getFocusableElement();if(this.isCellFocused())J.focus({preventScroll:!0})};if(_){setTimeout(Q,0);return}Q()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(_){let f=this.eGui;if(!f)return;gf(f,"tabindex",_?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;let _=this.column.isFirstRightPinned();this.comp.toggleCss(AB,_)}onLastLeftPinnedChanged(){if(!this.comp)return;let _=this.column.isLastLeftPinned();this.comp.toggleCss(RB,_)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){let _=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=_),_}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(_){let{beans:f}=this;if(jz(f))return;if(!this.comp){if(_)this.focusEventWhileNotReady=_;return}let $=this.isCellFocused(),z=f.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss(SB,$),$&&(_?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let Q=this.comp.getFocusableElement();if(z){let q=F0(Q,null,!0);if(q.length)Q=q[0]}let J=_?_.preventScrollOnBrowserFocus:!0;Q.focus({preventScroll:J}),O4(f,Q)}if($&&this.focusEventWhileNotReady)this.focusEventWhileNotReady=null;if($&&_)this.rowCtrl.announceDescription()}createCellPosition(){let{rowIndex:_,rowPinned:f}=this.rowNode;this.cellPosition={rowIndex:_,rowPinned:T0(f),column:this.column}}applyStaticCssClasses(){let{comp:_}=this;_.toggleCss(DB,!0),_.toggleCss(jB,!0);let f=this.column.isAutoHeight()==!0;_.toggleCss(MB,f),_.toggleCss(kB,!f)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){if(!this.comp)return;if(this.column.isTooltipEnabled())this.disableTooltipFeature(),this.enableTooltipFeature();else this.disableTooltipFeature();if(this.setWrapText(),this.editSvc?.isEditing(this))this.editSvc?.handleColDefChanged(this);else this.refreshOrDestroyCell({force:!0,suppressFlash:!0})}setWrapText(){let _=this.column.getColDef().wrapText==!0;this.comp.toggleCss(VB,_)}dispatchCellContextMenuEvent(_){let f=this.column.getColDef(),$=this.createEvent(_,"cellContextMenu"),{beans:z}=this;if(z.eventSvc.dispatchEvent($),f.onCellContextMenu)window.setTimeout(()=>{z.frameworkOverrides.wrapOutgoing(()=>{f.onCellContextMenu($)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){if(this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.isCellFocused()&&this.hasBrowserFocus())this.beans.focusSvc.attemptToRecoverFocus();super.destroy()}hasBrowserFocus(){return this.eGui?.contains(d(this.beans))??!1}createSelectionCheckbox(){let _=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(!_)return;return this.beans.context.createBean(_),_.init({rowNode:this.rowNode,column:this.column}),_}createDndSource(){let _=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);if(_)this.beans.context.createBean(_);return _}registerRowDragger(_,f,$){if(this.customRowDragComp){this.customRowDragComp.setDragElement(_,f);return}let z=this.createRowDragComp(_,f,$);if(z)this.customRowDragComp=z,this.addDestroyFunc(()=>{this.beans.context.destroyBean(z),this.customRowDragComp=null}),z.refreshVisibility()}createRowDragComp(_,f,$){let z=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,_,f,$);if(!z)return;return this.beans.context.createBean(z),z}cellEditorAttached(){for(let _ of this.onEditorAttachedFuncs)_();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(_){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!I_(this.column)||!this.eGui)return;let{ariaRowIndex:_}=this.rowCtrl;if(_!=null)Kz(this.eGui,_)}getRootElement(){return this.eGui}};function K5(_,f,$,z,Q,J){if($==null&&f==null)return;let q={},X={},Y=(Z,G)=>{for(let E of Z.split(" ")){if(E.trim()=="")continue;G(E)}};if($){let Z=Object.keys($);for(let G=0;G{if(H)q[W]=!0;else X[W]=!0})}}if(f&&J)for(let Z of Object.keys(f))Y(Z,(G)=>{if(!q[G])X[G]=!0});if(J)Object.keys(X).forEach(J);Object.keys(q).forEach(Q)}function S9(_){if(_.group)return _.level;let f=_.parent;return f?f.level+1:0}var PB=0,h6=class extends A{constructor(_,f,$,z,Q){super();this.rowNode=_,this.useAnimationFrameForCreate=z,this.printLayout=Q,this.focusEventWhileNotReady=null,this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.ariaRowIndex=null,this.businessKey=null,this.beans=f,this.gos=f.gos,this.paginationPage=f.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=_.id+"-"+PB++,this.rowId=U_(_.id),this.initRowBusinessKey(),this.rowFocused=f.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=S9(this.rowNode),this.setRowType(),this.setAnimateFlags($),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=f.editSvc?.createRowStyleFeature(this),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!=="function")return;let _=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=U_(_)}updateGui(_,f){if(_==="left")this.leftGui=f;else if(_==="right")this.rightGui=f;else if(_==="fullWidth")this.fullWidthGui=f;else this.centerGui=f}setComp(_,f,$,z){let{context:Q,rowRenderer:J}=this.beans;z=O$(this,Q,z);let q={rowComp:_,element:f,containerType:$,compBean:z};this.allRowGuis.push(q),this.updateGui($,q),this.initialiseRowComp(q);let X=this.rowNode,Y=this.rowType==="FullWidthLoading"||X.stub,Z=!X.data&&this.beans.rowModel.getType()==="infinite";if(!Y&&!Z&&!X.rowPinned)J.dispatchFirstDataRenderedEvent();this.setupFocus()}unsetComp(_){this.allRowGuis=this.allRowGuis.filter((f)=>f.containerType!==_),this.updateGui(_,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(_){let f=_?"none":"";for(let $ of this.allRowGuis)$.element.style.display=f}initialiseRowComp(_){let f=this.gos;if(this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(_),this.onRowHeightChanged(_),this.updateRowIndexes(_),this.setFocusedClasses(_),this.setStylesFromGridOptions(!1,_),p0(f)&&this.rowNode.selectable)this.onRowSelected(_);this.updateColumnLists(!this.useAnimationFrameForCreate);let $=_.rowComp,z=this.getInitialRowClasses(_.containerType);for(let Q of z)$.toggleCss(Q,!0);if(this.executeSlideAndFadeAnimations(_),this.rowNode.group)N_(_.element,!!this.rowNode.expanded);if(this.setRowCompRowId($),this.setRowCompRowBusinessKey($),tf(f,_.element,Oz,this),_.compBean.addDestroyFunc(()=>tf(f,_.element,Oz,null)),this.useAnimationFrameForCreate)this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,_),this.rowNode.rowIndex,"p2",!1);else this.addHoverFunctionality(_);if(this.isFullWidth())this.setupFullWidth(_);if(f.get("rowDragEntireRow"))this.addRowDraggerToRow(_);if(this.useAnimationFrameForCreate)this.beans.animationFrameSvc.addDestroyTask(()=>{if(!this.isAlive())return;_.rowComp.toggleCss("ag-after-created",!0)});this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(_){if(this.businessKey==null)return;_.setRowBusinessKey(this.businessKey)}setRowCompRowId(_){let f=U_(this.rowNode.id);if(this.rowId=f,f==null)return;_.setRowId(f)}executeSlideAndFadeAnimations(_){let{containerType:f}=_;if(this.slideInAnimation[f])k6(()=>{this.onTopChanged()}),this.slideInAnimation[f]=!1;if(this.fadeInAnimation[f])k6(()=>{_.rowComp.toggleCss("ag-opacity-zero",!1)}),this.fadeInAnimation[f]=!1}addRowDraggerToRow(_){let f=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,_.element);if(!f)return;let $=this.createBean(f,this.beans.context);this.rowDragComps.push($),_.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter((z)=>z!==$),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean($,this.beans.context)})}setupFullWidth(_){let f=this.getPinnedForContainer(_.containerType),$=this.createFullWidthCompDetails(_.element,f);_.rowComp.showFullWidth($)}getFullWidthCellRenderers(){if(this.gos.get("embedFullWidthRows"))return this.allRowGuis.map((_)=>_?.rowComp?.getFullWidthCellRenderer());return[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){let _=this.gos.getCallback("processRowPostCreate");if(!_||!this.areAllContainersReady())return;let f={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};_(f)}areAllContainersReady(){let{leftGui:_,centerGui:f,rightGui:$,beans:{visibleCols:z}}=this,Q=!!_||!z.isPinningLeft(),J=!!f,q=!!$||!z.isPinningRight();return Q&&J&&q}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;let _=this.beans.gos.getCallback("isFullWidthRow");return _?_({rowNode:this.rowNode}):!1}setRowType(){let{rowNode:_,gos:f,beans:{colModel:$}}=this,z=_.stub&&!f.get("suppressServerSideFullWidthLoadingRow")&&!f.get("groupHideOpenParents"),Q=this.isNodeFullWidthCell(),J=f.get("masterDetail")&&_.detail,q=$.isPivotMode(),X=Iq(f,_,q);if(z)this.rowType="FullWidthLoading";else if(J)this.rowType="FullWidthDetail";else if(Q)this.rowType="FullWidth";else if(X)this.rowType="FullWidthGroup";else this.rowType="Normal"}updateColumnLists(_=!1,f=!1){if(this.isFullWidth())return;let{animationFrameSvc:$}=this.beans;if(!$?.active||_||this.printLayout){this.updateColumnListsImpl(f);return}if(this.updateColumnListsPending)return;$.createTask(()=>{if(!this.active)return;this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0}getNewCellCtrl(_){if(this.beans.rowSpanSvc?.isCellSpanning(_,this.rowNode))return;return new _$(_,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(_){return!this.beans.rowSpanSvc?.isCellSpanning(_.column,this.rowNode)}createCellCtrls(_,f,$=null){let z={list:[],map:{}},Q=(Z,G,E)=>{if(E!=null)z.list.splice(E,0,G);else z.list.push(G);z.map[Z]=G},J=[];for(let Z of f){let G=Z.getInstanceId(),E=_.map[G];if(E&&!this.isCorrectCtrlForSpan(E))E.destroy(),E=void 0;if(!E)E=this.getNewCellCtrl(Z);if(!E)continue;Q(G,E)}for(let Z of _.list){let G=Z.column.getInstanceId();if(z.map[G]!=null)continue;if(!this.isCellEligibleToBeRemoved(Z,$))J.push([G,Z]);else Z.destroy()}if(J.length)for(let[Z,G]of J){let E=z.list.findIndex((H)=>H.column.getLeft()>G.column.getLeft()),U=E===-1?void 0:Math.max(E-1,0);Q(Z,G,U)}let{focusSvc:q,visibleCols:X}=this.beans,Y=q.getFocusedCell();if(Y&&Y.column.getPinned()==$){let Z=Y.column.getInstanceId();if(!z.map[Z]&&X.allCols.includes(Y.column)){let E=this.createFocusedCellCtrl();if(E){let U=z.list.findIndex((W)=>W.column.getLeft()>E.column.getLeft()),H=U===-1?void 0:Math.max(U-1,0);Q(Z,E,H)}}}return z}createFocusedCellCtrl(){let{focusSvc:_,rowSpanSvc:f}=this.beans,$=_.getFocusedCell();if(!$)return;let z=f?.getCellSpan($.column,this.rowNode);if(z){if(z.firstNode!==this.rowNode||!z.doesSpanContain($))return}else if(!_.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl($.column)}updateColumnListsImpl(_){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(_)}setCellCtrls(_){for(let f of this.allRowGuis){let $=this.getCellCtrlsForContainer(f.containerType);f.rowComp.setCellCtrls($,_)}}getCellCtrlsForContainer(_){switch(_){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){let _=this.beans.colViewport,f=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,f.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{let $=_.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,$);let z=f.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,z,"left");let Q=f.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,Q,"right")}}isCellEligibleToBeRemoved(_,f){let{column:Q}=_;if(Q.getPinned()!=f)return!0;if(!this.isCorrectCtrlForSpan(_))return!0;let{visibleCols:J,editSvc:q}=this.beans,X=q?.isEditing(_),Y=_.isCellFocused();if(X||Y)return J.allCols.indexOf(Q)>=0?!1:!0;return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||S_(this.gos,"print")}listenOnDomOrder(_){let f=()=>{_.rowComp.setDomOrder(this.getDomOrder())};_.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],f)}setAnimateFlags(_){if(this.rowNode.sticky||!_)return;let f=v(this.rowNode.oldRowTop),{visibleCols:$}=this.beans,z=$.isPinningLeft(),Q=$.isPinningRight();if(f){let{slideInAnimation:J}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){J.fullWidth=!0;return}J.center=!0,J.left=z,J.right=Q}else{let{fadeInAnimation:J}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){J.fullWidth=!0;return}J.center=!0,J.left=z,J.right=Q}}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){let _=(q,X)=>{if(!q)return!0;return q.rowComp.refreshFullWidth(()=>{return this.createFullWidthCompDetails(q.element,X).params})},f=_(this.fullWidthGui,null),$=_(this.centerGui,null),z=_(this.leftGui,"left"),Q=_(this.rightGui,"right");return f&&$&&z&&Q}addListeners(){let{beans:_,gos:f,rowNode:$}=this,{expansionSvc:z,eventSvc:Q,context:J,rowSpanSvc:q}=_;if(this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...z?.getRowExpandedListeners(this)??{}}),$.detail)this.addManagedListeners($.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)});if(this.addManagedListeners($,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners(Q,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),q)this.addManagedListeners(q,{spannedCellsUpdated:({pinned:X})=>{if(X&&!$.rowPinned)return;this.updateColumnLists()}});this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,J),this.tooltipFeature=this.destroyBean(this.tooltipFeature,J),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,J)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(f.get("rowDragEntireRow")){for(let Y of this.allRowGuis)this.addRowDraggerToRow(Y);return}this.rowDragComps=this.destroyBeans(this.rowDragComps,J)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{for(let _ of this.getAllCellCtrls())_.onRowIndexChanged()},cellChanged:(_)=>{for(let f of this.getAllCellCtrls())f.onCellChanged(_)}})}onRowPinned(){for(let _ of this.allRowGuis)_.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(_){this.refreshRow({suppressFlash:!_.update,newData:!_.update})}refreshRow(_){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){if(!this.refreshFullWidth())this.beans.rowRenderer.redrawRow(this.rowNode);return}for(let $ of this.getAllCellCtrls())$.refreshCell(_);for(let $ of this.allRowGuis)this.setRowCompRowId($.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey($.rowComp);this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.rowEditStyleFeature?.applyRowStyles(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){let _=this.beans.rowDropHighlightSvc,f=_?.row===this.rowNode?_.position:"none",$=f==="above",z=f==="inside",Q=f==="below",J=f!=="none",q=$||Q,X=this.rowNode.uiLevel,Y=q&&X>0,Z=Y?X.toString():"0";for(let G of this.allRowGuis){let E=G.rowComp;if(E.toggleCss("ag-row-highlight-above",$),E.toggleCss("ag-row-highlight-inside",z),E.toggleCss("ag-row-highlight-below",Q),E.toggleCss("ag-row-highlight-indent",Y),J)G.element.style.setProperty("--ag-row-highlight-level",Z);else G.element.style.removeProperty("--ag-row-highlight-level")}}postProcessRowDragging(){let _=this.rowNode.dragging;for(let f of this.allRowGuis)f.rowComp.toggleCss("ag-row-dragging",_)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:T0(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(_){let f=this.findFullWidthInfoForEvent(_);if(!f)return;let{rowGui:$,column:z}=f;if($.element!==_.target)return;let q=this.rowNode,{focusSvc:X,navigation:Y}=this.beans,Z=X.getFocusedCell(),G={rowIndex:q.rowIndex,rowPinned:q.rowPinned,column:Z?.column??z};Y?.navigateToNextCell(_,_.key,G,!0),_.preventDefault()}onTabKeyDown(_){if(_.defaultPrevented||z0(_))return;let f=this.allRowGuis.find((X)=>X.element.contains(_.target)),$=f?f.element:null,z=$===_.target,Q=d(this.beans),J=!1;if($&&Q)J=$.contains(Q)&&Q.classList.contains("ag-cell");let q=null;if(!z&&!J)q=V_(this.beans,$,!1,_.shiftKey);if(this.isFullWidth()&&z||!q)this.beans.navigation?.onTabKeyDown(this,_)}getFullWidthElement(){if(this.fullWidthGui)return this.fullWidthGui.element;return null}getRowYPosition(){let _=this.allRowGuis.find((f)=>A_(f.element))?.element;if(_)return _.getBoundingClientRect().top;return 0}onSuppressCellFocusChanged(_){let f=this.isFullWidth()&&_?void 0:this.gos.get("tabIndex");for(let $ of this.allRowGuis)gf($.element,"tabindex",f)}setupFocus(){if(!this.isFullWidth())return;this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0)}restoreFullWidthFocus(_=!1){let{focusSvc:f,editSvc:$}=this.beans;if($?.isEditing(this))return;if(!f.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!f.shouldTakeFocus())return;let z=this.getFullWidthRowGuiForFocus();if(!z)return;let Q=()=>{if(!this.isAlive())return;if(f.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))z.element.focus({preventScroll:!0})};if(_){setTimeout(Q,0);return}Q()}getFullWidthRowGuiForFocus(_){if(this.fullWidthGui)return this.fullWidthGui;let f=this.beans.focusSvc.getFocusedCell(),$=this.beans.colModel.getCol(_?.column??f?.column);if(!$)return;let z=$?.pinned;if(z==="right")return this.rightGui;if(z==="left")return this.leftGui;return this.centerGui}setFullWidthRowFocusedClass(_,f){this.forEachGui(void 0,($)=>{$.element.classList.toggle("ag-full-width-focus",f&&$===_)})}onFullWidthRowFocused(_){let{focusSvc:f}=this.beans;if(!(this.isFullWidth()&&f.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))){this.setFullWidthRowFocusedClass(void 0,!1);return}let z=this.getFullWidthRowGuiForFocus(_);if(!z){if(_)this.focusEventWhileNotReady=_;this.setFullWidthRowFocusedClass(void 0,!1);return}if(this.setFullWidthRowFocusedClass(z,!0),this.focusEventWhileNotReady=null,_?.forceBrowserFocus)z.element.focus({preventScroll:!0})}recreateCell(_){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,_),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,_),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,_),_.destroy(),this.updateColumnLists()}removeCellCtrl(_,f){let $={list:[],map:{}};for(let z of _.list){if(z===f)continue;$.list.push(z),$.map[z.column.getInstanceId()]=z}return $}onMouseEvent(_,f){switch(_){case"dblclick":this.onRowDblClick(f);break;case"click":this.onRowClick(f);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(f);break}}createRowEvent(_,f){let{rowNode:$}=this;return C(this.gos,{type:_,node:$,data:$.data,rowIndex:$.rowIndex,rowPinned:$.rowPinned,event:f})}createRowEventWithSource(_,f){let $=this.createRowEvent(_,f);return $.source=this,$}onRowDblClick(_){if(z0(_))return;let f=this.createRowEventWithSource("rowDoubleClicked",_);f.isEventHandlingSuppressed=this.isSuppressMouseEvent(_),this.beans.eventSvc.dispatchEvent(f)}findFullWidthInfoForEvent(_){if(!_)return;let f=this.findFullWidthRowGui(_.target),$=this.getColumnForFullWidth(f);if(!f||!$)return;return{rowGui:f,column:$}}findFullWidthRowGui(_){return this.allRowGuis.find((f)=>f.element.contains(_))}getColumnForFullWidth(_){let{visibleCols:f}=this.beans;switch(_?.containerType){case"center":return f.centerCols[0];case"left":return f.leftCols[0];case"right":return f.rightCols[0];default:return f.allCols[0]}}onRowMouseDown(_){if(this.lastMouseDownOnDragger=uf(_.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(_))return;let{rangeSvc:f,focusSvc:$}=this.beans;f?.removeAllCellRanges();let z=this.findFullWidthInfoForEvent(_);if(!z)return;let{rowGui:Q,column:J}=z,q=Q.element,X=_.target,Y=this.rowNode,Z=_.defaultPrevented||ef();if(q&&q.contains(X)&&s1(X))Z=!1;$.setFocusedCell({rowIndex:Y.rowIndex,column:J,rowPinned:Y.rowPinned,forceBrowserFocus:Z})}isSuppressMouseEvent(_){let{gos:f,rowNode:$}=this;if(this.isFullWidth()){let Q=this.findFullWidthRowGui(_.target);return MG(f,Q?.rowComp.getFullWidthCellRendererParams(),$,_)}let z=P$(f,_.target);return z!=null&&Ez(f,z.column,$,_)}onRowClick(_){if(z0(_)||this.lastMouseDownOnDragger)return;let $=this.isSuppressMouseEvent(_),{eventSvc:z,selectionSvc:Q}=this.beans,J=this.createRowEventWithSource("rowClicked",_);if(J.isEventHandlingSuppressed=$,z.dispatchEvent(J),$)return;Q?.handleSelectionEvent(_,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(_){if(this.rowType!=="FullWidthDetail")return;this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,_)}createFullWidthCompDetails(_,f){let{gos:$,rowNode:z}=this,Q=C($,{fullWidth:!0,data:z.data,node:z,value:z.key,valueFormatted:z.key,eGridCell:_,eParentOfValue:_,pinned:f,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(q,X,Y,Z)=>this.addFullWidthRowDragging(q,X,Y,Z),setTooltip:(q,X)=>{$.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(q,X)}}),J=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return X8(J,Q);case"FullWidthGroup":{let{value:q,valueFormatted:X}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return Q.value=q,Q.valueFormatted=X,q8(J,Q)}case"FullWidthLoading":return J8(J,Q);default:return Q8(J,Q)}}setupFullWidthRowTooltip(_,f){if(!this.fullWidthGui)return;this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,_,f)}addFullWidthRowDragging(_,f,$="",z){let{rowDragSvc:Q,context:J}=this.beans;if(!Q||!this.isFullWidth())return;let q=Q.createRowDragComp(()=>$,this.rowNode,void 0,_,f,z);this.createBean(q,J),this.addDestroyFunc(()=>{this.destroyBean(q,J)})}onUiLevelChanged(){let _=S9(this.rowNode);if(this.rowLevel!=_){let f="ag-row-level-"+_,$="ag-row-level-"+this.rowLevel;for(let z of this.allRowGuis)z.rowComp.toggleCss(f,!0),z.rowComp.toggleCss($,!1)}this.rowLevel=_}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){let _=this.isFirstRowOnPage(),f=this.isLastRowOnPage();if(this.firstRowOnPage!==_){this.firstRowOnPage=_;for(let $ of this.allRowGuis)$.rowComp.toggleCss("ag-row-first",_)}if(this.lastRowOnPage!==f){this.lastRowOnPage=f;for(let $ of this.allRowGuis)$.rowComp.toggleCss("ag-row-last",f)}}getAllCellCtrls(){if(this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){let _=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(_,this.rowNode),!_.length)return;for(let f of _)for(let $ of this.allRowGuis)$.rowComp.toggleCss(f,!0)}postProcessRowClassRules(){this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,(_)=>{for(let f of this.allRowGuis)f.rowComp.toggleCss(_,!0)},(_)=>{for(let f of this.allRowGuis)f.rowComp.toggleCss(_,!1)})}setStylesFromGridOptions(_,f){if(_)this.rowStyles=this.processStylesFromGridOptions();this.forEachGui(f,($)=>$.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(_){if(_==="left"||_==="right")return _;return null}getInitialRowClasses(_){let f=this.getPinnedForContainer(_),$=this.isFullWidth(),{rowNode:z,beans:Q}=this,J=[];if(J.push("ag-row"),J.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[_])J.push("ag-opacity-zero");if(J.push(z.rowIndex%2===0?"ag-row-even":"ag-row-odd"),z.isRowPinned()){if(J.push("ag-row-pinned"),Q.pinnedRowModel?.isManual())J.push("ag-row-pinned-manual")}if(!z.isRowPinned()&&z.pinnedSibling)J.push("ag-row-pinned-source");if(z.isSelected())J.push("ag-row-selected");if(z.footer)J.push("ag-row-footer");if(J.push("ag-row-level-"+this.rowLevel),z.stub)J.push("ag-row-loading");if($)J.push("ag-full-width-row");if(Q.expansionSvc?.addExpandedCss(J,z),z.dragging)J.push("ag-row-dragging");let{rowStyleSvc:q}=Q;if(q)q.processClassesFromGridOptions(J,z),q.preProcessRowClassRules(J,z);if(J.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage())J.push("ag-row-first");if(this.isLastRowOnPage())J.push("ag-row-last");if($){if(f==="left")J.push("ag-cell-last-left-pinned");if(f==="right")J.push("ag-cell-first-right-pinned")}return J}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(_){this.beans.selectionSvc?.onRowCtrlSelected(this,(f)=>{if(f===this.centerGui||f===this.fullWidthGui)this.announceDescription()},_)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(_){if(!this.active)return;let{element:f,compBean:$}=_,{rowNode:z,beans:Q,gos:J}=this;$.addManagedListeners(f,{pointerenter:(q)=>{if(q.pointerType==="mouse")z.dispatchRowEvent("mouseEnter")},pointerleave:(q)=>{if(q.pointerType==="mouse")z.dispatchRowEvent("mouseLeave")}}),$.addManagedListeners(z,{mouseEnter:()=>{if(!Q.dragSvc?.dragging&&!J.get("suppressRowHoverHighlight"))f.classList.add("ag-row-hover"),z.setHovered(!0)},mouseLeave:()=>{this.resetHoveredStatus(f)}})}resetHoveredStatus(_){let f=_?[_]:this.allRowGuis.map(($)=>$.element);for(let $ of f)$.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(_){let f=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),$=this.applyPaginationOffset(f.top,!0)-100,z=this.applyPaginationOffset(f.bottom,!0)+100;return Math.min(Math.max($,_),z)}forEachGui(_,f){if(_)f(_);else for(let $ of this.allRowGuis)f($)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(_){if(this.rowNode.rowHeight==null)return;let f=this.rowNode.rowHeight,$=this.beans.environment.getDefaultRowHeight(),Q=Pq(this.gos)?Y$(this.beans,this.rowNode).height:void 0,J=Q?`${Math.min($,Q)-2}px`:void 0;this.forEachGui(_,(q)=>{if(q.element.style.height=`${f}px`,J)q.element.style.setProperty("--ag-line-height",J)})}destroyFirstPass(_=!1){this.active=!1;let{rowNode:f}=this;if(!_&&S1(this.gos)&&!f.sticky)if(f.rowTop!=null){let Q=this.roundRowTopToBounds(f.rowTop);this.setRowTop(Q)}else for(let Q of this.allRowGuis)Q.rowComp.toggleCss("ag-opacity-zero",!0);if(this.fullWidthGui?.element.contains(d(this.beans)))this.beans.focusSvc.attemptToRecoverFocus();f.setHovered(!1);let $=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent($),this.beans.eventSvc.dispatchEvent($),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;let _=(f)=>{for(let $ of f.list)$.destroy();return{list:[],map:{}}};this.centerCellCtrls=_(this.centerCellCtrls),this.leftCellCtrls=_(this.leftCellCtrls),this.rightCellCtrls=_(this.rightCellCtrls)}setFocusedClasses(_){this.forEachGui(_,(f)=>{f.rowComp.toggleCss("ag-row-focus",this.rowFocused),f.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){let{focusSvc:_}=this.beans,f=_.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);if(f!==this.rowFocused)this.rowFocused=f,this.setFocusedClasses()}onPaginationChanged(){let _=this.beans.pagination?.getCurrentPage()??0;if(this.paginationPage!==_)this.paginationPage=_,this.onTopChanged();this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(_,f=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return _;let $=this.beans.pageBounds.getPixelOffset();return _+$*(f?1:-1)}setRowTop(_){if(this.printLayout)return;if(v(_)){let f=this.applyPaginationOffset(_),Q=`${this.rowNode.isRowPinned()||this.rowNode.sticky?f:this.beans.rowContainerHeight.getRealPixelPosition(f)}px`;this.setRowTopStyle(Q)}}getInitialRowTop(_){return this.suppressRowTransform?this.getInitialRowTopShared(_):void 0}getInitialTransform(_){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(_)})`}getInitialRowTopShared(_){if(this.printLayout)return"";let f=this.rowNode,$;if(f.sticky)$=f.stickyRowTop;else{let z=this.slideInAnimation[_]?this.roundRowTopToBounds(f.oldRowTop):f.rowTop,Q=this.applyPaginationOffset(z);$=f.isRowPinned()?Q:this.beans.rowContainerHeight.getRealPixelPosition(Q)}return $+"px"}setRowTopStyle(_){for(let f of this.allRowGuis)if(this.suppressRowTransform)f.rowComp.setTop(_);else f.rowComp.setTransform(`translateY(${_})`)}getCellCtrl(_,f=!1){let $=null;for(let z of this.getAllCellCtrls())if(z.column==_)$=z;if($!=null||f)return $;for(let z of this.getAllCellCtrls())if(z?.getColSpanningList().indexOf(_)>=0)$=z;return $}onRowIndexChanged(){if(this.rowNode.rowIndex!=null)this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss()}updateRowIndexes(_){let f=this.rowNode.getRowIndexString();if(f===null)return;let $=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),z=this.rowNode.rowIndex%2===0,Q=this.ariaRowIndex=$+this.rowNode.rowIndex+1;this.forEachGui(_,(J)=>{J.rowComp.setRowIndex(f),J.rowComp.toggleCss("ag-row-even",z),J.rowComp.toggleCss("ag-row-odd",!z),Kz(J.element,Q)})}},vB=class extends A{constructor(){super();this.beanName="navigation",this.onPageDown=N2(this.onPageDown,100),this.onPageUp=N2(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCon=_.gridBodyCtrl})}handlePageScrollingKey(_,f=!1){let{key:$,altKey:z}=_,Q=_.ctrlKey||_.metaKey,J=!!this.beans.rangeSvc&&_.shiftKey,q=yJ(this.gos,_),X=!1;switch($){case S.PAGE_HOME:case S.PAGE_END:if(!Q&&!z)this.onHomeOrEndKey($),X=!0;break;case S.LEFT:case S.RIGHT:case S.UP:case S.DOWN:if(!q)return!1;if(Q&&!z&&!J)this.onCtrlUpDownLeftRight($,q),X=!0;break;case S.PAGE_DOWN:case S.PAGE_UP:if(!Q&&!z)X=this.handlePageUpDown($,q,f);break}if(X)_.preventDefault();return X}handlePageUpDown(_,f,$){if($)f=this.beans.focusSvc.getFocusedCell();if(!f)return!1;if(_===S.PAGE_UP)this.onPageUp(f);else this.onPageDown(f);return!0}navigateTo({scrollIndex:_,scrollType:f,scrollColumn:$,focusIndex:z,focusColumn:Q,isAsync:J,rowPinned:q}){let{scrollFeature:X}=this.gridBodyCon;if(v($)&&!$.isPinned())X.ensureColumnVisible($);if(v(_))X.ensureIndexVisible(_,f);if(!J)X.ensureIndexVisible(z);let{focusSvc:Y}=this.beans;Y.setFocusedCell({rowIndex:z,column:Q,rowPinned:q,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:z,rowPinned:q,column:Q})}onPageDown(_){let f=this.beans,$=B6(f),z=this.getViewportHeight(),{pageBounds:Q,rowModel:J,rowAutoHeight:q}=f,X=Q.getPixelOffset(),Y=$.top+z,Z=J.getRowIndexAtPixel(Y+X);if(q?.active)this.navigateToNextPageWithAutoHeight(_,Z);else this.navigateToNextPage(_,Z)}onPageUp(_){let f=this.beans,$=B6(f),{pageBounds:z,rowModel:Q,rowAutoHeight:J}=f,q=z.getPixelOffset(),X=$.top,Y=Q.getRowIndexAtPixel(X+q);if(J?.active)this.navigateToNextPageWithAutoHeight(_,Y,!0);else this.navigateToNextPage(_,Y,!0)}navigateToNextPage(_,f,$=!1){let{pageBounds:z,rowModel:Q}=this.beans,J=this.getViewportHeight(),q=z.getFirstRow(),X=z.getLastRow(),Y=z.getPixelOffset(),Z=Q.getRow(_.rowIndex),G=$?Z?.rowHeight-J-Y:J-Y,E=Z?.rowTop+G,U=Q.getRowIndexAtPixel(E+Y);if(U===_.rowIndex){let W=$?-1:1;f=U=_.rowIndex+W}let H;if($){if(H="bottom",UX)U=X;if(f>X)f=X}if(this.isRowTallerThanView(Q.getRow(U)))f=U,H="top";this.navigateTo({scrollIndex:f,scrollType:H,scrollColumn:null,focusIndex:U,focusColumn:_.column})}navigateToNextPageWithAutoHeight(_,f,$=!1){this.navigateTo({scrollIndex:f,scrollType:$?"bottom":"top",scrollColumn:null,focusIndex:f,focusColumn:_.column}),setTimeout(()=>{let z=this.getNextFocusIndexForAutoHeight(_,$);this.navigateTo({scrollIndex:f,scrollType:$?"bottom":"top",scrollColumn:null,focusIndex:z,focusColumn:_.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(_,f=!1){let $=f?-1:1,z=this.getViewportHeight(),{pageBounds:Q,rowModel:J}=this.beans,q=Q.getLastRow(),X=0,Y=_.rowIndex;while(Y>=0&&Y<=q){let Z=J.getRow(Y);if(Z){let G=Z.rowHeight??0;if(X+G>z)break;X+=G}Y+=$}return Math.max(0,Math.min(Y,q))}getViewportHeight(){let _=this.beans,f=B6(_),$=this.beans.scrollVisibleSvc.getScrollbarWidth(),z=f.bottom-f.top;if(_.ctrlsSvc.get("center").isHorizontalScrollShowing())z-=$;return z}isRowTallerThanView(_){if(!_)return!1;let f=_.rowHeight;if(typeof f!=="number")return!1;return f>this.getViewportHeight()}onCtrlUpDownLeftRight(_,f){let $=this.beans.cellNavigation.getNextCellToFocus(_,f,!0);if(!$)return;let z=this.getNormalisedPosition($),{rowIndex:Q,rowPinned:J,column:q}=z??$,X=q;this.navigateTo({scrollIndex:Q,scrollType:null,scrollColumn:X,focusIndex:Q,focusColumn:X,rowPinned:J})}onHomeOrEndKey(_){let f=_===S.PAGE_HOME,{visibleCols:$,pageBounds:z,rowModel:Q}=this.beans,J=$.allCols,q=f?z.getFirstRow():z.getLastRow(),X=Q.getRow(q);if(!X)return;let Y=(f?J:[...J].reverse()).find((Z)=>!Z.isSuppressNavigable(X)&&!I_(Z));if(!Y)return;this.navigateTo({scrollIndex:q,scrollType:null,scrollColumn:Y,focusIndex:q,focusColumn:Y})}onTabKeyDown(_,f){let $=f.shiftKey,z=this.tabToNextCellCommon(_,$,f),Q=this.beans,{ctrlsSvc:J,pageBounds:q,focusSvc:X,gos:Y}=Q;if(z!==!1){if(z)f.preventDefault();else if(z===null)J.get("gridCtrl").allowFocusForNextCoreContainer($);return}if($){let{rowIndex:Z,rowPinned:G}=_.getRowPosition();if(G?Z===0:Z===q.getFirstRow())if(Y.get("headerHeight")===0||W0(Q))q0(Q,!0,!0);else f.preventDefault(),X.focusPreviousFromFirstCell(f)}else{if(_ instanceof _$)_.focusCell(!0);if(X.focusOverlay(!1)||q0(Q,$))f.preventDefault()}}tabToNextCell(_,f){let $=this.beans,{focusSvc:z,rowRenderer:Q}=$,J=z.getFocusedCell();if(!J)return!1;let q=f0($,J);if(!q){if(q=Q.getRowByPosition(J),!q?.isFullWidth())return!1}return!!this.tabToNextCellCommon(q,_,f,"api")}tabToNextCellCommon(_,f,$,z="ui"){let{editSvc:Q,focusSvc:J}=this.beans,q=void 0,X=_ instanceof _$?_:_.getAllCellCtrls()?.[0];if(Q?.isEditing())q=Q?.moveToNextCell(X,f,$,z);else q=this.moveToNextCellNotEditing(_,f,$);if(q===null)return q;return q||!!J.focusedHeader}moveToNextCellNotEditing(_,f,$){let z=this.beans.visibleCols.allCols,Q;if(_ instanceof h6){if(Q={..._.getRowPosition(),column:f?z[0]:b(z)},this.gos.get("embedFullWidthRows")&&$){let q=_.findFullWidthInfoForEvent($);if(q)Q.column=q.column}}else Q=_.getFocusedCellPosition();let J=this.findNextCellToFocusOn(Q,{backwards:f,startEditing:!1});if(J===!1)return null;if(J instanceof _$)J.focusCell(!0);else if(J)return this.tryToFocusFullWidthRow(J,f);return v(J)}findNextCellToFocusOn(_,{backwards:f,startEditing:$,skipToNextEditableCell:z}){let Q=_,J=this.beans,{cellNavigation:q,gos:X,focusSvc:Y,rowRenderer:Z}=J;while(!0){if(_!==Q)_=Q;if(!f)Q=this.getLastCellOfColSpan(Q);Q=q.getNextTabbedCell(Q,f);let G=X.getCallback("tabToNextCell");if(v(G)){let W=G({backwards:f,editing:$,previousCellPosition:_,nextCellPosition:Q?Q:null});if(W===!0)Q=_;else if(W===!1)return!1;else Q={rowIndex:W.rowIndex,column:W.column,rowPinned:W.rowPinned}}if(!Q)return null;if(Q.rowIndex<0){let H=o_(J);return Y.focusHeaderPosition({headerPosition:{headerRowIndex:H+Q.rowIndex,column:Q.column},fromCell:!0}),null}let E=X.get("editType")==="fullRow";if($&&(!E||z)){if(!this.isCellEditable(Q))continue}this.ensureCellVisible(Q);let U=f0(J,Q);if(!U){let H=Z.getRowByPosition(Q);if(!H||!H.isFullWidth()||$)continue;return{...H.getRowPosition(),column:Q?.column}}if(q.isSuppressNavigable(U.column,U.rowNode))continue;return U.setFocusedCellPosition(Q),this.setRangeToCellIfSupported(Q),U}}isCellEditable(_){let f=this.lookupRowNodeForCell(_);if(f)return _.column.isCellEditable(f);return!1}lookupRowNodeForCell({rowIndex:_,rowPinned:f}){let{pinnedRowModel:$,rowModel:z}=this.beans;if(f==="top")return $?.getPinnedTopRow(_);if(f==="bottom")return $?.getPinnedBottomRow(_);return z.getRow(_)}navigateToNextCell(_,f,$,z){let Q=$,J=!1,q=this.beans,{cellNavigation:X,focusSvc:Y,gos:Z}=q;while(Q&&(Q===$||!this.isValidNavigateCell(Q))){if(Z.get("enableRtl")){if(f===S.LEFT)Q=this.getLastCellOfColSpan(Q)}else if(f===S.RIGHT)Q=this.getLastCellOfColSpan(Q);Q=X.getNextCellToFocus(f,Q),J=n(Q)}if(J&&_&&_.key===S.UP)Q={rowIndex:-1,rowPinned:null,column:$.column};if(z){let E=Z.getCallback("navigateToNextCell");if(v(E)){let H=E({key:f,previousCellPosition:$,nextCellPosition:Q?Q:null,event:_});if(v(H))Q={rowPinned:H.rowPinned,rowIndex:H.rowIndex,column:H.column};else Q=null}}if(!Q)return;if(Q.rowIndex<0){let E=o_(q);Y.focusHeaderPosition({headerPosition:{headerRowIndex:E+Q.rowIndex,column:Q.column??$.column},event:_||void 0,fromCell:!0});return}let G=this.getNormalisedPosition(Q);if(G)this.focusPosition(G);else this.tryToFocusFullWidthRow(Q)}getNormalisedPosition(_){if(!!this.beans.spannedRowRenderer?.getCellByPosition(_))return _;this.ensureCellVisible(_);let $=f0(this.beans,_);if(!$)return null;return _=$.getFocusedCellPosition(),this.ensureCellVisible(_),_}tryToFocusFullWidthRow(_,f){let{visibleCols:$,rowRenderer:z,focusSvc:Q,eventSvc:J}=this.beans,q=$.allCols;if(!z.getRowByPosition(_)?.isFullWidth())return!1;let Y=Q.getFocusedCell(),Z={rowIndex:_.rowIndex,rowPinned:_.rowPinned,column:_.column||(f?b(q):q[0])};this.focusPosition(Z);let G=f==null?Y!=null&&Y_(Z,Y):f;return J.dispatchEvent({type:"fullWidthRowFocused",rowIndex:Z.rowIndex,rowPinned:Z.rowPinned,column:Z.column,isFullWidthCell:!0,fromBelow:G}),!0}focusPosition(_){let{focusSvc:f}=this.beans;f.setFocusedCell({rowIndex:_.rowIndex,column:_.column,rowPinned:_.rowPinned,forceBrowserFocus:!0}),this.setRangeToCellIfSupported(_)}setRangeToCellIfSupported(_){if(I_(_.column))return;this.beans.rangeSvc?.setRangeToCell(_)}isValidNavigateCell(_){return!!D_(this.beans,_)}getLastCellOfColSpan(_){let f=f0(this.beans,_);if(!f)return _;let $=f.getColSpanningList();if($.length===1)return _;return{rowIndex:_.rowIndex,column:b($),rowPinned:_.rowPinned}}ensureCellVisible(_){let f=y1(this.gos),$=this.beans.rowModel.getRow(_.rowIndex),z=f&&$?.sticky,{scrollFeature:Q}=this.gridBodyCon;if(!z&&n(_.rowPinned))Q.ensureIndexVisible(_.rowIndex);if(!_.column.isPinned())Q.ensureColumnVisible(_.column)}ensureColumnVisible(_){let f=this.gridBodyCon.scrollFeature;if(!_.isPinned())f.ensureColumnVisible(_)}ensureRowVisible(_){this.gridBodyCon.scrollFeature.ensureIndexVisible(_)}};function B6(_){return _.ctrlsSvc.getScrollFeature().getVScrollPosition()}var f1={moduleName:"KeyboardNavigation",version:c,beans:[vB,rW,qW],apiFunctions:{getFocusedCell:lW,clearFocusedCell:sW,setFocusedCell:aW,setFocusedHeader:_B,tabToNextCell:oW,tabToPreviousCell:eW}},TB=class extends A{constructor(){super(...arguments);this.beanName="pageBoundsListener"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(_){this.calculatePages(),this.eventSvc.dispatchEvent({type:"paginationChanged",animate:_?.animate??!1,newData:_?.newData??!1,newPage:_?.newPage??!1,newPageSize:_?.newPageSize??!1,keepRenderedRows:_?.keepRenderedRows??!1})}calculatePages(){let{pageBounds:_,pagination:f,rowModel:$}=this.beans;if(f)f.calculatePages();else _.calculateBounds(0,$.getRowCount()-1)}},IB=class extends A{constructor(){super(...arguments);this.beanName="pageBounds",this.pixelOffset=0}getFirstRow(){return this.topRowBounds?.rowIndex??-1}getLastRow(){return this.bottomRowBounds?.rowIndex??-1}getCurrentPageHeight(){let{topRowBounds:_,bottomRowBounds:f}=this;if(!_||!f)return 0;return Math.max(f.rowTop+f.rowHeight-_.rowTop,0)}getCurrentPagePixelRange(){let{topRowBounds:_,bottomRowBounds:f}=this,$=_?.rowTop??0,z=f?f.rowTop+f.rowHeight:0;return{pageFirstPixel:$,pageLastPixel:z}}calculateBounds(_,f){let{rowModel:$}=this.beans,z=$.getRowBounds(_);if(z)z.rowIndex=_;this.topRowBounds=z;let Q=$.getRowBounds(f);if(Q)Q.rowIndex=f;this.bottomRowBounds=Q,this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){let _=this.topRowBounds?.rowTop??0;if(this.pixelOffset===_)return;this.pixelOffset=_,this.eventSvc.dispatchEvent({type:"paginationPixelOffsetChanged"})}},yB=".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}",bB=class extends A{constructor(_,f){super();this.isLeft=_,this.elements=f,this.getWidth=_?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[`${this.isLeft?"left":"right"}PinnedWidthChanged`]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){let _=this.getWidth(),f=_>0;for(let $ of this.elements)if($)N($,f),I0($,_)}},CB=class extends A{constructor(){super(...arguments);this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(f)=>{this.gridBodyCtrl=f.gridBodyCtrl});let _=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:_,displayedColumnsWidthChanged:_}),this.addManagedPropertyListener("domLayout",_)}checkContainerWidths(){let{gos:_,visibleCols:f,eventSvc:$}=this.beans,z=S_(_,"print"),Q=z?0:f.getColsLeftWidth(),J=z?0:f.getDisplayedColumnsRightWidth();if(Q!=this.leftWidth)this.leftWidth=Q,$.dispatchEvent({type:"leftPinnedWidthChanged"});if(J!=this.rightWidth)this.rightWidth=J,$.dispatchEvent({type:"rightPinnedWidthChanged"})}keepPinnedColumnsNarrowerThanViewport(){let _=this.gridBodyCtrl.eBodyViewport,f=df(_);if(f<=50)return;let $=this.getPinnedColumnsOverflowingViewport(f-50),z=this.gos.getCallback("processUnpinnedColumns"),{columns:Q,hasLockedPinned:J}=$,q=Q;if(!q.length&&!J)return;if(z)q=z({columns:q,viewportWidth:f});if(!q?.length)return;q=q.filter((X)=>!I_(X)),this.setColsPinned(q,null,"viewportSizeFeature")}createPinnedWidthFeature(_,...f){return new bB(_,f)}setColsPinned(_,f,$){let{colModel:z,colAnimation:Q,visibleCols:J,gos:q}=this.beans;if(!z.cols)return;if(!_?.length)return;if(S_(q,"print")){j(37);return}Q?.start();let X;if(f===!0||f==="left")X="left";else if(f==="right")X="right";else X=null;let Y=[];for(let Z of _){if(!Z)continue;let G=z.getCol(Z);if(!G)continue;if(G.getPinned()!==X)this.setColPinned(G,X),Y.push(G)}if(Y.length)J.refresh($),mX(this.eventSvc,Y,$);Q?.finish()}initCol(_){let{pinned:f,initialPinned:$}=_.colDef;if(f!==void 0)this.setColPinned(_,f);else this.setColPinned(_,$)}setColPinned(_,f){if(f===!0||f==="left")_.pinned="left";else if(f==="right")_.pinned="right";else _.pinned=null;_.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(_){let{scrollVisibleSvc:f}=this.beans;if(_.pinned==null)return;let $=_.pinned==="left",z=_.pinned==="right";_.hidden=!0;let Q=()=>{let J=$?this.leftWidth:this.rightWidth;if(J==null)return;let q=J==0,X=_.hidden!==q,Y=this.gos.get("enableRtl"),Z=f.getScrollbarWidth(),E=f.verticalScrollShowing&&(Y&&$||!Y&&z)?J+Z:J;if(_.comp.setPinnedContainerWidth(`${E}px`),_.comp.setDisplayed(!q),X)_.hidden=q,_.refresh()};_.addManagedEventListeners({leftPinnedWidthChanged:Q,rightPinnedWidthChanged:Q,scrollVisibilityChanged:Q,scrollbarWidthChanged:Q})}getHeaderResizeDiff(_,f){if(f.getPinned()){let{leftWidth:z,rightWidth:Q}=this,J=df(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-50;if(z+Q+_>J)if(J>z+Q)_=J-z-Q;else return 0}return _}getPinnedColumnsOverflowingViewport(_){let f=this.rightWidth??0,$=this.leftWidth??0,z=f+$,Q=!1;if(z<_)return{columns:[],hasLockedPinned:Q};let{visibleCols:J}=this.beans,q=[...J.leftCols],X=[...J.rightCols],Y=0,Z=0,G=0,E=[],U=z-G-_;while((Z0){if(Y0){let H=q[Z++];if(H.colDef.lockPinned){Q=!0;continue}U-=H.getActualWidth(),E.push(H)}}return{columns:E,hasLockedPinned:Q}}},wB={moduleName:"PinnedColumn",version:c,beans:[CB],css:[yB]},xB=class extends j_{constructor(){super();this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.lastAnnouncement="",this.updateAnnouncement=c0(this,this.updateAnnouncement.bind(this),200)}postConstruct(){let _=this.beans,f=q_(_),$=this.descriptionContainer=f.createElement("div");$.classList.add("ag-aria-description-container"),r9($,"polite"),W4($,"additions text"),H4($,!0),_.eRootDiv.appendChild($)}announceValue(_,f){this.pendingAnnouncements.set(f,_),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;let _=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.handleAnnouncementUpdate(_)},50)}handleAnnouncementUpdate(_){if(!this.isAlive()||!this.descriptionContainer)return;let f=_;if(f==null||f.replace(/[ .]/g,"")==""){this.lastAnnouncement="";return}if(this.lastAnnouncement===f)f=`${f}​`;this.lastAnnouncement=f,this.descriptionContainer.textContent=f}destroy(){super.destroy();let{descriptionContainer:_}=this;if(_)f_(_),_.remove();this.descriptionContainer=null,this.pendingAnnouncements.clear()}},NB=class extends xB{},gB={moduleName:"Aria",version:c,beans:[NB]},hB=":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}",A9="ag-delay-render",uB=class extends A{constructor(){super(...arguments);this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=new Set}hideColumns(_){if(this.alreadyRevealed||this.requesters.has(_))return;if(this.requesters.add(_),!this.hideRequested)this.beans.ctrlsSvc.whenReady(this,(f)=>{f.gridBodyCtrl.eGridBody.classList.add(A9)}),this.hideRequested=!0}revealColumns(_){if(this.alreadyRevealed||!this.isAlive())return;if(this.requesters.delete(_),this.requesters.size>0)return;let{renderStatus:f,ctrlsSvc:$}=this.beans;if(f){if(!f.areHeaderCellsRendered()&&this.timesRetried<5){this.timesRetried++,setTimeout(()=>this.revealColumns(_));return}this.timesRetried=0}$.getGridBodyCtrl().eGridBody.classList.remove(A9),this.alreadyRevealed=!0}},iB={moduleName:"ColumnDelayRender",version:c,beans:[uB],css:[hB]},YQ=class extends w{constructor(){super()}},mB={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},cB=class extends YQ{constructor(){super(...arguments);this.eExportingIcon=V,this.eExportingText=V}init(_){let{beans:f}=this;this.setTemplate(mB);let $=h("overlayExporting",f,null);if($)this.eExportingIcon.appendChild($);let z=_.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=z,f.ariaAnnounce.announceValue(z,"overlay")}},pB={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},nB=class extends YQ{constructor(){super(...arguments);this.eLoadingIcon=V,this.eLoadingText=V}init(_){let{beans:f,gos:$}=this,z=T0($.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(z??pB),!z){let Q=h("overlayLoading",f,null);if(Q)this.eLoadingIcon.appendChild(Q);let J=_.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=J,f.ariaAnnounce.announceValue(J,"overlay")}}},dB={tag:"span",cls:"ag-overlay-no-matching-rows-center"},tB=class extends YQ{init(_){let{beans:f}=this;this.setTemplate(dB);let $=_.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=$,f.ariaAnnounce.announceValue($,"overlay")}},rB={tag:"span",cls:"ag-overlay-no-rows-center"},lB=class extends YQ{init(_){let{beans:f,gos:$}=this,z=T0($.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(z??rB),!z){let Q=_.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=Q,f.ariaAnnounce.announceValue(Q,"overlay")}}};function sB(_){_.overlays?.showLoadingOverlay()}function aB(_){_.overlays?.showNoRowsOverlay()}function oB(_){_.overlays?.hideOverlay()}var eB=".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}",_3={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},L5=class extends w{constructor(){super(_3);this.eOverlayWrapper=V,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(eB)}handleKeyDown(_){if(_.key!==S.TAB||_.defaultPrevented||z0(_))return;let{beans:f,eOverlayWrapper:$}=this;if($&&V_(f,$,!1,_.shiftKey))return;let Q=!1;if(_.shiftKey)Q=f.focusSvc.focusGridView({column:b(f.visibleCols.allCols),backwards:!0,canFocusOverlay:!1});else Q=q0(f,!1);if(Q)_.preventDefault()}updateLayoutClasses(_,f){let $=this.eOverlayWrapper;if(!$)return;let z=$.classList,{AUTO_HEIGHT:Q,NORMAL:J,PRINT:q}=B0;z.toggle(Q,f.autoHeight),z.toggle(J,f.normal),z.toggle(q,f.print)}postConstruct(){this.createManagedBean(new PJ(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(_){let f=this.eOverlayWrapper?.classList;if(!f){this.activeCssClass=null;return}if(this.activeCssClass)f.toggle(this.activeCssClass,!1);this.activeCssClass=_,f.toggle(_,!0)}showOverlay(_,f,$){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=_,this.overlayExclusive=$,!_)return this.refreshWrapperPadding(),g.resolve();if(this.setWrapperTypeClass(f),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),$&&this.isGridFocused()){let z=d(this.beans);if(z&&!sf(this.beans))this.elToFocusAfter=z}return _.then((z)=>{let Q=this.eOverlayWrapper;if(!Q){this.destroyBean(z);return}if(this.activePromise!==_){if(this.activeOverlay!==z)this.destroyBean(z),z=null;return}if(this.activePromise=null,!z)return;if(this.activeOverlay!==z)Q.appendChild(z.getGui()),this.activeOverlay=z;if($&&this.isGridFocused())F_(Q)}),_}refreshWrapperPadding(){if(!this.eOverlayWrapper){this.oldWrapperPadding=null;return}let _=!!this.activeOverlay||!!this.activePromise,f=0;if(_&&!this.overlayExclusive)f=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0;if(f!==this.oldWrapperPadding)this.oldWrapperPadding=f,this.eOverlayWrapper.style.setProperty("padding-top",`${f}px`)}destroyActiveOverlay(){this.activePromise=null;let _=this.activeOverlay;if(!_){this.overlayExclusive=!1,this.elToFocusAfter=null,this.refreshWrapperPadding();return}let f=this.elToFocusAfter;if(this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,f&&!this.isGridFocused())f=null;this.destroyBean(_);let $=this.eOverlayWrapper;if($)f_($);f?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){let _=d(this.beans);return!!_&&this.beans.eGridDiv.contains(_)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},f3={selector:"AG-OVERLAY-WRAPPER",component:L5},$3=["refresh"],y$=(_)=>({name:_,optionalMethods:$3}),Nf={id:"agLoadingOverlay",overlayType:"loading",comp:y$("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:(_)=>{let f=_.get("loading");return f===!1||_.get("suppressLoadingOverlay")===!0&&f!==!0}},F1={id:"agNoRowsOverlay",overlayType:"noRows",comp:y$("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:(_)=>_.get("suppressNoRowsOverlay")},pJ={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:y$("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},Iz={id:"agExportingOverlay",overlayType:"exporting",comp:y$("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},Wz={id:"activeOverlay",comp:y$("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},z3=(_)=>{if(!_)return null;return{agLoadingOverlay:Nf,agNoRowsOverlay:F1,agNoMatchingRowsOverlay:pJ,agExportingOverlay:Iz}[_]??Wz},Q3=(_)=>{if(!_)return null;return{loading:Nf,noRows:F1,noMatchingRows:pJ,exporting:Iz}[_]},J3=class extends A{constructor(){super(...arguments);this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.newColumnsLoadedCleanup=null}postConstruct(){let _=this.gos;this.showInitialOverlay=o(_);let f=()=>{if(this.userForcedNoRows)return;this.updateOverlay(!1)},[$,z,Q,J]=this.addManagedEventListeners({newColumnsLoaded:f,rowCountReady:()=>{this.disableInitialOverlay(),f(),z()},rowDataUpdated:f,modelUpdated:f});this.newColumnsLoadedCleanup=$,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],(q)=>this.onPropChange(new Set(q.changeSet?.properties)))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(_,f){if(!this.isAlive())return;if(!f)this.eWrapper=_;else if(this.eWrapper===_)this.eWrapper=void 0;this.updateOverlay(!1)}isVisible(){return!!this.currentDef}showLoadingOverlay(){this.showInitialOverlay=!1;let _=this.gos;if(!this.eWrapper||_.get("activeOverlay"))return;if(this.isDisabled(Nf))return;let f=_.get("loading");if(!f&&f!==void 0)return;this.doShowOverlay(Nf)}showNoRowsOverlay(){this.showInitialOverlay=!1;let _=this.gos;if(!this.eWrapper||_.get("activeOverlay")||_.get("loading")||this.isDisabled(F1))return;this.userForcedNoRows=!0,this.doShowOverlay(F1)}async showExportOverlay(_){let{gos:f,beans:$}=this;if(!this.eWrapper||f.get("activeOverlay")||f.get("loading")||this.isDisabled(Iz)||this.userForcedNoRows&&this.currentDef===F1){_();return}let z=this.getDesiredDefWithOverride(Iz);if(!z){_();return}this.exportsInProgress++,this.focusedCell=$.focusSvc.getFocusedCell(),await this.doShowOverlay(z),await new Promise((J)=>setTimeout(()=>J()));let Q=Date.now();try{_()}finally{let J=Date.now()-Q,q=Math.max(0,300-J),X=()=>{if(this.exportsInProgress--,this.exportsInProgress===0)this.updateOverlay(!1),C8($,this.focusedCell),this.focusedCell=null};if(q>0)setTimeout(()=>X(),q);else X()}}hideOverlay(){let _=this.gos;this.showInitialOverlay=!1;let f=this.userForcedNoRows;if(this.userForcedNoRows=!1,_.get("loading")){j(99);return}if(_.get("activeOverlay")){j(296);return}if(this.currentDef===pJ){j(297);return}if(this.doHideOverlay(),f){if(this.getOverlayDef()!==F1)this.updateOverlay(!1)}}getOverlayWrapperSelector(){return f3}getOverlayWrapperCompClass(){return L5}onPropChange(_){let f=_.has("activeOverlay");if(f||_.has("loading")){if(this.updateOverlay(f))return}let $=this.currentDef,z=this.eWrapper?.activeOverlay;if(z&&$){let Q=_.has("activeOverlayParams");if($===Wz){if(Q)z.refresh?.(this.makeCompParams(!0))}else{let J=$.paramsKey;if(_.has("overlayComponentParams")||J&&_.has(J))z.refresh?.(this.makeCompParams(!1,J,$.overlayType))}}}updateOverlay(_){let f=this.eWrapper;if(!f)return this.currentDef=null,!1;let $=this.getDesiredDefWithOverride(),z=this.currentDef,Q=$===Wz&&_;if($!==z){if(!$)return this.disableInitialOverlay(),this.doHideOverlay();return this.doShowOverlay($),!0}if(Q&&$)return f.hideOverlay(),this.doShowOverlay($),!0;if(!$)this.disableInitialOverlay();return!1}getDesiredDefWithOverride(_){let{gos:f}=this,$=z3(f.get("activeOverlay"));if(!$){if($=_??this.getOverlayDef(),$&&this.isDisabled($))$=null}return $}getOverlayDef(){let{gos:_,beans:f}=this,{rowModel:$}=f,z=_.get("loading");if(z!==void 0){if(this.disableInitialOverlay(),z)return Nf}else if(this.showInitialOverlay){if(!this.isDisabled(Nf)&&(!_.get("columnDefs")||!_.get("rowData")))return Nf;this.disableInitialOverlay()}else this.disableInitialOverlay();let J=$.getOverlayType();return Q3(J)}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(_){let{gos:f,beans:$}=this,{userCompFactory:z}=$;this.currentDef=_;let Q=_!==Wz,J=!!_.exclusive;this.exclusive=J;let q;if(_.paramsKey&&f.get(_.paramsKey)||_.compKey&&f.get(_.compKey))q=_.paramsKey;let X=void 0;if(Q){if(f.get("overlayComponent")||f.get("overlayComponentSelector"))X=z.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,_.paramsKey,_.overlayType))}X??(X=z.getCompDetailsFromGridOptions(_.comp,Q?_.id:void 0,this.makeCompParams(!Q,q,_.overlayType),!1));let Y=X?.newAgStackInstance()??null,Z=this.eWrapper?this.eWrapper.showOverlay(Y,_.wrapperCls,J):g.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(J),Z}makeCompParams(_,f,$){let{gos:z}=this,Q=_?z.get("activeOverlayParams"):{...z.get("overlayComponentParams"),...f&&z.get(f)||null,overlayType:$};return C(z,Q??{})}doHideOverlay(){let _=!1;if(this.currentDef)this.currentDef=null,_=!0;this.exclusive=!1;let f=this.eWrapper;if(f)f.hideOverlay(),f.refreshWrapperPadding(),this.setExclusive(!1);return _}setExclusive(_){if(this.oldExclusive!==_)this.oldExclusive=_,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"})}isDisabled(_){let{gos:f}=this;return _.overlayType&&f.get("suppressOverlays")?.includes(_.overlayType)||_.isSuppressed?.(f)===!0}},q3={moduleName:"Overlay",version:c,userComponents:{agLoadingOverlay:nB,agNoRowsOverlay:lB,agNoMatchingRowsOverlay:tB,agExportingOverlay:cB},apiFunctions:{showLoadingOverlay:sB,showNoRowsOverlay:aB,hideOverlay:oB},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[J3]},X3=class extends A{constructor(){super(...arguments);this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=U8(),q$(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;let _=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,f=this.getUiBodyHeight();if(_!==this.scrollY||f!==this.uiBodyHeight)this.scrollY=_,this.uiBodyHeight=f,this.calculateOffset()}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;let _=this.scrollY/this.maxScrollY,f=_*this.pixelsToShave;q$(this.gos,`RowContainerHeightService - Div Stretch Offset = ${f} (${this.pixelsToShave} * ${_})`),this.setDivStretchOffset(f)}setUiContainerHeight(_){if(_!==this.uiContainerHeight)this.uiContainerHeight=_,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"})}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(_){let f=typeof _==="number"?Math.floor(_):null;if(this.divStretchOffset===f)return;this.divStretchOffset=f,this.eventSvc.dispatchEvent({type:"heightScaleChanged"})}setModelHeight(_){if(this.modelHeight=_,this.stretching=_!=null&&this.maxDivHeight>0&&_>this.maxDivHeight,this.stretching)this.calculateOffset();else this.clearOffset()}getRealPixelPosition(_){return _-this.divStretchOffset}getUiBodyHeight(){let _=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return _.bottom-_.top}getScrollPositionForPixel(_){if(this.pixelsToShave<=0)return _;let f=this.modelHeight-this.getUiBodyHeight(),$=_/f;return this.maxScrollY*$}},Y3=400,Z3=class extends A{constructor(){super(...arguments);this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{let _=()=>{for(let J of this.getAllCellCtrls())J.onCellSelectionChanged()},f=()=>{for(let J of this.getAllCellCtrls())J.updateRangeBordersIfRangeCount()},$=()=>{this.eventSvc.addListener("cellSelectionChanged",_),this.eventSvc.addListener("columnMoved",f),this.eventSvc.addListener("columnPinned",f),this.eventSvc.addListener("columnVisible",f)},z=()=>{this.eventSvc.removeListener("cellSelectionChanged",_),this.eventSvc.removeListener("columnMoved",f),this.eventSvc.removeListener("columnPinned",f),this.eventSvc.removeListener("columnVisible",f)};if(this.addDestroyFunc(()=>z()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(i_(this.gos))$();else z()}),i_(this.gos))$()}}wireBeans(_){this.pageBounds=_.pageBounds,this.colModel=_.colModel,this.pinnedRowModel=_.pinnedRowModel,this.rowModel=_.rowModel,this.focusSvc=_.focusSvc,this.rowContainerHeight=_.rowContainerHeight,this.ctrlsSvc=_.ctrlsSvc,this.editSvc=_.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCtrl=_.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",(z)=>this.onSuppressCellFocusChanged(z.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:z,previousValue:Q})=>{if(!Q&&z||Q&&!z)this.redrawRows()});let{stickyRowSvc:_,gos:f,showRowGroupCols:$}=this.beans;if($)this.addManagedPropertyListener("showOpenedGroup",()=>{let z=$.columns;if(z.length)this.refreshCells({columns:z,force:!0})});if(_)this.stickyRowFeature=_.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{let z=this.gridBodyCtrl;z.setStickyTopHeight(0),z.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=S_(f,"print"),this.embedFullWidthRows=this.printLayout||f.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){let _=this.getKeepDetailRowsCount(),f=_!=null?_:3;this.cachedRowCtrls=new G3(f)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){let _=Object.values(this.rowCtrlsByRowIndex),f=Object.values(this.zombieRowCtrls),$=this.cachedRowCtrls?.getEntries()??[];if(f.length>0||$.length>0)this.allRowCtrls=[..._,...f,...$];else this.allRowCtrls=_}isCellBeingRendered(_,f){let $=this.rowCtrlsByRowIndex[_];if(!f||!$)return!!$;if($.isFullWidth())return!0;return!!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:_,column:f,rowPinned:null})||!!$.getCellCtrl(f)||!$.isRowRendered()}updateCellFocus(_){for(let f of this.getAllCellCtrls())f.onCellFocused(_);for(let f of this.getFullWidthRowCtrls())f.onFullWidthRowFocused(_)}onCellFocusChanged(_){if(_?.rowIndex!=null&&!_.rowPinned){let f=this.beans.colModel.getCol(_.column)??void 0;if(!this.isCellBeingRendered(_.rowIndex,f))this.redraw()}this.updateCellFocus(_)}onSuppressCellFocusChanged(_){for(let f of this.getAllCellCtrls())f.onSuppressCellFocusChanged(_);for(let f of this.getFullWidthRowCtrls())f.onSuppressCellFocusChanged(_)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:(_)=>this.onCellFocusChanged(_),cellFocusCleared:()=>this.updateCellFocus(),flashCells:(_)=>{let{cellFlashSvc:f}=this.beans;if(f)for(let $ of this.getAllCellCtrls())f.onFlashCells($,_)},columnHoverChanged:()=>{for(let _ of this.getAllCellCtrls())_.onColumnHover()},displayedColumnsChanged:()=>{for(let _ of this.getAllCellCtrls())_.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(let _ of this.getAllCellCtrls())_.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(let _ of this.destroyFuncsForColumnListeners)_();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();let _=this.colModel.getCols();for(let f of _){let $=(Y)=>{for(let Z of this.getAllCellCtrls())if(Z.column===f)Y(Z)},z=()=>{$((Y)=>Y.onLeftChanged())},Q=()=>{$((Y)=>Y.onWidthChanged())},J=()=>{$((Y)=>Y.onFirstRightPinnedChanged())},q=()=>{$((Y)=>Y.onLastLeftPinnedChanged())},X=()=>{$((Y)=>Y.onColDefChanged())};f.__addEventListener("leftChanged",z),f.__addEventListener("widthChanged",Q),f.__addEventListener("firstRightPinnedChanged",J),f.__addEventListener("lastLeftPinnedChanged",q),f.__addEventListener("colDefChanged",X),this.destroyFuncsForColumnListeners.push(()=>{f.__removeEventListener("leftChanged",z),f.__removeEventListener("widthChanged",Q),f.__removeEventListener("firstRightPinnedChanged",J),f.__removeEventListener("lastLeftPinnedChanged",q),f.__removeEventListener("colDefChanged",X)})}}onDomLayoutChanged(){let _=S_(this.gos,"print"),f=_||this.gos.get("embedFullWidthRows"),$=f!==this.embedFullWidthRows||this.printLayout!==_;if(this.printLayout=_,this.embedFullWidthRows=f,$)this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;let _=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(_)}onPageLoaded(_){let f={recycleRows:_.keepRenderedRows,animate:_.animate,newData:_.newData,newPage:_.newPage,onlyBody:!0};this.redrawAfterModelUpdate(f)}getAllCellsNotSpanningForColumn(_){let f=[];for(let $ of this.getAllRowCtrls()){let z=$.getCellCtrl(_,!0)?.eGui;if(z)f.push(z)}return f}refreshFloatingRowComps(_=!0){this.refreshFloatingRows(this.topRowCtrls,"top",_),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",_)}refreshFloatingRows(_,f,$){let{pinnedRowModel:z,beans:Q,printLayout:J}=this,q=Object.fromEntries(_.map((Y)=>[Y.rowNode.id,Y]));z?.forEachPinnedRow(f,(Y,Z)=>{let G=_[Z];if(G&&z.getPinnedRowById(G.rowNode.id,f)===void 0)G.destroyFirstPass(),G.destroySecondPass();if(Y.id in q&&$)_[Z]=q[Y.id],delete q[Y.id];else _[Z]=new h6(Y,Q,!1,!1,J)});let X=(f==="top"?z?.getPinnedTopRowCount():z?.getPinnedBottomRowCount())??0;_.length=X}onPinnedRowDataChanged(){let _={recycleRows:!0};this.redrawAfterModelUpdate(_)}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(_,f=!1){if(_.sticky)this.stickyRowFeature?.refreshStickyNode(_);else if(this.cachedRowCtrls?.has(_)){this.cachedRowCtrls.removeRow(_);return}else{let $=(z)=>{let Q=z[_.rowIndex];if(!Q)return;if(Q.rowNode!==_)return;Q.destroyFirstPass(),Q.destroySecondPass(),z[_.rowIndex]=this.createRowCon(_,!1,!1)};switch(_.rowPinned){case"top":$(this.topRowCtrls);break;case"bottom":$(this.bottomRowCtrls);break;default:$(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}if(!f)this.dispatchDisplayedRowsChanged(!1)}redrawRows(_){let{editSvc:f}=this.beans;if(f?.isEditing())if(f.isBatchEditing())f.cleanupEditors();else f.stopEditing(void 0,{source:"api"});if(_!=null){for(let z of _??[])this.redrawRow(z,!0);this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}redrawAfterModelUpdate(_={}){this.getLockOnRefresh();let f=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(_);let $=!_.domLayoutChanged&&!!_.recycleRows,z=_.animate&&S1(this.gos),Q=$?this.getRowsToRecycle():null;if(!$)this.removeAllRowComps();this.workOutFirstAndLastRowsToRender();let{stickyRowFeature:J,gos:q}=this;if(J){J.checkStickyRows();let X=J.extraTopHeight+J.extraBottomHeight;if(X)this.updateContainerHeights(X)}if(this.recycleRows(Q,z),this.gridBodyCtrl.updateRowCount(),!_.onlyBody)this.refreshFloatingRowComps(q.get("enableRowPinning")?$:void 0);if(this.dispatchDisplayedRowsChanged(),f!=null)this.restoreFocusedCell(f);this.releaseLockOnRefresh()}scrollToTopIfNewData(_){let f=_.newData||_.newPage,$=this.gos.get("suppressScrollOnNewData");if(f&&!$)this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets()}updateContainerHeights(_=0){let{rowContainerHeight:f}=this;if(this.printLayout){f.setModelHeight(null);return}let $=this.pageBounds.getCurrentPageHeight();if($===0)$=1;f.setModelHeight($+_)}getLockOnRefresh(){if(this.refreshInProgress)throw Error($0(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(_){if(!_)return;let f=this.beans.focusSvc,$=this.findPositionToFocus(_);if(!$){f.focusHeaderPosition({headerPosition:{headerRowIndex:o_(this.beans)-1,column:_.column}});return}if(_.rowIndex!==$.rowIndex||_.rowPinned!=$.rowPinned){f.setFocusedCell({...$,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0});return}if(!f.doesRowOrCellHaveBrowserFocus())this.updateCellFocus(C(this.gos,{...$,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}findPositionToFocus(_){let{pagination:f,pageBounds:$}=this.beans,z=_;if(z.rowPinned==null&&f&&$&&!f.isRowInPage(z.rowIndex))z={rowPinned:null,rowIndex:$.getFirstRow()};while(z){if(z.rowPinned==null&&$){if(z.rowIndex<$.getFirstRow()){if(z=m_(this.beans,{rowPinned:null,rowIndex:0}),!z)return null}else if(z.rowIndex>$.getLastRow())z={rowPinned:null,rowIndex:$.getLastRow()}}let Q=this.getRowByPosition(z);if(Q?.isAlive())return{...Q.getRowPosition(),column:_.column};z=m_(this.beans,z)}return null}getAllCellCtrls(){let _=[],f=this.getAllRowCtrls(),$=f.length;for(let z=0;z<$;z++){let Q=f[z].getAllCellCtrls(),J=Q.length;for(let q=0;q{let Q=z.rowNode;return j9(Q,f)})}getCellCtrls(_,f){let $;if(v(f))$={},f.forEach((Q)=>{let J=this.colModel.getCol(Q);if(v(J))$[J.getId()]=!0});let z=[];for(let Q of this.getRowCtrls(_))for(let J of Q.getAllCellCtrls()){let q=J.column.getId();if($&&!$[q])continue;z.push(J)}return z}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(_=!1){let f=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(f,_),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){let _=[];for(let $ of Object.keys(this.rowCtrlsByRowIndex))if(this.rowCtrlsByRowIndex[$].rowNode.id==null)_.push($);this.removeRowCtrls(_);let f={};for(let $ of Object.values(this.rowCtrlsByRowIndex)){let z=$.rowNode;f[z.id]=$}return this.rowCtrlsByRowIndex={},f}removeRowCtrls(_,f=!1){for(let $ of _){let z=this.rowCtrlsByRowIndex[$];if(z)z.destroyFirstPass(f),z.destroySecondPass();delete this.rowCtrlsByRowIndex[$]}}onBodyScroll(_){if(_.direction!=="vertical")return;this.redraw({afterScroll:!0})}redraw(_={}){let{focusSvc:f,animationFrameSvc:$}=this.beans,{afterScroll:z}=_,Q,J=this.stickyRowFeature;if(J)Q=f?.getFocusCellToUseAfterRefresh()||void 0;let q=this.firstRenderedRow,X=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let Y=!1;if(J){Y=J.checkStickyRows();let G=J.extraTopHeight+J.extraBottomHeight;if(G)this.updateContainerHeights(G)}let Z=this.firstRenderedRow!==q||this.lastRenderedRow!==X;if(z&&!Y&&!Z)return;if(this.getLockOnRefresh(),this.recycleRows(null,!1,z),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(z&&!Y),Q!=null){let G=f?.getFocusCellToUseAfterRefresh();if(Q!=null&&G==null)$?.flushAllFrames(),this.restoreFocusedCell(Q)}}removeRowCompsNotToDraw(_,f){let $={};for(let J of _)$[J]=!0;let Q=Object.keys(this.rowCtrlsByRowIndex).filter((J)=>!$[J]);this.removeRowCtrls(Q,f)}calculateIndexesToDraw(_){let f=[];for(let q=this.firstRenderedRow;q<=this.lastRenderedRow;q++)f.push(q);let $=this.beans.pagination,z=this.beans.focusSvc?.getFocusedCell()?.rowIndex;if(z!=null&&(zthis.lastRenderedRow)&&(!$||$.isRowInPage(z))&&z{let X=q.rowNode.rowIndex;if(X==null||X===z)return;if(Xthis.lastRenderedRow){if(this.doNotUnVirtualiseRow(q))f.push(X)}};for(let q of Object.values(this.rowCtrlsByRowIndex))Q(q);if(_)for(let q of Object.values(_))Q(q);f.sort((q,X)=>q-X);let J=[];for(let q=0;q{this.destroyRowCtrls(_,f),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()});else this.destroyRowCtrls(_,f)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(_=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:_})}onDisplayedColumnsChanged(){let{visibleCols:_}=this.beans,f=_.isPinningLeft(),$=_.isPinningRight();if(this.pinningLeft!==f||$!==this.pinningRight){if(this.pinningLeft=f,this.pinningRight=$,this.embedFullWidthRows)this.redrawFullWidthEmbeddedRows()}}redrawFullWidthEmbeddedRows(){let _=[];for(let f of this.getFullWidthRowCtrls()){let $=f.rowNode.rowIndex;_.push($.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(_),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(_){let f=R9(_);return this.getAllRowCtrls().filter(($)=>{if(!$.isFullWidth())return!1;let z=$.rowNode;if(f!=null&&!j9(z,f))return!1;return!0})}createOrUpdateRowCtrl(_,f,$,z){let Q,J=this.rowCtrlsByRowIndex[_];if(!J){if(Q=this.rowModel.getRow(_),v(Q)&&v(f)&&f[Q.id]&&Q.alreadyRendered)J=f[Q.id],f[Q.id]=null}if(!J){if(!Q)Q=this.rowModel.getRow(_);if(v(Q))J=this.createRowCon(Q,$,z);else return}if(Q)Q.alreadyRendered=!0;this.rowCtrlsByRowIndex[_]=J}destroyRowCtrls(_,f){let $=[];if(_)for(let z of Object.values(_)){if(!z)continue;if(this.cachedRowCtrls&&z.isCacheable()){this.cachedRowCtrls.addRow(z);continue}if(z.destroyFirstPass(!f),f){let Q=z.instanceId;this.zombieRowCtrls[Q]=z,$.push(()=>{z.destroySecondPass(),delete this.zombieRowCtrls[Q]})}else z.destroySecondPass()}if(f)$.push(()=>{if(this.isAlive())this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),window.setTimeout(()=>{for(let z of $)z()},Y3)}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){let _=this.getRowBuffer(),f=vq(this.beans);return _*f}workOutFirstAndLastRowsToRender(){let{rowContainerHeight:_,pageBounds:f,rowModel:$}=this;_.updateOffset();let z,Q;if(!$.isRowsToRender())z=0,Q=-1;else if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),z=f.getFirstRow(),Q=f.getLastRow();else{let G=this.getRowBufferInPixels(),E=this.ctrlsSvc.getScrollFeature(),U=this.gos.get("suppressRowVirtualisation"),H=!1,W,B;do{let M=f.getPixelOffset(),{pageFirstPixel:k,pageLastPixel:R}=f.getCurrentPagePixelRange(),O=_.divStretchOffset,I=E.getVScrollPosition(),T=I.top,y=I.bottom;if(U)W=k+O,B=R+O;else W=Math.max(T+M-G,k)+O,B=Math.min(y+M+G,R)+O;this.firstVisibleVPixel=Math.max(T+M,k)+O,this.lastVisibleVPixel=Math.min(y+M,R)+O,H=this.ensureAllRowsInRangeHaveHeightsCalculated(W,B)}while(H);let K=$.getRowIndexAtPixel(W),L=$.getRowIndexAtPixel(B),F=f.getFirstRow(),D=f.getLastRow();if(KD)L=D;z=K,Q=L}let J=S_(this.gos,"normal"),q=this.gos.get("suppressMaxRenderedRowRestriction"),X=Math.max(this.getRowBuffer(),500);if(J&&!q){if(Q-z>X)Q=z+X}let Y=z!==this.firstRenderedRow,Z=Q!==this.lastRenderedRow;if(Y||Z)this.firstRenderedRow=z,this.lastRenderedRow=Q,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:z,lastRow:Q})}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0,Y0(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})})}ensureAllRowsInRangeHaveHeightsCalculated(_,f){let $=this.pinnedRowModel?.ensureRowHeightsValid(),z=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:Q,rowModel:J}=this,q=J.ensureRowHeightsValid(_,f,Q.getFirstRow(),Q.getLastRow());if(q||z)this.eventSvc.dispatchEvent({type:"recalculateRowBounds"});if(z||q||$)return this.updateContainerHeights(),!0;return!1}doNotUnVirtualiseRow(_){let z=_.rowNode,Q=this.focusSvc.isRowFocused(z.rowIndex,z.rowPinned),J=this.editSvc?.isEditing(_),q=z.detail;if(!(Q||J||q))return!1;return this.isRowPresent(z)?!0:!1}isRowPresent(_){if(!this.rowModel.isRowPresent(_))return!1;return this.beans.pagination?.isRowInPage(_.rowIndex)??!0}createRowCon(_,f,$){let z=this.cachedRowCtrls?.getRow(_)??null;if(z)return z;let Q=$&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new h6(_,this.beans,f,Q,this.printLayout)}getRenderedNodes(){let _=Object.values(this.rowCtrlsByRowIndex).map((z)=>z.rowNode),f=this.getStickyTopRowCtrls().map((z)=>z.rowNode),$=this.getStickyBottomRowCtrls().map((z)=>z.rowNode);return[...f,..._,...$]}getRowByPosition(_){let f,{rowIndex:$}=_;switch(_.rowPinned){case"top":f=this.topRowCtrls[$];break;case"bottom":f=this.bottomRowCtrls[$];break;default:if(f=this.rowCtrlsByRowIndex[$],!f){if(f=this.getStickyTopRowCtrls().find((z)=>z.rowNode.rowIndex===$)||null,!f)f=this.getStickyBottomRowCtrls().find((z)=>z.rowNode.rowIndex===$)||null}break}return f}isRangeInRenderedViewport(_,f){if(_==null||f==null)return!1;let z=_>this.lastRenderedRow;return!(fthis.maxCount){let f=this.entriesList[0];f.destroyFirstPass(),f.destroySecondPass(),this.removeFromCache(f)}}getRow(_){if(_?.id==null)return null;let f=this.entriesMap[_.id];if(!f)return null;return this.removeFromCache(f),f.setCached(!1),f.rowNode!=_?null:f}has(_){return this.entriesMap[_.id]!=null}removeRow(_){let f=_.id,$=this.entriesMap[f];delete this.entriesMap[f],Q_(this.entriesList,$)}removeFromCache(_){let f=_.rowNode.id;delete this.entriesMap[f],Q_(this.entriesList,_)}getEntries(){return this.entriesList}};function R9(_){if(!_)return;let f={top:{},bottom:{},normal:{}};for(let $ of _){let z=$.id;switch($.rowPinned){case"top":f.top[z]=$;break;case"bottom":f.bottom[z]=$;break;default:f.normal[z]=$;break}}return f}function j9(_,f){let $=_.id;switch(_.rowPinned){case"top":return f.top[$]!=null;case"bottom":return f.bottom[$]!=null;default:return f.normal[$]!=null}}var E3=class extends A{constructor(){super(...arguments);this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=o(this.gos)?_1:U3,this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],this.updateOptions.bind(this));let _=this.updatePivotModeState.bind(this);this.addManagedEventListeners({columnPivotModeChanged:_,columnPivotChanged:_}),this.updateOptions(),_()}updateOptions(){this.accentedSort=!!this.gos.get("accentedSort"),this.primaryColumnsSortGroups=K0(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(_,f){return _.sort(($,z)=>this.compareRowNodes(f,$,z))}compareRowNodes(_,f,$){if(f===$)return 0;let z=this.accentedSort;for(let Q=0,J=_.length;Q{if(_.data)return _;let f=_.childrenAfterGroup;while(f?.length){let $=f[0];if($.data)return $;f=$.childrenAfterGroup}},V9=(_)=>{if(!_)return _;if(typeof _==="bigint")return _<0n?-_:_;let f=Number(_);return isNaN(f)?_:Math.abs(f)};function H3(_){_.sortSvc?.onSortChanged("api")}var Cf=(_,f)=>({tag:"span",ref:`eSort${_}`,cls:`ag-sort-indicator-icon ag-sort-${f} ag-hidden`,attrs:{"aria-hidden":"true"}}),W3={tag:"span",cls:"ag-sort-indicator-container",children:[Cf("Order","order"),Cf("Asc","ascending-icon"),Cf("Desc","descending-icon"),Cf("Mixed","mixed-icon"),Cf("AbsoluteAsc","absolute-ascending-icon"),Cf("AbsoluteDesc","absolute-descending-icon"),Cf("None","none-icon")]},nJ=class extends w{constructor(_){super();if(this.eSortOrder=V,this.eSortAsc=V,this.eSortDesc=V,this.eSortMixed=V,this.eSortNone=V,this.eSortAbsoluteAsc=V,this.eSortAbsoluteDesc=V,!_)this.setTemplate(W3)}attachCustomElements(_,f,$,z,Q,J,q){this.eSortOrder=_,this.eSortAsc=f,this.eSortDesc=$,this.eSortMixed=z,this.eSortNone=Q,this.eSortAbsoluteAsc=J,this.eSortAbsoluteDesc=q}setupSort(_,f=!1,$){if(this.column=_,this.suppressOrder=f,this.getSortDefOverride=$,this.setupMultiSortIndicator(),!_.isSortable()&&!_.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,_),this.addInIcon("sortDescending",this.eSortDesc,_),this.addInIcon("sortUnSort",this.eSortNone,_),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,_),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,_);let z=this.updateIcons.bind(this),Q=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",z),this.addManagedEventListeners({newColumnsLoaded:z,sortChanged:Q,columnRowGroupChanged:Q}),this.onSortChanged()}addInIcon(_,f,$){if(f==null)return;let z=h(_,this.beans,$);if(z)f.appendChild(z)}onSortChanged(){if(this.updateIcons(),!this.suppressOrder)this.updateSortOrder()}updateIcons(){let{eSortAsc:_,eSortDesc:f,eSortAbsoluteAsc:$,eSortAbsoluteDesc:z,eSortNone:Q,column:J,gos:q,beans:X}=this,Y=ZJ(J,X,this.getSortDefOverride),Z=Y.isDefaultSortAllowed,G=Y.isAbsoluteSortAllowed,{isAbsoluteSort:E,isDefaultSort:U,isAscending:H,isDescending:W,direction:B}=Y;if(_)N(_,H&&U&&Z,{skipAriaHidden:!0});if(f)N(f,W&&U&&Z,{skipAriaHidden:!0});if(Q){let K=!J.getColDef().unSortIcon&&!q.get("unSortIcon");N(Q,!K&&!B,{skipAriaHidden:!0})}if($)N($,H&&E&&G,{skipAriaHidden:!0});if(z)N(z,W&&E&&G,{skipAriaHidden:!0})}setupMultiSortIndicator(){let{eSortMixed:_,column:f,gos:$}=this;this.addInIcon("sortUnSort",_,f);let z=f.getColDef().showRowGroup;if(K0($)&&z)this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator()}updateMultiSortIndicator(){let{eSortMixed:_,beans:f,column:$}=this;if(_){let z=f.sortSvc.getDisplaySortForColumn($)?.direction==="mixed";N(_,z,{skipAriaHidden:!0})}}updateSortOrder(){let{eSortOrder:_,column:f,beans:{sortSvc:$}}=this;if(!_)return;let z=$.getColumnsWithSortingOrdered(),Q=$.getDisplaySortIndexForColumn(f)??-1,J=z.some((X)=>$.getDisplaySortIndexForColumn(X)??!1),q=Q>=0&&J;if(N(_,q,{skipAriaHidden:!0}),Q>=0)_.textContent=(Q+1).toString();else f_(_)}refresh(){this.onSortChanged()}},B3={selector:"AG-SORT-INDICATOR",component:nJ},K3=class extends A{constructor(){super(...arguments);this.beanName="sortSvc"}progressSort(_,f,$){let z=this.getNextSortDirection(_);this.setSortForColumn(_,z,f,$)}progressSortFromEvent(_,f){let z=this.gos.get("multiSortKey")==="ctrl"?f.ctrlKey||f.metaKey:f.shiftKey;this.progressSort(_,z,"uiColumnSorted")}setSortForColumn(_,f,$,z){let{gos:Q,showRowGroupCols:J}=this.beans,q=K0(Q),X=[_];if(q){if(_.getColDef().showRowGroup){let E=J?.getSourceColumnsForGroupColumn?.(_)?.filter((U)=>U.isSortable());if(E)X=[_,...E]}}for(let G of X)this.setColSort(G,f,z);let Y=($||Q.get("alwaysMultiSort"))&&!Q.get("suppressMultiSort"),Z=[];if(!Y){let G=this.clearSortBarTheseColumns(X,z);Z.push(...G)}this.updateSortIndex(_),Z.push(...X),this.dispatchSortChangedEvents(z,Z)}updateSortIndex(_){let{gos:f,colModel:$,showRowGroupCols:z}=this.beans,Q=K0(f),J=z?.getShowRowGroupCol(_.getId()),q=Q?J||_:_,X=this.getColumnsWithSortingOrdered();$.forAllCols((G)=>this.setColSortIndex(G,null));let Y=X.filter((G)=>{if(Q&&G.getColDef().showRowGroup)return!1;return G!==q});(q.getSortDef()?[...Y,q]:Y).forEach((G,E)=>this.setColSortIndex(G,E))}onSortChanged(_,f){this.dispatchSortChangedEvents(_,f)}isSortActive(){let _=!1;return this.beans.colModel.forAllCols((f)=>{if(f.getSortDef())return _=!0,!0}),_}dispatchSortChangedEvents(_,f){let $={type:"sortChanged",source:_};if(f)$.columns=f;this.eventSvc.dispatchEvent($)}clearSortBarTheseColumns(_,f){let $=[];return this.beans.colModel.forAllCols((z)=>{if(!_.includes(z)){if(z.getSortDef())$.push(z);this.setColSort(z,void 0,f)}}),$}getNextSortDirection(_,f){let $=_.getSortingOrder(),z=f===void 0?_.getSortDef():e_(f),J=$.findIndex((q)=>Gz(q,z))+1;if(J>=$.length)J=0;return e_($[J])}getIndexedSortMap(){let{gos:_,colModel:f,showRowGroupCols:$,rowGroupColsSvc:z}=this.beans,Q=[];if(f.forAllCols((Z)=>{if(Z.getSortDef())Q.push(Z)}),f.isPivotMode()){let Z=K0(_);Q=Q.filter((G)=>{let E=!!G.getAggFunc(),U=!G.isPrimary(),H=Z?$?.getShowRowGroupCol(G.getId()):G.getColDef().showRowGroup;return E||U||H})}let J=z?.columns.filter((Z)=>!!Z.getSortDef())??[],q={};Q.forEach((Z,G)=>q[Z.getId()]=G),Q.sort((Z,G)=>{let E=Z.getSortIndex(),U=G.getSortIndex();if(E!=null&&U!=null)return E-U;else if(E==null&&U==null){let H=q[Z.getId()],W=q[G.getId()];return H>W?1:-1}else if(U==null)return-1;else return 1});let X=K0(_)&&!!J.length;if(X)Q=[...new Set(Q.map((Z)=>$?.getShowRowGroupCol(Z.getId())??Z))];let Y=new Map;if(Q.forEach((Z,G)=>Y.set(Z,G)),X)for(let Z of J){let G=$.getShowRowGroupCol(Z.getId());Y.set(Z,Y.get(G))}return Y}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,_],[,f])=>_-f).map(([_])=>_)}collectSortItems(_=!1){let f=[],$=this.getColumnsWithSortingOrdered();for(let z of $){let Q=z.getSortDef()?.direction;if(!Q)continue;let J=M0(z.getSortDef()?.type),q={sort:Q,type:J};if(_)q.colId=z.getId();else q.column=z;f.push(q)}return f}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(_){let f=K0(this.gos),$=!!_.getColDef().showRowGroup;return f&&$}getDisplaySortForColumn(_){let f=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(_);if(!this.canColumnDisplayMixedSort(_)||!f?.length)return _.getSortDef();let z=_.getColDef().field!=null||!!_.getColDef().valueGetter?[_,...f]:f,Q=z[0].getSortDef();if(!z.every((q)=>Gz(q.getSortDef(),Q)))return{type:M0(_.getSortDef()?.type),direction:"mixed"};return Q}getDisplaySortIndexForColumn(_){return this.getIndexedSortMap().get(_)}setupHeader(_,f){let $=()=>{let{type:z,direction:Q}=e_(f.getSortDef());if(_.toggleCss("ag-header-cell-sorted-asc",Q==="asc"),_.toggleCss("ag-header-cell-sorted-desc",Q==="desc"),_.toggleCss("ag-header-cell-sorted-abs-asc",z==="absolute"&&Q==="asc"),_.toggleCss("ag-header-cell-sorted-abs-desc",z==="absolute"&&Q==="desc"),_.toggleCss("ag-header-cell-sorted-none",!Q),f.getColDef().showRowGroup){let X=!this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(f)?.every((Y)=>Q==Y.getSortDef()?.direction);_.toggleCss("ag-header-cell-sorted-mixed",X)}};_.addManagedEventListeners({sortChanged:$,columnPinned:$,columnRowGroupChanged:$,displayedColumnsChanged:$})}initCol(_){let{sortIndex:f,initialSortIndex:$}=_.colDef,z=tq(_.colDef);if(z)_.setSortDef(z,!0);if(f!==void 0){if(f!==null)_.sortIndex=f}else if($!==null)_.sortIndex=$}updateColSort(_,f,$){if(f===void 0)return;this.setColSort(_,e_(f),$)}setColSort(_,f,$){if(!Gz(_.getSortDef(),f))_.setSortDef(e_(f),f===void 0),_.dispatchColEvent("sortChanged",$);_.dispatchStateUpdatedEvent("sort")}setColSortIndex(_,f){_.sortIndex=f,_.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(_){return new nJ(_)}getSortIndicatorSelector(){return B3}},F5={moduleName:"Sort",version:c,beans:[K3,E3],apiFunctions:{onSortChanged:H3},userComponents:{agSortIndicator:nJ},icons:{sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc"}},L3=class extends A{constructor(){super(...arguments);this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",(_)=>this.setColumnDefs(_))}start(){this.beans.ctrlsSvc.whenReady(this,()=>{let _=this.gos.get("columnDefs");if(_)this.setColumnsAndData(_);else this.waitingForColumns=!0;this.gridReady()})}setColumnsAndData(_){let{colModel:f,rowModel:$}=this.beans;f.setColumnDefs(_??[],"gridInitializing"),$.start()}gridReady(){let{eventSvc:_,gos:f}=this;_.dispatchEvent({type:"gridReady"}),q$(f,`initialised successfully, enterprise = ${f.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(_){let f=this.gos.get("columnDefs");if(!f)return;if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(f);return}this.beans.colModel.setColumnDefs(f,Uf(_.source))}};var F3="paste",D3=class extends A{constructor(){super(...arguments);this.beanName="changeDetectionSvc",this.deferredDepth=0,this.batchedPath=null,this.batchedNodes=null}destroy(){super.destroy(),this.batchedPath=null,this.batchedNodes=null}postConstruct(){this.csrm=DJ(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(this.deferredDepth===0)return;if(--this.deferredDepth>0)return;let _=this.batchedPath,f=this.batchedNodes;if(this.batchedPath=null,this.batchedNodes=null,_)this.csrm?.doAggregate(_);let{rowRenderer:$}=this.beans;if(f)for(let z of f)O9($,z);if(_){let z=_.getSortedRows();for(let Q=0,J=z.length;Q{let{sibling:$,pinnedSibling:z}=f;_.refreshRowByNode(f),_.refreshRowByNode($),_.refreshRowByNode(z),_.refreshRowByNode($?.pinnedSibling),_.refreshRowByNode(z?.sibling)},M3=class extends A{constructor(){super(...arguments);this.beanName="expressionSvc",this.cache={}}evaluate(_,f){if(typeof _==="string")return this.evaluateExpression(_,f);else e(15,{expression:_})}evaluateExpression(_,f){try{return this.createExpressionFunction(_)(f.value,f.context,f.oldValue,f.newValue,f.value,f.node,f.data,f.colDef,f.rowIndex,f.api,f.getValue,f.column,f.columnGroup)}catch($){return e(16,{expression:_,params:f,e:$}),null}}createExpressionFunction(_){let f=this.cache;if(f[_])return f[_];let $=this.createFunctionBody(_),z=Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",$);return f[_]=z,z}createFunctionBody(_){if(_.includes("return"))return _;else return"return "+_+";"}};var k3={moduleName:"Expression",version:c,beans:[M3]},S3={moduleName:"ChangeDetection",version:c,beans:[D3]};var A3=class extends A{constructor(){super(...arguments);this.beanName="valueSvc",this.initialised=!1,this.isSsrm=!1}wireBeans(_){this.expressionSvc=_.expressionSvc,this.colModel=_.colModel,this.valueCache=_.valueCache,this.dataTypeSvc=_.dataTypeSvc,this.editSvc=_.editSvc,this.formulaDataSvc=_.formulaDataSvc,this.rowGroupColsSvc=_.rowGroupColsSvc}postConstruct(){if(!this.initialised)this.init()}init(){let{gos:_,valueCache:f}=this;this.executeValueGetter=f?this.executeValueGetterWithValueCache.bind(this):this.executeValueGetterWithoutValueCache.bind(this),this.isSsrm=Kf(_),this.cellExpressions=_.get("enableCellExpressions"),this.isTreeData=_.get("treeData"),this.initialised=!0;let $=(z)=>this.callColumnCellValueChangedHandler(z);this.eventSvc.addListener("cellValueChanged",$,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",$,!0)),this.addManagedPropertyListener("treeData",(z)=>this.isTreeData=z.currentValue)}getValueForDisplay(_){let f=this.beans,$=_.column,z=_.node,Q=f.showRowGroupColValueSvc,J=!$&&z.group,q=$?.colDef.showRowGroup,X=!this.isTreeData||z.footer;if(Q&&X&&(J||q)){let U=Q.getGroupValue(z,$,this.displayIgnoresAggData(z));if(U==null)return{value:null,valueFormatted:null};return{value:U.value,valueFormatted:_.includeValueFormatted?Q.formatAndPrefixGroupColValue(U,$,_.exporting):null}}if(!$)return{value:z.key,valueFormatted:null};let Y=this.getValue($,z,_.from,this.displayIgnoresAggData(z)),Z=Y,G=f.formula;if($.isAllowFormula()&&G?.isFormula(Y))if(_.useRawFormula)Y=G.normaliseFormula(Y,!0),Z=G.resolveValue($,z);else Y=G.resolveValue($,z),Z=Y;let E=_.includeValueFormatted&&!(_.exporting&&$.colDef.useValueFormatterForExport===!1);return{value:Y,valueFormatted:E?this.formatValue($,z,Z):null}}getValue(_,f,$,z=!1){if(!this.initialised)this.init();if(!f)return;let Q=_.colDef,J=f.group;if(!J){let Y=Q.pivotValueColumn;if(Y)_=Y}let q=this.editSvc?.getPendingEditValue(f,_,$);if(q!==void 0)return q;let X=this.resolveValue(_,f,z,J);if(X===void 0){if(J){let Y=Q.showRowGroup;if(typeof Y==="string"){let Z=this.rowGroupColsSvc?.getColumnIndex(Y);if(Z!=null&&Z>f.level)return null}}return}if(this.cellExpressions&&Bz(X)){let Y=X.substring(1);X=this.executeValueGetter(Y,f.data,_,f)}return X}displayIgnoresAggData(_){if(!_.group||_.footer||_.level===-1)return!1;if(!_.sibling||this.gos.get("groupSuppressBlankHeader"))return!1;if(_.leafGroup&&this.colModel.isPivotMode())return!1;return!!_.expanded}resolveValue(_,f,$,z){let{colDef:Q,colId:J}=_,q=!z&&this.formulaDataSvc;if(q&&q.hasDataSource()&&Q.allowFormula===!0){let F=q.getFormula({column:_,rowNode:f});if(Bz(F))return F}let X=z&&!$?f.aggData:void 0,Y=this.isTreeData;if(Y&&X?.[J]!==void 0)return X[J];let Z=f.data,G=Q.field,E=Q.valueGetter;if(Y){if(E)return this.executeValueGetter(E,Z,_,f);if(G&&Z)return e1(Z,G,_.isFieldContainsDots())}let U=f.groupData;if(U&&J in U)return U[J];if(X?.[J]!==void 0)return X[J];let H=Q.showRowGroup,W=typeof H!=="string"||!z,B=this.isSsrm,K=B&&$&&!!Q.aggFunc;if(E&&!K)return W?this.executeValueGetter(E,Z,_,f):void 0;if(B&&f.footer&&f.field&&(H===!0||H===f.field))return e1(Z,f.field,_.isFieldContainsDots());if(G&&Z&&!K)return W?e1(Z,G,_.isFieldContainsDots()):void 0;return}parseValue(_,f,$,z){let Q=_.getColDef();if(Q.allowFormula&&this.beans.formula?.isFormula($))return $;let J=Q.valueParser;if(v(J)){let q=C(this.gos,{node:f,data:f?.data,oldValue:z,newValue:$,colDef:Q,column:_});if(typeof J==="function")return J(q);return this.expressionSvc?.evaluate(J,q)}return $}getDeleteValue(_,f){if(v(_.getColDef().valueParser))return this.parseValue(_,f,"",this.getValueForDisplay({column:_,node:f,from:"edit"}).value)??null;return null}formatValue(_,f,$,z,Q=!0){let{expressionSvc:J}=this.beans,q=null,X,Y=_.getColDef();if(z)X=z;else if(Q)X=Y.valueFormatter;if(X){let Z=f?f.data:null,G=C(this.gos,{value:$,node:f,data:Z,colDef:Y,column:_});if(typeof X==="function")q=X(G);else q=J?J.evaluate(X,G):null}else if(Y.refData)return Y.refData[$]||"";if(q==null&&Array.isArray($))q=$.join(", ");return q}setValue(_,f,$,z){let Q=f.getColDef();if(!_.data&&this.canCreateRowNodeData(_,Q))_.data={};if(!this.isSetValueSupported(f,_,$,Q))return!1;let J=this.getValue(f,_,"data"),q=C(this.gos,{node:_,data:_.data,oldValue:J,newValue:$,colDef:Q,column:f}),X=!1;if(_.data){let Z=this.handleExternalFormulaChange({column:f,eventSource:z,newValue:$,setterParams:q,rowNode:_});if(Z!==null)return Z;X=this.computeValueChange({column:f,rowNode:_,newValue:$,params:q,rowData:_.data,valueSetter:Q.valueSetter,field:Q.field})??!0}let Y=this.beans.changeDetectionSvc;Y?.beginDeferred();try{if(_.group){let Z=this.beans.rowGroupingEditValueSvc?.setGroupDataValue(_,f,$,J,z,X||$!==J);if(Z!==void 0){if(!X&&!Z)return!1;return this.finishValueChange(_,f,q,z,$)}}if(!X)return!1;return this.finishValueChange(_,f,q,z)}finally{Y?.endDeferred()}}canCreateRowNodeData(_,f){if(!_.group)return!0;if(f.groupRowValueSetter!=null||f.groupRowEditable!=null)return!1;if(f.pivotValueColumn)return!1;return!0}finishValueChange(_,f,$,z,Q){_.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();let J=Q===void 0?this.getValue(f,_,"data"):Q;if(this.dispatchCellValueChangedEvent(_,$,J,z),_.pinnedSibling)this.dispatchCellValueChangedEvent(_.pinnedSibling,$,J,z);return!0}isSetValueSupported(_,f,$,z){let{field:Q,valueSetter:J}=z,q=this.beans.formula,X=_.isAllowFormula()&&q?.isFormula($),Y=!!this.formulaDataSvc?.hasDataSource();if(n(Q)&&n(J)&&!(Y&&X)){if(f.group&&(z.groupRowValueSetter||z.groupRowEditable))return!0;return j(17),!1}if(this.dataTypeSvc&&!this.dataTypeSvc.checkType(_,$))return j(135),!1;return!0}handleExternalFormulaChange(_){let{column:f,rowNode:$,newValue:z,eventSource:Q,setterParams:J}=_,q=this.beans.formula,X=this.formulaDataSvc;if(!X?.hasDataSource()||!f.isAllowFormula())return null;let Y=q?.isFormula(z),Z=X.getFormula({column:f,rowNode:$});if(Y){if(Z===z)return!1;X.setFormula({column:f,rowNode:$,formula:z});let E=q?.resolveValue(f,$),U=f.getColDef();if(v(U.valueSetter)||!n(U.field)){let H={...J,newValue:E};this.computeValueChange({column:f,rowNode:$,newValue:E,params:H,rowData:$.data,valueSetter:U.valueSetter,field:U.field})}return this.finishValueChange($,f,J,Q)}if(Z!==void 0)X.setFormula({column:f,rowNode:$,formula:void 0});return null}computeValueChange(_){let{valueSetter:f,params:$,rowData:z,field:Q,column:J,newValue:q}=_;if(v(f)){if(typeof f==="function")return f($);return this.expressionSvc?.evaluate(f,$)}return!!z&&this.setValueUsingField(z,Q,q,J.isFieldContainsDots())}dispatchCellValueChangedEvent(_,f,$,z){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:_.rowIndex,rowPinned:_.rowPinned,column:f.column,colDef:f.colDef,data:_.data,node:_,oldValue:f.oldValue,newValue:$,newRawValue:f.newValue,value:$,source:z})}callColumnCellValueChangedHandler(_){let f=_.colDef.onCellValueChanged;if(typeof f==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>{f(_)})}setValueUsingField(_,f,$,z){if(!f)return!1;let Q=!1;if(!z){if(Q=_[f]===$,!Q)_[f]=$}else{let J=f.split("."),q=_;while(J.length>0&&q){let X=J.shift();if(J.length===0){if(Q=q[X]===$,!Q)q[X]=$}else q=q[X]}}return!Q}executeValueGetterWithValueCache(_,f,$,z){let Q=$.getColId(),J=this.valueCache.getValue(z,Q);if(J!==void 0)return J;let q=this.executeValueGetterWithoutValueCache(_,f,$,z);return this.valueCache.setValue(z,Q,q),q}executeValueGetterWithoutValueCache(_,f,$,z){let Q=C(this.gos,{data:f,node:z,column:$,colDef:$.getColDef(),getValue:(q)=>this.getValueCallback(z,q)}),J;if(typeof _==="function")J=_(Q);else J=this.expressionSvc?.evaluate(_,Q);return J}getValueCallback(_,f){let $=this.colModel.getColDefCol(f);if($)return this.getValue($,_,"data");return null}getKeyForNode(_,f){let $=this.getValue(_,f,"data"),z=_.getColDef().keyCreator,Q=$;if(z){let J=C(this.gos,{value:$,colDef:_.getColDef(),column:_,node:f,data:f.data});Q=z(J)}if(typeof Q==="string"||Q==null)return Q;if(Q=String(Q),Q==="[object Object]")j(121);return Q}},R3={moduleName:"CommunityCore",version:c,beans:[EW,aG,uU,N7,X3,$U,JW,yW,XU,IB,TB,Z3,A3,ZW,zW,GW,mU,L3,bU,CU,pW],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:oG,destroy:eG,isDestroyed:_E,getGridOption:fE,setGridOption:$E,updateGridOptions:yX,isModuleRegistered:zE},dependsOn:[IU,I$,iE,F5,uW,wJ,iW,q3,S3,cW,f1,wB,gB,tW,NU,yU,k3,FU,iB]};function u6(_){let{inputValue:f,allSuggestions:$,hideIrrelevant:z,filterByPercentageOfBestMatch:Q}=_,J=($??[]).map((Y,Z)=>({value:Y,relevance:j3(f,Y),idx:Z}));if(J.sort((Y,Z)=>Y.relevance-Z.relevance),z)J=J.filter((Y)=>Y.relevance0&&Q&&Q>0){let Z=J[0].relevance*Q;J=J.filter((G)=>Z-G.relevance<0)}let q=[],X=[];for(let Y of J)q.push(Y.value),X.push(Y.idx);return{values:q,indices:X}}function j3(_,f){let $=_.length,z=f.length;if(z===0)return $?$:0;let Q=_.toLocaleLowerCase(),J=f.toLocaleLowerCase(),q;if(_.length1&&W>1){let L=_[E-2],F=Q[E-2],D=f[W-2],M=J[W-2];if(F===M){if(Z++,L===D)Z++}}if(E`No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule: - - import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community'; - - ModuleRegistry.registerModules([ AllCommunityModule ]); - `,v3=(_)=>{let f=_.map((z)=>`import { ${f$(z)} } from '${D5[z]?"ag-grid-enterprise":"ag-grid-community"}';`);if(_.some((z)=>z==="IntegratedCharts"||z==="Sparklines"))f.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';");return`import { ModuleRegistry } from 'ag-grid-community'; -${f.join(` -`)} - -ModuleRegistry.registerModules([ ${_.map((z)=>f$(z,!0)).join(", ")} ]); - -For more info see: ${k1}/modules/`};function f$(_,f=!1){if(f&&(_==="IntegratedCharts"||_==="Sparklines"))return`${_}Module.with(AgChartsEnterpriseModule)`;return`${_}Module`}function T3(_,f){let $=f.filter((J)=>J==="IntegratedCharts"||J==="Sparklines"),z="";if(!globalThis?.agCharts&&$.length>0)z=`Unable to use ${_} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise. -`;else if(f.some((J)=>D5[J]))z=z+`Unable to use ${_} as that requires the ag-grid-enterprise script to be included. -`;return z}function k5({moduleName:_,rowModelType:f}){return`To use the ${_}Module you must set the gridOption "rowModelType='${f}'"`}var P9=({reasonOrId:_,moduleName:f,gridScoped:$,gridId:z,rowModelType:Q,additionalText:J,isUmd:q})=>{let X=P3(f,Q),Y=typeof _==="string"?_:C3[_];if(q)return T3(Y,X);let Z=X.filter((U)=>U==="IntegratedCharts"||U==="Sparklines"),G=Z.length>0?`${Z.map((U)=>f$(U)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`${`Unable to use ${Y} as ${X.length>1?"one of "+X.map((U)=>f$(U)).join(", "):f$(X[0])} is not registered${$?" for gridId: "+z:""}. ${G} Check if you have registered the module: -`} -${v3(X)}`+(J?` - -${J}`:"")},v9=(_)=>{return`${_} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'. - -import { AgChartsEnterpriseModule } from 'ag-charts-enterprise'; -import { ModuleRegistry } from 'ag-grid-community'; -import { ${_} } from 'ag-grid-enterprise'; - -ModuleRegistry.registerModules([${_}.with(AgChartsEnterpriseModule)]); - `},I3=(_)=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${_}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,y3={1:()=>"`rowData` must be an array",2:({nodeId:_})=>`Duplicate node id '${_}' detected from getRowId callback, this could cause issues in your grid.`,3:()=>"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",4:({id:_})=>`Could not find row id=${_}, data item was not found for this id`,5:({data:_})=>["Could not find data item as object was not found.",_," Consider using getRowId to help the Grid find matching row data"],6:()=>"'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'",7:()=>"Pivoting is not supported with aligned grids as it may produce different columns in each grid.",8:({key:_})=>`Unknown key for navigation ${_}`,9:({variable:_})=>`No value for ${_?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${_?.defaultValue} will be used and updated when styles load.`,10:({eventType:_})=>`As of v33, the '${_}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,11:()=>"No gridOptions provided to createGrid",12:({colKey:_})=>["column ",_," not found"],13:()=>"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",14:({groupPrefix:_})=>`Row IDs cannot start with ${_}, this is a reserved prefix for AG Grid's row grouping feature.`,15:({expression:_})=>["value should be either a string or a function",_],16:({expression:_,params:f,e:$})=>["Processing of the expression failed","Expression = ",_,"Params = ",f,"Exception = ",$],17:()=>"you need either field or valueSetter set on colDef for editing to work",18:()=>"alignedGrids contains an undefined option.",19:()=>"alignedGrids - No api found on the linked grid.",20:()=>`You may want to configure via a callback to avoid setup race conditions: - "alignedGrids: () => [linkedGrid]"`,21:()=>"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",22:({key:_})=>`${_} is an initial property and cannot be updated.`,23:()=>"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",24:()=>"row height must be a number if not using standard row model",25:({id:_})=>["The getRowId callback must return a string. The ID ",_," is being cast to a string."],26:({fnName:_,preDestroyLink:f})=>{return`Grid API function ${_}() cannot be called as the grid has been destroyed. - Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. - To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${f}`},27:({fnName:_,module:f})=>`API function '${_}' not registered to module '${f}'`,28:()=>"setRowCount cannot be used while using row grouping.",29:()=>"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",30:({toIndex:_})=>["tried to insert columns in invalid location, toIndex = ",_,"remember that you should not count the moving columns when calculating the new index"],31:()=>"infinite loop in resizeColumnSets",32:()=>"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.",33:()=>"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.",34:({key:_})=>`the column type '${_}' is a default column type and cannot be overridden.`,35:()=>"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.",36:({t:_})=>"colDef.type '"+_+"' does not correspond to defined gridOptions.columnTypes",37:()=>"Changing the column pinning status is not allowed with domLayout='print'",38:({iconName:_})=>`provided icon '${_}' needs to be a string or a function`,39:()=>"Applying column order broke a group where columns should be married together. Applying new order has been discarded.",40:({e:_,method:f})=>`${_} -${I3(f)}`,41:()=>"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",42:()=>"Browser does not support document.execCommand('copy') for clipboard operations",43:({iconName:_})=>`As of v33, icon '${_}' is deprecated. Use the icon CSS name instead.`,44:()=>'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',45:({parentCellDataType:_})=>`The data type definition ${_} does not exist.`,46:()=>'The "baseDataType" property of a data type definition must match that of its parent.',47:({cellDataType:_})=>`Missing data type definition - "${_}"`,48:({property:_,inferred:f,colId:$})=>{let z=f?" (inferred)":"",Q=$?` for column "${$}"`:"";return`Cell data type is "object"${z} but no Value ${_} has been provided${Q}. Please either provide an object data type definition with a Value ${_}, or set: - - "colDef.value${_}"${f&&_==="Parser"?` - - "colDef.cellDataType = 'object'"`:""}`},49:({methodName:_})=>`Framework component is missing the method ${_}()`,50:({compName:_})=>`Could not find component ${_}, did you forget to configure this component?`,51:()=>"Export cancelled. Export is not allowed as per your configuration.",52:()=>"There is no `window` associated with the current `document`",53:()=>"unknown value type during csv conversion",54:()=>"Could not find document body, it is needed for drag and drop and context menu.",55:()=>"addRowDropZone - A container target needs to be provided",56:()=>"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",57:()=>"unable to show popup filter, filter instantiation failed",58:()=>"no values found for select cellEditor",59:()=>"cannot select pinned rows",60:()=>"cannot select node until it has finished loading",61:()=>"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",62:({colId:_})=>`setFilterModel() - no column found for colId: ${_}`,63:({colId:_})=>`setFilterModel() - unable to fully apply model, filtering disabled for colId: ${_}`,64:({colId:_})=>`setFilterModel() - unable to fully apply model, unable to create filter for colId: ${_}`,65:()=>"filter missing setModel method, which is needed for setFilterModel",66:()=>"filter API missing getModel method, which is needed for getFilterModel",67:()=>"Filter is missing isFilterActive() method",68:()=>"Column Filter API methods have been disabled as Advanced Filters are enabled.",69:({guiFromFilter:_})=>`getGui method from filter returned ${_}; it should be a DOM element.`,70:({newFilter:_})=>`Grid option quickFilterText only supports string inputs, received: ${typeof _}`,71:()=>"debounceMs is ignored when apply button is present",72:({keys:_})=>["ignoring FilterOptionDef as it doesn't contain one of ",_],73:()=>"invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'",74:()=>"no filter options for filter",75:()=>"Unknown button type specified",76:({filterModelType:_})=>['Unexpected type of filter "',_,'", it looks like the filter was configured with incorrect Filter Options'],77:()=>"Filter model is missing 'conditions'",78:()=>'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',79:()=>'"filterParams.maxNumConditions" must be greater than or equal to zero.',80:()=>'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',81:()=>'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',82:({param:_})=>`DateFilter ${_} is not a number`,83:()=>"DateFilter minValidYear should be <= maxValidYear",84:()=>"DateFilter minValidDate should be <= maxValidDate",85:()=>"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",86:()=>"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",87:()=>"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",88:({index:_})=>`Invalid row index for ensureIndexVisible: ${_}`,89:()=>"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)",90:()=>"datasource is missing getRows method",91:()=>"Filter is missing method doesFilterPass",92:()=>"AnimationFrameService called but animation frames are off",93:()=>"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",94:({paginationPageSizeOption:_,pageSizeSet:f,pageSizesSet:$,pageSizeOptions:z})=>`'paginationPageSize=${_}'${f?"":" (default value)"}, but ${_} is not included in${$?"":" the default"} paginationPageSizeSelector=[${z?.join(", ")}].`,95:({paginationPageSizeOption:_,paginationPageSizeSelector:f})=>`Either set '${f}' to an array that includes ${_} or to 'false' to disable the page size selector.`,96:({id:_,data:f})=>["Duplicate ID",_,"found for pinned row with data",f,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."],97:({colId:_})=>`cellEditor for column ${_} is missing getGui() method`,98:()=>"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",99:()=>"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",101:({propertyName:_,componentName:f,agGridDefaults:$,jsComps:z})=>{let Q=[],J=[...Object.keys($??[]).filter((X)=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(X)),...Object.keys(z??[]).filter((X)=>!!z[X])],q=u6({inputValue:f,allSuggestions:J,hideIrrelevant:!0,filterByPercentageOfBestMatch:0.8}).values;if(Q.push(`Could not find '${f}' component. It was configured as "${_}: '${f}'" but it wasn't found in the list of registered components. -`),q.length>0)Q.push(` Did you mean: [${q.slice(0,3)}]? -`);return Q.push("If using a custom component check it has been registered correctly."),Q},102:()=>"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",103:()=>"Invalid selection state. When using client-side row model, the state must conform to `string[]`.",104:({value:_,param:f})=>`Numeric value ${_} passed to ${f} param will be interpreted as ${_} seconds. If this is intentional use "${_}s" to silence this warning.`,105:({e:_})=>["chart rendering failed",_],106:()=>`Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${k1}/theming-migration/`,107:({key:_,value:f})=>`Invalid value for theme param ${_} - ${f}`,108:({e:_})=>["chart update failed",_],109:({inputValue:_,allSuggestions:f})=>{let $=u6({inputValue:_,allSuggestions:f,hideIrrelevant:!0,filterByPercentageOfBestMatch:0.8}).values;return[`Could not find '${_}' aggregate function. It was configured as "aggFunc: '${_}'" but it wasn't found in the list of registered aggregations.`,$.length>0?` Did you mean: [${$.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join(` -`)},110:()=>"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",111:()=>"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",113:()=>"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",114:({component:_})=>`Could not find component with name of ${_}. Is it in Vue.components?`,116:()=>"Invalid selection state. The state must conform to `IServerSideSelectionState`.",117:()=>"selectAll must be of boolean type.",118:()=>"Infinite scrolling must be enabled in order to set the row count.",119:()=>"Unable to instantiate filter",120:()=>"MultiFloatingFilterComp expects MultiFilter as its parent",121:()=>"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",122:()=>"could not find the document, document is empty",123:()=>"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",124:()=>"No active charts to update.",125:({chartId:_})=>`Unable to update chart. No active chart found with ID: ${_}.`,126:()=>"unable to restore chart as no chart model is provided",127:({allRange:_})=>`unable to create chart as ${_?"there are no columns in the grid":"no range is selected"}.`,128:({feature:_})=>`${_} is only available if using 'multiRow' selection mode.`,129:({feature:_,rowModel:f})=>`${_} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${f}.`,130:()=>'cannot multi select unless selection mode is "multiRow"',132:()=>"Row selection features are not available unless `rowSelection` is enabled.",133:({iconName:_})=>`icon '${_}' function should return back a string or a dom object`,134:({iconName:_})=>`Did not find icon '${_}'`,135:()=>"Data type of the new value does not match the cell data type of the column",136:()=>"Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.",137:({type:_,currentChartType:f})=>`Unable to update chart as a '${_}' update type is not permitted on a ${f}.`,138:({chartType:_})=>`invalid chart type supplied: ${_}`,139:({customThemeName:_})=>`a custom chart theme with the name ${_} has been supplied but not added to the 'chartThemes' list`,140:({name:_})=>`no stock theme exists with the name '${_}' and no custom chart theme with that name was supplied to 'customChartThemes'`,141:()=>"cross filtering with row grouping is not supported.",142:()=>"cross filtering is only supported in the client side row model.",143:({panel:_})=>`'${_}' is not a valid Chart Tool Panel name`,144:({type:_})=>`Invalid charts data panel group name supplied: '${_}'`,145:({group:_})=>`As of v32, only one charts customize panel group can be expanded at a time. '${_}' will not be expanded.`,146:({comp:_})=>`Unable to instantiate component '${_}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,147:({group:_})=>`Invalid charts customize panel group name supplied: '${_}'`,148:({group:_})=>`invalid chartGroupsDef config '${_}'`,149:({group:_,chartType:f})=>`invalid chartGroupsDef config '${_}.${f}'`,150:()=>"'seriesChartTypes' are required when the 'customCombo' chart type is specified.",151:({chartType:_})=>`invalid chartType '${_}' supplied in 'seriesChartTypes', converting to 'line' instead.`,152:({colId:_})=>`no 'seriesChartType' found for colId = '${_}', defaulting to 'line'.`,153:({chartDataType:_})=>`unexpected chartDataType value '${_}' supplied, instead use 'category', 'series' or 'excluded'`,154:({colId:_})=>`cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${_}`,155:({option:_})=>`'${_}' is not a valid Chart Toolbar Option`,156:({panel:_})=>`Invalid panel in chartToolPanelsDef.panels: '${_}'`,157:({unrecognisedGroupIds:_})=>["unable to find group(s) for supplied groupIds:",_],158:()=>"can not expand a column item that does not represent a column group header",159:()=>"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",160:()=>"Export cancelled. Export is not allowed as per your configuration.",161:()=>"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",162:({id:_,dataType:f})=>`Unrecognized data type for excel export [${_}.dataType=${f}]`,163:({featureName:_})=>`Excel table export does not work with ${_}. The exported Excel file will not contain any Excel tables. - Please turn off ${_} to enable Excel table exports.`,164:()=>"Unable to add data table to Excel sheet: A table already exists.",165:()=>"Unable to add data table to Excel sheet: Missing required parameters.",166:({unrecognisedGroupIds:_})=>["unable to find groups for these supplied groupIds:",_],167:({unrecognisedColIds:_})=>["unable to find columns for these supplied colIds:",_],168:()=>"detailCellRendererParams.template should be function or string",169:()=>'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',170:({providedStrategy:_})=>`invalid cellRendererParams.refreshStrategy = ${_} supplied, defaulting to refreshStrategy = 'rows'.`,171:()=>"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",172:()=>"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",173:({group:_})=>`invalid chartGroupsDef config '${_}'`,174:({group:_,chartType:f})=>`invalid chartGroupsDef config '${_}.${f}'`,175:({menuTabName:_,itemsToConsider:f})=>[`Trying to render an invalid menu item '${_}'. Check that your 'menuTabs' contains one of `,f],176:({key:_})=>`unknown menu item type ${_}`,177:()=>"valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.",178:({colId:_})=>`column ${_} is not visible`,179:()=>"totalValueGetter should be either a function or a string (expression)",180:()=>"agRichSelectCellEditor requires cellEditorParams.values to be set",181:()=>"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",182:()=>'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',183:()=>"Group Column Filter only works on group columns. Please use a different filter.",184:({parentGroupData:_,childNodeData:f})=>["duplicate group keys for row data, keys should be unique",[_,f]],185:({data:_})=>["getDataPath() should not return an empty path",[_]],186:({rowId:_,rowData:f,duplicateRowsData:$})=>["duplicate group keys for row data, keys should be unique",_,f,...$??[]],187:({rowId:_,firstData:f,secondData:$})=>[`Duplicate node id ${_}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,"first instance",f,"second instance",$],188:(_)=>`getRowId callback must be provided for Server Side Row Model ${_?.feature||"selection"} to work correctly.`,189:({startRow:_})=>`invalid value ${_} for startRow, the value should be >= 0`,190:({rowGroupId:_,data:f})=>["null and undefined values are not allowed for server side row model keys",_?`column = ${_}`:"","data is ",f],194:({method:_})=>`calling gridApi.${_}() is only possible when using rowModelType=\`clientSide\`.`,195:({justCurrentPage:_})=>`selecting just ${_?"current page":"filtered"} only works when gridOptions.rowModelType='clientSide'`,196:({key:_})=>`Provided ids must be of string type. Invalid id provided: ${_}`,197:()=>"`toggledNodes` must be an array of string ids.",199:()=>"getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.",200:P9,201:({rowModelType:_})=>`Could not find row model for rowModelType = ${_}`,202:()=>"`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.",203:()=>"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",204:()=>"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",205:({duplicateIdText:_})=>`Unable to display rows as duplicate row ids (${_}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,206:()=>"getRowId callback must be implemented for transactions to work. Transaction was ignored.",207:()=>'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',208:()=>"Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.",209:()=>`Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${k1}/filter-set-filter-list/#filter-value-types`,210:()=>"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",211:()=>"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",212:()=>"please review all your toolPanel components, it seems like at least one of them doesn't have an id",213:()=>"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",214:({key:_})=>`unable to lookup Tool Panel as invalid key supplied: ${_}`,215:({key:_,defaultByKey:f})=>`the key ${_} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(f??{}).join(",")}`,216:({name:_})=>`Missing component for '${_}'`,217:({invalidColIds:_})=>["unable to find grid columns for the supplied colDef(s):",_],218:({property:_,defaultOffset:f})=>`${_} must be a number, the value you provided is not a valid number. Using the default of ${f}px.`,219:({property:_})=>`Property ${_} does not exist on the target object.`,220:({lineDash:_})=>`'${_}' is not a valid 'lineDash' option.`,221:()=>"agAggregationComponent should only be used with the client and server side row model.",222:()=>"agFilteredRowCountComponent should only be used with the client side row model.",223:()=>"agSelectedRowCountComponent should only be used with the client and server side row model.",224:()=>"agTotalAndFilteredRowCountComponent should only be used with the client side row model.",225:()=>"agTotalRowCountComponent should only be used with the client side row model.",226:()=>"viewport is missing init method.",227:()=>"menu item icon must be DOM node or string",228:({menuItemOrString:_})=>`unrecognised menu item ${_}`,230:()=>"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",231:()=>"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",232:()=>"Using both rowData and v-model. rowData will be ignored.",233:({methodName:_})=>`Framework component is missing the method ${_}()`,234:()=>'Group Column Filter does not work with the colDef property "field". This property will be ignored.',235:()=>'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',236:()=>'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',237:()=>"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",238:()=>"setRowCount can only accept a positive row count.",239:()=>'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',240:({theme:_})=>`theme grid option must be a Theming API theme object or the string "legacy", received: ${_}`,243:()=>"Failed to deserialize state - each provided state object must be an object.",244:()=>"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",245:()=>"Failed to deserialize state - `toggledNodes` must be an array.",246:()=>"Failed to deserialize state - Every `toggledNode` requires an associated string id.",247:()=>`Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. -Please rebuild the selection state and reapply it.`,248:()=>"SetFloatingFilter expects SetFilter as its parent",249:()=>"Must supply a Value Formatter in Set Filter params when using a Key Creator",250:()=>"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",251:({chartType:_})=>`AG Grid: Unable to create chart as an invalid chartType = '${_}' was supplied.`,252:()=>`cannot get grid to draw rows when it is in the middle of drawing rows. -Your code probably called a grid API method while the grid was in the render stage. -To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). -To see what part of your code that caused the refresh check this stacktrace.`,253:({version:_})=>["Illegal version string: ",_],254:()=>"Cannot create chart: no chart themes available.",255:({point:_})=>`Lone surrogate U+${_?.toString(16).toUpperCase()} is not a scalar value`,256:()=>"Unable to initialise. See validation error, or load ValidationModule if missing.",257:()=>v9("IntegratedChartsModule"),258:()=>v9("SparklinesModule"),259:({part:_})=>`the argument to theme.withPart must be a Theming API part object, received: ${_}`,260:({propName:_,compName:f,gridScoped:$,gridId:z,rowModelType:Q})=>P9({reasonOrId:`AG Grid '${_}' component: ${f}`,moduleName:j1[f],gridId:z,gridScoped:$,rowModelType:Q}),261:()=>"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",262:()=>'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',263:()=>'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',264:()=>'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',265:({colId:_})=>`Unable to infer chart data type for column '${_}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${k1}/integrated-charts-range-chart#coldefchartdatatype .`,266:()=>'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',267:()=>"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",268:()=>"Transactions aren't supported with tree data when using treeDataChildrenField",269:()=>"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",270:({id:_,parentId:f})=>`Cycle detected for row with id='${_}' and parent id='${f}'. Resetting the parent for row with id='${_}' and showing it as a root-level node.`,271:({id:_,parentId:f})=>`Parent row not found for row with id='${_}' and parent id='${f}'. Showing row with id='${_}' as a root-level node.`,272:()=>M5(),273:({providedId:_,usedId:f})=>`Provided column id '${_}' was already in use, ensure all column and group ids are unique. Using '${f}' instead.`,274:({prop:_})=>{let f=`Since v33, ${_} has been deprecated.`;switch(_){case"maxComponentCreationTimeMs":f+=" This property is no longer required and so will be removed in a future version.";break;case"setGridApi":f+=" This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api ";break;case"children":f+=" For multiple versions AgGridReact does not support children.";break}return f},275:k5,276:()=>"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",277:({colId:_})=>`'enableFilterHandlers' is set to true, but column '${_}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,278:({colId:_})=>`Unable to create filter handler for column '${_}'`,279:(_)=>{},280:({colId:_})=>`'name' must be provided for custom filter components for column '${_}`,281:({colId:_})=>`Filter for column '${_}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,282:()=>"New filter tool panel requires `enableFilterHandlers: true`.",283:()=>"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",284:()=>"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",285:()=>"As of v34, use (`api.getColumnFilterModel()`) instead.",286:()=>"As of v34, use (`api.setColumnFilterModel()`) instead.",287:()=>"`api.doFilterAction()` requires `enableFilterHandlers = true",288:()=>"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",289:({rowModelType:_})=>`Row Model '${_}' is not supported with Batch Editing`,290:({rowIndex:_,rowPinned:f})=>`Row with index '${_}' and pinned state '${f}' not found`,291:()=>"License Key being set multiple times with different values. This can result in an incorrect license key being used,",292:({colId:_})=>`The Multi Filter for column '${_}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,293:()=>"The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.",294:()=>"When using the `agRichSelectCellEditor` setting `filterListAsync = true` requires `allowTyping = true` and the `values()` callback must return a Promise of filtered values.",295:({blockedService:_})=>`colDef.allowFormula is not supported with ${_}. Formulas has been turned off.`,296:()=>"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.",297:()=>'`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.',298:()=>"Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates."};function b3(_,f){let $=y3[_];if(!$)return[`Missing error text for error id ${_}!`];let z=$(f),J=` -See ${jq(_,f)}`;return Array.isArray(z)?z.concat(J):[z,J]}var C3={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},w3=class{constructor(_="javascript"){this.frameworkName=_,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.wrapIncoming=(f)=>f(),this.wrapOutgoing=(f)=>f(),this.baseDocLink=`${Bq}/${this.frameworkName}-data-grid`,_7(this.baseDocLink)}frameworkComponent(_){return null}isFrameworkComponent(_){return!1}getDocLink(_){return this.baseDocLink+(_?"/"+_:"")}},T9=new WeakMap,I9=new WeakMap;function ZQ(_,f,$){if(!f)return e(11),{};let z=$,Q;if(!z?.setThemeOnGridDiv){let q=z_({tag:"div"});q.style.height="100%",_.appendChild(q),_=q,Q=()=>_.remove()}return new N3().create(_,f,(q)=>{let X=new lG(_);q.createBean(X)},void 0,$,Q)}var x3=1,N3=class{create(_,f,$,z,Q,J){let q=$J.applyGlobalGridOptions(f),X=q.gridId??String(x3++),Y=this.getRegisteredModules(Q,X,q.rowModelType),Z=this.createBeansList(q.rowModelType,Y,X),G=this.createProvidedBeans(_,q,Q);if(!Z)return;let H=new O8({providedBeanInstances:G,beanClasses:Z,id:X,beanInitComparator:T8,beanDestroyComparator:I8,derivedBeans:[P8],destroyCallback:()=>{I9.delete(W),T9.delete(_),l4(X),J?.()}});this.registerModuleFeatures(H,Y),$(H),H.getBean("syncSvc").start(),z?.(H);let W=H.getBean("gridApi");return T9.set(_,W),I9.set(W,_),W}getRegisteredModules(_,f,$){return X$(R3,void 0,!0),_?.modules?.forEach((z)=>X$(z,f)),s4(f,y9($))}registerModuleFeatures(_,f){let $=_.getBean("registry"),z=_.getBean("apiFunctionSvc");for(let Q of f){$.registerModule(Q);let J=Q.apiFunctions;if(J){let q=Object.keys(J);for(let X of q)z?.addFunction(X,J[X])}}}createProvidedBeans(_,f,$){let z=$?$.frameworkOverrides:null;if(n(z))z=new w3;let Q={gridOptions:f,eGridDiv:_,eRootDiv:_,globalListener:$?$.globalListener:null,globalSyncListener:$?$.globalSyncListener:null,frameworkOverrides:z,withinStudio:$?.withinStudio};if($?.providedBeanInstances)Object.assign(Q,$.providedBeanInstances);return Q}createBeansList(_,f,$){let z={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},Q=y9(_),J=z[Q];if(!J){r1(201,{rowModelType:Q},`Unknown rowModelType ${Q}.`);return}if(!o4()){r1(272,void 0,M5());return}if(!_){let X=Object.entries(z).filter(([Y,Z])=>S6(Z,$,Y));if(X.length==1){let[Y,Z]=X[0];if(Y!==Q){let G={moduleName:Z,rowModelType:Y};r1(275,G,k5(G));return}}}if(!S6(J,$,Q)){let X=QJ(),Y=`rowModelType = '${Q}'`,Z=X?`Unable to use ${Y} as that requires the ag-grid-enterprise script to be included. -`:`Missing module ${J}Module for rowModelType ${Q}.`;r1(200,{reasonOrId:Y,moduleName:J,gridScoped:zJ(),gridId:$,rowModelType:Q,isUmd:X},Z);return}let q=new Set;for(let X of f)for(let Y of X.beans??[])q.add(Y);return Array.from(q)}};function y9(_){return _??"clientSide"}function g3(_,f,$="auto"){_.frameworkOverrides.wrapIncoming(()=>_.ctrlsSvc.getScrollFeature().ensureColumnVisible(f,$),"ensureVisible")}function h3(_,f,$){_.frameworkOverrides.wrapIncoming(()=>_.ctrlsSvc.getScrollFeature().ensureIndexVisible(f,$),"ensureVisible")}var S5=(_,f)=>{for(let $=0,z=_.length;${if($!=null){let J=$.getSortedRows();for(let q=0,X=J.length;q{let Z=X.level+1;for(let G=0,E=Y.length;G{if(!E&&E!==void 0){let D=L.sourceRowIndex;E=D<=U,U=D}if(L.data!==F){if(L.updateData(F),!q.has(L))X.add(L);if(!L.selectable&&L.isSelected())Z.push(L)}},B=(L,F,D)=>{for(let M=0,k=F.length;M0;if(K){let L=$._leafs??($._leafs=[]);if(E===void 0)n3(L,Y,J);else if(p3(L,Y))J.reordered=!0}if(K||H||X.size)_.rowDataUpdated=!0,this.deselect(Z)}deleteUnusedNodes(_,{removals:f},$,z){let Q=this.rootNode._leafs;for(let J=0,q=Q.length;J0}updateRowData(_,f,$){if(this.dispatchRowDataUpdateStarted(_.add),this.beans.groupStage?.getNestedDataGetter())return j(268),{remove:[],update:[],add:[]};let z=[],Q=j6(this.gos),J=this.executeRemove(Q,_,f,z,$),q=this.executeUpdate(Q,_,f,z),X=this.executeAdd(_,f);return this.deselect(z),{remove:J,update:q,add:X}}executeRemove(_,{remove:f},{adds:$,updates:z,removals:Q},J,q){let X=this.rootNode._leafs,Y=X?.length,Z=f?.length;if(!Z||!Y)return[];let G=0,E=Y,U=0,H=Array(Z);for(let W=0;WU)U=K;if(H[G++]=B,!this.destroyNode(B,q))continue;if(B.isSelected())J.push(B);if(!$.delete(B))z.delete(B),Q.push(B)}if(H.length=G,G)c3(X,E,U);return H}executeUpdate(_,{update:f},{adds:$,updates:z},Q){let J=f?.length;if(!J)return[];let q=Array(J),X=0;for(let Y=0;Y=Y;--E){let H=z[E];H.sourceRowIndex=U,z[U--]=H}f.reordered=!0}z.length=X;let Z=Array(q),G=f.adds;for(let E=0;E=$||Number.isNaN(f))return $;f=Math.ceil(f);let z=this.gos;if(f>0&&z.get("treeData")&&z.get("getDataPath"))f=i3(_,f);return f}},i3=(_,f)=>{for(let $=0,z=_.length;${if(_.group=!0,_.level=-1,_._expanded=!0,_.id="ROOT_NODE_ID",_._leafs?.length!==0)_._leafs=[];let f=[],$=[],z=[],Q=[];_.childrenAfterGroup=f,_.childrenAfterSort=$,_.childrenAfterAggFilter=z,_.childrenAfterFilter=Q;let J=_.sibling;if(J)J.childrenAfterGroup=f,J.childrenAfterSort=$,J.childrenAfterAggFilter=z,J.childrenAfterFilter=Q,J.childrenMapped=_.childrenMapped;return _.updateHasChildren(),_},m3=(_,f)=>{if(_)for(let $=0,z=_.length;${f=Math.max(0,f);for(let z=f,Q=_.length;z{let $=f.size;_.length=$;let z=0,Q=!1,J=!1;for(let q of f){let X=q.sourceRowIndex;if(X===z)J||(J=Q);else{if(X>=0)J=!0;else Q=!0;q.sourceRowIndex=z,_[z]=q}++z}return J},n3=(_,f,{adds:$})=>{let z=_.length,Q=f.size;if(Q>z)_.length=Q;let J=0;for(let q=0;q{if(z.hasChildren())if(_&&!Q)z.childrenAfterFilter=z.childrenAfterGroup.filter((J)=>{let q=J.childrenAfterFilter&&J.childrenAfterFilter.length>0,X=J.data&&this.filterManager.doesRowPassFilter({rowNode:J});return q||X});else z.childrenAfterFilter=z.childrenAfterGroup;else z.childrenAfterFilter=z.childrenAfterGroup;i6(z)};if(this.doingTreeDataFiltering()){let z=(Q,J)=>{if(Q.childrenAfterGroup)for(let q=0;q$(Q,!1);R_(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,f,z)}}softFilter(_,f){let $=(Q)=>{if(Q.childrenAfterFilter=Q.childrenAfterGroup,Q.hasChildren())for(let J of Q.childrenAfterGroup)J.softFiltered=_&&!(J.data&&this.filterManager.doesRowPassFilter({rowNode:J}));i6(Q)},z=this.beans.rowModel;R_(z.rootNode,z.hierarchical,f,$)}doingTreeDataFiltering(){let{gos:_}=this;return!!this.beans.groupStage?.treeData&&!_.get("excludeChildrenWhenTreeDataFiltering")}},t3=4,r3=(_,f,$,z,Q)=>{let{childrenAfterSort:J,childrenAfterAggFilter:q}=f;if(!q)return J&&J.length>0?J:[];let X=q.length;if(X<=1){if(J?.length===X&&(X===0||J[0]===q[0]))return J;return q.slice()}if(!J||X<=t3)return _.doFullSortInPlace(q.slice(),Q);let Y=new Map,{updates:Z,adds:G}=$,E=[];for(let H=0;H_.compareRowNodes(Q,H,W)||~Y.get(H)-~Y.get(W)),U===X)return E;return l3(_,Q,E,J,Y,X)},l3=(_,f,$,z,Q,J)=>{let q=Array(J),X=0,Y=$[X],Z,G=-1,E=0,U=0,H=$.length,W=z.length;while(!0){if(G<0){if(E>=W)break;if(Z=z[E++],G=Q.get(Z)??-1,G<0)continue}if((_.compareRowNodes(f,Y,Z)||~Q.get(Y)-G)<0){if(q[U++]=Y,++X>=H)break;Y=$[X]}else q[U++]=Z,G=-1}while(X=0)q[U++]=B}return q},s3=(_,f,$)=>{let z=0;$.length=f.size;for(let Q=0,J=_.length;Q{let{childrenAfterSort:f,sibling:$}=_;if($)$.childrenAfterSort=f;if(!f)return;for(let z=0,Q=f.length-1;z<=Q;z++){let J=f[z],q=z===0,X=z===Q;if(J.firstChild!==q)J.firstChild=q,J.dispatchRowEvent("firstChildChanged");if(J.lastChild!==X)J.lastChild=X,J.dispatchRowEvent("lastChildChanged");if(J.childIndex!==z)J.childIndex=z,J.dispatchRowEvent("childIndexChanged")}},a3=class extends A{constructor(){super(...arguments);this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(_,f){let $=this.beans.sortSvc.getSortOptions(),z=$.length>0&&!!f&&this.gos.get("deltaSort"),{gos:Q,colModel:J,rowGroupColsSvc:q,rowNodeSorter:X,rowRenderer:Y,showRowGroupCols:Z}=this.beans,G=Q.get("groupMaintainOrder"),E=J.getCols().some((F)=>F.isRowGroupActive()),U=q?.columns,H=J.isPivotMode(),W=Q.getCallback("postSortRows"),B=!1,K,L=(F)=>{let D=H&&F.leafGroup,M=G&&E&&!F.leafGroup;if(M)K??(K=this.shouldSortContainsGroupCols($)),M&&(M=!K);let k=null;if(M){let R=!1;if(U){let O=F.level+1;if(O{let{childrenAfterSort:f,childrenAfterAggFilter:$}=_,z=f?.length,Q=$?.length;if(!z||!Q)return null;let J=Array(Q),q=new Set;for(let Y=0;Y{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:$,columnRowGroupChanged:$,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:()=>this.refreshModel({step:"pivot"}),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),stylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){let{beans:_,stagesRefreshProps:f}=this,$=[_.groupStage,_.filterStage,_.pivotStage,_.aggStage,_.sortStage,_.filterAggStage,_.flattenStage].filter((z)=>!!z);this.stages=$;for(let z=$.length-1;z>=0;--z){let Q=$[z];for(let J of Q.refreshProps)f.set(J,z)}this.addManagedPropertyListeners([...f.keys(),"rowData"],(z)=>{let Q=z.changeSet?.properties;if(Q)this.onPropChange(Q)}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){if(this.started=!0,this.rowNodesCountReady)this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0});else this.setInitialData()}setInitialData(){if(this.gos.get("rowData"))this.onPropChange(["rowData"])}ensureRowHeightsValid(_,f,$,z){let Q,J=!1;do{Q=!1;let q=this.getRowIndexAtPixel(_),X=this.getRowIndexAtPixel(f),Y=Math.max(q,$),Z=Math.min(X,z);for(let G=Y;G<=Z;G++){let E=this.getRow(G);if(E.rowHeightEstimated){let U=Y$(this.beans,E);E.setRowHeight(U.height),Q=!0,J=!0}}if(Q)this.setRowTopAndRowIndex()}while(Q);return J}onPropChange(_){let{nodeManager:f,gos:$,beans:z}=this,Q=z.groupStage;if(!f)return;let J=new Set(_),q=Q?.onPropChange(J),X;if(J.has("rowData"))X=$.get("rowData");else if(q)X=Q?.extractData();if(X&&!Array.isArray(X))X=null,j(1);let Y={step:"nothing",changedProps:J};if(X){let G=!q&&!this.isEmpty()&&X.length>0&&$.exists("getRowId")&&!$.get("resetRowDataOnUpdate");if(this.refreshingData=!0,G)Y.keepRenderedRows=!0,Y.animate=!$.get("suppressAnimationFrame"),Y.changedRowNodes=new R1,f.setImmutableRowData(Y,X);else Y.rowDataUpdated=!0,Y.newData=!0,f.setNewRowData(X),this.rowNodesCountReady=!0}let Z=Y.rowDataUpdated?"group":this.getRefreshedStage(_);if(Z)Y.step=Z,this.refreshModel(Y)}getRefreshedStage(_){let{stages:f,stagesRefreshProps:$}=this;if(!f)return null;let z=f.length,Q=z;for(let J=0,q=_.length;J{if(J?.id!=null&&!f.has(J.id))J.clearRowTopAndRowIndex()},z=(J)=>{$(J),$(J.detailNode),$(J.sibling);let q=J.childrenAfterGroup;if(!J.hasChildren()||!q)return;if(_&&J.level!==-1&&!J.expanded)return;for(let X=0,Y=q.length;X{let Z=J[Y];if(this.gos.get("groupHideOpenParents"))while(Z.expanded&&Z.childrenAfterSort&&Z.childrenAfterSort.length>0)Z=Z.childrenAfterSort[0];return Z.rowIndex},X=f.footerSvc;if(X)return X?.getTopDisplayIndex(z,_,J,q);return q(_)}getTopLevelIndexFromDisplayedIndex(_){let{rootNode:f,rowsToDisplay:$}=this;if(!f||!$.length||$[0]===f)return _;let Q=this.getRow(_);if(Q.footer)Q=Q.sibling;let J=Q.parent;while(J&&J!==f)Q=J,J=Q.parent;let q=f.childrenAfterSort?.indexOf(Q)??-1;return q>=0?q:_}getRowBounds(_){let f=this.rowsToDisplay[_];return f?{rowTop:f.rowTop,rowHeight:f.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:S1(this.gos)})}onFilterChanged({afterDataChange:_,columns:f}){if(!_){let z=f.length===0||f.some((Q)=>Q.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:z,keepRenderedRows:!0,animate:S1(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:S1(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}isSuppressModelUpdateAfterUpdateTransaction(_){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;let{changedRowNodes:f,newData:$,rowDataUpdated:z}=_;if(!f||$||!z)return!1;if(f.removals.length||f.adds.size)return!1;return!0}reMapRows(){if(this.refreshingModel||this.refreshingData){this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,this.noAnimate=!0;return}this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(_){let{nodeManager:f,eventSvc:$,started:z}=this;if(!f)return;let Q=!!_.rowDataUpdated;if(z&&Q)$.dispatchEvent({type:"rowDataUpdated"});if(this.deferRefresh(_)){this.setPendingRefreshFlags(_),this.rowDataUpdatedPending||(this.rowDataUpdatedPending=Q);return}if(this.rowDataUpdatedPending)this.rowDataUpdatedPending=!1,_.step="group";this.updateRefreshParams(_);let J=!1;this.refreshingModel=!0;try{this.executeRefresh(_,Q),J=!0}finally{if(this.refreshingData=!1,this.refreshingModel=!1,!J)this.setPendingRefreshFlags(_)}this.clearPendingRefreshFlags(),$.dispatchEvent({type:"modelUpdated",animate:_.animate,keepRenderedRows:_.keepRenderedRows,newData:_.newData,newPage:!1,keepUndoRedoStack:_.keepUndoRedoStack})}executeRefresh(_,f){let{beans:$,rootNode:z}=this;if($.masterDetailSvc?.refreshModel(_),f&&_.step!=="group")$.colFilter?.refreshModel();let Q=_.changedPath;if(Q?.addRow(z),_.step==="group")this.doGrouping(z,_),Q??(Q=_.changedPath);switch(Q??(Q=$.changedPathFactory?.ensureRowsPath(_,z)),_.step){case"group":case"filter":this.doFilter(Q);case"pivot":if(this.doPivot(Q))Q=void 0,_.changedPath=void 0;case"aggregate":this.doAggregate(Q);case"filter_aggregates":this.doFilterAggregates(Q);case"sort":this.doSort(Q,_.changedRowNodes);case"map":this.doRowsToDisplay()}let J=new Set;this.setRowTopAndRowIndex(J),this.clearRowTopAndRowIndex(Q,J),this.updateRefreshParams(_)}deferRefresh(_){if(this.refreshingModel)return!0;if(this.beans.colModel.changeEventsDispatching)return!0;if(this.isSuppressModelUpdateAfterUpdateTransaction(_)){if(this.started)this.refreshingData=!1;return!0}if(!this.started)return!0;return!1}setPendingRefreshFlags(_){this.pendingNewData||(this.pendingNewData=!!_.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!_.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!_.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!_.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(_){_.newData=this.pendingNewData||!!_.newData,_.keepRenderedRows=!this.noKeepRenderedRows&&!!_.keepRenderedRows,_.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!_.keepUndoRedoStack,_.animate=!this.noAnimate&&!!_.animate}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getOverlayType(){let{beans:_,gos:f}=this;if(this.rootNode?._leafs?.length){if(_.filterManager?.isAnyFilterPresent()&&this.getRowCount()===0)return"noMatchingRows"}else if(this.rowCountReady||(f.get("rowData")?.length??0)==0)return"noRows";return null}getNodesInRangeForSelection(_,f){let $=!1,z=!1,Q=[],J=G$(this.gos);return this.forEachNodeAfterFilterAndSort((q)=>{if(z)return;if($){if(q===f||q===_){if(z=!0,J&&q.group){R5(Q,q);return}}}if(!$){if(q!==f&&q!==_)return;if($=!0,f===_)z=!0}if(!q.group||!J)Q.push(q)}),Q}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(_){return this.rowsToDisplay[_]}getFormulaRow(_){return this.formulaRows[_]}isRowPresent(_){return this.rowsToDisplay.indexOf(_)>=0}getRowIndexAtPixel(_){let f=this.rowsToDisplay,$=f.length;if(this.isEmpty()||$===0)return-1;let z=0,Q=$-1;if(_<=0)return 0;if(f[Q].rowTop<=_)return Q;let q=-1,X=-1;while(!0){let Y=Math.floor((z+Q)/2),Z=f[Y];if(this.isRowInPixel(Z,_))return Y;if(Z.rowTop<_)z=Y+1;else if(Z.rowTop>_)Q=Y-1;if(q===z&&X===Q)return Y;q=z,X=Q}}isRowInPixel(_,f){let $=_.rowTop,z=$+_.rowHeight;return $<=f&&z>f}forEachLeafNode(_){let f=this.rootNode?._leafs;if(f)for(let $=0,z=f.length;$$.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(_,f=!1){this.depthFirstSearchRowNodes(_,f,($)=>$.childrenAfterSort)}forEachPivotNode(_,f,$){let{colModel:z,rowGroupColsSvc:Q}=this.beans;if(!z.isPivotMode())return;if(!Q?.columns.length){_(this.rootNode,0);return}let J=$?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(_,f,(q)=>!q.leafGroup?q[J]:null)}depthFirstSearchRowNodes(_,f=!1,$=(J)=>J.childrenAfterGroup,z=this.rootNode,Q=0){let J=Q;if(!z)return J;let q=z===this.rootNode;if(!q)_(z,J++);if(z.hasChildren()&&!z.footer){let X=q||this.hierarchical?$(z):null;if(X){let Y=this.beans.footerSvc;J=Y?.addTotalRows(J,z,_,f,q,"top")??J;for(let Z of X)J=this.depthFirstSearchRowNodes(_,f,$,Z,J);return Y?.addTotalRows(J,z,_,f,q,"bottom")??J}}return J}doAggregate(_){if(this.rootNode)this.beans.aggStage?.execute(_)}doFilterAggregates(_){let f=this.rootNode,$=this.beans.filterAggStage;if($&&this.hierarchical){$.execute(_);return}f.childrenAfterAggFilter=f.childrenAfterFilter;let z=f.sibling;if(z)z.childrenAfterAggFilter=f.childrenAfterFilter}doSort(_,f){let $=this.beans.sortStage;if($){$.execute(_,f);return}R_(this.rootNode,this.hierarchical,_,(z)=>{z.childrenAfterSort=z.childrenAfterAggFilter.slice(0),A5(z)})}doGrouping(_,f){let z=this.beans.groupStage?.execute(f);if(z===void 0){let Q=_._leafs;_.childrenAfterGroup=Q,_.updateHasChildren();let J=_.sibling;if(J)J.childrenAfterGroup=Q}if(z||f.rowDataUpdated)this.beans.colFilter?.refreshModel();if(!this.rowCountReady&&this.rowNodesCountReady)this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"})}doFilter(_){let f=this.beans.filterStage;if(f){f.execute(_);return}R_(this.rootNode,this.hierarchical,_,($)=>{$.childrenAfterFilter=$.childrenAfterGroup,i6($)})}doPivot(_){return this.beans.pivotStage?.execute(_)??!1}getRowNode(_){let f=this.nodeManager?.getRowNode(_);if(typeof f==="object")return f;return this.beans.groupStage?.getNonLeaf(_)}batchUpdateRowData(_,f){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];let $=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),$)}this.asyncTransactions.push({rowDataTransaction:_,callback:f})}flushAsyncTransactions(){let _=this.asyncTransactionsTimer;if(_)clearTimeout(_),this.executeBatchUpdateRowData()}executeBatchUpdateRowData(){let{nodeManager:_,beans:f,eventSvc:$,asyncTransactions:z}=this;if(!_)return;f.valueCache?.onDataChanged();let Q=[],J=[],q=new R1,X=!this.gos.get("suppressAnimationFrame");for(let{rowDataTransaction:Y,callback:Z}of z??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;let G=_.updateRowData(Y,q,X);if(Q.push(G),Z)J.push(Z.bind(null,G))}if(this.commitTransactions(q,X),J.length>0)setTimeout(()=>{for(let Y=0,Z=J.length;Y0)$.dispatchEvent({type:"asyncTransactionsFlushed",results:Q});this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(_){let f=this.nodeManager;if(!f)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;let $=new R1,z=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;let Q=f.updateRowData(_,$,z);return this.commitTransactions($,z),Q}commitTransactions(_,f){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:f,changedRowNodes:_})}doRowsToDisplay(){let{rootNode:_,beans:f}=this;if(f.formula?.active){let Q=_?.childrenAfterSort??[];this.formulaRows=Q,this.rowsToDisplay=Q.filter((J)=>!J.softFiltered);for(let J of this.rowsToDisplay)J.setUiLevel(0);return}let $=f.flattenStage;if($){this.rowsToDisplay=$.execute();return}let z=this.rootNode.childrenAfterSort??[];for(let Q of z)Q.setUiLevel(0);this.rowsToDisplay=z}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){let _=this.rootNode;if(!_)return;let f=this.resetRowHeightsForAllRowNodes();_.setRowHeight(_.rowHeight,!0);let $=_.sibling;if($?.setRowHeight($.rowHeight,!0),f)this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let _=!1;return this.forEachNode((f)=>{f.setRowHeight(f.rowHeight,!0);let $=f.detailNode;$?.setRowHeight($.rowHeight,!0);let z=f.sibling;z?.setRowHeight(z.rowHeight,!0),_=!0}),_}onGridStylesChanges(_){if(_.rowHeightChanged&&!this.beans.rowAutoHeight?.active)this.resetRowHeights()}onGridReady(){if(!this.started)this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},R5=(_,f)=>{let $=f.childrenAfterGroup;if($)for(let z=0,Q=$.length;zthis.onFirstDataRendered(f)});let Q=_.get("rowData");$=Q!=null&&Q.length>0&&o(_)}if($)this.beans.colDelayRenderSvc?.hideColumns(z)}}autoSizeCols(_){let{eventSvc:f,visibleCols:$,colModel:z}=this.beans;t1(this.beans,!0),this.innerAutoSizeCols(_).then((Q)=>{let J=(G)=>P1(f,Array.from(G),!0,"autosizeColumns");if(!_.scaleUpToFitGridWidth)return t1(this.beans,!1),J(Q);let q=C9(this.beans),X=(G)=>$.leftCols.some((E)=>b0(E,G)),Y=(G)=>$.rightCols.some((E)=>b0(E,G)),Z=_.colKeys.filter((G)=>{return!z.getCol(G)?.getColDef().suppressAutoSize&&!I_(G)&&!X(G)&&!Y(G)});this.sizeColumnsToFit(q,_.source,!0,{defaultMaxWidth:_.defaultMaxWidth,defaultMinWidth:_.defaultMinWidth,columnLimits:_.columnLimits?.map((G)=>({...G,key:G.colId})),colKeys:Z,onlyScaleUp:!0,animate:!1}),t1(this.beans,!1),J(Q)})}innerAutoSizeCols(_){return new Promise((f,$)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(_).then(f,$));let{colKeys:z,skipHeader:Q,skipHeaderGroups:J,stopAtGroup:q,defaultMaxWidth:X,defaultMinWidth:Y,columnLimits:Z=[],source:G="api"}=_,{animationFrameSvc:E,renderStatus:U,colModel:H,autoWidthCalc:W,visibleCols:B}=this.beans;if(E?.flushAllFrames(),this.timesDelayed<5&&U&&(!U.areHeaderCellsRendered()||!U.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{if(this.isAlive())this.innerAutoSizeCols(_).then(f,$)});return}this.timesDelayed=0;let K=new Set,L=-1,F=Object.fromEntries(Z.map(({colId:k,...R})=>[k,R])),D=Q??this.gos.get("skipHeaderOnAutoSize"),M=J??D;while(L!==0){L=0;let k=[];for(let R of z){if(!R||k$(R))continue;let O=H.getCol(R);if(!O||K.has(O)||O.getColDef().suppressAutoSize)continue;let I=W.getPreferredWidthForColumn(O,D);if(I>0){let T=F[O.colId]??{};T.minWidth??(T.minWidth=Y),T.maxWidth??(T.maxWidth=X);let y=QK(O,I,T);O.setActualWidth(y,G),K.add(O),L++}k.push(O)}if(k.length)B.refresh(G)}if(!M)this.autoSizeColumnGroupsByColumns(z,G,q);f(K)})}autoSizeColumn(_,f,$){this.autoSizeCols({colKeys:[_],skipHeader:$,skipHeaderGroups:!0,source:f})}autoSizeColumnGroupsByColumns(_,f,$){let{colModel:z,ctrlsSvc:Q}=this.beans,J=new Set,q=z.getColsForKeys(_);for(let Y of q){let Z=Y.getParent();while(Z&&Z!=$){if(!Z.isPadding())J.add(Z);Z=Z.getParent()}}let X;for(let Y of J){for(let Z of Q.getHeaderRowContainerCtrls())if(X=Z.getHeaderCtrlForColumn(Y),X)break;X?.resizeLeafColumnsToFit(f)}}autoSizeAllColumns(_){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(_));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,..._})}addColumnAutosizeListeners(_,f){let $=this.gos.get("skipHeaderOnAutoSize"),z=()=>{this.autoSizeColumn(f,"uiColumnResized",$)};_.addEventListener("dblclick",z);let Q=new u_(_);return Q.addEventListener("doubleTap",z),()=>{_.removeEventListener("dblclick",z),Q.destroy()}}addColumnGroupResize(_,f,$){let z=this.gos.get("skipHeaderOnAutoSize"),Q=()=>{let J=[],q=f.getDisplayedLeafColumns();for(let X of q)if(!X.getColDef().suppressAutoSize)J.push(X.getColId());if(J.length>0)this.autoSizeCols({colKeys:J,skipHeader:z,stopAtGroup:f,source:"uiColumnResized"});$()};return _.addEventListener("dblclick",Q),()=>_.removeEventListener("dblclick",Q)}sizeColumnsToFitGridBody(_,f){if(!this.isAlive())return;let $=C9(this.beans);if($>0){this.sizeColumnsToFit($,"sizeColumnsToFit",!1,_);return}if(f===void 0)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(_,100)},0);else if(f===100)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(_,500)},100);else if(f===500)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(_,-1)},500);else j(29)}sizeColumnsToFit(_,f="sizeColumnsToFit",$,z){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(_,f,$,z));return}let{beans:Q}=this,J=z?.animate??!0;if(J)t1(Q,!0);let q={};for(let{key:L,...F}of z?.columnLimits??[])q[typeof L==="string"?L:L.getColId()]=F;let X=Q.visibleCols.allCols;if(_<=0||!X.length)return;let Y=m0(X);if(z?.onlyScaleUp&&Y>_)return;if(_===Y){if(X.every((F)=>{if(F.colDef.suppressSizeToFit)return!0;let D=q?.[F.getId()],M=D?.minWidth??z?.defaultMinWidth,k=D?.maxWidth??z?.defaultMaxWidth,R=F.getActualWidth();return(M==null||R>=M)&&(k==null||R<=k)}))return}let G=[],E=[];for(let L of X){let F=z?.colKeys?.some((D)=>b0(L,D))??!0;if(L.getColDef().suppressSizeToFit||!F)E.push(L);else G.push(L)}let U=G.slice(0),H=!1,W=(L)=>{Q_(G,L),E.push(L)},B={};for(let L of G){if(z?.onlyScaleUp)B[L.getColId()]=L.getActualWidth();L.resetActualWidth(f);let F=q?.[L.getId()],D=F?.minWidth??z?.defaultMinWidth??-1/0,M=F?.maxWidth??z?.defaultMaxWidth??1/0,k=L.getActualWidth(),R=Math.max(Math.min(k,M),D);if(R!=k)L.setActualWidth(R,f,!0)}while(!H){H=!0;let L=_-m0(E);if(L<=0)for(let F of G){let D=q?.[F.getId()]?.minWidth??z?.defaultMinWidth??F.minWidth;F.setActualWidth(D,f,!0)}else{let F=L/m0(G),D=L;for(let M=G.length-1;M>=0;M--){let k=G[M],R=k.getColId(),O=B[R],I=q?.[R],T=I?.minWidth??z?.defaultMinWidth??O,y=I?.maxWidth??z?.defaultMaxWidth,i=Math.max(T??-1/0,k.getMinWidth()),x=Math.min(y??1/0,k.getMaxWidth()),a=Math.round(k.getActualWidth()*F);if(ax)a=x,W(k),H=!1;else if(M===0)a=D;k.setActualWidth(a,f,!0),D-=a}}}for(let L of U)L.fireColumnWidthChangedEvent(f);let K=Q.visibleCols;if(K.setLeftValues(f),K.updateBodyWidths(),$)return;if(P1(this.eventSvc,U,!0,f),J)t1(Q,!1)}applyAutosizeStrategy(){let{gos:_,colDelayRenderSvc:f}=this.beans,$=_.get("autoSizeStrategy");if($?.type!=="fitGridWidth"&&$?.type!=="fitProvidedWidth")return;setTimeout(()=>{if(!this.isAlive())return;let z=$.type;if(z==="fitGridWidth"){let{columnLimits:Q,defaultMinWidth:J,defaultMaxWidth:q}=$,X=Q?.map(({colId:Y,minWidth:Z,maxWidth:G})=>({key:Y,minWidth:Z,maxWidth:G}));this.sizeColumnsToFitGridBody({defaultMinWidth:J,defaultMaxWidth:q,columnLimits:X})}else if(z==="fitProvidedWidth")this.sizeColumnsToFit($.width,"sizeColumnsToFit");f?.revealColumns(z)})}onFirstDataRendered({colIds:_,...f}){setTimeout(()=>{if(!this.isAlive())return;let $="autosizeColumns";if(_)this.autoSizeCols({...f,source:$,colKeys:_});else this.autoSizeAllColumns({...f,source:$});this.beans.colDelayRenderSvc?.revealColumns(f.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(let _ of this.resizeOperationQueue)_();this.resizeOperationQueue=[]}pushResizeOperation(_){this.resizeOperationQueue.push(_)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function QK(_,f,$={}){let z=$.minWidth??_.getMinWidth();if(fQ)f=Q;return f}function C9({ctrlsSvc:_,scrollVisibleSvc:f}){let $=_.getGridBodyCtrl(),Q=$.isVerticalScrollShowing()?f.getScrollbarWidth():0;return df($.eGridBody)-Q}var w9="ag-animate-autosize";function t1({ctrlsSvc:_,gos:f},$){if(!f.get("animateColumnResizing")||f.get("enableRtl")||!_.isAlive())return;let z=_.getGridBodyCtrl().eGridBody.classList;if($)z.add(w9);else z.remove(w9)}var O5={moduleName:"ColumnAutoSize",version:c,beans:[zK],apiFunctions:{sizeColumnsToFit:fK,autoSizeColumns:V5,autoSizeAllColumns:$K},dependsOn:[uX],css:[_K]};var JK=class extends A{constructor(){super(...arguments);this.beanName="gridSerializer"}wireBeans(_){this.visibleCols=_.visibleCols,this.colModel=_.colModel,this.rowModel=_.rowModel,this.pinnedRowModel=_.pinnedRowModel}serialize(_,f={}){let{allColumns:$,columnKeys:z,skipRowGroups:Q,exportRowNumbers:J}=f,q=this.getColumnsToExport({allColumns:$,skipRowGroups:Q,columnKeys:z,exportRowNumbers:J});return[this.prepareSession(q),this.prependContent(f),this.exportColumnGroups(f,q),this.exportHeaders(f,q),this.processPinnedTopRows(f,q),this.processRows(f,q),this.processPinnedBottomRows(f,q),this.appendContent(f)].reduce((X,Y)=>Y(X),_).parse()}processRow(_,f,$,z){let Q=f.shouldRowBeSkipped||(()=>!1),q=f.rowPositions!=null||!!f.onlySelected,X=this.gos.get("groupHideOpenParents")&&!q,Y=this.colModel.isPivotMode()?z.leafGroup:!z.group,Z=!!z.footer,G=z.allChildrenCount===1&&z.childrenAfterGroup?.length===1&&Z7(this.gos,z);if(!Y&&!Z&&(f.skipRowGroups||G||X)||f.onlySelected&&!z.isSelected()||f.skipPinnedTop&&z.rowPinned==="top"||f.skipPinnedBottom&&z.rowPinned==="bottom"||z.stub)return;if(z.level===-1&&!Y&&!Z)return;if(Q(C(this.gos,{node:z})))return;let H=_.onNewBodyRow(z);if($.forEach((W,B)=>{H.onColumn(W,B,z)}),f.getCustomContentBelowRow){let W=f.getCustomContentBelowRow(C(this.gos,{node:z}));if(W)_.addCustomContent(W)}}appendContent(_){return(f)=>{let $=_.appendContent;if($)f.addCustomContent($);return f}}prependContent(_){return(f)=>{let $=_.prependContent;if($)f.addCustomContent($);return f}}prepareSession(_){return(f)=>{return f.prepare(_),f}}exportColumnGroups(_,f){return($)=>{if(!_.skipColumnGroupHeaders){let z=new pX,{colGroupSvc:Q}=this.beans,J=Q?Q.createColumnGroups({columns:f,idCreator:z,pinned:null,isStandaloneStructure:!0}):f;this.recursivelyAddHeaderGroups(J,$,_.processGroupHeaderCallback)}return $}}exportHeaders(_,f){return($)=>{if(!_.skipColumnHeaders){let z=$.onNewHeaderRow();f.forEach((Q,J)=>{z.onColumn(Q,J,void 0)})}return $}}processPinnedTopRows(_,f){return($)=>{let z=this.processRow.bind(this,$,_,f);if(_.rowPositions)_.rowPositions.filter((Q)=>Q.rowPinned==="top").sort((Q,J)=>Q.rowIndex-J.rowIndex).map((Q)=>this.pinnedRowModel?.getPinnedTopRow(Q.rowIndex)).forEach(z);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("top",z);return $}}processRows(_,f){return($)=>{let z=this.rowModel,Q=o(this.gos,z),J=Kf(this.gos,z),q=!Q&&_.onlySelected,X=this.processRow.bind(this,$,_,f),{exportedRows:Y="filteredAndSorted"}=_;if(_.rowPositions)_.rowPositions.filter((Z)=>Z.rowPinned==null).sort((Z,G)=>Z.rowIndex-G.rowIndex).map((Z)=>z.getRow(Z.rowIndex)).forEach(X);else if(this.colModel.isPivotMode())if(Q)z.forEachPivotNode(X,!0,Y==="filteredAndSorted");else if(J)z.forEachNodeAfterFilterAndSort(X,!0);else z.forEachNode(X);else if(_.onlySelectedAllPages||q){let Z=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(Z),Z.forEach(X)}else if(Y==="all")z.forEachNode(X);else if(Q||J)z.forEachNodeAfterFilterAndSort(X,!0);else z.forEachNode(X);return $}}replicateSortedOrder(_){let{sortSvc:f,rowNodeSorter:$}=this.beans;if(!f||!$)return;let z=f.getSortOptions(),Q=(J,q)=>{if(J.rowIndex!=null&&q.rowIndex!=null)return J.rowIndex-q.rowIndex;if(J.level===q.level){if(J.parent?.id===q.parent?.id)return $.compareRowNodes(z,J,q)||(J.rowIndex??-1)-(q.rowIndex??-1);return Q(J.parent,q.parent)}if(J.level>q.level)return Q(J.parent,q);return Q(J,q.parent)};_.sort(Q)}processPinnedBottomRows(_,f){return($)=>{let z=this.processRow.bind(this,$,_,f);if(_.rowPositions)_.rowPositions.filter((Q)=>Q.rowPinned==="bottom").sort((Q,J)=>Q.rowIndex-J.rowIndex).map((Q)=>this.pinnedRowModel?.getPinnedBottomRow(Q.rowIndex)).forEach(z);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("bottom",z);return $}}getColumnsToExport(_){let{allColumns:f=!1,skipRowGroups:$=!1,exportRowNumbers:z=!1,columnKeys:Q}=_,{colModel:J,gos:q,visibleCols:X}=this,Y=J.isPivotMode(),Z=(U)=>{if(x0(U))return!1;return!I_(U)||z};if(Q?.length)return J.getColsForKeys(Q).filter(Z);let G=q.get("treeData"),E=[];if(f&&!Y)E=J.getCols();else E=X.allCols;return E=E.filter((U)=>Z(U)&&($&&!G?!of(U):!0)),E}recursivelyAddHeaderGroups(_,f,$){let z=[];for(let Q of _){let J=Q;if(!J.getChildren)continue;for(let q of J.getChildren()??[])z.push(q)}if(_.length>0&&G_(_[0]))this.doAddHeaderHeader(f,_,$);if(z&&z.length>0)this.recursivelyAddHeaderGroups(z,f,$)}doAddHeaderHeader(_,f,$){let z=_.onNewHeaderGroupingRow(),Q=0;for(let J of f){let q=J,X;if($)X=$(C(this.gos,{columnGroup:q}));else X=this.beans.colNames.getDisplayNameForColumnGroup(q,"header");let Z=(q.isExpandable()?q.getLeafColumns():[]).reduce((G,E,U,H)=>{let W=b(G);if(E.getColumnGroupShow()!=="open"){if(W&&W[1]==null)W[1]=U-1}else if(!W||W[1]!=null)W=[U],G.push(W);if(U===H.length-1&&W&&W[1]==null)W[1]=U;return G},[]);z.onColumn(q,X||"",Q++,q.getLeafColumns().length-1,Z)}}},dJ={moduleName:"SharedExport",version:c,beans:[JK]},tJ=class extends A{getFileName(_){let f=this.getDefaultFileExtension();if(!_?.length)_=this.getDefaultFileName();return _.includes(".")?_:`${_}.${f}`}getData(_){return this.beans.gridSerializer.serialize(this.createSerializingSession(_),_)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}};function GQ(_,f){let $=document.defaultView||window;if(!$){j(52);return}let z=document.createElement("a"),Q=$.URL.createObjectURL(f);z.setAttribute("href",Q),z.setAttribute("download",_),z.style.display="none",document.body.appendChild(z),z.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:$})),z.remove(),$.setTimeout(()=>{$.URL.revokeObjectURL(Q)},0)}var rJ=class{constructor(_){this.valueFrom="data";let{colModel:f,rowGroupColsSvc:$,colNames:z,valueSvc:Q,gos:J,processCellCallback:q,processHeaderCallback:X,processGroupHeaderCallback:Y,processRowGroupCallback:Z,valueFrom:G}=_;if(this.colModel=f,this.rowGroupColsSvc=$,this.colNames=z,this.valueSvc=Q,this.gos=J,this.processCellCallback=q,this.processHeaderCallback=X,this.processGroupHeaderCallback=Y,this.processRowGroupCallback=Z,G)this.valueFrom=G}prepare(_){}extractHeaderValue(_){return this.getHeaderName(this.processHeaderCallback,_)??""}extractRowCellValue(_){let{column:f,node:$,currentColumnIndex:z,accumulatedRowIndex:Q,type:J,useRawFormula:q}=_,X=z===0&&Iq(this.gos,$,this.colModel.isPivotMode());if(this.processRowGroupCallback&&(this.gos.get("treeData")||$.group)&&(f.isRowGroupDisplayed($.rowGroupColumn?.getColId()??"")||X))return{value:this.processRowGroupCallback(C(this.gos,{column:f,node:$}))??""};if(this.processCellCallback)return{value:this.processCellCallback(C(this.gos,{accumulatedRowIndex:Q,column:f,node:$,value:this.valueSvc.getValueForDisplay({column:f,node:$,from:this.valueFrom}).value,type:J,parseValue:(W)=>this.valueSvc.parseValue(f,$,W,this.valueSvc.getValue(f,$,this.valueFrom)),formatValue:(W)=>this.valueSvc.formatValue(f,$,W)??W}))??""};let Y=this.gos.get("treeData"),Z=this.valueSvc,G=$.level===-1&&$.footer,E=f.colDef.showRowGroup===!0&&($.group||Y);if(!G&&(X||E)){let W="",B=$;while(B&&B.level!==-1){let{value:K,valueFormatted:L}=Z.getValueForDisplay({column:X?void 0:f,node:B,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});W=` -> ${L??K??""}${W}`,B=B.parent}return{value:W,valueFormatted:W}}let{value:U,valueFormatted:H}=Z.getValueForDisplay({column:f,node:$,includeValueFormatted:!0,exporting:!0,useRawFormula:q,from:this.valueFrom});return{value:U??"",valueFormatted:H}}getHeaderName(_,f){if(_)return _(C(this.gos,{column:f}));return this.colNames.getDisplayNameForColumn(f,"csv",!0)}},x9=`\r -`,qK=class extends rJ{constructor(_){super(_);this.config=_,this.isFirstLine=!0,this.result="";let{suppressQuotes:f,columnSeparator:$}=_;this.suppressQuotes=f,this.columnSeparator=$}addCustomContent(_){if(!_)return;if(typeof _==="string"){if(!/^\s*\n/.test(_))this.beginNewLine();_=_.replace(/\r?\n/g,x9),this.result+=_}else _.forEach((f)=>{this.beginNewLine(),f.forEach(($,z)=>{if(z!==0)this.result+=this.columnSeparator;if(this.result+=this.putInQuotes($.data.value||""),$.mergeAcross)this.appendEmptyCells($.mergeAcross)})})}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(_,f,$,z){if($!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(f),this.appendEmptyCells(z)}appendEmptyCells(_){for(let f=1;f<=_;f++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(_,f){if(f!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(this.extractHeaderValue(_))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(_,f,$){if(f!=0)this.result+=this.columnSeparator;let z=this.extractRowCellValue({column:_,node:$,currentColumnIndex:f,accumulatedRowIndex:f,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(z.valueFormatted??z.value)}putInQuotes(_){if(this.suppressQuotes)return _;if(_===null||_===void 0)return'""';let f;if(typeof _==="string")f=_;else if(typeof _.toString==="function")f=_.toString();else j(53),f="";return'"'+f.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){if(!this.isFirstLine)this.result+=x9;this.isFirstLine=!1}},XK=class extends tJ{constructor(){super(...arguments);this.beanName="csvCreator"}getMergedParams(_){let f=this.gos.get("defaultCsvExportParams");return Object.assign({},f,_)}export(_){if(this.isExportSuppressed()){j(51);return}let f=()=>{let z=this.getMergedParams(_),Q=this.getData(z),J=new Blob(["\uFEFF",Q],{type:"text/plain"}),q=z.fileName,X=typeof q==="function"?q(C(this.gos,{})):q;GQ(this.getFileName(X),J)},{overlays:$}=this.beans;if($)$.showExportOverlay(f);else f()}exportDataAsCsv(_){this.export(_)}getDataAsCsv(_,f=!1){let $=f?Object.assign({},_):this.getMergedParams(_);return this.getData($)}getDefaultFileExtension(){return"csv"}createSerializingSession(_){let{colModel:f,colNames:$,rowGroupColsSvc:z,valueSvc:Q,gos:J}=this.beans,{processCellCallback:q,processHeaderCallback:X,processGroupHeaderCallback:Y,processRowGroupCallback:Z,suppressQuotes:G,columnSeparator:E,valueFrom:U}=_;return new qK({colModel:f,colNames:$,valueSvc:Q,gos:J,processCellCallback:q||void 0,processHeaderCallback:X||void 0,processGroupHeaderCallback:Y||void 0,processRowGroupCallback:Z||void 0,suppressQuotes:G||!1,columnSeparator:E||",",rowGroupColsSvc:z,valueFrom:U})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function YK(_,f){return _.csvCreator?.getDataAsCsv(f)}function ZK(_,f){_.csvCreator?.exportDataAsCsv(f)}var P5={moduleName:"CsvExport",version:c,beans:[XK],apiFunctions:{getDataAsCsv:YK,exportDataAsCsv:ZK},dependsOn:[dJ]},v5=class extends j_{constructor(_,f){super();if(this.ctrl=_,f)this.beans=f}postConstruct(){this.refreshTooltip()}setBrowserTooltip(_,f){let z=this.ctrl.getGui();if(!z)return;if(_!=null&&(_!=""||f))z.setAttribute("title",_);else z.removeAttribute("title")}updateTooltipText(){let{getTooltipValue:_}=this.ctrl;if(_)this.tooltip=_()}createTooltipFeatureIfNeeded(){if(this.tooltipManager==null){let _=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);if(_)this.tooltipManager=this.createBean(_,this.beans.context)}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(_){this.tooltip=_,this.refreshTooltip()}refreshTooltip(_){if(this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips)this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context);else this.setBrowserTooltip(_?"":null,_),this.createTooltipFeatureIfNeeded()}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},GK=1000,EK=1000,N9=100,g9,Qz=!1,UK=class extends j_{constructor(_,f){super();this.tooltipCtrl=_,this.getTooltipValue=f,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(_){this.popupSvc=_.popupSvc}postConstruct(){if(this.gos.get("tooltipInteraction"))this.interactionEnabled=!0;this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");let _=this.tooltipCtrl.getGui();if(this.tooltipTrigger===0)this.addManagedListeners(_,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)});if(this.tooltipTrigger===1)this.addManagedListeners(_,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)});if(this.addManagedListeners(_,{mousemove:this.onMouseMove.bind(this)}),!this.interactionEnabled)this.addManagedListeners(_,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(_){let f=this.gos.get(_);return Math.max(200,f)}getTooltipDelay(_){return this.tooltipCtrl[`getTooltip${_}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${_}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){let _=this.gos.get("tooltipTrigger");if(!_||_==="hover")return 0;return 1}onMouseEnter(_){if(this.interactionEnabled&&this.interactiveTooltipTimeoutId)this.unlockService(),this.startHideTimeout();if(pf())return;if(Qz)this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(_)},N9);else this.prepareToShowTooltip(_)}onMouseMove(_){if(this.lastMouseEvent)this.lastMouseEvent=_;if(this.tooltipMouseTrack&&this.state===2&&this.tooltipComp)this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){if(this.interactionEnabled)this.lockService();else this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(_){let f=_.relatedTarget,$=this.tooltipCtrl.getGui(),z=this.tooltipComp?.getGui();if(this.isInteractingWithTooltip||$.contains(f)||this.interactionEnabled&&z?.contains(f))return;this.setToDoNothing()}onKeyDown(){if(this.isInteractingWithTooltip)this.isInteractingWithTooltip=!1;this.setToDoNothing()}prepareToShowTooltip(_){if(this.state!=0||Qz)return;let f=0;if(_)f=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show");this.lastMouseEvent=_||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),f),this.state=1}isLastTooltipHiddenRecently(){return Date.now()-g9this.hideTooltip(!0),...f.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;let z=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp($,z)}hideTooltip(_){if(!_&&this.isInteractingWithTooltip)return;if(this.tooltipComp)this.destroyTooltipComp(),g9=Date.now();if(this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),_)this.isInteractingWithTooltip=!1;this.setToDoNothing(!0)}newTooltipComponentCallback(_,f){if(this.state!==2||this.tooltipInstanceCount!==_){this.destroyBean(f);return}let z=f.getGui();if(this.tooltipComp=f,!z.classList.contains("ag-tooltip"))z.classList.add("ag-tooltip-custom");if(this.tooltipTrigger===0)z.classList.add("ag-tooltip-animate");if(this.interactionEnabled)z.classList.add("ag-tooltip-interactive");let Q=this.getLocaleTextFunc(),J=this.popupSvc?.addPopup({eChild:z,ariaLabel:Q("ariaLabelTooltip","Tooltip")});if(J)this.tooltipPopupDestroyFunc=J.hideFunc;if(this.positionTooltip(),this.tooltipTrigger===1){let q=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:q}),this.setEventHandlers(q)}if(this.interactionEnabled){if([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(z,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(q_(this.beans),{keydown:(q)=>{if(!z.contains(q?.target))this.onKeyDown()}}),this.tooltipTrigger===1)[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(z,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)})}this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:z,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){if(this.isTooltipFocused())return;this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){let _=this.tooltipComp?.getGui(),f=d(this.beans);return!!_&&_.contains(f)}onTooltipFocusOut(_){let f=this.tooltipCtrl.getGui();if(this.isTooltipFocused())return;if(this.isInteractingWithTooltip=!1,f.contains(_.relatedTarget))this.startHideTimeout();else this.hideTooltip()}positionTooltip(){let _={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};if(this.lastMouseEvent)this.popupSvc?.positionPopupUnderMouseEvent({..._,mouseEvent:this.lastMouseEvent});else this.popupSvc?.positionPopupByComponent({..._,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");let _=this.tooltipPopupDestroyFunc,f=this.tooltipComp,$=this.tooltipTrigger===0?EK:0;window.setTimeout(()=>{_(),this.destroyBean(f)},$),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(let _ of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])if(_)_();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Qz=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},N9)}unlockService(){Qz=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){if(!this.showTooltipTimeoutId)return;window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0}clearHideTimeout(){if(!this.hideTooltipTimeoutId)return;window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0}clearInteractiveTimeout(){if(!this.interactiveTooltipTimeoutId)return;window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}},HK=class extends v5{constructor(_,f,$){super(_,$);this.highlightTracker=f,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",({currentValue:_})=>{this.setTooltipMode(_)}),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(_){if(this.tooltipMode!==1)return;if(_.highlighted)this.attemptToShowTooltip();else this.attemptToHideTooltip()}setTooltipMode(_="focus"){this.tooltipMode=_==="focus"?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},WK=class extends FJ{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(_){let{value:f}=_,$=this.getGui();$.textContent=L$(f);let z=_.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();$.classList.add(`ag-${z}-tooltip`)}},BK=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",Jz=0,KK=200,LK=class extends j_{constructor(){super(...arguments);this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){let _=this.gos.get("popupParent");if(_)return _;return this.getDefaultPopupParent()}positionPopupUnderMouseEvent(_){let{ePopup:f,nudgeX:$,nudgeY:z,skipObserver:Q}=_;this.positionPopup({ePopup:f,nudgeX:$,nudgeY:z,keepWithinBounds:!0,skipObserver:Q,updatePosition:()=>this.calculatePointerAlign(_.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(_.additionalParams,_.type,_.ePopup,null,_.mouseEvent)})}calculatePointerAlign(_){let f=this.getParentRect();return{x:_.clientX-f.left,y:_.clientY-f.top}}positionPopupByComponent(_){let{ePopup:f,nudgeX:$,nudgeY:z,keepWithinBounds:Q,eventSource:J,alignSide:q="left",position:X="over",type:Y}=_,Z=J.getBoundingClientRect(),G=this.getParentRect();this.setAlignedTo(J,f);let E=()=>{let U=Z.left-G.left;if(q==="right")U-=f.offsetWidth-Z.width;let H;if(X==="over")H=Z.top-G.top,this.setAlignedStyles(f,"over");else if(this.setAlignedStyles(f,"under"),this.shouldRenderUnderOrAbove(f,Z,G,_.nudgeY||0)==="under")H=Z.top-G.top+Z.height;else H=Z.top-f.offsetHeight-(z||0)*2-G.top;return{x:U,y:H}};this.positionPopup({ePopup:f,nudgeX:$,nudgeY:z,keepWithinBounds:Q,updatePosition:E,postProcessCallback:()=>this.callPostProcessPopup(_.additionalParams,Y,f,J,null)})}positionPopupForMenu(_){let{eventSource:f,ePopup:$,event:z}=_,Q=f.getBoundingClientRect(),J=this.getParentRect();this.setAlignedTo(f,$);let q=!1,X=()=>{let Y=this.keepXYWithinBounds($,Q.top-J.top,0),Z=$.clientWidth>0?$.clientWidth:200;if(!q)$.style.minWidth=`${Z}px`,q=!0;let E=J.right-J.left-Z,U;if(this.gos.get("enableRtl")){if(U=W(),U<0)U=H(),this.setAlignedStyles($,"left");if(U>E)U=0,this.setAlignedStyles($,"right")}else{if(U=H(),U>E)U=W(),this.setAlignedStyles($,"right");if(U<0)U=0,this.setAlignedStyles($,"left")}return{x:U,y:Y};function H(){return Q.right-J.left-2}function W(){return Q.left-J.left-Z}};this.positionPopup({ePopup:$,keepWithinBounds:!0,updatePosition:X,postProcessCallback:()=>this.callPostProcessPopup(_.additionalParams,"subMenu",$,f,z instanceof MouseEvent?z:void 0)})}shouldRenderUnderOrAbove(_,f,$,z){let Q=$.bottom-f.bottom,J=f.top-$.top,q=_.offsetHeight+z;if(Q>q)return"under";if(J>q||J>Q)return"above";return"under"}setAlignedStyles(_,f){let $=this.getPopupIndex(_);if($===-1)return;let z=this.popupList[$],{alignedToElement:Q}=z;if(!Q)return;let J=["right","left","over","above","under"];for(let q of J)Q.classList.remove(`ag-has-popup-positioned-${q}`),_.classList.remove(`ag-popup-positioned-${q}`);if(!f)return;Q.classList.add(`ag-has-popup-positioned-${f}`),_.classList.add(`ag-popup-positioned-${f}`)}setAlignedTo(_,f){let $=this.getPopupIndex(f);if($!==-1){let z=this.popupList[$];z.alignedToElement=_}}positionPopup(_){let{ePopup:f,keepWithinBounds:$,nudgeX:z,nudgeY:Q,skipObserver:J,updatePosition:q}=_,X={width:0,height:0},Y=(Z=!1)=>{let{x:G,y:E}=q();if(Z&&f.clientWidth===X.width&&f.clientHeight===X.height)return;if(X.width=f.clientWidth,X.height=f.clientHeight,z)G+=z;if(Q)E+=Q;if($)G=this.keepXYWithinBounds(f,G,1),E=this.keepXYWithinBounds(f,E,0);if(f.style.left=`${G}px`,f.style.top=`${E}px`,_.postProcessCallback)_.postProcessCallback()};if(Y(),!J){let Z=S0(this.beans,f,()=>Y(!0));setTimeout(()=>Z(),KK)}}getParentRect(){let _=q_(this.beans),f=this.getPopupParent();if(f===_.body)f=_.documentElement;else if(getComputedStyle(f).position==="static")f=f.offsetParent;return qq(f)}keepXYWithinBounds(_,f,$){let z=$===0,Q=z?"clientHeight":"clientWidth",J=z?"top":"left",q=z?"height":"width",X=z?"scrollTop":"scrollLeft",Y=q_(this.beans),Z=Y.documentElement,G=this.getPopupParent(),E=_.getBoundingClientRect(),U=G.getBoundingClientRect(),H=Y.documentElement.getBoundingClientRect(),W=G===Y.body,B=Math.ceil(E[q]),L=W?(z?Qq:Jq)(Z)+Z[X]:G[Q];if(W)L-=Math.abs(H[J]-U[J]);let F=L-B;return Math.min(Math.max(f,0),Math.max(F,0))}addPopup(_){let{eChild:f,ariaLabel:$,ariaOwns:z,alwaysOnTop:Q,positionCallback:J,anchorToElement:q}=_,X=this.getPopupIndex(f);if(X!==-1)return{hideFunc:this.popupList[X].hideFunc};this.initialisePopupPosition(f);let Y=this.createPopupWrapper(f,!!Q,$,z),Z=this.addEventListenersToPopup({..._,wrapperEl:Y});if(J)J();return this.addPopupToPopupList(f,Y,Z,q),{hideFunc:Z}}initialisePopupPosition(_){let $=this.getPopupParent().getBoundingClientRect();if(!v(_.style.top))_.style.top=`${$.top*-1}px`;if(!v(_.style.left))_.style.left=`${$.left*-1}px`}createPopupWrapper(_,f,$,z){let Q=this.getPopupParent(),{environment:J,gos:q}=this.beans,X=B_({tag:"div"});if(J.applyThemeClasses(X),X.classList.add("ag-popup"),_.classList.add(q.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),!_.hasAttribute("role"))Z_(_,"dialog");if($)W_(_,$);else if(z)_.id||(_.id=`popup-component-${Jz}`),w2(z,_.id);if(X.appendChild(_),Q.appendChild(X),f)this.setAlwaysOnTop(_,!0);else this.bringPopupToFront(_);return X}addEventListenersToPopup(_){let f=this.beans,$=q_(f),{wrapperEl:z,eChild:Q,closedCallback:J,afterGuiAttached:q,closeOnEsc:X,modal:Y,ariaOwns:Z}=_,G=!1,E=(B)=>{if(!z.contains(d(f)))return;if(B.key===S.ESCAPE&&!this.isStopPropagation(B))W({keyboardEvent:B})},U=(B)=>W({mouseEvent:B}),H=(B)=>W({touchEvent:B}),W=(B={})=>{let{mouseEvent:K,touchEvent:L,keyboardEvent:F,forceHide:D}=B;if(!D&&(this.isEventFromCurrentPopup({mouseEvent:K,touchEvent:L},Q)||G))return;if(G=!0,z.remove(),$.removeEventListener("keydown",E),$.removeEventListener("mousedown",U),$.removeEventListener("touchstart",H),$.removeEventListener("contextmenu",U),this.eventSvc.removeListener("dragStarted",U),J)J(K||L||F);this.removePopupFromPopupList(Q,Z)};if(q)q({hidePopup:W});return window.setTimeout(()=>{if(X)$.addEventListener("keydown",E);if(Y)$.addEventListener("mousedown",U),this.eventSvc.addListener("dragStarted",U),$.addEventListener("touchstart",H),$.addEventListener("contextmenu",U)},0),W}addPopupToPopupList(_,f,$,z){if(this.popupList.push({element:_,wrapper:f,hideFunc:$,instanceId:Jz,isAnchored:!!z}),z)this.setPopupPositionRelatedToElement(_,z);Jz=Jz+1}getPopupIndex(_){return this.popupList.findIndex((f)=>f.element===_)}setPopupPositionRelatedToElement(_,f){let $=this.getPopupIndex(_);if($===-1)return;let z=this.popupList[$];if(z.stopAnchoringPromise)z.stopAnchoringPromise.then((J)=>J&&J());if(z.stopAnchoringPromise=void 0,z.isAnchored=!1,!f)return;let Q=this.keepPopupPositionedRelativeTo({element:f,ePopup:_,hidePopup:z.hideFunc});return z.stopAnchoringPromise=Q,z.isAnchored=!0,Q}removePopupFromPopupList(_,f){if(this.setAlignedStyles(_,null),this.setPopupPositionRelatedToElement(_,null),f)w2(f,null);this.popupList=this.popupList.filter(($)=>$.element!==_)}keepPopupPositionedRelativeTo(_){let f=this.getPopupParent(),$=f.getBoundingClientRect(),{element:z,ePopup:Q}=_,J=z.getBoundingClientRect(),q=(E)=>Number.parseInt(E.substring(0,E.length-1),10),X=(E,U)=>{let H=$[E]-J[E],W=q(Q.style[E]);return{initialDiff:H,lastDiff:H,initial:W,last:W,direction:U}},Y=X("top",0),Z=X("left",1),G=this.beans.frameworkOverrides;return new g((E)=>{G.wrapIncoming(()=>{C7(()=>{let U=f.getBoundingClientRect(),H=z.getBoundingClientRect();if(H.top==0&&H.left==0&&H.height==0&&H.width==0){_.hidePopup();return}let B=(K,L)=>{let F=q(Q.style[L]);if(K.last!==F)K.initial=F,K.last=F;let D=U[L]-H[L];if(D!=K.lastDiff){let M=this.keepXYWithinBounds(Q,K.initial+K.initialDiff-D,K.direction);Q.style[L]=`${M}px`,K.last=M}K.lastDiff=D};B(Y,"top"),B(Z,"left")},200).then((U)=>{E(()=>{if(U!=null)window.clearInterval(U)})})},"popupPositioning")})}isEventFromCurrentPopup(_,f){let{mouseEvent:$,touchEvent:z}=_,Q=$?$:z;if(!Q)return!1;let J=this.getPopupIndex(f);if(J===-1)return!1;for(let q=J;q_.element)}hasAnchoredPopup(){return this.popupList.some((_)=>_.isAnchored)}isStopPropagation(_){return z0(_)}},$1={moduleName:"Popup",version:c,beans:[FK]};function yz(_){return _.get("tooltipShowMode")==="whenTruncated"}function EQ(_,f){return yz(_)?Q$(f):void 0}var DK=(_,f)=>{let $=_;if(typeof $.getTranslatedMessage==="function")return $.getTranslatedMessage(f);return _.message},m6=(_,f,$)=>{let{editModelSvc:z}=_,Q=z?.getCellValidationModel()?.getCellValidation(f)?.errorMessages,J=z?.getRowValidationModel().getRowValidation(f)?.errorMessages,q=Q||J;return q?.length?q.join($("tooltipValidationErrorSeparator",". ")):void 0},MK=(_,f)=>{if(!yz(_.gos))return;if(f.isCellRenderer()){let z=f.column.getColDef();if(!(!!z.showRowGroup||z.cellRenderer==="agGroupCellRenderer"))return;return Q$(()=>{let J=f.eGui;return J.querySelector(".ag-group-value")||J.querySelector(".ag-cell-value")||J})}return Q$(()=>{let z=f.eGui;return z.children.length===0?z:z.querySelector(".ag-cell-value")})},kK=(_,f,$)=>{let{editSvc:z}=_,{column:Q}=f,J=MK(_,f),q=()=>{if(z?.isEditing(f))return!1;if(!J)return!0;if(!Q.isTooltipEnabled())return!1;return J()};return{shouldDisplayDefault:q,shouldDisplayColumnTooltip:q,shouldDisplayCustomTooltip:$??q}},SK=({beans:_,ctrl:f,value:$,displayFunctions:z,translate:Q})=>{let{editSvc:J,formula:q,gos:X}=_,{column:Y,rowNode:Z}=f;if(q?.active&&Y.isAllowFormula()){let K=q.getFormulaError(Y,Z);if(K)return{value:DK(K,Q),location:"cellFormula",shouldDisplay:()=>!!q?.getFormulaError(Y,Z)}}if(!J?.isEditing(f)){let K=m6(_,f,Q);if(K)return{value:K,location:"cellEditor",shouldDisplay:()=>!J?.isEditing(f)&&!!m6(_,f,Q)}}let{shouldDisplayCustomTooltip:E,shouldDisplayColumnTooltip:U}=z;if($!=null)return{value:$,location:"cell",shouldDisplay:E};let H=Y.getColDef(),W=Z.data;if(H.tooltipField&&v(W))return{value:e1(W,H.tooltipField,Y.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:U};let B=H.tooltipValueGetter;if(B)return{value:B(C(X,{location:"cell",colDef:Y.getColDef(),column:Y,rowIndex:f.cellPosition.rowIndex,node:Z,data:Z.data,value:f.value,valueFormatted:f.valueFormatted})),location:"cell",shouldDisplay:U};return null},AK=class extends A{constructor(){super(...arguments);this.beanName="tooltipSvc"}setupHeaderTooltip(_,f,$,z){if(_)f.destroyBean(_);let Q=this.gos,J=yz(Q),{column:q,eGui:X}=f,Y=q.getColDef();if(!z&&J&&!Y.headerComponent)z=Q$(()=>X.querySelector(".ag-header-cell-text"));let Z="header",G="header",E=this.beans.colNames.getDisplayNameForColumn(q,G,!0),U=$??E,H={getGui:()=>X,getLocation:()=>Z,getTooltipValue:()=>$??Y?.headerTooltipValueGetter?.(C(Q,{location:Z,colDef:Y,column:q,value:U,valueFormatted:E}))??Y?.headerTooltip,shouldDisplayTooltip:z,getAdditionalParams:()=>({column:q,colDef:q.getColDef()})},W=this.createTooltipFeature(H);if(W)W=f.createBean(W),f.setRefreshFunction("tooltip",()=>W.refreshTooltip());return W}setupHeaderGroupTooltip(_,f,$,z){if(_)f.destroyBean(_);let Q=this.gos,J=yz(Q),{column:q,eGui:X}=f,Y=q.getColGroupDef();if(!z&&J&&!Y?.headerGroupComponent)z=Q$(()=>X.querySelector(".ag-header-group-text"));let Z="headerGroup",G="header",E=this.beans.colNames.getDisplayNameForColumnGroup(q,G),U=$??E,H={getGui:()=>X,getLocation:()=>Z,getTooltipValue:()=>$??Y?.headerTooltipValueGetter?.(C(Q,{location:Z,colDef:Y,column:q,value:U,valueFormatted:E}))??Y?.headerTooltip,shouldDisplayTooltip:z,getAdditionalParams:()=>{let B={column:q};if(Y)B.colDef=Y;return B}},W=this.createTooltipFeature(H);return W?f.createBean(W):W}enableCellTooltipFeature(_,f,$){let{beans:z}=this,{column:Q,rowNode:J}=_,q=kK(z,_,$),X=this.getLocaleTextFunc(),Y=null,Z=()=>{return Y=SK({beans:z,ctrl:_,value:f,displayFunctions:q,translate:X}),Y},E={getGui:()=>_.eGui,getLocation:()=>Y?.location??"cell",getTooltipValue:()=>Z()?.value,shouldDisplayTooltip:()=>{let U=Y??Z();if(!U)return!1;return U.shouldDisplay?U.shouldDisplay():!0},getAdditionalParams:()=>({column:Q,colDef:Q.getColDef(),rowIndex:_.cellPosition.rowIndex,node:J,data:J.data,valueFormatted:_.valueFormatted})};return this.createTooltipFeature(E,z)}setupFullWidthRowTooltip(_,f,$,z){let Q={getGui:()=>f.getFullWidthElement(),getTooltipValue:()=>$,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:z},J=this.beans,q=J.context;if(_)f.destroyBean(_,q);let X=this.createTooltipFeature(Q,J);if(!X)return;return f.createBean(X,q)}setupCellEditorTooltip(_,f){let{beans:$}=this,{context:z}=$,Q=f.getValidationElement?.(!0)||!f.isPopup?.()&&_.eGui;if(!Q)return;let J={getGui:()=>Q,getTooltipValue:()=>m6($,_,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{let{editModelSvc:X}=$,Y=X?.getRowValidationModel()?.getRowValidationMap(),Z=X?.getCellValidationModel()?.getCellValidationMap(),G=!!Y&&Y.size>0,E=!!Z&&Z.size>0;return G||E}},q=this.createTooltipFeature(J,$);if(!q)return;return _.createBean(q,z)}initCol(_){let{colDef:f}=_;_.tooltipEnabled=v(f.tooltipField)||v(f.tooltipValueGetter)||v(f.tooltipComponent)}createTooltipFeature(_,f){return this.beans.registry.createDynamicBean("tooltipFeature",!1,_,f)}},RK=class extends UK{createTooltipComp(_,f){Y8(this.beans.userCompFactory,_)?.newAgStackInstance().then(f)}setEventHandlers(_){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:_})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},jK={moduleName:"Tooltip",version:c,beans:[AK],dynamicBeans:{tooltipFeature:v5,highlightTooltipFeature:HK,tooltipStateManager:RK},userComponents:{agTooltipComponent:WK},dependsOn:[$1],css:[BK]};var VK=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}";var OK=class extends rX{constructor(_,f="ag-text-field",$="text"){super(_,f,$)}postConstruct(){if(super.postConstruct(),this.config.allowedCharPattern)this.preventDisallowedCharacters()}setValue(_,f){let $=this.eInput;if($.value!==_)$.value=v(_)?_:"";return super.setValue(_,f)}setStartValue(_){this.setValue(_,!0)}setCustomValidity(_){let f=this.eInput,$=_.length>0;if(f.setCustomValidity(_),$)f.reportValidity();l9(f,$)}preventDisallowedCharacters(){let _=new RegExp(`[${this.config.allowedCharPattern}]`),f=($)=>{if(!AX($))return;if($.key&&!_.test($.key))$.preventDefault()};this.addManagedListeners(this.eInput,{keydown:f,paste:($)=>{if($.clipboardData?.getData("text")?.split("").some((Q)=>!_.test(Q)))$.preventDefault()}})}},lJ={selector:"AG-INPUT-TEXT-FIELD",component:OK};var PK=class extends F8{constructor(_){super();this.cellEditorInput=_,this.eEditor=V}initialiseEditor(_){let{cellEditorInput:f}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[f.getTemplate()]},f.getAgComponents());let{eEditor:$}=this,{cellStartedEdit:z,eventKey:Q,suppressPreventDefault:J}=_;$.getInputElement().setAttribute("title",""),f.init($,_);let q,X=!0;if(z){if(this.focusAfterAttached=!0,Q===S.BACKSPACE||Q===S.DELETE)q="";else if(Q&&Q.length===1)if(J)X=!1;else q=Q;else if(q=f.getStartValue(),Q!==S.F2)this.highlightAllOnFocus=!0}else this.focusAfterAttached=!1,q=f.getStartValue();if(X&&q!=null)$.setStartValue(q);this.addGuiEventListener("keydown",(Y)=>{let{key:Z}=Y;if(Z===S.PAGE_UP||Z===S.PAGE_DOWN)Y.preventDefault()})}afterGuiAttached(){let _=this.getLocaleTextFunc(),f=this.eEditor;if(f.setInputAriaLabel(_("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;if(!ef())f.getFocusableElement().focus();let $=f.getInputElement();if(this.highlightAllOnFocus)$.select();else this.cellEditorInput.setCaret?.()}focusIn(){let{eEditor:_}=this,f=_.getFocusableElement(),$=_.getInputElement();f.focus(),$.select()}getValue(){return this.cellEditorInput.getValue()}agSetEditValue(_){this.params.value=_;let f=this.cellEditorInput.getStartValue();this.eEditor.setStartValue(f??null)}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}};var vK={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},TK=class{constructor(_){this.getLocaleTextFunc=_}getTemplate(){return vK}getAgComponents(){return[lJ]}init(_,f){this.eEditor=_,this.params=f;let $=f.maxLength;if($!=null)_.setMaxLength($)}getValidationErrors(){let{params:_}=this,{maxLength:f,getValidationErrors:$}=_,z=this.getValue(),Q=this.getLocaleTextFunc(),J=[];if(f!=null&&typeof z==="string"&&z.length>f)J.push(Q("maxLengthValidation",`Must be ${f} characters or fewer.`,[String(f)]));if(!J.length)J=null;if($)return $({value:z,cellEditorParams:_,internalErrors:J});return J}getValue(){let{eEditor:_,params:f}=this,$=_.getValue();if(!v($)&&!v(f.value))return f.value;return f.parseValue($)}getStartValue(){let _=this.params;return _.useFormatter||_.column.getColDef().refData?_.formatValue(_.value):_.value}setCaret(){if(ef())this.eEditor.getInputElement().focus({preventScroll:!0});let _=this.eEditor,f=_.getValue(),$=v(f)&&f.length||0;if($)_.getInputElement().setSelectionRange($,$)}},h9=class extends PK{constructor(){super(new TK(()=>this.getLocaleTextFunc()))}};function IK(_,f){return _.editModelSvc?.getEditRowDataValue(f,{checkSiblings:!0})}function yK(_){let f=_.editModelSvc?.getEditMap(),$=[];return f?.forEach((z,Q)=>{let{rowIndex:J,rowPinned:q}=Q;z.forEach((X,Y)=>{let{editorValue:Z,pendingValue:G,sourceValue:E,state:U}=X,H=L0(X),W=Z??G;if(W===v_)W=void 0;let B={newValue:W,oldValue:E,state:U,column:Y,colId:Y.getColId(),colKey:Y.getColId(),rowIndex:J,rowPinned:q},K=U==="editing";if(K||!K&&H)$.push(B)})}),$}function bK(_,f=!1){let{editSvc:$}=_;if($?.isBatchEditing()){if(f){for(let z of _.editModelSvc?.getEditPositions()??[])if(z.state==="editing")$.revertSingleCellEdit(z)}else Xf(_,{persist:!0});qf(_,void 0,{cancel:f})}else $?.stopEditing(void 0,{cancel:f,source:"edit",forceStop:!f,forceCancel:f})}function CK(_,f){let $=l(_,f);return!!_.editSvc?.isEditing($)}function wK(_,f){let{key:$,colKey:z,rowIndex:Q,rowPinned:J}=f,{editSvc:q,colModel:X}=_,Y=X.getCol(z);if(!Y){j(12,{colKey:z});return}let G=D_(_,{rowIndex:Q,rowPinned:J||null,column:Y});if(!G){j(290,{rowIndex:Q,rowPinned:J});return}if(!q?.isCellEditable({rowNode:G,column:Y},"api"))return;if(J==null)h3(_,Q);g3(_,z),q?.startEditing({rowNode:G,column:Y},{event:$?new KeyboardEvent("keydown",{key:$}):void 0,source:"api",editable:!0})}function xK(_){return _.editSvc?.validateEdit()||null}var NK={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},gK=class extends FJ{constructor(_){super(NK);this.params=_}postConstruct(){tf(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){let _=this.getGui(),f=this.params,$=(z)=>{if(!y6(this.gos,z,f.node,f.column,!0))f.onKeyDown(z)};this.addManagedElementListeners(_,{keydown:$})}};function hK(_,{column:f},$,z,Q="ui"){if($ instanceof KeyboardEvent&&($.key===S.TAB||$.key===S.ENTER||$.key===S.F2||$.key===S.BACKSPACE&&z))return!0;if($?.shiftKey&&_.rangeSvc?.getCellRanges().length!=0)return!1;let q=f?.getColDef(),X=uK(_.gos,q),Y=$?.type;if(Y==="click"&&$?.detail===1&&X===1)return!0;if(Y==="dblclick"&&$?.detail===2&&X===2)return!0;if(Q==="api")return!!z;return!1}function uK(_,f){if(_.get("suppressClickEdit")===!0)return 0;if(_.get("singleClickEdit")===!0)return 1;if(f?.singleClickEdit)return 1;return 2}function L6(_,f){return _.editModelSvc?.hasEdits(f,{withOpenEditor:!0})??!1}function c6(_,f){let{column:$,rowNode:z}=f,Q=$.getColDef();if(!z)return L6(_,f);let J=Q.editable;if(z.group&&Q.groupRowEditable!=null){if(_.rowGroupingEditValueSvc?.isGroupCellEditable(z,$))return!0;return L6(_,f)}if($.isColumnFunc(z,J))return!0;return L6(_,f)}function iK(_,f,$="ui"){let z=c6(_,f);if(z||$==="ui")return z;let{rowNode:Q,column:J}=f;for(let q of _.colModel.getCols())if(q!==J&&c6(_,{rowNode:Q,column:q}))return!0;return!1}var bz=(_,f=!1)=>{if(_!==void 0)return L0(_)||f&&_.state==="editing"};function T5(_,f,$=!1){return bz(_.editModelSvc?.getEdit(f),$)}var I5=(_,f,$)=>{if(!_)return;for(let z=0,Q=_.length;z{let Y={rowNode:z,column:X};return T5($,Y,!0)||y5($,Y)||b5($,Y)});this.applyStyle(J,q);return}this.applyStyle(J)}applyStyle(_=!1,f=!1){let $=!!this.editSvc?.isBatchEditing(),z=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:Q})=>{Q.toggleCss("ag-row-editing",z&&f),Q.toggleCss("ag-row-batch-edit",z&&f&&$),Q.toggleCss("ag-row-inline-editing",f),Q.toggleCss("ag-row-not-inline-editing",!f),Q.toggleCss("ag-row-editing-invalid",z&&f&&_)})}},pK=({rowModel:_,pinnedRowModel:f,editModelSvc:$},z)=>{let Q=new Set;_.forEachNode((J)=>z.has(J)&&Q.add(J)),f?.forEachPinnedRow("top",(J)=>z.has(J)&&Q.add(J)),f?.forEachPinnedRow("bottom",(J)=>z.has(J)&&Q.add(J));for(let J of z)if(!Q.has(J))$.removeEdits({rowNode:J});return Q},nK=({editModelSvc:_},f,$)=>{for(let z of f)_?.getEditRow(z)?.forEach((Q,J)=>!$.has(J)&&_.removeEdits({rowNode:z,column:J}))},dK=(_)=>()=>{let f=new Set(_.colModel.getCols()),$=_.editModelSvc.getEditMap(!0),z=new Set($.keys());nK(_,pK(_,z),f)},tK=new Set(["undo","redo","paste","bulk","rangeSvc"]),rK=new Set(["ui","api"]),C5={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},lK=new Set(Object.keys(C5)),sK=new Set(["paste","rangeSvc","cellClear","redo","undo"]),F6={cancel:!0,source:"api"},aK={cancel:!1,source:"api"},wf={checkSiblings:!0},zf={force:!0,suppressFlash:!0},oK={force:!0},eK=class extends A{constructor(){super(...arguments);this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){let{beans:_}=this;this.model=_.editModelSvc,this.valueSvc=_.valueSvc,this.rangeSvc=_.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:z})=>{this.stopEditing(void 0,F6),this.createStrategy(z)});let f=dK(_),$=()=>{let z=this.model.getCellValidationModel().getCellValidationMap().size>0,Q=this.model.getRowValidationModel().getRowValidationMap().size>0;if(z||Q)this.stopEditing(void 0,F6);else if(this.isEditing())if(this.batch)qf(_,this.model.getEditPositions());else this.stopEditing(void 0,aK);return!1};this.addManagedEventListeners({columnPinned:f,columnVisible:f,columnRowGroupChanged:f,rowExpansionStateChanged:f,pinnedRowsChanged:f,displayedRowsChanged:f,sortChanged:$,filterChanged:$,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){if(this.batch)return;this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,F6)}stopBatchEditing(_){if(!this.batch)return;if(_)this.stopEditing(void 0,_);if(this.batchStartDispatched)this.dispatchBatchStopped(new Map,!1);this.batch=!1,this.batchStartDispatched=!1}ensureBatchStarted(){if(!this.batch||this.batchStartDispatched)return;this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map)}createStrategy(_){let{beans:f,gos:$,strategy:z}=this,Q=u9($,_);if(z){if(z.beanName===Q)return z;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(f.registry.createDynamicBean(Q,!0))}destroyStrategy(){if(!this.strategy)return;this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy)}shouldStartEditing(_,f,$,z="ui"){let Q=hK(this.beans,_,f,$,z);if(Q)this.strategy??(this.strategy=this.createStrategy());return Q}shouldStopEditing(_,f,$="ui"){return this.strategy?.shouldStop(_,f,$)??null}shouldCancelEditing(_,f,$="ui"){return this.strategy?.shouldCancel(_,f,$)??null}validateEdit(){return HB(this.beans)}isEditing(_,f){return this.model.hasEdits(_??void 0,f??wf)}isRowEditing(_,f){return!!_&&this.model.hasRowEdits(_,f)}enableRangeSelectionWhileEditing(){if(this.beans.rangeSvc&&this.gos.get("cellSelection"))this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(_,f){let{startedEdit:$=!0,event:z=null,source:Q="ui",ignoreEventKey:J=!1,silent:q}=f;if(this.strategy??(this.strategy=this.createStrategy()),!(f.editable??this.isCellEditable(_,"api")))return;let Y=l(this.beans,_);if(Y&&!Y.comp){f.editable=void 0,Y.onCompAttachedFuncs.push(()=>this.startEditing(_,f));return}let Z=this.shouldStartEditing(_,z,$,Q);if(Z===!1&&Q!=="api"){if(this.isEditing(_))this.stopEditing();return}if(!this.batch&&this.shouldStopEditing(_,void 0,Q)&&!f.continueEditing)this.stopEditing(void 0,{source:Q});if(Z)this.ensureBatchStarted();this.strategy.start({position:_,event:z,source:Q,ignoreEventKey:J,startedEdit:$,silent:q})}stopEditing(_,f){let $=this.prepareStopContext(_,f);if(!$)return!1;this.stopping=!0;let z=!1,{edits:Q}=$;try{let J=this.processStopRequest($);return z||(z=J.res),Q=J.edits,this.finishStopEditing({...$,edits:Q,params:f,position:_,res:z}),z}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(_,f){let{event:$=null,cancel:z=!1,source:Q="ui",forceCancel:J=!1,forceStop:q=!1,commit:X=!1}=f||{};if(lK.has(Q)&&this.batch){if(_?.rowNode&&_?.column)this.bulkRefreshCell(_);return null}let Y=this.committing?C5[Q]:Q;if(!(this.committing||this.isEditing(_)||this.batch&&this.model.hasEdits(_,wf))||!this.strategy||this.stopping)return null;let G=l(this.beans,_);if(G)G.onEditorAttachedFuncs=[];let E=!z&&(!!this.shouldStopEditing(_,$,Y)||(this.committing||Q==="paste")&&!this.batch)||q,U=z&&!!this.shouldCancelEditing(_,$,Y)||J;return{cancel:z,cellCtrl:G,edits:this.model.getEditMap(!0),event:$??null,forceCancel:J,forceStop:q,commit:X,position:_,source:Q,treatAsSource:Y,willCancel:U,willStop:E}}processStopRequest(_){let{event:f,position:$,willCancel:z,willStop:Q}=_;if(Q||z)return this.handleStopOrCancel(_);if(this.shouldHandleMidBatchKey(f,$))return{res:!1,edits:this.handleMidBatchKey(f,$,_)};if(Xf(this.beans,{persist:!0}),this.batch)this.strategy?.cleanupEditors($);return{res:!1,edits:this.model.getEditMap()}}handleStopOrCancel(_){let{beans:f,model:$}=this,{cancel:z,commit:Q,edits:J,event:q,source:X,willCancel:Y,willStop:Z}=_,G=!this.batch||!Y;Xf(f,{persist:G,isCancelling:Y||z,isStopping:Z});let E=$.getEditMap(),H=!Y&&(!this.batch||Q)?this.processEdits(E,X):[];if(z)this.strategy?.stopCancelled(_.forceCancel);else this.strategy?.stopCommitted(q,Q);this.clearValidationIfNoOpenEditors();for(let W of H)$.clearEditValue(W);this.bulkRefreshMap(J);for(let W of $.getEditPositions(E)){let B=l(f,W),K=L0(W);B?.refreshCell({force:!0,suppressFlash:!K})}return{res:Z,edits:E}}shouldHandleMidBatchKey(_,f){return _ instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(f)&&this.isEditing(f,{withOpenEditor:!0})}handleMidBatchKey(_,f,$){let{beans:z,model:Q}=this,{cellCtrl:J,edits:q}=$,{key:X}=_,Y=X===S.ENTER,Z=X===S.ESCAPE,G=X===S.TAB;if(Y||G||Z){if(Y||G)Xf(z,{persist:!0});else if(Z&&J){let{rowNode:E,column:U}=J;if(this.batch&&E&&U){let H={rowNode:E,column:U};qf(z,[H],{silent:!0}),this.model.stop(H,!0,!0),l(z,H)?.refreshCell(zf)}else this.revertSingleCellEdit(J)}if(this.batch)this.strategy?.cleanupEditors();else qf(z,Q.getEditPositions(),{event:_,cancel:Z});return _.preventDefault(),this.bulkRefreshMap(q,{suppressFlash:!0}),Q.getEditMap()}return q}finishStopEditing({cellCtrl:_,edits:f,params:$,position:z,res:Q,commit:J,forceCancel:q,willCancel:X,willStop:Y}){let Z=this.beans;if(Q&&z){if(!this.batch||J)this.model.removeEdits(z)}this.navigateAfterEdit($,_?.cellPosition),l1(Z),this.clearValidationIfNoOpenEditors();let{rowRenderer:G,formula:E}=Z;if(X)G.refreshRows({rowNodes:Array.from(f.keys())});if(this.batch){if(E)E.refreshFormulas(!0);else G.refreshRows({suppressFlash:!0,force:!0});let U=Y&&J;if(U||X&&q)this.dispatchBatchStopped(f,U)}}dispatchBatchStopped(_,f){let $;if(f){if($=JB(_),$.size>0)this.ensureBatchStarted()}if(this.batchStartDispatched)this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",$??new Map)}clearValidationIfNoOpenEditors(){if(!this.model.hasEdits(void 0,{withOpenEditor:!0}))this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()}navigateAfterEdit(_,f){if(!_||!f)return;let{event:$,suppressNavigateAfterEdit:z}=_;if(!($ instanceof KeyboardEvent)||z)return;let{key:J,shiftKey:q}=$,X=this.gos.get("enterNavigatesVerticallyAfterEdit");if(J!==S.ENTER||!X)return;let Y=q?S.UP:S.DOWN;this.beans.navigation?.navigateToNextCell(null,Y,f,!1)}processEdits(_,f){let $=Array.from(_.keys()),z=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,Q=[],{changeDetectionSvc:J}=this.beans;J?.beginDeferred();try{for(let q of $){let X=_.get(q);for(let Y of X.keys()){let Z=X.get(Y),G={rowNode:q,column:Y};if(L0(Z)&&!z){let E=l(this.beans,G);if(!this.setNodeDataValue(q,Y,Z.pendingValue,E,f))Q.push(G)}}}}finally{J?.endDeferred()}return Q}setNodeDataValue(_,f,$,z,Q="edit"){let J=rK.has(Q)?"edit":Q;if(z)z.suppressRefreshCell=!0;this.committing=!0;try{return _.setDataValue(f,$,J)}finally{if(this.committing=!1,z)z.suppressRefreshCell=!1}}syncEditAfterCommit(_,f){let $=this.model.getEdit(_);if($&&$.state!=="editing")if(f)this.beans.editModelSvc?.setEdit(_,{sourceValue:$.pendingValue});else this.model.clearEditValue(_)}setEditMap(_,f){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(_,f),this.bulkRefreshMap(_);let $=zf;if(f?.forceRefreshOfEditCellsOnly)$={..._L(_),...zf};this.beans.rowRenderer.refreshCells($)}dispatchEditValuesChanged({rowNode:_,column:f},$={}){if(!_||!f||!$)return;let{pendingValue:z,sourceValue:Q}=$,{rowIndex:J,rowPinned:q,data:X}=_;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:_,rowIndex:J,rowPinned:q,column:f,source:"api",data:X,newValue:z,oldValue:Q,value:z,colDef:f.getColDef()})}bulkRefreshCell(_,f){if(o(this.gos,this.beans.rowModel))this.refCell(_,this.model.getEdit(_),f)}bulkRefreshMap(_,f){if(o(this.gos,this.beans.rowModel))_.forEach(($,z)=>{for(let Q of $.keys())this.refCell({rowNode:z,column:Q},$.get(Q),f)})}refCell({rowNode:_,column:f},$,z={}){let{beans:Q,gos:J}=this,q=new Set([_]),X=new Set,Y=_.pinnedSibling;if(Y)q.add(Y);let Z=_.sibling;if(Z)X.add(Z);let G=_.parent;while(G){if(G.sibling?.footer&&J.get("groupTotalRow"))X.add(G.sibling);else if(!G.parent&&G.sibling&&J.get("grandTotalRow"))X.add(G.sibling);else X.add(G);G=G.parent}for(let E of q)this.dispatchEditValuesChanged({rowNode:E,column:f},$);for(let E of q)l(Q,{rowNode:E,column:f})?.refreshCell(z);for(let E of X){let U=l(Q,{rowNode:E,column:f});if(U){if(U.refreshCell(z),!z.force&&this.batch)U.editStyleFeature?.applyCellStyles?.()}}}stopAllEditing(_=!1,f="ui"){if(this.isEditing())this.stopEditing(void 0,{cancel:_,source:f})}isCellEditable(_,f="ui"){let{gos:$,beans:z}=this,Q=_.rowNode;if(Q.group&&_.column.getColDef().groupRowEditable==null){if($.get("treeData")){if(!Q.data&&!$.get("enableGroupEdit"))return!1}else if(!$.get("enableGroupEdit"))return!1}let J=u9($)==="fullRow"?iK(z,_,f):c6(z,_);if(J)this.strategy??(this.strategy=this.createStrategy());return J}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(_,f,$=!0){if(this.hasValidationErrors(_)){let z=l(this.beans,_);if(this.cellEditingInvalidCommitBlocks()){if(f?.preventDefault?.(),$){if(z&&!z.hasBrowserFocus())z.focusCell();z?.comp?.getCellEditor()?.focusIn?.()}return"block-stop"}if(z)this.revertSingleCellEdit(z);return"revert-continue"}return"continue"}revertSingleCellEdit(_,f=!1){let $=l(this.beans,_);if(!$?.comp?.getCellEditor())return;if(qf(this.beans,[_],{silent:!0}),this.model.clearEditValue(_),lf(this.beans,_,{silent:!0}),Hf(this.beans),$?.refreshCell(zf),!f)return;$?.focusCell(),$?.comp?.getCellEditor()?.focusIn?.()}hasValidationErrors(_){Hf(this.beans);let f=l(this.beans,_);if(f)f.refreshCell(zf),f.rowCtrl.rowEditStyleFeature?.applyRowStyles();let $=!1;if(_?.rowNode){if($||($=this.model.getRowValidationModel().hasRowValidation({rowNode:_.rowNode})),_.column)$||($=this.model.getCellValidationModel().hasCellValidation({rowNode:_.rowNode,column:_.column}))}else $||($=this.model.getCellValidationModel().getCellValidationMap().size>0),$||($=this.model.getRowValidationModel().getRowValidationMap().size>0);return $}moveToNextCell(_,f,$,z="ui"){let Q,J=this.isEditing(),q=J&&this.checkNavWithValidation(void 0,$)==="block-stop";if(_ instanceof _$&&J)Q=this.strategy?.moveToNextEditingCell(_,f,$,z,q);if(Q===null)return Q;if(Q=Q||!!this.beans.focusSvc.focusedHeader,Q===!1&&!q)this.stopEditing();return Q}getPendingEditValue(_,f,$){if($==="data")return;if($==="batch"&&!this.batch)return;let z=this.model.getEdit({rowNode:_,column:f},wf);if(!z)return;if(this.stopping&&!this.batch&&!z.editorState?.cellStartedEditing)return;if($==="edit"){let J=z.editorValue;if(J!=null&&J!==v_)return J}let Q=z.pendingValue;if(Q!==v_)return Q;return}getCellDataValue(_){let f=this.model.getEdit(_,wf);if(f){let $=f.pendingValue;if($!==v_)return $;let z=f.sourceValue;if(z!=null)return z}return this.valueSvc.getValue(_.column,_.rowNode,"data")}addStopEditingWhenGridLosesFocus(_){$B(this,this.beans,_)}createPopupEditorWrapper(_){return new gK(_)}batchResetToSourceValue(_){if(!this.batch)return!1;let f=this.model.getEdit(_);if(!f)return!1;let{pendingValue:$,sourceValue:z,state:Q}=f;if($===z)return!1;if(Q==="editing")return!1;return this.dispatchEditValuesChanged(_,{...f,pendingValue:z}),this.beans.editModelSvc?.removeEdits(_),l(this.beans,_)?.refreshCell(zf),!0}setDataValue(_,f,$){try{let z=this.batch,Q=this.isEditing(z?void 0:_);if((!Q||this.committing)&&!z&&!sK.has($))return;if(!Q&&!z&&$==="paste")return;if($==="batch"&&!z)return;if($==="edit"){if(Q&&this.applyEditorValue(_,f))return!0;if(!z)return}if(this.strategy??(this.strategy=this.createStrategy()),$==="batch"||$==="edit")return this.applyDirectValue(_,f,$);let J=this.beans,q;if(z)q="ui";else if(this.committing)q=$??"api";else q="api";if(!$||tK.has($))return this.applyDirectValue(_,f,$);let X=this.applyExistingEdit(_,f,$,q);if(X!==void 0)return X;return H1(J,_,f,$,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(_,{source:q,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}applyExistingEdit(_,f,$,z){let Q=this.model.getEdit(_);if(!Q)return;if(Q.pendingValue===f)return!1;if(Q.sourceValue!==f)return H1(this.beans,_,f,$,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(_,{source:z,suppressNavigateAfterEdit:!0}),!0;return this.beans.editModelSvc?.removeEdits(_),this.ensureBatchStarted(),this.dispatchEditValuesChanged(_,{...Q,pendingValue:f}),!0}applyEditorValue(_,f){let $=this.beans,z=l($,_),Q=z?.comp?.getCellEditor();if(!z||!Q)return!1;if(H1($,_,f,"edit",void 0,{persist:!0}),z.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in Q)return Q.agSetEditValue(f),!0;if(Q.refresh&&z.editCompDetails)return Q.refresh({...z.editCompDetails.params,value:f}),!0;if(z.hasBrowserFocus())z.onEditorAttachedFuncs.push(()=>{let q=l(this.beans,_);q?.focusCell(!0),q?.comp?.getCellEditor()?.focusIn?.()});return qf($,[_],{silent:!0,cancel:!0}),lf($,_,{silent:!0}),Hf($),l($,_)?.refreshCell(zf),!0}applyDirectValue(_,f,$){let z=this.beans;if(this.batch){if($==="batch"&&l(z,_)?.comp?.getCellEditor()){let{editModelSvc:q,valueSvc:X}=z,{rowNode:Y,column:Z}=_;if(q?.getEdit(_)?.sourceValue===void 0)q?.setEdit(_,{sourceValue:X.getValue(Z,Y,"data")});q?.setEdit(_,{pendingValue:f})}else if(H1(z,_,f,$,void 0,{persist:!0}),$!=="batch")this.cleanupEditors();return l1(z),this.ensureBatchStarted(),this.bulkRefreshCell(_),!0}H1(z,_,f,$,void 0,{persist:!0});let Q=l(z,_),J=this.setNodeDataValue(_.rowNode,_.column,f,Q,$);return this.syncEditAfterCommit(_,J),l1(z),l(z,_)?.refreshCell(J?oK:zf),J}handleColDefChanged(_){XB(this.beans,_)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(_,f){let{model:$}=this;if(!this.batch)return;if(!$.hasRowEdits(_.rowNode,wf))return;let{rowNode:Q}=_,{compDetails:J,valueToDisplay:q}=f;if(J){let{params:X}=J;return X.data=$.getEditRowDataValue(Q,wf),{compDetails:J}}return{valueToDisplay:q}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(_,f,$,z){this.strategy?.dispatchCellEvent(_,f,$,z)}dispatchBatchEvent(_,f){this.eventSvc.dispatchEvent(this.createBatchEditEvent(_,f))}createBatchEditEvent(_,f){return C(this.gos,{type:_,..._==="batchEditingStopped"?{changes:this.toEventChangeList(f)}:{}})}toEventChangeList(_){return this.model.getEditPositions(_).map((f)=>({rowIndex:f.rowNode.rowIndex,rowPinned:f.rowNode.rowPinned,columnId:f.column.getColId(),newValue:f.pendingValue,oldValue:f.sourceValue}))}applyBulkEdit({rowNode:_,column:f},$){if(!$||$.length===0)return;let{beans:z,rangeSvc:Q,valueSvc:J}=this,{formula:q}=z;Xf(z,{persist:!0});let X=this.model.getEditMap(!0),Y=X.get(_)?.get(f)?.pendingValue,Z=!1;if(!this.batch)this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),Z=!0;let G=q?.isFormula(Y)??!1;$.forEach((U)=>{let H=U.columns.some((W)=>W?.isAllowFormula());if(Q?.forEachRowInRange(U,(W)=>{let B=D_(z,W);if(B===void 0)return;let K=X.get(B)??new Map,L=Y;for(let F of U.columns){if(!F)continue;let D=!!G&&F.isAllowFormula();if(this.isCellEditable({rowNode:B,column:F},"api")){let M=J.getValue(F,B,"data",!0),k=J.parseValue(F,B??null,L,M);if(Number.isNaN(k))k=null;K.set(F,{editorValue:void 0,pendingValue:k,sourceValue:M,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}if(D)L=q?.updateFormulaByOffset({value:L,columnDelta:1})}if(K.size>0)X.set(B,K);if(G&&H)Y=q?.updateFormulaByOffset({value:Y,rowDelta:1})}),this.setEditMap(X),this.batch){this.cleanupEditors(),l1(z),this.ensureBatchStarted();return}this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{if(this.committing=!1,Z)this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(X)})}});let E=l(z,{rowNode:_,column:f});if(E)E.focusCell(!0)}createCellStyleFeature(_){return new mK(_,this.beans)}createRowStyleFeature(_){return new cK(_,this.beans)}setEditingCells(_,f){let{beans:$}=this,{colModel:z,valueSvc:Q}=$,J=new Map;for(let{colId:q,column:X,colKey:Y,rowIndex:Z,rowPinned:G,newValue:E,state:U}of _){let H=q?z.getCol(q):Y?z.getCol(Y):X;if(!H)continue;let W=D_($,{rowIndex:Z,rowPinned:G});if(!W)continue;let B=Q.getValue(H,W,"data",!0);if(!f?.forceRefreshOfEditCellsOnly&&!L0({pendingValue:E,sourceValue:B})&&U!=="editing")continue;let K=J.get(W);if(!K)K=new Map,J.set(W,K);if(E===void 0)E=v_;K.set(H,{editorValue:void 0,pendingValue:E,sourceValue:B,state:U??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(J,f)}onCellFocused(_){let f=l(this.beans,_);if(!f||!this.isEditing(f,wf))return;let $=this.model.getEdit(f);if(!$||!L0($))return;let Q=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(Q,"pendingChange")}allowedFocusTargetOnValidation(_){return l(this.beans,_)}};function _L(_){return{rowNodes:_?Array.from(_.keys()):void 0,columns:_?[...new Set(Array.from(_.values()).flatMap((f)=>Array.from(f.keys())))]:void 0}}function u9(_,f){return f??_.get("editType")??"singleCell"}var w5=class extends A{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(_){this.model.clearEditValue(_)}onCellFocusChanged(_){let f,$=_.previousParams,{editSvc:z,beans:Q}=this,J=_.type==="cellFocused"?_.sourceEvent:null;if($)f=l(Q,$);let{gos:q,editModelSvc:X}=Q,Y=_.type==="cellFocusCleared";if(z.isEditing(void 0,{withOpenEditor:!0})){let{column:Z,rowIndex:G,rowPinned:E}=_,U={column:Z,rowNode:D_(Q,{rowIndex:G,rowPinned:E})},H=q.get("invalidEditValueMode")==="block";if(H)return;let W=!H,B=!!X?.getCellValidationModel().hasCellValidation(U),K=W&&B;if(!($||Y?z.stopEditing(void 0,{cancel:K,source:Y&&W?"api":void 0,event:J}):!0))if(z.isBatchEditing())z.cleanupEditors();else z.stopEditing(void 0,{source:"api"})}f?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(_){let f=this.editSvc.isBatchEditing()&&!_;for(let $ of this.model.getEditPositions())W$(this.beans,$,{cancel:!0},l(this.beans,$)),this.model.stop($,f,!0);return!0}stopCommitted(_,f){let $=this.model.getEditPositions(),z={all:[],pass:[],fail:[]};for(let q of $)if(z.all.push(q),(this.model.getCellValidationModel().getCellValidation(q)?.errorMessages?.length??0)>0)z.fail.push(q);else z.pass.push(q);let Q=this.processValidationResults(z),J=this.editSvc.isBatchEditing()&&!f;for(let q of Q.destroy)W$(this.beans,q,{event:_},l(this.beans,q)),this.model.stop(q,J,!1);for(let q of Q.keep){let X=l(this.beans,q);if(!this.editSvc.cellEditingInvalidCommitBlocks()&&X)this.editSvc.revertSingleCellEdit(X)}return!0}cleanupEditors({rowNode:_}={},f){Xf(this.beans,{persist:!1});let $=this.model.getEditPositions(),z=[];if(_){for(let Q of $)if(Q.rowNode!==_)z.push(Q)}else for(let Q of $)z.push(Q);qf(this.beans,z),l1(this.beans,f)}setFocusOutOnEditor(_){_.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(_){let f=_.comp,$=f?.getCellEditor();if($?.focusIn)$.focusIn();else{let z=this.beans.gos.get("editType")==="fullRow";_.focusCell(z),_.onEditorAttachedFuncs.push(()=>f?.getCellEditor()?.focusIn?.())}}setupEditors(_){let{event:f,ignoreEventKey:$=!1,startedEdit:z,position:Q,cells:J=this.model.getEditPositions()}=_,q=f instanceof KeyboardEvent&&!$&&f.key||void 0;QB(this.beans,J,Q,q,f,z)}dispatchCellEvent(_,f,$,z){let Q=l(this.beans,_);if(Q)this.eventSvc.dispatchEvent({...Q.createEvent(f??null,$),...z})}dispatchRowEvent(_,f,$){if($)return;let z=Tz(this.beans,_);if(z)this.eventSvc.dispatchEvent(z.createRowEvent(f))}shouldStop(_,f,$="ui"){let z=this.editSvc.isBatchEditing();if(z&&$==="api")return!0;if(z&&($==="ui"||$==="edit"))return!1;if($==="api")return!0;if(f instanceof KeyboardEvent&&!z)return f.key===S.ENTER;return null}shouldCancel(_,f,$="ui"){let z=this.editSvc.isBatchEditing();if(f instanceof KeyboardEvent&&!z){if(f.key===S.ESCAPE)return!0}if(z&&$==="api")return!0;if($==="api")return!0;return!1}setEditMap(_,f){if(!f?.update)this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});let $=[];if(_.forEach((z,Q)=>{z.forEach((J,q)=>{if(J.state==="editing")$.push({...J,rowNode:Q,column:q})})}),f?.update)_=new Map([...this.model.getEditMap(),..._]);if(this.model?.setEditMap(_),$.length>0){let z=$.at(-1),Q=z.pendingValue===v_?void 0:z.pendingValue;this.start({position:z,event:new KeyboardEvent("keydown",{key:Q}),source:"api"});let J=l(this.beans,z);if(J)this.setFocusInOnEditor(J)}}destroy(){this.cleanupEditors(),super.destroy()}},fL=class extends w5{constructor(){super(...arguments);this.beanName="fullRow",this.startedRows=new Set}shouldStop(_,f,$="ui"){let{rowNode:z,beans:Q}=this,{rowNode:J}=_||{};if(!Tz(Q,{rowNode:z}))return!0;let X=super.shouldStop({rowNode:z},f,$);if(X!==null)return X;if(!z)return!1;return J!==z}midBatchInputsAllowed({rowNode:_}){if(!_)return!1;return this.model.hasEdits({rowNode:_})}clearEdits(_){this.model.clearEditValue(_)}start(_){let{position:f,silent:$,startedEdit:z,event:Q,ignoreEventKey:J}=_,{rowNode:q}=f,{beans:X,model:Y,startedRows:Z}=this;if(this.rowNode!==q)super.cleanupEditors(f);let G=X.visibleCols.allCols,E=[],U=[];for(let H of G)if(H.isCellEditable(q))U.push(H);if(U.length==0)return;if(!Z.has(q))this.dispatchRowEvent({rowNode:q},"rowEditingStarted",$),Z.add(q);for(let H of U){let W={rowNode:q,column:H};E.push(W),Y.start(W)}this.rowNode=q,this.setupEditors({cells:E,position:f,startedEdit:z,event:Q,ignoreEventKey:J})}processValidationResults(_){if(_.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:_.all};return{destroy:_.all,keep:[]}}stopCancelled(_){let{rowNode:f,model:$}=this;if(f&&!$.hasRowEdits(f))return!1;return super.stopCancelled(_),this.cleanupEditors({rowNode:f},!0),this.rowNode=void 0,!0}stopCommitted(_,f){let{rowNode:$,beans:z,model:Q,editSvc:J}=this;if($&&!Q.hasRowEdits($))return!1;let q=[];if(Q.getEditMap().forEach((X,Y)=>{if(!X||X.size===0)return;for(let Z of X.values())if(L0(Z)){q.push(Y);break}}),Hf(z),J.checkNavWithValidation({rowNode:$})==="block-stop")return!1;if(super.stopCommitted(_,f),f||!J.isBatchEditing())for(let X of q)this.dispatchRowEvent({rowNode:X},"rowValueChanged");return this.cleanupEditors({rowNode:$},!0),this.rowNode=void 0,!0}onCellFocusChanged(_){let{rowIndex:f}=_,$=_.previousParams;if($?.rowIndex===f||_.sourceEvent instanceof KeyboardEvent)return;let{beans:z,gos:Q,model:J}=this;if(z.editSvc?.isRangeSelectionEnabledWhileEditing())return;let q=l(z,$);if(Q.get("invalidEditValueMode")==="block"&&q&&(J.getCellValidationModel().getCellValidation(q)||J.getRowValidationModel().getRowValidation(q)))return;super.onCellFocusChanged(_)}cleanupEditors(_={},f){super.cleanupEditors(_,f);let{startedRows:$}=this;for(let z of $)this.dispatchRowEvent({rowNode:z},"rowEditingStopped"),this.destroyEditorsForRow(z);$.clear()}destroyEditorsForRow(_){let f=Tz(this.beans,{rowNode:_});if(!f)return;let $={};for(let z of f.getAllCellCtrls())if(z.comp?.getCellEditor())W$(this.beans,z,$,z)}moveToNextEditingCell(_,f,$,z="ui",Q=!1){let{beans:J,model:q,gos:X,editSvc:Y}=this,Z=_.cellPosition,G;q.suspend(!0);try{G=J.navigation?.findNextCellToFocusOn(Z,{backwards:f,startEditing:!0,skipToNextEditableCell:!1})}finally{q.suspend(!1)}if(G===!1)return null;if(G==null)return!1;let E=G.cellPosition,U=_.isCellEditable(),H=G.isCellEditable(),W=E&&Z.rowIndex===E.rowIndex&&Z.rowPinned===E.rowPinned;if(U)this.setFocusOutOnEditor(_);this.restoreEditors();let B=X.get("suppressStartEditOnTab");if(H&&!Q)if(B)G.focusCell(!0,$);else{if(!G.comp?.getCellEditor())lf(J,G,{event:$,cellStartedEdit:!0});this.setFocusInOnEditor(G),G.focusCell(!1,$)}else{if(H&&Q)this.setFocusInOnEditor(G);G.focusCell(!0,$)}if(!W&&!Q){if(Y?.stopEditing({rowNode:_.rowNode},{event:$,forceStop:!0}),Y?.isRowEditing(_.rowNode,{withOpenEditor:!0}))this.cleanupEditors(G,!0);if(B)G.focusCell(!0,$);else Y.startEditing(G,{startedEdit:!0,event:$,source:z,ignoreEventKey:!0,editable:H||void 0})}return _.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){let{beans:_,model:f}=this;f.getEditMap().forEach(($,z)=>$.forEach(({state:Q},J)=>{if(Q!=="editing")return;let q=l(_,{rowNode:z,column:J});if(q&&!q.comp?.getCellEditor())lf(_,q,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}},$L=class extends w5{constructor(){super(...arguments);this.beanName="singleCell"}shouldStop(_,f,$="ui"){let z=super.shouldStop(_,f,$);if(z!==null)return z;let Q=_?.rowNode,J=_?.column,q=this.rowNode,X=this.column;if((!q||!X)&&Q&&J)return null;if(q!==Q||X!==J)return!0;if(!q&&!X)return this.model.hasEdits(void 0,{withOpenEditor:!0});return!1}midBatchInputsAllowed(_){return this.model.hasEdits(_)}start(_){let{position:f,startedEdit:$,event:z,ignoreEventKey:Q}=_;if(this.rowNode!==f.rowNode||this.column!==f.column)super.cleanupEditors();this.rowNode=f.rowNode,this.column=f.column,this.model.start(f),this.setupEditors({cells:[f],position:f,startedEdit:$,event:z,ignoreEventKey:Q})}dispatchRowEvent(_,f,$){}processValidationResults(_){if(_.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:_.all};return{destroy:_.all,keep:[]}}stopCancelled(_){return super.stopCancelled(_),this.clearPosition()}stopCommitted(_,f){return super.stopCommitted(_,f),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(_){let{colModel:f,editSvc:$}=this.beans,{rowIndex:z,column:Q,rowPinned:J}=_,q=D_(this.beans,{rowIndex:z,rowPinned:J}),X=g6(Q),Y=f.getCol(X),Z=_.previousParams;if(Z){let G=g6(Z.column);if(Z?.rowIndex===z&&G===X&&Z?.rowPinned===J)return}if(_.type=="cellFocused"&&($?.isRangeSelectionEnabledWhileEditing()||$?.isEditing({rowNode:q,column:Y},{withOpenEditor:!0})))return;super.onCellFocusChanged(_)}moveToNextEditingCell(_,f,$,z="ui",Q=!1){let J=this.beans.focusSvc.getFocusedCell();if(J)_=f0(this.beans,J)??_;let q=_.cellPosition,X,Y=this.beans.gos.get("editType")==="fullRow";if(Y)this.model.suspend(!0);if(!Q)_.eGui.focus(),this.editSvc?.stopEditing(_,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:$});try{X=this.beans.navigation?.findNextCellToFocusOn(q,{backwards:f,startEditing:!0})}finally{if(Y)this.model.suspend(!1)}if(X===!1)return null;if(X==null)return!1;let Z=X.cellPosition,G=_.isCellEditable(),E=X.isCellEditable(),U=Z&&q.rowIndex===Z.rowIndex&&q.rowPinned===Z.rowPinned;if(G&&!Q)this.setFocusOutOnEditor(_);let H=this.gos.get("suppressStartEditOnTab"),W=!1;if(!U&&!Q)if(super.cleanupEditors(X,!0),H)X.focusCell(!0,$);else W=!0,this.editSvc.startEditing(X,{startedEdit:!0,event:$,source:z,ignoreEventKey:!0,editable:E});if(E&&!Q){if(X.focusCell(!1,$),H)X.focusCell(!0,$);else if(!X.comp?.getCellEditor()){if(!W){let B=this.editSvc?.isEditing(X,{withOpenEditor:!0});lf(this.beans,X,{event:$,cellStartedEdit:!0,silent:B})}this.setFocusInOnEditor(X),this.cleanupEditors(X)}}else{if(E&&Q)this.setFocusInOnEditor(X);X.focusCell(!0,$)}return _.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},zL={moduleName:"EditCore",version:c,beans:[fB,eK],apiFunctions:{getEditingCells:yK,getEditRowValues:IK,getCellEditorInstances:zB,startEditingCell:wK,stopEditing:bK,isEditing:CK,validateEdit:xK},dynamicBeans:{singleCell:$L,fullRow:fL},dependsOn:[$1,jK],css:[VK]};var x5={moduleName:"TextEditor",version:c,userComponents:{agCellEditor:h9,agTextCellEditor:h9},dependsOn:[zL]};var N5={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},QL=new Set(Object.values(N5));function Qf(_,f){let $=_.filterUi;if(!$)return null;if($.created)return $.promise;if(f)return null;let z=$.create($.refreshed),Q=$;return Q.created=!0,Q.promise=z,z}function UQ(_,f,$,z,Q,J,q){return f.refresh?.({...$,model:z,source:J,additionalEventAttributes:q}),_().then((X)=>{if(X){let{filter:Y,filterParams:Z}=X;w1(Y,Z,z,Q,J,q)}})}function w1(_,f,$,z,Q,J){_?.refresh?.({...f,model:$,state:z,source:Q,additionalEventAttributes:J})}function g5(_,f,$,z){let Q=_();if(Q?.created)Q.promise.then((J)=>{let q=f();w1(J,Q.filterParams,q,$()??{model:q},"ui",z)})}function Cz(_){let f,$=!1,z,{action:Q,filterParams:J,getFilterUi:q,getModel:X,getState:Y,updateState:Z,updateModel:G,processModelToApply:E}=_;switch(Q){case"apply":{let U=Y();if(z=U?.model??null,E)z=E(z);f={state:U?.state,model:z},$=!0;break}case"clear":{if(f={model:null},!J?.buttons?.includes("apply"))$=!0,z=null;break}case"reset":{f={model:null},$=!0,z=null;break}case"cancel":{f={model:X()};break}}if(Z(f),$)G(z);else g5(q,X,Y,{fromAction:Q})}function L_(_,f){return _[f]??null}var JL=class extends OJ{constructor(){super(...arguments);this.iconCreated=!1}wireComp(_,f,$,z,Q){this.comp=_;let J=O$(this,this.beans.context,Q);this.eButtonShowMainFilter=$,this.eFloatingFilterBody=z,this.setGui(f,J),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(J),this.setupLeft(J),this.setupHover(J),this.setupFocus(J),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(J),this.setupUi(),J.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(J);let q=()=>this.onColDefChanged(J);J.addManagedListeners(this.column,{colDefChanged:q}),J.addManagedEventListeners({filterSwitched:({column:X})=>{if(X===this.column)q()}}),J.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){let{column:_,beans:f}=this,$=_.colDef;return C(f.gos,{colDef:$,column:_,floatingFilter:!0})}setupActive(){let _=this.column.getColDef(),f=!!_.filter,$=!!_.floatingFilter;this.active=f&&$}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;let _=h("filter",this.beans,this.column);if(_)this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(_)}setupFocus(_){_.createManagedBean(new t0(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){let _=this.getLocaleTextFunc();W_(this.eButtonShowMainFilter,_("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(_){let{beans:f}=this;if(d(f)===this.eGui)return;let Q=V_(f,this.eGui,null,_.shiftKey);if(Q){f.headerNavigation?.scrollToColumn(this.column),_.preventDefault(),Q.focus();return}let J=this.findNextColumnWithFloatingFilter(_.shiftKey);if(!J)return;if(f.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:J},event:_}))_.preventDefault()}findNextColumnWithFloatingFilter(_){let f=this.beans.visibleCols,$=this.column;do if($=_?f.getColBefore($):f.getColAfter($),!$)break;while(!$.getColDef().filter||!$.getColDef().floatingFilter);return $}handleKeyDown(_){super.handleKeyDown(_);let f=this.getWrapperHasFocus();switch(_.key){case S.UP:case S.DOWN:case S.LEFT:case S.RIGHT:if(f)return;n_(_);case S.ENTER:if(f){if(F_(this.eGui))_.preventDefault()}break;case S.ESCAPE:if(!f)this.eGui.focus()}}onFocusIn(_){if(this.eGui.contains(_.relatedTarget))return;let $=!!_.relatedTarget&&!_.relatedTarget.classList.contains("ag-floating-filter"),z=!!_.relatedTarget&&uf(_.relatedTarget,"ag-floating-filter");if($&&z&&_.target===this.eGui){let Q=this.lastFocusEvent,J=!!(Q&&Q.key===S.TAB);if(Q&&J){let q=Q.shiftKey;F_(this.eGui,q)}}this.focusThis()}setupHover(_){this.beans.colHover?.addHeaderFilterColumnHoverListener(_,this.comp,this.column,this.eGui)}setupLeft(_){let f=new VJ(this.column,this.eGui,this.beans);_.createManagedBean(f)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!E_(this.gos)}setupUserComp(){if(!this.active)return;let _=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());if(_)this.setCompDetails(_)}setCompDetails(_){this.userCompDetails=_,this.comp.setCompDetails(_)}showParentFilter(){let _=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:_,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(_){if(!this.active)return;let{beans:{colFilter:f},column:$,gos:z}=this,Q=(J)=>{if(J?.source==="filterDestroyed"&&(!this.isAlive()||!f?.isAlive()))return;let q=this.comp.getFloatingFilterComp();if(!q)return;q.then((X)=>{if(X){if(z.get("enableFilterHandlers")){let G=J,E="filter";if(G?.afterFloatingFilter)E="ui";else if(G?.afterDataChange)E="dataChanged";else if(J?.source==="api")E="api";this.updateFloatingFilterParams(this.userCompDetails,E);return}let Y=f?.getCurrentFloatingFilterParentModel($),Z=J?{...J,columns:J.columns??[],source:J.source==="api"?"api":"columnFilter"}:null;X.onParentModelChanged(Y,Z)}})};if([this.destroySyncListener]=_.addManagedListeners($,{filterChanged:Q}),f?.isFilterActive($))Q(null)}setupWidth(_){let f=()=>{let $=`${this.column.getActualWidth()}px`;this.comp.setWidth($)};_.addManagedListeners(this.column,{widthChanged:f}),f()}setupFilterChangedListener(_){if(this.active)[this.destroyFilterChangedListener]=_.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton()}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){let _=!!this.beans.filterManager?.isFilterAllowed(this.column);if(this.comp.setButtonWrapperDisplayed(_),this.highlightFilterButtonWhenActive&&_)this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(_){let f=this.active;this.setupActive();let $=!f&&this.active;if(f&&!this.active)this.destroySyncListener(),this.destroyFilterChangedListener();let z=this.beans.colFilter,Q=this.active?z?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,J=this.comp.getFloatingFilterComp();if(!J||!Q)this.updateCompDetails(_,Q,$);else J.then((q)=>{if(!q||z?.areFilterCompsDifferent(this.userCompDetails??null,Q))this.updateCompDetails(_,Q,$);else this.updateFloatingFilterParams(Q,"colDef")})}updateCompDetails(_,f,$){if(!this.isAlive())return;if(this.setCompDetails(f),this.setupFilterButton(),this.setupUi(),$)this.setupSyncWithFilter(_),this.setupFilterChangedListener(_)}updateFloatingFilterParams(_,f){if(!_)return;let $=_.params;this.comp.getFloatingFilterComp()?.then((z)=>{if(typeof z?.refresh==="function"){if(this.gos.get("enableFilterHandlers"))$={...$,model:L_(this.beans.colFilter?.model??{},this.column.getColId()),source:f};z.refresh($)}})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function qL(_,f){let $=_.colModel.getCol(f);if(!$){e(12,{colKey:f});return}_.menuSvc?.showColumnMenu({column:$,positionBy:"auto"})}function XL(_){_.menuSvc?.hidePopupMenu()}var YL=class extends A{constructor(){super(...arguments);this.beanName="menuSvc"}postConstruct(){let{enterpriseMenuFactory:_,filterMenuFactory:f}=this.beans;this.activeMenuFactory=_??f}showColumnMenu(_){this.showColumnMenuCommon(this.activeMenuFactory,_,"columnMenu")}showFilterMenu(_){this.showColumnMenuCommon(i9(this.beans),_,_.containerType,!0)}showHeaderContextMenu(_,f,$){this.activeMenuFactory?.showMenuAfterContextMenuEvent(_,f,$)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){i9(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(_){let{suppressHeaderMenuButton:f}=_.getColDef();return!f&&!!this.activeMenuFactory?.isMenuEnabled(_)&&(E_(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(_){return!_.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(_)}isHeaderContextMenuEnabled(_){return!(_&&Q0(_)?_.getColDef():_?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){let _=!this.isSuppressMenuHide();return!(pf()&&_)}isHeaderFilterButtonEnabled(_){return this.isFilterMenuInHeaderEnabled(_)&&!E_(this.gos)&&!this.isFloatingFilterButtonDisplayed(_)}isFilterMenuItemEnabled(_){return!!this.beans.filterManager?.isFilterAllowed(_)&&!E_(this.gos)&&!this.isFilterMenuInHeaderEnabled(_)&&!this.isFloatingFilterButtonDisplayed(_)}isFloatingFilterButtonEnabled(_){return!_.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(_){return!!_.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(_)}isSuppressMenuHide(){let _=this.gos,f=_.get("suppressMenuHide");if(E_(_))return _.exists("suppressMenuHide")?f:!1;return f}showColumnMenuCommon(_,f,$,z){let{positionBy:Q,onClosedCallback:J}=f,q=f.column;if(Q==="button"){let{buttonElement:X}=f;_?.showMenuAfterButtonClick(q,X,$,J,z)}else if(Q==="mouse"){let{mouseEvent:X}=f;_?.showMenuAfterMouseEvent(q,X,$,J,z)}else if(q){let X=this.beans,Y=X.ctrlsSvc;Y.getScrollFeature().ensureColumnVisible(q,"auto"),Y0(X,()=>{let Z=Y.getHeaderRowContainerCtrl(q.getPinned())?.getHeaderCtrlForColumn(q);if(Z)_?.showMenuAfterButtonClick(q,Z.getAnchorElementForMenu(z),$,J,z)})}}};function B$(_,f,$){if(_.menuVisible!==f)_.menuVisible=f,_.dispatchColEvent("menuVisibleChanged",$)}function i9(_){let{enterpriseMenuFactory:f,filterMenuFactory:$,gos:z}=_;return f&&E_(z)?f:$}var sJ={moduleName:"SharedMenu",version:c,beans:[YL],apiFunctions:{showColumnMenu:qL,hidePopupMenu:XL}},ZL=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function GL(_){let f=_.filterManager;return!!f?.isColumnFilterPresent()||!!f?.isAggregateFilterPresent()}function EL(_,f){return _.filterManager?.getColumnFilterInstance(f)??Promise.resolve(void 0)}function UL(_,f){let $=_.colModel.getColDefCol(f);if($)return _.colFilter?.destroyFilter($,"api")}function HL(_,f){_.frameworkOverrides.wrapIncoming(()=>_.filterManager?.setFilterModel(f))}function WL(_){return _.filterManager?.getFilterModel()??{}}function BL(_,f,$){let{gos:z,colModel:Q,colFilter:J}=_;if($&&!z.get("enableFilterHandlers"))j(288),$=!1;let q=Q.getColDefCol(f);return q?J?.getModelForColumn(q,$)??null:null}function KL(_,f,$){return _.filterManager?.setColumnFilterModel(f,$)??Promise.resolve()}function LL(_,f){let $=_.colModel.getCol(f);if(!$){e(12,{colKey:f});return}_.menuSvc?.showFilterMenu({column:$,containerType:"columnFilter",positionBy:"auto"})}function FL(_){_.menuSvc?.hideFilterMenu()}function DL(_,f){let $=_.colModel.getCol(f);if(!$){e(12,{colKey:f});return}return _.colFilter?.getHandler($,!0)}function ML(_,f){let{colModel:$,colFilter:z,gos:Q}=_;if(!Q.get("enableFilterHandlers")){j(287);return}let{colId:J,action:q}=f;if(J){let X=$.getColById(J);if(X)z?.updateModel(X,q)}else z?.updateAllModels(q)}var m9={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},c9=["january","february","march","april","may","june","july","august","september","october","november","december"];function kL(_,f){if(_==null)return-1;if(f==null)return 1;return Number.parseFloat(_)-Number.parseFloat(f)}function SL(_,f){if(_==null)return-1;if(f==null)return 1;let $=Bf(_),z=Bf(f);if($!=null&&z!=null){if($===z)return 0;return $>z?1:-1}return String(_).localeCompare(String(f))}function p9(_){return _ instanceof Date&&!isNaN(_.getTime())}var p6={number:()=>{return},bigint:()=>{return},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(_,f)=>f,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(_,f)=>f===!1,numberOfInputs:0}]}),date:()=>({isValidDate:p9}),dateString:({dataTypeDefinition:_})=>({comparator:(f,$)=>{let z=_.dateParser($);if($==null||zf)return 1;return 0},isValidDate:(f)=>typeof f==="string"&&p9(_.dateParser(f))}),dateTime:(_)=>p6.date(_),dateTimeString:(_)=>p6.dateString(_),object:()=>{return},text:()=>{return}},n6={number:()=>({comparator:kL}),bigint:()=>({comparator:SL}),boolean:({t:_})=>({valueFormatter:(f)=>v(f.value)?_(String(f.value),f.value?"True":"False"):_("blanks","(Blanks)")}),date:({formatValue:_,t:f})=>({valueFormatter:($)=>{let z=_($);return v(z)?z:f("blanks","(Blanks)")},treeList:!0,treeListFormatter:($,z)=>{if($==="NaN")return f("invalidDate","Invalid Date");if(z===1&&$!=null){let Q=c9[Number($)-1];return f(Q,m9[Q])}return $??f("blanks","(Blanks)")},treeListPathGetter:($)=>K1($,!1)}),dateString:({formatValue:_,dataTypeDefinition:f,t:$})=>({valueFormatter:(z)=>{let Q=_(z);return v(Q)?Q:$("blanks","(Blanks)")},treeList:!0,treeListPathGetter:(z)=>K1(f.dateParser(z??void 0),!1),treeListFormatter:(z,Q)=>{if(Q===1&&z!=null){let J=c9[Number(z)-1];return $(J,m9[J])}return z??$("blanks","(Blanks)")}}),dateTime:(_)=>{let f=n6.date(_);return f.treeListPathGetter=K1,f},dateTimeString(_){let f=_.dataTypeDefinition.dateParser,$=n6.dateString(_);return $.treeListPathGetter=(z)=>K1(f(z??void 0)),$},object:({formatValue:_,t:f})=>({valueFormatter:($)=>{let z=_($);return v(z)?z:f("blanks","(Blanks)")}}),text:()=>{return}};function aJ(_,f,$,z,Q,J,q){let X=f,Y=$,Z=_==="agSetColumnFilter";if(!Y&&z.baseDataType==="object"&&!Z)Y=({column:H,node:W})=>Q({column:H,node:W,value:J.valueSvc.getValue(H,W,"data")});let E=(Z?n6:p6)[z.baseDataType],U=E({dataTypeDefinition:z,formatValue:Q,t:q});return X=typeof f==="object"?{...U,...f}:U,{filterParams:X,filterValueGetter:Y}}var AL={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},RL={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function oJ(_,f=!1){return(f?RL:AL)[_??"text"]}function eJ(_,f,$){if(f==null)return null;let z=null,{compName:Q,jsComp:J,fwComp:q}=eq(_,f);if(Q)z={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[Q];else if(J==null&&q==null&&f.filter===!0)z=$();return z}var jL={filterHandler:()=>({doesFilterPass:()=>!0})};function n9(_,f,$,z){if(!_.isPrimary())return!0;let J=!$;if(!_.isValueActive()||!J)return!1;if(f)return!0;return z}var VL=class extends A{constructor(){super(...arguments);this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...N5},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));let _=this.gos,f={..._.get("initialState")?.filter?.filterModel??{}};if(this.initialModel=f,this.model={...f},!_.get("enableFilterHandlers"))delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(_,f="api",$){let{colModel:z,dataTypeSvc:Q,filterManager:J}=this.beans;if(Q?.isPendingInference){this.modelUpdates.push({model:_,source:f});return}let q=[],X=this.getModel(!0);if(_){let Y=new Set(Object.keys(_));this.allColumnFilters.forEach((Z,G)=>{let E=_[G];q.push(this.setModelOnFilterWrapper(Z,E)),Y.delete(G)}),Y.forEach((Z)=>{let G=z.getColDefCol(Z)||z.getCol(Z);if(!G){j(62,{colId:Z});return}if(!G.isFilterAllowed()){j(63,{colId:Z});return}let E=this.getOrCreateFilterWrapper(G,!0);if(!E){j(64,{colId:Z});return}q.push(this.setModelOnFilterWrapper(E,_[Z],!0))})}else this.model={},this.allColumnFilters.forEach((Y)=>{q.push(this.setModelOnFilterWrapper(Y,null))});g.all(q).then(()=>{let Y=this.getModel(!0),Z=[];if(this.allColumnFilters.forEach((G,E)=>{let U=X?X[E]:null,H=Y?Y[E]:null;if(!wz(U,H))Z.push(G.column)}),Z.length>0)J?.onFilterChanged({columns:Z,source:f});else if($)this.updateActive("filterChanged")})}getModel(_){let f={},{allColumnFilters:$,initialModel:z,beans:{colModel:Q}}=this;if($.forEach((J,q)=>{let X=this.getModelFromFilterWrapper(J);if(v(X))f[q]=X}),!_)for(let J of Object.keys(z)){let q=z[J];if(v(q)&&!$.has(J)&&Q.getCol(J)?.isFilterAllowed())f[J]=q}return f}setState(_,f,$="api"){if(this.state.clear(),f)for(let z of Object.keys(f)){let Q=f[z];this.state.set(z,{model:L_(this.model,z),state:Q})}this.setModel(_,$,!0)}getState(){let _=this.state;if(!_.size)return;let f={},$=!1;return _.forEach((z,Q)=>{let J=z.state;if(J!=null)$=!0,f[Q]=J}),$?f:void 0}getModelFromFilterWrapper(_){let $=_.column.getColId();if(_.isHandler)return L_(this.model,$);let z=_.filter;if(z){if(typeof z.getModel!=="function")return j(66),null;return z.getModel()}return L_(this.initialModel,$)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};let{allColumnFilters:_}=this;if(_.size)return _.forEach((f)=>this.disposeFilterWrapper(f,"advancedFilterEnabled")),!0;return!1}updateActiveFilters(){let _=(Y)=>{if(!Y)return!1;if(!Y.isFilterActive)return j(67),!1;return Y.isFilterActive()},{colModel:f,gos:$}=this.beans,z=!!C0($),Q=[],J=[],q=(Y,Z,G)=>{if(Z)if(n9(Y,f.isPivotMode(),f.isPivotActive(),z))Q.push(G);else J.push(G)},X=[];return this.allColumnFilters.forEach((Y)=>{let Z=Y.column,G=Z.getColId();if(Y.isHandler)X.push(g.resolve().then(()=>{q(Z,this.isHandlerActive(Z),{colId:G,isHandler:!0,handler:Y.handler,handlerParams:Y.handlerParams})}));else{let E=Qf(Y);if(E)X.push(E.then((U)=>{q(Z,_(U),{colId:G,isHandler:!1,comp:U})}))}}),g.all(X).then(()=>{this.activeAggregateFilters=Q,this.activeColumnFilters=J})}updateFilterFlagInColumns(_,f){let $=[];return this.allColumnFilters.forEach((z)=>{let Q=z.column;if(z.isHandler)$.push(g.resolve().then(()=>{this.setColFilterActive(Q,this.isHandlerActive(Q),_,f)}));else{let J=Qf(z);if(J)$.push(J.then((q)=>{this.setColFilterActive(Q,q.isFilterActive(),_,f)}))}}),this.beans.groupFilter?.updateFilterFlags(_,f),g.all($)}doFiltersPass(_,f,$){let{data:z,aggData:Q}=_,J=$?this.activeAggregateFilters:this.activeColumnFilters,q=$?Q:z,X=this.model;for(let Y=0;Y{if(this.isAlive())$?.onFilterChanged(_)};if(f.isRefreshInProgress())setTimeout(z,0);else z()}updateBeforeFilterChanged(_={}){let{column:f,additionalEventAttributes:$}=_,z=f?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",$).then(()=>{this.allColumnFilters.forEach((Q)=>{let{column:J,isHandler:q}=Q;if(z===J.getColId())return;if(q)Q.handler.onAnyFilterChanged?.();Qf(Q,q)?.then((X)=>{if(typeof X?.onAnyFilterChanged==="function")X.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(_){let f=[];this.allColumnFilters.forEach(($)=>{let z=$.isHandler;if(z)$.handler.onNewRowsLoaded?.();let Q=Qf($,z);if(Q)f.push(Q.then((J)=>{J.onNewRowsLoaded?.()}))}),g.all(f).then(()=>this.updateActive(_,{afterDataChange:!0}))}updateActive(_,f){this.updateFilterFlagInColumns(_,f).then(()=>this.updateActiveFilters())}createGetValue(_,f){let{filterValueSvc:$,colModel:z}=this.beans;return(Q,J)=>{let q=J?z.getCol(J):_;return q?$.getValue(q,Q,f):void 0}}isFilterActive(_){let f=this.cachedFilter(_);if(f?.isHandler)return this.isHandlerActive(_);let $=f?.filter;if($)return $.isFilterActive();return L_(this.initialModel,_.getColId())!=null}isHandlerActive(_){let f=v(L_(this.model,_.getColId()));if(f)return f;let $=this.beans.groupFilter;return $?.isGroupFilter(_)?$.isFilterActive(_):!1}getOrCreateFilterUi(_){let f=this.getOrCreateFilterWrapper(_,!0);return f?Qf(f):null}getFilterUiForDisplay(_){let f=this.getOrCreateFilterWrapper(_,!0);if(!f)return null;let $=Qf(f);if(!$)return null;return $.then((z)=>({comp:z,params:f.filterUi.filterParams,isHandler:f.isHandler}))}getHandler(_,f){let $=this.getOrCreateFilterWrapper(_,f);return $?.isHandler?$.handler:void 0}getOrCreateFilterWrapper(_,f){if(!_.isFilterAllowed())return;let $=this.cachedFilter(_);if(!$&&f)$=this.createFilterWrapper(_),this.setColumnFilterWrapper(_,$);return $}cachedFilter(_){return this.allColumnFilters.get(_.getColId())}getDefaultFilter(_,f=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(_),f)}getDefaultFilterFromDataType(_,f=!1){if(B7(this.gos))return f?"agSetColumnFloatingFilter":"agSetColumnFilter";return oJ(_(),f)}getDefaultFloatingFilter(_){return this.getDefaultFilter(_,!0)}createFilterComp(_,f,$,z,Q,J){let q=()=>{let Z=this.createFilterCompParams(_,Q,J),G=z(Z,Q);return HJ(this.beans.userCompFactory,f,G,$)},X=q();if(!X)return null;return{compDetails:X,createFilterUi:(Z)=>{return(Z?q():X).newAgStackInstance()}}}createFilterInstance(_,f,$,z){let Q=this.beans.selectableFilter;if(Q?.isSelectable(f))f=Q.getFilterDef(_,f);let{handler:J,handlerParams:q,handlerGenerator:X}=this.createHandler(_,f,$)??{},Y=this.createFilterComp(_,f,$,z,!!J,"init");if(!Y)return{compDetails:null,createFilterUi:null,handler:J,handlerGenerator:X,handlerParams:q};let{compDetails:Z,createFilterUi:G}=Y;if(this.isGlobalButtons){if(!Z.params?.buttons?.length)j(281,{colId:_.getColId()})}return{compDetails:Z,handler:J,handlerGenerator:X,handlerParams:q,createFilterUi:G}}createBaseFilterParams(_,f){let{filterManager:$,rowModel:z}=this.beans;return C(this.gos,{column:_,colDef:_.getColDef(),getValue:this.createGetValue(_),doesRowPassOtherFilter:f?()=>!0:(Q)=>$?.doesRowPassOtherFilters(_.getColId(),Q)??!0,rowModel:z})}createFilterCompParams(_,f,$,z){let Q=this.filterChangedCallbackFactory(_),J=this.createBaseFilterParams(_,z);if(J.filterChangedCallback=Q,J.filterModifiedCallback=z?()=>{}:(q)=>this.filterModified(_,q),f){let q=J,X=_.getColId(),Y=L_(this.model,X);q.model=Y,q.state=this.state.get(X)??{model:Y},q.onModelChange=(Z,G)=>{this.updateStoredModel(X,Z),this.refreshHandlerAndUi(_,Z,"ui",!1,G).then(()=>{Q({...G,source:"columnFilter"})})},q.onStateChange=(Z)=>{this.updateState(_,Z),this.updateOrRefreshFilterUi(_)},q.onAction=(Z,G,E)=>{this.updateModel(_,Z,G),this.dispatchLocalEvent({type:"filterAction",column:_,action:Z,event:E})},q.getHandler=()=>this.getHandler(_,!0),q.onUiChange=(Z)=>this.filterUiChanged(_,Z),q.source=$}return J}createFilterUiForHandler(_,f){return f?{created:!1,create:f,filterParams:_.params,compDetails:_}:null}createFilterUiLegacy(_,f,$){let z=f(),Q={created:!0,create:f,filterParams:_.params,compDetails:_,promise:z};return z.then($),Q}createFilterWrapper(_){let{compDetails:f,handler:$,handlerGenerator:z,handlerParams:Q,createFilterUi:J}=this.createFilterInstance(_,_.getColDef(),this.getDefaultFilter(_),(X)=>X),q=_.getColId();if($)return delete this.initialModel[q],$.init?.({...Q,source:"init",model:L_(this.model,q)}),{column:_,isHandler:!0,handler:$,handlerGenerator:z,handlerParams:Q,filterUi:this.createFilterUiForHandler(f,J)};if(J){let X={column:_,filterUi:null,isHandler:!1};return X.filterUi=this.createFilterUiLegacy(f,J,(Y)=>{X.filter=Y??void 0}),X}return{column:_,filterUi:null,isHandler:!1}}createHandlerFunc(_,f,$){let{gos:z,frameworkOverrides:Q,registry:J}=this.beans,q,X=(H)=>{let W=H.filter;if(sq(W)){let B=W.handler;if(B)return B;if(q=W.doesFilterPass,q)return()=>({doesFilterPass:q});return}return typeof W==="string"?W:void 0},Y=z.get("enableFilterHandlers"),Z=Y?X(f):void 0,G=(H)=>()=>this.createBean(J.createDynamicBean(H,!0)),E,U;if(typeof Z==="string"){let H=z.get("filterHandlers")?.[Z];if(H!=null)E=H;else if(QL.has(Z))E=G(Z),U=Z}else E=Z;if(!E){let H,{compName:W,jsComp:B,fwComp:K}=eq(Q,f);if(W)H=W;else if(B==null&&K==null&&f.filter===!0)H=$;if(U=this.handlerMap[H],U)E=G(U)}if(!E){if(!Y)return;if(o(z))j(277,{colId:_.getColId()});return jL}return{filterHandler:E,handlerNameOrCallback:q??U}}createHandler(_,f,$){let z=this.createHandlerFunc(_,f,$);if(!z)return;let Q=tQ(this.beans.userCompFactory,f,this.createFilterCompParams(_,!0,"init")),{handlerNameOrCallback:J,filterHandler:q}=z,{handler:X,handlerParams:Y}=this.createHandlerFromFunc(_,q,Q);return{handler:X,handlerParams:Y,handlerGenerator:J??q}}createHandlerFromFunc(_,f,$){let z=_.getColDef(),Q=f(C(this.gos,{column:_,colDef:z})),J=this.createHandlerParams(_,$);return{handler:Q,handlerParams:J}}createHandlerParams(_,f){let $=_.getColDef(),z=_.getColId(),Q=this.filterChangedCallbackFactory(_);return C(this.gos,{colDef:$,column:_,getValue:this.createGetValue(_),doesRowPassOtherFilter:(J)=>this.beans.filterManager?.doesRowPassOtherFilters(z,J)??!0,onModelChange:(J,q)=>{this.updateStoredModel(z,J),this.refreshHandlerAndUi(_,J,"handler",!1,q).then(()=>{Q({...q,source:"columnFilter"})})},onModelAsStringChange:()=>{_.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:_})},filterParams:f})}onColumnsChanged(){let _=[],{colModel:f,filterManager:$,groupFilter:z}=this.beans;this.allColumnFilters.forEach((J,q)=>{let X;if(J.column.isPrimary())X=f.getColDefCol(q);else X=f.getCol(q);if(X&&X===J.column)return;_.push(J.column),this.disposeFilterWrapper(J,"columnChanged"),this.disposeColumnListener(q)});let Q=z&&_.every((J)=>z.isGroupFilter(J));if(_.length>0&&!Q)$?.onFilterChanged({columns:_,source:"api"})}isFilterAllowed(_){if(!_.isFilterAllowed())return!1;let $=this.beans.groupFilter;if($?.isGroupFilter(_))return $.isFilterAllowed(_);return!0}getFloatingFilterCompDetails(_,f){let{userCompFactory:$,frameworkOverrides:z,selectableFilter:Q,gos:J}=this.beans,q=(H)=>{this.getOrCreateFilterUi(_)?.then((B)=>{H(d0(B))})},X=_.getColDef(),Y=Q?.isSelectable(X)?Q.getFilterDef(_,X):X,Z=eJ(z,Y,()=>this.getDefaultFloatingFilter(_))??"agReadOnlyFloatingFilter",G=J.get("enableFilterHandlers"),E=tQ($,Y,this.createFilterCompParams(_,G,"init",!0)),U=C(J,{column:_,filterParams:E,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(_),parentFilterInstance:q,showParentFilter:f});if(G){let H=U,W=_.getColId(),B=this.filterChangedCallbackFactory(_);H.onUiChange=(K)=>this.floatingFilterUiChanged(_,K),H.model=L_(this.model,W),H.onModelChange=(K,L)=>{this.updateStoredModel(W,K),this.refreshHandlerAndUi(_,K,"floating",!0,L).then(()=>{B({...L,source:"columnFilter"})})},H.getHandler=()=>this.getHandler(_,!0),H.source="init"}return WJ($,X,U,Z)}getCurrentFloatingFilterParentModel(_){return this.getModelFromFilterWrapper(this.cachedFilter(_)??{column:_})}destroyFilterUi(_,f,$,z){if(_.isHandler){let J=f.getColId();delete this.initialModel[J],this.state.delete(J);let q=_.filterUi,X=this.createFilterUiForHandler($,z);_.filterUi=X;let Y=this.eventSvc;if(q?.created)q.promise.then((Z)=>{this.destroyBean(Z),Y.dispatchEvent({type:"filterDestroyed",source:"paramsUpdated",column:f})});else Y.dispatchEvent({type:"filterHandlerDestroyed",source:"paramsUpdated",column:f})}else this.destroyFilter(f,"paramsUpdated")}destroyFilter(_,f="api"){let $=_.getColId(),z=this.allColumnFilters.get($);if(this.disposeColumnListener($),delete this.initialModel[$],z)this.disposeFilterWrapper(z,f).then((Q)=>{if(Q&&this.isAlive())this.beans.filterManager?.onFilterChanged({columns:[_],source:"api"})})}disposeColumnListener(_){let f=this.allColumnListeners.get(_);if(f)this.allColumnListeners.delete(_),f()}disposeFilterWrapper(_,f){let $=!1,{column:z,isHandler:Q,filterUi:J}=_,q=z.getColId();if(Q)$=this.isHandlerActive(z),this.destroyBean(_.handler),delete this.model[q],this.state.delete(q);let X=()=>{this.setColFilterActive(z,!1,"filterDestroyed"),this.allColumnFilters.delete(q),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:f,column:z})};if(J)if(J.created)return J.promise.then((Y)=>{return $=Q?$:!!Y?.isFilterActive(),this.destroyBean(Y),X(),$});else X();return g.resolve($)}filterChangedCallbackFactory(_){return(f)=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:f,columns:[_],column:_,source:f?.source??"columnFilter"})}}filterParamsChanged(_,f="api"){let $=this.allColumnFilters.get(_);if(!$)return;let z=this.beans,Q=$.column,J=Q.getColDef(),q=Q.isFilterAllowed(),X=this.getDefaultFilter(Q),Y=z.selectableFilter,Z=Y?.isSelectable(J)?Y.getFilterDef(Q,J):J,G=q?this.createHandlerFunc(Q,Z,this.getDefaultFilter(Q)):void 0,E=!!G,U=$.isHandler;if(U!=E){this.destroyFilter(Q,"paramsUpdated");return}let{compDetails:H,createFilterUi:W}=(q?this.createFilterComp(Q,Z,X,(K)=>K,E,"colDef"):null)??{compDetails:null,createFilterUi:null},B=H?.params??tQ(z.userCompFactory,Z,this.createFilterCompParams(Q,E,"colDef"));if(U){let K=G?.handlerNameOrCallback??G?.filterHandler,L=L_(this.model,_);if($.handlerGenerator!=K){let F=$.handler,{handler:D,handlerParams:M}=this.createHandlerFromFunc(Q,G.filterHandler,B);if($.handler=D,$.handlerParams=M,$.handlerGenerator=K,delete this.model[_],D.init?.({...M,source:"init",model:null}),this.destroyBean(F),L!=null)this.beans.filterManager?.onFilterChanged({columns:[Q],source:f})}else{let F=this.createHandlerParams(Q,H?.params);$.handlerParams=F,$.handler.refresh?.({...F,source:"colDef",model:L})}}if(this.areFilterCompsDifferent($.filterUi?.compDetails??null,H)||!$.filterUi||!H){this.destroyFilterUi($,Q,H,W);return}$.filterUi.filterParams=B,Qf($,U)?.then((K)=>{if((K?.refresh?K.refresh(B):!0)===!1)this.destroyFilterUi($,Q,H,W);else this.dispatchLocalEvent({type:"filterParamsChanged",column:Q,params:B})})}refreshHandlerAndUi(_,f,$,z,Q){let J=this.cachedFilter(_);if(!J){if(z)this.getOrCreateFilterWrapper(_,!0);return g.resolve()}if(!J.isHandler)return g.resolve();let{filterUi:q,handler:X,handlerParams:Y}=J;return UQ(()=>{if(q){let{created:Z,filterParams:G}=q;if(Z)return q.promise.then((E)=>{return E?{filter:E,filterParams:G}:void 0});else q.refreshed=!0}return g.resolve(void 0)},X,Y,f,this.state.get(_.getColId())??{model:f},$,Q)}setColumnFilterWrapper(_,f){let $=_.getColId();this.allColumnFilters.set($,f),this.allColumnListeners.set($,this.addManagedListeners(_,{colDefChanged:()=>this.filterParamsChanged($)})[0])}areFilterCompsDifferent(_,f){if(!f||!_)return!0;let{componentClass:$}=_,{componentClass:z}=f;return!($===z||$?.render&&z?.render&&$.render===z.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some((f)=>f.getColDef().floatingFilter)}getFilterInstance(_){let f=this.beans.colModel.getColDefCol(_);if(!f)return Promise.resolve(void 0);let $=this.getOrCreateFilterUi(f);if(!$)return Promise.resolve(null);return new Promise((z)=>{$.then((Q)=>{z(d0(Q))})})}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:_,source:f})=>this.setModel(_,f)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:_,model:f,resolve:$})=>{this.setModelForColumn(_,f).then(()=>$())}),this.columnModelUpdates=[]}getModelForColumn(_,f){if(f){let{state:z,model:Q}=this,J=_.getColId(),q=z.get(J);if(q)return q.model??null;return L_(Q,J)}let $=this.cachedFilter(_);return $?this.getModelFromFilterWrapper($):null}setModelForColumn(_,f){if(this.beans.dataTypeSvc?.isPendingInference){let $=()=>{},z=new Promise((Q)=>{$=Q});return this.columnModelUpdates.push({key:_,model:f,resolve:$}),z}return new Promise(($)=>{this.setModelForColumnLegacy(_,f).then((z)=>$(z))})}getStateForColumn(_){return this.state.get(_)??{model:L_(this.model,_)}}setModelForColumnLegacy(_,f){let $=this.beans.colModel.getColDefCol(_),z=$?this.getOrCreateFilterWrapper($,!0):null;return z?this.setModelOnFilterWrapper(z,f):g.resolve()}setColDefPropsForDataType(_,f,$){let z=_.filter,Q=z===!0?this.getDefaultFilterFromDataType(()=>f.baseDataType):z;if(typeof Q!=="string")return;let J,q,X=this.beans,{filterParams:Y,filterValueGetter:Z}=_;if(Q==="agMultiColumnFilter")({filterParams:J,filterValueGetter:q}=X.multiFilter?.getParamsForDataType(Y,Z,f,$)??{});else({filterParams:J,filterValueGetter:q}=aJ(Q,Y,Z,f,$,X,this.getLocaleTextFunc()));if(_.filterParams=J,q)_.filterValueGetter=q}setColFilterActive(_,f,$,z){if(_.filterActive!==f)_.filterActive=f,_.dispatchColEvent("filterActiveChanged",$);_.dispatchColEvent("filterChanged",$,z)}setModelOnFilterWrapper(_,f,$){return new g((z)=>{if(_.isHandler){let J=_.column,q=J.getColId(),X=this.model[q];if(this.updateStoredModel(q,f),$&&f===X){z();return}this.refreshHandlerAndUi(J,f,"api").then(()=>z());return}let Q=Qf(_);if(Q){Q.then((J)=>{if(typeof J?.setModel!=="function"){j(65),z();return}(J.setModel(f)||g.resolve()).then(()=>z())});return}z()})}updateStoredModel(_,f){if(v(f))this.model[_]=f;else delete this.model[_];let $=this.state.get(_),z={model:f,state:$?.state};this.state.set(_,z)}filterModified(_,f){this.getOrCreateFilterUi(_)?.then(($)=>{this.eventSvc.dispatchEvent({type:"filterModified",column:_,filterInstance:$,...f})})}filterUiChanged(_,f){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"filterUiChanged",column:_,...f})}floatingFilterUiChanged(_,f){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:_,...f})}updateModel(_,f,$){let z=_.getColId(),Q=this.cachedFilter(_),J=()=>Q?.filterUi;Cz({action:f,filterParams:Q?.filterUi?.filterParams,getFilterUi:J,getModel:()=>L_(this.model,z),getState:()=>this.state.get(z),updateState:(q)=>this.updateState(_,q),updateModel:(q)=>J()?.filterParams?.onModelChange(q,{...$,fromAction:f}),processModelToApply:Q?.isHandler?Q.handler.processModelToApply?.bind(Q.handler):void 0})}updateAllModels(_,f){let $=[];if(this.allColumnFilters.forEach((z,Q)=>{let J=this.beans.colModel.getColDefCol(Q);if(J)Cz({action:_,filterParams:z.filterUi?.filterParams,getFilterUi:()=>z.filterUi,getModel:()=>L_(this.model,Q),getState:()=>this.state.get(Q),updateState:(q)=>this.updateState(J,q),updateModel:(q)=>{this.updateStoredModel(Q,q),this.dispatchLocalEvent({type:"filterAction",column:J,action:_}),$.push(this.refreshHandlerAndUi(J,q,"ui"))},processModelToApply:z?.isHandler?z.handler.processModelToApply?.bind(z.handler):void 0})}),$.length)g.all($).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:f,columns:[]})})}updateOrRefreshFilterUi(_){let f=_.getColId();g5(()=>this.cachedFilter(_)?.filterUi,()=>L_(this.model,f),()=>this.state.get(f))}updateState(_,f){this.state.set(_.getColId(),f),this.dispatchLocalEvent({type:"filterStateChanged",column:_,state:f})}canApplyAll(){let{state:_,model:f,activeFilterComps:$}=this;for(let Q of $)if(Q.source==="COLUMN_MENU")return!1;let z=!1;for(let Q of _.keys()){let J=_.get(Q);if(J.valid===!1)return!1;if((J.model??null)!==L_(f,Q))z=!0}return z}hasUnappliedModel(_){let{model:f,state:$}=this;return($.get(_)?.model??null)!==L_(f,_)}setGlobalButtons(_){this.isGlobalButtons=_,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:_})}shouldKeepStateOnDetach(_,f){if(f==="newFiltersToolPanel")return!0;let $=this.beans.filterPanelSvc;if($?.isActive)return!!$.getState(_.getColId());return!1}onPivotModeChanged(_){let{colModel:f,pivotColsSvc:$}=this.beans,z=!!C0(this.gos),Q=_.currentValue,J=Q?this.activeColumnFilters:this.activeAggregateFilters,q=Q?this.activeAggregateFilters:this.activeColumnFilters,X=[];for(let Y of J){let Z=f.getColById(Y.colId),G=Q&&!!$?.columns.length;if(Z&&Q===n9(Z,Q,G,z))q.push(Y),X.push(Y)}K$(J,X)}destroy(){super.destroy(),this.allColumnFilters.forEach((_)=>this.disposeFilterWrapper(_,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function OL(_){return!!_.filterManager?.isAnyFilterPresent()}function PL(_,f="api"){_.filterManager?.onFilterChanged({source:f})}var vL=class extends A{constructor(){super(...arguments);this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(_){this.quickFilter=_.quickFilter,this.advancedFilter=_.advancedFilter,this.colFilter=_.colFilter}postConstruct(){let _=this.refreshFiltersForAggregations.bind(this),f=this.updateAdvFilterColumns.bind(this);if(this.addManagedEventListeners({columnValueChanged:_,columnPivotChanged:_,columnPivotModeChanged:_,newColumnsLoaded:f,columnVisible:f,advancedFilterEnabledChanged:({enabled:z})=>this.onAdvFilterEnabledChanged(z),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter)this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});let{gos:$}=this;this.alwaysPassFilter=$.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=$.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){let _=this.gos.getCallback("isExternalFilterPresent");return typeof _==="function"&&_({})}doesExternalFilterPass(_){let f=this.gos.get("doesExternalFilterPass");return typeof f==="function"&&f(_)}setFilterState(_,f,$="api"){if(this.isAdvFilterEnabled())return;this.colFilter?.setState(_,f,$)}setFilterModel(_,f="api",$){if(this.isAdvFilterEnabled()){if(!$)this.warnAdvFilters();return}this.colFilter?.setModel(_,f)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(_){if(_){if(this.colFilter?.disableFilters())this.onFilterChanged({source:"advancedFilter"})}else if(this.advancedFilter?.isFilterPresent())this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"})}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){if(C0(this.gos)&&this.isAnyFilterPresent())this.onFilterChanged()}onFilterChanged(_={}){let{source:f,additionalEventAttributes:$,columns:z=[]}=_;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(_):g.resolve()).then(()=>{let Q={source:f,type:"filterChanged",columns:z};if($)H_(Q,$);this.eventSvc.dispatchEvent(Q),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!C0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(_,f){return this.doesRowPassFilter({rowNode:f,colIdToSkip:_})}doesRowPassAggregateFilters(_){let{rowNode:f}=_;if(this.alwaysPassFilter?.(f))return!0;if(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(f))return!1;if(this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(f,_.colIdToSkip,!0))return!1;return!0}doesRowPassFilter(_){let{rowNode:f}=_;if(this.alwaysPassFilter?.(f))return!0;if(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(f))return!1;if(this.externalFilterPresent&&!this.doesExternalFilterPass(f))return!1;if(this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(f,_.colIdToSkip))return!1;if(this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(f))return!1;return!0}isFilterAllowed(_){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.isFilterAllowed(_)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(_,f="api"){if(!this.isAdvFilterEnabled())return;if(this.beans.dataTypeSvc?.isPendingInference){this.advFilterModelUpdateQueue.push(_);return}this.advancedFilter.setModel(_??null),this.onFilterChanged({source:f})}toggleAdvFilterBuilder(_,f){if(!this.isAdvFilterEnabled())return;this.advancedFilter.getCtrl().toggleFilterBuilder({source:f,force:_})}updateAdvFilterColumns(){if(!this.isAdvFilterEnabled())return;if(this.advancedFilter.updateValidity())this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(_){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve(void 0);return this.colFilter?.getFilterInstance(_)??Promise.resolve(void 0)}warnAdvFilters(){j(68)}setupAdvFilterHeaderComp(_){this.advancedFilter?.getCtrl().setupHeaderComp(_)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(let _ of this.advFilterModelUpdateQueue)this.setAdvFilterModel(_);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(_,f){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve();return this.colFilter?.setModelForColumn(_,f)??Promise.resolve()}};function TL(_){return{tag:"div",cls:_}}var _2=class extends w{constructor(_){let{className:f="ag-filter-apply-panel"}=_??{};super(TL(f));this.listeners=[],this.validationMessage=null,this.className=f}updateButtons(_,f){let $=this.buttons;if(this.buttons=_,$===_)return;let z=this.getGui();f_(z);let Q;this.destroyListeners();let J=document.createDocumentFragment(),q=this.className,X=({type:Z,label:G})=>{let E=(L)=>{this.dispatchLocalEvent({type:Z,event:L})};if(!["apply","clear","reset","cancel"].includes(Z))j(75);let U=Z==="apply",W=z_({tag:"button",attrs:{type:U&&f?"submit":"button"},ref:`${Z}FilterButton`,cls:`ag-button ag-standard-button ${q}-button${U?" "+q+"-apply-button":""}`,children:G});if(this.activateTabIndex([W]),U)Q=W;let B=(L)=>{if(L.key===S.ENTER)L.preventDefault(),E(L)},K=this.listeners;W.addEventListener("click",E),K.push(()=>W.removeEventListener("click",E)),W.addEventListener("keydown",B),K.push(()=>W.removeEventListener("keydown",B)),J.append(W)};for(let Z of _)X(Z);this.eApply=Q;let Y=this.validationTooltipFeature;if(Q&&!Y)this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1000}));else if(!Q&&Y)this.validationTooltipFeature=this.destroyBean(Y);z.append(J)}getApplyButton(){return this.eApply}updateValidity(_,f=null){let $=this.eApply;if(!$)return;a6($,!_),this.validationMessage=f,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage)}destroyListeners(){for(let _ of this.listeners)_();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}};var f2=class extends w{constructor(_,f,$,z,Q,J){super();this.column=_,this.wrapper=f,this.eventParent=$,this.updateModel=z,this.isGlobalButtons=Q,this.enableGlobalButtonCheck=J,this.hidePopup=null,this.applyActive=!1}postConstruct(){let{comp:_,params:f}=this.wrapper,$=f,z=$.useForm,Q=z?"form":"div";if(this.setTemplate({tag:Q,cls:"ag-filter-wrapper"}),z)this.addManagedElementListeners(this.getGui(),{submit:(J)=>{J?.preventDefault()},keydown:this.handleKeyDown.bind(this)});this.appendChild(_.getGui()),this.params=$,this.resetButtonsPanel($),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:J,params:q})=>{if(J===this.column)this.resetButtonsPanel(q,this.params)},filterStateChanged:({column:J,state:q})=>{if(J===this.column)this.eButtons?.updateValidity(q.valid!==!1)},filterAction:({column:J,action:q,event:X})=>{if(J===this.column)this.afterAction(q,X)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:J})=>{if(J!==this.isGlobalButtons){this.isGlobalButtons=J;let q=this.params;this.resetButtonsPanel(q,q,!0)}}}:void 0})}afterGuiAttached(_){if(_)this.hidePopup=_.hidePopup}resetButtonsPanel(_,f,$){let{buttons:z,readOnly:Q}=f??{},{buttons:J,readOnly:q,useForm:X}=_;if(!$&&Q===q&&wz(z,J))return;let Y=J&&J.length>0&&!_.readOnly&&!this.isGlobalButtons,Z=this.eButtons;if(Y){let G=J.map((E)=>{let U=`${E}Filter`;return{type:E,label:XX(this,U)}});if(this.applyActive=V$(this.params),!Z){Z=this.createBean(new _2),this.appendChild(Z.getGui());let E=this.column,U=(H)=>({event:W})=>{this.updateModel(E,H,{fromButtons:!0}),this.afterAction(H,W)};Z?.addManagedListeners(Z,{apply:U("apply"),clear:U("clear"),reset:U("reset"),cancel:U("cancel")}),this.eButtons=Z}Z.updateButtons(G,X)}else if(this.applyActive=!1,Z)T_(Z.getGui()),this.eButtons=this.destroyBean(Z)}close(_){let f=this.hidePopup;if(!f)return;let $=_,z=$?.key,Q;if(z===S.ENTER||z===S.SPACE)Q={keyboardEvent:$};f(Q),this.hidePopup=null}afterAction(_,f){let{params:$,applyActive:z}=this,Q=$?.closeOnApply;switch(_){case"apply":{if(f?.preventDefault(),Q&&z)this.close(f);break}case"reset":{if(Q&&z)this.close();break}case"cancel":{if(Q)this.close(f);break}}}handleKeyDown(_){if(!_.defaultPrevented&&_.key===S.ENTER&&this.applyActive)this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",_)}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},IL=":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}",yL={tag:"div",cls:"ag-filter"},$2=class extends w{constructor(_,f,$){super(yL);this.column=_,this.source=f,this.enableGlobalButtonCheck=$,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return this.wrapper!=null}getFilter(){return this.wrapper?.then((_)=>_.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??g.resolve()}afterGuiAttached(_){this.afterGuiAttachedParams=_,this.wrapper?.then((f)=>{this.comp?.afterGuiAttached(_),f?.comp?.afterGuiAttached?.(_)})}afterGuiDetached(){this.wrapper?.then((_)=>{_?.comp?.afterGuiDetached?.()})}createFilter(_){let{column:f,source:$,beans:{colFilter:z}}=this,Q=z.getFilterUiForDisplay(f)??null;this.wrapper=Q,Q?.then((J)=>{if(!J)return;let{isHandler:q,comp:X}=J,Y;if(q){let Z=!!this.enableGlobalButtonCheck,G=this.createBean(new f2(f,J,z,z.updateModel.bind(z),Z&&z.isGlobalButtons,Z));this.comp=G,Y=G.getGui()}else if(this.registerCSS(IL),Y=X.getGui(),!v(Y))j(69,{guiFromFilter:Y});if(this.appendChild(Y),_)this.eventSvc.dispatchEvent({type:"filterOpened",column:f,source:$,eGui:this.getGui()});else X.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(_){let{source:f,column:$}=_;if((f==="api"||f==="paramsUpdated")&&$.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column))f_(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter()}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},bL=class extends A{constructor(){super(...arguments);this.beanName="filterMenuFactory"}wireBeans(_){this.popupSvc=_.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(_,f,$,z){if(_&&!_.isColumn)return;this.showPopup(_,(Q)=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:_},type:$,mouseEvent:f,ePopup:Q})},$,f.target,E_(this.gos),z)}showMenuAfterButtonClick(_,f,$,z){if(_&&!_.isColumn)return;let Q=-1,J="left",q=E_(this.gos);if(!q&&this.gos.get("enableRtl"))Q=1,J="right";let X=q?void 0:4*Q,Y=q?void 0:4;this.showPopup(_,(Z)=>{this.popupSvc?.positionPopupByComponent({type:$,eventSource:f,ePopup:Z,nudgeX:X,nudgeY:Y,alignSide:J,keepWithinBounds:!0,position:"under",additionalParams:{column:_}})},$,f,q,z)}showPopup(_,f,$,z,Q,J){let q=_?this.createBean(new $2(_,"COLUMN_MENU")):void 0;if(this.activeMenu=q,!q?.hasFilter()||!_){e(57);return}let X=z_({tag:"div",cls:`ag-menu${!Q?" ag-filter-menu":""}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(X,{keydown:(B)=>this.trapFocusWithin(B,X)}),X.appendChild(q?.getGui());let Y,Z=()=>q?.afterGuiDetached(),G=qJ(this.gos)?z??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,E=(B)=>{B$(_,!1,"contextMenu");let K=B instanceof KeyboardEvent;if(this.tabListener)this.tabListener=this.tabListener();if(K&&z&&A_(z))oz(z)?.focus({preventScroll:!0});Z(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,$,_),J?.()},U=this.getLocaleTextFunc(),H=Q&&$!=="columnFilter"?U("ariaLabelColumnMenu","Column Menu"):U("ariaLabelColumnFilter","Column Filter"),W=this.popupSvc?.addPopup({modal:!0,eChild:X,closeOnEsc:!0,closedCallback:E,positionCallback:()=>f(X),anchorToElement:G,ariaLabel:H});if(W)this.hidePopup=Y=W.hideFunc;q.afterInit().then(()=>{f(X),q.afterGuiAttached({container:$,hidePopup:Y})}),B$(_,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,$,_)}trapFocusWithin(_,f){if(_.key!==S.TAB||_.defaultPrevented||V_(this.beans,f,!1,_.shiftKey))return;_.preventDefault(),F_(f,_.shiftKey)}dispatchVisibleChangedEvent(_,f,$){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:_,switchingTab:!1,key:f,column:$??null,columnGroup:null})}isMenuEnabled(_){return _.isFilterAllowed()&&(_.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},CL=class extends A{constructor(){super(...arguments);this.beanName="filterValueSvc"}getValue(_,f,$){if(!f)return;let z=_.getColDef(),{selectableFilter:Q,valueSvc:J,formula:q}=this.beans,X=$??Q?.getFilterValueGetter(_.getColId())??z.filterValueGetter;if(X)return this.executeFilterValueGetter(X,f.data,_,f,z);let Y=J.getValue(_,f,"data");if(_.isAllowFormula()&&q?.isFormula(Y))return q.resolveValue(_,f);return Y}executeFilterValueGetter(_,f,$,z,Q){let{expressionSvc:J,valueSvc:q}=this.beans,X=C(this.gos,{data:f,node:z,column:$,colDef:Q,getValue:q.getValueCallback.bind(q,z)});if(typeof _==="function")return _(X);return J?.evaluate(_,X)}};function wL(_){return!!_.quickFilter?.isFilterPresent()}function xL(_){return _.quickFilter?.getText()}function NL(_){_.quickFilter?.resetCache()}var gL=class extends A{constructor(){super(...arguments);this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){let _=this.resetCache.bind(this),f=this.gos;this.addManagedEventListeners({columnPivotModeChanged:_,newColumnsLoaded:_,columnRowGroupChanged:_,columnVisible:()=>{if(!f.get("includeHiddenColumnsInQuickFilter"))this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",($)=>this.setFilter($.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(f.get("quickFilterText")),this.parser=f.get("quickFilterParser"),this.matcher=f.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){let{autoColSvc:_,colModel:f,gos:$,pivotResultCols:z}=this.beans,Q=f.isPivotMode(),J=_?.getColumns(),q=f.getColDefCols(),X=(Q&&!$.get("applyQuickFilterBeforePivotOrAgg")?z?.getPivotResultCols()?.list:q)??[];if(J)X=X.concat(J);this.colsToUse=$.get("includeHiddenColumnsInQuickFilter")?X:X.filter((Y)=>Y.isVisible()||Y.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(_){let f=this.gos.get("cacheQuickFilter");if(this.matcher)return this.doesRowPassMatcher(f,_);return this.quickFilterParts.every(($)=>f?this.doesRowPassCache(_,$):this.doesRowPassNoCache(_,$))}resetCache(){this.beans.rowModel.forEachNode((_)=>_.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){let{quickFilter:_,parser:f}=this;if(_)this.quickFilterParts=f?f(_):_.split(" ");else this.quickFilterParts=null}parseFilter(_){if(!v(_))return null;return _.toUpperCase()}setFilter(_){if(_!=null&&typeof _!=="string"){j(70,{newFilter:_});return}let f=this.parseFilter(_);if(this.quickFilter!==f)this.quickFilter=f,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}setParserAndMatcher(){let _=this.gos.get("quickFilterParser"),f=this.gos.get("quickFilterMatcher"),$=_!==this.parser||f!==this.matcher;if(this.parser=_,this.matcher=f,$)this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}onColumnConfigChanged(){if(this.refreshCols(),this.resetCache(),this.isFilterPresent())this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(_,f){return this.colsToUse.some(($)=>{let z=this.getTextForColumn($,_);return v(z)&&z.includes(f)})}doesRowPassCache(_,f){return this.checkGenerateAggText(_),_.quickFilterAggregateText.includes(f)}doesRowPassMatcher(_,f){let $;if(_)this.checkGenerateAggText(f),$=f.quickFilterAggregateText;else $=this.getAggText(f);let{quickFilterParts:z,matcher:Q}=this;return Q(z,$)}checkGenerateAggText(_){if(!_.quickFilterAggregateText)_.quickFilterAggregateText=this.getAggText(_)}getTextForColumn(_,f){let $=this.beans.filterValueSvc.getValue(_,f),z=_.getColDef();if(z.getQuickFilterText){let Q=C(this.gos,{value:$,node:f,data:f.data,column:_,colDef:z});$=z.getQuickFilterText(Q)}return v($)?$.toString().toUpperCase():null}getAggText(_){let f=[];for(let $ of this.colsToUse){let z=this.getTextForColumn($,_);if(v(z))f.push(z)}return f.join(` -`)}},hL={moduleName:"ClientSideRowModelFilter",version:c,rowModels:["clientSide"],beans:[d3]},h5={moduleName:"FilterCore",version:c,beans:[vL],apiFunctions:{isAnyFilterPresent:OL,onFilterChanged:PL},css:[ZL],dependsOn:[hL]},u5={moduleName:"FilterValue",version:c,beans:[CL]},i5={moduleName:"ColumnFilter",version:c,beans:[VL,bL],dynamicBeans:{headerFilterCellCtrl:JL},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:GL,getColumnFilterInstance:EL,destroyFilter:UL,setFilterModel:HL,getFilterModel:WL,getColumnFilterModel:BL,setColumnFilterModel:KL,showColumnFilter:LL,hideColumnFilter:FL,getColumnFilterHandler:DL,doFilterAction:ML},dependsOn:[h5,$1,u5,sJ]};var uL={moduleName:"QuickFilterCore",version:c,rowModels:["clientSide"],beans:[gL],dependsOn:[h5,u5]},m5={moduleName:"QuickFilter",version:c,apiFunctions:{isQuickFilterPresent:wL,getQuickFilter:xL,resetQuickFilter:NL},dependsOn:[uL]};var iL=class extends A{constructor(){super(...arguments);this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(_,f){let $=this.wrapSvc?.wrap(_,f)??f,z=!Hz.has(_),Q=z?this.asyncListeners:this.syncListeners;if(!Q.has(_))Q.set(_,new Set);Q.get(_).add($),this.eventSvc.addListener(_,$,z)}removeListener(_,f){let $=this.wrapSvc?.unwrap(_,f)??f,Q=!!this.asyncListeners.get(_)?.delete($);if(!Q)this.syncListeners.get(_)?.delete($);this.eventSvc.removeListener(_,$,Q)}addGlobalListener(_){let f=this.wrapSvc?.wrapGlobal(_)??_,$=(J,q)=>{if(Hz.has(J))f(J,q)},z=(J,q)=>{if(!Hz.has(J))f(J,q)};this.globalListenerPairs.set(_,{syncListener:$,asyncListener:z});let Q=this.eventSvc;Q.addGlobalListener($,!1),Q.addGlobalListener(z,!0)}removeGlobalListener(_){let{eventSvc:f,wrapSvc:$,globalListenerPairs:z}=this,Q=$?.unwrapGlobal(_)??_;if(z.has(Q)){let{syncListener:q,asyncListener:X}=z.get(Q);f.removeGlobalListener(q,!1),f.removeGlobalListener(X,!0),z.delete(_)}else this.syncGlobalListeners.delete(Q),f.removeGlobalListener(Q,!1)}destroyEventListeners(_,f){_.forEach(($,z)=>{$.forEach((Q)=>this.eventSvc.removeListener(z,Q,f)),$.clear()}),_.clear()}destroyGlobalListeners(_,f){for(let $ of _)this.eventSvc.removeGlobalListener($,f);_.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);let{globalListenerPairs:_,eventSvc:f}=this;_.forEach(({syncListener:$,asyncListener:z})=>{f.removeGlobalListener($,!1),f.removeGlobalListener(z,!0)}),_.clear()}};function mL(_,f,$){_.apiEventSvc?.addListener(f,$)}function cL(_,f,$){_.apiEventSvc?.removeListener(f,$)}function pL(_,f){_.apiEventSvc?.addGlobalListener(f)}function nL(_,f){_.apiEventSvc?.removeGlobalListener(f)}var c5={moduleName:"EventApi",version:c,apiFunctions:{addEventListener:mL,addGlobalListener:pL,removeEventListener:cL,removeGlobalListener:nL},beans:[iL]};function A0(_,f){if(typeof _!=="number")return"";let $=f(),z=$("thousandSeparator",","),Q=$("decimalSeparator",".");return _.toString().replace(".",Q).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${z}`)}var dL="↑",tL="↓",rL={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},lL=class extends w{constructor(){super(rL);this.eValue=V,this.eDelta=V,this.refreshCount=0}init(_){this.refresh(_,!0)}showDelta(_,f){let $=Math.abs(f),z=_.formatValue($),Q=v(z)?z:$,J=f>=0,q=this.eDelta;if(J)q.textContent=dL+Q;else q.textContent=tL+Q;q.classList.toggle("ag-value-change-delta-up",J),q.classList.toggle("ag-value-change-delta-down",!J)}setTimerToRemoveDelta(){this.refreshCount++;let _=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(_===this.refreshCount)this.hideDeltaValue()},2000)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),f_(this.eDelta)}refresh(_,f=!1){let{value:$,valueFormatted:z}=_,{eValue:Q,lastValue:J,beans:q}=this;if($===J)return!1;if(v(z))Q.textContent=z;else if(v($))Q.textContent=$;else f_(Q);if(q.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;let X=$&&typeof $==="object"&&"toNumber"in $?$.toNumber():$,Y=J&&typeof J==="object"&&"toNumber"in J?J.toNumber():J;if(X===Y)return!1;if(typeof X==="number"&&typeof Y==="number"){let Z=X-Y;this.showDelta(_,Z)}if(J)Q.classList.add("ag-value-change-value-highlight");if(!f)this.setTimerToRemoveDelta();return this.lastValue=$,!0}},sL=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",aL={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},oL=class extends w{constructor(){super(aL);this.eCurrent=V,this.refreshCount=0,this.registerCSS(sL)}init(_){this.refresh(_,!0)}addSlideAnimation(){this.refreshCount++;let _=this.refreshCount;this.ePrevious?.remove();let{beans:f,eCurrent:$}=this,z=z_({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=z,z.textContent=$.textContent,this.getGui().insertBefore(z,$),f.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(_!==this.refreshCount)return;this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{if(_!==this.refreshCount)return;this.ePrevious?.remove(),this.ePrevious=null},3000)})}refresh(_,f=!1){let $=_.value;if(n($))$="";if($===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if(!f)this.addSlideAnimation();this.lastValue=$;let z=this.eCurrent;if(v(_.valueFormatted))z.textContent=_.valueFormatted;else if(v(_.value))z.textContent=$;else f_(z);return!0}},eL=class extends A{constructor(){super(...arguments);this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(_,f,$=this.beans.gos.get("cellFlashDuration"),z=this.beans.gos.get("cellFadeDuration")){let Q=this.animations[f];Q.delete(_);let J=Date.now(),q=J+$,X=J+$+z,Y={phase:"flash",flashEndTime:q,fadeEndTime:X};Q.set(_,Y);let Z=`ag-cell-${f}`,G=`${Z}-animation`,{comp:E,eGui:{style:U}}=_;if(E.toggleCss(Z,!0),E.toggleCss(G,!1),U.removeProperty("transition"),U.removeProperty("transition-delay"),this.nextAnimationTime&&q+15{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),$)}),this.nextAnimationTime=q}advanceAnimations(){let _=Date.now(),f=null;for(let $ of Object.keys(this.animations)){let z=this.animations[$],Q=`ag-cell-${$}`,J=`${Q}-animation`;for(let[q,X]of z){if(!q.isAlive()||!q.comp){z.delete(q);continue}let{phase:Y,flashEndTime:Z,fadeEndTime:G}=X,E=Y==="flash"?Z:G;if(!(_+15>=E)){f=Math.min(E,f??1/0);continue}let{comp:H,eGui:{style:W}}=q;switch(Y){case"flash":H.toggleCss(Q,!1),H.toggleCss(J,!0),W.transition=`background-color ${G-Z}ms`,W.transitionDelay=`${Z-_}ms`,f=Math.min(G,f??1/0),X.phase="fade";break;case"fade":H.toggleCss(Q,!1),H.toggleCss(J,!1),W.removeProperty("transition"),W.removeProperty("transition-delay"),z.delete(q);break}}}if(f==null)this.nextAnimationTime=null,this.nextAnimationCycle=null;else if(f)this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),f-_),this.nextAnimationTime=f}onFlashCells(_,f){if(!_.comp)return;let $=g0(_.cellPosition);if(f.cells[$])this.animateCell(_,"highlight")}flashCell(_,f){this.animateCell(_,"data-changed",f?.flashDuration,f?.fadeDuration)}destroy(){for(let _ of Object.keys(this.animations))this.animations[_].clear()}};function _F(_,f={}){let{cellFlashSvc:$}=_;if(!$)return;_.frameworkOverrides.wrapIncoming(()=>{for(let z of _.rowRenderer.getCellCtrls(f.rowNodes,f.columns))$.flashCell(z,f)})}var p5={moduleName:"HighlightChanges",version:c,beans:[eL],userComponents:{agAnimateShowChangeCellRenderer:lL,agAnimateSlideCellRenderer:oL},apiFunctions:{flashCells:_F}};var fF=class extends A{constructor(){super(...arguments);this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",(_)=>{this.onSelectionOptionsChanged(_.currentValue,_.previousValue,Uf(_.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(_){let f=this.columns;if(f==null)return;_.list=f.list.concat(_.list),_.tree=f.tree.concat(_.tree),A$(_)}createColumns(_,f){let $=()=>{J0(this.beans,this.columns?.tree),this.columns=null},z=_.treeDepth,J=(this.columns?.treeDepth??-1)==z,q=this.generateSelectionCols();if(S$(q,this.columns?.list??[])&&J)return;$();let{colGroupSvc:Y}=this.beans,Z=Y?.findDepth(_.tree)??0,G=Y?.balanceTreeForAutoCols(q,Z)??[];this.columns={list:q,tree:G,treeDepth:Z,map:{}},f((U)=>{if(!U)return null;let H=U.filter((W)=>!x0(W));return[...q,...H]})}updateColumns(_){let f=Uf(_.source),{beans:$}=this;for(let z of this.columns?.list??[]){let Q=this.createSelectionColDef(_.currentValue);z.setColDef(Q,null,f),d_($,{state:[EJ(Q,z.colId)]},f)}}getColumn(_){return this.columns?.list.find((f)=>b0(f,_))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){let{gos:_,beans:f}=this,$=_.get("rowSelection");if(typeof $!=="object"||!p0(_))return!1;let z=(f.autoColSvc?.getColumns()?.length??0)>0;if($.checkboxLocation==="autoGroupColumn"&&z)return!1;let Q=!!Zf($),J=Zz($);return Q||J}createSelectionColDef(_){let{gos:f}=this,$=_??f.get("selectionColumnDef"),z=f.get("enableRtl"),{rowSpan:Q,spanRows:J,...q}=$??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:z?"right":"left",comparator(X,Y,Z,G){let E=Z.isSelected(),U=G.isSelected();return E===U?0:E?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...q,colId:pq,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];let _=this.createSelectionColDef(),f=_.colId;this.gos.validateColDef(_,f,!0);let $=new Z0(_,null,f,!1);return this.createBean($),[$]}onSelectionOptionsChanged(_,f,$){let z=f&&typeof f!=="string"?Zf(f):void 0,Q=_&&typeof _!=="string"?Zf(_):void 0,J=z!==Q,q=f&&typeof f!=="string"?Zz(f):void 0,X=_&&typeof _!=="string"?Zz(_):void 0,Y=q!==X,Z=V1(_),G=V1(f);if(J||Y||Z!==G)this.beans.colModel.refreshAll($)}destroy(){J0(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(_,f,$){if(!this.columns?.list.length)return;let z=_.length+f.length+$.length;if(z===0)return;let Q=this.columns.list[0];if(!Q.isVisible())return;let J=()=>{let Y;switch(Q.pinned){case"left":case!0:Y=_;break;case"right":Y=$;break;default:Y=f}if(Y)Q_(Y,Q)};if((this.beans.rowNumbersSvc?.getColumn(nq)?2:1)===z)J()}},$F=':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}';function zF(_,f){if(!f.nodes.every((q)=>{if(q.rowPinned&&!XQ(q))return j(59),!1;if(q.id===void 0)return j(60),!1;return!0}))return;let{nodes:z,source:Q,newValue:J}=f;_.selectionSvc?.setNodesSelected({nodes:z,source:Q??"api",newValue:J})}function QF(_,f,$="apiSelectAll"){_.selectionSvc?.selectAllRowNodes({source:$,selectAll:f})}function JF(_,f,$="apiSelectAll"){_.selectionSvc?.deselectAllRowNodes({source:$,selectAll:f})}function qF(_,f="apiSelectAllFiltered"){_.selectionSvc?.selectAllRowNodes({source:f,selectAll:"filtered"})}function XF(_,f="apiSelectAllFiltered"){_.selectionSvc?.deselectAllRowNodes({source:f,selectAll:"filtered"})}function YF(_,f="apiSelectAllCurrentPage"){_.selectionSvc?.selectAllRowNodes({source:f,selectAll:"currentPage"})}function ZF(_,f="apiSelectAllCurrentPage"){_.selectionSvc?.deselectAllRowNodes({source:f,selectAll:"currentPage"})}function GF(_){return _.selectionSvc?.getSelectedNodes()??[]}function EF(_){return _.selectionSvc?.getSelectedRows()??[]}var UF={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},HF=class extends w{constructor(){super(UF,[h0]);this.eCheckbox=V}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){let _=this.getLocaleTextFunc(),{rowNode:f,eCheckbox:$}=this,z=f.isSelected(),Q=l6(_,z),[J,q]=f.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],X=_(J,q);$.setValue(z,!0),$.setInputAriaLabel(`${X} (${Q})`)}init(_){if(this.rowNode=_.rowNode,this.column=_.column,this.overrides=_.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:n_,click:(z)=>{if(n_(z),this.eCheckbox.isDisabled())return;this.beans.selectionSvc?.handleSelectionEvent(z,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:z,previousValue:Q})=>{let J=typeof z==="object"?dQ(z):void 0,q=typeof Q==="object"?dQ(Q):void 0;if(J!==q)this.onSelectableChanged()}),V6(this.gos)||typeof this.getIsVisible()==="function"){let z=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:z}),this.addManagedListeners(this.rowNode,{dataChanged:z,cellChanged:z}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){let{column:_,rowNode:f,overrides:$,gos:z}=this,Q=f.selectable,J=this.getIsVisible(),q=void 0;if(typeof J==="function"){let E=$?.callbackParams;if(!_)q=J({...E,node:f,data:f.data});else{let U=_.createColumnFunctionCallbackParams(f);q=J({...E,...U})}}else q=J??!1;let X=Q&&!q||!Q&&q,Y=Q||q,Z=z.get("rowSelection"),G=Z&&typeof Z!=="string"?!dQ(Z):!!_?.getColDef().showDisabledCheckboxes;if(this.setVisible(Y&&(X?G:!0)),this.setDisplayed(Y&&(X?G:!0)),Y)this.eCheckbox.setDisabled(X);if($?.removeHidden)this.setDisplayed(Y)}getIsVisible(){let _=this.overrides;if(_)return _.isVisible;let f=this.gos.get("rowSelection");if(f&&typeof f!=="string")return Zf(f);return this.column?.getColDef()?.checkboxSelection}},WF=class{constructor(_,f){this.rowModel=_,this.pinnedRowModel=f,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(_){this.rootId=_.id,this.endId=null,this.cachedRange.length=0}setEndRange(_){this.endId=_.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){let _=this.getRoot(),f=this.getEnd();if(_==null||f==null)return this.cachedRange;this.cachedRange=this.getNodesInRange(_,f)??[]}return this.cachedRange}isInRange(_){if(this.rootId===null)return!1;return this.getRange().some((f)=>f.id===_.id)}getRoot(_){if(this.rootId)return this.getRowNode(this.rootId);if(_)return this.setRoot(_),_}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(_){let f,{rowModel:$,pinnedRowModel:z}=this;if(f??(f=$.getRowNode(_)),z?.isManual())f??(f=z.getPinnedRowById(_,"top")),f??(f=z.getPinnedRowById(_,"bottom"));return f}truncate(_){let f=this.getRange();if(f.length===0)return{keep:[],discard:[]};let $=f[0].id===this.rootId,z=f.findIndex((Q)=>Q.id===_.id);if(z>-1){let Q=f.slice(0,z),J=f.slice(z+1);return this.setEndRange(_),$?{keep:Q,discard:J}:{keep:J,discard:Q}}else return{keep:f,discard:[]}}extend(_,f=!1){let $=this.getRoot();if($==null){let Q=this.getRange().slice();if(f)_.depthFirstSearch((J)=>!J.group&&Q.push(J));return Q.push(_),this.setRoot(_),{keep:Q,discard:[]}}let z=this.getNodesInRange($,_);if(!z)return this.setRoot(_),{keep:[_],discard:[]};if(z.find((Q)=>Q.id===this.endId))return this.setEndRange(_),{keep:this.getRange(),discard:[]};else{let Q=this.getRange().slice();return this.setEndRange(_),{keep:this.getRange(),discard:Q}}}getNodesInRange(_,f){let{pinnedRowModel:$,rowModel:z}=this;if(!$?.isManual())return z.getNodesInRangeForSelection(_,f);if(_.rowPinned==="top"&&!f.rowPinned)return l_($,"top",_,void 0).concat(z.getNodesInRangeForSelection(z.getRow(0),f)??[]);if(_.rowPinned==="bottom"&&!f.rowPinned){let Q=l_($,"bottom",void 0,_),J=z.getRowCount(),q=z.getRow(J-1);return(z.getNodesInRangeForSelection(f,q)??[]).concat(Q)}if(!_.rowPinned&&!f.rowPinned)return z.getNodesInRangeForSelection(_,f);if(_.rowPinned==="top"&&f.rowPinned==="top")return l_($,"top",_,f);if(_.rowPinned==="bottom"&&f.rowPinned==="top"){let Q=l_($,"top",f,void 0),J=l_($,"bottom",void 0,_),q=z.getRow(0),X=z.getRow(z.getRowCount()-1);return Q.concat(z.getNodesInRangeForSelection(q,X)??[]).concat(J)}if(!_.rowPinned&&f.rowPinned==="top")return l_($,"top",f,void 0).concat(z.getNodesInRangeForSelection(z.getRow(0),_)??[]);if(_.rowPinned==="top"&&f.rowPinned==="bottom"){let Q=l_($,"top",_,void 0),J=l_($,"bottom",void 0,f),q=z.getRow(0),X=z.getRow(z.getRowCount()-1);return Q.concat(z.getNodesInRangeForSelection(q,X)??[]).concat(J)}if(_.rowPinned==="bottom"&&f.rowPinned==="bottom")return l_($,"bottom",_,f);if(!_.rowPinned&&f.rowPinned==="bottom"){let Q=l_($,"bottom",void 0,f),J=z.getRow(z.getRowCount());return(z.getNodesInRangeForSelection(_,J)??[]).concat(Q)}return null}},BF=class extends A{constructor(_){super();this.column=_,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(_){let f=this.cbSelectAll;if(f.isDisplayed()&&!f.getGui().contains(d(this.beans)))_.preventDefault(),f.setValue(!f.getValue())}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(_){this.headerCellCtrl=_;let f=this.createManagedBean(new xJ);this.cbSelectAll=f,f.addCss("ag-header-select-all"),Z_(f.getGui(),"presentation"),this.showOrHideSelectAll();let $=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:$,paginationChanged:$,modelUpdated:$}),this.addManagedPropertyListener("rowSelection",({currentValue:z,previousValue:Q})=>{let J=(q)=>typeof q==="string"||!q||q.mode==="singleRow"?void 0:q.selectAll;if(J(z)!==J(Q))this.showOrHideSelectAll();this.updateStateOfCheckbox()}),this.addManagedListeners(f,{fieldValueChanged:this.onCbSelectAll.bind(this)}),f.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(_){if(!this.isAlive())return;this.showOrHideSelectAll(_.source==="uiColumnMoved")}showOrHideSelectAll(_=!1){let f=this.isCheckboxSelection();if(this.cbSelectAllVisible=f,this.cbSelectAll.setDisplayed(f),f)this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox();this.refreshSelectAllLabel(_)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;let _=this.getSelectAllMode(),f=this.beans.selectionSvc,$=this.cbSelectAll,z=f.getSelectAllState(_);$.setValue(z);let Q=f.hasNodesToSelect(_);$.setDisabled(!Q),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(_=!1){let f=this.getLocaleTextFunc(),{headerCellCtrl:$,cbSelectAll:z,cbSelectAllVisible:Q}=this,J=z.getValue(),q=l6(f,J),X=f("ariaRowSelectAll","Press Space to toggle all rows selection");if($.setAriaDescriptionProperty("selectAll",Q?`${X} (${q})`:null),z.setInputAriaLabel(f("ariaHeaderSelection","Column with Header Selection")),!_)$.announceAriaDescription()}checkSelectionType(_){if(!Z$(this.gos))return j(128,{feature:_}),!1;return!0}checkRightRowModelType(_){let{gos:f,rowModel:$}=this.beans;if(!(o(f)||Kf(f)))return j(129,{feature:_,rowModel:$.getType()}),!1;return!0}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;let _=this.cbSelectAll.getValue(),f=this.getSelectAllMode(),$="uiSelectAll";if(f==="currentPage")$="uiSelectAllCurrentPage";else if(f==="filtered")$="uiSelectAllFiltered";let z={source:$,selectAll:f},Q=this.beans.selectionSvc;if(_)Q.selectAllRowNodes(z);else Q.deselectAllRowNodes(z)}isCheckboxSelection(){let{column:_,gos:f,beans:$}=this,J=typeof f.get("rowSelection")==="object"?"headerCheckbox":"headerCheckboxSelection";return n5($,_)&&this.checkRightRowModelType(J)&&this.checkSelectionType(J)}getSelectAllMode(){let _=wq(this.gos,!1);if(_)return _;let{headerCheckboxSelectionCurrentPageOnly:f,headerCheckboxSelectionFilteredOnly:$}=this.column.getColDef();if(f)return"currentPage";if($)return"filtered";return"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function n5({gos:_,selectionColSvc:f},$){let z=_.get("rowSelection"),Q=$.getColDef(),{headerCheckboxSelection:J}=Q,q=!1;if(typeof z==="object"){let Y=x0($),Z=of($);if(V1(z)==="autoGroupColumn"&&Z||Y&&f?.isSelectionColumnEnabled())q=Zz(z)}else if(typeof J==="function")q=J(C(_,{column:$,colDef:Q}));else q=!!J;return q}var KF=class extends A{postConstruct(){let{gos:_,beans:f}=this;this.selectionCtx=new WF(f.rowModel,f.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{let $=V6(_);if($!==this.isRowSelectable)this.isRowSelectable=$,this.updateSelectable()}),this.isRowSelectable=V6(_),this.addManagedEventListeners({cellValueChanged:($)=>this.updateRowSelectable($.node),rowNodeDataChanged:($)=>this.updateRowSelectable($.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new HF}createSelectAllFeature(_){if(n5(this.beans,_))return new BF(_)}isMultiSelect(){return Z$(this.gos)}onRowCtrlSelected(_,f,$){let z=!!_.rowNode.isSelected();_.forEachGui($,(Q)=>{Q.rowComp.toggleCss("ag-row-selected",z);let J=Q.element;if(r6(J,z),J.contains(d(this.beans)))f(Q)})}announceAriaRowSelection(_){if(this.isRowSelectionBlocked(_))return;let f=_.isSelected(),$=this.beans.editSvc?.isEditing({rowNode:_});if(!_.selectable||$)return;let Q=this.getLocaleTextFunc()(f?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${f?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(Q,"rowSelection")}isRowSelectionBlocked(_){return!_.selectable||_.rowPinned&&!XQ(_)||!p0(this.gos)}updateRowSelectable(_,f){let $=_.rowPinned&&_.pinnedSibling?_.pinnedSibling.selectable:this.isRowSelectable?.(_)??!0;return this.setRowSelectable(_,$,f),$}setRowSelectable(_,f,$){if(_.selectable!==f){if(_.selectable=f,_.dispatchRowEvent("selectableChanged"),$)return;if(G$(this.gos)){let Q=this.calculateSelectedFromChildren(_);this.setNodesSelected({nodes:[_],newValue:Q??!1,source:"selectableChanged"});return}if(_.isSelected()&&!_.selectable)this.setNodesSelected({nodes:[_],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(_){let f=!1,$=!1;if(!_.childrenAfterGroup?.length)return _.selectable?_.__selected:null;for(let z=0;z<_.childrenAfterGroup.length;z++){let Q=_.childrenAfterGroup[z],J=Q.isSelected();if(!Q.selectable){let q=this.calculateSelectedFromChildren(Q);if(q===null)continue;J=q}switch(J){case!0:f=!0;break;case!1:$=!0;break;default:return}}if(f&&$)return;if(f)return!0;if($)return!1;if(!_.selectable)return null;return _.__selected}selectRowNode(_,f,$,z="api"){if(f&&_.destroyed)return!1;let Q=!_.selectable&&f,J=_.__selected===f;if(Q||J)return!1;_.__selected=f,_.dispatchRowEvent("rowSelected");let q=_.sibling;if(q&&q.footer&&q.__localEventService)q.dispatchRowEvent("rowSelected");let X=_.pinnedSibling;if(X?.rowPinned&&X.__localEventService)X.dispatchRowEvent("rowSelected");return this.eventSvc.dispatchEvent({...MJ(_,this.gos,"rowSelected"),event:$||null,source:z}),!0}isCellCheckboxSelection(_,f){let $=this.gos.get("rowSelection");if($&&typeof $!=="string"){let z=x0(_)&&Zf($);return _.isColumnFunc(f,z)}else return _.isColumnFunc(f,_.colDef.checkboxSelection)}inferNodeSelections(_,f,$,z){let{gos:Q,selectionCtx:J}=this,q=_.isSelected(),X=G$(Q),Y=E7(Q),Z=U7(Q),G=this.isMultiSelect(),E=z==="rowClicked";if(E&&!(Y||Z))return null;if(f&&$&&G){let U=J.getRoot();if(!U)return null;else if(!U.isSelected()){let H=J.extend(_,X);return{select:[],deselect:H.keep,reset:!1}}else{let H=J.isInRange(_)?J.truncate(_):J.extend(_,X);return{deselect:H.discard,select:H.keep,reset:!1}}}else if(f&&G){let U=J.selectAll?this.beans.rowModel.getRow(0):void 0,H=J.getRoot(U),W=J.isInRange(_)?J.truncate(_):J.extend(_,X);return{select:W.keep,deselect:W.discard,reset:J.selectAll||!!(H&&!H.isSelected())}}else if($){if(E){let U=!q;if(U&&!Y||!U&&!Z)return null;return J.setRoot(_),{node:_,newValue:U,clearSelection:!1}}return J.setRoot(_),{node:_,newValue:!q,clearSelection:!G}}else{J.setRoot(_);let U=H7(Q),H=kz(Q)==="filteredDescendants",W=E&&(!U||!Y);if(H&&q===void 0&&o(Q))return{node:_,newValue:!1,checkFilteredNodes:!0,clearSelection:!G||W};if(E){let B=q?!U:Y;if(B===q&&!W||B&&!Y||!B&&!Z)return null;return{node:_,newValue:B,clearSelection:!G||W,keepDescendants:_.group&&X}}return{node:_,newValue:!q,clearSelection:!G||W}}}},LF=class extends KF{constructor(){super(...arguments);this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();let{gos:_}=this;this.mode=Mz(_),this.groupSelectsDescendants=G$(_),this.groupSelectsFiltered=kz(_)==="filteredDescendants",this.masterSelectsDetail=i2(_)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{let f=G$(_),$=Mz(_),z=kz(_)==="filteredDescendants";if(this.masterSelectsDetail=i2(_)==="detail",f!==this.groupSelectsDescendants||z!==this.groupSelectsFiltered||$!==this.mode)this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=f,this.groupSelectsFiltered=z,this.mode=$}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(_,f,$){if(this.isRowSelectionBlocked(f))return 0;let z=this.inferNodeSelections(f,_.shiftKey,_.metaKey||_.ctrlKey,$);if(z==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in z){if(z.reset)this.resetNodes();else this.selectRange(z.deselect,!1,$);return this.selectRange(z.select,!0,$)}else{let Q=z.checkFilteredNodes?t5(z.node):z.newValue;return this.setNodesSelected({nodes:[z.node],newValue:Q,clearSelection:z.clearSelection,keepDescendants:z.keepDescendants,event:_,source:$})}}setNodesSelected({newValue:_,clearSelection:f,suppressFinishActions:$,nodes:z,event:Q,source:J,keepDescendants:q=!1}){if(z.length===0)return 0;let{gos:X}=this;if(!p0(X)&&_)return j(132),0;if(z.length>1&&!this.isMultiSelect())return j(130),0;let Y=0;for(let Z=0;Z0)this.updateGroupsFromChildrenSelections(J),this.dispatchSelectionChanged(J)}return Y}selectRange(_,f,$){let z=0;if(_.forEach((Q)=>{let J=Q.primaryRow;if(J.group&&this.groupSelectsDescendants)return;if(this.selectRowNode(J,f,void 0,$))z++}),z>0)this.updateGroupsFromChildrenSelections($),this.dispatchSelectionChanged($);return z}selectChildren(_,f,$){let z=this.groupSelectsFiltered?_.childrenAfterAggFilter:_.childrenAfterGroup;if(!z)return 0;return this.setNodesSelected({newValue:f,clearSelection:!1,suppressFinishActions:!0,source:$,nodes:z})}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){let _=[];return this.selectedNodes.forEach((f)=>f.data&&_.push(f.data)),_}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(_){let f=new Map;this.selectedNodes.forEach(($,z)=>{if(_($))f.set(z,$)}),this.selectedNodes=f}updateGroupsFromChildrenSelections(_,f){if(!this.groupSelectsDescendants)return!1;let{gos:$,rowModel:z}=this.beans;if(!o($,z))return!1;let Q=z.rootNode;if(!Q)return!1;let J=!1,q=(X)=>{if(X!==Q){let Y=this.calculateSelectedFromChildren(X);J=this.selectRowNode(X,Y===null?!1:Y,void 0,_)||J}};return R_(Q,this.beans.rowModel.hierarchical,f,q),J}clearOtherNodes(_,f,$){let z=new Map,Q=0;return this.selectedNodes.forEach((J)=>{let q=J.id==_.id;if((f?!DF(_,J):!0)&&!q){let Y=this.selectedNodes.get(J.id);if(Q+=this.setNodesSelected({nodes:[Y],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:$}),this.groupSelectsDescendants&&J.parent)z.set(J.parent.id,J.parent)}}),z.forEach((J)=>{let q=this.calculateSelectedFromChildren(J);this.selectRowNode(J,q===null?!1:q,void 0,$)}),Q}onRowSelected(_){let f=_.node;if(this.groupSelectsDescendants&&f.group)return;if(f.isSelected())this.selectedNodes.set(f.id,f);else this.selectedNodes.delete(f.id)}syncInRowNode(_,f){this.syncInOldRowNode(_,f),this.syncInNewRowNode(_)}createDaemonNode(_){if(!_.id)return;let f=new Df(this.beans);return f.id=_.id,f.data=_.data,f.__selected=_.__selected,f.level=_.level,f}syncInOldRowNode(_,f){if(f&&_.id!==f.id){if(this.selectedNodes.get(f.id)==_)this.selectedNodes.set(f.id,f)}}syncInNewRowNode(_){if(this.selectedNodes.has(_.id))_.__selected=!0,this.selectedNodes.set(_.id,_);else _.__selected=!1}reset(_){let f=this.getSelectionCount();if(this.resetNodes(),f)this.dispatchSelectionChanged(_)}resetNodes(){this.selectedNodes.forEach((_)=>{this.selectRowNode(_,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){let{gos:_,rowModel:f}=this.beans;if(!o(_,f))return;let $=f.getTopLevelNodes();if($===null)return;let z=[];function Q(J){for(let q=0,X=J.length;q{let q=this.selectRowNode(J.primaryRow,!1,void 0,_);z||(z=q)};if(f==="currentPage"||f==="filtered"){if(!$){e(102);return}this.getNodesToSelect(f).forEach(Q)}else this.selectedNodes.forEach(Q),this.reset(_);if(this.selectionCtx.selectAll=!1,$&&this.groupSelectsDescendants){let J=this.updateGroupsFromChildrenSelections(_);z||(z=J)}if(z)this.dispatchSelectionChanged(_)}getSelectedCounts(_){let f=0,$=0;return this.getNodesToSelect(_).forEach((z)=>{if(this.groupSelectsDescendants&&z.group)return;if(z.isSelected())f++;else if(z.selectable)$++}),{selectedCount:f,notSelectedCount:$}}getSelectAllState(_){let{selectedCount:f,notSelectedCount:$}=this.getSelectedCounts(_);return d5(f,$)??null}hasNodesToSelect(_){return this.getNodesToSelect(_).filter((f)=>f.selectable).length>0}getNodesToSelect(_){if(!this.canSelectAll())return[];let f=[],$=(Q)=>f.push(Q);if(_==="currentPage")return this.forEachNodeOnPage((Q)=>{if(!Q.group){$(Q);return}if(!Q.footer&&!Q.expanded){let J=(q)=>{$(q);let X=q.childrenAfterFilter;if(X)for(let Y=0,Z=X.length;Y{let X=this.selectRowNode(q.primaryRow,!0,void 0,z);J||(J=X)}),$.selectAll=!0,o(f)&&this.groupSelectsDescendants){let q=this.updateGroupsFromChildrenSelections(z);J||(J=q)}if(J)this.dispatchSelectionChanged(z)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(_,f,$){if(!_)_=[];if(!Array.isArray(_)){e(103);return}let z=new Set(_),Q=[];if(this.beans.rowModel.forEachNode((J)=>{if(z.has(J.id))Q.push(J)}),$)this.resetNodes();this.setNodesSelected({newValue:!0,nodes:Q,source:f})}canSelectAll(){return o(this.beans.gos)}updateSelectable(_){let{gos:f,rowModel:$}=this.beans;if(!p0(f))return;let z="selectableChanged",Q=o(f)&&this.groupSelectsDescendants,J=[];if(Q){let q=$.rootNode;if(q)R_(q,$.hierarchical,_,(X)=>{let Y=!1;for(let Z of X.childrenAfterGroup)if(Y||(Y=Z.selectable),!Z.group&&!this.updateRowSelectable(Z,!0)&&Z.isSelected())J.push(Z);this.setRowSelectable(X,Y,!0)})}else $.forEachNode((q)=>{if(!this.updateRowSelectable(q,!0)&&q.isSelected())J.push(q)});if(J.length)this.setNodesSelected({nodes:J,newValue:!1,source:z});if(!_&&Q)this.updateGroupsFromChildrenSelections?.(z)}updateSelectableAfterGrouping(_){if(this.updateSelectable(_),this.groupSelectsDescendants){if(this.updateGroupsFromChildrenSelections?.("rowGroupChanged",_))this.dispatchSelectionChanged("rowGroupChanged")}}refreshMasterNodeState(_,f){if(!this.masterSelectsDetail)return;let $=_.detailNode?.detailGridInfo?.api;if(!$)return;let z=FF($);if(_.isSelected()!==z){if(this.selectRowNode(_,z,f,"masterDetail"))this.dispatchSelectionChanged("masterDetail")}if(!z)this.detailSelection.set(_.id,new Set($.getSelectedNodes().map((J)=>J.id)))}setDetailSelectionState(_,f,$){if(!this.masterSelectsDetail)return;if(!Z$(f)){j(269);return}switch(_.isSelected()){case!0:{$.selectAll();break}case!1:{$.deselectAll();break}case void 0:{let z=this.detailSelection.get(_.id);if(z){let Q=[];for(let J of z){let q=$.getRowNode(J);if(q)Q.push(q)}$.setNodesSelected({nodes:Q,newValue:!0,source:"masterDetail"})}break}default:break}}dispatchSelectionChanged(_){this.eventSvc.dispatchEvent({type:"selectionChanged",source:_,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function FF(_){let f=0,$=0;return _.forEachNode((z)=>{if(z.isSelected())f++;else if(z.selectable)$++}),d5(f,$)}function d5(_,f){if(_===0&&f===0)return!1;if(_>0&&f>0)return;return _>0}function DF(_,f){let $=f.parent;while($){if($===_)return!0;$=$.parent}return!1}function t5(_){let f=_.isSelected()===!1,$=_.childrenAfterFilter?.some(t5)??!1;return f||$}var MF={moduleName:"SharedRowSelection",version:c,beans:[fF],css:[$F],apiFunctions:{setNodesSelected:zF,selectAll:QF,deselectAll:JF,selectAllFiltered:qF,deselectAllFiltered:XF,selectAllOnCurrentPage:YF,deselectAllOnCurrentPage:ZF,getSelectedNodes:GF,getSelectedRows:EF}},r5={moduleName:"RowSelection",version:c,rowModels:["clientSide","infinite","viewport"],beans:[LF],dependsOn:[MF]},kF=class extends A{constructor(_,f){super();this.cellCtrl=_,this.staticClasses=[],this.beans=f,this.column=_.column}setComp(_){this.cellComp=_,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){let{column:_,cellComp:f}=this,$=_.colDef,z=$.cellClassRules,Q=this.getCellClassParams(_,$);K5(this.beans.expressionSvc,z===this.cellClassRules?void 0:this.cellClassRules,z,Q,(J)=>f.toggleCss(J,!0),(J)=>f.toggleCss(J,!1)),this.cellClassRules=z}applyUserStyles(){let _=this.column,f=_.colDef,$=f.cellStyle;if(!$)return;let z;if(typeof $==="function"){let Q=this.getCellClassParams(_,f);z=$(Q)}else z=$;if(z)this.cellComp.setUserStyles(z)}applyClassesFromColDef(){let{column:_,cellComp:f}=this,$=_.colDef,z=this.getCellClassParams(_,$);for(let J of this.staticClasses)f.toggleCss(J,!1);let Q=this.beans.cellStyles.getStaticCellClasses($,z);this.staticClasses=Q;for(let J of Q)f.toggleCss(J,!0)}getCellClassParams(_,f){let{value:$,rowNode:z}=this.cellCtrl;return C(this.beans.gos,{value:$,data:z.data,node:z,colDef:f,column:_,rowIndex:z.rowIndex})}},SF=class extends A{constructor(){super(...arguments);this.beanName="cellStyles"}processAllCellClasses(_,f,$,z){K5(this.beans.expressionSvc,void 0,_.cellClassRules,f,$,z),this.processStaticCellClasses(_,f,$)}getStaticCellClasses(_,f){let{cellClass:$}=_;if(!$)return[];let z;if(typeof $==="function")z=$(f);else z=$;if(typeof z==="string")z=[z];return z||[]}createCellCustomStyleFeature(_){return new kF(_,this.beans)}processStaticCellClasses(_,f,$){this.getStaticCellClasses(_,f).forEach((Q)=>{$(Q)})}},l5={moduleName:"CellStyle",version:c,beans:[SF]};var AF={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,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,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,overlayComponent:!0,suppressOverlays:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,groupLockGroupColumns:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!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,renderingMode:!0,columnMenu:!0,suppressSetFilterByDefault:!0,getDataPath:!0,enableCellSpan:!0,enableFilterHandlers:!0,filterHandlers:!0},h_="clientSide",b_="serverSide",U1="infinite",RF={onGroupExpandedOrCollapsed:[h_],refreshClientSideRowModel:[h_],isRowDataEmpty:[h_],forEachLeafNode:[h_],forEachNodeAfterFilter:[h_],forEachNodeAfterFilterAndSort:[h_],resetRowHeights:[h_,b_],applyTransaction:[h_],applyTransactionAsync:[h_],flushAsyncTransactions:[h_],getBestCostNodeSelection:[h_],getServerSideSelectionState:[b_],setServerSideSelectionState:[b_],applyServerSideTransaction:[b_],applyServerSideTransactionAsync:[b_],applyServerSideRowData:[b_],retryServerSideLoads:[b_],flushServerSideAsyncTransactions:[b_],refreshServerSide:[b_],getServerSideGroupLevelState:[b_],refreshInfiniteCache:[U1],purgeInfiniteCache:[U1],getInfiniteRowCount:[U1],isLastRowIndexKnown:[U1,b_],expandAll:[h_,b_],collapseAll:[h_,b_],onRowHeightChanged:[h_,b_],setRowCount:[U1,b_],getCacheBlockState:[U1,b_]},jF={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};function VF(_,f,$){let z=jF[_];if(z){let{version:J,new:q,old:X,message:Y}=z,Z=X??_;return(...G)=>{let E=q?`Please use ${q} instead. `:"";return Yf(`Since ${J} api.${Z} is deprecated. ${E}${Y??""}`),f.apply(f,G)}}let Q=RF[_];if(Q)return(...J)=>{let q=$.rowModel.getType();if(!Q.includes(q)){M1(`api.${_} can only be called when gridOptions.rowModelType is ${Q.join(" or ")}`);return}return f.apply(f,J)};return f}var OF={detailCellRendererCtrl:"SharedMasterDetail",dndSourceComp:"DragAndDrop",fillHandle:"CellSelection",groupCellRendererCtrl:"GroupCellRenderer",headerFilterCellCtrl:"ColumnFilter",headerGroupCellCtrl:"ColumnGroup",rangeHandle:"CellSelection",tooltipFeature:"Tooltip",highlightTooltipFeature:"Tooltip",tooltipStateManager:"Tooltip",groupStrategy:"RowGrouping",treeGroupStrategy:"TreeData",rowNumberRowResizer:"RowNumbers",singleCell:"EditCore",fullRow:"EditCore",agSetColumnFilterHandler:"SetFilter",agMultiColumnFilterHandler:"MultiFilter",agGroupColumnFilterHandler:"GroupFilter",agNumberColumnFilterHandler:"NumberFilter",agBigIntColumnFilterHandler:"BigIntFilter",agDateColumnFilterHandler:"DateFilter",agTextColumnFilterHandler:"TextFilter"},PF={expanded:1,contracted:1,"tree-closed":1,"tree-open":1,"tree-indeterminate":1,pin:1,"eye-slash":1,arrows:1,left:1,right:1,group:1,aggregation:1,pivot:1,"not-allowed":1,chart:1,cross:1,cancel:1,tick:1,first:1,previous:1,next:1,last:1,linked:1,unlinked:1,"color-picker":1,loading:1,menu:1,"menu-alt":1,filter:1,"filter-add":1,columns:1,maximize:1,minimize:1,copy:1,cut:1,paste:1,grip:1,save:1,csv:1,excel:1,"small-down":1,"small-left":1,"small-right":1,"small-up":1,asc:1,desc:1,aasc:1,adesc:1,none:1,up:1,down:1,plus:1,minus:1,settings:1,"checkbox-checked":1,"checkbox-indeterminate":1,"checkbox-unchecked":1,"radio-button-on":1,"radio-button-off":1,eye:1,"column-arrow":1,"un-pin":1,"pinned-top":1,"pinned-bottom":1,"chevron-up":1,"chevron-down":1,"chevron-left":1,"chevron-right":1,edit:1},vF={chart:"MenuCore",cancel:"EnterpriseCore",first:"Pagination",previous:"Pagination",next:"Pagination",last:"Pagination",linked:"IntegratedCharts",loadingMenuItems:"MenuCore",unlinked:"IntegratedCharts",menu:"ColumnHeaderComp",legacyMenu:"ColumnMenu",filter:"ColumnFilter",filterActive:"ColumnFilter",filterAdd:"NewFiltersToolPanel",filterCardCollapse:"NewFiltersToolPanel",filterCardExpand:"NewFiltersToolPanel",filterCardEditing:"NewFiltersToolPanel",filterTab:"ColumnMenu",filtersToolPanel:"FiltersToolPanel",columns:["MenuCore"],columnsToolPanel:["ColumnsToolPanel"],maximize:"EnterpriseCore",minimize:"EnterpriseCore",save:"MenuCore",columnGroupOpened:"ColumnGroupHeaderComp",columnGroupClosed:"ColumnGroupHeaderComp",accordionOpen:"EnterpriseCore",accordionClosed:"EnterpriseCore",accordionIndeterminate:"EnterpriseCore",columnSelectClosed:["ColumnsToolPanel","ColumnMenu"],columnSelectOpen:["ColumnsToolPanel","ColumnMenu"],columnSelectIndeterminate:["ColumnsToolPanel","ColumnMenu"],columnMovePin:"SharedDragAndDrop",columnMoveHide:"SharedDragAndDrop",columnMoveMove:"SharedDragAndDrop",columnMoveLeft:"SharedDragAndDrop",columnMoveRight:"SharedDragAndDrop",columnMoveGroup:"SharedDragAndDrop",columnMoveValue:"SharedDragAndDrop",columnMovePivot:"SharedDragAndDrop",dropNotAllowed:"SharedDragAndDrop",ensureColumnVisible:["ColumnsToolPanel","ColumnMenu"],groupContracted:"GroupCellRenderer",groupExpanded:"GroupCellRenderer",setFilterGroupClosed:"SetFilter",setFilterGroupOpen:"SetFilter",setFilterGroupIndeterminate:"SetFilter",setFilterLoading:"SetFilter",close:"EnterpriseCore",check:"MenuItem",colorPicker:"CommunityCore",groupLoading:"LoadingCellRenderer",overlayLoading:"Overlay",overlayExporting:"Overlay",menuAlt:"ColumnHeaderComp",menuPin:"MenuCore",menuValue:"MenuCore",menuAddRowGroup:["MenuCore","ColumnsToolPanel"],menuRemoveRowGroup:["MenuCore","ColumnsToolPanel"],clipboardCopy:"MenuCore",clipboardCut:"MenuCore",clipboardPaste:"MenuCore",pivotPanel:["ColumnsToolPanel","RowGroupingPanel"],rowGroupPanel:["ColumnsToolPanel","RowGroupingPanel"],valuePanel:"ColumnsToolPanel",columnDrag:"EnterpriseCore",rowDrag:["RowDrag","DragAndDrop"],csvExport:"MenuCore",excelExport:"MenuCore",smallDown:"CommunityCore",selectOpen:"CommunityCore",richSelectOpen:"RichSelect",richSelectRemove:"RichSelect",richSelectLoading:"RichSelect",smallLeft:"CommunityCore",smallRight:"CommunityCore",subMenuOpen:"MenuItem",subMenuOpenRtl:"MenuItem",panelDelimiter:"RowGroupingPanel",panelDelimiterRtl:"RowGroupingPanel",smallUp:"CommunityCore",sortAscending:["MenuCore","Sort"],sortDescending:["MenuCore","Sort"],sortAbsoluteAscending:["MenuCore","Sort"],sortAbsoluteDescending:["MenuCore","Sort"],sortUnSort:["MenuCore","Sort"],advancedFilterBuilder:"AdvancedFilter",advancedFilterBuilderDrag:"AdvancedFilter",advancedFilterBuilderInvalid:"AdvancedFilter",advancedFilterBuilderMoveUp:"AdvancedFilter",advancedFilterBuilderMoveDown:"AdvancedFilter",advancedFilterBuilderAdd:"AdvancedFilter",advancedFilterBuilderRemove:"AdvancedFilter",advancedFilterBuilderSelectOpen:"AdvancedFilter",chartsMenu:"IntegratedCharts",chartsMenuEdit:"IntegratedCharts",chartsMenuAdvancedSettings:"IntegratedCharts",chartsMenuAdd:"IntegratedCharts",chartsColorPicker:"IntegratedCharts",chartsThemePrevious:"IntegratedCharts",chartsThemeNext:"IntegratedCharts",chartsDownload:"IntegratedCharts",checkboxChecked:"CommunityCore",checkboxIndeterminate:"CommunityCore",checkboxUnchecked:"CommunityCore",radioButtonOn:"CommunityCore",radioButtonOff:"CommunityCore",rowPin:"PinnedRow",rowUnpin:"PinnedRow",rowPinBottom:"PinnedRow",rowPinTop:"PinnedRow"},TF=new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),IF=class extends A{constructor(){super(...arguments);this.beanName="validation"}wireBeans(_){this.gridOptions=_.gridOptions,e4(b3)}warnOnInitialPropertyUpdate(_,f){if(_==="api"&&AF[f])j(22,{key:f})}processGridOptions(_){this.processOptions(_,vW())}validateApiFunction(_,f){return VF(_,f,this.beans)}missingUserComponent(_,f,$,z){let Q=j1[f];if(Q)this.gos.assertModuleRegistered(Q,`AG Grid '${_}' component: ${f}`);else j(101,{propertyName:_,componentName:f,agGridDefaults:$,jsComps:z})}missingDynamicBean(_){let f=OF[_];return f?$0(200,{...this.gos.getModuleErrorParams(),moduleName:f,reasonOrId:_}):void 0}checkRowEvents(_){if(bF.has(_))j(10,{eventType:_})}validateIcon(_){if(TF.has(_))j(43,{iconName:_});if(PF[_])return;let f=vF[_];if(f){e(200,{reasonOrId:`icon '${_}'`,moduleName:f,gridScoped:zJ(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."});return}j(134,{iconName:_})}isProvidedUserComp(_){return!!j1[_]}validateColDef(_){this.processOptions(_,FW())}processOptions(_,f){let{validations:$,deprecations:z,allProperties:Q,propertyExceptions:J,objectName:q,docsUrl:X}=f;if(Q&&this.gridOptions.suppressPropertyNamesCheck!==!0)this.checkProperties(_,[...J??[],...Object.keys(z)],Q,q,X);let Y=new Set;if(Object.keys(_).forEach((G)=>{let E=z[G];if(E){let{message:F,version:D}=E;Y.add(`As of v${D}, ${String(G)} is deprecated. ${F??""}`)}let U=_[G];if(U==null||U===!1)return;let H=$[G];if(!H)return;let{dependencies:W,validate:B,supportedRowModels:K,expectedType:L}=H;if(L){let F=typeof U;if(F!==L){Y.add(`${String(G)} should be of type '${L}' but received '${F}' (${U}).`);return}}if(K){let F=this.gridOptions.rowModelType??"clientSide";if(!K.includes(F)){Y.add(`${String(G)} is not supported with the '${F}' row model. It is only valid with: ${K.join(", ")}.`);return}}if(W){let F=this.checkForRequiredDependencies(G,W,_);if(F){Y.add(F);return}}if(B){let F=B(_,this.gridOptions,this.beans);if(F){Y.add(F);return}}}),Y.size>0)for(let G of Y)Yf(G)}checkForRequiredDependencies(_,f,$){let Q=Object.entries(f).filter(([J,q])=>{let X=$[J];return!q.required.includes(X)});if(Q.length===0)return null;return Q.map(([J,q])=>`'${String(_)}' requires '${J}' to be one of [${q.required.map((X)=>{if(X===null)return"null";else if(X===void 0)return"undefined";return X}).join(", ")}]. ${q.reason??""}`).join(` - `)}checkProperties(_,f,$,z,Q){let J=["__ob__","__v_skip","__metadata__"],q=yF(Object.getOwnPropertyNames(_),[...J,...f,...$],$),X=Object.keys(q);for(let Y of X){let Z=q[Y],G=`invalid ${z} property '${Y}' did you mean any of these: ${Z.slice(0,8).join(", ")}.`;if($.includes("context"))G+=` -If you are trying to annotate ${z} with application data, use the '${z}.context' property instead.`;Yf(G)}if(X.length>0&&Q){let Y=this.beans.frameworkOverrides.getDocLink(Q);Yf(`to see all the valid ${z} properties please check: ${Y}`)}}};function yF(_,f,$){let z={},Q=_.filter((J)=>!f.some((q)=>q===J));if(Q.length>0)for(let J of Q)z[J]=u6({inputValue:J,allSuggestions:$}).values;return z}var bF=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),s5={moduleName:"Validation",version:c,beans:[IF]};var x1=class extends A{constructor(){super(...arguments);this.dispatchColumnChangedEvent=cX,this.columns=[],this.columnIndexMap={},this.updateIndexMap=()=>{this.columnIndexMap={},this.columns.forEach((_,f)=>this.columnIndexMap[_.getId()]=f)}}wireBeans(_){this.colModel=_.colModel,this.aggFuncSvc=_.aggFuncSvc,this.visibleCols=_.visibleCols,this.groupHierarchCols=_.groupHierarchyColSvc}sortColumns(_){let{groupHierarchCols:f}=this;this.columns.sort(($,z)=>f?.compareVirtualColumns($,z)??_($,z)),this.updateIndexMap()}setColumns(_,f){this.setColList(_,this.columns,this.eventName,!0,!0,this.columnProcessors.set,f)}addColumns(_,f){this.updateColList(_,this.columns,!0,!0,this.columnProcessors.add,this.eventName,f)}removeColumns(_,f){this.updateColList(_,this.columns,!1,!0,this.columnProcessors.remove,this.eventName,f)}getColumnIndex(_){return this.columnIndexMap[_]}setColList(_=[],f,$,z,Q,J,q){let X=this.colModel.getCols();if(!X||X.length===0)return;let Y=new Map;f.forEach((G,E)=>Y.set(G,E)),f.length=0;for(let G of _){let E=this.colModel.getColDefCol(G);if(E)f.push(E)}f.forEach((G,E)=>{let U=Y.get(G);if(U===void 0){Y.set(G,0);return}if(z&&U!==E)return;Y.delete(G)}),this.updateIndexMap();let Z=this.colModel.getColDefCols();for(let G of Z??[]){let E=f.indexOf(G)>=0;J(G,E,q)}if(Q)this.colModel.refreshCols(!1,q);this.visibleCols.refresh(q),this.dispatchColumnChangedEvent(this.eventSvc,$,[...Y.keys()],q)}updateColList(_=[],f,$,z,Q,J,q){if(!_||_.length===0)return;let X=!1,Y=new Set;for(let G of _){if(!G)continue;let E=this.colModel.getColDefCol(G);if(!E)continue;if(Y.add(E),$){if(f.indexOf(E)>=0)continue;f.push(E)}else{let U=f.indexOf(E);if(U<0)continue;for(let H=U+1;H=0;else if(K)if(T)R=D;else if(y)R=k!=null&&k>=0;else R=!1;else R=$.indexOf(B)>=0;if(R)if(K?M!=null||k!=null:M!=null)z.push(B);else Q.push(B)}let E=(B)=>{let K=B.getColDef();return q(K)??X(K)};z.sort((B,K)=>E(B)-E(K));let U=[],H=this.groupHierarchCols,W=(B)=>{if(H)H.expandColumnInto(U,B);else U.push(B)};z.forEach(W);for(let B of $)if(Q.indexOf(B)>=0)W(B);for(let B of Q)if(U.indexOf(B)<0)W(B);for(let B of $)if(U.indexOf(B)<0)J(B,!1,_);for(let B of U)if($.indexOf(B)<0)J(B,!0,_);return this.columns=U,this.updateIndexMap(),this.columns}restoreColumnOrder(_,f){let $=this.columns,z=this.colModel.getColDefCols();if(!$.length||!z)return _;let Q=Object.keys(f),J=new Set(Q),q=new Set(Q),X=new Set($.map((D)=>{let M=D.getColId();return q.delete(M),M}).concat(Q)),Y=[],Z={},G=0;for(let D=0;D{let M=Z[D];for(let k=H;k>>32-Q,$)}ff(_,f,$,z,Q,J,q){return this.cmn(f&$|~f&z,_,f,Q,J,q)}gg(_,f,$,z,Q,J,q){return this.cmn(f&z|$&~z,_,f,Q,J,q)}hh(_,f,$,z,Q,J,q){return this.cmn(f^$^z,_,f,Q,J,q)}ii(_,f,$,z,Q,J,q){return this.cmn($^(f|~z),_,f,Q,J,q)}md51(_){let f=_.length,$=[1732584193,-271733879,-1732584194,271733878],z;for(z=64;z<=_.length;z+=64)this.md5cycle($,this.md5blk(_.substring(z-64,z)));_=_.substring(z-64);let Q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(z=0;z<_.length;z++)Q[z>>2]|=_.charCodeAt(z)<<(z%4<<3);if(Q[z>>2]|=128<<(z%4<<3),z>55){this.md5cycle($,Q);for(z=0;z<16;z++)Q[z]=0}return Q[14]=f*8,this.md5cycle($,Q),$}md5blk(_){let f=[];for(let $=0;$<64;$+=4)f[$>>2]=_.charCodeAt($)+(_.charCodeAt($+1)<<8)+(_.charCodeAt($+2)<<16)+(_.charCodeAt($+3)<<24);return f}rhex(_){let f="0123456789abcdef".split(""),$="",z=0;for(;z<4;z++)$+=f[_>>z*8+4&15]+f[_>>z*8&15];return $}hex(_){for(let f=0;f<_.length;f++)_[f]=this.rhex(_[f]);return _.join("")}md5(_){return this.hex(this.md51(_))}add32(_,f){return this.ieCompatibility?this.add32Compat(_,f):this.add32Std(_,f)}add32Std(_,f){return _+f&4294967295}add32Compat(_,f){let $=(_&65535)+(f&65535);return(_>>16)+(f>>16)+($>>16)<<16|$&65535}},HQ={"01":"GRID","02":"CHARTS","0102":"BOTH"};var wY=class _{constructor(f){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=f,this.md5=new wF,this.md5.init()}validateLicense(){let f=this.getLicenseDetails(_.licenseKey),$=`AG Grid ${f.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,z=f.suppliedLicenseType===void 0?"":`AG ${f.suppliedLicenseType==="BOTH"?"Grid and AG Charts":f.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(f.missing){if(!this.isWebsiteUrl()||this.isForceWatermark())this.outputMissingLicenseKey($)}else if(f.expired){let Q=_.getGridReleaseDate(),J=_.formatDate(Q);this.outputExpiredKey(f.expiry,J,$,z)}else if(!f.valid)this.outputInvalidLicenseKey(!!f.incorrectLicenseType,$,z);else if(f.isTrial&&f.trialExpired)this.outputExpiredTrialKey(f.expiry,$,z)}static extractExpiry(f){let $=f.substring(f.lastIndexOf("_")+1,f.length);return new Date(parseInt(_.decode($),10))}static extractLicenseComponents(f){let $=f.replace(/[\u200B-\u200D\uFEFF]/g,"");if($=$.replace(/\r?\n|\r/g,""),f.length<=32)return{md5:null,license:f,version:null,isTrial:null};let z=$.length-32,Q=$.substring(z),J=$.substring(0,z),[q,X,Y]=_.extractBracketedInformation($);return{md5:Q,license:J,version:q,isTrial:X,type:Y}}getLicenseDetails(f){let $=_.chartsLicenseManager?"BOTH":"GRID";if(!f?.length)return{licenseKey:f,valid:!1,missing:!0,currentLicenseType:$};let z=_.getGridReleaseDate(),{md5:Q,license:J,version:q,isTrial:X,type:Y}=_.extractLicenseComponents(f),Z=Q===this.md5.md5(J)&&!f.includes("For_Trialing_ag-Grid_Only"),G=void 0,E=void 0,U=null,H=!1,W=void 0;function B(){G=UU,q){case"legacy":case"2":{if(X)B();break}case"3":if(!Y?.length)Z=!1;else if(W=Y,Y!==HQ["01"]&&Y!==HQ["0102"]||$==="BOTH"&&W!=="BOTH")Z=!1,H=!0;else if(X)B()}}if(!Z)return{licenseKey:f,valid:Z,incorrectLicenseType:H,currentLicenseType:$,suppliedLicenseType:W};return{licenseKey:f,valid:Z,expiry:_.formatDate(U),expired:E,version:q,isTrial:X,trialExpired:G,incorrectLicenseType:H,currentLicenseType:$,suppliedLicenseType:W}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){let $=(this.document.defaultView||window).location,{hostname:z=""}=$;return z}isForceWatermark(){let $=(this.document.defaultView||window).location,{pathname:z}=$;return z?z.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(f){let $=["January","February","March","April","May","June","July","August","September","October","November","December"],z=f.getDate(),Q=f.getMonth(),J=f.getFullYear();return z+" "+$[Q]+" "+J}static getGridReleaseDate(){return new Date(parseInt(_.decode(_.RELEASE_INFORMATION),10))}static decode(f){let z="",Q,J,q,X,Y,Z,G,E=0,U=f.replace(/[^A-Za-z0-9+/=]/g,"");while(E>4,J=(Y&15)<<4|Z>>2,q=(Z&3)<<6|G,z=z+String.fromCharCode(Q),Z!=64)z=z+String.fromCharCode(J);if(G!=64)z=z+String.fromCharCode(q)}return z=_.utf8_decode(z),z}static utf8_decode(f){f=f.replace(/rn/g,"n");let $="";for(let z=0;z127&&Q<2048)$+=String.fromCharCode(Q>>6|192),$+=String.fromCharCode(Q&63|128);else $+=String.fromCharCode(Q>>12|224),$+=String.fromCharCode(Q>>6&63|128),$+=String.fromCharCode(Q&63|128)}return $}static setChartsLicenseManager(f){this.chartsLicenseManager=f,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(f){if(v(this.licenseKey)&&this.licenseKey!==f)Vq(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used.");this.licenseKey=f,this.chartsLicenseManager?.setLicenseKey(f,!0)}static extractBracketedInformation(f){if(!f.includes("["))return["legacy",!1,void 0];let $=f.match(/\[(.*?)\]/g).map((X)=>X.replace("[","").replace("]",""));if(!$||$.length===0)return["legacy",!1,void 0];let z=$.filter((X)=>X==="TRIAL").length===1,Q=$.filter((X)=>X.indexOf("v")===0)[0],J=Q?Q.replace("v",""):"legacy",q=HQ[$.filter((X)=>HQ[X])[0]];return[J,z,q]}centerPadAndOutput(f){let $=this.totalMessageLength-f.length}padAndOutput(f,$="*",z=""){}outputInvalidLicenseKey(f,$,z){}outputExpiredTrialKey(f,$,z){}outputMissingLicenseKey(f){}outputExpiredKey(f,$,z,Q){}};wY.RELEASE_INFORMATION="MTc3NDQyNTc0Nzc3NQ==";var WQ=wY,xF='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',NF={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},gF=class extends w{constructor(){super(NF);this.eLicenseTextRef=V,this.registerCSS(xF)}wireBeans(_){this.licenseManager=_.licenseManager}postConstruct(){let _=this.shouldDisplayWatermark();if(this.setDisplayed(_),_)this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5000)}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},hF={selector:"AG-WATERMARK",component:gF},o5=class extends A{constructor(){super(...arguments);this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){let _=this.beans;if(_.withinStudio)this.licenseManager={isDisplayWatermark:()=>!1,getWatermarkMessage:()=>""};else{let f=new WQ(q_(_));this.licenseManager=f,f.validateLicense()}}static getLicenseDetails(_){return new WQ(null).getLicenseDetails(_)}getWatermarkSelector(){return hF}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(_){WQ.setLicenseKey(_)}static setChartsLicenseManager(_){WQ.setChartsLicenseManager(_)}},uF=9525,e5={"0":1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},BQ=`\r -`;function _Y(_,f,$){if(!f&&f!==""&&f!==0)return"";let z=f;if(typeof f==="boolean"){if($)z=$(f)}return` ${_}="${z}"`}function iF(_={}){let z=["version"];if(!_.version)_.version="1.0";if(_.encoding)z.push("encoding");if(_.standalone)z.push("standalone");return``${J}="${_[J]}"`).join(" ")} ?>`}function xY(_,f){let $="";if(_.properties){if(_.properties.prefixedAttributes)_.properties.prefixedAttributes.forEach((Q)=>{for(let J of Object.keys(Q.map))$+=_Y(Q.prefix+J,Q.map[J],f)});if(_.properties.rawMap)for(let Q of Object.keys(_.properties.rawMap))$+=_Y(Q,_.properties.rawMap[Q],f)}let z="<"+_.name+$;if(!_.children&&_.textNode==null)return z+"/>"+BQ;if(_.textNode!=null)return z+">"+_.textNode+""+BQ;if(z+=">"+BQ,_.children)for(let Q of _.children)z+=xY(Q,f);return z+""+BQ}var mF=(_)=>{return Math.round(_*96/72)},N1=(_)=>{return Math.ceil(_*uF)},cF=(_)=>{if(_===void 0)return;let $=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(_||"Automatic");return Math.max($,0)},MQ=(_,f)=>{if(!f)return;let $;if(typeof f==="number")$=f;else $=f({rowIndex:_});return $},pF=(_,f)=>{let{colSpan:$,column:z}=_.position;if(!_.width)return;if($){let Q=f.slice(z-1,z+$-1),J=0;for(let q=0;q{let{rowSpan:$,row:z}=_.position;if(!_.height)return;if($){let Q=0,J=0;for(let q=z;q{let $=iF({encoding:"UTF-8",standalone:"yes"}),z=xY(_);if(f)return z;return`${$}${z}`},Y1=(_)=>{let z=String.fromCharCode,Q=Math.floor(_/26),J=_%26;if(!Q||_===26)return z(65+_-1);if(!J)return Y1(Q-1)+"Z";if(Q<26)return z(65+Q-1)+z(65+J-1);return Y1(Q)+z(65+J-1)},dF=(_)=>{return _.replaceAll(` -`,"_x000a_")},jQ=(_)=>{if(_==null)return null;let f="";for(let $=0;$<_.length;$++){let z=_.charCodeAt($);if(z>=0&&z<=31&&z!==10){let q=`_x${z.toString(16).toUpperCase().padStart(4,"0")}_`;f+=q}else f+=_[$]}return f},tF=(_)=>{let f=[];for(let $ of _.keys()){let z=$.toString(),Q={name:"t",textNode:U_(jQ(z))};if(z.trim().length!==z.length)Q.properties={rawMap:{"xml:space":"preserve"}};f.push({name:"si",children:[Q]})}return f},rF=class extends rJ{constructor(_){super(_);this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=_.formulaSvc,this.config=Object.assign({},_),this.workbook=_.workbook,this.stylesByIds={};for(let $ of this.config.baseExcelStyles)this.stylesByIds[$.id]=$;let f={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[f.id]=f,this.excelStyles=[...this.config.baseExcelStyles,f]}addCustomContent(_){for(let f of _){let $=this.rows.length+1,z;if(!this.config.suppressRowOutline&&f.outlineLevel!=null)z=f.outlineLevel;let Q={height:MQ($,f.height||this.config.rowHeight),cells:(f.cells||[]).map((J,q)=>{let X=this.addImage($,this.columnsToExport[q],J.data?.value),Y=null;if(J.styleId)Y=typeof J.styleId==="string"?[J.styleId]:J.styleId;let Z=this.getStyleId(Y);if(X)return this.createCell(Z,this.getDataTypeForValue(X.value),X.value==null?"":X.value);let G=J.data?.value??"",E=this.getDataTypeForValue(G);if(J.mergeAcross)return this.createMergedCell(Z,E,G,J.mergeAcross);return this.createCell(Z,E,G)}),outlineLevel:z};if(f.collapsed!=null)Q.collapsed=f.collapsed;if(f.hidden!=null)Q.hidden=f.hidden;this.rows.push(Q)}}onNewHeaderGroupingRow(){let _=[],{freezeRows:f,headerRowHeight:$}=this.config;if(this.rows.push({cells:_,height:MQ(this.rows.length+1,$)}),f)this.frozenRowCount++;return{onColumn:(z,Q,J,q,X)=>{let Y=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${Q}`,columnGroup:z});_.push({...this.createMergedCell(this.getStyleId(Y),this.getDataTypeForValue("string"),Q,q),collapsibleRanges:X})}}}onNewHeaderRow(){let{freezeRows:_,headerRowHeight:f}=this.config;if(_)this.frozenRowCount++;return this.onNewRow(this.onNewHeaderColumn,f)}onNewBodyRow(_){let{freezeRows:f,rowHeight:$}=this.config;if(!this.skipFrozenRows)if(f==="headersAndPinnedRows"&&_?.rowPinned==="top")this.frozenRowCount++;else if(typeof f==="function")if(f(C(this.gos,{node:_})))this.frozenRowCount++;else this.skipFrozenRows=!0;else this.skipFrozenRows=!0;let z=this.onNewRow(this.onNewBodyColumn,$);if(_)this.addRowOutlineIfNecessary(_);return z}prepare(_){super.prepare(_),this.columnsToExport=[..._],this.cols=_.map((f,$)=>this.convertColumnToExcel(f,$))}parse(){let _=this.rows.reduce(($,z)=>Math.max($,z.cells.length),0);while(this.cols.length<_)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));let f=this.createWorksheet();return this.addWorksheetToWorkbook(f)}createWorksheet(){let{sheetName:_}=this.config,f;if(_!=null){let $=typeof _==="function"?_(C(this.gos,{})):_;f=String($).substring(0,31)}else f="ag-grid";return{name:f,table:{columns:this.cols,rows:this.rows}}}addRowOutlineIfNecessary(_){let{gos:f,suppressRowOutline:$,rowGroupExpandState:z="expanded"}=this.config;if(f.get("groupHideOpenParents")||$||_.level==null)return;let J=_.footer?1:0,q=b(this.rows);if(_.uiLevel==null||_.level===_.uiLevel){let Y=Math.min(_.level+J,7);q.outlineLevel=Y}if(z==="expanded")return;let X=z==="collapsed";if(_.isExpandable()){let Y=!X&&_.expanded;q.collapsed=!Y}q.hidden=!!_.parent&&_.parent.level!==-1&&(X||this.isAnyParentCollapsed(_.parent))}isAnyParentCollapsed(_){while(_&&_.level!==-1){if(!_.expanded)return!0;_=_.parent}return!1}convertColumnToExcel(_,f){let $=this.config.columnWidth,Q=(_?this.extractHeaderValue(_):void 0)??"",J=_?_.isFilterAllowed():!1;if($){if(typeof $==="number")return{width:$,displayName:Q,filterAllowed:J};return{width:$({column:_,index:f}),displayName:Q,filterAllowed:J}}if(_)return{width:Math.max(_.getActualWidth(),75),displayName:Q,filterAllowed:J};return{displayName:Q,filterAllowed:J}}onNewHeaderColumn(_,f){return($)=>{let z=this.extractHeaderValue($),Q=this.config.styleLinker({rowType:"HEADER",rowIndex:_,value:z,column:$});f.push(this.createCell(this.getStyleId(Q),this.getDataTypeForValue("string"),z))}}onNewBodyColumn(_,f){let $=0,{freezeColumns:z,rightToLeft:Q}=this.config;return(J,q,X)=>{if($>0){$-=1;return}if(!this.skipFrozenColumns){let K=J.getPinned();if(z==="pinned"&&K&&(K===!0||K==="left")!==Q)this.frozenColumnCount++;else if(typeof z==="function"&&z(C(this.gos,{column:J})))this.frozenColumnCount++;else this.skipFrozenColumns=!0}let{value:Y,valueFormatted:Z}=this.extractRowCellValue({column:J,node:X,currentColumnIndex:q,accumulatedRowIndex:_,type:"excel",useRawFormula:!0}),G=Y,E=typeof G==="bigint"?G.toString():G,U=this.config.styleLinker({rowType:"BODY",rowIndex:_,value:G,column:J,node:X}),H=this.getStyleId(U),W=J.getColSpan(X),B=this.addImage(_,J,E);if(B)f.push(this.createCell(H,this.getDataTypeForValue(B.value),B.value==null?"":B.value));else if(W>1)$=W-1,f.push(this.createMergedCell(H,this.getDataTypeForValue(G),E,W-1));else{let K=J.isAllowFormula()&&this.formulaSvc?.isFormula(E),L=this.createCell(H,K?"f":this.getDataTypeForValue(G),K?this.formulaSvc?.updateFormulaByOffset({value:E,rowDelta:_-(X.formulaRowIndex+1),useRefFormat:!1}):E,Z);f.push(L)}}}onNewRow(_,f){let $=[];return this.rows.push({cells:$,height:MQ(this.rows.length+1,f)}),{onColumn:_.bind(this,this.rows.length,$)()}}addWorksheetToWorkbook(_){let{excelStyles:f,config:$}=this;if(this.mapSharedStrings(_),this.frozenColumnCount)$.frozenColumnCount=this.frozenColumnCount;if(this.frozenRowCount)$.frozenRowCount=this.frozenRowCount;return this.workbook.addWorksheet(f,_,$)}mapSharedStrings(_){let f;for(let $ of _.table.rows)for(let z of $.cells){let Q=z.data;if(!Q||Q.type!=="s")continue;let J=Q.value;if(J==null)continue;if(J===""){f??(f=this.workbook.getStringPosition("").toString()),Q.value=f;continue}Q.value=this.workbook.getStringPosition(String(J)).toString()}}getDataTypeForValue(_){if(_===void 0)return"empty";let f="s";try{if(this.isNumerical(_))f="n"}catch($){}return f}getTypeFromStyle(_,f){if(this.isFormula(f))return"f";if(_?.dataType)switch(_.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:j(162,{id:_.id,dataType:_.dataType})}return null}addImage(_,f,$){if(!this.config.addImageToCell)return;let z=this.config.addImageToCell(_,f,$);if(!z)return;return this.workbook.addBodyImageToMap(z.image,_,f,this.columnsToExport,this.config.rowHeight),z}createCell(_,f,$,z){let Q=this.getStyleById(_);if(!Q?.dataType&&f==="s"&&z!=null)$=z;let J=this.getTypeFromStyle(Q,$)||f,{value:q,escaped:X}=this.getCellValue(J,$),Y=[];if(Q)Y.push(_);if(X)Y.push("_quotePrefix");return _=this.getStyleId(Y)||void 0,{styleId:_,data:{type:J,value:q}}}createMergedCell(_,f,$,z){let Q=$==null?"":$;return{styleId:this.getStyleById(_)?_:void 0,data:{type:f,value:f==="s"?String(Q):$},mergeAcross:z}}getCellValue(_,f){let $=!1;if(f==null||_==="s"&&f==="")return{value:"",escaped:!1};if(_==="s"){if(f=String(f),f[0]==="'")$=!0,f=f.slice(1)}else if(_==="f")f=this.addXlfnPrefix(f).slice(1);else if(_==="n"){let z=Number(f);if(isNaN(z))f="";else if(f!=="")f=z.toString()}return{value:f,escaped:$}}addXlfnPrefix(_){if(!_)return _;let f=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return _.replace(f,($,z,Q,J)=>`${z}_xlfn.${Q}${J}`)}getStyleId(_){if(!_?.length)return null;let f=_.filter((z)=>this.stylesByIds[z]!=null);if(!f.length)return null;if(f.length===1)return f[0];let $=f.join("-");if(!this.mixedStyles[$])this.addNewMixedStyle(f);return this.mixedStyles[$].excelID}addNewMixedStyle(_){this.mixedStyleCounter+=1;let f=`mixedStyle${this.mixedStyleCounter}`,$={};for(let Q of _){let J=this.stylesByIds[Q];if(J)H_($,J,!0,!0)}$.id=f;let z=_.join("-");this.mixedStyles[z]={excelID:f,key:z,result:$},this.excelStyles.push($),this.stylesByIds[f]=$}isFormula(_){if(_==null)return!1;let f=String(_);return this.config.autoConvertFormulas&&Bz(f)}isNumerical(_){if(typeof _==="bigint")return!1;return isFinite(_)&&_!==""&&!isNaN(parseFloat(_))}getStyleById(_){if(_==null)return null;return this.stylesByIds[_]||null}},lF={getTemplate(_){let{name:f,ContentType:$,Extension:z,PartName:Q}=_;return{name:f,properties:{rawMap:{Extension:z,PartName:Q,ContentType:$}}}}},sF=lF,bQ=(_)=>_==="jpg"?"jpeg":_,aF={getTemplate({sheetLen:_,hasCustomProperties:f}){let $=Array(_).fill(void 0).map((E,U)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${U+1}.xml`})),z=vf.size,Q=a0.size,J={};i1.forEach((E)=>{J[bQ(E.type)]=!0});let q=Array(z).fill(void 0).map((E,U)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${U+1}.xml`})),X=[];i0.forEach(({name:E})=>{X.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${E}.xml`})});let Y=f?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],Z=Object.keys(J).map((E)=>({name:"Default",ContentType:`image/${E}`,Extension:E}));if(Q)Z.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});let G=[...Z,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...$,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...q,...X,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...Y].map((E)=>sF.getTemplate(E));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:G}}},oF=aF,eF={getTemplate(_){let $=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:_},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:$},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:$}]}}},_D=eF,fD="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",$D=(_)=>{return Object.keys(_).filter(($)=>$&&_[$]!=null).map(($,z)=>({name:"property",properties:{rawMap:{fmtid:fD,pid:(z+2).toString(),name:U_($)??""}},children:[{name:"vt:lpwstr",textNode:U_(jQ(String(_[$])))??""}]}))},zD={getTemplate(_){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:$D(_)}}},QD=zD,fY=(_,f)=>({name:`xdr:${_}`,children:[{name:"xdr:col",textNode:f.col.toString()},{name:"xdr:colOff",textNode:f.offsetX.toString()},{name:"xdr:row",textNode:f.row.toString()},{name:"xdr:rowOff",textNode:f.offsetY.toString()}]}),JD=(_)=>{let f=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(_.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":f.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:f}},qD=(_,f)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:f,name:_.id,descr:_.altText!=null?_.altText:void 0}},children:[JD(_)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),$Y=(_)=>{if(!_.saturation&&!_.tint)return;let f=[];if(_.saturation)f.push({name:"a:satMod",properties:{rawMap:{val:_.saturation*1000}}});if(_.tint)f.push({name:"a:tint",properties:{rawMap:{val:_.tint*1000}}});return f},XD=(_,f)=>{return{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:_.color}},children:$Y(_)},{name:"a:srgbClr",properties:{rawMap:{val:f.color}},children:$Y(f)}]}},YD=(_,f)=>{let $;if(_.transparency){let z=Math.min(Math.max(_.transparency,0),100);$=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(z*1000)}}}]}if(_.recolor){if(!$)$=[];switch(_.recolor.toLocaleLowerCase()){case"grayscale":$.push({name:"a:grayscl"});break;case"sepia":$.push(XD({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":$.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${f}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:$},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},ZD=(_,f)=>{let $={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:f.width,cy:f.height}}}]};if(_.rotation){let J=_.rotation;$.properties={rawMap:{rot:Math.min(Math.max(J,0),360)*60000}}}return{name:"xdr:spPr",children:[$,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},GD=(_)=>{_.fitCell=!!_.fitCell||!_.width||!_.height;let{position:f={},fitCell:$,width:z=0,height:Q=0,totalHeight:J,totalWidth:q}=_,{offsetX:X=0,offsetY:Y=0,row:Z=1,rowSpan:G=1,column:E=1,colSpan:U=1}=f;return{from:{row:Z-1,col:E-1,offsetX:N1(X),offsetY:N1(Y)},to:{row:Z-1+($?1:G-1),col:E-1+($?1:U-1),offsetX:N1(z+X),offsetY:N1(Q+Y)},height:N1(J||Q),width:N1(q||z)}},ED=(_,f,$,z)=>{return{name:"xdr:pic",children:[qD(_,f+1),YD(_,$+1),ZD(_,z)]}},UD={getTemplate(_){let{sheetIndex:f}=_,$=vf.get(f),z=m1.get(f),Q=$.map((J,q)=>{let X=GD(J);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[fY("from",X.from),fY("to",X.to),ED(J,q,z.get(J.id).index,X),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:Q}}},HD=UD,WD={getTemplate(_){let{Id:f,Type:$,Target:z}=_;return{name:"Relationship",properties:{rawMap:{Id:f,Type:$,Target:z}}}}},BD=WD,KD={getTemplate(_){let f=_.map(($)=>BD.getTemplate($));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:f}}},p$=KD,LD={getTemplate(_){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:_.size,uniqueCount:_.size}},children:tF(_)}}},FD=LD,DD=(_)=>{switch(_){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},MD={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},kD=["Dashed","DashDot","DashDotDot"],SD={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},AD={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},RD={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},jD=(_)=>{if(!_)return"none";return SD[_]||_},Of=(_)=>{if(_==null)return _;if(_.charAt(0)==="#")_=_.substring(1);return _.length===6?"FF"+_:_},KQ=(_,f)=>{if(!_)return"thin";let $=DD(f);if(_==="Continuous")return $;let z=MD[_];if($==="medium"&&kD.some((Q)=>Q===z))return`medium${z}`;return`${z.charAt(0).toLowerCase()}${z.substring(1)}`},VD=(_)=>{return AD[_]||"general"},OD=(_)=>{return RD[_]||void 0},b$=(_)=>{return{name:"color",properties:{rawMap:{rgb:Of(_||"#000000")}}}},PD={getTemplate(_){let{left:f,right:$,top:z,bottom:Q,diagonal:J}=_,q=f?[b$(f.color)]:void 0,X=$?[b$($.color)]:void 0,Y=z?[b$(z.color)]:void 0,Z=Q?[b$(Q.color)]:void 0,G=J?[b$(J.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:f?.style}},children:q},{name:"right",properties:{rawMap:{style:$?.style}},children:X},{name:"top",properties:{rawMap:{style:z?.style}},children:Y},{name:"bottom",properties:{rawMap:{style:Q?.style}},children:Z},{name:"diagonal",properties:{rawMap:{style:J?.style}},children:G}]}}},vD=PD,TD={getTemplate(_){return{name:"borders",properties:{rawMap:{count:_.length}},children:_.map((f)=>vD.getTemplate(f))}}},ID=TD,yD=(_)=>{let $=["Context","LeftToRight","RightToLeft"].indexOf(_);return Math.max($,0)},bD={getTemplate(_){let{horizontal:f,indent:$,readingOrder:z,rotate:Q,shrinkToFit:J,vertical:q,wrapText:X}=_;return{name:"alignment",properties:{rawMap:{horizontal:f&&VD(f),indent:$,readingOrder:z&&yD(z),textRotation:Q,shrinkToFit:J,vertical:q&&OD(q),wrapText:X}}}}},CD=bD,wD={getTemplate(_){let f=_.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:_.hideFormula===!0?1:0,locked:f}}}}},xD=wD,ND={getTemplate(_){let{alignment:f,borderId:$,fillId:z,fontId:Q,numFmtId:J,protection:q,quotePrefix:X,xfId:Y}=_,Z=[];if(f)Z.push(CD.getTemplate(f));if(q)Z.push(xD.getTemplate(q));return{name:"xf",properties:{rawMap:{applyAlignment:f?1:void 0,applyProtection:q?1:void 0,applyBorder:$?1:void 0,applyFill:z?1:void 0,borderId:$,fillId:z,applyFont:Q?1:void 0,fontId:Q,applyNumberFormat:J?1:void 0,numFmtId:J,quotePrefix:X?1:void 0,xfId:Y}},children:Z.length?Z:void 0}}},NY=ND,gD={getTemplate(_){return{name:"cellStyleXfs",properties:{rawMap:{count:_.length}},children:_.map((f)=>NY.getTemplate(f))}}},hD=gD,uD={getTemplate(_){let{builtinId:f,name:$,xfId:z}=_;return{name:"cellStyle",properties:{rawMap:{builtinId:f,name:$,xfId:z}}}}},iD=uD,mD={getTemplate(_){return{name:"cellStyles",properties:{rawMap:{count:_.length}},children:_.map((f)=>iD.getTemplate(f))}}},cD=mD,pD={getTemplate(_){return{name:"cellXfs",properties:{rawMap:{count:_.length}},children:_.map((f)=>NY.getTemplate(f))}}},nD=pD,dD={getTemplate(_){let{patternType:f,fgTheme:$,fgTint:z,fgRgb:Q,bgRgb:J,bgIndexed:q}=_,X={name:"patternFill",properties:{rawMap:{patternType:f}}};if($||z||Q)X.children=[{name:"fgColor",properties:{rawMap:{theme:$,tint:z,rgb:Q}}}];if(q||J){if(!X.children)X.children=[];X.children.push({name:"bgColor",properties:{rawMap:{indexed:q,rgb:J}}})}return{name:"fill",children:[X]}}},tD=dD,rD={getTemplate(_){return{name:"fills",properties:{rawMap:{count:_.length}},children:_.map((f)=>tD.getTemplate(f))}}},lD=rD,sD={getTemplate(_){let{size:f,colorTheme:$,color:z="FF000000",fontName:Q="Calibri",family:J,scheme:q,italic:X,bold:Y,strikeThrough:Z,outline:G,shadow:E,underline:U,verticalAlign:H}=_,W=[{name:"sz",properties:{rawMap:{val:f}}},{name:"color",properties:{rawMap:{theme:$,rgb:z}}},{name:"name",properties:{rawMap:{val:Q}}}];if(J)W.push({name:"family",properties:{rawMap:{val:J}}});if(q)W.push({name:"scheme",properties:{rawMap:{val:q}}});if(X)W.push({name:"i"});if(Y)W.push({name:"b"});if(Z)W.push({name:"strike"});if(G)W.push({name:"outline"});if(E)W.push({name:"shadow"});if(U)W.push({name:"u",properties:{rawMap:{val:U}}});if(H)W.push({name:"vertAlign",properties:{rawMap:{val:H}}});return{name:"font",children:W}}},aD=sD,oD={getTemplate(_){return{name:"fonts",properties:{rawMap:{count:_.length}},children:_.map((f)=>aD.getTemplate(f))}}},eD=oD;function _M(_){let f=_.split(/(\[[^\]]*\])/);for(let $=0;$$M.getTemplate(f))}}},QM=zM,VQ,g1,x$,N$,g$,gY,OQ,hY,K2,uY=(_,f)=>{if(_.includes("mixedStyle")&&f>1)_+=`_${f}`;return _},iY=()=>{VQ={base:0},g1=[],x$=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],N$=[{patternType:"none"},{patternType:"gray125"}],g$=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],gY=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],OQ=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],hY=[{builtinId:0,name:"Normal",xfId:0}]},JM=(_)=>{let f=jD(_.pattern),$=Of(_.color),z=Of(_.patternColor),Q=N$.findIndex((J)=>{let{patternType:q,fgRgb:X,bgRgb:Y}=J;return!(q!=f||X!=$||Y!=z)});if(Q===-1)Q=N$.length,N$.push({patternType:f,fgRgb:$,bgRgb:z});return Q},qM=(_)=>{if(e5[_])return e5[_];let f=g1.findIndex(($)=>$.formatCode===_);if(f===-1)f=g1.length+164,g1.push({formatCode:_,numFmtId:f});else f=g1[f].numFmtId;return f},XM=(_)=>{let{borderBottom:f,borderTop:$,borderLeft:z,borderRight:Q}=_,J,q,X,Y,Z,G,E,U;if(z)X=KQ(z.lineStyle,z.weight),E=Of(z.color);if(Q)Y=KQ(Q.lineStyle,Q.weight),U=Of(Q.color);if(f)J=KQ(f.lineStyle,f.weight),Z=Of(f.color);if($)q=KQ($.lineStyle,$.weight),G=Of($.color);let H=g$.findIndex((W)=>{let{left:B,right:K,top:L,bottom:F}=W;if(!B&&(X||E))return!1;if(!K&&(Y||U))return!1;if(!L&&(q||G))return!1;if(!F&&(J||Z))return!1;let{style:D,color:M}=B||{},{style:k,color:R}=K||{},{style:O,color:I}=L||{},{style:T,color:y}=F||{};if(D!=X||M!=E)return!1;if(k!=Y||R!=U)return!1;if(O!=q||I!=G)return!1;if(T!=J||y!=Z)return!1;return!0});if(H===-1)H=g$.length,g$.push({left:{style:X,color:E},right:{style:Y,color:U},top:{style:q,color:G},bottom:{style:J,color:Z},diagonal:{style:void 0,color:void 0}});return H},YM=(_)=>{let{fontName:f="Calibri",color:$,size:z,bold:Q,italic:J,outline:q,shadow:X,strikeThrough:Y,underline:Z,family:G,verticalAlign:E}=_,U=Of($),H=cF(G),W=Z?Z.toLocaleLowerCase():void 0,B=E?E.toLocaleLowerCase():void 0,K=x$.findIndex((L)=>{return!(L.fontName!=f||L.color!=U||L.size!=z||L.bold!=Q||L.italic!=J||L.outline!=q||L.shadow!=X||L.strikeThrough!=Y||L.underline!=W||L.verticalAlign!=B||L.family!=H)});if(K===-1)K=x$.length,x$.push({fontName:f,color:U,size:z,bold:Q,italic:J,outline:q,shadow:X,strikeThrough:Y,underline:W,verticalAlign:B,family:H!=null?H.toString():void 0});return K},ZM=(_)=>{let{alignment:f,borders:$,font:z,interior:Q,numberFormat:J,protection:q,quotePrefix:X}=_,{id:Y}=_,Z=0,G=0,E=0,U=0;if(!Y)return;if(Y=uY(Y,K2),VQ[Y]!=null)return;if(Q)Z=JM(Q);if($)G=XM($);if(z)E=YM(z);if(J)U=qM(J.format);VQ[Y]=OQ.length,OQ.push({alignment:f,borderId:G||0,fillId:Z||0,fontId:E||0,numFmtId:U||0,protection:q,quotePrefix:X,xfId:0})},GM={getTemplate(_){let f=QM.getTemplate(g1),$=eD.getTemplate(x$.map((Y)=>({...Y,size:Y.size!=null?Y.size:_}))),z=lD.getTemplate(N$),Q=ID.getTemplate(g$),J=hD.getTemplate(gY),q=nD.getTemplate(OQ),X=cD.getTemplate(hY);return iY(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[f,$,z,Q,J,q,X,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},EM=(_,f)=>{return VQ[uY(_,f)]||0},UM=(_,f)=>{if(K2=f,K2===1)iY();_.forEach(ZM)},HM=GM,WM={getTemplate(_,f){let{name:$,columns:z,rowRange:Q,displayName:J,showRowStripes:q,showColumnStripes:X,showFilterButtons:Y,highlightFirstColumn:Z,highlightLastColumn:G}=_||{},E=!Q||Q[0]-Q[1]===0;if(!_||!$||!Array.isArray(z)||!z.length||E)return{name:"table"};let U=z.map((F,D)=>({name:"filterColumn",properties:{rawMap:{colId:D.toString(),hiddenButton:Y[D]?0:1}}})),H=`A${Q[0]}`,W=`${Y1(z.length)}${Q[1]}`,B=`${H}:${W}`,K=`${f+1}`,L=f?`${J}_${K}`:J;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:L,displayName:L,ref:B,totalsRowShown:0,id:K}},children:[{name:"autoFilter",properties:{rawMap:{ref:B}},children:U},{name:"tableColumns",properties:{rawMap:{count:z.length}},children:z.map((F,D)=>({name:"tableColumn",properties:{rawMap:{id:(D+1).toString(),name:U_(dF(F)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:Z?1:0,showLastColumn:G?1:0,showRowStripes:q?1:0,showColumnStripes:X?1:0}}}]}}},BM=WM,E0=(_)=>{let[f,$,z,Q]=_;return{name:`a:${f}`,children:[{name:`a:${$}`,properties:{rawMap:{val:z,lastClr:Q}}}]}},KM={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[E0(["dk1","sysClr","windowText","000000"]),E0(["lt1","sysClr","window","FFFFFF"]),E0(["dk2","srgbClr","44546A"]),E0(["lt2","srgbClr","E7E6E6"]),E0(["accent1","srgbClr","4472C4"]),E0(["accent2","srgbClr","ED7D31"]),E0(["accent3","srgbClr","A5A5A5"]),E0(["accent4","srgbClr","FFC000"]),E0(["accent5","srgbClr","5B9BD5"]),E0(["accent6","srgbClr","70AD47"]),E0(["hlink","srgbClr","0563C1"]),E0(["folHlink","srgbClr","954F72"])]}}},LM=KM,P=(_)=>{let[f,$,z,Q]=_;return{name:`a:${f}`,properties:{rawMap:{script:z,typeface:$,panose:Q}}}},FM={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[P(["latin","Calibri Light",void 0,"020F0302020204030204"]),P(["ea",""]),P(["cs",""]),P(["font","游ゴシック Light","Jpan"]),P(["font","맑은 고딕","Hang"]),P(["font","等线 Light","Hans"]),P(["font","新細明體","Hant"]),P(["font","Times New Roman","Arab"]),P(["font","Times New Roman","Hebr"]),P(["font","Tahoma","Thai"]),P(["font","Nyala","Ethi"]),P(["font","Vrinda","Beng"]),P(["font","Shruti","Gujr"]),P(["font","MoolBoran","Khmr"]),P(["font","Tunga","Knda"]),P(["font","Raavi","Guru"]),P(["font","Euphemia","Cans"]),P(["font","Plantagenet Cherokee","Cher"]),P(["font","Microsoft Yi Baiti","Yiii"]),P(["font","Microsoft Himalaya","Tibt"]),P(["font","MV Boli","Thaa"]),P(["font","Mangal","Deva"]),P(["font","Gautami","Telu"]),P(["font","Latha","Taml"]),P(["font","Estrangelo Edessa","Syrc"]),P(["font","Kalinga","Orya"]),P(["font","Kartika","Mlym"]),P(["font","DokChampa","Laoo"]),P(["font","Iskoola Pota","Sinh"]),P(["font","Mongolian Baiti","Mong"]),P(["font","Times New Roman","Viet"]),P(["font","Microsoft Uighur","Uigh"]),P(["font","Sylfaen","Geor"]),P(["font","Arial","Armn"]),P(["font","Leelawadee UI","Bugi"]),P(["font","Microsoft JhengHei","Bopo"]),P(["font","Javanese Text","Java"]),P(["font","Segoe UI","Lisu"]),P(["font","Myanmar Text","Mymr"]),P(["font","Ebrima","Nkoo"]),P(["font","Nirmala UI","Olck"]),P(["font","Ebrima","Osma"]),P(["font","Phagspa","Phag"]),P(["font","Estrangelo Edessa","Syrn"]),P(["font","Estrangelo Edessa","Syrj"]),P(["font","Estrangelo Edessa","Syre"]),P(["font","Nirmala UI","Sora"]),P(["font","Microsoft Tai Le","Tale"]),P(["font","Microsoft New Tai Lue","Talu"]),P(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[P(["latin","Calibri",void 0,"020F0502020204030204"]),P(["ea",""]),P(["cs",""]),P(["font","游ゴシック","Jpan"]),P(["font","맑은 고딕","Hang"]),P(["font","等线","Hans"]),P(["font","新細明體","Hant"]),P(["font","Arial","Arab"]),P(["font","Arial","Hebr"]),P(["font","Tahoma","Thai"]),P(["font","Nyala","Ethi"]),P(["font","Vrinda","Beng"]),P(["font","Shruti","Gujr"]),P(["font","DaunPenh","Khmr"]),P(["font","Tunga","Knda"]),P(["font","Raavi","Guru"]),P(["font","Euphemia","Cans"]),P(["font","Plantagenet Cherokee","Cher"]),P(["font","Microsoft Yi Baiti","Yiii"]),P(["font","Microsoft Himalaya","Tibt"]),P(["font","MV Boli","Thaa"]),P(["font","Mangal","Deva"]),P(["font","Gautami","Telu"]),P(["font","Latha","Taml"]),P(["font","Estrangelo Edessa","Syrc"]),P(["font","Kalinga","Orya"]),P(["font","Kartika","Mlym"]),P(["font","DokChampa","Laoo"]),P(["font","Iskoola Pota","Sinh"]),P(["font","Mongolian Baiti","Mong"]),P(["font","Arial","Viet"]),P(["font","Microsoft Uighur","Uigh"]),P(["font","Sylfaen","Geor"]),P(["font","Arial","Armn"]),P(["font","Leelawadee UI","Bugi"]),P(["font","Microsoft JhengHei","Bopo"]),P(["font","Javanese Text","Java"]),P(["font","Segoe UI","Lisu"]),P(["font","Myanmar Text","Mymr"]),P(["font","Ebrima","Nkoo"]),P(["font","Nirmala UI","Olck"]),P(["font","Ebrima","Osma"]),P(["font","Phagspa","Phag"]),P(["font","Estrangelo Edessa","Syrn"]),P(["font","Estrangelo Edessa","Syrj"]),P(["font","Estrangelo Edessa","Syre"]),P(["font","Nirmala UI","Sora"]),P(["font","Microsoft Tai Le","Tale"]),P(["font","Microsoft New Tai Lue","Talu"]),P(["font","Ebrima","Tfng"])]}]}}},DM=FM,u0=(_,f,$)=>({name:`a:${_}`,properties:{rawMap:{val:f}},children:$}),Q2=(_)=>{let[f,$,z,Q,J,q]=_,X=[];if(X.push(u0("satMod",z)),Q)X.push(u0("lumMod",Q));if(J)X.push(u0("tint",J));if(q)X.push(u0("shade",q));return{name:"a:gs",properties:{rawMap:{pos:f}},children:[{name:"a:schemeClr",properties:{rawMap:{val:$}},children:X}]}},PQ=(_,f)=>({name:"a:solidFill",children:[u0("schemeClr",_,f)]}),L2=(_)=>{let[f,$,z,Q,J]=_,[q,X]=J;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:f}},children:[{name:"a:gsLst",children:[Q2($),Q2(z),Q2(Q)]},{name:"a:lin",properties:{rawMap:{ang:q,scaled:X}}}]}},J2=(_)=>{let[f,$,z,Q]=_;return{name:"a:ln",properties:{rawMap:{w:f,cap:$,cmpd:z,algn:Q}},children:[PQ("phClr"),u0("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},q2=(_)=>{let f=[];if(_){let[$,z,Q,J,q]=_;f.push({name:"a:outerShdw",properties:{rawMap:{blurRad:$,dist:z,dir:Q,algn:J,rotWithShape:q}},children:[u0("srgbClr","000000",[u0("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},f.length?{children:f}:{})]}},MM=()=>({name:"a:fillStyleLst",children:[PQ("phClr"),L2(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),L2(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),kM=()=>({name:"a:lnStyleLst",children:[J2(["6350","flat","sng","ctr"]),J2(["12700","flat","sng","ctr"]),J2(["19050","flat","sng","ctr"])]}),SM=()=>({name:"a:effectStyleLst",children:[q2(),q2(),q2(["57150","19050","5400000","ctr","0"])]}),AM=()=>({name:"a:bgFillStyleLst",children:[PQ("phClr"),PQ("phClr",[u0("tint","95000"),u0("satMod","170000")]),L2(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),RM={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[MM(),kM(),SM(),AM()]}}},jM=RM,VM={getTemplate(){return{name:"a:themeElements",children:[LM.getTemplate(),DM.getTemplate(),jM.getTemplate()]}}},OM=VM,PM={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[OM.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},vM=PM,TM=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),IM=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),yM=(_)=>({name:"v:formulas",children:_.map((f)=>({name:"v:f",properties:{rawMap:{eqn:f}}}))}),bM=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),mY=(_)=>{let{aspectratio:f,rotation:$}=_||{},z={};if(f)z.aspectratio="t";if($)z.rotation="t";return{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:z}}};function CM(_,f,$,z,Q){return(_-f)/($-f)*(Q-z)+z}var wM=(_,f)=>{let $,{recolor:z,brightness:Q,contrast:J,id:q}=_;if(z){if($={},z==="Washout"||z==="Grayscale")$.gain="19661f",$.blacklevel="22938f";if(z==="Black & White"||z==="Grayscale"){if($.grayscale="t",z==="Black & White")$.bilevel="t"}}if(!z||z==="Grayscale"){if(!$)$={};if(J!=null&&J!==50){let X="1";if(J>=0){if(J<50)X=String(J/50);else if(J<100)X=String(50/(100-J));else if(J===100)X="2147483647f"}$.gain=X}if(Q!=null&&Q!==50)$.blacklevel=CM(Q,0,100,-0.5,0.5).toString()}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${f}`,title:q}}],rawMap:$}}},xM=()=>{let _=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[IM(),yM(_),bM(),mY({aspectratio:!0})]}},zY=(_)=>Math.floor((_??0)*0.74999943307122),NM=(_,f)=>{let{width:$=0,height:z=0,altText:Q}=_,J=zY($),q=zY(z);return{name:"v:shape",properties:{rawMap:{id:_.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${J}pt; height: ${q}pt; z-index: ${f+1}`,type:"#_x0000_t75",alt:Q}},children:[wM(_,f+1),mY({rotation:!0})]}},gM={getTemplate(_){let f=a0.get(_.sheetIndex)||[],$=[TM(),xM(),...f.map((z,Q)=>NM(z,Q))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:$}}},hM=gM,uM={getTemplate(_,f){let $=(f+1).toString();return{name:"sheet",properties:{rawMap:{name:_,sheetId:$,"r:id":`rId${$}`}}}}},iM=uM,mM={getTemplate(_){return{name:"sheets",children:_.map((f,$)=>iM.getTemplate(f,$))}}},cM=mM,pM={getTemplate(_,f){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:f}}}]},cM.getTemplate(_)]}}},nM=pM,dM=(_)=>Math.ceil((_-12)/7+1),tM={getTemplate(_){let{min:f,max:$,outlineLevel:z,s:Q,width:J,hidden:q,bestFit:X}=_,Y=1,Z="0";if(J>1)Y=dM(J),Z="1";return{name:"col",properties:{rawMap:{min:f,max:$,outlineLevel:z!=null?z:void 0,width:Y,style:Q,hidden:q?"1":"0",bestFit:X?"1":"0",customWidth:Z}}}}},rM=tM,lM={getTemplate(_){return{name:"mergeCell",properties:{rawMap:{ref:_}}}}},sM=lM,aM=(_)=>{let f=_.charAt(0).toLowerCase();return f==="s"?"inlineStr":f},oM={getTemplate(_,f,$){let{ref:z,data:Q,styleId:J}=_,{type:q,value:X}=Q||{type:"empty",value:null},Y=q;if(q==="f")Y="str";else if(q.charAt(0)===q.charAt(0).toUpperCase())Y=aM(q);let Z={name:"c",properties:{rawMap:{r:z,t:Y==="empty"?void 0:Y,s:J?EM(J,$):void 0}}};if(Y==="empty")return Z;let G;if(Y==="str"&&q==="f")G=[{name:"f",textNode:U_(jQ(X))}];else if(Y==="inlineStr")G=[{name:"is",children:[{name:"t",textNode:U_(jQ(X))}]}];else G=[{name:"v",textNode:X}];return Object.assign({},Z,{children:G})}},eM=oM,_k=(_,f)=>{let $=[],z=0;for(let Q=0;Q<_.length;Q++){let J=_[Q];if(J.mergeAcross)$.push({pos:Q,excelPos:z}),z+=J.mergeAcross;z++}if($.length)for(let Q=$.length-1;Q>=0;Q--){let J=[],q=_[$[Q].pos];for(let X=1;X<=q.mergeAcross;X++)J.push({ref:`${Y1($[Q].excelPos+1+X)}${f+1}`,styleId:q.styleId,data:{type:"empty",value:null}});if(J.length)_.splice($[Q].pos+1,0,...J)}},fk=(_)=>_.data?.value!==""||_.styleId!==void 0,$k={getTemplate(_,f,$){let{collapsed:z,hidden:Q,height:J,outlineLevel:q,cells:X=[]}=_;_k(X,f);let Y=X.filter(fk).map((Z,G)=>eM.getTemplate(Z,G,$));return{name:"row",properties:{rawMap:{r:f+1,collapsed:z?"1":"0",hidden:Q?"1":"0",ht:J,customHeight:J!=null?"1":"0",spans:"1:1",outlineLevel:q||void 0}},children:Y}}},zk=$k,Qk=(_,f,$)=>{let z=[],Q=[];_.forEach((X,Y)=>{let Z=X.cells,G=0,E;Z.forEach((U,H)=>{let W=H+G+1,B=Y1(W),K=Y+1;if(U.mergeAcross){G+=U.mergeAcross;let F=Y1(H+G+1);z.push(`${B}${K}:${F}${K}`)}if(!f[W-1])f[W-1]={};let{collapsibleRanges:L}=U;if(L)L.forEach((F)=>{Q.push([W+F[0],W+F[1]])});E=f[W-1],E.min=W,E.max=W,U.ref=`${B}${K}`})}),Q.sort((X,Y)=>{if(X[0]!==Y[0])return X[0]-Y[0];return Y[1]-X[1]});let J=new Map,q=new Map;return Q.filter((X)=>{let Y=X.toString();if(J.get(Y))return!1;return J.set(Y,!0),!0}).forEach((X)=>{let Y=f.find((G)=>G.min==X[0]&&G.max==X[1]),Z=q.get(X[0]);f.push({min:X[0],max:X[1],outlineLevel:$?void 0:Z||1,width:(Y||{width:100}).width}),q.set(X[0],(Z||0)+1)}),z},Jk=(_)=>{if(!_||_!=="Portrait"&&_!=="Landscape")return"portrait";return _.toLocaleLowerCase()},qk=(_)=>{if(_==null)return 1;let $=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(_);return $===-1?1:$+1},Xk=(_)=>{let f={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(let $ of Object.keys(f))_=_.replace($,f[$]);return _},Yk=(_)=>{if(_==="Center")return"C";if(_==="Right")return"R";return"L"},Zk=(_,f)=>{if(!f)return _;if(_+="&"",_+=f.fontName||"Calibri",f.bold!==f.italic)_+=f.bold?",Bold":",Italic";else if(f.bold)_+=",Bold Italic";else _+=",Regular";if(_+=""",f.size)_+=`&${f.size}`;if(f.strikeThrough)_+="&S";if(f.underline)_+=`&${f.underline==="Double"?"E":"U"}`;if(f.color)_+=`&K${f.color.replace("#","").toUpperCase()}`;return _},Gk=(_,f,$)=>_.reduce((z,Q,J)=>{let q=Yk(Q.position),X=Zk(`${z}&${q}`,Q.font),Y=["Left","Center","Right"];if(!Q.position)Q.position=Y[J];let{image:Z}=Q;if(Q.value==="&[Picture]"&&Z){let G=`${q}${f}${$}`;cY(Z,G)}return`${X}${U_(Xk(Q.value))}`},""),Ek=(_)=>{let f=["all","first","even"],$=[];return f.forEach((z)=>{let Q=_[z],J=z==="all"?"odd":z;if(!Q)return;for(let q of Object.keys(Q)){let X=Q[q],Y=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,Z=q[0].toUpperCase();if(X){let G=z==="all"?"":z.toUpperCase();$.push({name:`${J}${Y}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:Gk(X,Z,G)})}}}),$},Uk=(_)=>{return(f)=>{if(_.length)f.children.push({name:"cols",children:_.map(($)=>rM.getTemplate($))});return f}},Hk=(_,f)=>{return($)=>{if(_.length)$.children.push({name:"sheetData",children:_.map((z,Q)=>zk.getTemplate(z,Q,f))});return $}},Wk=(_)=>{let f=_.length;if(!f)return"";let $=Array(f+1);$[0]=f;for(let Q=1;Q<=f;Q++)$[Q]=_.charCodeAt(Q-1)&255;let z=0;for(let Q=$.length-1;Q>=0;Q--){let J=$[Q],q=(z&16384)===0?0:1,X=z<<1&32767;z=(q|X)^J}return(z^52811).toString(16).toUpperCase().padStart(4,"0")},Bk=(_)=>{return(f)=>{if(!_)return f;let $=typeof _==="boolean"?{}:_,z={sheet:1},Q=$.password?Wk($.password):"";if(Q)z.password=Q;let J={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(J).forEach((q)=>{let X=$[q];if(X==null||X===J[q])return;z[q]=X?0:1}),f.children.push({name:"sheetProtection",properties:{rawMap:z}}),f}},Kk=(_)=>{return(f)=>{if(_.length)f.children.push({name:"mergeCells",properties:{rawMap:{count:_.length}},children:_.map(($)=>sM.getTemplate($))});return f}},Lk=(_)=>{return(f)=>{let{top:$=0.75,right:z=0.7,bottom:Q=0.75,left:J=0.7,header:q=0.3,footer:X=0.3}=_;return f.children.push({name:"pageMargins",properties:{rawMap:{bottom:Q,footer:X,header:q,left:J,right:z,top:$}}}),f}},Fk=(_)=>{return(f)=>{if(_)f.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:Jk(_.orientation),paperSize:qk(_.pageSize)}}});return f}},Dk=(_)=>{return(f)=>{if(!_)return f;let $=_.first!=null?1:0,z=_.even!=null?1:0;return f.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:$,differentOddEven:z}},children:Ek(_)}),f}},Mk=(_)=>{return(f)=>{if(_)f.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++f.rIdCounter}`}}}]});return f}},kk=(_)=>{return(f)=>{if(vf.get(_)?.length)f.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++f.rIdCounter}`}}});return f}},Sk=(_)=>{return(f)=>{if(a0.get(_))f.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++f.rIdCounter}`}}});return f}},Ak=(_=0,f=0)=>{let $=_>0||f>0;return $?[{name:"pane",properties:{rawMap:{state:$?"frozen":void 0,topLeftCell:$?`${Y1(_+1)}${f+1}`:void 0,xSplit:_===0?void 0:_,ySplit:f===0?void 0:f}}}]:void 0},Rk=(_=!1,f,$)=>{return(z)=>{return z.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:_===!0?"1":"0",workbookViewId:"0"}},children:Ak(f,$)}]}),z}},jk=()=>{return(_)=>{return _.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),_}},Vk=(_)=>{return(f)=>{let $=_.reduce((z,Q)=>{if(Q.outlineLevel&&Q.outlineLevel>z)return Q.outlineLevel;return z},0);return f.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:$?$:void 0}}}),f}},Ok={getTemplate(_){let{worksheet:f,currentSheet:$,config:z}=_,{margins:Q={},pageSetup:J,headerFooterConfig:q,suppressColumnOutline:X,rightToLeft:Y,frozenRowCount:Z,frozenColumnCount:G,protectSheet:E}=z,{table:U}=f,{rows:H,columns:W}=U,B=W?.length?Qk(H,W,!!X):[],K=i0.get($),{children:L}=[jk(),Rk(Y,G,Z),Vk(H),Uk(W),Hk(H,$+1),Bk(E),Kk(B),Lk(Q),Fk(J),Dk(q),kk($),Sk($),Mk(K)].reduce((F,D)=>D(F),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:L}}},Pk=Ok,J1=new Map,t_=[],q1=[],X1=new Map,Pf=new Map,vf=new Map,a0=new Map,i1=new Map,m1=new Map,i0=new Map,vk="AG-GRID-TABLE",S2="SINGLE_SHEET";function Tk(){return S2}function Ik(_){S2=_}function yk(_,f,$){Nk(f),UM(_,t_.length);let z=Object.assign({},$);if($.exportAsExcelTable&&$.pivotModeActive)j(163,{featureName:"pivot mode"}),z.exportAsExcelTable=!1;wk(f,z);let Q=fS(f,z);return $S(Q),Q}function bk(_){return _.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function Ck(_,f){if(i0.has(_)){j(164);return}i0.set(_,f)}function wk(_,f){let{exportAsExcelTable:$,prependContent:z,appendContent:Q,headerRowCount:J=0}=f;if(!$)return;let q=typeof $==="boolean"?{}:$,{name:X,showColumnStripes:Y,showRowStripes:Z,showFilterButton:G,highlightFirstColumn:E,highlightLastColumn:U}=q,H=bk(X||vk),W=t_.length-1,{table:B}=_,{rows:K,columns:L}=B,F=z?z.length:0,D=Q?Q.length:0,M=K.length,k=L.length,R=[],O=[];for(let I=0;IJ.id===_.id))Q.push(_)}function xk(_,f,$,z,Q){let J=t_.length,{row:q,column:X}=_.position||{},Y=_;if(z){if(f!=null&&$!=null&&(!q||!X)){if(!_.position)_.position={};_.position=Object.assign({},_.position,{row:f,column:z.indexOf($)+1})}pF(Y,z),nF(Y,Q)}pY({imageToAdd:Y,idx:J});let Z=m1.get(J);if(!Z)Z=new Map,m1.set(J,Z);let G=vf.get(J);if(!G)vf.set(J,[Y]);else G.push(Y);if(!Z.get(_.id))Z.set(_.id,{index:Z.size,type:_.imageType})}function pY(_){let{imageToAdd:f,idx:$}=_,z=Pf.get(f.id);if(z){let Q=z.find((J)=>J.sheetId===$);if(Q)Q.image.push(f);else z.push({sheetId:$,image:[f]})}else Pf.set(f.id,[{sheetId:$,image:[f]}]),i1.set(f.id,{type:f.imageType,index:i1.size})}function Nk(_){let f=U_(_.name)||"",$="";while(t_.indexOf(`${f}${$}`)!==-1)if($==="")$="_1";else $=`_${parseInt($.slice(1),10)+1}`;_.name=`${f}${$}`,t_.push(_.name)}function gk(_){if(J1.has(_))return J1.get(_);return J1.set(_,J1.size),J1.size-1}function hk(){J1.clear(),Pf.clear(),vf.clear(),a0.clear(),i1.clear(),m1.clear(),i0.clear(),t_=[],q1=[],X1=new Map,S2="SINGLE_SHEET"}function uk(_){return w_(nM.getTemplate(t_,_))}function ik(_){return w_(HM.getTemplate(_))}function mk(){return w_(FD.getTemplate(J1))}function ck(_){return w_(_D.getTemplate(_))}function pk(_){return w_(QD.getTemplate(_))}function nk(_,f){return w_(oF.getTemplate({sheetLen:_,hasCustomProperties:f}))}function dk(_){let f=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];if(_)f.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});let $=p$.getTemplate(f);return w_($)}function tk(){return w_(vM.getTemplate())}function rk(_,f){return w_(BM.getTemplate(_,f))}function lk(_){let f=Array(_).fill(void 0).map((z,Q)=>({Id:`rId${Q+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${Q+1}.xml`})),$=p$.getTemplate([...f,{Id:`rId${_+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${_+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${_+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return w_($)}function sk(_){return w_(HD.getTemplate({sheetIndex:_}))}function ak(_){let f=m1.get(_)||[],$=[];for(let[z,Q]of f){let{index:J,type:q}=Q;$.push({Id:`rId${J+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${i1.get(z).index+1}.${bQ(q)}`})}return w_(p$.getTemplate($))}function ok(_){return w_(hM.getTemplate({sheetIndex:_}),!0)}function ek(_){let f=a0.get(_)||[],$=[];for(let z=0;z{if(!_.size)return;let $=new Map;f.forEach((z,Q)=>{if(_.has(z))$.set(Q,_.get(z))}),_.clear(),$.forEach((z,Q)=>_.set(Q,z))},$S=(_)=>{let f=X1.get(_)??[];f.push(t_.length-1),X1.set(_,f),q1.push(_)},zS=(_)=>{let f=new Map(X1),$=[];for(let z of _){let Q=f.get(z);if(!Q?.length)return null;let J=Q.shift();$.push(J),f.set(z,Q)}return $},QS=(_)=>{if(!_.length||q1.length===0)return null;let f=new Set,$=[];for(let z of _){let Q=q1.findIndex((J,q)=>!f.has(q)&&J===z);if(Q===-1)return null;f.add(Q),$.push(Q)}return $},JS=(_)=>{let f=new Map;_.forEach(($,z)=>f.set($,z)),t_=_.map(($)=>t_[$]),q1=_.map(($)=>q1[$]),LQ(vf,_),LQ(a0,_),LQ(i0,_),LQ(m1,_),Pf.forEach(($)=>{$.forEach((z)=>{let Q=f.get(z.sheetId);if(Q!=null)z.sheetId=Q})}),X1=new Map,q1.forEach(($,z)=>{let Q=X1.get($)??[];Q.push(z),X1.set($,Q)})},qS=(_)=>{if(_.length<=1)return;let f=zS(_)??QS(_);if(!f)return;JS(f)},A2=class{getStringPosition(_){return gk(_)}addBodyImageToMap(_,f,$,z,Q){xk(_,f,$,z,Q)}addHeaderFooterImageToMap(_,f){cY(_,f)}addWorksheet(_,f,$){return yk(_,f,$)}syncOrderWithSheetData(_){qS(_)}reset(){hk()}setFactoryMode(_){Ik(_)}getFactoryMode(){return Tk()}getSheetNames(){return[...t_]}},XS=async(_)=>{let f=0,$=[],z=new WritableStream({write:(q)=>{$.push(q),f+=q.length}}),Q=new ReadableStream({start:(q)=>{let X=new FileReader;X.onload=(Y)=>{if(Y.target?.result)q.enqueue(Y.target.result);q.close()},X.readAsArrayBuffer(_)}}),J=new window.CompressionStream("deflate-raw");return await Q.pipeThrough(J).pipeTo(z),{size:f,content:new Blob($)}},YS=async(_)=>{let f=new Blob([_]),{size:$,content:z}=await XS(f),Q=new Uint8Array(await z.arrayBuffer());return{size:$,content:Q}},ZS=(_)=>{let f=_.getHours();return f<<=6,f=f|_.getMinutes(),f<<=5,f=f|_.getSeconds()/2,f},GS=(_)=>{let f=_.getFullYear()-1980;return f<<=4,f=f|_.getMonth()+1,f<<=5,f=f|_.getDate(),f};function C_(_,f){let $="";for(let z=0;z>>=8;return $}var QY=(_)=>{if(!_.length)return 0;let f=-1,$=0,z=0,Q=0;for(let J=0;J<_.length;J++)$=_[J],z=(f^$)&255,Q=ES[z],f=f>>>8^Q;return f^-1},JY=(_)=>{if(!_.length)return 0;if(typeof _==="string")return QY(new TextEncoder().encode(_));return QY(_)},ES=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function US(_){let f=String.fromCharCode;function $(E){let U=[];if(!E)return[];let H=E.length,W=0,B,K;while(W=55296&&B<=56319&&W=55296&&E<=57343)throw Error($0(255,{point:E}))}function Q(E,U){return f(E>>U&63|128)}function J(E){if((E&4294967168)==0)return f(E);let U="";if((E&4294965248)==0)U=f(E>>6&31|192);else if((E&4294901760)==0)z(E),U=f(E>>12&15|224),U+=Q(E,6);else if((E&4292870144)==0)U=f(E>>18&7|240),U+=Q(E,12),U+=Q(E,6);return U+=f(E&63|128),U}let q=$(_),X=q.length,Y=-1,Z,G="";while(++Y{let{content:q,path:X,created:Y}=_,Z=ZS(Y),G=GS(Y),E=JY(Q),U=J!==void 0?J:z,H=US(X),W=H!==X,B="";if(W){let D=C_(1,1)+C_(JY(H),4)+H;B="up"+C_(D.length,2)+D}let K="\x14\x00"+(W?"\x00\b":"\x00\x00")+C_(f?8:0,2)+C_(Z,2)+C_(G,2)+C_(U?E:0,4)+C_(J??z,4)+C_(z,4)+C_(H.length,2)+C_(B.length,2),L="PK\x03\x04"+K+H+B,F="PK\x01\x02\x14\x00"+K+"\x00\x00\x00\x00\x00\x00"+(q?"\x00\x00\x00\x00":"\x10\x00\x00\x00")+C_($,4)+H+B;return{localFileHeader:Uint8Array.from(L,(D)=>D.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(F,(D)=>D.charCodeAt(0))}},dY=(_)=>{let f;if(typeof _==="string"){let $=atob(_.split(";base64,")[1]);f=Uint8Array.from($,(z)=>z.charCodeAt(0))}else f=_;return{size:f.length,content:f}},HS=async(_)=>{let{content:f}=_,{size:$,content:z}=!f?{size:0,content:Uint8Array.from([])}:dY(f),Q,J,q=!1;if(_.type==="file"&&z&&$>0){let Y=await YS(z);Q=Y.content,J=Y.size,q=!0}return{rawContent:z,rawSize:$,deflatedContent:Q,deflatedSize:J,isCompressed:q}},WS=(_,f)=>{let{content:$}=_,{content:z}=!$?{content:Uint8Array.from([])}:dY($);return{...nY(_,!1,f,z.length,z,void 0),content:z,isCompressed:!1}},BS=(_,f,$)=>{let z="PK\x05\x06\x00\x00\x00\x00"+C_(_,2)+C_(_,2)+C_(f,4)+C_($,4)+"\x00\x00";return Uint8Array.from(z,(Q)=>Q.charCodeAt(0))},tY=class{constructor(){this.folders=[],this.files=[]}addFolders(_){_.forEach(this.addFolder.bind(this))}addFolder(_){this.folders.push({path:_,created:new Date,isBase64:!1,type:"folder"})}addFile(_,f,$=!1){this.files.push({path:_,created:new Date,content:$?f:new TextEncoder().encode(f),isBase64:$,type:"file"})}async getZipFile(_="application/zip"){let f=await this.buildCompressedFileStream();return this.clearStream(),new Blob([f],{type:_})}getUncompressedZipFile(_="application/zip"){let f=this.buildFileStream();return this.clearStream(),new Blob([f],{type:_})}clearStream(){this.folders=[],this.files=[]}packageFiles(_){let f=0,$=0;for(let Z of _){let{localFileHeader:G,centralDirectoryHeader:E,content:U}=Z;f+=G.length+U.length,$+=E.length}let z=new Uint8Array(f),Q=new Uint8Array($),J=0,q=0;for(let Z of _){let{localFileHeader:G,centralDirectoryHeader:E,content:U}=Z;z.set(G,J),J+=G.length,z.set(U,J),J+=U.length,Q.set(E,q),q+=E.length}let X=BS(_.length,$,f),Y=new Uint8Array(z.length+Q.length+X.length);return Y.set(z),Y.set(Q,z.length),Y.set(X,z.length+Q.length),Y}async buildCompressedFileStream(){let _=[...this.folders,...this.files],f=await Promise.all(_.map(HS)),$=[],z=0;for(let Q=0;Q<_.length;Q++){let J=_[Q],{rawContent:q,rawSize:X,deflatedContent:Y,deflatedSize:Z,isCompressed:G}=f[Q],E=nY(J,G,z,X,q,Z),U=Y??q;$.push({...E,content:U,isCompressed:G}),z+=E.localFileHeader.length+U.length}return this.packageFiles($)}buildFileStream(){let _=[...this.folders,...this.files],f=[],$=0;for(let z of _){let Q=WS(z,$),{localFileHeader:J,content:q}=Q;f.push(Q),$+=J.length+q.length}return this.packageFiles(f)}},KS=(_)=>{if(_.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!Pf.size)return;_.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let f=0;Pf.forEach(($)=>{let z=$[0].image[0],{base64:Q,imageType:J}=z;_.addFile(`xl/media/image${++f}.${bQ(J)}`,Q,!0)})},LS=(_,f)=>{let $=0,z=0;for(let Q=0;Q0&&vf.has(Q),X=i0.size>0&&i0.get(Q),Y=Pf.size&&a0.has(Q);if(!q&&!X&&!Y)continue;let Z,G,E;if(q)FS(_,Q,$),G=$,$++;if(Y)DS(_,Q,z),E=z,z++;if(X)Z=X.name;let U=`xl/worksheets/_rels/sheet${Q+1}.xml.rels`;_.addFile(U,_S({tableName:Z,drawingIndex:G,vmlDrawingIndex:E}))}},FS=(_,f,$)=>{let Q=`xl/drawings/drawing${$+1}.xml`,J=`xl/drawings/_rels/drawing${$+1}.xml.rels`;_.addFile(J,ak(f)),_.addFile(Q,sk(f))},DS=(_,f,$)=>{let Q=`xl/drawings/vmlDrawing${$+1}.vml`,J=`xl/drawings/_rels/vmlDrawing${$+1}.vml.rels`;_.addFile(Q,ok(f)),_.addFile(J,ek(f))},MS=(_)=>{let f=i0,$=Array.from(f.keys());for(let z=0;z<$.length;z++){let Q=$[z],J=f.get(Q);if(!J)continue;_.addFile(`xl/tables/${J.name}.xml`,rk(J,z))}},kS=(_,f,$,z,Q,J)=>{let q=!!J&&Object.keys(J).some((X)=>J[X]!=null);if(_.addFile("xl/workbook.xml",uk(Q)),_.addFile("xl/styles.xml",ik(f)),_.addFile("xl/sharedStrings.xml",mk()),_.addFile("xl/theme/theme1.xml",tk()),_.addFile("xl/_rels/workbook.xml.rels",lk(z)),_.addFile("docProps/core.xml",ck($)),q)_.addFile("docProps/custom.xml",pk(J));_.addFile("[Content_Types].xml",nk(z,q)),_.addFile("_rels/.rels",dk(q))},rY=(_,f,$={},z)=>{if(!f||f.length===0)return j(159),z.reset(),!1;z.syncOrderWithSheetData(f);let{fontSize:Q=11,author:J="AG Grid",activeTab:q=0,customMetadata:X}=$,Y=f.length,Z=Math.max(Math.min(q,Y-1),0);return KS(_),MS(_),LS(_,f),kS(_,Q,J,Y,Z,X),z.reset(),!0},qY=(_,f=new A2)=>{let{data:$,fontSize:z,author:Q,activeSheetIndex:J,customMetadata:q}=_,X=_.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Y=new tY;if(!rY(Y,$,{author:Q,fontSize:z,activeTab:J,customMetadata:q},f))return Promise.resolve(void 0);return Y.getZipFile(X)},XY=(_,f=new A2)=>{let{data:$,fontSize:z,author:Q,activeSheetIndex:J,customMetadata:q}=_,X=_.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Y=new tY;if(!rY(Y,$,{author:Q,fontSize:z,activeTab:J,customMetadata:q},f))return;return Y.getUncompressedZipFile(X)};var SS=class extends tJ{constructor(){super(...arguments);this.beanName="excelCreator",this.workbook=new A2}getMergedParams(_){let f=this.gos.get("defaultExcelExportParams");return Object.assign({},f,_)}export(_){if(this.isExportSuppressed()){j(160);return}let f=()=>{let z=this.getMergedParams(_),Q=this.getData(z),{fontSize:J,author:q,mimeType:X,customMetadata:Y}=z,Z={data:[Q],fontSize:J,author:q,mimeType:X,customMetadata:Y};this.packageCompressedFile(Z).then((G)=>{if(G){let{fileName:E}=z,U=typeof E==="function"?E(C(this.gos,{})):E;GQ(this.getFileName(U),G)}})},{overlays:$}=this.beans;if($)$.showExportOverlay(f);else f()}exportDataAsExcel(_){this.export(_)}getDataAsExcel(_){let f=this.getMergedParams(_),$=this.getData(f),{fontSize:z,author:Q,mimeType:J,customMetadata:q}=f,X={data:[$],fontSize:z,author:Q,mimeType:J,customMetadata:q};return this.packageFile(X)}setFactoryMode(_){this.workbook.setFactoryMode(_)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(_){let f=this.getMergedParams(_);return this.getData(f)}getMultipleSheetsAsExcel(_){return XY(_,this.workbook)}exportMultipleSheetsAsExcel(_){qY(_,this.workbook).then((f)=>{let{fileName:$="export.xlsx"}=_;if(f){let z=typeof $==="function"?$():$;GQ(z,f)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(_){let{colModel:f,colNames:$,rowGroupColsSvc:z,valueSvc:Q,formula:J,gos:q}=this.beans,X=q.get("excelStyles")||[],Y=this.createStyleLinker(X),Z={..._,colModel:f,colNames:$,rowGroupColsSvc:z,valueSvc:Q,formulaSvc:J,gos:q,suppressRowOutline:_.suppressRowOutline||_.skipRowGroups,headerRowHeight:_.headerRowHeight||_.rowHeight,baseExcelStyles:X,rightToLeft:_.rightToLeft??q.get("enableRtl"),styleLinker:Y,headerRowCount:WX(f),pivotModeActive:f.isPivotActive(),workbook:this.workbook};return new rF(Z)}createStyleLinker(_){let f=[],$=new Set,z=new Map;_.forEach((q,X)=>{f.push(q.id),$.add(q.id),z.set(q.id,X)});let{gos:Q,cellStyles:J}=this.beans;return(q)=>{let{rowType:X,rowIndex:Y,value:Z,column:G,columnGroup:E,node:U}=q,H=X==="HEADER",W=X==="HEADER_GROUPING",B=H?G:E,K=[];if(H||W){if(K.push("header"),W)K.push("headerGroup");if(B)K=K.concat(fQ(B.getDefinition(),Q,G||null,E||null));return K}let L=["cell"];if(!f.length)return L;let F=G.getDefinition();return J?.processAllCellClasses(F,C(Q,{value:Z,data:U.data,node:U,colDef:F,column:G,rowIndex:Y}),(D)=>{if($.has(D))L.push(D)}),L.sort((D,M)=>{let k=z.get(D)??-1,R=z.get(M)??-1;return k===R?0:kthis.onFocusIn(_),onFocusOut:(_)=>this.onFocusOut(_),focusInnerElement:(_)=>this.focusInnerElement(_),onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.handleKeyDown(_)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(_){if(_.listItemHeightChanged)this.rowHeight=this.getItemHeight(),this.refresh()}refreshAriaProperties(){let f=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),$=this.eContainer;Z_($,this.model?.getRowCount()>0?this.ariaRole:"presentation"),W_($,f)}addResizeObserver(){let _=()=>Y0(this.beans,()=>this.drawVirtualRows()),f=S0(this.beans,this.getGui(),_);this.addDestroyFunc(f)}focusInnerElement(_){return this.focusRow(_?this.model.getRowCount()-1:0),!0}onFocusIn(_){let f=_.target;if(f.classList.contains("ag-virtual-list-item"))this.lastFocusedRowIndex=t9(f)-1}onFocusOut(_){if(!this.getFocusableElement().contains(_.relatedTarget))this.lastFocusedRowIndex=null}handleKeyDown(_){let{key:f,shiftKey:$}=_;switch(f){case S.UP:case S.DOWN:{let z=f===S.UP;if(_.preventDefault(),$)this.moveItem(z);else this.navigate(z)}break;case S.PAGE_HOME:case S.PAGE_END:case S.PAGE_UP:case S.PAGE_DOWN:if(this.navigateToPage(f)!==null)_.preventDefault();break}}onTabKeyDown(_){this.stopPropagationCallbacks?.stopPropagation(_),this.forceFocusOutOfContainer(_.shiftKey)}getNextRow(_){if(this.lastFocusedRowIndex==null)return;let f=this.lastFocusedRowIndex+(_?-1:1);if(f<0||f>=this.model.getRowCount())return;return f}moveItem(_){if(!this.moveItemCallback)return;let f=this.getComponentAt(this.lastFocusedRowIndex);if(!f)return;this.moveItemCallback(f,_)}navigate(_){let f=this.getNextRow(_);if(f===void 0)return;this.focusRow(f)}navigateToPage(_,f="focused"){let $=!1;if(f==="focused")f=this.getLastFocusedRow(),$=!0;let z=this.model.getRowCount()-1,Q=-1;if(_===S.PAGE_HOME)Q=0;else if(_===S.PAGE_END)Q=z;else if(_===S.PAGE_DOWN)Q=Math.min(f+this.pageSize,z);else if(_===S.PAGE_UP)Q=Math.max(f-this.pageSize,0);if(Q===-1)return null;if($)this.focusRow(Q);else this.ensureIndexVisible(Q);return Q}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(_){if(this.isScrolling)return;this.isScrolling=!0,this.ensureIndexVisible(_),Y0(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;let f=this.renderedRows.get(_);if(f)f.eDiv.focus()})}getComponentAt(_){let f=this.renderedRows.get(_);return f&&f.rowComponent}forEachRenderedRow(_){this.renderedRows.forEach((f,$)=>_(f.rowComponent,$))}getItemHeight(){if(!this.isHeightFromTheme)return this.rowHeight;return this.beans.environment.getDefaultListItemHeight()}ensureIndexVisible(_,f=!0){let $=this.model.getRowCount();if(typeof _!=="number"||_<0||_>=$)return!1;let z=_*this.rowHeight,Q=z+this.rowHeight,J=this.getGui(),q=J.scrollTop,X=J.offsetHeight,Y=q+X,Z=f?0:this.rowHeight,G=q>z+Z,E=Y{if(!this.isAlive())return;if(this.canSoftRefresh(_))this.drawVirtualRows(!0);else this.clearVirtualRows(),this.drawVirtualRows()})}awaitStable(_){if(this.awaitStableCallbacks.push(_),this.awaitStableCallbacks.length>1)return;let f=this.model.getRowCount();_J(this,()=>this.eContainer.clientHeight>=f*this.rowHeight,()=>{if(!this.isAlive())return;let $=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(let z of $)z()})}canSoftRefresh(_){return!!(_&&this.renderedRows.size&&typeof this.model.areRowsEqual==="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((_,f)=>this.removeRow(f))}drawVirtualRows(_){if(!this.isAlive()||!this.model)return;let f=this.getGui(),$=f.scrollTop,z=$+f.offsetHeight;if($===z)this.clearVirtualRows();else{let Q=Math.floor($/this.rowHeight),J=Math.floor(z/this.rowHeight);this.pageSize=Math.floor((z-$)/this.rowHeight),this.ensureRowsRendered(Q,J,_)}}ensureRowsRendered(_,f,$){if(this.renderedRows.forEach((z,Q)=>{if((Q<_||Q>f)&&Q!==this.lastFocusedRowIndex)this.removeRow(Q)}),$)this.refreshRows();for(let z=_;z<=f;z++){if(this.renderedRows.has(z))continue;if(z=f.getRowCount())return;let{cssIdentifier:$,ariaRole:z,renderedRows:Q,eContainer:J}=this,q=f.getRow(_),X=z==="tree"?"treeitem":"option",Y=B_({tag:"div",cls:`ag-virtual-list-item ag-${$}-virtual-list-item`,role:X,attrs:{tabindex:"-1"}});gz(Y,f.getRowCount()),hz(Y,_+1);let Z=this.rowHeight;Y.style.height=`${Z}px`,Y.style.top=`${Z*_}px`;let G=this.componentCreator(q,Y);if(G.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=_),Y.appendChild(G.getGui()),Q.has(_-1))Q.get(_-1).eDiv.insertAdjacentElement("afterend",Y);else if(Q.has(_+1))Q.get(_+1).eDiv.insertAdjacentElement("beforebegin",Y);else J.appendChild(Y);Q.set(_,{rowComponent:G,eDiv:Y,value:q})}removeRow(_){let f=this.renderedRows.get(_);f.eDiv.remove(),this.destroyBean(f.rowComponent),this.renderedRows.delete(_)}refreshRows(){let _=this.model.getRowCount();this.renderedRows.forEach((f,$)=>{if($>=_)this.removeRow($);else{let z=this.model.getRow($);if(this.model.areRowsEqual?.(f.value,z))this.componentUpdater(z,f.rowComponent);else this.removeRow($)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(_){this.model=_}getAriaElement(){return this.eContainer}destroy(){if(!this.isAlive())return;this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy()}},VS='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',X2="ag-list-item-hovered",OS=class extends j_{constructor(_,f,$){super();this.comp=_,this.virtualList=f,this.params=$,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(VS,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(_){this.currentDragValue=this.params.getCurrentDragValue(_),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){let _={isInterestedIn:(f)=>f===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:(f)=>this.onDragging(f),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(_)}createAutoScrollService(){let _=this.virtualList.getGui();this.autoScrollService=new QQ({scrollContainer:_,scrollAxis:"y",getVerticalPosition:()=>_.scrollTop,setVerticalPosition:(f)=>_.scrollTop=f})}onDragging(_){if(!this.currentDragValue||this.moveBlocked)return;let f=this.getListDragItem(_),$=this.virtualList.getComponentAt(f.rowIndex);if(!$)return;let z=$.getGui().parentElement;if(this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===f.rowIndex&&this.lastHoveredListItem.position===f.position)return;this.autoScrollService.check(_.event),this.clearHoveredItems(),this.lastHoveredListItem=f,s6(z,X2),s6(z,`ag-item-highlight-${f.position}`)}getListDragItem(_){let f=this.virtualList.getGui(),$=Number.parseFloat(window.getComputedStyle(f).paddingTop),z=this.virtualList.getRowHeight(),Q=this.virtualList.getScrollTop(),J=Math.max(0,(_.y-$+Q)/z),q=this.params.getNumRows(this.comp)-1,X=Math.min(q,J)|0;return{rowIndex:X,position:Math.round(J)>J||J>q?"bottom":"top",component:this.virtualList.getComponentAt(X)}}onDragStop(){if(this.moveBlocked)return;this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties()}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){let _=this.virtualList.getGui();for(let f of _.querySelectorAll(`.${X2}`))for(let $ of[X2,"ag-item-highlight-top","ag-item-highlight-bottom"])f.classList.remove($);this.lastHoveredListItem=null}};var PS=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function vS(_){return _??(_=_||"default"),{tag:"div",cls:`ag-panel ag-${_}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${_}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${_}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${_}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${_}-panel-content-wrapper`}]}}var TS=class extends p_{constructor(_){super(vS(_.cssIdentifier));this.config=_,this.closable=!0,this.eContentWrapper=V,this.eTitleBar=V,this.eTitleBarButtons=V,this.eTitle=V,this.registerCSS(PS)}postConstruct(){let{component:_,closable:f,hideTitleBar:$,title:z,minWidth:Q=250,width:J,minHeight:q=250,height:X,centered:Y,popup:Z,x:G,y:E,postProcessPopupParams:U}=this.config,H=this.beans,W=this.createManagedBean(new BJ(this.getGui(),{minWidth:Q,width:J,minHeight:q,height:X,centered:Y,x:G,y:E,popup:Z,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=W;let B=this.getGui();if(_)this.setBodyComponent(_);if(!$){if(z)this.setTitle(z);this.setClosable(f!=null?f:this.closable)}else N(this.eTitleBar,!1);if(this.addManagedElementListeners(this.eTitleBar,{mousedown:(L)=>{if(B.contains(L.relatedTarget)||B.contains(d(H))||this.eTitleBarButtons.contains(L.target)){L.preventDefault();return}let F=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");if(F)F.focus()}}),Z&&W.isPositioned())return;if(this.renderComponent)this.renderComponent();let K;if(U){let{type:L,eventSource:F,mouseEvent:D}=U;K=()=>H.popupSvc?.callPostProcessPopup(U,L,B,F,D)}W.initialisePosition(K),this.eContentWrapper.style.height="0"}renderComponent(){let _=this.getGui();_.focus(),this.close=()=>{_.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(_){this.positionableFeature.setHeight(_)}getWidth(){return this.positionableFeature.getWidth()}setWidth(_){this.positionableFeature.setWidth(_)}setClosable(_){if(_!==this.closable)this.closable=_;if(_){let f=this.closeButtonComp=new p_({tag:"div",cls:"ag-button"});this.createBean(f);let $=f.getGui(),z=this.beans.iconSvc.createIconNoSpan("close",this.beans);z.classList.add("ag-panel-title-bar-button-icon"),$.appendChild(z),this.addTitleBarButton(f),f.addManagedElementListeners($,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp)this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}setBodyComponent(_){_.setParentComponent(this),this.eContentWrapper.appendChild(_.getGui())}addTitleBarButton(_,f){let $=this.eTitleBarButtons,z=$.children,Q=z.length;if(f==null)f=Q;f=Math.max(0,Math.min(f,Q)),_.addCss("ag-panel-title-bar-button");let J=_.getGui();if(f===0)$.prepend(J);else if(f===Q)$.append(J);else z[f-1].after(J);_.setParentComponent(this)}getBodyHeight(){return uz(this.eContentWrapper)}getBodyWidth(){return df(this.eContentWrapper)}setTitle(_){this.eTitle.innerText=_}onBtClose(){this.close()}destroy(){if(this.closeButtonComp)this.closeButtonComp=this.destroyBean(this.closeButtonComp);let _=this.getGui();if(_&&A_(_))this.close();super.destroy()}},IS=class extends TS{constructor(_,f){super({..._,popup:!0});this.callbacks=f,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(_){this.popupSvc=_.popupSvc}postConstruct(){let _=this.getGui(),{movable:f,resizable:$,maximizable:z,modal:Q}=this.config;if(this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new TJ(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(_)},onTabKeyDown:(J)=>{if(Q)return;let q=J.shiftKey,X=V_(this.beans,_,!1,q);if(!X||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(X)){if(this.callbacks?.focusNextContainer(this.beans,q))J.preventDefault()}}}),f)this.setMovable(f);if(z)this.setMaximizable(z);if($)this.setResizable($);if(!this.config.modal)this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(_){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(_)}renderComponent(){let _=this.getGui(),{alwaysOnTop:f,modal:$,title:z,afterGuiAttached:Q}=this.config,J=this.getLocaleTextFunc(),q=this.popupSvc?.addPopup({modal:$,eChild:_,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:f,ariaLabel:z||J("ariaLabelDialog","Dialog"),afterGuiAttached:Q});if(q)this.close=q.hideFunc}onClosed(_){this.destroy(),this.config.closedCallback?.(_)}setMaximized(_){if(this.isMaximizable&&_!==this.isMaximized)this.toggleMaximize()}toggleMaximize(){let _=this.positionableFeature.getPosition();if(this.isMaximized){let{x:f,y:$,width:z,height:Q}=this.lastPosition;this.setWidth(z),this.setHeight(Q),this.positionableFeature.offsetElement(f,$)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=_.x,this.lastPosition.y=_.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){N(this.maximizeIcon,!this.isMaximized),N(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(let _ of this.maximizeListeners)_();this.maximizeListeners.length=0}if(this.resizeListenerDestroy)this.resizeListenerDestroy(),this.resizeListenerDestroy=null}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(_){this.positionableFeature.setResizable(_)}setMovable(_){this.positionableFeature.setMovable(_,this.eTitleBar)}setMaximizable(_){if(!_){if(this.clearMaximizebleListeners(),this.maximizeButtonComp)this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0;return}let f=this.eTitleBar;if(!f||_===this.isMaximizable)return;this.isMaximizable=_;let $=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),$.addManagedElementListeners($.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton($,0),this.maximizeListeners.push(...this.addManagedElementListeners(f,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){let _=this.maximizeButtonComp=this.createBean(new p_({tag:"div",cls:"ag-dialog-button"})),f=_.getGui(),$=this.beans.iconSvc;return this.maximizeIcon=$.createIconNoSpan("maximize"),f.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=$.createIconNoSpan("minimize"),f.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),_}};var yS=class extends r0{constructor(_){super();this.setTemplateFromElement(_.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.handleKeyDown(_)})}handleKeyDown(_){if(_.key===S.ESCAPE)this.closePanel()}onTabKeyDown(_){if(_.defaultPrevented)return;this.closePanel(),_.preventDefault()}closePanel(){let _=this.parentComponent;_.closeSubMenu(),setTimeout(()=>_.getGui().focus(),0)}},F2=class extends j_{constructor(_){super();this.callbacks=_,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(_){let{menuItemDef:f,isAnotherSubMenuOpen:$,level:z,childComponent:Q,contextParams:J}=_;return this.params=_.menuItemDef,this.level=z,this.isAnotherSubMenuOpen=$,this.childComponent=Q,this.contextParams=J,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...f,level:z,isAnotherSubMenuOpen:$,openSubMenu:(q)=>this.openSubMenu(q),closeSubMenu:()=>this.closeSubMenu(),closeMenu:(q)=>this.closeMenu(q),updateTooltip:(q,X)=>this.refreshTooltip(q,X),onItemActivated:()=>this.onItemActivated()}).then((q)=>{if(!q)return;this.menuItemComp=q;let X=q.configureDefaults?.();if(X)this.configureDefaults(X===!0?void 0:X)})}addListeners(_,f){if(!f?.suppressClick)this.addManagedElementListeners(_,{click:($)=>this.onItemSelected($)});if(!f?.suppressKeyboardSelect)this.addManagedElementListeners(_,{keydown:($)=>{if($.key===S.ENTER||$.key===S.SPACE)$.preventDefault(),this.onItemSelected($)}});if(!f?.suppressMouseDown)this.addManagedElementListeners(_,{mousedown:($)=>{$.stopPropagation(),$.preventDefault()}});if(!f?.suppressMouseOver)this.addManagedElementListeners(_,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(_=!1,f){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;let $=z_({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=$;let z,Q=()=>{this.subMenuIsOpening=!1};if(this.childComponent){let Z=this.createBean(new yS(this.childComponent));Z.setParentComponent(this);let G=Z.getGui(),E="mouseenter",U=()=>this.cancelDeactivate();if(G.addEventListener(E,U),z=()=>{G.removeEventListener(E,U),this.destroyBean(Z)},$.appendChild(G),this.childComponent.afterGuiAttached)Q=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1}}else if(this.params.subMenu){let Z=this.createBean(new lY(this.level+1,this.contextParams,this.callbacks));if(Z.setParentComponent(this),Z.addMenuItems(this.params.subMenu),$.appendChild(Z.getGui()),this.addManagedListeners(Z,{closeMenu:(G)=>this.dispatchLocalEvent(G)}),Z.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),z=()=>this.destroyBean(Z),_)Q=()=>{Z.activateFirstItem(),this.subMenuIsOpening=!1}}let J=this.beans.popupSvc,q=()=>{let Z=this.eGui;J?.positionPopupForMenu({eventSource:Z,ePopup:$,event:f instanceof MouseEvent?f:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},X=this.getLocaleTextFunc(),Y=J?.addPopup({modal:!0,eChild:$,positionCallback:q,anchorToElement:this.eGui,ariaLabel:X("ariaLabelSubMenu","SubMenu"),afterGuiAttached:Q});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{if(Y)Y.hideFunc();this.subMenuIsOpen=!1,this.setAriaExpanded(!1),z(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(_){if(!this.suppressAria)N_(this.eGui,_)}closeSubMenu(){if(!this.hideSubMenu)return;this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1)}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(_,f){if(this.cancelActivate(),this.params.disabled&&!f)return;if(this.isActive=!0,!this.suppressRootStyles)this.eGui.classList.add(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!0),!this.suppressFocus)this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!f}));if(_&&this.params.subMenu)window.setTimeout(()=>{if(this.isAlive()&&this.isActive)this.openSubMenu()},300);this.onItemActivated()}deactivate(){if(this.cancelDeactivate(),!this.suppressRootStyles)this.eGui.classList.remove(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen)this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(_){this.parentComponent=_}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(_){if(this.menuItemComp.select?.(),this.params.action)this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams})));else this.openSubMenu(_&&_.type==="keydown",_);if(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)return;this.closeMenu(_)}closeMenu(_){let f={type:"closeMenu"};if(_)if(_ instanceof MouseEvent)f.mouseEvent=_;else f.keyboardEvent=_;this.dispatchLocalEvent(f)}onItemActivated(){let _={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(_)}cancelActivate(){if(this.activateTimeoutId)window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0}cancelDeactivate(){if(this.deactivateTimeoutId)window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0}onMouseEnter(){if(this.cancelDeactivate(),this.isAnotherSubMenuOpen())this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY);else this.activate(!0)}onMouseLeave(){if(this.cancelActivate(),this.isSubMenuOpen())this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY);else this.deactivate()}refreshRootElementGui(_){let f=this.menuItemComp.getGui(),{cssClassPrefix:$,params:{cssClasses:z,disabled:Q}}=this,J=this.menuItemComp.getRootElement?.();if(J){if(!_)f.classList.add("ag-menu-option-custom");f=J}if(this.suppressRootStyles=!!_,!this.suppressRootStyles){f.classList.add($);for(let q of z??[])f.classList.add(q);if(Q)f.classList.add(`${$}-disabled`)}return f}applyAriaProperties(_){let{params:{checked:f,subMenu:$,subMenuRole:z,disabled:Q}}=this,J=f!=null;if(Z_(_,J?"menuitemcheckbox":"menuitem"),$)$q(_,z??"menu");if(Q)a9(_,!0)}configureDefaults(_){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(_));return}let{suppressRootStyles:f,suppressTooltip:$,suppressAria:z,suppressTabIndex:Q,suppressFocus:J}=_||{},{params:{tooltip:q,disabled:X}}=this,Y=this.eGui=this.refreshRootElementGui(!!f);if(this.suppressAria=!!z,!z)this.applyAriaProperties(Y);if(!Q)Y.setAttribute("tabindex","-1");if(!$)this.refreshTooltip(q);if(!X)this.addListeners(Y,_);this.suppressFocus=!!J}refreshTooltip(_,f){if(this.tooltip=_,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!_||!this.menuItemComp)return;let $=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:f});if($)this.tooltipFeature=this.createBean($)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},lY=class extends r0{constructor(_=0,f,$){super({tag:"div",cls:"ag-menu-list",role:"menu"});this.level=_,this.menuActionParams=f,this.callbacks=$,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(_)),onFocusIn:(_)=>this.handleFocusIn(_),onFocusOut:(_)=>this.handleFocusOut(_)})}onTabKeyDown(_){if(!this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed"))_.preventDefault();if(_.shiftKey)this.closeIfIsChild(_)}handleKeyDown(_){switch(_.key){case S.UP:case S.RIGHT:case S.DOWN:case S.LEFT:_.preventDefault(),this.handleNavKey(_.key);break;case S.ESCAPE:if(this.closeIfIsChild())this.callbacks.stopPropagationCallbacks.stopPropagation(_);break}}handleFocusIn(_){let f=_.relatedTarget;if(!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(f)&&(this.getGui().contains(f)||this.activeMenuItem?.getSubMenuGui()?.contains(f)))return;if(this.activeMenuItem)this.activeMenuItem.activate();else this.activateFirstItem()}handleFocusOut(_){let f=_.relatedTarget;if(!this.activeMenuItem||this.getGui().contains(f)||this.activeMenuItem.getSubMenuGui()?.contains(f))return;if(!this.activeMenuItem.isSubMenuOpening())this.activeMenuItem.deactivate()}clearActiveItem(){if(this.activeMenuItem)this.activeMenuItem.deactivate(),this.activeMenuItem=null}addMenuItems(_){if(_==null)return;g.all(_.map((f)=>{if(f==="separator")return g.resolve({eGui:this.createSeparator()});else if(typeof f==="string")return this.callbacks.warnNoItem?.(f),g.resolve({eGui:null});else return this.addItem(f)})).then((f)=>{for(let $ of f??[])if($?.eGui){if(this.appendChild($.eGui),$.comp)this.menuItems.push($.comp)}})}addItem(_){let f=this.createManagedBean(new F2(this.callbacks));return f.init({menuItemDef:_,isAnotherSubMenuOpen:()=>this.menuItems.some(($)=>$.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>{return f.setParentComponent(this),this.addManagedListeners(f,{closeMenu:($)=>{this.dispatchLocalEvent($)},menuItemActivated:($)=>{if(this.activeMenuItem&&this.activeMenuItem!==$.menuItem)this.activeMenuItem.deactivate();this.activeMenuItem=$.menuItem}}),{comp:f,eGui:f.getGui()}})}activateFirstItem(){let _=this.menuItems.filter((f)=>!f.isDisabled())[0];if(!_)return;_.activate()}createSeparator(){let _={tag:"div",cls:"ag-menu-separator-part"};return B_({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[_,_,_,_]})}handleNavKey(_){switch(_){case S.UP:case S.DOWN:{let $=this.findNextItem(_===S.UP);if($&&$!==this.activeMenuItem)$.activate(!1,!0);return}}let f=this.gos.get("enableRtl")?S.RIGHT:S.LEFT;if(_===f)this.closeIfIsChild();else this.openChild()}closeIfIsChild(_){let f=this.getParentComponent();if(f&&f instanceof F2){if(_)_.preventDefault();return f.closeSubMenu(),f.getGui().focus(),!0}return!1}openChild(){if(this.activeMenuItem)this.activeMenuItem.openSubMenu(!0)}findNextItem(_){let f=[...this.menuItems];if(!f.length)return;if(!this.activeMenuItem)return _?b(f):f[0];if(_)f.reverse();let $,z=!1;for(let Q of f){if(!z){if(Q===this.activeMenuItem)z=!0;continue}$=Q;break}if(z&&!$)return f[0];return $||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};var bS=class extends p_{constructor(_){super({tag:"div"});this.callbacks=_}init(_){this.params=_,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){let{checked:_,subMenu:f}=this.params,$=this.getGui();if(_)_q($,_);if(f)N_($,!1)}addIcon(){if(this.params.isCompact)return;let _=B_({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:f,icon:$}=this.params;if(f)_.appendChild(this.beans.iconSvc.createIconNoSpan("check"));else if($)if(D$($))_.appendChild($);else if(typeof $==="string")_.innerHTML=$;else this.callbacks?.warnNoIcon?.();this.getGui().appendChild(_)}addName(){let _=B_({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(_)}addShortcut(){if(this.params.isCompact)return;let _=B_({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(_)}addSubMenu(){let _=B_({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),f=this.getGui();if(this.params.subMenu){let $=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";_.appendChild(this.beans.iconSvc.createIconNoSpan($))}f.appendChild(_)}getClassName(_){return`${this.cssClassPrefix}-${_}`}};function D2(_,f){if(!f)return null;let $=F0(_),z=$.indexOf(f);if(z===-1)return null;let Q=-1;for(let J=z-1;J>=0;J--)if($[J].classList.contains(o1.TAB_GUARD_TOP)){Q=J;break}if(Q<=0)return null;return $[Q-1]}function sY(_,f){if(!f)return!1;let $=_.querySelectorAll(`.${LJ}`);if(!$.length)return!1;for(let z=0;z<$.length;z++)if($[z].contains(f))return!0;return!1}function CS(_){return{tag:"div",cls:`ag-tabs ${_}`,children:[{tag:"div",ref:"eHeader"},{tag:"div",ref:"eBody",role:"presentation",cls:"ag-tabs-body"+_?` ${_}-body`:""}]}}var wS=class extends r0{constructor(_){super(CS(_.cssClass));this.eHeader=V,this.eBody=V,this.items=[],this.tabbedItemScrollMap=new Map,this.params=_}postConstruct(){if(this.setupHeader(),this.params.items)for(let _ of this.params.items)this.addItem(_);this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>this.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){let{enableCloseButton:_,cssClass:f}=this.params,$=(z,Q)=>{if(z.classList.add(`ag-tabs-${Q}`),f)z.classList.add(`${f}-${Q}`)};if(_)this.setupCloseButton($),this.eTabHeader=B_({tag:"div",role:"presentation"}),$(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader);else this.eTabHeader=this.eHeader;Z_(this.eTabHeader,"tablist"),$(this.eTabHeader,"header")}setupCloseButton(_){let f=B_({tag:"button"});_(f,"close-button");let $=this.beans.iconSvc.createIconNoSpan("close");W_(f,this.params.closeButtonAriaLabel),f.appendChild($),this.addManagedElementListeners(f,{click:()=>this.params.onCloseClicked?.()});let z=B_({tag:"div",role:"presentation"});_(z,"close-button-wrapper"),z.appendChild(f),this.eHeader.appendChild(z),this.eCloseButton=f}handleKeyDown(_){switch(_.key){case S.RIGHT:case S.LEFT:{if(!this.eTabHeader.contains(d(this.beans)))return;let f=_.key===S.RIGHT,$=this.gos.get("enableRtl"),z=this.items.indexOf(this.activeItem),Q=f!==$?Math.min(z+1,this.items.length-1):Math.max(z-1,0);if(z===Q)return;_.preventDefault();let J=this.items[Q];this.showItemWrapper(J),J.eHeaderButton.focus();break}case S.UP:case S.DOWN:_.stopPropagation();break}}onTabKeyDown(_){if(_.defaultPrevented)return;let{beans:f,eHeader:$,eBody:z,activeItem:Q,params:J}=this,{suppressTrapFocus:q,enableCloseButton:X}=J,Y=d(f),Z=_.target,G=_.shiftKey;if($.contains(Y)){if(_.preventDefault(),X&&G&&!this.eCloseButton?.contains(Y))this.eCloseButton?.focus();else if(q&&G)D2(q_(f).body,Z)?.focus();else this.focusBody(_.shiftKey);return}let E=null;if(sY(z,Z)){if(G)E=D2(z,Z);if(!E&&!q)E=Q.eHeaderButton}if(!E&&z.contains(Y)){if(E=V_(f,z,!1,G),!E){if(q&&!G)this.forceFocusOutOfContainer(G);else if(X&&!G)_.preventDefault(),this.eCloseButton?.focus();else _.preventDefault(),this.focusHeader();return}}if(E)_.preventDefault(),E.focus()}focusInnerElement(_){if(_)return this.focusBody(!0);else return this.focusHeader(),!0}focusHeader(_){this.activeItem.eHeaderButton.focus({preventScroll:_})}focusBody(_){return F_(this.eBody,_)}setAfterAttachedParams(_){this.afterAttachedParams=_}showFirstItem(){if(this.items.length>0)this.showItemWrapper(this.items[0])}addItem(_){let f=B_({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});f.appendChild(_.title),this.eTabHeader.appendChild(f),W_(f,_.titleLabel);let $={tabbedItem:_,eHeaderButton:f};this.items.push($),f.addEventListener("click",this.showItemWrapper.bind(this,$))}showItem(_){let f=this.items.find(($)=>$.tabbedItem===_);if(f)this.showItemWrapper(f)}showItemWrapper(_){let{tabbedItem:f,eHeaderButton:$}=_;if(this.params.onItemClicked?.({item:f}),this.activeItem===_){this.params.onActiveItemClicked?.();return}if(this.lastScrollListener)this.lastScrollListener=this.lastScrollListener();if(f_(this.eBody),f.bodyPromise.then((z)=>{this.eBody.appendChild(z);let Q=!b1();if(!this.params.suppressFocusBodyOnOpen)F_(this.eBody,!1,Q);if(f.afterAttachedCallback)f.afterAttachedCallback(this.afterAttachedParams);if(this.params.keepScrollPosition){let J=f.getScrollableContainer?.()||z;[this.lastScrollListener]=this.addManagedElementListeners(J,{scroll:()=>{this.tabbedItemScrollMap.set(f.name,J.scrollTop)}});let q=this.tabbedItemScrollMap.get(f.name);if(q!==void 0)setTimeout(()=>{J.scrollTop=q},0)}}),this.activeItem)this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.();$.classList.add("ag-tab-selected"),this.activeItem=_}},xS=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function NS(_){let f=_.cssIdentifier||"default",$=_.direction||"vertical";return{tag:"div",cls:`ag-group ag-${f}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${f}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${$} ag-${f}-group-container`}]}}var gS=class extends p_{constructor(_={}){super(NS(_),[h0]);this.params=_,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=V,this.cbGroupEnabled=V,this.eContainer=V,this.registerCSS(xS);let{enabled:f,items:$,suppressEnabledCheckbox:z,expanded:Q,suppressToggleExpandOnEnableChange:J,useToggle:q}=_;if(this.cssIdentifier=_.cssIdentifier||"default",this.enabled=f!=null?f:!0,this.items=$||[],this.useToggle=q??!1,this.alignItems=_.alignItems||"center",this.expanded=Q==null?!0:Q,z!=null)this.suppressEnabledCheckbox=z;if(J!=null)this.suppressToggleExpandOnEnableChange=J}postConstruct(){if(this.setupTitleBar(),this.items.length){let Q=this.items;this.items=[],this.addItems(Q)}let _=this.getLocaleTextFunc();if(this.cbGroupEnabled.setLabel(_("enabled","Enabled")),this.enabled)this.setEnabled(this.enabled,void 0,!0);this.setAlignItems(this.alignItems);let{onEnableChange:f,onExpandedChange:$,suppressOpenCloseIcons:z}=this.params;if(this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(z??!1),this.refreshChildDisplay(),N(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange((Q)=>{this.setEnabled(Q,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(Q)}),f!=null)this.onEnableChange(f);if($!=null)this.onExpandedChange($)}refreshChildDisplay(){N(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(_){if(this.alignItems!==_)this.removeCss(`ag-group-item-alignment-${this.alignItems}`);this.alignItems=_;let f=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(f),this}toggleGroupExpand(_,f){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)_=!0,f=!0;else if(_=_!=null?_:!this.expanded,this.expanded===_)return this;if(this.expanded=_,this.refreshChildDisplay(),N(this.eContainer,_),!f)this.dispatchLocalEvent({type:_?"expanded":"collapsed"});return this}addItems(_){for(let f of _)this.addItem(f)}prependItem(_){this.insertItem(_,!0)}addItem(_){this.insertItem(_,!1)}updateItems(_){let f=this.items,$=0;for(let z=0;z_(f.enabled)}),this}onExpandedChange(_){return this.addManagedListeners(this,{expanded:()=>_(!0),collapsed:()=>_(!1)}),this}hideEnabledCheckbox(_){return this.suppressEnabledCheckbox=_,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(_){return this.eTitleBar?.hideOpenCloseIcons(_),this}refreshDisabledStyles(){let _=!this.enabled;this.eContainer.classList.toggle("ag-disabled",_),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&_),this.eContainer.classList.toggle("ag-disabled-group-container",_)}setupTitleBar(){let _=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",_.getGui())}createDefaultTitleBar(){let _=this.createManagedBean(new uS(this.params));return this.eTitleBar=_,_.refreshOnExpand(this.expanded),this.addManagedListeners(_,{expandedChanged:(f)=>this.toggleGroupExpand(f.expanded)}),_}createToggleTitleBar(){let _=this.createManagedBean(new z2({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:(f)=>{this.setEnabled(f,!0),this.dispatchEnableChangeEvent(f)}}));return _.addCss("ag-group-title-bar"),_.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=_,this.toggleGroupExpand(this.enabled),_}},Y2="ag-disabled-group-title-bar";function hS(_){let f=_.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${f}-group-title-bar ag-unselectable`,role:_.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${f}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${f}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${f}-group-title`}]}}var uS=class extends p_{constructor(_={}){super(hS(_));this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=V,this.eGroupClosedIcon=V,this.eTitle=V;let{title:f,suppressOpenCloseIcons:$,suppressKeyboardNavigation:z}=_;if(!!f&&f.length>0)this.title=f;if($!=null)this.suppressOpenCloseIcons=$;this.suppressKeyboardNavigation=z??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){let _=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(_.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(_.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:(f)=>{switch(f.key){case S.ENTER:case S.SPACE:f.preventDefault(),this.dispatchExpandChanged();break;case S.RIGHT:case S.LEFT:f.preventDefault(),this.dispatchExpandChanged(f.key===S.RIGHT);break}}})}refreshOnExpand(_){this.refreshAriaStatus(_),this.refreshOpenCloseIcons(_)}refreshAriaStatus(_){if(!this.suppressOpenCloseIcons)N_(this.getGui(),_)}refreshOpenCloseIcons(_){let f=!this.suppressOpenCloseIcons;N(this.eGroupOpenedIcon,f&&_),N(this.eGroupClosedIcon,f&&!_)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(_){let f={type:"expandedChanged",expanded:_};this.dispatchLocalEvent(f)}setTitle(_){let f=this.getGui(),$=!!_&&_.length>0;if(_=$?_:void 0,this.eTitle.textContent=_??"",N(f,$),_!==this.title)this.title=_;let z=f.classList.contains(Y2);return this.refreshDisabledStyles(z),this}addWidget(_){return this.getGui().appendChild(_),this}hideOpenCloseIcons(_){if(this.suppressOpenCloseIcons=_,_)this.dispatchExpandChanged(!0);return this}refreshDisabledStyles(_){let f=this.getGui();if(_)f.classList.add(Y2),f.removeAttribute("tabindex"),Z_(f,"presentation");else if(f.classList.remove(Y2),typeof this.title==="string"&&!this.suppressKeyboardNavigation)this.activateTabIndex([f]),Z_(f,"group");else f.removeAttribute("tabindex"),Z_(f,"presentation")}};var $_="35.2.0",y_={moduleName:"EnterpriseCore",version:$_,beans:[o5],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:o5.setLicenseKey};var iS={stopPropagationCallbacks:Ff,focusNextContainer:(_,f)=>{return q0(_,f)},configureFocusableContainer:(_,f)=>{let $=_.ctrlsSvc.get("gridCtrl");$.addFocusableContainer(f),f.addDestroyFunc(()=>$.removeFocusableContainer(f))}},mS=class extends IS{constructor(_){super(_,iS)}getFocusableContainerName(){return"dialog"}};var aY=class extends jS{constructor(_){super(Ff,_)}};var cS=class extends OS{};function pS(_){return _.sideBar?.comp.isDisplayed()??!1}function nS(_,f){_.sideBar?.comp.setDisplayed(f)}function dS(_,f){_.sideBar?.comp.setSideBarPosition(f)}function tS(_,f,$){_.sideBar?.comp.openToolPanel(f,"api",$)}function rS(_){_.sideBar?.comp.close("api")}function lS(_){return _.sideBar?.comp.openedItem()??null}function sS(_){_.sideBar?.comp.refresh()}function aS(_){return _.sideBar?.comp.isToolPanelShowing()??!1}function oS(_,f){let $=_.sideBar?.comp.getToolPanelInstance(f);return d0($)}function eS(_){return _.sideBar?.comp.getDef()}var _A=`.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{ - /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}`,fA={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},$A=class extends w{constructor(_){super();this.toolPanelDef=_,this.eToggleButton=V,this.eIconWrapper=V,this.eLabel=V}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(fA,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){let _=this.toolPanelDef,f=this.getLocaleTextFunc()(_.labelKey,_.labelDefault);this.eLabel.textContent=f}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",h(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(_){this.toggleCss("ag-selected",_),N_(this.eToggleButton,_)}},zA={tag:"div",cls:"ag-side-buttons",role:"tablist"},QA=class extends w{constructor(){super(zA);this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(_){if(_.key!==S.TAB||!_.shiftKey)return;if(q0(this.beans,!0)){_.preventDefault();return}n_(_)}setActiveButton(_){for(let f of this.buttonComps)f.setSelected(_===f.getToolPanelId())}addButtonComp(_){let f=this.createBean(new $A(_));return this.buttonComps.push(f),this.appendChild(f),f.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:_.id})}),f}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),f_(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},JA={selector:"AG-SIDE-BAR-BUTTONS",component:QA},oY={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},eY={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},qA={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},h$={columns:oY,filters:eY,"filters-new":qA};function M2(_){if(!_)return;if(_===!0)return{toolPanels:[oY,eY],defaultToolPanel:"columns"};if(typeof _==="string")return M2([_]);if(Array.isArray(_)){let f=[];for(let $ of _){let z=h$[$];if(!z){j(215,{key:$,defaultByKey:h$});continue}f.push(z)}if(f.length===0)return;return{toolPanels:f,defaultToolPanel:f[0].id}}return{toolPanels:XA(_.toolPanels),defaultToolPanel:_.defaultToolPanel,hiddenByDefault:_.hiddenByDefault,position:_.position,hideButtons:_.hideButtons}}function XA(_){let f=[];if(!_)return f;return _.forEach(($)=>{let z=YA($);if(!z)return;f.push(z)}),f}function YA(_){if(typeof _!=="string")return _;if(h$[_])return h$[_];return j(215,{key:_,defaultByKey:h$}),null}var ZA=class extends w{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"});this.minWidth=100,this.maxWidth=null}postConstruct(){let _=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(_),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(_,f,$){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:$,started:_,ended:f})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(_){return this.onResizing(_,!0)}onResizing(_,f=!1){let $=this.inverted?-1:1,z=Math.max(this.minWidth,Math.floor(this.startingWidth-_*$));if(this.maxWidth!=null)z=Math.min(this.maxWidth,z);this.elementToResize.style.setProperty("--ag-horizontal-size",`${z}px`),this.dispatchResizeEvent(!1,f,z)}};function GA(_,f,$){return _.getCompDetails(f,EA,void 0,$,!0)}var EA={name:"toolPanel",optionalMethods:["refresh","getState"]},UA={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},HA=class extends w{constructor(){super(UA);this.eContent=V,this.animationId=0,this.defParent=null}postConstruct(){let _=this.getGui(),f=this.resizeBar=this.createManagedBean(new ZA);_.setAttribute("id",`ag-${this.getCompId()}`),f.elementToResize=_,this.appendChild(f)}getToolPanelId(){return this.toolPanelId}getDefParent(){return this.defParent}setDefParent(_){this.defParent=_}setToolPanelDef(_,f){let{id:$,minWidth:z,maxWidth:Q,width:J,parent:q}=_;if(this.toolPanelId=$,this.defParent=q??null,J)this.getGui().style.setProperty("--ag-side-bar-panel-width",`${J}px`);let X=GA(this.beans.userCompFactory,_,f);if(X==null)return!1;let Y=X.newAgStackInstance();this.params=X.params,Y.then(this.setToolPanelComponent.bind(this));let Z=this.resizeBar;if(z!=null)Z.minWidth=z;if(Q!=null)Z.maxWidth=Q;return!0}setToolPanelComponent(_){this.toolPanelCompInstance=_;let{eContent:f}=this;f.appendChild(_.getGui()),this.addDestroyFunc(()=>{this.destroyBean(_)})}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(_){let f=this.gos.get("enableRtl"),$=_==="left",z=f?$:!$;this.resizeBar.inverted=z}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(_){if(this.isDisplayed()===_)return;let f=++this.animationId,{eContent:$}=this,z=()=>{if(this.animationId===f)Q.classList.remove("ag-tool-panel-animating"),$.style.width="",Q.style.width=""},Q=this.getGui(),J=Q.offsetWidth;this.setDisplayed(_),Q.classList.add("ag-tool-panel-animating");let q=getComputedStyle(Q).transitionDuration;if(!parseFloat(q)){z();return}Q.style.transition="none",Q.style.width="",$.style.width=`${$.offsetWidth}px`,Q.style.width=`${J}px`;let X=Q.offsetWidth;Q.style.transition="",Q.style.width=_?"":"0";let Y=setTimeout(z,100);Q.addEventListener("transitionstart",()=>clearTimeout(Y),{once:!0}),Q.addEventListener("transitionend",z,{once:!0})}},WA={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},BA=class extends w{constructor(){super(WA,[JA]);this.sideBarButtons=V,this.toolPanelWrappers=[],this.registerCSS(_A)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));let{beans:_,gos:f}=this,{sideBar:$}=f.get("initialState")??{};this.setSideBarDef({sideBarDef:M2(f.get("sideBar")),sideBarState:$}),this.addManagedPropertyListener("sideBar",()=>this.setState()),_.sideBar.comp=this;let z=this.getFocusableElement();this.createManagedBean(new t0(z,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),Mf(_,this,z),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(_){if(_.defaultPrevented)return;let{beans:f,sideBarButtons:$}=this,z=this.getGui(),Q=$.getGui(),J=d(f),q=z.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),X=_.target,Y=_.shiftKey;if(!q){if(q0(f,Y,!0))return _.preventDefault(),!0;return HX(_),!1}if(Q.contains(J)){if(F_(q,Y))_.preventDefault();return}if(!Y)return;let Z=null;if(q.contains(J))Z=V_(f,q,void 0,!0);else if(sY(q,X))Z=D2(q,X);if(!Z)Z=Q.querySelector(".ag-selected button"),Z=A_(Z)?Z:null;if(Z&&Z!==_.target)_.preventDefault(),Z.focus()}handleKeyDown(_){let f=d(this.beans),$=this.sideBarButtons;if(!$.getGui().contains(f))return;let z=$.getGui(),Q=Array.prototype.slice.call(z.querySelectorAll(".ag-side-button")),J=Q.findIndex((Y)=>Y.contains(f)),q=null;switch(_.key){case S.LEFT:case S.UP:q=Math.max(0,J-1);break;case S.RIGHT:case S.DOWN:q=Math.min(J+1,Q.length-1);break}if(q===null)return;let X=Q[q].querySelector("button");if(X)X.focus(),_.preventDefault()}onToolPanelButtonClicked(_){let f=_.toolPanelId;if(this.openedItem()===f)this.openToolPanel(void 0,"sideBarButtonClicked");else this.openToolPanel(f,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:_,sideBarState:f,existingToolPanelWrappers:$}){if(this.setDisplayed(!1),this.sideBar=_,_)this.sideBarButtons.setDisplayed(!_.hideButtons);if(_?.toolPanels){let z=_.toolPanels;if(this.createToolPanelsAndSideButtons(z,f,$),!this.toolPanelWrappers.length)return;let Q=f?f.visible:!_.hiddenByDefault;if(this.setDisplayed(Q),this.setSideBarPosition(f?f.position:_.position),Q)if(f){let{openToolPanel:J}=f;if(J)this.openToolPanel(J,"sideBarInitializing")}else this.openToolPanel(_.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(_){if(!_)_="right";this.position=_;let f=_==="left",$=f?"right":"left";this.toggleCss("ag-side-bar-left",f),this.toggleCss("ag-side-bar-right",!f);for(let z of this.toolPanelWrappers)z.setResizerSizerSide($);return this.dispatchSideBarUpdated(),this}setDisplayed(_,f){super.setDisplayed(_,f),this.dispatchSideBarUpdated()}getState(){let _={};for(let f of this.toolPanelWrappers)_[f.getToolPanelId()]=f.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:_}}createToolPanelsAndSideButtons(_,f,$){for(let z of _)this.createToolPanelAndSideButton(z,f?.toolPanels?.[z.id],$?.[z.id])}validateDef(_){let{id:f,toolPanel:$}=_;if(f==null)return j(212),!1;if(YY($)){if(this.beans.filterManager?.isAdvFilterEnabled())return j(213),!1}return!0}createToolPanelAndSideButton(_,f,$){if(!this.validateDef(_)){this.destroyBean($);return}let z;if($)z=$,z.setDefParent(_.parent??null);else if(z=this.createBean(new HA),!z.setToolPanelDef(_,C(this.gos,{initialState:f,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;z.setDisplayed(!1),this.renderToolPanelUnderParent(z,_.parent),this.toolPanelWrappers.push(z);let Q=this.sideBarButtons.addButtonComp(_);fq(Q.eToggleButton,z.getGui())}refresh(){for(let _ of this.toolPanelWrappers)_.refresh()}renderToolPanelUnderParent(_,f){let $=_.getGui();if(f)this.beans.environment.applyThemeClasses(f,["ag-external","ag-tool-panel-external"]),$.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let z=f??_.getDefParent()??this.getGui();if($.parentElement!==z)z.appendChild($)}getWrapper(_){return this.toolPanelWrappers.find((f)=>f.getToolPanelId()===_)}openToolPanel(_,f="api",$){let z=this.openedItem(),J=!!_&&!!z||f==="sideBarInitializing";for(let Y of this.toolPanelWrappers){let Z=_===Y.getToolPanelId();if(Z)this.renderToolPanelUnderParent(Y,$??null);if(J)Y.setDisplayed(Z);else Y.animateDisplayed(Z)}let q=this.openedItem();if(z!==q)this.sideBarButtons.setActiveButton(_),this.raiseToolPanelVisibleEvent(_,z??void 0,f)}getToolPanelInstance(_){let f=this.getWrapper(_);if(!f){j(214,{key:_});return}return f.getToolPanelInstance()}raiseToolPanelVisibleEvent(_,f,$){let z=!!_&&!!f,Q=this.eventSvc;if(f)Q.dispatchEvent({type:"toolPanelVisibleChanged",source:$,key:f,visible:!1,switchingToolPanel:z});if(_)Q.dispatchEvent({type:"toolPanelVisibleChanged",source:$,key:_,visible:!0,switchingToolPanel:z})}close(_="api"){this.openToolPanel(void 0,_)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let _=null;for(let f of this.toolPanelWrappers)if(f.isDisplayed())_=f.getToolPanelId();return _}setState(_){let f=M2(this.gos.get("sideBar")),$={};if(f&&this.sideBar)f.toolPanels?.forEach((z)=>{let{id:Q}=z;if(!Q)return;let J=this.sideBar.toolPanels?.find((Z)=>Z.id===Q);if(!J||z.toolPanel!==J.toolPanel)return;let q=this.getWrapper(Q);if(!q)return;let X=C(this.gos,{...z.toolPanelParams??{},initialState:_?.toolPanels?.[Q],onStateUpdated:()=>this.dispatchSideBarUpdated()});if(q.getToolPanelInstance()?.refresh(X)!==!0)return;this.toolPanelWrappers=this.toolPanelWrappers.filter((Z)=>Z!==q),T_(q.getGui()),$[Q]=q});this.clearDownUi(),this.setSideBarDef({sideBarDef:f,sideBarState:_,existingToolPanelWrappers:$})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(let _ of this.toolPanelWrappers)T_(_.getGui()),this.destroyBean(_);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){if(this.sideBar?.toolPanels?.some((f)=>YY(typeof f==="string"?f:f.toolPanel)))this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function YY(_){return _==="agFiltersToolPanel"||_==="agNewFiltersToolPanel"}var KA={selector:"AG-SIDE-BAR",component:BA},LA=class extends A{constructor(){super(...arguments);this.beanName="sideBar"}getSelector(){return KA}},R2={moduleName:"SideBar",version:$_,beans:[LA],apiFunctions:{isSideBarVisible:pS,setSideBarVisible:nS,setSideBarPosition:dS,openToolPanel:tS,closeToolPanel:rS,getOpenedToolPanel:lS,refreshToolPanel:sS,isToolPanelShowing:aS,getToolPanelInstance:oS,getSideBar:eS},dependsOn:[y_,CJ]},FA='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',_Z=class extends bS{constructor(){super({warnNoIcon:()=>j(227)})}},j2={moduleName:"MenuItem",version:$_,userComponents:{agMenuItem:_Z},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[FA]},DA=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}",MA=300,kA={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},SA=class extends w{constructor(){super(kA,[h0,lJ]);this.eExpand=V,this.eSelect=V,this.eFilterTextField=V}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:(f)=>{if(f.key===S.SPACE)f.preventDefault(),this.onExpandClicked()}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});let _=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(_("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(_("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){let _=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(_),this.eSelect.toggleCss("ag-column-select-column-readonly",_)}init(_){this.params=_;let f=this.gos.get("functionsReadOnly");if(this.eSelect.setReadOnly(f),this.eSelect.toggleCss("ag-column-select-column-readonly",f),this.beans.colModel.ready)this.showOrHideOptions()}createExpandIcons(){let _=this.beans;this.eExpand.appendChild(this.eExpandChecked=h("columnSelectOpen",_)),this.eExpand.appendChild(this.eExpandUnchecked=h("columnSelectClosed",_)),this.eExpand.appendChild(this.eExpandIndeterminate=h("columnSelectIndeterminate",_)),this.setExpandState(0)}showOrHideOptions(){let _=this.params,f=!_.suppressColumnFilter,$=!_.suppressColumnSelectAll,z=!_.suppressColumnExpandAll,Q=!!this.beans.colModel.colDefCols?.treeDepth,J=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(J("searchOoo","Search...")),N(this.eFilterTextField.getGui(),f),N(this.eSelect.getGui(),$),N(this.eExpand,z&&Q)}onFilterTextChanged(){if(!this.onFilterTextChangedDebounced)this.onFilterTextChangedDebounced=c0(this,()=>{let _=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:_})},MA);this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(_){this.expandState=_,N(this.eExpandChecked,_===0),N(this.eExpandUnchecked,_===1),N(this.eExpandIndeterminate,_===2)}setSelectionState(_){this.selectState=_,this.eSelect.setValue(this.selectState)}},AA={selector:"AG-PRIMARY-COLS-HEADER",component:SA};function u1(_){return!!_&&typeof _.children<"u"}function Rf(_){return u1(_)?_.groupId:_.colId}function fZ(_,f,$){let z=(q,X)=>{let Z=q.children.map(Rf).includes(Rf(X)),G=b(q.children),E=G&&Rf(G)!==Rf(X);return Z&&E};if(!u1(_))return!0;let Q=_,J=$;if(z(Q,J))return Q.children.push(J),!0;if(Q.groupId===f){if(!Q.children.map(Rf).includes(Rf(J)))return Q.children.push(J),!0}for(let q=Q.children.length-1;q>=0;q--)if(fZ(Q.children[q],f,$))break;return!1}function $Z(_){let f=(Q,J)=>{return u1(Q)&&u1(J)&&Rf(Q)===Rf(J)},$=(Q,J)=>{if(!u1(J))return Q;let q=Q,X=J;if(X.children&&X.groupId){if(fZ(q,X.groupId,X.children[0]))return q}for(let Y of X.children)$(q,Y);return q},z=[];for(let Q=1;Q<=_.length;Q++){let J=_[Q-1],q=_[Q];if(f(J,q))_[Q]=$(J,q);else z.push(J)}return z}function RA(_,f){let $=[],z=(J,q)=>{if(u1(J)){let X=J,Y=typeof X.groupId<"u"?X.groupId:X.headerName,Z=new cf(X,Y,!1,q),G=[];for(let E of X.children){let U=z(E,q+1);if(U)G.push(U)}return Z.setChildren(G),Z}else{let X=J,Y=X.colId?X.colId:X.field,Z=_.getColDefCol(Y);if(!Z)$.push(X);return Z}},Q=[];for(let J of f){let q=z(J,0);if(q)Q.push(q)}if($.length>0)j(217,{invalidColIds:$});return Q}function jA(_,f){let $=zZ(OA(_)),z=$Z($);f(z)}function VA(_,f){let $=zZ(_),z=$Z($);f(z)}function zZ(_){let f=($,z)=>{let Q;if(X_($))if($.isPadding())Q=z;else{let q=Object.assign({},$.getColGroupDef());q.groupId=$.getGroupId(),q.children=[z],Q=q}else{let q=Object.assign({},$.getColDef());q.colId=$.getColId(),Q=q}let J=$.getOriginalParent();if(J)return f(J,Q);else return Q};return _.map(($)=>f($,$.getColDef()))}function OA(_){return _.getCols().filter((f)=>{let $=f.getColDef();return f.isPrimary()&&!$.showRowGroup})}var ZY=class{constructor(_,f,$,z=!1,Q){if(this.displayName=_,this.depth=$,this.group=z,this.localEventService=new D0,z)this.columnGroup=f,this._expanded=Q,this.children=[];else this.column=f}get expanded(){return!!this._expanded}set expanded(_){if(_===this._expanded)return;this._expanded=_,this.localEventService.dispatchEvent({type:"expandedChanged"})}addEventListener(_,f){this.localEventService.addEventListener(_,f)}removeEventListener(_,f){this.localEventService.removeEventListener(_,f)}};function p(_){return!!_?.buttons?.includes("apply")}function g_(_,f){if(!p(f))return;let $=_.sideBar?.comp.openedItem();if(!$)return;_.sideBar?.comp.getToolPanelInstance($)?.refreshDeferredUi()}function QZ(_,f,$,z,Q){let J=PA(f);JZ(_,J,$,z,Q)}function JZ(_,f,$,z,Q){if(_.columnStateUpdateStrategy.getPivotMode(p(Q)))TA(_,f,$,z,Q);else vA(_,f,$,z,Q)}function PA(_){let f=[],$=(z)=>{for(let Q of z){if(!Q.passesFilter)continue;if(Q.group)$(Q.children);else f.push(Q.column)}};return $(_),f}function vA(_,f,$,z,Q){let J=_.columnStateUpdateStrategy,q=[];for(let X of f){if(X.getColDef().lockVisible)continue;if(J.isColumnVisibleInToolPanel(p(Q),X)!==$)q.push({colId:X.getId(),hide:!$})}J.applyColumnState(p(Q),q,z),g_(_,Q)}function TA(_,f,$,z,Q){IA(_,f,$,z,Q)}function IA(_,f,$,z,Q){let J=_.columnStateUpdateStrategy,q=[],Z=$?(G)=>{if(J.isColumnSelectedInPivotModeToolPanel(p(Q),G))return;if(G.isAllowValue()){let E=typeof G.getAggFunc()==="string"?G.getAggFunc():_.aggFuncSvc?.getDefaultAggFunc(G);q.push({colId:G.getId(),aggFunc:E})}else if(G.isAllowRowGroup())q.push({colId:G.getId(),rowGroup:!0});else if(G.isAllowPivot())q.push({colId:G.getId(),pivot:!0})}:(G)=>{if(J.isColumnSelectedInPivotModeToolPanel(p(Q),G))q.push({colId:G.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};f.forEach(Z),J.applyColumnState(p(Q),q,z),g_(_,Q)}function qZ(_,f){let{columns:$,visibleState:z,pivotState:Q,eventType:J}=f,q=_.columnStateUpdateStrategy,X=q.getPivotMode(p(f)),Y=$.map((Z)=>{let G=Z.getColId();if(X){let E=Q?.[G];return{colId:G,pivot:E?.pivot,rowGroup:E?.rowGroup,aggFunc:E?.aggFunc}}else return{colId:G,hide:!z?.[G]}});q.applyColumnState(p(f),Y,J),g_(_,f)}function yA(_){return{pivot:_.isPivotActive(),rowGroup:_.isRowGroupActive(),aggFunc:_.isValueActive()?_.getAggFunc():void 0}}function XZ(_,f,$){if(!$)return yA(_);let z=f.getRowGroupColumns($).includes(_),Q=f.getPivotColumns($).includes(_),J=f.getValueColumns($).includes(_);return{pivot:Q,rowGroup:z,aggFunc:J?f.getColumnAggFunc($,_):void 0}}var YZ=(_,f)=>{if(!f)return[];let $=_;for(let z=0,Q=f.length;z{let z=_.aggData;if(z===f)return;if(_.aggData=f,_.__localEventService)bA(_,z,f,$)},GY=(_,f,$)=>{h1(_,f,$);let z=_.pinnedSibling;if(z)h1(z,f,$);let Q=_.sibling;if(Q){h1(Q,f,$);let J=Q.pinnedSibling;if(J)h1(J,f,$)}},bA=(_,f,$,z)=>{if(!$){if(!f)return;let q=Object.keys(f);for(let X=0,Y=q.length;X{if(!_)return;let z=_.group;if(z===$)return;if(_.group=$,_.updateHasChildren(),z&&!$)h1(_,null,f.colModel),_.setAllChildrenCount(null);f.selectionSvc?.updateRowSelectable(_),_.dispatchRowEvent("groupChanged")},ZZ=(_,f,$)=>{EY(_,f,$),EY(_.pinnedSibling,f,$)},m$=(_,f)=>{let{gos:$,rowGroupColsSvc:z}=f;if(!z||!_)return!1;let Q=$.get("groupLockGroupColumns");if(!_.isRowGroupActive()||Q===0)return!1;if(Q===-1)return!0;let J=z.columns.findIndex((q)=>q.getColId()===_.getColId());return Q>J},u$=(_,f,$)=>{let Q=_(f,`${f==="groupBy"?"Group by":"Un-Group by"} ${$}`,[$]);if(Q.indexOf($)>=0)return Q;else return`${Q} ${$}`};function CA(_){let f=a_(_),$="getSelection"in f?f.getSelection():null,z=[];for(let Q=0;Q<($?.rangeCount??0);Q++){let J=$?.getRangeAt(Q);if(J)z.push(J)}return{selection:$,ranges:z}}function wA(_,f){if(!_.gos.get("enableCellTextSelection"))return f();if(!az()&&!ef())return f();let{selection:z,ranges:Q}=CA(_);f(),z?.removeAllRanges();for(let J of Q)z?.addRange(J)}var xA={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},GZ={getMenuItemComp:(_,f,$)=>{return _.userCompFactory.getCompDetails(f,xA,"agMenuItem",C(_.gos,$),!0)?.newAgStackInstance()??g.resolve()},getPostProcessPopupParams:({column:_,node:f})=>({column:_,rowNode:f}),preserveRangesWhile:wA,stopPropagationCallbacks:Ff,warnNoItem:(_)=>{j(228,{menuItemOrString:_})}},NA=class extends F2{constructor(){super(GZ)}},EZ=class extends lY{constructor(_,f={column:null,node:null,value:null}){super(_,f,GZ)}},UZ=class extends w{constructor(_,f,$,z={}){super({tag:"div",cls:"ag-menu"});this.column=_,this.mouseEventOrTouch=f,this.parentEl=$,this.params=z,this.displayName=null}postConstruct(){let{column:_,beans:{colNames:f}}=this;this.initializeProperties(_);let $;if(Q0(_))$=f.getDisplayNameForColumn(_,"columnToolPanel");else $=f.getDisplayNameForProvidedColumnGroup(null,_,"columnToolPanel");if(this.displayName=$,this.buildMenuItemMap(),this.isActive()){let z=this.mouseEventOrTouch;if("preventDefault"in z)z.preventDefault();let Q=this.getMappedMenuItems();if(Q.length===0)return;this.displayContextMenu(Q)}}initializeProperties(_){let f=this.beans.columnStateUpdateStrategy,$;if(X_(_))$=_.getLeafColumns();else $=[_];this.columns=$;let z=f.getPivotMode(p(this.params));this.allowScrollIntoView=!z&&$.some(this.isColumnValidForScrollIntoView),this.allowGrouping=$.some((Q)=>Q.isPrimary()&&Q.isAllowRowGroup()),this.allowValues=$.some((Q)=>Q.isPrimary()&&Q.isAllowValue()),this.allowPivoting=z&&$.some((Q)=>Q.isPrimary()&&Q.isAllowPivot())}buildMenuItemMap(){let _=this.getLocaleTextFunc(),{beans:f,displayName:$}=this,z=this.beans.columnStateUpdateStrategy,Q=new Map;this.menuItemMap=Q;let J=p(this.params),q=z.getPivotMode(J),X=new Set(z.getRowGroupColumns(J).map((H)=>H.getColId())),Y=new Set(z.getValueColumns(J).map((H)=>H.getColId())),Z=new Set(z.getPivotColumns(J).map((H)=>H.getColId()));Q.set("scrollIntoView",{allowedFunction:(H)=>!H.isPinned()&&!q&&this.isColumnValidForScrollIntoView(H),activeFunction:()=>!1,activateLabel:()=>_("scrollColumnIntoView",`Scroll ${$} into View`,[$]),activateFunction:()=>{let H=this.columns.find(this.isColumnValidForScrollIntoView);if(H)this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(H)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});let G=(H)=>H.isPrimary()&&H.isAllowRowGroup()&&!m$(H,f);Q.set("rowGroup",{allowedFunction:G,activeFunction:(H)=>X.has(H.getColId()),activateLabel:()=>u$(_,"groupBy",$),deactivateLabel:()=>u$(_,"ungroupBy",$),activateFunction:()=>{let H=this.addColumnsToList(z.getRowGroupColumns(J),G);z.setRowGroupColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(z.getRowGroupColumns(J),G);z.setRowGroupColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});let E=(H)=>H.isPrimary()&&H.isAllowValue();Q.set("value",{allowedFunction:E,activeFunction:(H)=>Y.has(H.getColId()),activateLabel:()=>_("addToValues",`Add ${$} to values`,[$]),deactivateLabel:()=>_("removeFromValues",`Remove ${$} from values`,[$]),activateFunction:()=>{let H=this.addColumnsToList(z.getValueColumns(J),E);z.setValueColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(z.getValueColumns(J),E);z.setValueColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});let U=(H)=>q&&H.isPrimary()&&H.isAllowPivot();Q.set("pivot",{allowedFunction:U,activeFunction:(H)=>Z.has(H.getColId()),activateLabel:()=>_("addToLabels",`Add ${$} to labels`,[$]),deactivateLabel:()=>_("removeFromLabels",`Remove ${$} from labels`,[$]),activateFunction:()=>{let H=this.addColumnsToList(z.getPivotColumns(J),U);z.setPivotColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(z.getPivotColumns(J),U);z.setPivotColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(_){if(!_.isVisible())return!1;let $=_.getParent();if(!$)return!0;return $.getDisplayedChildren()?.includes(_)??!0}addColumnsToList(_,f){return[..._].concat(this.columns.filter(($)=>f($)&&!_.includes($)))}removeColumnsFromList(_,f){return _.filter(($)=>!f($)||!this.columns.includes($))}displayContextMenu(_){let f=this.getGui(),$=this.createBean(new EZ),z=this.getLocaleTextFunc(),Q=()=>{};f.appendChild($.getGui()),$.addMenuItems(_),$.addManagedListeners($,{closeMenu:()=>{this.parentEl.focus(),Q()}});let J=this.beans.popupSvc,q=J.addPopup({modal:!0,eChild:f,closeOnEsc:!0,afterGuiAttached:()=>F_($.getGui()),ariaLabel:z("ariaLabelContextMenu","Context Menu"),closedCallback:(X)=>{if(X instanceof KeyboardEvent)this.parentEl.focus();this.destroyBean($)}});if(q)Q=q.hideFunc;J.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:f})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){let _=[],{menuItemMap:f,columns:$,displayName:z,beans:Q}=this;for(let J of f.values()){let q=$.some((Y)=>J.allowedFunction(Y)&&!J.activeFunction(Y)),X=$.some((Y)=>J.allowedFunction(Y)&&J.activeFunction(Y));if(q)_.push({name:J.activateLabel(z),icon:h(J.addIcon,Q,null),action:()=>J.activateFunction()});if(X&&J.removeIcon&&J.deactivateLabel)_.push({name:J.deactivateLabel(z),icon:h(J.removeIcon,Q,null),action:()=>J.deActivateFunction?.()})}return _}},gA={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},HZ=class extends w{constructor(_,f,$,z,Q){super();this.modelItem=_,this.allowDragging=f,this.eventType=$,this.focusWrapper=z,this.params=Q,this.cbSelect=V,this.eLabel=V,this.eGroupOpenedIcon=V,this.eGroupClosedIcon=V,this.eColumnGroupIcons=V,this.processingColumnStateChange=!1;let{columnGroup:J,depth:q,displayName:X}=_;this.columnGroup=J,this.columnDepth=q,this.displayName=X}postConstruct(){this.setTemplate(gA,[h0]);let{beans:_,cbSelect:f,eLabel:$,displayName:z,columnDepth:Q,modelItem:J,focusWrapper:q,columnGroup:X}=this,{registry:Y,gos:Z}=_,G=h("columnDrag",_);this.eDragHandle=G,G.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");let E=f.getGui(),U=f.getInputElement();E.after(G),U.setAttribute("tabindex","-1"),$.textContent=z??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+Q),this.getGui().style.setProperty("--ag-indentation-level",String(Q)),this.tooltipFeature=this.createOptionalManagedBean(Y.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:EQ(Z,()=>$)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners($,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(f,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(J,{expandedChanged:this.onExpandChanged.bind(this)});let H=new u_(this.getGui(),!1);this.addManagedListeners(H,{longTap:(B)=>this.onContextMenu(B.touchStart)}),this.addDestroyFunc(H.destroy.bind(H)),this.addManagedListeners(q,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();let W=$Q(X.getColGroupDef(),Z,null,X);for(let B of W)this.toggleCss(B,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){let _=this.columnGroup.getColGroupDef();if(!_)return;let f=()=>this.tooltipFeature?.setTooltipAndRefresh(_.headerTooltip);f(),this.addManagedEventListeners({newColumnsLoaded:f})}handleKeyDown(_){switch(_.key){case S.LEFT:_.preventDefault(),this.modelItem.expanded=!1;break;case S.RIGHT:_.preventDefault(),this.modelItem.expanded=!0;break;case S.SPACE:if(_.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(_){let{columnGroup:f,gos:$}=this;if($.get("functionsReadOnly"))return;let z=this.createBean(new UZ(f,_,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(z.isAlive())this.destroyBean(z)})}addVisibilityListenersToAllChildren(){let _=this.onColumnStateChanged.bind(this);for(let f of this.columnGroup.getLeafColumns())this.addManagedListeners(f,{visibleChanged:_,columnValueChanged:_,columnPivotChanged:_,columnRowGroupChanged:_})}setupDragging(){if(!this.allowDragging){N(this.eDragHandle,!1);return}let _=this.beans,{gos:f,eventSvc:$,dragAndDrop:z}=_,Q=!f.get("suppressDragLeaveHidesColumns"),J={type:G0.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>Q?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{Q=!f.get("suppressDragLeaveHidesColumns"),$.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{$.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(q)=>{if(Q)qZ(_,{columns:this.columnGroup.getLeafColumns(),visibleState:q?.visibleState,pivotState:q?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{if(Q)this.onChangeCommon(!1)}};z.addDragSource(J,!0),this.addDestroyFunc(()=>z.removeDragSource(J))}createDragItem(){let _=this.columnGroup.getLeafColumns(),f={},$={},z=this.beans.columnStateUpdateStrategy,Q=p(this.params);for(let J of _){let q=J.getId();f[q]=J.isVisible(),$[q]=XZ(J,z,Q)}return{columns:_,visibleState:f,pivotState:$}}setupExpandContract(){let{beans:_,eGroupClosedIcon:f,eGroupOpenedIcon:$,eColumnGroupIcons:z}=this;f.appendChild(zQ("columnSelectClosed",_,null)),$.appendChild(zQ("columnSelectOpen",_,null));let Q=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(f,{click:Q}),this.addManagedElementListeners($,{click:Q});let J=new u_(z,!0);this.addManagedListeners(J,{tap:Q}),this.addDestroyFunc(J.destroy.bind(J))}onLabelClicked(){let _=!this.cbSelect.getValue();this.onChangeCommon(_)}onCheckboxChanged(_){this.onChangeCommon(_.selected)}getVisibleLeafColumns(){let _=[],f=($)=>{for(let z of $)if(z.passesFilter)if(z.group)f(z.children);else _.push(z.column)};return f(this.modelItem.children),_}onChangeCommon(_){if(this.refreshAriaLabel(),this.processingColumnStateChange)return;QZ(this.beans,this.modelItem.children,_,this.eventType,this.params)}refreshAriaLabel(){let{cbSelect:_,focusWrapper:f,displayName:$}=this,z=this.getLocaleTextFunc(),Q=z("ariaColumnGroup","Column Group"),J=_.getValue(),q=J===void 0?z("ariaIndeterminate","indeterminate"):J?z("ariaVisible","visible"):z("ariaHidden","hidden"),X=z("ariaToggleVisibility","Press SPACE to toggle visibility");W_(f,`${$} ${Q}`),_.setInputAriaLabel(`${X} (${q})`),xz(f,_.getInputElement().id)}onColumnStateChanged(){let _=this.workOutSelectedValue(),f=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;let $=this.cbSelect;$.setValue(_),$.setReadOnly(f),this.toggleCss("ag-column-select-column-group-readonly",f),this.processingColumnStateChange=!1}workOutSelectedValue(){let f=this.beans.columnStateUpdateStrategy.getPivotMode(p(this.params)),$=this.getVisibleLeafColumns(),z=0,Q=0;for(let J of $)if(f||!J.getColDef().lockVisible)if(this.isColumnChecked(J))z++;else Q++;if(z>0&&Q>0)return;return z>0}workOutReadOnlyValue(){let _=this.beans.columnStateUpdateStrategy.getPivotMode(p(this.params)),f=0;for(let $ of this.columnGroup.getLeafColumns())if(_){if($.isAnyFunctionAllowed())f++}else if(!$.getColDef().lockVisible)f++;return f===0}isColumnChecked(_){let f=this.beans.columnStateUpdateStrategy;if(f.getPivotMode(p(this.params)))return f.isColumnSelectedInPivotModeToolPanel(p(this.params),_);return f.isColumnVisibleInToolPanel(p(this.params),_)}onExpandOrContractClicked(){let _=this.modelItem,f=_.expanded;_.expanded=!f}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){let _=this.modelItem.expanded;N(this.eGroupClosedIcon,!_),N(this.eGroupOpenedIcon,_)}refreshAriaExpanded(){N_(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(_){let f=this.cbSelect,$=f.getValue();if(!f.isReadOnly()&&(_&&!$||!_&&$))f.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(_){this.cbSelect.setValue(_,!0)}},Z2=(_)=>{if(X_(_))return _.getLeafColumns();return _?[_]:[]},hA=(_,f,$,z)=>{if(!f||!_)return null;let Q=z.indexOf(f),J=$?Q:Q+1,q=uA(z,_,J);return J-q},uA=(_,f,$)=>{if(!f)return 0;let z=f[0],Q=f.length;if(_.indexOf(z)<$)return Q;return 0},UY=(_,f,$,z)=>{let Q=p(z);if(_.get("suppressMovableColumns")||f.columnStateUpdateStrategy.getPivotMode(Q))return!0;return!!$.find(({colDef:X})=>!!X.suppressMovable||!!X.lockPosition)},HY=(_,f,$,z)=>{if(!$)return;let{component:Q}=$,J=null,q=$.position==="top";if(Q instanceof HZ)J=Q.getColumns()[0],q=!0;else if(Q)J=Q.column;if(!J)return;let X=p(z),Y=X?_.columnStateUpdateStrategy.getPrimaryColumns(X):_.colModel.getCols(),Z=hA(f,J,q,Y);if(Z!=null)_.columnStateUpdateStrategy.moveColumns(X,f,Z,"toolPanelUi"),g_(_,z)},iA=(_)=>{return _.column},mA={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},cA=class extends w{constructor(_,f,$,z,Q){super();this.modelItem=_,this.allowDragging=f,this.groupsExist=$,this.focusWrapper=z,this.params=Q,this.eLabel=V,this.cbSelect=V,this.processingColumnStateChange=!1;let{column:J,depth:q,displayName:X}=_;this.column=J,this.columnDepth=q,this.displayName=X}postConstruct(){this.setTemplate(mA,[h0]);let{beans:_,cbSelect:f,displayName:$,eLabel:z,columnDepth:Q,groupsExist:J,column:q,gos:X,focusWrapper:Y}=this,Z=h("columnDrag",_);this.eDragHandle=Z,Z.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");let G=f.getGui(),E=f.getInputElement();if(G.after(Z),E.setAttribute("tabindex","-1"),z.textContent=$,J)this.addCss("ag-column-select-add-group-indent");this.addCss(`ag-column-select-indent-${Q}`),this.getGui().style.setProperty("--ag-indentation-level",String(Q)),this.tooltipFeature=this.createOptionalManagedBean(_.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:EQ(X,()=>z),getAdditionalParams:()=>({colDef:q.getColDef()})})),this.setupDragging();let U=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:U}),this.addManagedListeners(q,{columnValueChanged:U,columnPivotChanged:U,columnRowGroupChanged:U,visibleChanged:U}),this.addManagedListeners(Y,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});let H=new u_(Y);this.addManagedListeners(H,{longTap:(B)=>this.onContextMenu(B.touchStart)}),this.addDestroyFunc(H.destroy.bind(H)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(f,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(z,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();let W=$Q(q.getColDef(),X,q,null);for(let B of W)this.toggleCss(B,!0)}getColumn(){return this.column}setupTooltip(){let _=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);_(),this.addManagedEventListeners({newColumnsLoaded:_})}onContextMenu(_){let{column:f,gos:$}=this;if($.get("functionsReadOnly"))return;let z=this.createBean(new UZ(f,_,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(z.isAlive())this.destroyBean(z)})}handleKeyDown(_){if(_.key===S.SPACE){if(_.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected())}}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;let _=!this.cbSelect.getValue();this.onChangeCommon(_)}onCheckboxChanged(_){this.onChangeCommon(_.selected)}onChangeCommon(_){if(this.cbSelect.isReadOnly())return;if(this.refreshAriaLabel(),this.processingColumnStateChange)return;JZ(this.beans,[this.column],_,"toolPanelUi",this.params)}refreshAriaLabel(){let{cbSelect:_,focusWrapper:f,displayName:$}=this,z=this.getLocaleTextFunc(),Q=z("ariaColumn","Column"),J=_.getValue()?z("ariaVisible","visible"):z("ariaHidden","hidden"),q=z("ariaToggleVisibility","Press SPACE to toggle visibility");W_(f,`${$} ${Q}`),this.cbSelect.setInputAriaLabel(`${q} (${J})`),xz(f,_.getInputElement().id)}setupDragging(){let _=this.eDragHandle;if(!this.allowDragging){N(_,!1);return}let f=this.beans,{gos:$,eventSvc:z,dragAndDrop:Q}=f;if(p(this.params))_.setAttribute("data-column-tool-panel-deferred","");let J=!$.get("suppressDragLeaveHidesColumns"),q={type:G0.ToolPanel,eElement:_,dragItemName:this.displayName,getDefaultIconName:()=>J&&!p(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{J=!$.get("suppressDragLeaveHidesColumns"),z.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{z.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(X)=>{if(J&&!p(this.params))qZ(f,{columns:[this.column],visibleState:X?.visibleState,pivotState:X?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{if(J&&!p(this.params))this.onChangeCommon(!1)}};Q.addDragSource(q,!0),this.addDestroyFunc(()=>Q.removeDragSource(q))}createDragItem(){let _=this.column.getColId(),f={[_]:this.column.isVisible()},$=this.beans.columnStateUpdateStrategy,z={[_]:XZ(this.column,$,p(this.params))};return{columns:[this.column],visibleState:f,pivotState:z}}onColumnStateChanged(){this.processingColumnStateChange=!0;let _=this.beans.columnStateUpdateStrategy,f=_.getPivotMode(p(this.params));if(f){let Q=_.isColumnSelectedInPivotModeToolPanel(p(this.params),this.column);this.cbSelect.setValue(Q)}else this.cbSelect.setValue(_.isColumnVisibleInToolPanel(p(this.params),this.column));let $=!0,z=!0;if(f){let Q=this.gos.get("functionsReadOnly"),J=!this.column.isAnyFunctionAllowed();$=!Q&&!J,z=$}else{let{enableRowGroup:Q,enableValue:J,lockPosition:q,suppressMovable:X,lockVisible:Y}=this.column.getColDef(),Z=!!Q||!!J,G=!!q||!!X;$=!Y,z=Z||!G}this.cbSelect.setReadOnly(!$),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!z),this.toggleCss("ag-column-select-column-readonly",!z&&!$),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(_){let f=this.cbSelect;if(_!==f.getValue()){if(!f.isReadOnly())f.toggle()}}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(_){j(158)}},pA=class{constructor(_){this.items=_}getRowCount(){return this.items.length}getRow(_){return this.items[_]}},nA="ag-column-select-list",dA=class extends w{constructor(){super({tag:"div",cls:nA,role:"presentation"});this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(_){this.colModel=_.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(let _ of this.destroyColumnItemFuncs)_();this.destroyColumnItemFuncs=[]}init(_,f,$){this.params=_;let{suppressSyncLayoutWithGrid:z,contractColumnSelection:Q,suppressColumnMove:J}=_;if(this.allowDragging=f,this.eventType=$,!z)this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)});this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});let q=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:q,columnPivotModeChanged:q,columnRowGroupChanged:q,columnValueChanged:q,columnVisible:q,newColumnsLoaded:q}),this.expandGroupsByDefault=!Q;let X=J||z,Y=this.createManagedBean(new aY({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(Z,G)=>{if(X)return;this.moveItems(Z,G)}}));if(this.virtualList=Y,this.appendChild(Y.getGui()),Y.setComponentCreator((Z,G)=>{return s9(G,Z.depth+1),this.createComponentFromItem(Z,G)}),this.colModel.ready)this.onColumnsChanged();if(X)return;this.createItemDragFeature()}createItemDragFeature(){let{gos:_,beans:f,virtualList:$}=this;this.createManagedBean(new cS(this,$,{dragSourceType:G0.ToolPanel,addListeners:(z,Q,J)=>{z.addManagedEventListeners({columnPanelItemDragStart:Q,columnPanelItemDragEnd:J})},getCurrentDragValue:(z)=>iA(z),isMoveBlocked:(z)=>UY(_,f,Z2(z),this.params),getNumRows:(z)=>z.getDisplayedColsList().length,moveItem:(z,Q)=>HY(f,Z2(z),Q,this.params)}))}moveItems(_,f){let{gos:$,beans:z}=this,{modelItem:Q}=_,{group:J,columnGroup:q,column:X,expanded:Y}=Q,Z=Z2(J?q:X);if(UY($,z,Z,this.params))return;let G=this.displayedColsList.indexOf(Q),E=f?-1:1,U=0;if(f){let W=_.columnDepth>0?X.getParent()?.getChildren():null;if(W?.length&&X===W[0])U=-1}else if(J)U=Y?Q.children.length:0;let H=Math.min(Math.max(G+U+E,0),this.displayedColsList.length-1);this.skipRefocus=!0,HY(z,Z,{rowIndex:H,position:f?"top":"bottom",component:this.virtualList.getComponentAt(H)},this.params),this.focusRowIfAlive(H-U).then(()=>{this.skipRefocus=!1})}createComponentFromItem(_,f){let $=this.allowDragging;if(_.group){let Q=new HZ(_,$,this.eventType,f,this.params);return this.createBean(Q),Q}let z=new cA(_,$,this.groupsExist,f,this.params);return this.createBean(z),z}onColumnsChanged(){let _=this.params;if(!this.hasLoadedInitialState)this.hasLoadedInitialState=!0,this.isInitialState=!!_.initialState;let f=this.getExpandedStates(),$=this.colModel.isPivotMode(),z=p(_),Q=z&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(z);if((!_.suppressSyncLayoutWithGrid||z)&&!$||Q)this.buildTreeFromWhatGridIsDisplaying();else this.buildTreeFromProvidedColumnDefs();this.setExpandedStates(f),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){let _={};if(this.isInitialState){let{expandedGroupIds:f}=this.params.initialState;for(let $ of f)_[$]=!0;return _}if(!this.allColsTree)return{};return this.forEachItem((f)=>{if(!f.group)return;let $=f.columnGroup;if($)_[$.getId()]=f.expanded}),_}setExpandedStates(_){if(!this.allColsTree)return;let{isInitialState:f}=this;this.forEachItem(($)=>{if(!$.group)return;let z=$.columnGroup;if(z){let Q=_[z.getId()];if(Q!=null||f)$.expanded=!!Q}})}buildTreeFromWhatGridIsDisplaying(){let _=p(this.params);if(_&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(_)){let f=this.beans.columnStateUpdateStrategy.getPrimaryColumns(_);if(f.length>0){VA(f,this.setColumnLayout.bind(this));return}}if(this.params.suppressSyncLayoutWithGrid){this.buildTreeFromProvidedColumnDefs();return}jA(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(_){let f=RA(this.colModel,_);this.buildListModel(f),this.groupsExist=_.some(($)=>{return $&&typeof $.children<"u"}),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){let _=this.colModel;this.buildListModel(_.getColDefColTree()),this.groupsExist=!!_.colDefCols?.treeDepth}buildListModel(_){let f=this.onColumnExpanded.bind(this),$=(X)=>{X.addEventListener("expandedChanged",f);let Y=X.removeEventListener.bind(X,"expandedChanged",f);this.destroyColumnItemFuncs.push(Y)},z=this.beans.colNames,Q=(X,Y,Z)=>{for(let G of X)if(X_(G))J(G,Y,Z);else q(G,Y,Z)},J=(X,Y,Z)=>{if(X.getColGroupDef()?.suppressColumnsToolPanel)return;if(X.isPadding()){Q(X.getChildren(),Y,Z);return}let U=z.getDisplayNameForProvidedColumnGroup(null,X,"columnToolPanel"),H=new ZY(U,X,Y,!0,this.expandGroupsByDefault);Z.push(H),$(H),Q(X.getChildren(),Y+1,H.children)},q=(X,Y,Z)=>{if(X.getColDef()?.suppressColumnsToolPanel)return;let E=z.getDisplayNameForColumn(X,"columnToolPanel");Z.push(new ZY(E,X,Y))};this.destroyColumnTree(),Q(_,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];let _=(z)=>{if(!z.passesFilter)return;if(this.displayedColsList.push(z),z.group&&z.expanded)z.children.forEach(_)},f=this.virtualList;this.allColsTree.forEach(_),f.setModel(new pA(this.displayedColsList));let $=null;if(!this.skipRefocus)$=f.getLastFocusedRow();if(f.refresh(),$!=null)this.focusRowIfAlive($);this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){let _=this.getLocaleTextFunc(),f=_("ariaColumnPanelList","Column List"),$=_("columns","Columns"),z=this.displayedColsList.length;W_(this.virtualList.getAriaElement(),`${f} ${z} ${$}`)}focusRowIfAlive(_){if(_===-1)return Promise.resolve();return new Promise((f)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(_);f()},0)})}forEachItem(_){let f=(z)=>{for(let Q of z)if(_(Q),Q.group)f(Q.children)},$=this.allColsTree;if(!$)return;f($)}doSetExpandedAll(_){this.forEachItem((f)=>{if(f.group)f.expanded=_})}setGroupsExpanded(_,f){if(!f){this.doSetExpandedAll(_);return}let $=[];this.forEachItem((Q)=>{if(!Q.group)return;let J=Q.columnGroup.getId();if(f.indexOf(J)>=0)Q.expanded=_,$.push(J)});let z=f.filter((Q)=>!$.includes(Q));if(z.length>0)j(157,{unrecognisedGroupIds:z})}getExpandState(){let _=0,f=0;if(this.forEachItem(($)=>{if(!$.group)return;if($.expanded)_++;else f++}),_>0&&f>0)return 2;if(f>0)return 1;return 0}doSetSelectedAll(_){QZ(this.beans,this.allColsTree,_,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let _=0;_{if(Q.group)return;if(!Q.passesFilter)return;let J=Q.column,q=J.getColDef(),X;if(z){if(!J.isAllowPivot()&&!J.isAllowRowGroup()&&!J.isAllowValue())return;X=$.isColumnSelectedInPivotModeToolPanel(p(this.params),J)??!1}else{if(q.lockVisible)return;X=$.isColumnVisibleInToolPanel(p(this.params),J)??!1}if(X)_++;else f++}),_>0&&f>0)return;return!(_===0||f>0)}setFilterText(_){this.filterText=v(_)?_.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){let _=($)=>{if(!v(this.filterText))return!0;let z=$.displayName;return z==null||z.toLowerCase().indexOf(this.filterText)!==-1},f=($,z)=>{let Q=!1;if($.group){let q=_($);for(let X of $.children){let Y=f(X,q||z);if(Y)Q=Y}}let J=z||Q?!0:_($);return $.passesFilter=J,J};for(let $ of this.allColsTree)f($,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){let _=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:_})}fireSelectionChangedEvent(){if(!this.allColsTree)return;let _=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:_})}getExpandedGroups(){let _=[];if(!this.allColsTree)return _;return this.forEachItem((f)=>{if(f.group&&f.expanded)_.push(f.columnGroup.getId())}),_}},tA={selector:"AG-PRIMARY-COLS-LIST",component:dA},rA={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},WZ=class extends w{constructor(){super(rA,[AA,tA]);this.primaryColsHeaderPanel=V,this.primaryColsListPanel=V,this.registerCSS(DA)}init(_,f,$){let{primaryColsHeaderPanel:z,primaryColsListPanel:Q}=this;z.init(f);let{suppressColumnFilter:J,suppressColumnSelectAll:q}=f;if(f.suppressColumnExpandAll&&J&&q)z.setDisplayed(!1);this.addManagedListeners(Q,{groupExpanded:(Y)=>{z.setExpandState(Y.state),f.onStateUpdated()},selectionChanged:(Y)=>z.setSelectionState(Y.state)}),Q.init(f,_,$),this.addManagedListeners(z,{expandAll:Q.doSetExpandedAll.bind(Q,!0),collapseAll:Q.doSetExpandedAll.bind(Q,!1),selectAll:Q.doSetSelectedAll.bind(Q,!0),unselectAll:Q.doSetSelectedAll.bind(Q,!1),filterChanged:(Y)=>Q.setFilterText(Y.filterText)}),this.positionableFeature=this.createManagedBean(new j$(this.getGui(),{minHeight:100}))}toggleResizable(_){this.positionableFeature.setResizable(_?{bottom:!0}:!1)}expandGroups(_){this.primaryColsListPanel.setGroupsExpanded(!0,_)}collapseGroups(_){this.primaryColsListPanel.setGroupsExpanded(!1,_)}setColumnLayout(_){this.primaryColsListPanel.setColumnLayout(_)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},lA=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}",sA="ag-column-panel-deferred",aA=class extends w{constructor(){super({tag:"div",cls:"ag-column-panel"});this.initialised=!1,this.childDestroyFuncs=[],this.isDeferModeEnabled=!1,this.isCommitting=!1,this.onDeferredApply=()=>{this.isCommitting=!0;try{this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled)}finally{this.isCommitting=!1}this.deferredButtonsComp?.updateValidity(!1),this.lastKnownGridState=this.captureGridState()},this.onDeferredCancel=()=>{this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy(),this.lastKnownGridState=this.captureGridState()},this.onPivotModePanelValueChanged=()=>{this.refreshToolPanelLayouts(),this.setLastVisible(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))},this.onColumnEverythingChanged=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;let _=this.captureGridState();if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)){this.lastKnownGridState=_;return}let f=this.lastKnownGridState&&this.isGridStateEqual(this.lastKnownGridState,_);if(this.lastKnownGridState=_,!f)return;this.resetDeferredState()},this.onExternalGridChange=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))return;this.resetDeferredState(),this.lastKnownGridState=this.captureGridState()},this.registerCSS(lA)}wireBeans(_){this.colToolPanelFactory=_.colToolPanelFactory}setVisible(_){if(super.setDisplayed(_),_&&!this.initialised)this.init(this.params)}init(_){let $={...C(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),..._};this.params=$;let{childDestroyFuncs:z,colToolPanelFactory:Q,gos:J}=this,q=J.isModuleRegistered("SharedPivot"),X=q||J.isModuleRegistered("SharedRowGrouping");if(this.isDeferModeEnabled=p($),this.toggleCss(sA,this.isDeferModeEnabled),!$.suppressPivotMode&&Q&&q)this.pivotModePanel=Q.createPivotModePanel(this,z,$,this.onPivotModePanelValueChanged);let Y=this.createBean(new WZ);if(this.primaryColsPanel=Y,z.push(()=>this.destroyBean(this.primaryColsPanel)),Y.init(!0,$,"toolPanelUi"),Y.addCss("ag-column-panel-column-select"),this.appendChild(Y),Q){if(!$.suppressRowGroups&&X)this.rowGroupDropZonePanel=Q.createRowGroupPanel(this,z,$);if(!$.suppressValues&&X)this.valuesDropZonePanel=Q.createValuesPanel(this,z,$);if(!$.suppressPivots&&q)this.pivotDropZonePanel=Q.createPivotPanel(this,z,$);this.setLastVisible();let[Z]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});z.push(()=>Z())}if(this.isDeferModeEnabled){let Z=this.onExternalGridChange;z.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:Z,columnVisible:Z,columnRowGroupChanged:Z,columnValueChanged:Z,columnPivotChanged:Z,columnPivotModeChanged:Z,newColumnsLoaded:Z,...$.suppressSyncLayoutWithGrid?{}:{columnMoved:Z}}))}if($.buttons){if(!$.buttons.includes("apply"))j(298);if($.buttons.length)this.initDeferredButtons($.buttons)}this.initialised=!0}initDeferredButtons(_){let f=this.createBean(new _2({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=f,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});let $=this.getLocaleTextFunc(),z=_.map((Q)=>({type:Q,label:$(Q==="apply"?"applyColumnToolPanel":"cancelColumnToolPanel",Q==="apply"?"Apply":"Cancel")}));f.updateButtons(z),f.updateValidity(!1),f.addManagedListeners(f,{apply:this.onDeferredApply,cancel:this.onDeferredCancel}),this.appendChild(f)}resetDeferredState(){this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy()}captureGridState(){let{beans:_}=this,f=($)=>($??[]).map((z)=>z.getColId());return{rowGroupColIds:f(_.rowGroupColsSvc?.columns),valueColIds:f(_.valueColsSvc?.columns),pivotColIds:f(_.pivotColsSvc?.columns),pivotMode:_.colModel.isPivotMode(),columnOrder:_.colModel.getCols().map(($)=>$.getColId()),visibleColIds:_.colModel.getCols().filter(($)=>$.isVisible()).map(($)=>$.getColId()),sortState:_.colModel.getCols().filter(($)=>$.getSort()).map(($)=>`${$.getColId()}:${$.getSort()}:${$.getSortIndex()}`),aggFuncState:(_.valueColsSvc?.columns??[]).map(($)=>$.getAggFunc()),widthState:_.colModel.getCols().map(($)=>`${$.getColId()}:${$.getActualWidth()}`)}}isGridStateEqual(_,f){return J_(_.rowGroupColIds,f.rowGroupColIds)&&J_(_.valueColIds,f.valueColIds)&&J_(_.pivotColIds,f.pivotColIds)&&_.pivotMode===f.pivotMode&&J_(_.columnOrder,f.columnOrder)&&J_(_.visibleColIds,f.visibleColIds)&&J_(_.sortState,f.sortState)&&J_(_.aggFuncState,f.aggFuncState)&&J_(_.widthState,f.widthState)}refreshDeferredUi(){this.refreshToolPanelLayouts(),this.setLastVisible(),this.pivotModePanel?.refreshEditStrategy(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))}refreshToolPanelLayouts(){this.primaryColsPanel.syncLayoutWithGrid(),this.rowGroupDropZonePanel?.refreshGui(),this.valuesDropZonePanel?.refreshGui(),this.pivotDropZonePanel?.refresh()}setPivotModeSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.pivotModePanel=f.setPanelVisible(this.pivotModePanel,_,f.createPivotModePanel.bind(f,this,this.childDestroyFuncs,this.params,this.onPivotModePanelValueChanged,!0)),this.setLastVisible()}setRowGroupsSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.rowGroupDropZonePanel=f.setPanelVisible(this.rowGroupDropZonePanel,_,f.createRowGroupPanel.bind(f,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setValuesSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.valuesDropZonePanel=f.setPanelVisible(this.valuesDropZonePanel,_,f.createValuesPanel.bind(f,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setPivotSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.pivotDropZonePanel=f.setPanelVisible(this.pivotDropZonePanel,_,f.createPivotPanel.bind(f,this,this.childDestroyFuncs,this.params)),this.pivotDropZonePanel?.setDisplayed(_),this.setLastVisible()}setResizers(){for(let _ of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!_)continue;let f=_.getGui();_.toggleResizable(!f.classList.contains("ag-last-column-drop")&&!f.classList.contains("ag-hidden")&&!f.classList.contains("ag-last-visible-child"))}}setLastVisible(){let _=this.getGui(),f=Array.prototype.slice.call(_.querySelectorAll(".ag-column-drop"));for(let Q of f)Q.classList.remove("ag-last-column-drop");let $=_.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),z=b($);if(z)z.classList.add("ag-last-column-drop");this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!z),this.setResizers()}resetChildrenHeight(){let f=this.getGui().children;for(let $=0;$J.getGui().getBoundingClientRect()),Q=z.findIndex((J)=>this.horizontal?J.right>$&&J.left<$:J.top<$&&J.bottom>$);if(Q===-1){let J=this.gos.get("enableRtl");if(z.every((Y)=>$>(this.horizontal?Y.right:Y.bottom)))return J&&this.horizontal?0:this.childPillComponents.length;if(z.every((Y)=>$<(this.horizontal?Y.left:Y.top)))return J&&this.horizontal?this.childPillComponents.length:0;return this.insertIndex}if(this.insertIndex<=Q)return Q+1;return Q}checkDragStartedBySelf(_){if(this.state!=="notDragging")return;this.state="rearrangeItems",this.potentialDndItems=this.getItems(_.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(_),this.refreshGui()}onDragging(_){if(this.checkDragStartedBySelf(_),this.checkInsertIndex(_))this.refreshGui()}handleDragEnterEnd(_){}onDragEnter(_){let f=this.getItems(_.dragSource.getDragItem());this.state="newItemsIn";let $=f.filter((Q)=>this.isItemDroppable(Q,_)),z=$.every((Q)=>this.childPillComponents.map((J)=>J.getItem()).indexOf(Q)!==-1);if($.length===0)return;if(this.potentialDndItems=$,z){this.state="notDragging";return}this.handleDragEnterEnd(_),this.checkInsertIndex(_),this.refreshGui()}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(_){}onDragLeave(_){if(this.state==="rearrangeItems"){let f=this.getItems(_.dragSource.getDragItem());this.removeItems(f)}if(this.isPotentialDndItems())this.handleDragLeaveEnd(_),this.potentialDndItems=[],this.refreshGui();this.state="notDragging"}onDragCancel(_){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.handleDragLeaveEnd(_);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}onDragStop(){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.addItems(this.potentialDndItems);else this.rearrangeItems(this.potentialDndItems);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}removeItems(_){let f=this.getExistingItems().filter(($)=>!_.includes($));this.updateItems(f),this.refreshGui()}addItems(_){if(!_)return;let f=this.getExistingItems().slice(),$=_.filter((z)=>f.indexOf(z)<0);WY(f,$,this.insertIndex),this.updateItems(f),this.refreshGui()}addItem(_){this.insertIndex=this.getExistingItems().length,this.addItems([_])}rearrangeItems(_,f){let $;if(!f)$=this.getNonGhostItems().slice();else $=this.getExistingItems().filter((z)=>_.indexOf(z)===-1);if(WY($,_,this.insertIndex),J_($,this.getExistingItems()))return!1;return this.updateItems($),this.refreshGui(),!0}refreshGui(){let _=0;if(!this.horizontal)_=this.ePillDropList.scrollTop;let f=this.resizeEnabled,$=this.getFocusedItem(),{eGridDiv:z}=this.beans,Q=b1(),J=null;if(Q)J=V_(this.beans,z)??V_(this.beans,z,!1,!0);if(this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),_!==0)this.ePillDropList.scrollTop=_;if(f)this.toggleResizable(f);if(Q)this.restoreFocus($,J)}getFocusedItem(){let _=this.getGui(),f=d(this.beans);if(!_.contains(f))return-1;return Array.from(_.querySelectorAll(".ag-column-drop-cell")).indexOf(f)}focusItemAtIndex(_){let f=this.getGui(),z=Array.from(f.querySelectorAll(".ag-column-drop-cell"))[_];if(!z)return;z.focus({preventScroll:!0})}restoreFocus(_,f){let $=this.getGui(),z=Array.from($.querySelectorAll(".ag-column-drop-cell"));if(_===-1)return;if(z.length===0)f.focus();let Q=Math.min(z.length-1,_),J=z[Q];if(J)J.focus()}focusList(_){let f=_?this.childPillComponents.length-1:0;this.restoreFocus(f,this.getFocusableElement())}getNonGhostItems(){let _=this.getExistingItems();if(this.isPotentialDndItems())return _.filter((f)=>!this.potentialDndItems.includes(f));return _}addItemsToGui(){let f=this.getNonGhostItems().map(($)=>this.createItemComponent($,!1));if(this.isPotentialDndItems()){let $=this.potentialDndItems.map((z)=>this.createItemComponent(z,!0));if(this.insertIndex>=f.length)f.push(...$);else f.splice(this.insertIndex,0,...$)}this.appendChild(this.ePillDropList),f.forEach(($,z)=>{if(z>0)this.addArrow(this.ePillDropList);this.ePillDropList.appendChild($.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){let{childPillComponents:_,ePillDropList:f}=this,$=_.length;Z_(f,$===0?"presentation":"listbox");for(let z=0;z<$;z++){let J=_[z].getGui();hz(J,z+1),gz(J,$)}}createItemComponent(_,f){let $=this.createPillComponent(_,this.dropTarget,f,this.horizontal);if($.addEventListener("columnRemove",this.removeItems.bind(this,[_])),this.createBean($),this.guiDestroyFunctions.push(()=>this.destroyBean($)),!f)this.childPillComponents.push($);return $}addIconAndTitleToGui(){let{title:_,icon:f}=this.params;if(!_||!f)return;let $=z_({tag:"div"});if(Nz($,!0),this.addElementClasses($,"title-bar"),this.addElementClasses(f,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),$.appendChild(f),!this.horizontal){let z=z_({tag:"span"});this.addElementClasses(z,"title"),z.textContent=_,$.appendChild(z)}this.appendChild($)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){let{emptyMessage:_}=this.params;if(!_||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;let f=z_({tag:"span"});f.textContent=_,this.addElementClasses(f,"empty-message"),this.ePillDropList.appendChild(f)}addArrow(_){if(this.horizontal){let f=this.gos.get("enableRtl"),$=h(f?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses($,"cell-separator"),_.appendChild($)}}},fR={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},$R=class extends w{constructor(_,f,$,z,Q){super();this.dragSourceDropTarget=_,this.ghost=f,this.horizontal=$,this.template=z,this.agComponents=Q,this.eText=V,this.eDragHandle=V,this.eButton=V}postConstruct(){this.setTemplate(this.template??fR,this.agComponents);let _=this.getGui(),{beans:f,eDragHandle:$,eText:z,eButton:Q}=this;if(this.addElementClasses(_),this.addElementClasses($,"drag-handle"),this.addElementClasses(z,"text"),this.addElementClasses(Q,"button"),$.appendChild(h("columnDrag",f)),Q.appendChild(h("cancel",f)),this.tooltipFeature=this.createOptionalManagedBean(f.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable())this.addDragSource();this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){let _=this.getLocaleTextFunc(),f=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(f,_),W_(this.getGui(),f.join(". "))}addAdditionalAriaInstructions(_,f){if(this.isRemovable()){let $=f("ariaDropZoneColumnComponentDescription","Press DELETE to remove");_.push($)}}setupTooltip(){let _=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());_(),this.addManagedEventListeners({newColumnsLoaded:_})}getDragSourceId(){return}getDefaultIconName(){return"notAllowed"}addDragSource(){let{beans:{dragAndDrop:_},eDragHandle:f}=this,$=this.createGetDragItem(),z=this.getDefaultIconName(),Q={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:f,getDefaultIconName:()=>z,getDragItem:$,dragItemName:this.getDisplayName()};_?.addDragSource(Q,!0),this.addDestroyFunc(()=>_?.removeDragSource(Q))}setupComponents(){if(this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost)this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){N(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();let _={type:"columnRemove"};this.addGuiEventListener("keydown",($)=>this.onKeyDown($)),this.addManagedElementListeners(this.eButton,{click:($)=>{this.dispatchLocalEvent(_),$.stopPropagation()}});let f=new u_(this.eButton);this.addManagedListeners(f,{tap:()=>this.dispatchLocalEvent(_)}),this.addDestroyFunc(f.destroy.bind(f))}onKeyDown(_){if(_.key===S.DELETE){if(this.isRemovable())_.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"})}}getDisplayValue(){return this.getDisplayName()}addElementClasses(_,f){f=f?`-${f}`:"";let $=this.horizontal?"horizontal":"vertical";_.classList.add(`ag-column-drop-cell${f}`,`ag-column-drop-${$}-cell${f}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},zR=class extends $R{constructor(_,f,$,z,Q,J){super(f,$,Q);this.column=_,this.dropZonePurpose=z,this.updateParams=J,this.eSortIndicator=V,this.popupShowing=!1,this.deferApply=p(J)}postConstruct(){let{sortSvc:_,colNames:f}=this.beans;if(this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},_?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},_)this.agComponents=[_.getSortIndicatorSelector()];if(this.displayName=f.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.deferApply)this.eDragHandle.setAttribute("data-column-tool-panel-deferred","");if(_)this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}});if(this.isGroupingZone())this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(_,f){let $=this.gos.get("rowGroupPanelSuppressSort"),z=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!z){let Q=f("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");_.push(Q)}if(this.isGroupingZone()&&this.column.isSortable()&&!$){let Q=f("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");_.push(Q)}super.addAdditionalAriaInstructions(_,f)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){let _=this.getLocaleTextFunc(),{name:f,aggFuncName:$}=this.getColumnAndAggFuncName(),z=_("ariaDropZoneColumnComponentAggFuncSeparator"," of "),Q={asc:_("ariaDropZoneColumnComponentSortAscending","ascending"),desc:_("ariaDropZoneColumnComponentSortDescending","descending")},J=this.getCurrentSortDirection(this.column),q=this.gos.get("rowGroupPanelSuppressSort");return[$&&`${$}${z}`,f,this.isGroupingZone()&&!q&&J&&`, ${Q[J]}`].filter((X)=>!!X).join("")}getColumnAndAggFuncName(){let _=this.displayName,f="";if(this.isAggregationZone()){let $=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),z=typeof $==="string"?$:"agg";f=this.getLocaleTextFunc()(z,z)}return{name:_,aggFuncName:f}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;let{gos:_,column:f,eSortIndicator:$}=this;if(!_.get("rowGroupPanelSuppressSort")){$.setupSort(f,!0,this.getSortDefOverride.bind(this));let z=(Q)=>{Q.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,f,Q),$.refresh(),this.setupAria(),g_(this.beans,this.updateParams)};this.addGuiEventListener("click",z),this.addGuiEventListener("keydown",(Q)=>{if(Q.key===S.ENTER&&this.isGroupingZone())z(Q)})}}getCurrentSortDirection(_){return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,_)?.direction??null}getSortDefOverride(){if(!this.deferApply)return;return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,this.column)}getDefaultIconName(){return"hide"}createGetDragItem(){let{column:_}=this;return()=>{let f={};return f[_.getId()]=_.isVisible(),{columns:[_],visibleState:f}}}setupComponents(){if(super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(_){if(super.onKeyDown(_),_.key===S.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))_.preventDefault(),this.onShowAggFuncSelection()}getDisplayValue(){let{name:_,aggFuncName:f}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${f}(${_})`:_}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;let{aggFuncSvc:_,popupSvc:f}=this.beans,$=new aY({cssIdentifier:"select-agg-func"}),z=_.getFuncNames(this.column),Q=this.getGui(),J=$.getGui();$.setModel({getRow:function(H){return z[H]},getRowCount:function(){return z.length}}),this.createBean($);let q=z_({tag:"div",cls:"ag-select-agg-func-popup"});q.style.top="0px",q.style.left="0px",q.appendChild(J),q.style.width=`${Q.clientWidth}px`;let[X]=this.addManagedElementListeners(q,{focusout:(H)=>{if(!q.contains(H.relatedTarget)&&G)G.hideFunc()}}),Y=(H)=>{if(this.destroyBean($),this.popupShowing=!1,H?.key==="Escape")Q.focus();if(X)X()},Z=this.getLocaleTextFunc(),G=f.addPopup({modal:!0,eChild:q,closeOnEsc:!0,closedCallback:Y,ariaLabel:Z("ariaLabelAggregationFunction","Aggregation Function")});if(G)$.setComponentCreator(this.createAggSelect.bind(this,G.hideFunc));$.addGuiEventListener("keydown",(H)=>{if(H.key===S.ENTER||H.key===S.SPACE){let W=$.getLastFocusedRow();if(W==null)return;let B=$.getComponentAt(W);if(B)B.selectItem()}}),f.positionPopupByComponent({type:"aggFuncSelect",eventSource:Q,ePopup:q,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),$.refresh();let E=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),U=z.findIndex((H)=>H===E);if(U===-1)U=0;$.focusRow(U)}createAggSelect(_,f){let $=()=>{if(_(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,f,"toolPanelDragAndDrop"),this.column){let X=this.getGui().querySelector(".ag-column-drop-cell-text");if(X)X.textContent=this.getDisplayValue();this.setupAria()}g_(this.beans,this.updateParams)},z=this.getLocaleTextFunc(),Q=(f||"").toString(),J=z(Q,Q);return new QR($,J)}isGroupingAndLocked(){return this.isGroupingZone()&&m$(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return G0.ToolPanel}destroy(){super.destroy(),this.column=null}},QR=class extends w{constructor(_,f){super({tag:"div",cls:"ag-select-agg-func-item",children:f});this.selectItem=_,this.addGuiEventListener("click",this.selectItem)}},V2=class extends _R{constructor(_,f,$){super(_);this.dropZonePurpose=f,this.updateParams=$,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(_){super.init(_),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(_){return _.columns??[]}isInterestedIn(_,f){if(_===G0.HeaderCell)return!0;if(_!==G0.ToolPanel)return!1;if(!this.horizontal)return!0;return!f.hasAttribute("data-column-tool-panel-deferred")}minimumAllowedNewInsertIndex(){let{gos:_,rowGroupColsSvc:f}=this.beans,$=_.get("groupLockGroupColumns"),z=f?.columns.length??0;if($===-1)return z;return Math.min($,z)}showOrHideColumnOnExit(_){return this.isRowGroupPanel()&&dz(this.gos,!0)&&!_.fromNudge}handleDragEnterEnd(_){if(this.showOrHideColumnOnExit(_)){let z=_.dragSource.getDragItem().columns;this.setColumnsVisible(z,!1,"uiColumnDragged")}}handleDragLeaveEnd(_){if(this.showOrHideColumnOnExit(_)){let $=_.dragSource.getDragItem();this.setColumnsVisible($.columns,!0,"uiColumnDragged")}}setColumnsVisible(_,f,$){if(!_)return;if(p(this.updateParams))return;let z=_.filter((Q)=>!Q.getColDef().lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,z,f,$)}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(_,f,$,z){return new zR(_,f,$,this.dropZonePurpose,z,this.updateParams)}},JR=class extends V2{constructor(_,f){super(_,"pivot",f)}postConstruct(){let _=this.getLocaleTextFunc(),f=_("pivotColumnsEmptyMessage","Drag here to set column labels"),$=_("pivots","Column Labels");if(super.init({icon:h("pivotPanel",this.beans,null),emptyMessage:f,title:$}),this.horizontal)Mf(this.beans,this,this.getGui());this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){let _=this.beans.colModel,f=_.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(f);break;case"onlyWhenPivoting":{let $=_.isPivotActive();this.setDisplayed(f&&$);break}default:this.setDisplayed(!1);break}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(p(this.updateParams)))}isItemDroppable(_,f){if(this.gos.get("functionsReadOnly")||!_.isPrimary())return!1;let $=this.beans.columnStateUpdateStrategy.getPivotColumns(p(this.updateParams)).includes(_);return _.isAllowPivot()&&(!$||this.isSourceEventFromTarget(f))}updateItems(_){this.beans.columnStateUpdateStrategy.setPivotColumns(p(this.updateParams),_,"toolPanelUi"),g_(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(p(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},qR=class extends V2{constructor(_,f){super(_,"rowGroup",f)}postConstruct(){let _=this.getLocaleTextFunc(),f=_("rowGroupColumnsEmptyMessage","Drag here to set row groups"),$=_("groups","Row Groups");if(super.init({icon:h("rowGroupPanel",this.beans,null),emptyMessage:f,title:$}),this.horizontal)Mf(this.beans,this,this.getGui());this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(_,f){if(this.gos.get("functionsReadOnly")||!_.isPrimary()||_.colDef.showRowGroup)return!1;let $=this.beans.columnStateUpdateStrategy.getRowGroupColumns(p(this.updateParams)).includes(_);return _.isAllowRowGroup()&&(!$||this.isSourceEventFromTarget(f))}updateItems(_){this.beans.columnStateUpdateStrategy.setRowGroupColumns(p(this.updateParams),_,"toolPanelUi"),g_(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(p(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},XR=class extends V2{constructor(_,f){super(_,"aggregation",f)}postConstruct(){let _=this.getLocaleTextFunc(),f=_("valueColumnsEmptyMessage","Drag here to aggregate"),$=_("values","Values");super.init({icon:h("valuePanel",this.beans,null),emptyMessage:f,title:$}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(_,f){if(this.gos.get("functionsReadOnly")||!_.isPrimary())return!1;let $=this.beans.columnStateUpdateStrategy.getValueColumns(p(this.updateParams)).includes(_);return _.isAllowValue()&&(!$||this.isSourceEventFromTarget(f))}updateItems(_){this.beans.columnStateUpdateStrategy.setValueColumns(p(this.updateParams),_,"toolPanelUi"),g_(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(p(this.updateParams))}},YR={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},ZR=class extends w{constructor(_,f){super();this.params=_,this.onPivotModeValueChanged=f,this.cbPivotMode=V}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(p(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(YR,[a5]);let _=this.cbPivotMode;_.setValue(this.getCurrentPivotMode());let f=this.getLocaleTextFunc();_.setLabel(f("pivotMode","Pivot Mode"));let $=()=>{let Q=!!_.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(p(this.params),Q,"toolPanelUi"),this.onPivotModeValueChanged?.()},z=()=>{_.setValue(this.getCurrentPivotMode())};this.addManagedListeners(_,{fieldValueChanged:$}),this.addManagedEventListeners({newColumnsLoaded:z,columnPivotModeChanged:z})}},GR=class extends A{constructor(){super(...arguments);this.beanName="colToolPanelFactory"}setPanelVisible(_,f,$){if(_)_.setDisplayed(f);else if(f)_=$();return _}createRowGroupPanel(_,f,$){return this.createPanel(_,f,new qR(!1,$))}createValuesPanel(_,f,$){return this.createPanel(_,f,new XR(!1,$))}createPivotPanel(_,f,$){return this.createPanel(_,f,new JR(!1,$))}createPivotModePanel(_,f,$,z,Q){return this.createPanel(_,f,new ZR($,z),Q)}createPanel(_,f,$,z){if($=_.createBean($),f.push(()=>_.destroyBean($)),z)_.prependChild($);else _.appendChild($);return $}},BY=()=>{},ER=class extends A{constructor(){super(...arguments);this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(_,f,$){this.getUpdateStrategy(_).applyColumnState(f,$)}commit(_){this.getUpdateStrategy(_).commit()}hasPendingChanges(_){return this.getUpdateStrategy(_).hasPendingChanges()}moveColumns(_,f,$,z){this.getUpdateStrategy(_).moveColumns(f,$,z)}reset(_){this.getUpdateStrategy(_).reset()}setColumnsVisible(_,f,$,z){this.getUpdateStrategy(_).setColumnsVisible(f,$,z)}isColumnVisibleInToolPanel(_,f){return this.getUpdateStrategy(_).isColumnVisibleInToolPanel(f)}setRowGroupColumns(_,f,$){this.getUpdateStrategy(_).setRowGroupColumns(f,$)}getRowGroupColumns(_){return this.getUpdateStrategy(_).getRowGroupColumns()}getPrimaryColumns(_){return this.getUpdateStrategy(_).getPrimaryColumns()}hasDeferredColumnOrder(_){return this.getUpdateStrategy(_).hasDeferredColumnOrder()}setValueColumns(_,f,$){this.getUpdateStrategy(_).setValueColumns(f,$)}getValueColumns(_){return this.getUpdateStrategy(_).getValueColumns()}setColumnAggFunc(_,f,$,z){this.getUpdateStrategy(_).setColumnAggFunc(f,$,z)}getColumnAggFunc(_,f){return this.getUpdateStrategy(_).getColumnAggFunc(f)}setPivotColumns(_,f,$){this.getUpdateStrategy(_).setPivotColumns(f,$)}getPivotColumns(_){return this.getUpdateStrategy(_).getPivotColumns()}setPivotMode(_,f,$){this.getUpdateStrategy(_).setPivotMode(f,$)}getPivotMode(_){return this.getUpdateStrategy(_).getPivotMode()}isColumnSelectedInPivotModeToolPanel(_,f){return this.getUpdateStrategy(_).isColumnSelectedInPivotModeToolPanel(f)}progressSortFromEvent(_,f,$){this.getUpdateStrategy(_).progressSortFromEvent(f,$)}getSortDef(_,f){return this.getUpdateStrategy(_).getSortDef(f)}getUpdateStrategy(_){return _?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new UR(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new HR(this.beans))}},UR=class{constructor(_){this.beans=_,this.lastPivotColIds=[],this.reset=BY,this.commit=BY,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(_,f){if(_.length===0)return;d_(this.beans,{state:_},f)}moveColumns(_,f,$){this.beans.colMoves?.moveColumns(_,f,$),WR(this.beans)}setColumnsVisible(_,f,$){let z=_.filter((Q)=>!Q.getColDef().lockVisible);this.beans.colModel.setColsVisible(z,f,$)}setRowGroupColumns(_,f){this.beans.rowGroupColsSvc?.setColumns(_,f)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return O2(this.beans)}setValueColumns(_,f){this.beans.valueColsSvc?.setColumns(_,f)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(_,f,$){this.beans.valueColsSvc?.setColumnAggFunc?.(_,f,$)}getColumnAggFunc(_){return _.getAggFunc()}setPivotColumns(_,f){this.lastPivotColIds=_.map(($)=>$.getColId()),this.beans.pivotColsSvc?.setColumns(_,f)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(_,f){let{colModel:$,gos:z,ctrlsSvc:Q}=this.beans;if(_===$.isPivotMode())return;let J=this.beans.pivotColsSvc?.columns.map((q)=>q.getColId())??[];if(J.length>0)this.lastPivotColIds=J;if(!_){let q=this.beans.colModel.getColDefCols()??[];d_(this.beans,{state:q.map((X)=>({colId:X.getColId(),pivot:!1,pivotIndex:null}))},f)}if(z.updateGridOptions({options:{pivotMode:_},source:f}),_&&this.lastPivotColIds.length>0)this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,f);for(let q of Q.getHeaderRowContainerCtrls())q.refresh()}progressSortFromEvent(_,f){this.beans.sortSvc?.progressSortFromEvent(_,f)}isColumnVisibleInToolPanel(_){return _.isVisible()}isColumnSelectedInPivotModeToolPanel(_){return _.isAnyFunctionActive()}getPivotMode(){return this.beans.colModel.isPivotMode()}getSortDef(_){return _.getSortDef()}},HR=class{constructor(_){this.beans=_,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){let{state:_,beans:f}=this,{columnState:$,columnOrder:z,rowGroup:Q,aggregation:J,pivot:q,pivotMode:X,sort:Y,aggFuncs:Z}=_,G=(E)=>(E??[]).map((U)=>U.getColId());if($)for(let[E,U]of $.patches){let H=f.colModel.getColDefCol(E);if(!H)continue;if(U.hide!==void 0&&U.hide!==!H.isVisible()||U.rowGroup!==void 0&&!!U.rowGroup!==H.isRowGroupActive()||U.pivot!==void 0&&!!U.pivot!==H.isPivotActive()||U.aggFunc!==void 0&&(U.aggFunc??null)!==(H.getAggFunc()??null))return!0}if(z&&!J_(z.colIds,E2(f)))return!0;if(Q&&!J_(Q.colIds,G(f.rowGroupColsSvc?.columns)))return!0;if(J&&!J_(J.colIds,G(f.valueColsSvc?.columns)))return!0;if(q&&!J_(q.colIds,G(f.pivotColsSvc?.columns)))return!0;if(X&&X.pivotMode!==f.colModel.isPivotMode())return!0;if(Y){for(let[E,U]of Y.sortDefsByColId){let H=f.colModel.getColDefCol(E);if(!H)continue;if((U?.direction??null)!==(H.getSortDef()?.direction??null))return!0}if(Y.baselineCleared){let E=O2(f);for(let U of E)if(!Y.sortDefsByColId.has(U.getColId())&&U.getSortDef()!==null)return!0}}if(Z)for(let[E,U]of Z.values){let H=f.colModel.getColDefCol(E);if(!H)continue;if(U!==H.getAggFunc())return!0}return!1}commit(){let{beans:_,state:f}=this,$=[];for(let Q of Object.keys(f)){let J=f[Q];if(J)$.push({type:Q,...J})}let z=$.sort((Q,J)=>Q.seq-J.seq);for(let Q of z)switch(Q.type){case"columnState":{d_(_,{state:[...Q.patches.values()]},Q.eventType);break}case"columnOrder":{let J=Q.colIds.map((q)=>_.colModel.getColDefCol(q)).filter((q)=>!!q&&c$(q));if(!_.colModel.isPivotMode())for(let q=0;qc$(E)),G=(Z>=0?Z:0)+q;if(Y[G]!==X)_.colMoves?.moveColumns([X],G,Q.eventType,!0)}BZ(_,J);break}case"rowGroup":{_.rowGroupColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"aggregation":{_.valueColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"pivot":{this.lastPivotColIds=Q.colIds,_.pivotColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"pivotMode":{let{colModel:J,ctrlsSvc:q,gos:X,stateSvc:Y}=_;if(Q.pivotMode!==J.isPivotMode()){let Z=_.pivotColsSvc?.columns.map((U)=>U.getColId())??[];if(Z.length>0)this.lastPivotColIds=Z;let G=Y?.getState().pivot?.pivotColIds??Z,E=Q.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:G;if(Y?.setState({...Y.getState(),pivot:{pivotMode:Q.pivotMode,pivotColIds:E}},["pivot"]),!Q.pivotMode){let U=_.colModel.getColDefCols()??[];d_(_,{state:U.map((H)=>({colId:H.getColId(),pivot:!1,pivotIndex:null}))},Q.eventType)}if(X.updateGridOptions({options:{pivotMode:Q.pivotMode},source:Q.eventType}),Q.pivotMode&&E.length>0)_.pivotColsSvc?.setColumns(E,Q.eventType);for(let U of q.getHeaderRowContainerCtrls())U.refresh()}break}case"sort":{let J=[],q=0;for(let[X,Y]of Q.sortDefsByColId)J.push({colId:X,sort:Y?.direction??null,sortIndex:Y?.direction?q++:null,sortType:Y?.type??void 0});d_(_,{state:J,defaultState:Q.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},Q.eventType);break}case"aggFuncs":{for(let[J,q]of Q.values){let X=_.colModel.getColDefCol(J);if(!X)continue;_.valueColsSvc?.setColumnAggFunc?.(X,q,Q.eventType)}break}}this.reset()}applyColumnState(_,f){for(let z of _)U2(this.state,z);let $=kQ(this.state);$.seq=l0(this.sequence),this.sequence=$.seq,$.eventType=f}moveColumns(_,f,$){let z=new Set(_.map((Y)=>Y.getColId())),J=(this.state.columnOrder?.colIds??E2(this.beans)).filter((Y)=>!z.has(Y)),q=_.map((Y)=>Y.getColId()),X=l0(this.sequence);this.sequence=X,this.state.columnOrder={colIds:[...J.slice(0,f),...q,...J.slice(f)],eventType:$,seq:X}}setColumnsVisible(_,f,$){for(let Q of _){if(Q.getColDef().lockVisible)continue;U2(this.state,{colId:Q.getColId(),hide:!f})}let z=kQ(this.state);z.seq=l0(this.sequence),this.sequence=z.seq,z.eventType=$}setRowGroupColumns(_,f){H2(this.state,"rowGroup");let $=l0(this.sequence);this.sequence=$,this.state.rowGroup={colIds:_.map((z)=>z.getColId()),eventType:f,seq:$}}setValueColumns(_,f){H2(this.state,"aggFunc");let $=new Set((this.beans.valueColsSvc?.columns??[]).map((J)=>J.getColId())),z=KY(this.state);for(let J of _)if(!$.has(J.getColId())&&!z.values.has(J.getColId())){let q=J.getAggFunc(),X=q!=null?q:this.beans.aggFuncSvc?.getDefaultAggFunc(J);if(X!=null)z.values.set(J.getColId(),X)}let Q=l0(this.sequence);this.sequence=Q,z.seq=Q,z.eventType=f,this.state.aggregation={colIds:_.map((J)=>J.getColId()),eventType:f,seq:Q}}setColumnAggFunc(_,f,$){U2(this.state,{colId:_.getColId(),aggFunc:f});let z=kQ(this.state);z.seq=l0(this.sequence),this.sequence=z.seq,z.eventType=$;let Q=KY(this.state);Q.seq=z.seq,Q.eventType=$,Q.values.set(_.getColId(),f)}getColumnAggFunc(_){let f=_.getColId();if(this.state.aggFuncs?.values.has(f))return this.state.aggFuncs.values.get(f);return _.getAggFunc()}isColumnVisibleInToolPanel(_){let f=this.state.columnState?.patches.get(_.getColId());if(f?.hide!==void 0)return!f.hide;return _.isVisible()}isColumnSelectedInPivotModeToolPanel(_){let f=_.getColId(),$=this.state.columnState?.patches.get(f),z;if($?.rowGroup!==void 0)z=!!$.rowGroup;else if(this.state.rowGroup)z=this.state.rowGroup.colIds.includes(f);else z=_.isRowGroupActive();let Q;if($?.pivot!==void 0)Q=!!$.pivot;else if(this.state.pivot)Q=this.state.pivot.colIds.includes(f);else Q=_.isPivotActive();let J;if($?.aggFunc!==void 0)J=$.aggFunc!=null;else if(this.state.aggregation)J=this.state.aggregation.colIds.includes(f);else J=_.isValueActive();return z||Q||J}setPivotColumns(_,f){H2(this.state,"pivot");let $=l0(this.sequence);this.sequence=$,this.state.pivot={colIds:_.map((z)=>z.getColId()),eventType:f,seq:$}}setPivotMode(_,f){let $=l0(this.sequence);this.sequence=$,this.state.pivotMode={pivotMode:_,eventType:f,seq:$}}getRowGroupColumns(){return C$(this.beans,G2(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,(_)=>_.rowGroup==null?void 0:!!_.rowGroup))}getPrimaryColumns(){return C$(this.beans,this.state.columnOrder?.colIds??E2(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return C$(this.beans,G2(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,(_)=>_.aggFunc===void 0?void 0:_.aggFunc!=null))}getPivotColumns(){if(!this.getPivotMode())return[];let _=this.beans.pivotColsSvc?.columns,f=_?.length?_:C$(this.beans,this.lastPivotColIds);return C$(this.beans,G2(this.state.pivot?.colIds,f,this.state.columnState?.patches,($)=>$.pivot==null?void 0:!!$.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.isPivotMode()}getSortDef(_){let f=this.state.sort,$=_.getColId(),z=f?.sortDefsByColId;if(z?.has($))return z.get($)??null;if(f?.baselineCleared)return null;return _.getSortDef()}progressSortFromEvent(_,f){let $=this.state.sort??{sortDefsByColId:new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:z}=this.beans,Q=_.getColId(),J;if($.sortDefsByColId.has(Q))J=$.sortDefsByColId.get(Q);else if($.baselineCleared)J=null;else J=_.getSortDef();let q=z?.getNextSortDirection(_,J);if(!q)return;let{gos:X}=this.beans;if(!(((X.get("multiSortKey")==="ctrl"?f.ctrlKey||f.metaKey:f.shiftKey)||X.get("alwaysMultiSort"))&&!X.get("suppressMultiSort")))$.sortDefsByColId.clear(),$.baselineCleared=!0;$.sortDefsByColId.set(Q,q.direction?q:null),$.seq=l0(this.sequence),this.sequence=$.seq,this.state.sort=$}};function C$(_,f){if(!f)return[];return f.map(($)=>_.colModel.getColDefCol($)).filter(($)=>!!$)}function G2(_,f,$,z){let Q=[..._??f?.map((q)=>q.getColId())??[]];if(!$?.size)return Q;let J=new Set(Q);for(let[q,X]of $){let Y=z(X);if(Y===void 0)continue;if(Y){if(!J.has(q))Q.push(q),J.add(q);continue}if(!J.has(q))continue;J.delete(q);let Z=Q.indexOf(q);if(Z>=0)Q.splice(Z,1)}return Q}function WR(_){let f=_.colModel.getCols().filter(($)=>c$($)).map(($)=>_.colModel.getColDefCol($.getColId())).filter(($)=>!!$);BZ(_,f)}function BZ(_,f){let $=BR(_);if(!$)return;let z=new Set(f);$.list=[...f,...$.list.filter((Q)=>c$(Q)&&!z.has(Q))]}function E2(_){return O2(_).map((f)=>f.getColId())}function O2(_){return(_.colModel.getColDefCols()??_.colModel.getCols()).filter((f)=>c$(f))}function BR(_){let f=_.colModel.colDefCols,$=f?.list;if(!Array.isArray($))return;return f}function c$(_){if(!_.isPrimary())return!1;return!of(_)&&!k$(_)}function l0(_){return _+1}function U2(_,f){let $=kQ(_),z=$.patches.get(f.colId);$.patches.set(f.colId,z?{...z,...f}:f)}function H2(_,f){let $=_.columnState?.patches;if(!$?.size)return;for(let[z,Q]of $){if(!(f in Q))continue;let J={...Q};if(delete J[f],Object.keys(J).length===1){$.delete(z);continue}$.set(z,J)}}function kQ(_){let{columnState:f}=_;if(!f)f={patches:new Map,seq:0,eventType:"toolPanelUi"},_.columnState=f;return f}function KY(_){let{aggFuncs:f}=_;if(!f)f={values:new Map,seq:0,eventType:"toolPanelUi"},_.aggFuncs=f;return f}var KR=class extends A{constructor(){super(...arguments);this.beanName="columnStateUpdateStrategy"}applyColumnState(_,f,$){this.delegate("applyColumnState",_,f,$)}commit(_){this.delegate("commit",_)}hasPendingChanges(_){return this.delegate("hasPendingChanges",_)}moveColumns(_,f,$,z){this.delegate("moveColumns",_,f,$,z)}reset(_){this.delegate("reset",_)}setColumnsVisible(_,f,$,z){this.delegate("setColumnsVisible",_,f,$,z)}isColumnVisibleInToolPanel(_,f){return this.delegate("isColumnVisibleInToolPanel",_,f)}setRowGroupColumns(_,f,$){this.delegate("setRowGroupColumns",_,f,$)}getRowGroupColumns(_){return this.delegate("getRowGroupColumns",_)}getPrimaryColumns(_){return this.delegate("getPrimaryColumns",_)}hasDeferredColumnOrder(_){return this.delegate("hasDeferredColumnOrder",_)}setValueColumns(_,f,$){this.delegate("setValueColumns",_,f,$)}getValueColumns(_){return this.delegate("getValueColumns",_)}setColumnAggFunc(_,f,$,z){this.delegate("setColumnAggFunc",_,f,$,z)}getColumnAggFunc(_,f){return this.delegate("getColumnAggFunc",_,f)}setPivotColumns(_,f,$){this.delegate("setPivotColumns",_,f,$)}getPivotColumns(_){return this.delegate("getPivotColumns",_)}setPivotMode(_,f,$){this.delegate("setPivotMode",_,f,$)}getPivotMode(_){return this.delegate("getPivotMode",_)}isColumnSelectedInPivotModeToolPanel(_,f){return this.delegate("isColumnSelectedInPivotModeToolPanel",_,f)}progressSortFromEvent(_,f,$){this.delegate("progressSortFromEvent",_,f,$)}getSortDef(_,f){return this.delegate("getSortDef",_,f)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new ER))}delegate(_,...f){let $=this.getUpdateStrategy();return $[_].bind($)(...f)}},LR={moduleName:"SharedColumnStateUpdateStrategy",version:$_,beans:[KR],dependsOn:[y_]},KZ={moduleName:"ColumnsToolPanel",version:$_,beans:[GR],userComponents:{agColumnsToolPanel:aA},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[y_,LR,R2,I$,T$,$1,j2]},FR=class extends A{constructor(){super(...arguments);this.beanName="chartMenuItemMapper"}getChartItems(_){let f=this.beans,$=f.chartSvc,z=_==="pivotChart";if(!$)return null;let Q=this.getLocaleTextFunc.bind(this),J=z?new DR(f,$,Q):new MR(f,$,Q),q=$.isEnterprise(),X=J.getMenuItem();if(X?.subMenu&&!q){let Z=(G)=>({...G,subMenu:G.subMenu?.filter((E)=>!E._enterprise).map((E)=>Z(E))});X=Z(X)}let Y=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(Y)X=this.filterAndOrderChartMenu(X,Y,J.getConfigLookup());return this.cleanInternals(X)}cleanInternals(_){if(!_)return _;let f=($)=>{delete $?._key,delete $?._enterprise;for(let z of $?.subMenu??[])f(z);return $};return f(_)}buildLookup(_){let f={},$=(z)=>{if(f[z._key]=z,z.subMenu)for(let Q of z.subMenu)$(Q)};return $(_),f}filterAndOrderChartMenu(_,f,$){let z=this.buildLookup(_),Q={..._,subMenu:[]};for(let J of Object.keys(f)){let q=f[J],X=$[J];if(X===null)continue;if(X==null){j(173,{group:J});continue}let Y=z[X._key];if(Y)if(Y.subMenu){let Z=q.map((G)=>{let E=X[G];if(E==null){j(174,{group:J,chartType:G});return}return z[E]}).filter((G)=>G!==void 0);if(Z.length>0)Y.subMenu=Z,Q.subMenu?.push(Y)}else Q.subMenu?.push(Y)}if(Q.subMenu?.length==0)return null;return Q}},DR=class{constructor(_,f,$){this.beans=_,this.chartSvc=f,this.getLocaleTextFunc=$}getMenuItem(){let _=this.getLocaleTextFunc(),f=($,z,Q,J,q=!1)=>{return{name:_($,z+"‎"),action:()=>this.chartSvc.createPivotChart({chartType:Q}),_key:J,_enterprise:q}};return{name:_("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:_("columnChart","Column"),subMenu:[f("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),f("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),f("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:_("barChart","Bar"),subMenu:[f("groupedBar","Grouped","groupedBar","pivotGroupedBar"),f("stackedBar","Stacked","stackedBar","pivotStackedBar"),f("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:_("pieChart","Pie"),subMenu:[f("pie","Pie","pie","pivotPie"),f("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:_("lineChart","Line"),subMenu:[f("lineChart","Line","line","pivotLineChart"),f("stackedLine","Stacked","stackedLine","pivotStackedLine"),f("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:_("areaChart","Area"),subMenu:[f("areaChart","Area","area","pivotArea"),f("stackedArea","Stacked","stackedArea","pivotStackedArea"),f("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:_("xyChart","X Y (Scatter)"),subMenu:[f("scatter","Scatter","scatter","pivotScatter"),f("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:_("statisticalChart","Statistical"),subMenu:[f("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:_("hierarchicalChart","Hierarchical"),subMenu:[f("treemapChart","Treemap","treemap","pivotTreemap",!0),f("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:_("funnel","Funnel"),subMenu:[f("funnel","Funnel","funnel","pivotFunnel"),f("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),f("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:_("combinationChart","Combination"),subMenu:[f("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),f("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:h("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},MR=class{constructor(_,f,$){this.beans=_,this.chartSvc=f,this.getLocaleTextFunc=$}getMenuItem(){let _=this.getLocaleTextFunc(),f=($,z,Q,J,q=!1)=>{return{name:_($,z),action:()=>this.chartSvc.createChartFromCurrentRange(Q),_key:J,_enterprise:q}};return{name:_("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:_("columnChart","Column"),subMenu:[f("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),f("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),f("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:_("barChart","Bar"),subMenu:[f("groupedBar","Grouped","groupedBar","rangeGroupedBar"),f("stackedBar","Stacked","stackedBar","rangeStackedBar"),f("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:_("pieChart","Pie"),subMenu:[f("pie","Pie","pie","rangePie"),f("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:_("lineChart","Line"),subMenu:[f("lineChart","Line","line","rangeLineChart"),f("stackedLine","Stacked","stackedLine","rangeStackedLine"),f("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:_("areaChart","Area"),subMenu:[f("areaChart","Area","area","rangeArea"),f("stackedArea","Stacked","stackedArea","rangeStackedArea"),f("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:_("xyChart","X Y (Scatter)"),subMenu:[f("scatter","Scatter","scatter","rangeScatter"),f("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:_("polarChart","Polar"),subMenu:[f("radarLine","Radar Line","radarLine","rangeRadarLine"),f("radarArea","Radar Area","radarArea","rangeRadarArea"),f("nightingale","Nightingale","nightingale","rangeNightingale"),f("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),f("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:_("statisticalChart","Statistical"),subMenu:[f("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),f("histogramChart","Histogram","histogram","rangeHistogram",!1),f("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),f("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:_("hierarchicalChart","Hierarchical"),subMenu:[f("treemap","Treemap","treemap","rangeTreemap"),f("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:_("specializedChart","Specialized"),subMenu:[f("heatmap","Heatmap","heatmap","rangeHeatmap"),f("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:_("funnel","Funnel"),subMenu:[f("funnel","Funnel","funnel","rangeFunnel"),f("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),f("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:_("combinationChart","Combination"),subMenu:[f("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),f("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:h("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},kR=class extends A{constructor(){super(...arguments);this.beanName="colChooserFactory"}createColumnSelectPanel(_,f,$,z){let Q=_.createManagedBean(new WZ),J=z??f?.getColDef().columnChooserParams??{},{contractColumnSelection:q,suppressColumnExpandAll:X,suppressColumnFilter:Y,suppressColumnSelectAll:Z,suppressSyncLayoutWithGrid:G,columnLayout:E}=J;if(Q.init(!!$,C(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!q,suppressColumnExpandAll:!!X,suppressColumnFilter:!!Y,suppressColumnSelectAll:!!Z,suppressSyncLayoutWithGrid:!!E||!!G,onStateUpdated:()=>{}}),"columnMenu"),E)Q.setColumnLayout(E);return Q}showColumnChooser({column:_,chooserParams:f,eventSource:$,headerPosition:z}){this.hideActiveColumnChooser();let Q=this.createColumnSelectPanel(this,_,!0,f),J=this.getLocaleTextFunc(),q=this.beans,{visibleCols:X,focusSvc:Y,menuUtils:Z}=q,G=X.allCols.indexOf(_),E=_?Y.focusedHeader??z??null:null;this.activeColumnChooserDialog=this.createBean(new mS({title:J("chooseColumns","Choose Columns"),component:Q,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{V_(q,Q.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,_)},closedCallback:(U)=>{let H=this.activeColumnChooser.getGui();if(this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,_),_)Z.restoreFocusOnClose({column:_,headerPosition:E,columnIndex:G,eventSource:$},H,U,!0)},postProcessPopupParams:{type:"columnChooser",column:_,eventSource:$}})),this.activeColumnChooser=Q}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(_,f){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:_,switchingTab:!1,key:"columnChooser",column:f??null})}},SR={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function AR(_,f){let $=SR[f];if($)_.assertModuleRegistered($,`menu item '${f}'`)}var z1="separator";function LZ(_,f){if(!_)return;for(let $=_.length-2;$>=0;$--){let z=_[$]===f,Q=_[$+1]===f;if(z&&Q)_.splice($+1,1)}}var RR={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:(_)=>({type:M0(_.getSortDef()?.type),direction:null})}},jR=class extends A{constructor(){super(...arguments);this.beanName="menuItemMapper"}mapWithStockItems(_,f,$,z,Q){if(!_)return[];let J=[],q=this.getLocaleTextFunc(),{beans:X,gos:Y}=this,{pinnedCols:Z,colAutosize:G,aggFuncSvc:E,rowGroupColsSvc:U,colNames:H,colModel:W,clipboardSvc:B,expansionSvc:K,focusSvc:L,csvCreator:F,excelCreator:D,menuSvc:M,colChooserFactory:k,sortSvc:R,chartMenuItemMapper:O,valueColsSvc:I,pinnedRowModel:T}=X,y=(i,x,a,t)=>{switch(AR(Y,i),i){case"pinSubMenu":return Z&&x?{name:q("pinColumn","Pin Column"),icon:h("menuPin",X,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return Z&&x?{name:q("pinLeft","Pin Left"),action:()=>Z.setColsPinned([x],"left",t),checked:!!x&&x.isPinnedLeft()}:null;case"pinRight":return Z&&x?{name:q("pinRight","Pin Right"),action:()=>Z.setColsPinned([x],"right",t),checked:!!x&&x.isPinnedRight()}:null;case"clearPinned":return Z&&x?{name:q("noPin","No Pin"),action:()=>Z.setColsPinned([x],null,t),checked:!!x&&!x.isPinned()}:null;case"pinRowSubMenu":{let u=Y.get("enableRowPinning"),__=[],r=$?.rowPinned??$?.pinnedSibling?.rowPinned;if(r)__.push("unpinRow");if(u&&u!=="bottom"&&r!="top")__.push("pinTop");if(u&&u!=="top"&&r!="bottom")__.push("pinBottom");return T?.isManual()?{name:q("pinRow","Pin Row"),icon:h("rowPin",X,x),subMenu:__}:null}case"pinTop":return T?.isManual()?{name:q("pinTop","Pin to Top"),icon:h("rowPinTop",X,x),action:({node:u,column:__})=>u&&T.pinRow(u,"top",__)}:null;case"pinBottom":return T?.isManual()?{name:q("pinBottom","Pin to Bottom"),icon:h("rowPinBottom",X,x),action:({node:u,column:__})=>u&&T.pinRow(u,"bottom",__)}:null;case"unpinRow":return T?.isManual()?{name:q("unpinRow","Unpin Row"),icon:h("rowUnpin",X,x),action:({node:u,column:__})=>u&&T.pinRow(u,null,__)}:null;case"valueAggSubMenu":if(E&&I&&(x?.isPrimary()||x?.getColDef().pivotValueColumn))return{name:q("valueAggregation","Value Aggregation"),icon:h("menuValue",X,null),subMenu:VR(x,E,I,q),disabled:Y.get("functionsReadOnly")};else return null;case"autoSizeThis":return G?{name:q("autosizeThisColumn","Autosize This Column"),action:()=>x&&G.autoSizeColumn(x,t,Y.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return G?{name:q("autosizeAllColumns","Autosize All Columns"),action:()=>G.autoSizeAllColumns({source:t,skipHeader:Y.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return U?{name:u$(q,"groupBy",H.getDisplayNameForColumn(x,"header")),disabled:Y.get("functionsReadOnly")||x?.isRowGroupActive()||!x?.getColDef().enableRowGroup,action:()=>U.addColumns([x],t),icon:h("menuAddRowGroup",X,null)}:null;case"rowUnGroup":if(U&&Y.isModuleRegistered("SharedRowGrouping")){let u=x?.getColDef().showRowGroup,__=Y.get("groupLockGroupColumns"),r,O_,P_;if(u===!0)r=q("ungroupAll","Un-Group All"),O_=Y.get("functionsReadOnly")||__===-1||__>=(U.columns.length??0),P_=()=>U.setColumns(U.columns.slice(0,__),t);else if(typeof u==="string"){let M_=W.getColDefCol(u),Tf=M_!=null?H.getDisplayNameForColumn(M_,"header"):u;r=u$(q,"ungroupBy",Tf),O_=Y.get("functionsReadOnly")||m$(M_,X),P_=()=>{U.removeColumns([u],t)}}else r=u$(q,"ungroupBy",H.getDisplayNameForColumn(x,"header")),O_=Y.get("functionsReadOnly")||!x?.isRowGroupActive()||!x?.getColDef().enableRowGroup||m$(x,X),P_=()=>U.removeColumns([x],t);return{name:r,disabled:O_,action:P_,icon:h("menuRemoveRowGroup",X,null)}}else return null;case"resetColumns":return{name:q("resetColumns","Reset Columns"),action:()=>nX(X,t)};case"expandAll":return K?{name:q("expandAll","Expand All Row Groups"),action:()=>K.expandAll(!0)}:null;case"contractAll":return K?{name:q("collapseAll","Collapse All Row Groups"),action:()=>K.expandAll(!1)}:null;case"copy":return B?{name:q("copy","Copy"),shortcut:q("ctrlC","Ctrl+C"),icon:h("clipboardCopy",X,null),action:()=>B.copyToClipboard()}:null;case"copyWithHeaders":return B?{name:q("copyWithHeaders","Copy with Headers"),icon:h("clipboardCopy",X,null),action:()=>B.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return B?{name:q("copyWithGroupHeaders","Copy with Group Headers"),icon:h("clipboardCopy",X,null),action:()=>B.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(B){let u=L.getFocusedCell(),__=u?D_(X,u):null,r=__?u?.column.isCellEditable(__):!1;return{name:q("cut","Cut"),shortcut:q("ctrlX","Ctrl+X"),icon:h("clipboardCut",X,null),disabled:!r||Y.get("suppressCutToClipboard"),action:()=>B.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(B){let u=Y.get("suppressClipboardApi")||Y.get("suppressClipboardPaste")||!x||!$||!x.isCellEditable($)||x.isSuppressPaste($);return{name:q("paste","Paste"),shortcut:q("ctrlV","Ctrl+V"),icon:h("clipboardPaste",X,null),disabled:u,action:()=>B.pasteFromClipboard()}}else return null;case"export":{let u=[];if(!Y.get("suppressCsvExport")&&F)u.push("csvExport");if(!Y.get("suppressExcelExport")&&D)u.push("excelExport");return u.length?{name:q("export","Export"),subMenu:u,icon:h("save",X,null)}:null}case"csvExport":return F?{name:q("csvExport","CSV Export"),icon:h("csvExport",X,null),action:()=>F.exportDataAsCsv()}:null;case"excelExport":return D?{name:q("excelExport","Excel Export"),icon:h("excelExport",X,null),action:()=>D.exportDataAsExcel()}:null;case"separator":return i;case"pivotChart":case"chartRange":return O.getChartItems(i);case"columnFilter":return M&&x?{name:q("columnFilter","Column Filter"),icon:h("filter",X,null),action:()=>M.showFilterMenu({column:x,buttonElement:a(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{let u=L.focusedHeader;return k?{name:q("columnChooser","Choose Columns"),icon:h("columns",X,null),action:()=>k.showColumnChooser({column:x,eventSource:a(),headerPosition:u})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!R||!x)return null;let{fallback:u,getSortDef:__}=RR[i];return{name:q(i,u),icon:h(i,X,null),action:()=>R.setSortForColumn(x,__(x),!1,t)}}default:return j(176,{key:i}),null}};for(let i of _){let x;if(typeof i==="string")x=y(i,f,z,Q);else x={...i};if(!x)continue;let a=x,{subMenu:t}=a;if(t&&t instanceof Array)a.subMenu=this.mapWithStockItems(t,f,$,z,Q);if(x!=null)J.push(x)}return LZ(J,z1),J}};function VR(_,f,$,z){let Q;if(_.isPrimary())Q=_;else{let q=_.getColDef().pivotValueColumn;Q=v(q)?q:void 0}let J=[];if(Q){let q=Q.isValueActive(),X=f.getFuncNames(Q);J.push({name:z("noAggregation","None"),action:()=>{$.removeColumns([Q],"contextMenu"),$.setColumnAggFunc(Q,void 0,"contextMenu")},checked:!q});for(let Y of X)J.push({name:z(Y,f.getDefaultFuncLabel(Y)),action:()=>{$.setColumnAggFunc(Q,Y,"contextMenu"),$.addColumns([Q],"contextMenu")},checked:q&&Q.getAggFunc()===Y})}return J}var OR=class extends A{constructor(){super(...arguments);this.beanName="colMenuFactory"}createMenu(_,f,$,z){let Q=_.createManagedBean(new EZ(0,{column:$??null,node:null,value:null})),J=this.beans.menuItemMapper.mapWithStockItems(f,$??null,null,z,"columnMenu");return Q.addMenuItems(J),Q}getMenuItems(_=null,f=null){let $=this.getDefaultMenuOptions(_),z,Q=(_?.getColDef()??f?.getColGroupDef())?.mainMenuItems;if(Array.isArray(Q))z=Q;else if(typeof Q==="function")z=Q(C(this.gos,{column:_,columnGroup:f,defaultItems:$}));else{let J=this.gos.getCallback("getMainMenuItems");if(J)z=J({column:_,columnGroup:f,defaultItems:$});else z=$}return LZ(z,z1),z}getDefaultMenuOptions(_){let f=[],{beans:$,gos:z}=this,{colChooserFactory:Q,rowGroupColsSvc:J,colModel:q,expansionSvc:X,sortSvc:Y,menuSvc:Z,pinnedCols:G,aggFuncSvc:E,colAutosize:U}=$,H=E_(z),W=()=>{if(!H&&Q)f.push("columnChooser");f.push("resetColumns")};if(!_)return W(),f;let{colDef:B}=_,K=G&&!B.lockPinned,L=J?.columns.length??0,F=L>0,D=Lf(z),M=z.get("treeData"),k=_.isPrimary(),R=!k||E&&_.isAllowValue()&&(F||D||M);if(Y&&!H&&_.isSortable()){let{isDefaultSortAllowed:O,isAbsoluteSortAllowed:I,isAbsoluteSort:T,isDefaultSort:y,isAscending:i,isDescending:x,direction:a}=ZJ(_,$);if(O&&!(i&&y))f.push("sortAscending");if(O&&!(x&&y))f.push("sortDescending");if(I&&!(i&&T))f.push("sortAbsoluteAscending");if(I&&!(x&&T))f.push("sortAbsoluteDescending");if(a)f.push("sortUnSort");f.push(z1)}if(Z?.isFilterMenuItemEnabled(_))f.push("columnFilter"),f.push(z1);if(K)f.push("pinSubMenu");if(R)f.push("valueAggSubMenu");if(K||R)f.push(z1);if(U){if(!B.suppressAutoSize)f.push("autoSizeThis");f.push("autoSizeAll"),f.push(z1)}if(J&&z.isModuleRegistered("SharedRowGrouping")){let O=f.length;if(B.showRowGroup)f.push("rowUnGroup");else if(_.isAllowRowGroup()&&k)if(_.isRowGroupActive()){if(!m$(_,$))f.push("rowUnGroup")}else f.push("rowGroup");if(f.length>O)f.push(z1)}if(W(),X&&(o(z)||z.get("ssrmExpandAllAffectsAllRows"))&&(M||L>(q.isPivotMode()?1:0)))f.push("expandAll"),f.push("contractAll");return f}};var jf="filterMenuTab",Vf="generalMenuTab",Q1="columnsMenuTab",SQ=[Vf,jf,Q1],PR=class extends A{constructor(){super(...arguments);this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(_,f,$,z,Q){let{column:J,columnGroup:q}=this.splitColumnOrGroup(_),X=Q?"filterMenuTab":void 0;this.showMenu(J,q,(Y)=>{let Z=Y.getGui();if(this.beans.popupSvc.positionPopupUnderMouseEvent({type:$,additionalParams:{column:J},mouseEvent:f,ePopup:Z}),X)Y.showTab?.(X);this.dispatchVisibleChangedEvent(!0,!1,J,q,X)},$,X,void 0,f.target,z)}splitColumnOrGroup(_){let f=_&&Q0(_);return{column:f?_:void 0,columnGroup:f?void 0:_}}showMenuAfterButtonClick(_,f,$,z,Q){let J=-1,q="left";if(this.gos.get("enableRtl"))J=1,q="right";let X=Q?"filterMenuTab":void 0,Y=X?[X]:void 0,Z=E_(this.gos),G=(Z?9:4)*J,E=Z?-23:4,{column:U,columnGroup:H}=this.splitColumnOrGroup(_);this.showMenu(U,H,(W)=>{let B=W.getGui();if(this.beans.popupSvc.positionPopupByComponent({type:$,additionalParams:{column:U},eventSource:f,ePopup:B,alignSide:q,nudgeX:G,nudgeY:E,position:"under",keepWithinBounds:!0}),X)W.showTab?.(X);this.dispatchVisibleChangedEvent(!0,!1,U,H,X)},$,X,Y,f,z)}showMenu(_,f,$,z,Q,J,q,X){let Y=this.getMenuParams(_,f,J,q);if(!Y)return;let{menu:Z,eMenuGui:G,anchorToElement:E,restoreFocusParams:U}=Y,H=[],{menuUtils:W,popupSvc:B}=this.beans;H.push((L)=>{let F=Z.getGui();if(this.destroyBean(Z),_)B$(_,!1,"contextMenu"),W.restoreFocusOnClose(U,F,L);X?.()});let K=this.getLocaleTextFunc();if(B.addPopup({modal:!0,eChild:G,closeOnEsc:!0,closedCallback:(L)=>{for(let F of H)F(L);this.dispatchVisibleChangedEvent(!1,!1,_,f,Q)},afterGuiAttached:(L)=>Z.afterGuiAttached(Object.assign({},{container:z},L)),positionCallback:Q?()=>$(Z):void 0,ariaLabel:K("ariaLabelColumnMenu","Column Menu")}),!Q)Z.showTabBasedOnPreviousSelection?.(),$(Z);if(qJ(this.gos)){let L=B.setPopupPositionRelatedToElement(G,E);if(L&&_)this.addStopAnchoring(L,_,H)}if(Z.addEventListener("tabSelected",(L)=>{this.dispatchVisibleChangedEvent(!1,!0,_),this.lastSelectedTab=L.key,this.dispatchVisibleChangedEvent(!0,!0,_)}),_)B$(_,!0,"contextMenu");this.activeMenu=Z,Z.addEventListener("destroyed",()=>{if(this.activeMenu===Z)this.activeMenu=null})}addStopAnchoring(_,f,$){_.then((z)=>{f.__addEventListener("leftChanged",z),f.__addEventListener("visibleChanged",z),$.push(()=>{f.__removeEventListener("leftChanged",z),f.__removeEventListener("visibleChanged",z)})})}getMenuParams(_,f,$,z){let{focusSvc:Q,visibleCols:J,ctrlsSvc:q}=this.beans,X={column:_,headerPosition:Q.focusedHeader,columnIndex:J.allCols.indexOf(_),eventSource:z},Y=this.createMenu(_,f,X,$,z);return Y?{menu:Y,eMenuGui:Y.getGui(),anchorToElement:z||q.getGridBodyCtrl().eGridBody,restoreFocusParams:X}:void 0}createMenu(_,f,$,z,Q){if(E_(this.gos))return this.createBean(new vR(_,$,this.lastSelectedTab,z,Q));else{let J=this.beans.colMenuFactory.getMenuItems(_,f);return J.length?this.createBean(new TR(J,_,$,Q)):void 0}}dispatchVisibleChangedEvent(_,f,$,z,Q){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:_,switchingTab:f,key:this.lastSelectedTab??Q??(E_(this.gos)?Vf:"columnMenu"),column:$??null,columnGroup:z??null})}isMenuEnabled(_){if(!E_(this.gos))return!0;let f=!this.beans.filterManager?.isFilterAllowed(_),$=_.getColDef().menuTabs??SQ;return(f&&$.includes(jf)?$.length-1:$.length)>0}showMenuAfterContextMenuEvent(_,f,$){this.beans.menuUtils.onContextMenu({mouseEvent:f,touchEvent:$,source:"ui",showMenuCallback:(z)=>{return this.showMenuAfterMouseEvent(_,z,"columnMenu"),!0}})}},vR=class extends A{constructor(_,f,$,z,Q){super();this.column=_,this.restoreFocusParams=f,this.initialSelection=$,this.restrictTo=z,this.sourceElement=Q,this.tabFactories={},this.includeChecks={};let{tabFactories:J,includeChecks:q}=this;J[Vf]=this.createMainPanel.bind(this),J[jf]=this.createFilterPanel.bind(this),J[Q1]=this.createColumnsPanel.bind(this),q[Vf]=()=>!0,q[jf]=()=>_?!!this.beans.filterManager?.isFilterAllowed(_):!1,q[Q1]=()=>!0}postConstruct(){let _=this.getTabsToCreate().map(($)=>this.createTab($)),f=new wS({items:_,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(f),this.mainMenuList?.setParentComponent(f),this.addDestroyFunc(()=>this.destroyBean(f))}getTabsToCreate(){if(this.restrictTo)return this.restrictTo;return(this.column?.getColDef().menuTabs??SQ).filter((_)=>this.isValidMenuTabItem(_)&&this.isNotSuppressed(_))}isValidMenuTabItem(_){let f=!0,$=SQ;if(this.restrictTo!=null)f=this.restrictTo.indexOf(_)>-1,$=this.restrictTo;if(f=f&&SQ.indexOf(_)>-1,!f)j(175,{menuTabName:_,itemsToConsider:$});return f}isNotSuppressed(_){return this.includeChecks[_]()}createTab(_){return this.tabFactories[_]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(_){let{tabItemColumns:f,tabbedLayout:$,tabItemFilter:z,tabItemGeneral:Q}=this;if(f&&_===Q1)$.showItem(f);else if(z&&_===jf)$.showItem(z);else if(Q&&_===Vf)$.showItem(Q);else $.showFirstItem()}onTabItemClicked(_){let f=null;switch(_.item){case this.tabItemColumns:f=Q1;break;case this.tabItemFilter:f=jf;break;case this.tabItemGeneral:f=Vf;break}if(f)this.activateTab(f)}activateTab(_){let f={type:"tabSelected",key:_};this.dispatchLocalEvent(f)}createMainPanel(){let{beans:_,column:f}=this,$=_.colMenuFactory,z=$.createMenu(this,$.getMenuItems(f),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=z,z.addEventListener("closeMenu",this.onHidePopup.bind(this));let Q={title:h("legacyMenu",_,f),titleLabel:Vf.replace("MenuTab",""),bodyPromise:g.resolve(z.getGui()),name:Vf};return this.tabItemGeneral=Q,Q}onHidePopup(_){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,_)}createFilterPanel(){let _=this.column?this.createBean(new $2(this.column,"COLUMN_MENU")):null;if(this.filterComp=_,!_?.hasFilter())e(119);let f=(z)=>_?.afterGuiAttached(z),$=()=>_?.afterGuiDetached();return this.tabItemFilter={title:h("filterTab",this.beans,this.column),titleLabel:jf.replace("MenuTab",""),bodyPromise:g.resolve(_?.getGui()),afterAttachedCallback:f,afterDetachedCallback:$,name:jf},this.tabItemFilter}createColumnsPanel(){let _=z_({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:f,column:$}=this,Q=f.colChooserFactory.createColumnSelectPanel(this,$).getGui();Q.classList.add("ag-menu-column-select"),_.appendChild(Q);let J={title:h("columns",f,$),titleLabel:Q1.replace("MenuTab",""),bodyPromise:g.resolve(_),name:Q1};return this.tabItemColumns=J,J}afterGuiAttached(_){let{container:f,hidePopup:$}=_;if(this.tabbedLayout.setAfterAttachedParams({container:f,hidePopup:$}),$)this.hidePopupFunc=$,this.addDestroyFunc($)}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},TR=class extends w{constructor(_,f,$,z){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"});this.menuItems=_,this.column=f,this.restoreFocusParams=$,this.sourceElement=z,this.eColumnMenu=V}postConstruct(){let _=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=_,_.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(_.getGui())}onHidePopup(_){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,_)}afterGuiAttached({hidePopup:_}){if(_)this.hidePopupFunc=_,this.addDestroyFunc(_);F_(this.mainMenuList.getGui())}};function IR(_,f){_.colChooserFactory?.showColumnChooser({chooserParams:f})}function yR(_){_.colChooserFactory?.hideActiveColumnChooser()}var bR=class extends A{constructor(){super(...arguments);this.beanName="menuUtils"}restoreFocusOnClose(_,f,$,z){let{eventSource:Q}=_,J=$ instanceof KeyboardEvent;if(!z&&!J||!Q)return;let q=d(this.beans);if(!f.contains(q)&&!sf(this.beans))return;this.focusHeaderCell(_)}closePopupAndRestoreFocusOnSelect(_,f,$){let z;if($?.keyboardEvent)z=$.keyboardEvent;_(z&&{keyboardEvent:z});let Q=this.beans,J=Q.focusSvc,q=J.getFocusedCell();if(sf(Q))if(q){let{rowIndex:X,rowPinned:Y,column:Z}=q;J.setFocusedCell({rowIndex:X,column:Z,rowPinned:Y,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(f)}onContextMenu(_){let{mouseEvent:f,touchEvent:$,showMenuCallback:z,source:Q}=_;if(!this.gos.get("allowContextMenuWithControlKey")){if(f&&(f.ctrlKey||f.metaKey))return}if(f)this.blockMiddleClickScrollsIfNeeded(f);if(Q==="ui"&&this.gos.get("suppressContextMenu"))return;let J=f??$.touches[0];if(z(J)){let q=f??$;if(q?.cancelable)q.preventDefault()}}async focusHeaderCell(_){let{column:f,columnIndex:$,headerPosition:z,eventSource:Q}=_,{visibleCols:J,headerNavigation:q,focusSvc:X}=this.beans,Y=await J.allCols.some((Z)=>Z===f);if(!this.isAlive())return;if(f?.isAlive()&&Y&&Q&&A_(Q)){let Z=oz(Q);if(Z)q?.scrollToColumn(f),Z.focus()}else if(z&&$!==-1){let Z=J.allCols,G=Z[$]||b(Z);if(G)X.focusHeaderPosition({headerPosition:{headerRowIndex:z.headerRowIndex,column:G}})}}blockMiddleClickScrollsIfNeeded(_){if(this.gos.get("suppressMiddleClickScrolls")&&_.which===2)_.preventDefault()}},CR={moduleName:"MenuCore",version:$_,beans:[jR,FR,bR],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[y_,$1,sJ,j2]},FZ={moduleName:"ColumnMenu",version:$_,beans:[PR,OR,kR],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:IR,hideColumnChooser:yR},dependsOn:[CR,T$,I$]};var wR=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function xR(_,f,$){return _.getCompDetails(f,NR,void 0,$,!0)}var NR={name:"statusPanel",optionalMethods:["refresh"]},gR={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},hR={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},uR=class extends w{constructor(){super(hR);this.updateQueued=!1,this.panelsPromise=g.resolve(),this.eStatusBarLeft=V,this.eStatusBarCenter=V,this.eStatusBarRight=V,this.compDestroyFunctions={},this.registerCSS(wR)}wireBeans(_){this.userCompFactory=_.userCompFactory,this.statusBarSvc=_.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),Mf(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){let _=this.gos,f=_.get("statusBar")?.statusPanels;if(!f)return f;return f.filter(($)=>{let{rowModels:z,warnArgs:Q}=gR[$.statusPanel]??{};if(!z)return!0;if(z.includes(_.get("rowModelType")))return!0;return j(...Q),!1})}processStatusPanels(_){let f=this.getValidPanels();if(f){let $=f.filter((J)=>J.align==="left"),z=f.filter((J)=>J.align==="center"),Q=f.filter((J)=>!J.align||J.align==="right");this.panelsPromise=g.all([this.createAndRenderComponents($,this.eStatusBarLeft,_),this.createAndRenderComponents(z,this.eStatusBarCenter,_),this.createAndRenderComponents(Q,this.eStatusBarRight,_)])}else this.setDisplayed(!1)}handleStatusBarChanged(){if(this.updateQueued)return;this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1})}updateStatusBar(){let _=this.getValidPanels(),f=Array.isArray(_)&&_.length>0;this.setDisplayed(f);let $=new Map;if(f)for(let z of _){let Q=z.key??z.statusPanel,J=this.statusBarSvc.getStatusPanel(Q);if(J?.refresh){let q=C(this.gos,{...z.statusPanelParams??{},key:Q});if(J.refresh(q))$.set(Q,J),delete this.compDestroyFunctions[Q],T_(J.getGui())}}if(this.resetStatusBar(),f)this.processStatusPanels($)}resetStatusBar(){f_(this.eStatusBarLeft),f_(this.eStatusBarCenter),f_(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(let _ of Object.values(this.compDestroyFunctions))_();this.compDestroyFunctions={}}createAndRenderComponents(_,f,$){let z=[];for(let Q of _){let J=Q.key||Q.statusPanel,q=$.get(J),X;if(q)X=g.resolve(q);else{let Y=xR(this.userCompFactory,Q,C(this.gos,{key:J}));if(Y==null)continue;X=Y.newAgStackInstance()}z.push({key:J,promise:X})}return g.all(z.map((Q)=>Q.promise)).then(()=>{for(let Q of z)Q.promise.then((J)=>{let q=()=>{this.destroyBean(J)};if(this.isAlive())this.statusBarSvc.registerStatusPanel(Q.key,J),f.appendChild(J.getGui()),this.compDestroyFunctions[Q.key]=q;else q()})})}},iR={selector:"AG-STATUS-BAR",component:uR},mR={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},": ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},cR=BigInt(Number.MIN_SAFE_INTEGER),pR=BigInt(Number.MAX_SAFE_INTEGER),n$=class extends w{constructor(){super(mR);this.eLabel=V,this.eValue=V}setLabel(_,f){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(_,f)}setValue(_,f){let $=null,z;if(typeof _==="bigint"){if(z=_,_>=cR&&_<=pR)$=Number(_)}else $=_;this.eValue.textContent=this.valueFormatter(C(this.gos,{value:$,bigintValue:z,totalRows:f,key:this.key}))}},nR={selector:"AG-NAME-VALUE",component:n$},DZ=(_)=>{let f=0;return _.forEachNodeAfterFilter(($)=>{if($.data)f++}),f},d$=(_)=>{let f=0;return _.forEachNode(($)=>{if($.data)f++}),f};function dR(_,f){if(typeof _!=="number")return"";return A0(Math.round(_*100)/100,f)}var tR={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},rR=class extends w{constructor(){super(tR,[nR]);this.sumAggregationComp=V,this.countAggregationComp=V,this.minAggregationComp=V,this.maxAggregationComp=V,this.avgAggregationComp=V}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(_){this.refresh(_)}refresh(_){this.params=_;let f=_.valueFormatter??((z)=>{let{value:Q,bigintValue:J}=z;if(J!=null)return J.toString();return dR(Q,this.getLocaleTextFunc.bind(this))}),$=["avg","count","min","max","sum"];for(let z of $){let Q=this.getAllowedAggregationValueComponent(z);if(Q)Q.key=z,Q.valueFormatter=f.bind(this)}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(_,f,$){let z=this.getAllowedAggregationValueComponent(_),Q=d$(this.beans.rowModel);if(v(z)&&z)z.setValue(f,Q),z.setDisplayed($);else this.getAggregationValueComponent(_)?.setDisplayed(!1)}getAllowedAggregationValueComponent(_){let{aggFuncs:f}=this.params;if(!f||f.includes(_))return this.getAggregationValueComponent(_);return null}getAggregationValueComponent(_){let f=`${_}AggregationComp`;return this[f]}onCellSelectionChanged(){let _=this.beans,{rangeSvc:f,valueSvc:$}=_,z=f?.getCellRanges(),Q=0,J=0n,q=!1,X=!1,Y=0,Z=0,G=null,E=null,U=null,H=null,W=(T)=>{if(typeof T==="number"){if(Q+=T,G===null||TE)E=T;if(!Number.isInteger(T)||!Number.isSafeInteger(T))X=!0;else{let y=BigInt(T);if(J+=y,U===null||yH)H=y}}else{if(q=!0,J+=T,U===null||TH)H=T;let y=Number(T);if(Q+=y,G===null||yE)E=y}Z++},B={};if(z?.length&&f)for(let T=0;T{if(i===null)return;let u=g0({rowPinned:i.rowPinned,column:t,rowIndex:i.rowIndex});if(B[u])return;B[u]=!0;let __=D_(_,i);if(n(__))return;let r=$.getValue(t,__,"data");if(n(r)||r==="")return;if(Y++,typeof r==="object"&&"value"in r){if(r=r.value,r==="")return}if(typeof r==="string"){let O_=r.trim();if(O_==="")return;let P_=Number(O_);if(!Number.isFinite(P_))return;if(Q+P_>=Number.MAX_SAFE_INTEGER||Q+P_<=Number.MIN_SAFE_INTEGER||P_>=Number.MAX_SAFE_INTEGER||P_<=Number.MIN_SAFE_INTEGER){if(r=Bf(O_),r===null)r=P_}else r=P_}if(typeof r==="number"&&!isNaN(r)||typeof r==="bigint")W(r)}),i=K_(_,i)}}let K=Y>1,L=Z>1,F=q&&!X,D;if(F)D=J/BigInt(Z);else D=Q/Z;let M=L?F?J:Q:null,k=L?F?U:G:null,R=L?F?H:E:null,O=L?D:null,I=L;this.setAggregationComponentValue("count",Y,K),this.setAggregationComponentValue("sum",M,L),this.setAggregationComponentValue("min",k,L),this.setAggregationComponentValue("max",R,L),this.setAggregationComponentValue("avg",O,I)}},lR=class extends n${postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);let _=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:_})}onDataChanged(){let{rowModel:_}=this.beans,f=d$(_),$=DZ(_);this.setValue($,f),this.setDisplayed(f!==$)}init(_){this.refresh(_),this.onDataChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f})=>A0(f,this.getLocaleTextFunc.bind(this)))}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}},sR=class extends n${postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");let _=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:_,selectionChanged:_})}onRowSelectionChanged(){let{selectionSvc:_,rowModel:f}=this.beans,$=_?.getSelectionCount()??0,z=d$(f);if(this.setValue($,z),$<0){this.setDisplayed(!0);return}this.setDisplayed($>0)}init(_){this.refresh(_),this.onRowSelectionChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f})=>{if(f==null||f>=0)return A0(f,this.getLocaleTextFunc.bind(this));return this.getLocaleTextFunc()("statusBarLastRowUnknown","?")})}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}},aR=class extends n${postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let{rowModel:_}=this.beans,f=DZ(_),$=d$(_);this.setValue(f,$)}init(_){this.refresh(_),this.onDataChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f,totalRows:$})=>{let z=this.getLocaleTextFunc.bind(this),Q=A0(f,z),J=A0($??f,z);if(f===$)return Q;let q=z();return`${Q} ${q("of","of")} ${J}`})}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}},oR=class extends n${postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let _=d$(this.beans.rowModel);this.setValue(_,_)}init(_){this.refresh(_),this.onDataChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f})=>A0(f,this.getLocaleTextFunc.bind(this)))}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}};function eR(_,f){let $=_.statusBarSvc?.getStatusPanel(f);return d0($)}var _j=class extends A{constructor(){super();this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(_,f){this.comps.set(_,f)}unregisterStatusPanel(_){this.comps.delete(_)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(_){return this.comps.get(_)}destroy(){this.unregisterAllComponents(),super.destroy()}},MZ={moduleName:"StatusBar",version:$_,beans:[_j],userComponents:{agAggregationComponent:rR,agTotalRowCountComponent:oR,agFilteredRowCountComponent:lR,agTotalAndFilteredRowCountComponent:aR,agSelectedRowCountComponent:sR},selectors:[iR],apiFunctions:{getStatusPanel:eR},dependsOn:[y_,f1]};function kZ(_){if(_.excelCreator?.getFactoryMode()==="MULTI_SHEET")return j(161),!1;return!0}function fj(_,f){if(kZ(_))return _.excelCreator?.getDataAsExcel(f);return}function $j(_,f){if(kZ(_))_.excelCreator?.exportDataAsExcel(f)}function zj(_,f){return _.excelCreator?.setFactoryMode("MULTI_SHEET"),_.excelCreator?.getSheetDataForExcel(f)}function Qj(_,f){return _.excelCreator?.getMultipleSheetsAsExcel(f)}function Jj(_,f){_.excelCreator?.exportMultipleSheetsAsExcel(f)}var SZ={moduleName:"ExcelExport",version:$_,beans:[SS],apiFunctions:{getDataAsExcel:fj,exportDataAsExcel:$j,getSheetDataForExcel:zj,getMultipleSheetsAsExcel:Qj,exportMultipleSheetsAsExcel:Jj},dependsOn:[dJ,y_]};function CQ(_){let{filters:f}=_;return f&&f.length>0?f:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function vQ(_,f){if(_==null)return;for(let $=_.length-1;$>=0;$--)f(_[$],$)}function qj(_,f){if(f.title!=null)return f.title;return _ instanceof ez?_.getFilterTitle():"Filter"}function TQ(_,f,$,z){let Q=[],J=_?.filterModels;for(let q=0;qq==null)?null:{filterType:"multi",filterModels:Q}}function s0(_,f){return _?.filterModels?.[f]??null}function IQ(_,f,$,z){let Q=$.filterValueGetter;return Q?_.colFilter.createGetValue(f,Q):z}var AZ=class extends IJ{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"});this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:(_)=>this.onFocusIn(_)})}refreshGui(_){if(_===this.lastOpenedInContainer)return g.resolve();return this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),g.all(this.getFilterWrappers().map((f,$)=>{if(!f)return g.resolve(null);let z=this.getFilterFromWrapper(f),Q=this.getCompFromWrapper(f),J=this.filterDefs[$],q=qj(z,J),X;if(J.display==="subMenu"&&_!=="toolPanel")X=this.insertFilterMenu(Q,z,q).then((Y)=>Y.getGui());else if(J.display==="subMenu"||J.display==="accordion"){let Y=this.insertFilterGroup(z,Q,q);X=g.resolve(Y.getGui())}else X=g.resolve(Q.getGui());return X})).then((f)=>{f.forEach(($,z)=>{if(!$)return;if(z>0)this.appendChild(z_({tag:"div",cls:"ag-filter-separator"}));this.appendChild($)}),this.filterGuis=f,this.lastOpenedInContainer=_})}destroyChildren(){for(let _ of this.guiDestroyFuncs)_();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(_,f,$){let z=_.getGui();Z_(z,"dialog");let Q=this.createBean(new NA),J={getGui:()=>_.getGui(),afterGuiAttached:(q)=>{if(_.afterGuiAttached?.(q),_!==f)f.afterGuiAttached?.(q)}};return Q.init({menuItemDef:{name:$,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:_Z,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:J,contextParams:{column:null,node:null,value:null}}).then(()=>{Q.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(Q)),this.addManagedListeners(Q,{menuItemActivated:(X)=>{if(this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==X.menuItem)this.lastActivatedMenuItem.deactivate();this.lastActivatedMenuItem=X.menuItem}});let q=Q.getGui();return Q.addManagedElementListeners(q,{keydown:(X)=>{let{key:Y}=X;switch(Y){case S.UP:case S.RIGHT:case S.DOWN:case S.LEFT:if(X.preventDefault(),Y===S.RIGHT)Q.openSubMenu(!0);break}},focusin:()=>Q.activate(),focusout:()=>{if(!Q.isSubMenuOpen()&&!Q.isSubMenuOpening())Q.deactivate()}}),Q})}insertFilterGroup(_,f,$){let z=this.createBean(new gS({title:$,cssIdentifier:"multi-filter"}));if(this.guiDestroyFuncs.push(()=>this.destroyBean(z)),z.addItem(f.getGui()),z.toggleGroupExpand(!1),_.afterGuiAttached)z.addManagedListeners(z,{expanded:()=>_.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})});return z}afterGuiAttached(_){let f;if(_)this.hidePopup=_.hidePopup,f=this.refreshGui(_.container);else this.hidePopup=void 0,f=g.resolve();let $=_?.suppressFocus;f.then(()=>{let{filterDefs:z,filterGuis:Q,beans:J}=this,q=this.getFilterWrappers(),X=!!$;if(z)vQ(z,(Z,G)=>{let E=G===0,U=Z.display&&Z.display!=="inline",H=$||!E||U,W={..._??{},suppressFocus:H},B=q[G],K=B?this.getFilterFromWrapper(B):void 0;if(B){let L=this.getCompFromWrapper(B);if(L!==K)L.afterGuiAttached(W)}if(K){if(this.executeFunctionIfExistsOnFilter(K,"afterGuiAttached",W),E&&!H)X=!0}if(!$&&E&&U){let L=Q[G];if(L){if(!F_(L))L.focus({preventScroll:!0});X=!0}}});let Y=d(J);if(!X&&(sf(J)||this.getGui().contains(Y)))this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",(_)=>this.executeOnWrapper(_,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",(_)=>this.executeOnWrapper(_,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(_,f){}executeFunctionIfExists(_,f){vQ(this.getFilterWrappers(),($)=>{if($)f?.($),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper($),_)})}executeFunctionIfExistsOnFilter(_,f,...$){let z=_[f];if(typeof z==="function")z.apply(_,$)}onFocusIn(_){let f=this.lastActivatedMenuItem;if(f!=null&&!f.getGui().contains(_.target))f.deactivate(),this.lastActivatedMenuItem=null}},RZ=class extends AZ{constructor(){super(...arguments);this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(_){this.params=_,this.filterDefs=CQ(_);let f=L_(this.beans.colFilter.model,_.column.getColId()),{filterChangedCallback:$}=_;this.filterChangedCallback=$;let z=this.filterDefs.map((Q,J)=>this.createFilter(Q,J,f));return new g((Q)=>{g.all(z).then((J)=>{this.wrappers=J,this.refreshGui("columnMenu").then(()=>{Q()})})}).then(()=>{for(let Q of this.afterFiltersReadyFuncs)Q();this.afterFiltersReadyFuncs.length=0})}refresh(_){return this.params=_,!0}isFilterActive(){return this.wrappers.some((_)=>{if(!_)return!1;let{filter:f,handler:$,model:z}=_;if($)return z!=null;return f.isFilterActive()})}getLastActiveFilterIndex(){let _=this.activeFilterIndices;return _.length>0?_[_.length-1]:null}doesFilterPass(_,f){return this.wrappers.every(($,z)=>{if(!$||f!=null&&z===f)return!0;let{handler:Q,filter:J,model:q}=$;if(Q)return q==null||Q.doesFilterPass({..._,model:q,handlerParams:$.handlerParams});return!J.isFilterActive()||J.doesFilterPass(_)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map((f)=>{if(!f)return null;let $=f.filter;if(typeof $.getModelFromUi==="function")return $.getModelFromUi();return null})}}getModel(){if(!this.isFilterActive())return null;return{filterType:this.filterType,filterModels:this.wrappers.map((f)=>{if(!f)return null;let{filter:$,handler:z,model:Q}=f;if(z)return Q;return $.isFilterActive()?$.getModel():null})}}setModel(_){let f=(z,Q)=>{return new g((J)=>{let q=z.setModel(Q);if(q)q.then(J);else J()})},$=[];return this.wrappers.forEach((z,Q)=>{if(!z)return;let J=s0(_,Q),{filter:q,filterParams:X,handler:Y,handlerParams:Z,state:G}=z;if(Y){let E={model:J,state:G?.state};z.state=E,z.model=J,$.push(UQ(()=>g.resolve({filter:q,filterParams:X}),Y,Z,J,E,"api").then(()=>{this.updateActiveListForHandler(Q,z.model)}))}else $.push(f(q,J).then(()=>{this.updateActiveListForFilter(Q,q)}))}),g.all($).then(()=>{})}applyModel(_="api"){let f=!1;for(let $ of this.wrappers)if($){let z=$.filter;if(z instanceof ez)f=z.applyModel(_)||f}return f}getChildFilterInstance(_){return this.wrappers[_]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(let _ of this.wrappers)this.destroyBean(_?.filter),this.destroyBean(_?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(_){return _.filter}getCompFromWrapper(_){return _.comp}executeOnWrapper(_,f){_.handler?.[f]?.()}createFilter(_,f,$){let z=this.params.column,Q=null,J,q=this.beans,X=(H,W)=>{let B=this.wrappers[f];if(!B)return;let K={model:H,state:B.state?.state};B.state=K,B.model=H,UQ(()=>g.resolve({filter:B.filter,filterParams:B.filterParams}),B.handler,B.handlerParams,H,K,"ui").then(()=>{this.onHandlerModelChanged(f,B.model,W)})},{compDetails:Y,handler:Z,handlerParams:G,createFilterUi:E}=q.colFilter.createFilterInstance(z,_,"agTextColumnFilter",(H,W)=>{let B={...H,filterChangedCallback:W?()=>{}:(K)=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(f,K))},doesRowPassOtherFilter:(K)=>H.doesRowPassOtherFilter(K)&&this.doesFilterPass({node:K,data:K.data},f),getValue:IQ(q,z,_,H.getValue)};if(W)Q=s0($,f),J=this.updateDisplayParams(B,f,Q,()=>Y,()=>Z,X);return B});if(!E)return g.resolve(null);let U;if(Z){let{doesRowPassOtherFilter:H,getValue:W}=G;U={...G,onModelChange:X,doesRowPassOtherFilter:(B)=>H(B)&&this.doesFilterPass({node:B,data:B.data},f),getValue:IQ(q,z,_,W)},Z.init?.({...U,model:Q,source:"init"})}return E().then((H)=>{if(!Z)return{filter:H,comp:H};let W=Y?.params,B=J(H);return{filter:H,comp:B,filterParams:W,handler:Z,handlerParams:U,model:Q}})}updateDisplayParams(_,f,$,z,Q,J){let q=this.params.column,X=new D0;_.model=$,_.state={model:$},_.onModelChange=J,_.getHandler=Q;let Y=(G,E)=>{G.state=E,X.dispatchEvent({type:"filterStateChanged",column:q,state:E})};_.onStateChange=(G)=>{let E=this.wrappers[f];if(!E)return;Y(E,G),w1(E.filter,E.filterParams,E.model??null,G,"ui")};let Z=(G,E,U)=>{let H=this.wrappers[f];if(!H)return;let W=()=>H?.model??null;Cz({action:E,filterParams:H.filterParams,getFilterUi:()=>{let B=g.resolve(H.filter);return{created:!0,filterParams:H.filterParams,compDetails:z(),create:()=>B,promise:B}},getModel:W,getState:()=>H?.state??{model:W()},updateState:(B)=>Y(H,B),updateModel:(B)=>H.filterParams?.onModelChange(B,U),processModelToApply:H.handler?.processModelToApply?.bind(H.handler)})};return _.onAction=(G,E,U)=>{Z(q,G,E),X.dispatchEvent({type:"filterAction",column:q,action:G,event:U})},(G)=>{let E=z()?.params;return this.createManagedBean(new f2(q,{comp:G,params:E,isHandler:!0},X,Z,!1))}}executeWhenAllFiltersReady(_){if((this.wrappers?.length??0)>0)_();else this.afterFiltersReadyFuncs.push(_)}updateActiveListForFilter(_,f){this.updateActiveList(_,()=>f?.isFilterActive())}updateActiveListForHandler(_,f){this.updateActiveList(_,()=>f!=null)}updateActiveList(_,f){let $=this.activeFilterIndices;if(Q_(this.activeFilterIndices,_),f())$.push(_)}onFilterModelChanged(_,f){this.updateActiveListForFilter(_,this.wrappers[_]?.filter),this.filterChanged(_,f)}onHandlerModelChanged(_,f,$){this.updateActiveListForHandler(_,f),this.filterChanged(_,$)}filterChanged(_,f){this.filterChangedCallback(f),this.wrappers.forEach(($,z)=>{if(_===z||!$)return;let{filter:Q,handler:J}=$;if(J?.onAnyFilterChanged?.(),typeof Q.onAnyFilterChanged==="function")Q.onAnyFilterChanged()})}getModelAsString(_){if(!_?.filterModels?.length)return"";let f=this.getLastActiveFilterIndex()??0;return this.wrappers[f]?.filter?.getModelAsString?.(_.filterModels[f])??""}},Xj=class extends A{constructor(){super(...arguments);this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(_){this.params=_;let f=CQ(_.filterParams);this.filterDefs=f,f.forEach(($,z)=>{let Q=this.beans.colFilter.createHandler(_.column,$,"agTextColumnFilter");if(this.handlerWrappers.push(Q),!Q){j(278,{colId:_.column.getColId()});return}let{handler:J,handlerParams:q}=Q;J.init?.({...this.updateHandlerParams(q,z,!0),model:s0(_.model,z),source:"init"})}),this.resetActiveList(_.model)}refresh(_){this.params=_;let{model:f,source:$,filterParams:z}=_,Q=z?.filters;if(this.handlerWrappers.forEach((J,q)=>{if(J){let X=this.updateHandlerParams(_,q,!1,Q?.[q].filterParams);J.handlerParams=X,J.handler.refresh?.({...X,model:s0(f,q),source:$})}}),_.source!=="floating"&&_.source!=="ui")this.resetActiveList(_.model);if(_.additionalEventAttributes?.fromButtons)this.onAnyFilterChanged()}updateHandlerParams(_,f,$,z){let{onModelChange:Q,doesRowPassOtherFilter:J,getValue:q}=_,X={..._,onModelChange:(Y,Z)=>Q(TQ(this.params.model,this.handlerWrappers.length,Y,f),Z),doesRowPassOtherFilter:(Y)=>J(Y)&&this.doesFilterPass({node:Y,data:Y.data,model:this.params.model,handlerParams:X},f),getValue:IQ(this.beans,_.column,this.filterDefs[f],q),filterParams:this.updateFilterParams(_,$,z)};return X}updateFilterParams(_,f,$){let z=_.filterParams;if($?.buttons&&f)j(292,{colId:_.column.getColId()});let Q=$?{...z,...$}:z;if(!Q.buttons)return Q;if($)return delete Q.buttons,Q;let{buttons:J,...q}=Q;return q}doesFilterPass(_,f){let $=_.model?.filterModels;if($==null)return!0;return this.handlerWrappers.every((z,Q)=>{let J=$[Q];if(J==null||f!=null&&Q===f)return!0;let q=z?.handler;return!q||q.doesFilterPass({..._,model:J,handlerParams:z.handlerParams})})}resetActiveList(_){this.activeFilterIndices=[];let f=_?.filterModels;if(f==null)return;for(let $=0;$0?_[_.length-1]:null}getModelAsString(_,f){let $=f==="filterToolPanel",z=()=>$?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!_?.filterModels?.length)return z();let Q=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[Q]?.handler.getModelAsString?.(_.filterModels[Q],f)??z()}getHandler(_){return this.handlerWrappers[_]?.handler}onAnyFilterChanged(){vQ(this.handlerWrappers,(_)=>_?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){vQ(this.handlerWrappers,(_)=>_?.handler?.onNewRowsLoaded?.())}destroy(){for(let _ of this.handlerWrappers)this.destroyBean(_?.handler);this.handlerWrappers.length=0,super.destroy()}},Yj=class extends A{constructor(){super(...arguments);this.beanName="multiFilter"}getParamsForDataType(_,f,$,z){let Q=_?.filters,J=this.beans;if(!Q)Q=[{filter:oJ($.baseDataType)},{filter:"agSetColumnFilter"}];let q=this.getLocaleTextFunc();return Q=Q.map((X)=>{let{filter:Y,filterParams:Z,filterValueGetter:G}=X;if(typeof Y!=="string")return X;let{filterParams:E,filterValueGetter:U}=aJ(Y,Z,G??f,$,z,J,q);return{...X,filterParams:E,filterValueGetter:U}}),{filterParams:{..._,filters:Q}}}},jZ=class extends AZ{constructor(){super(...arguments);this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(_){this.params=_;let f=CQ(_).map((z)=>{if(z.filterParams?.buttons){j(292,{colId:_.column.getColId()});let Q={...z.filterParams};return delete Q.buttons,{...z,filterParams:Q}}return z});this.filterDefs=f,this.allState=_.state;let $=this.filterDefs.map((z,Q)=>this.createFilter(z,Q));return new g((z)=>{g.all($).then((Q)=>{this.filters=Q,this.refreshGui("columnMenu").then(()=>{z()})})})}refresh(_){let{model:f,state:$,source:z}=_;if(z==="colDef")return!1;this.params=_;let Q=this.filterParams;if($===this.allState)return!0;this.allState=$;let J=$.state;return this.filters.forEach((q,X)=>{let Y=s0(f,X),Z={state:J?.[X],model:s0($.model,X)};w1(q,Q[X],Y,Z,z)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(_){return this.filters[_]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(let _ of this.filters)this.destroyBean(_);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(_){return _}getCompFromWrapper(_){return _}createFilter(_,f){let $=this.beans.userCompFactory,z=this.updateParams(_,this.params,f),Q=HJ($,_,z,"agTextColumnFilter");if(!Q)return g.resolve(null);return this.filterParams[f]=Q.params,Q.newAgStackInstance()}updateParams(_,f,$){let{doesRowPassOtherFilter:z,model:Q,onModelChange:J,state:q,onStateChange:X,column:Y,source:Z,onAction:G,onUiChange:E,getValue:U}=f,H=s0(Q,$),W=q?{model:s0(q.model,$),state:q.state?.[$]}:{model:H},B=()=>{let L=this.getHandler();this.filters.forEach((F,D)=>{if($!==D)L.getHandler(D)?.onAnyFilterChanged?.(),F?.onAnyFilterChanged?.()})},K=this.beans.colFilter;return{...K.createBaseFilterParams(Y),..._,doesRowPassOtherFilter:(L)=>z(L)&&this.getHandler().doesFilterPass({node:L,data:L.data,model:this.params.model,handlerParams:K.getHandlerParams(Y)},$),model:H,state:W,onModelChange:(L,F)=>{let{filters:D,params:M}=this,k=TQ(M.model,D.length,L,$);this.updateActiveList($,L),J(k,F),B()},onStateChange:(L)=>this.onStateChange(X,$,L),getHandler:()=>this.getHandler().getHandler($),onAction:(L,F,D)=>{if(V$(f))return;let M=L==="apply"||L==="reset";if(M)this.updateActiveList($,s0(this.params.state.model,$));if(G(L,F,D),M)B()},onUiChange:E,source:Z,getValue:IQ(this.beans,Y,_,U)}}updateActiveList(_,f){this.getHandler().updateActiveList?.(_,f)}getHandler(){return this.params.getHandler()}onStateChange(_,f,$){let{model:z,state:Q,valid:J}=$,q=this.validity;q[f]=J;let X=this.allState,Y=TQ(X.model,this.filters.length,z,f),Z=q.every((U)=>U!==!1),G=[...X.state??[]];G[f]=Q;let E={state:G,model:Y,valid:Z};this.allState=E,_(E)}getModelAsString(_){return this.getHandler().getModelAsString?.(_)??""}},Zj={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},Gj=class extends w{constructor(){super(Zj);this.floatingFilters=[],this.compDetailsList=[]}init(_){this.params=_;let{compDetailsList:f}=this.getCompDetailsList(_);return this.setParams(f)}setParams(_){let f=[];return _.forEach(($)=>{let z=$?.newAgStackInstance();if(z!=null)this.compDetailsList.push($),f.push(z)}),g.all(f).then(($)=>{$.forEach((z,Q)=>{this.floatingFilters.push(z);let J=z.getGui();if(this.appendChild(J),Q>0)N(J,!1)})})}refresh(_){this.params=_;let{compDetailsList:f,floatingFilterParamsList:$}=this.getCompDetailsList(_);if(f.length===this.compDetailsList.length&&f.every((Q,J)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[J],Q))){if($.forEach((Q,J)=>{this.floatingFilters[J].refresh?.(Q)}),this.gos.get("enableFilterHandlers")){let Q=_;if(Q.model==null)this.floatingFilters.forEach((J,q)=>{N(J.getGui(),q===0)});else{let J=Q.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((q,X)=>{let Y=J==null?X===0:X===J;N(q.getGui(),Y)})}}}else f_(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(f)}getCompDetailsList(_){let f=[],$=[],z=_.filterParams,Q=_.currentParentModel,J=CQ(z);return J.forEach((q,X)=>{let Y={..._,parentFilterInstance:(G)=>{this.parentMultiFilterInstance((E)=>{let U=E.getChildFilterInstance(X);if(U==null)return;G(U)})},currentParentModel:()=>Q()?.filterModels?.[X]??null};if(this.gos.get("enableFilterHandlers")){let G=Y;G.model=G.model?.filterModels?.[X]??null;let{onModelChange:E,getHandler:U}=G;G.onModelChange=(H,W)=>E(TQ(this.params.model,J.length,H,X),W),G.getHandler=()=>{return U().getHandler(X)}}H_(Y.filterParams,q.filterParams);let Z=this.getCompDetails(q,Y);if(Z)f.push(Z),$.push(Y)}),{compDetailsList:f,floatingFilterParamsList:$}}onParentModelChanged(_,f){if(f?.afterFloatingFilter)return;this.parentMultiFilterInstance(($)=>{if(_==null)this.floatingFilters.forEach((z,Q)=>{z.onParentModelChanged(null,f),N(z.getGui(),Q===0)});else{let z=$.getLastActiveFilterIndex();this.floatingFilters.forEach((Q,J)=>{let q=_.filterModels.length>J?_.filterModels[J]:null;Q.onParentModelChanged(q,f);let X=z==null?J===0:J===z;N(Q.getGui(),X)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(_,f){let{colFilter:$,frameworkOverrides:z,userCompFactory:Q}=this.beans,J=eJ(z,_,()=>$.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return WJ(Q,_,f,J)}parentMultiFilterInstance(_){this.params.parentFilterInstance((f)=>{if(!(f instanceof RZ||f instanceof jZ))e(120);_(f)})}},VZ={moduleName:"MultiFilter",version:$_,userComponents:{agMultiColumnFilter:{getComp:(_)=>_.gos.get("enableFilterHandlers")?{classImp:jZ,params:{useForm:!0}}:RZ},agMultiColumnFloatingFilter:Gj},beans:[Yj],dynamicBeans:{agMultiColumnFilterHandler:Xj},dependsOn:[y_,i5,j2]},Ej=class extends A{constructor(){super(...arguments);this.beanName="aggColNameSvc"}getHeaderName(_,f){if(this.gos.get("suppressAggFuncInHeader"))return f;let{valueColsSvc:$,colModel:z,rowGroupColsSvc:Q}=this.beans,J=_.getColDef().pivotValueColumn,q=v(J),X=null,Y;if(q){let Z=$?.columns??[],G=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&Z.length===1,E=_.getColDef().pivotTotalColumnIds!==void 0;if(G&&!E)return f;X=J?J.getAggFunc():null,Y=!0}else{let Z=_.isValueActive(),G=Q?.columns.length!==0,E=z.isPivotMode()||G||this.gos.get("treeData");if(Z&&E)X=_.getAggFunc(),Y=!0;else Y=!1}if(Y){let Z=typeof X==="string"?X:"func";return`${this.getLocaleTextFunc()(Z,Z)}(${f})`}return f}},Uj={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Hj=class extends A{constructor(){super(...arguments);this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){if(this.initialised)return;this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs"))}initialiseWithDefaultAggregations(){let _=this.aggFuncsMap;_.sum=Wj,_.first=Bj,_.last=Kj,_.min=Lj,_.max=Fj,_.count=Mj,_.avg=Sj,this.initialised=!0}isAggFuncPossible(_,f){let z=this.getFuncNames(_).includes(f),Q=v(this.aggFuncsMap[f]);return z&&Q}getDefaultFuncLabel(_){return Uj[_]??_}getDefaultAggFunc(_){let f=_.getColDef().defaultAggFunc;if(v(f)&&this.isAggFuncPossible(_,f))return f;if(this.isAggFuncPossible(_,"sum"))return"sum";let $=this.getFuncNames(_);return $?.length?$[0]:null}addAggFuncs(_){if(this.init(),!_)return;for(let f of Object.keys(_))if(_[f])this.aggFuncsMap[f]=_[f]}getAggFunc(_){return this.init(),this.aggFuncsMap[_]}getFuncNames(_){let f=_.getColDef().allowedAggFuncs;return f==null?Object.keys(this.aggFuncsMap).sort():f}clear(){this.aggFuncsMap={}}};function Wj(_){let{values:f}=_,$=null;for(let z=0;z0?_.values[0]:null}function Kj(_){return _.values.length>0?b(_.values):null}function Lj(_){let{values:f}=_,$=null;for(let z=0;zQ))$=Q}return $}function Fj(_){let{values:f}=_,$=null;for(let z=0;z0)Q=$/(typeof $==="number"?z:BigInt(z));let J=_.rowNode?.aggData?.[_.column?.getColId()];if(J&&J.count===z&&J.value===Q)return J;let q=Object.create(kj);return q.count=z,q.value=Q,q}var Aj=class extends A{constructor(){super(...arguments);this.beanName="aggChildrenSvc"}getAggregatedChildren(_,f,$){if(!_?.group)return[];if(_.rowPinned){if(_=_.pinnedSibling,!_)return[]}let z=this.gos,Q=OZ(_,f,z);if(!$)return Q;let J=[];return PZ(Q,f,z,J),J}},OZ=(_,f,$)=>{let z=f?.colDef,Q=z?.pivotKeys;if(Q){if(_.leafGroup&&Q.length&&!z.pivotTotalColumnIds)return YZ(_.childrenMapped,Q);return _.childrenAfterFilter??_.childrenAfterGroup??[]}if(C0($)||$.get("suppressAggFilteredOnly"))return _.childrenAfterGroup??[];return _.childrenAfterFilter??_.childrenAfterGroup??[]},PZ=(_,f,$,z)=>{for(let Q=0,J=_.length;Q{GY(R,null,M)})}return}this.hadAgg=!0;let{colModel:J,aggFuncSvc:q}=$,X=f.get("alwaysAggregateAtRootLevel")||!!Lf(f)||J.isPivotMode(),Y=!C0(f)&&!f.get("suppressAggFilteredOnly"),Z=$.valueSvc,G=$.gridApi,E=$.gridOptions.context,U=Q??[],H=U.length,W=_?.kind==="cells"?_:void 0,B,K=Array(H);for(let M=0;M=0)B=W;K[M]={column:k,colId:k.colId,colDef:k.colDef,aggFunc:vZ(k.getAggFunc(),q,k),colSlot:R}}let L=Tj(J,$.pivotResultCols,q),F=H>0?Array(H):null,D=$.rowModel;R_(D.rootNode,D.hierarchical,_,(M)=>{if(M.level===-1&&!X){h1(M,null,J);return}let k;if(z)k=z({nodes:M.childrenAfterFilter});else if(!F)k=null;else if(L)k=vj(M,L,Z,G,E);else k=Pj(M,K,H,F,B,Y,Z,G,E);GY(M,k,J)})}},Pj=(_,f,$,z,Q,J,q,X,Y)=>{let Z=(J?_.childrenAfterFilter:_.childrenAfterGroup)??[],G=Z.length,E=_.data,U=Object.create(null),H=Q?Q.getSlot(_):-1,W=H>=0?_.aggData:void 0,B=0;for(let K=0;K<$;++K){let L=f[K];if(H>=0&&!Q.hasCellBySlot(H,L.colSlot)){if(z[K]=null,W)U[L.colId]=W[L.colId]}else z[K]=Array(G),++B}if(B===0)return U;for(let K=0;K{let J=f.length,q=_.leafGroup,X=_.data,Y=_.childrenMapped,Z=_.childrenAfterFilter??[],G=Object.create(null),E,U;for(let H=0;H{if(typeof _==="function")return _;if(_==null)return null;let z=f.getAggFunc(_);if(typeof z!=="function")return j(109,{inputValue:_.toString(),allSuggestions:f.getFuncNames($)}),null;return z},Tj=(_,f,$)=>{if(!_.isPivotActive())return null;let z=f?.getAggregationOrderedList();if(!z||z.length===0)return null;let Q=z.length,J=Array(Q),q=0;for(let X=0;X{let f=_.childrenAfterAggFilter,$=0;if(f){let Q=f.length;$=Q;for(let J=0;J=0?null:$;_.setAllChildrenCount(z),_.pinnedSibling?.setAllChildrenCount(z)},this.setAllChildrenCountGridGrouping=(_)=>{let f=_.childrenAfterAggFilter,$=0;for(let z=0,Q=f.length;z!W.node.group,Z=(W)=>W.node.leafGroup,G=C0(this.gos)||(J?Z:Y),E=X?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,U=(W,B=!1)=>{if(W.childrenAfterFilter){if(W.childrenAfterAggFilter=W.childrenAfterFilter,B){let K=W.childrenAfterAggFilter;for(let L=0,F=K.length;L{if(W.childrenAfterAggFilter=W.childrenAfterFilter?.filter((B)=>{if(G({node:B})){if(Q.doesRowPassAggregateFilters({rowNode:B}))return U(B,!0),!0}return B.childrenAfterAggFilter?.length})||null,W.hasChildren())E(W);else W.setAllChildrenCount(null),W.pinnedSibling?.setAllChildrenCount(null);if(W.sibling)W.sibling.childrenAfterAggFilter=W.childrenAfterAggFilter};R_(f.rootNode,f.hierarchical,_,q?H:U)}};function i$(_,f){if(_.sibling)return;let $=YX(_,f);$.footer=!0,$.setRowTop(null),$.setRowIndex(null),$.oldRowTop=null,$.id="rowGroupFooter_"+_.id,$.sibling=_,_.sibling=$}function yj(_){let f=_.sibling;if(!f)return;f._destroy(!1),_.sibling=void 0,f.sibling=void 0}var bj=class extends A{constructor(){super(...arguments);this.beanName="footerSvc"}addTotalRows(_,f,$,z,Q,J){let q=_;if(Q){let Z=z&&Lf(this.gos);if(Cj(J,Z))i$(f,this.beans),$(f.sibling,q++);return q}let X=pz(this.gos);if((z&&X({node:f}))===J)i$(f,this.beans),$(f.sibling,q++);return q}getTopDisplayIndex(_,f,$,z){let Q=f;if(_[0].footer){if(f===0)return 0;Q-=1}let J=_[_.length-1],q=Q>=$.length;if(J.footer&&q)return J.rowIndex;return z(Q)}doesCellShowTotalPrefix(_,f){if(!_.footer||!f?.getColDef().showRowGroup)return!1;if(this.gos.get("treeData"))return!0;if(_.level===-1)return this.beans.showRowGroupCols?.columns[0]===f;return!!_.rowGroupColumn&&f?.isRowGroupDisplayed(_.rowGroupColumn.getId())}applyTotalPrefix(_,f,$,z){let Q=z.getColDef().cellRendererParams?.totalValueGetter;if(Q){let J=C(this.gos,{column:z,node:$,value:_,formattedValue:f});if(typeof Q==="function")return Q(J);if(typeof Q==="string")return this.beans.expressionSvc?.evaluate(Q,J);j(179)}if($.level===-1)return this.getLocaleTextFunc()("footerTotal","Total")+" ";return this.getTotalValue(f??_)??""}getTotalValue(_){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(_??"")}};function Cj(_,f){switch(f){case"top":case"pinnedTop":return _==="top";case"bottom":case"pinnedBottom":return _==="bottom";default:return!1}}var TZ=class extends x1{constructor(){super(...arguments);this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(_,f,$)=>this.setValueActive(f,_,$),add:(_,f,$)=>this.setValueActive(!0,_,$),remove:(_,f,$)=>this.setValueActive(!1,_,$)},this.columnExtractors={setFlagFunc:(_,f,$)=>this.setColValueActive(_,f,$),getIndexFunc:()=>{return},getInitialIndexFunc:()=>{return},getValueFunc:(_)=>{let f=_.aggFunc;if(f===null||f==="")return null;if(f===void 0)return;return!!f},getInitialValueFunc:(_)=>{return _.initialAggFunc!=null&&_.initialAggFunc!=""}},this.modifyColumnsNoEventsCallbacks={addCol:(_)=>this.columns.push(_),removeCol:(_)=>Q_(this.columns,_)}}extractCols(_,f){this.columns=super.extractCols(_,f);for(let $ of this.columns){let z=$.getColDef();if(z.aggFunc!=null&&z.aggFunc!="")this.setColAggFunc($,z.aggFunc);else if(!$.getAggFunc())this.setColAggFunc($,z.initialAggFunc)}return this.columns}setColumnAggFunc(_,f,$){if(!_)return;let z=this.colModel.getColDefCol(_);if(!z)return;this.setColAggFunc(z,f),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[z],$)}syncColumnWithState(_,f,$){let z=$("aggFunc").value1;if(z!==void 0)if(typeof z==="string"){if(this.setColAggFunc(_,z),!_.isValueActive())this.setColValueActive(_,!0,f),this.modifyColumnsNoEventsCallbacks.addCol(_)}else{if(v(z))j(33);if(_.isValueActive())this.setColValueActive(_,!1,f),this.modifyColumnsNoEventsCallbacks.removeCol(_)}}setValueActive(_,f,$){if(_===f.isValueActive())return;if(this.setColValueActive(f,_,$),_&&!f.getAggFunc()&&this.aggFuncSvc){let z=this.aggFuncSvc.getDefaultAggFunc(f);this.setColAggFunc(f,z)}}setColAggFunc(_,f){_.aggFunc=f,_.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(_,f,$){if(_.aggregationActive!==f)_.aggregationActive=f,_.dispatchColEvent("columnValueChanged",$)}},IZ={moduleName:"SharedAggregation",version:$_,beans:[Hj,Ej,bj,TZ],apiFunctions:{addAggFuncs:Rj,clearAggFuncs:jj,setColumnAggFunc:Vj},dependsOn:[y_]},wj={moduleName:"Aggregation",version:$_,beans:[Oj,Ij,Aj],rowModels:["clientSide"],dependsOn:[IZ]},yZ=class extends x1{constructor(){super(...arguments);this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(_,f,$)=>this.setColPivotActive(_,f,$),add:(_,f,$)=>this.setColPivotActive(_,!0,$),remove:(_,f,$)=>this.setColPivotActive(_,!1,$)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(_,f,$)=>this.setColPivotActive(_,f,$),getIndexFunc:(_)=>_.pivotIndex,getInitialIndexFunc:(_)=>_.initialPivotIndex,getValueFunc:(_)=>_.pivot,getInitialValueFunc:(_)=>_.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:(_)=>{if(!this.columns.includes(_))this.columns.push(_)},removeCol:(_)=>Q_(this.columns,_)}}syncColumnWithState(_,f,$,z){let{value1:Q,value2:J}=$("pivot","pivotIndex");if(Q!==void 0||J!==void 0){if(typeof J==="number"||Q){if(!_.isPivotActive())this.setColPivotActive(_,!0,f),this.modifyColumnsNoEventsCallbacks.addCol(_);if(z&&typeof J==="number")z[_.getId()]=J}else if(_.isPivotActive())this.setColPivotActive(_,!1,f),this.modifyColumnsNoEventsCallbacks.removeCol(_)}}setColPivotActive(_,f,$){if(_.pivotActive!==f){if(_.pivotActive=f,f)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,_)?.forEach((Q)=>this.setColPivotActive(Q,f,$));_.dispatchColEvent("columnPivotChanged",$)}_.dispatchStateUpdatedEvent("pivot")}},xj=class extends x1{constructor(){super(...arguments);this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(_,f,$)=>this.setActive(f,_,$),add:(_,f,$)=>this.setActive(!0,_,$),remove:(_,f,$)=>this.setActive(!1,_,$)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(_,f,$)=>this.setColRowGroupActive(_,f,$),getIndexFunc:(_)=>_.rowGroupIndex,getInitialIndexFunc:(_)=>_.initialRowGroupIndex,getValueFunc:(_)=>_.rowGroup,getInitialValueFunc:(_)=>_.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:(_)=>{if(!this.columns.includes(_))this.columns.push(_)},removeCol:(_)=>Q_(this.columns,_)}}moveColumn(_,f,$){if(this.columns.length===0)return;let z=this.columns[_],Q=this.columns.slice(_,f);this.columns.splice(_,1),this.columns.splice(f,0,z),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:Q,column:Q.length===1?Q[0]:null,source:$})}syncColumnWithState(_,f,$,z){let{value1:Q,value2:J}=$("rowGroup","rowGroupIndex");if(Q!==void 0||J!==void 0){if(typeof J==="number"||Q){if(!_.isRowGroupActive())this.setColRowGroupActive(_,!0,f),this.modifyColumnsNoEventsCallbacks.addCol(_);if(z&&typeof J==="number")z[_.getId()]=J}else if(_.isRowGroupActive())this.setColRowGroupActive(_,!1,f),this.modifyColumnsNoEventsCallbacks.removeCol(_)}}setActive(_,f,$){if(_===f.isRowGroupActive())return;this.setColRowGroupActive(f,_,$);let z=this.beans.groupHierarchyColSvc?.getColumn(f);if(dz(this.gos,_)&&!z)this.colModel.setColsVisible([f],!_,$)}setColRowGroupActive(_,f,$){if(_.rowGroupActive!==f){if(_.rowGroupActive=f,f)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,_)?.forEach((Q)=>this.setColRowGroupActive(Q,f,$));_.dispatchColEvent("columnRowGroupChanged",$)}_.dispatchStateUpdatedEvent("rowGroup")}},Nj=class extends A{constructor(){super(...arguments);this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this)),this.setupGroupHideColumnsUntilExpanded()}setupGroupHideColumnsUntilExpanded(){let _=()=>this.updateGroupColumnVisibility();this.addManagedEventListeners({modelUpdated:_}),this.addManagedPropertyListeners(["groupHideColumnsUntilExpanded","groupDisplayType","groupHideOpenParents"],_)}addColumns(_){let{columns:f}=this;if(f==null)return;_.list=f.list.concat(_.list),_.tree=f.tree.concat(_.tree),A$(_)}createColumns(_,f,$){let z=this.beans,{colModel:Q,gos:J,rowGroupColsSvc:q,colGroupSvc:X}=z,Y=Q.isPivotMode(),Z=nz(J,Y),G=Y?J.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),E=q?.columns,H=!(E&&E.length>0||J.get("treeData"))||G||Z,W=()=>{if(this.columns)J0(z,this.columns.tree),this.columns=null};if(H){W();return}let B=this.generateAutoCols(E),K=S$(B,this.columns?.list||null),L=_.treeDepth,D=(this.columns?this.columns.treeDepth:-1)==L;if(K&&D){let O=new Map(B.map((I)=>[I.getId(),I]));for(let I of this.columns?.list??[]){let T=O.get(I.getId());if(T)I.setColDef(T.getColDef(),null,$)}return}W();let M=X?.findDepth(_.tree)??0,k=X?.balanceTreeForAutoCols(B,M)??[];this.columns={list:B,tree:k,treeDepth:M,map:{}},f((O)=>{if(!O)return null;let I=O.filter((T)=>!of(T));return[...B,...I]})}updateColumns(_){let f=Uf(_.source);this.columns?.list.forEach(($,z)=>this.updateOneAutoCol($,z,f))}getColumn(_){return this.columns?.list.find((f)=>b0(f,_))??null}getColumns(){return this.columns?.list??null}generateAutoCols(_=[]){let f=[],{gos:$}=this,z=$.get("treeData"),Q=M$($);if(z&&Q)j(182),Q=!1;if(Q)_.forEach((J,q)=>{f.push(this.createOneAutoCol(J,q))});else f.push(this.createOneAutoCol());return f}isSuppressAutoCol(){let _=this.gos;if(_.get("groupDisplayType")==="custom")return!0;return _.get("treeDataDisplayType")==="custom"}createOneAutoCol(_,f){let $;if(_)$=`${af}-${_.getId()}`;else $=af;let z=this.createAutoColDef($,_,f);z.colId=$;let Q=new Z0(z,null,$,!0);return this.createBean(Q),Q}updateOneAutoCol(_,f,$){let z=_.getColDef(),Q=typeof z.showRowGroup=="string"?z.showRowGroup:void 0,J=this.beans,q=Q!=null?J.colModel.getColDefCol(Q):void 0,X=_.getId(),Y=this.createAutoColDef(X,q??void 0,f);_.setColDef(Y,null,$),d_(J,{state:[EJ(Y,X)]},$)}createAutoColDef(_,f,$){let z=this.createBaseColDef(f),Q=this.gos.get("autoGroupColumnDef");if(H_(z,Q),z=n0(this.beans,z,_,!0),Q?.groupRowEditable==null)z.groupRowEditable=void 0;if(Q?.groupRowValueSetter==null)z.groupRowValueSetter=void 0;if(!this.gos.get("treeData")){if(n(z.field)&&n(z.valueGetter)&&n(z.filterValueGetter)&&z.filter!=="agGroupColumnFilter")z.filter=!1}if($&&$>0)z.headerCheckboxSelection=!1;let J=K0(this.gos),q=z.valueGetter||z.field!=null;if(J&&!q)z.sortIndex=void 0,z.initialSort=void 0;return z}createBaseColDef(_){let f=this.gos.get("autoGroupColumnDef"),z={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:_?.getColId()??!0};if(!(f&&(f.cellRenderer||f.cellRendererSelector)))z.cellRenderer="agGroupCellRenderer";if(_)z.headerName=this.beans.colNames.getDisplayNameForColumn(_,"header")??void 0,z.headerValueGetter=_.colDef.headerValueGetter;return z}getDeepestExpandedLevel(_,f){let $=-1;if(!_)return $;for(let z of _){if(!z.group||!z.expanded)continue;if(z.level>$)$=z.level;if($>=f)return $;let Q=this.getDeepestExpandedLevel(z.childrenAfterGroup,f);if(Q>$)$=Q;if($>=f)return $}return $}updateGroupColumnVisibility(){let _=this.columns?.list;if(!_||_.length===0)return;let{gos:f,visibleCols:$,rowModel:z}=this.beans,Q=JJ(f),J=!1,q=(Y,Z)=>{if(Z!==Y.isVisible())Y.setVisible(Z,"api"),J=!0},X=()=>{for(let Y of _)q(Y,!0)};if(!Q)X();else if(_.length>1){let Y=_.length-2,Z=z?.rootNode?.childrenAfterGroup,G=this.getDeepestExpandedLevel(Z,Y);if(G>=Y)X();else for(let E=0;E<_.length-1;E++)q(_[E+1],G>=E)}if(J)$.refresh("api")}destroy(){J0(this.beans,this.columns?.tree),super.destroy()}},k2=null,LY=(_)=>{let f=k2,$=new Uint32Array(1<<32-Math.clz32(_|63));if(f)$.set(f);return k2=$,$},gj=(_,f,$,z)=>{let Q=f-z,J=$-1;if(Q===1){let Z=0;while(_[Z].level===J)++Z;if(Z0){let G=_[Z];_.copyWithin(1,0,Z),_[0]=G}return _}let q=Array(Q),X=0,Y=0;for(let Z=0;Z{let $=_[0].level+1,z=$,Q=0,J=$,q=k2;if(!q||$>=q.length)q=LY($);++q[$];for(let E=1;E$){if($=U,$>=q.length)q=LY($)}else if(U=0)return q.fill(0,z,$+1),_;let X=q[z],Y=q[$];if(X+Y===f)return q[z]=0,q[$]=0,gj(_,f,$,Y);let Z=0;for(let E=$;E>=z;--E){let U=q[E];q[E]=Z,Z+=U}let G=Array(f);for(let E=0;E{if(f===2){if(_[0].level<_[1].level){let $=_[0];_[0]=_[1],_[1]=$}return _}if(f>16)return hj(_,f);for(let $=1;$=0&&_[J].level=0)$.set(f,-1),f=f.parent;return}let z=this.rows;do $.set(f,-1),z.push(f),f=f.parent;while(f!=null&&!$.has(f));this.unsorted=!0}addCell(_,f){if(f==null){this.addRow(_);return}if(_==null)return;let $=this.slots,z=this.bits,Q=$.get(f)??this.ensureCol(f),J=$.get(_);if(J===void 0)J=this.ensureRow(_);else if(J<0)return;let q=Q<32?z:this.extraBits[(Q>>>5)-1],X=1<<(Q&31),Y=q[J];if((Y&X)!==0)return;q[J]=Y|X;let Z=_.parent;while(Z!=null){let G=$.get(Z);if(G<0)break;let E=q[G];if((E&X)!==0)break;q[G]=E|X,Z=Z.parent}}hasRow(_){return this.slots.has(_)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let _=bZ(this.rows);return this.rows=_,_}getSlot(_){return this.slots.get(_)??-1}hasCellBySlot(_,f){if(_<0)return!0;if(f<32)return f>=0&&(this.bits[_]&1<>>5)-1][_]&1<<(f&31))!==0}ensureRow(_){let f=this.slots,$=this.rows,z=this.bits,Q=this.extraBits,J=z.push(0),q=J-1;if(Q!==null)for(let Y=0,Z=Q.length;Y=32){let $=(f>>>5)-1,z=this.extraBits;if(z===null)z=[],this.extraBits=z;if($>=z.length)z.push(Array(this.bits.length).fill(0))}return f}},FY=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=new Set}addRow(_){let f=_;if(f==null)return;let $=this.rowSet;if($.has(f))return;let z=this.rows;do $.add(f),z.push(f),f=f.parent;while(f!=null&&!$.has(f));this.unsorted=!0}addCell(_,f){this.addRow(_)}hasRow(_){return this.rowSet.has(_)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let _=bZ(this.rows);return this.rows=_,_}},ij=class extends A{constructor(){super(...arguments);this.beanName="changedPathFactory"}newPath(_){return _?new uj:new FY}ensureRowsPath(_){let f=_.changedPath;if(!f&&_.changedRowNodes&&!_.newData){let $=this.beans.rowModel;if($.hierarchical)f=new FY,_.changedPath=f,f.addRow($.rootNode)}return f}},mj=class extends A{addExpandedCss(_,f){if(f.isExpandable())_.push("ag-row-group"),_.push(f.expanded?"ag-row-group-expanded":"ag-row-group-contracted")}getRowExpandedListeners(_){let{rowNode:f}=_,$=this.updateExpandedCss.bind(this,_,f);return{expandedChanged:$,hasChildrenChanged:$}}setExpanded(_,f,$,z){if(_.expanded===f)return;_._expanded=f,_.dispatchRowEvent("expandedChanged");let Q={...MJ(_,this.gos,"rowGroupOpened"),expanded:f,event:$||null};this.dispatchExpandedEvent(Q,z)}defaultExpanded(_){let $=this.beans.gos,z=_.level??0,Q=_.group&&$.get("isGroupOpenByDefault");if(!Q){let q=$.get("groupDefaultExpanded");return q===-1||z{let J=Q.rowComp;J.toggleCss("ag-row-group",$),J.toggleCss("ag-row-group-expanded",$&&z),J.toggleCss("ag-row-group-contracted",$&&!z),N_(Q.element,$&&z)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},cj=class extends mj{constructor(){super(...arguments);this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(_){let f=new Set(_.expandedRowGroupIds);this.beans.rowModel.forEachNode(($)=>{let z=$.id;if(!z)return;$._expanded=f.has(z)}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(_=!1){let f=[],$=[];return this.beans.rowModel.forEachNode((z)=>{let Q=z.id;if(!Q)return;if(z.expanded)f.push(Q);else if(_&&z.isExpandable())$.push(Q)}),{expandedRowGroupIds:f,collapsedRowGroupIds:$}}getExpansionState(){return this.getInternalExpansionState()}isExpanded(_){if(_.footer)return!!_._expanded;if(!(_.group||_.master)||_.leafGroup&&this.beans.colModel.isPivotMode())return!1;let f=_._expanded;if(f===null)f=this.defaultExpanded(_)??!1,_._expanded=f;return!!f}resetExpansion(){let{rowModel:_}=this.beans;_.forEachNode((f)=>{if(!f.group&&!f.master)return;f._expanded=null}),this.onGroupExpandedOrCollapsed()}expandAll(_){let{gos:f,rowModel:$,colModel:z,eventSvc:Q}=this.beans,J=f.get("treeData"),q=z.isPivotActive(),X=(Z)=>{if(!Z)return;for(let G of Z){let E=()=>{G._expanded=_,X(G.childrenAfterGroup)};if(G.master){E();continue}if(J){if(v(G.childrenAfterGroup))E();continue}if(q){if(!G.leafGroup)E();continue}if(G.group)E()}},Y=$.rootNode;if(Y)X(Y.childrenAfterGroup);this.onGroupExpandedOrCollapsed(),Q.dispatchEvent({type:"expandOrCollapseAll",source:_?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(_){let f=this.getInternalExpansionState(!0),$=f.collapsedRowGroupIds.length===0;if(f.expandedRowGroupIds.length===0===$)return;return $?_.expandAll():_.collapseAll()}dispatchExpandedEvent(_,f){if((this.events??(this.events=[])).push(_),f){this.dispatchExpandedEvents();return}let $=this.dispatchExpandedDebounced;if(!$){if(!this.isAlive())return;$=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=$}$()}dispatchExpandedEvents(){let{eventSvc:_,rowRenderer:f}=this.beans,$=this.events,z=$?.length;if(!z)return;this.events=null;let Q=Array(z);for(let J=0;Jwindow.setTimeout(_,0);let $=!1;return()=>{if(!f.active){window.setTimeout(_,0);return}if($)return;$=!0,f.addDestroyTask(()=>{$=!1,_()})}}};function pj(_){let f=_.get("groupHideParentOfSingleChild");if(!f){if(f=_.get("groupRemoveSingleChildren"),!f&&_.get("groupRemoveLowestSingleChildren"))f="leafGroupsOnly"}return{groupHideParentOfSingleChild:f,isGroupMultiAutoColumn:M$(_),hideOpenParents:_.get("groupHideOpenParents"),grandTotalRow:Lf(_),groupTotalRow:pz(_)}}function nj(_,f,$){return _.groupHideParentOfSingleChild===!0&&$&&f.childrenAfterGroup.length===1}function dj(_,f,$){return _.groupHideParentOfSingleChild==="leafGroupsOnly"&&$&&f.leafGroup&&f.childrenAfterGroup.length===1}function tj(_,f,$,z,Q,J){if(z&&!$)return!1;if(Q||J)return!1;if(!_.hideOpenParents)return!0;if(f.master||f.level===-1)return!0;if(!(z&&f.leafGroup)&&f.expanded)return!1;return!0}var rj=class extends A{constructor(){super(...arguments);this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){let{beans:_,gos:f}=this,$=[],z=_.rowModel.rootNode;if(!z)return $;let Q=_.colModel.isPivotMode(),J=Q&&z.leafGroup&&z.aggData,q=J?[z]:z.childrenAfterSort,X=pj(f);this.recursivelyAddToRowsToDisplay(X,q,$,Q,0);let Y=$.length>0,Z=X.grandTotalRow;if(!J&&Y&&Z)if(i$(z,_),Z==="pinnedBottom"||Z==="pinnedTop")this.beans.pinnedRowModel?.setGrandTotalPinned(Z==="pinnedBottom"?"bottom":"top");else{let E=Z==="top";this.addRowNodeToRowsToDisplay(X,z.sibling,$,0,E)}return $}recursivelyAddToRowsToDisplay(_,f,$,z,Q){if(!f?.length)return;let J=this.beans.masterDetailSvc;for(let q=0;qthis.onCsrmCellChange(_),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(_){if(!_.rowDragManaged||!_.sameGrid)return!1;if(!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()}initDraggingGroups(_){let f=new Map,$=(z)=>{let Q=z.childrenAfterGroup;if(Q){if(f.has(z))return;let J=Q.slice();f.set(z,J);for(let q of J)$(q)}};for(let z of _.rows)if(z.group)$(z);this.draggingGroups=f}canSetParent(_){if(!_.sameGrid)return!1;if(this.beans.groupStage?.treeData)return!0;if(_.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length}canDropRow(_,f){if(this.beans.groupStage?.treeData)return!sj(_,f.newParent);let{position:$,target:z,newParent:Q,rootNode:J}=f,q=_.parent;if(_.group&&(MY(_,z)||MY(_,Q)))return!1;if($==="inside")return!0;if(Q&&Q!==q)return Q!==J||q===J;let X=Q??z?.parent??J;if(X!==q)return!1;let Y=_.group?_.level:q.level??-1,Z=-1;if(z)Z=z.group?z.level:z.parent?.level??-1;else if(X)Z=X.level;if(Y>=0&&Z>=0&&Z!==Y)return!1;return!0}fixRowsDrop(_,f,$,z){let Q=!!this.beans.groupStage?.treeData;if(_.treeData=Q,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!Q)return;if(!this.draggingGroups&&this.isGroupingDrop(_)&&!_.suppressMoveWhenRowDragging)this.initDraggingGroups(_);let q=_.target,X=null,Y=!1,Z=_.rootNode,G=this.beans.rowModel,E=this.canStartGroup(q,Q);this.updateDropTarget(_,$,E);let U=this.beans.pageBounds?.getLastRow?.()??G.getRowCount()-1;if(f){if(!q||z>=0.5&&q.rowIndex===U)X=Z;else if(_.moved&&q&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(_))X=q;if(!X)X=q?.parent??Z}if(!$&&q&&E&&!(q.group&&q.expanded))this.startDropGroupDelay(q);if(X){if(q&&X===q&&X!==Z){let H=X.expanded?ZX(G,1,q):null;if(H?.parent===X)q=H,z=-0.5;else Y=!0}if(q&&!Y){let H=q;while(H&&H!==Z&&H!==X)q=H,H=H.parent}}_.target=q,_.newParent=X,_.yDelta=z,_.inside=Y}clearNewSameParent(_,f){let $=_.newParent;if($&&(!f||aj(_.rows,$)))_.newParent=null}updateDropTarget(_,f,$){let z=$?_.target:null;if(this.dropGroupTarget&&this.dropGroupTarget!==z)this.resetDragGroup();if(!z?.childrenAfterSort?.length)return;if(f&&this.dropGroupThrottled&&!z.expanded&&z.isExpandable?.())z.setExpanded(!0,void 0,!0);if(this.canDropInTarget(z,_))this.dropGroupThrottled=!0,this.dropGroupTarget=z}canDropInTarget(_,f){if(_.expanded)return!0;if(!_.group)return!1;if(f.pointerPos==="inside")return!0;if(f.treeData)return!1;let $=f.rows,z=_.level;for(let Q=0,J=$.length;Q{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},f)}resetDragGroup(){if(this.dropGroupTimer!==null)window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null;this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(_){if(_)this.draggingGroups=null;this.resetDragGroup()}shouldDropTargetBeParent({target:_,rows:f,pointerPos:$,treeData:z}){if(!_||$==="none")return!1;if($==="inside")return!0;if(!z&&_.group&&!_.expanded)return!0;if($==="above")return!1;let Q=this.beans.rowModel,q=_.rowIndex+1,X;do X=Q.getRow(q++);while(X?.footer);let Y=this.draggingGroups?.get(_)??_.childrenAfterGroup;if(X&&X.parent===_&&Y?.length){let Z=new Set(f);for(let G=0,E=Y.length;G{if(Z.has(F))return;if(Z.add(F),U??(U=this.newGroupValues(J)),this.setRowGroup(F,U))E.add(F)},W=(F)=>{let D=this.draggingGroups?.get(F)??F.childrenAfterGroup,M=D?.length;if(M)for(let k=0;k=0)H(R);else W(R)}};for(let F of _.rows)if(F.group)W(F);else{let D=F.sourceRowIndex>=0&&!F.destroyed?F:this.csrmFirstLeaf(F);if(D)H(D)}let B=$==="inside"?"above":$,K=$==="inside"?this.findFirstLeafForParent(J,Z)??z:z,L=!1;if(Z.size&&B!=="none")L=wX(Q._leafs,Z,K,B==="above");if(!E.size&&!L)return!1;G.reordered=L;for(let F of Z)G.updates.add(F);if(this.csrmRefresh(G),Y)Y.focusCell();else q.clearFocusedCell();return!0}canStartGroup(_,f){if(!_||_.level<0||_.footer||_.detail)return!1;if(_.group)return!0;return f}flushGroupEdits(){let _=this.pendingEditRefresh;if(_)this.pendingEditRefresh=null,this.csrmRefresh(_)}csrmRefresh(_){let f=this.beans.rowModel;if(!f.rootNode)return;f.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:_})}newGroupValues(_){let f=this.beans.rowGroupColsSvc?.columns??[],$=Array(f.length),z=-1,Q=_;while(Q&&Q.level>=0){let J=f[Q.level];if(J){let q=J.getColId(),X=Q.level;if($[X]=Q.groupData?.[q]??Q.key??void 0,X>z)z=X}Q=Q.parent}return{values:$,columns:f,maxLevel:z}}setRowGroup(_,{values:f,columns:$,maxLevel:z}){if(z<0)return!1;let{valueSvc:Q,changeDetectionSvc:J}=this.beans,q=!1;J?.beginDeferred();try{for(let X=0;X<$.length;++X){let Y=$[X];if(!Y||X>z)continue;let Z=f[X],G=Q.getValue(Y,_,"data");if(G===Z||G==null&&Z==null)continue;let E=Z,U=Q.parseValue(Y,_,Z,G);if(U!==void 0)E=U;if(_.setDataValue(Y,E,"rowDrag"))q=!0}}finally{J?.endDeferred()}return q}onCsrmCellChange(_){let{column:f,node:$,source:z}=_;if(!this.gos.get("refreshAfterGroupEdit"))return;if(z==="rowDrag")return;if(!f?.isRowGroupActive())return;if($.group||!$.data)return;if(this.beans.editSvc?.isBatchEditing()){let J=this.pendingEditRefresh;if(!J)J=DY(),this.pendingEditRefresh=J;J.updates.add($)}else{let J=DY();J.updates.add($),this.csrmRefresh(J)}}csrmFirstLeaf(_){if(!_)return null;let f=this.draggingGroups,$=f?.get(_)??_.childrenAfterGroup;while($?.length){let z=$[0];if(z.sourceRowIndex>=0){if(!z.destroyed)return z;return this.firstAliveChildLeaf(z)}$=f?.get(z)??z.childrenAfterGroup}return _1(_)}firstAliveChildLeaf(_){let f=this.draggingGroups?.get(_)??_.childrenAfterGroup;if(f){for(let $ of f)if($.sourceRowIndex>=0&&!$.destroyed)return $}return null}findFirstLeafForParent(_,f){if(!_)return null;let $=this.draggingGroups?.get(_)??_?.childrenAfterGroup;if(!$)return null;for(let z=0,Q=$.length;z=0&&!f.has(J))return J;let q=this.findFirstLeafForParent(J,f);if(q!==null)return q}return null}},DY=()=>{let _=new R1;return _.reordered=!0,_},MY=(_,f)=>{if(!_||!f)return!1;let $=f;while($){if($===_)return!0;$=$.parent}return!1},sj=(_,f)=>{if(!f||_.parent===f)return!1;let $=f,z=_.id;while($){if($===_)return!0;if(z!=null&&$.id===z)return!0;$=$.parent}return!1},aj=(_,f)=>{for(let $=0,z=_.length;$this.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.columnsInvalidated=!0,this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(_){return this.strategy?.nonLeafsById?.get(_)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(_){let f=this.gos,$=this.strategy?.nestedDataGetter;if(_.has("treeData"))this.gosTreeData=f.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0;return this.strategy?.onPropChange?.(_),this.getNestedDataGetter()!==$}extractData(){let _=this.beans.rowModel.rootNode,f=this.nested?_?.childrenAfterGroup:_?._leafs;if(!f)return this.gos.get("rowData")??[];let $=f.length,z=Array($),Q=0;for(let J=0;J<$;++J){let q=f[J].data;if(q!=null)z[Q++]=q}return z.length=Q,z}execute(_){let f=this.beans,$=f.rowModel,z=$.rootNode;if(!z)return!1;let Q=this.getStrategy(),J=!!Q?.nestedDataGetter,q=this.needReset;if(this.nested=J,q)this.needReset=!1,f.rowDragSvc?.cancelRowDrag(),_.animate=!1,_V(z,!J,f);if(!Q){$.hierarchical=!1;return}return $.hierarchical=!0,f.changedPathFactory?.ensureRowsPath(_,z),Q.execute(z,_)||q}loadLeafs(_){return _.footer?ej(_):yQ(_)}loadGroupData(_){let f=this.getStrategy();if(f)return f.loadGroupData(_);return _._groupData=null,null}clearNonLeafs(){this.strategy?.clearNonLeafs()}getWantedStrategyType(){if(this.isAlive()){if(this.gosTreeData)return"tree";if(this.hasRowGrouping&&(this.beans.rowGroupColsSvc?.columns?.length||this.pivotMode))return"group"}return"none"}getStrategy(){let _=this.strategy,f=this.beans.colModel.isPivotMode();if(f!==this.pivotMode)this.pivotMode=f,this.columnsInvalidated=!0;if(_!==void 0&&!this.columnsInvalidated&&this.isAlive())return _;this.columnsInvalidated=!1;let $=this.getWantedStrategyType();if($===this.strategyType){if(_!==void 0)return _;return this.strategy=null,null}if(_)this.strategy=this.destroyBean(_),this.needReset=!0;if(this.strategyType=$,this.treeData=$==="tree",this.grouping=$==="group",$==="none")return this.strategy=null,null;let z=$==="tree"?"treeGroupStrategy":"groupStrategy";return _=this.beans.registry.createDynamicBean(z,!1)??null,this.strategy=_&&this.createBean(_),_}},ej=(_)=>{let f=_.sibling;if(!f)return null;let $=f._leafs;if($!==void 0)return $;return yQ(f)},yQ=(_)=>{let f=_.childrenAfterGroup,$=f?.length;if(_._leafs=null,!$)return null;let z,Q=$===1?f[0]:null;if(Q?.group&&Q.sourceRowIndex<0){if(z=Q._leafs,z===void 0)z=yQ(Q)}else if(_.leafGroup)z=f;else{z=[];for(let J=0;J<$;++J){let q=f[J];if(q.sourceRowIndex>=0)z.push(q);if(!q.group)continue;let X=q._leafs;if(X===void 0)X=yQ(q);if(X)for(let Y=0,Z=X.length;Y{let{_leafs:z,sibling:Q}=_;if(_.treeNodeFlags=0,_.childrenAfterGroup=z,_.childrenMapped=null,_._groupData=void 0,_.aggData=null,Q)Q.childrenAfterGroup=_.childrenAfterGroup,Q.childrenAfterAggFilter=_.childrenAfterAggFilter,Q.childrenAfterFilter=_.childrenAfterFilter,Q.childrenAfterSort=_.childrenAfterSort,Q.childrenMapped=null,Q._groupData=void 0,Q.aggData=null;for(let J=0,q=z.length??0;J{_.key=null,_.treeNodeFlags=0,_.allChildrenCount=null,_.childrenAfterGroup=null,_.childrenAfterAggFilter=null,_.childrenAfterFilter=null,_.childrenAfterSort=null,_.childrenMapped=null,_.level=0,_._groupData=void 0};function SY(_,f,$){let z=_,Q=z.level-f.level;if(Q<=0)return!1;if(!$.get("groupHideOpenParents"))return!1;for(let q=0;q{let{rowDragSvc:f}=this.beans;if(!this.params.rowDrag||!f)return;let $=f.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean($),this.eGui.insertAdjacentElement("afterbegin",$.getGui())};this.setupExpand(),_(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){let _=this.params.colDef?.cellAriaRole,f=this.params.column?.getColDef().cellAriaRole;return _||f||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;let{visibleCols:_}=this.beans,f=this.params.pinned==="left",$=this.params.pinned==="right",z=!f&&!$;if(this.gos.get("enableRtl")){if(_.isPinningLeft())return!$;return!z}if(_.isPinningLeft())return!f;return!z}addGroupValue(){let{params:{value:_,valueFormatted:f}}=this,$=this.getInnerCompDetails();this.comp.setInnerRenderer($,f??_??null)}setupExpand(){let{colModel:_}=this.beans,{eGridCell:f,suppressDoubleClickExpand:$}=this.params,z=(Y,Z)=>{let G=h(Y,this.beans,null);if(G)Z.appendChild(G),this.addDestroyFunc(()=>G.remove())};z("groupExpanded",this.eExpanded),z("groupContracted",this.eContracted);let Q=this.comp,J=()=>{if(!this.isExpandable())return;let Z=!!this.displayedNode.expanded;Q.setExpandedDisplayed(Z),Q.setContractedDisplayed(!Z),N_(f,Z)},q=()=>{let Y=this.isExpandable();Q.toggleCss("ag-cell-expandable",Y),Q.toggleCss("ag-row-group",Y);let Z=!Y&&_.isPivotMode();Q.toggleCss("ag-pivot-leaf-group",Z);let G=!_.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);Q.toggleCss("ag-row-group-leaf-indent",!Y&&G);let E=this.getChildCount(),U=E>0?`(${E})`:"";if(Q.setChildCount(U),!Y)Q.setExpandedDisplayed(!1),Q.setContractedDisplayed(!1),o9(f);else J()};(()=>{if(!$&&!this.isGroupCellEditable(this.displayedNode))this.addManagedListeners(f,{dblclick:this.onCellDblClicked.bind(this)});this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(f,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:q,masterChanged:q,groupChanged:q,hasChildrenChanged:q,expandedChanged:J})})(),q()}getInnerCompDetails(){let{userCompFactory:_,findSvc:f}=this.beans,$=this.params;if($.fullWidth){let Y=this.gos.get("groupRowRendererParams"),Z=R$(_,Y,$);if(Z)return Z;if(f?.isMatch($.node,null))return R$(_,{...Y,innerRenderer:"agFindCellRenderer"},$);return}let z=(Y)=>Y&&Y.componentClass==this.compClass,Q=R$(_,$,$);if(Q&&!z(Q))return Q;let{displayedNode:{rowGroupColumn:J}}=this,q=J?.colDef,X=J&&$.column?.isRowGroupDisplayed(J.getId());if(q&&X){let Y=U$(_,q,$);if(Y)if(z(Y)){if(q?.cellRendererParams?.innerRenderer)return R$(_,q.cellRendererParams,$)}else return Y}if(f?.isMatch($.node,$.column))return U$(_,{...q??$.colDef,cellRenderer:"agFindCellRenderer"},$)}getChildCount(){let{column:_,suppressCount:f}=this.params;if(f)return 0;let{allChildrenCount:$,rowGroupColumn:z}=this.displayedNode;if(!(($??0)>0&&(!z||!_||_?.isRowGroupDisplayed(z.getId()))))return 0;if(this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!SY(this.node,this.displayedNode,this.gos))return 0;return $??0}isExpandable(){let{node:_,column:f,colDef:$}=this.params;if(!this.displayedNode.isExpandable())return!1;if(_.rowPinned)return!1;if(!f)return!0;if(_.hasChildren()&&$){let{showRowGroup:J}=$;if(!J)return!1;if(J===!0)return!0}if(_===this.displayedNode){if(_.rowGroupColumn){if(f?.isRowGroupDisplayed(_.rowGroupColumn.getId()))return!0}if(_.master)return $?.showRowGroup===!0||$?.showRowGroup==null;return!1}return SY(this.node,this.displayedNode,this.gos)}setupIndent(){let{suppressPadding:_,node:f,colDef:$}=this.params;if(_)return;let z=()=>{let Q=f.uiLevel;if($&&$.showRowGroup!==!0)Q=0;let J="ag-row-group-indent-"+Q;if(J===this.indentClass)return;if(this.indentClass)this.comp.toggleCss(this.indentClass,!1);this.indentClass=J,this.comp.toggleCss(J,!0),this.eGui.style.setProperty("--ag-indentation-level",String(Q))};this.addManagedListeners(f,{uiLevelChanged:z.bind(this)}),z()}setupCheckbox(){let{node:_}=this.params;if(!(!_.footer&&!_.rowPinned&&!_.detail))return;this.addManagedPropertyListener("rowSelection",({currentValue:$,previousValue:z})=>{let Q=typeof $==="object"?$:void 0,J=typeof z==="object"?z:void 0;if(Q?.checkboxLocation!==J?.checkboxLocation)this.destroyCheckbox(),this.addCheckbox()}),this.addCheckbox()}addCheckbox(){let{selectionSvc:_}=this.beans;if(!_||!p0(this.gos))return;let{node:f,column:$}=this.params,z=this.gos.get("rowSelection"),Q=V1(z);if(Q==="selectionColumn")return;if(Q==="autoGroupColumn"){let Z=$?.getColDef().showRowGroup!=null,G=!$&&f.group;if(!(Z||G))return}let J=typeof z==="object"?Zf(z):this.params.checkbox;if(!(typeof J==="function"||J===!0))return;if(typeof $?.getColDef().showRowGroup==="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}let Y=_.createCheckboxSelectionComponent();this.cbComp=Y,this.createBean(Y),Y.init({rowNode:f,column:$,overrides:{isVisible:J,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(Y.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}isGroupCellEditable(_){let f=this.params.column;return!!f&&(!!f.getColDef().groupRowEditable||this.gos.get("enableGroupEdit"))&&f.isCellEditable(_)}onExpandClicked(_){if(z0(_))return;n_(_),this.onExpandOrContract(_)}onKeyDown(_){if(_.key!==S.ENTER||this.params.suppressEnterExpand)return;if(this.isGroupCellEditable(this.params.node))return;this.onExpandOrContract(_)}onCellDblClicked(_){if(z0(_))return;if(!(iz(this.eExpanded,_)||iz(this.eContracted,_)))this.onExpandOrContract(_)}onExpandOrContract(_){if(!this.isExpandable())return;let f=this.displayedNode,$=!f.expanded;if(!$&&f.sticky)this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(f.rowTop-f.stickyRowTop);f.setExpanded($,_)}destroy(){super.destroy(),this.destroyCheckbox()}},fV={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},AY=class extends w{constructor(){super(fV);this.eExpanded=V,this.eContracted=V,this.eCheckbox=V,this.eValue=V,this.eChildCount=V}init(_){let f={setInnerRenderer:(J,q)=>this.setRenderDetails(J,q),setChildCount:(J)=>this.eChildCount.textContent=J,toggleCss:(J,q)=>this.toggleCss(J,q),setContractedDisplayed:(J)=>N(this.eContracted,J),setExpandedDisplayed:(J)=>N(this.eExpanded,J),setCheckboxVisible:(J)=>this.eCheckbox.classList.toggle("ag-invisible",!J),setCheckboxSpacing:(J)=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",J)},$=this.createManagedBean(new CZ),z=!_.colDef,Q=this.getGui();if($.init(f,Q,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,_),z)Z_(Q,$.getCellAriaRole())}setRenderDetails(_,f){if(_)_.newAgStackInstance().then(($)=>{if(!$)return;let z=()=>this.destroyBean($);if(this.isAlive())this.eValue.appendChild($.getGui()),this.addDestroyFunc(z);else z()});else this.eValue.innerText=f}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},$V=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}",zV=class extends A{constructor(){super(...arguments);this.beanName="showRowGroupColValueSvc"}getGroupValue(_,f,$){if(!f){if(!_.group)return null;return{displayedNode:_,value:_.groupValue}}let z=this.beans.valueSvc,Q=f.colDef.showRowGroup;if(!Q)return null;if(_.level===-1&&_.footer)return{displayedNode:_,value:null};if(typeof Q==="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex(Q)??-1)>_.level)return null;let X=this.getDisplayedNode(_,f,!0);if(X)return{displayedNode:X,value:z.getValue(f,X,"data",$)}}let J=z.getValue(f,_,"data",$);if(J==null){let q=this.getDisplayedNode(_,f);if(q)return{displayedNode:q,value:z.getValue(f,q,"data",$)}}return{displayedNode:_,value:J}}formatAndPrefixGroupColValue(_,f,$=!1){let z=this.formatGroupColValue(_,f,$),{value:Q,displayedNode:J}=_,q=this.beans.footerSvc;if(q?.doesCellShowTotalPrefix(J,f))return q.applyTotalPrefix(Q,z,J,f);if(J.footer&&J.level===-1)return null;return z}formatGroupColValue(_,f,$=!1){let z=this.beans.valueSvc,{displayedNode:Q,value:J}=_,q=Q.rowGroupColumn,X=Q.group&&!f;if(q&&(X||f?.isRowGroupDisplayed(q.colId))){if($&&q.colDef.useValueFormatterForExport===!1)return null;let Z=z.formatValue(q,Q,J);if(Z==null&&Q.key==="")return this.getLocaleTextFunc()("blanks","(Blanks)");return Z}if(!f||Q.group)return null;if($&&f.colDef.useValueFormatterForExport===!1)return null;return z.formatValue(f,Q,J)}getDisplayedNode(_,f,$=!1){let z=this.gos,Q=z.get("groupHideOpenParents"),J=z.get("showOpenedGroup")&&!$;if(!Q&&!J)return;let q=f.colDef.showRowGroup;if(q===!0){if(_.group)return;return _.parent??void 0}let X=_;while(X&&X.rowGroupColumn?.getId()!=q){let Y=X===X.parent?.getFirstChild();if(!J&&!Y)return;X=X.parent}if(X===_)return;return X??void 0}},QV=class extends A{constructor(){super(...arguments);this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){let{colModel:_,rowGroupColsSvc:f}=this.beans,$=this.columns,z=this.colsSet,Q=this.colsMap;Q.clear();let J=$.length,q=0,X=!1,Y=_.getCols();for(let Z=0,G=Y.length;Z=J||!z.has(E)),$[q++]=E}if(X||(X=q!==J),X){$.length=q,z.clear();for(let Z=0;Z{this.gridBodyCtrl=_.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(_){if(this.extraTopHeight===_)return;this.extraTopHeight=_,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:_})}setOffsetBottom(_){if(this.extraBottomHeight===_)return;this.extraBottomHeight=_}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(_){return this.isClientSide?XV(_):qV(_)}getFirstPixelOfGroup(_){if(_.footer)return _.sibling.rowTop+_.sibling.rowHeight-1;if(_.hasChildren())return _.rowTop-1;return 0}updateStickyRows(_){let f=_==="top",$=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(_,new Set,$);let z=new Set,{rowModel:Q,rowRenderer:J,pinnedRowModel:q,pageBounds:X,rowContainerHeight:Y}=this.beans,{pageFirstPixel:Z,pageLastPixel:G}=X.getCurrentPagePixelRange(),E=f?J.firstVisibleVPixel-this.extraTopHeight:J.lastVisibleVPixel-this.extraTopHeight,U=Y.divStretchOffset??0,H=Z+U,W=G+U,B=(D)=>{if(z.add(D),f){let M=this.getLastPixelOfGroup(D),k=E+$+D.rowHeight;if(Mk)D.stickyRowTop=$-(M-k);else D.stickyRowTop=$}$=0,z.forEach((M)=>{let k=M.stickyRowTop+M.rowHeight;if(${if(!D.displayed)return!1;if(D.footer){if(K===!0)return!1;if(K==="grand"&&D.level===-1)return!1;if(K==="group"&&D.level>-1)return!1;let M=D.sibling.rowIndex?D.sibling.rowIndex+1===D.rowIndex:!1;if(_==="bottom"&&M)return!1;if(D.level===-1&&q?.getGrandTotalPinned())return!1;return!z.has(D)}if(D.isExpandable()){if(L===!0)return!1;if(_==="bottom")return!1;return!z.has(D)&&!!D.expanded}return!1};for(let D=0;D<100;D++){let M=E+$;if(!f)M=E-$;if(f&&MW)M=W;let k=Q.getRowIndexAtPixel(M),R=Q.getRow(k);if(R==null)break;let I=this.getStickyAncestors(R).find((y)=>(f?y.rowIndexk)&&F(y));if(I){B(I);continue}if((f?R.rowTopM)&&F(R)){B(R);continue}break}if(!f)z.forEach((D)=>{D.stickyRowTop=$-(D.stickyRowTop+D.rowHeight)});return this.refreshNodesAndContainerHeight(_,z,$)}areFooterRowsStickySuppressed(){let _=this.gos.get("suppressStickyTotalRow");if(_===!0)return!0;let f=_==="group",$=_==="grand";if(f&&$)return!0;if($)return"grand";if(f)return"group";return!1}canRowsBeSticky(){let _=y1(this.gos),f=this.areFooterRowsStickySuppressed(),$=this.gos.get("suppressGroupRowsSticky");return _&&(!f||!$)}getStickyAncestors(_){let f=[],$=_.footer?_.sibling:_.parent;while($){if($.sibling)f.push($.sibling);f.push($),$=$.parent}return f.reverse()}checkStickyRows(){let _=this.updateStickyRows("top"),f=this.updateStickyRows("bottom");return _||f}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(_){let f=new Set;if(this.stickyTopRowCtrls.some(($)=>$.rowNode===_)){for(let $=0;${if(X.has(H))return;H.sticky=!0,Y.push(this.createRowCon(H,!1,!1))});let Z=!!Y.length||q.length!==Q.length;if(z){if(this.topContainerHeight!==$)this.topContainerHeight=$,this.gridBodyCtrl.setStickyTopHeight($),Z=!0}else if(this.bottomContainerHeight!==$)this.bottomContainerHeight=$,this.gridBodyCtrl.setStickyBottomHeight($),Z=!0;this.destroyRowCtrls(J,!1);let G=[...q,...Y];if(G.sort((H,W)=>W.rowNode.rowIndex-H.rowNode.rowIndex),!z)G.reverse();for(let H of G)H.setRowTop(H.rowNode.stickyRowTop);let E=this.beans.pageBounds,U=0;if(z){for(let H of f)if(H.rowIndexthis.topContainerHeight)U=this.topContainerHeight;this.setOffsetTop(U)}else{for(let H of f)if(H.rowIndex>E.getLastRow())U+=H.rowHeight;if(U>this.bottomContainerHeight)U=this.bottomContainerHeight;this.setOffsetBottom(U)}if(!Z)return!1;if(z)this.stickyTopRowCtrls=G;else this.stickyBottomRowCtrls=G;return!0}ensureRowHeightsValid(){let _=!1,f=($)=>{let z=$.rowNode;if(z.rowHeightEstimated){let Q=Y$(this.beans,z);z.setRowHeight(Q.height),_=!0}};return this.stickyTopRowCtrls.forEach(f),this.stickyBottomRowCtrls.forEach(f),_}};function qV(_){if(_.isExpandable()||_.footer){if(_.master&&_.detailNode)return _.detailNode.rowTop+_.detailNode.rowHeight;if(!_.sibling||Math.abs(_.sibling.rowIndex-_.rowIndex)===1){let $=_.childStore?.getStoreBounds();if(_.footer)$=_.sibling.childStore?.getStoreBounds();return($?.heightPx??0)+($?.topPx??0)}if(_.footer)return _.rowTop+_.rowHeight;return _.sibling.rowTop+_.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function XV(_){if(_.isExpandable()||_.footer){if(_.footer&&_.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!_.sibling||Math.abs(_.sibling.rowIndex-_.rowIndex)===1){let z=_.footer?_.sibling:_;while(z.isExpandable()&&z.expanded)if(z.master&&z.detailNode)z=z.detailNode;else if(z.childrenAfterSort){if(z.childrenAfterSort.length===0)break;z=b(z.childrenAfterSort)}return z.rowTop+z.rowHeight}if(_.footer)return _.rowTop+_.rowHeight;return _.sibling.rowTop+_.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var YV=class extends A{constructor(){super(...arguments);this.beanName="stickyRowSvc"}createStickyRowFeature(_,f,$){let z=this.gos;if(y1(z)&&o(z)||Kf(z))return _.createManagedBean(new JV(f,$));return}},wZ={moduleName:"GroupCellRenderer",version:$_,userComponents:{agGroupRowRenderer:AY,agGroupCellRenderer:AY},dynamicBeans:{groupCellRendererCtrl:CZ},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[$V],dependsOn:[y_]},ZV={moduleName:"GroupColumn",version:$_,beans:[Nj,QV,zV,xj,yZ,TZ],dependsOn:[y_,wZ]},xZ={moduleName:"ChangedPath",version:$_,beans:[ij],dependsOn:[y_]},wQ={moduleName:"ClientSideRowModelHierarchy",version:$_,rowModels:["clientSide"],beans:[oj,rj,cj],dependsOn:[y_,xZ]},NZ={moduleName:"StickyRow",version:$_,beans:[YV]},GV={moduleName:"GroupEdit",version:$_,beans:[lj],dependsOn:[y_,wQ]},EV=({valueSvc:_,dataTypeSvc:f},$,z)=>{let Q=_.getValue($,z,"data"),J=null;if(Q instanceof Date)J=Q;else if(typeof Q==="string")J=(f?.getDateParserFunction($)??H$)(Q)??null;return J},Sf=(_,f,$,z)=>(Q)=>{let J=EV(_,f,Q.node),q=K1(J);if(!q)return null;return z?.(q[$])??q[$]},Af=({colNames:_},f,$)=>(z)=>{let Q=_.getDisplayNameForColumn(f,z.location);if(Q)return`${Q} (${$})`;return""},UV=Object.fromEntries(gJ.map((_)=>[_,_.toLowerCase()])),HV=(_)=>{let f=gJ[Number.parseInt(_,10)-1]??_,$=UV[f]??_;return{month:f,localeKey:$}};function RY(_){return _.groupHierarchy??_.rowGroupingHierarchy}var WV=class extends A{constructor(){super(...arguments);this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(_){let f=this.columns;if(f==null)return;_.list=f.list.filter(($)=>!_.list.some((z)=>z.getColId()===$.getColId())).concat(_.list),_.tree=f.tree.filter(($)=>!_.tree.some((z)=>z.getId()===$.getId())).concat(_.tree),A$(_)}createColumns(_){let f=new WeakMap,$=new WeakMap,z=this.createGroupHierarchyColumns(_,f,$);if(S$(z,this.columns?.list??[]))return;J0(this.beans,this.columns?.tree),this.columns=null;let{colGroupSvc:J}=this.beans,q=J?.findDepth(_.tree)??0,X=J?.balanceTreeForAutoCols(z,q)??[];this.columns={list:z,tree:X,treeDepth:q,map:{}},this.sourceColumnMap=f,this.inverseColumnMap=$}updateColumns(_){}getColumn(_){return this.columns?.list.find((f)=>b0(f,_))??null}getColumns(){return this.columns?.list??null}expandColumnInto(_,f){let $=this.getVirtualColumnsForColumn(f).concat(f);for(let z of $)if(!_.some((Q)=>b0(Q,z)||Q.getColId()===z.getColId()))_.push(z)}compareVirtualColumns(_,f){let $=this.inverseColumnMap.get(_),z=this.inverseColumnMap.get(f);if($&&$===z){let Q=this.sourceColumnMap.get($)??[];return Q?.indexOf(_)-Q?.indexOf(f)}if(this.sourceColumnMap.get(_)?.includes(f))return 1;if(this.sourceColumnMap.get(f)?.includes(_))return-1;return null}insertVirtualColumnsForCol(_,f){let $=this.getVirtualColumnsForColumn(f);if(!$)return[];let z=_.indexOf(f);if(z<0)z=_.length-1;return K$(_,$),_.splice(z,0,...$),$}getVirtualColumnsForColumn(_){if(this.isGroupHierarchyColsEnabledForCol(_))return this.sourceColumnMap.get(_)??[];return[]}isGroupHierarchyColsEnabled(_){return _.list.some((f)=>this.isGroupHierarchyColsEnabledForCol(f))}isGroupHierarchyColsEnabledForCol(_){let f=_.getColDef();return!!(RY(f)&&(f.rowGroup||f.enableRowGroup||f.rowGroupIndex!=null||f.pivot||f.enablePivot||f.pivotIndex!=null))}createGroupHierarchyColDefs(_){let f=[],$=_.getColDef(),z=RY($);if(!z)return f;if(!this.isGroupHierarchyColsEnabledForCol(_))return f;for(let Q of z){let J=null;if(typeof Q==="string")J=this.createColDefForPart(Q,_,$);else J=Q;if(J)f.push(J)}return f}createGroupHierarchyColumns(_,f,$){if(!this.isGroupHierarchyColsEnabled(_))return[];let z=[];for(let Q of _.list)for(let J of this.createGroupHierarchyColDefs(Q)){let q=J.colId;this.gos.validateColDef(J,q,!0);let X=new Z0(J,null,q,!0);this.createBean(X),z.push(X),BV(f,Q,X),$.set(X,Q)}return z}createColDefForPart(_,f,$){let{beans:z,gos:Q}=this,J=`${dq}-${f.getColId()}-${_}`,q={enableRowGroup:$.enableRowGroup,rowGroup:$.rowGroup,enablePivot:$.enablePivot,hide:!0,editable:!1},X=Q.get("groupHierarchyConfig")??{};if(_ in X){let E={...q,...X[_]};return E.colId??(E.colId=J),n0(z,E,E.colId,!0)}let Y=n0(z,{colId:J,...q},J,!0),Z=this.getLocaleTextFunc(),G=(E,U)=>Z?.(E,U)??U;switch(_){case"year":return{...Y,headerValueGetter:Af(z,f,G(_,"Year")),valueGetter:Sf(z,f,0)};case"quarter":return{...Y,headerValueGetter:Af(z,f,G(_,"Quarter")),valueGetter:Sf(z,f,1,(E)=>(Math.floor(Number(E)/4)+1).toString())};case"month":return{...Y,headerValueGetter:Af(z,f,G(_,"Month")),valueGetter:Sf(z,f,1)};case"formattedMonth":return{...Y,headerValueGetter:Af(z,f,G("month","Month")),valueGetter:Sf(z,f,1,(E)=>{let U=HV(E);return G(U.localeKey,U.month)})};case"day":return{...Y,headerValueGetter:Af(z,f,G(_,"Day")),valueGetter:Sf(z,f,2)};case"hour":return{...Y,headerValueGetter:Af(z,f,G(_,"Hour")),valueGetter:Sf(z,f,3)};case"minute":return{...Y,headerValueGetter:Af(z,f,G(_,"Minute")),valueGetter:Sf(z,f,4)};case"second":return{...Y,headerValueGetter:Af(z,f,G(_,"Second")),valueGetter:Sf(z,f,5)};default:return null}}};function BV(_,f,$){let z=_.get(f);_.set(f,(z??[]).concat($))}var KV={moduleName:"GroupHierarchy",version:$_,beans:[WV],dependsOn:[xZ]};var LV=(_,f)=>{if(!_){f.length=0;return}let $=_.length;f.length=$;for(let z=0;z<$;z++){let Q=_[z],J=Q.getColDef();f[z]={col:Q,field:J.field,type:J.type,keyCreator:J.keyCreator,valueGetter:J.valueGetter}}},FV=(_,f)=>{let $=_.length;if($!==f?.length)return!0;for(let z=0;z<$;z++){let Q=_[z],J=f[z];if(Q.col!==J)return!0;let q=J.getColDef();if(Q.field!==q.field||Q.type!==q.type||Q.valueGetter!==q.valueGetter||Q.keyCreator!==q.keyCreator)return!0}return!1};function DV(_){if(!_)return!1;let f=_.length;if(f<2)return!1;let $=!1;for(let z=1;z0){$=!0;break}if(!$)return!1;return _.sort(jY),!0}function jY(_,f){let $=_.sourceRowIndex,z=f.sourceRowIndex,Q=$>=0,J=z>=0,q=Q&&J,X=!Q&&!J;if(q)return $-z;if(X)return _.__objectId-f.__objectId;if(Q)return 1;return-1}var MV=class extends A{constructor(){super(...arguments);this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){let _=this.nonLeafsById;for(let f of _.values())f._destroy(!1);_.clear()}loadGroupData(_){if(!_.group)return _._groupData=null,null;let f=_.rowGroupColumn,{valueSvc:$,showRowGroupCols:z}=this.beans,Q={};if(_._groupData=Q,!f)return Q;let J=_1(_),q=f.getId();if(!z)return Q;let X=z.columns;for(let Y=0,Z=X.length;Y{let z=$.childrenAfterGroup,Q=z?.length;if(!Q)return;let J=Array(Q),q=0,X=!1,Y;for(let Z=0;Z1)}}if(Q.size)for(let Y of Q){this.insertOneNode(_,Y);let Z=Y.parent;f?.addRow(Z),J||(J=(Z?.childrenAfterGroup?.length??0)>1)}if(X.size)VY(X),this.removeEmptyGroups(X,q);if(J)this.sortChildren(_,f)}sortChildren(_,f){R_(_,!0,void 0,($)=>{if(DV($.childrenAfterGroup))f?.addRow($)})}orderGroups(_){let f=this.gos.getCallback("initialGroupOrderComparator");if(!f)return;let $=this.beans,z=$.gridApi,Q=$.gridOptions.context,J=(X,Y)=>f({api:z,context:Q,nodeA:X,nodeB:Y}),q=(X)=>{let Y=X.childrenAfterGroup,Z=Y?.length;if(!Z||X.leafGroup)return;if(Z>1)Y.sort(J);for(let G=0,E=Z;G=0;--X){let{col:Y}=q[X],Z=$.getKeyForNode(Y,f);if(Z==null||Z===""){if(!z)continue;Z=""}if(!Q?.parent||Q.key!==Z){J=!0;break}Q=Q.parent}if(J||(J=!!Q?.parent),!J)return!1;return this.removeFromParent(f),this.insertOneNode(_,f),f.setData(f.data),!0}groupShouldBeRemoved(_){let f=this.getChildrenMappedKey(_.key,_.rowGroupColumn),$=_.parent?.childrenMapped;if($?!$[f]:!0)return!1;return!!_.group&&(_.childrenAfterGroup?.length??0)===0}removeEmptyGroups(_,f){let $=this.beans.selectionSvc,z,Q=Array.from(_),J=this.nonLeafsById;do{_.clear();for(let q=0;q=X-1,B=this.createGroup($,Z,E,H,W,f);this.addToParent(B,$),$=B}if(!$.group)j(184,{parentGroupData:$.data,childNodeData:f.data});f.parent=$,f.level=$.level+1,$.childrenAfterGroup.push(f),$.updateHasChildren(),AQ($)}createGroup(_,f,$,z,Q,J){let q=f.col,X=(_.level>=0?_.id+"-":"row-group-")+(q.getColId()+"-"+$),Y=this.nonLeafsById,Z=Y.get(X),G=!0;if(Z){if(Z.childrenAfterGroup!==null)return Z._expanded??(Z._expanded=null),Z;G=!1,AQ(Z)}else Z=new Df(this.beans),Z.group=!0,Z.key=$,Z.id=X,Z.aggData=null,Y.set(X,Z);let E=(B)=>{B.childrenAfterGroup=U,B.childrenMapped=H,B.parent=_,B.level=z,B.rowGroupIndex=z,B.leafGroup=Q},U=[],H={};if(E(Z),Z.field=f.field??null,Z.rowGroupColumn=q,Z.groupValue=this.beans.valueSvc.getValue(q,J,"data"),Z._expanded??(Z._expanded=null),G)return Z.setAllChildrenCount(0),Z.updateHasChildren(),Z;let W=Z.sibling;if(W)E(W);return Z.dispatchRowEvent("hasChildrenChanged"),Z}getChildrenMappedKey(_,f){return f?f.getId()+"-"+_:_}onShowRowGroupColsSetChanged(){let{rowModel:_,valueSvc:f}=this.beans;for(let z of this.nonLeafsById.values()){z._groupData=void 0;let Q=z.rowGroupColumn,J=Q&&_1(z);z.groupValue=J&&f.getValue(Q,J,"data")}let $=_.rootNode?._leafs;if($)for(let z=0,Q=$.length;z{for(let f of _){let $=f?.childrenAfterGroup;if(!$)continue;let z=$.length,Q=0;for(let J=0;J{while(_._leafs!==void 0){let f=_.parent;if(!f)break;_._leafs=void 0,_=f}};function kV(_,f){_.rowGroupColsSvc?.setColumns(f,"api")}function SV(_,f){_.rowGroupColsSvc?.removeColumns(f,"api")}function AV(_,f){_.rowGroupColsSvc?.addColumns(f,"api")}function RV(_,f,$){_.rowGroupColsSvc?.moveColumn?.(f,$,"api")}function jV(_){return _.rowGroupColsSvc?.columns??[]}var gZ={moduleName:"SharedRowGrouping",version:$_,apiFunctions:{setRowGroupColumns:kV,removeRowGroupColumns:SV,addRowGroupColumns:AV,getRowGroupColumns:jV,moveRowGroupColumn:RV},dependsOn:[y_,IZ,ZV,NZ,KV]},VV={moduleName:"RowGrouping",version:$_,dynamicBeans:{groupStrategy:MV},rowModels:["clientSide"],dependsOn:[gZ,wj,wQ,GV]};function OV(_,f){_.clipboardSvc?.copyToClipboard(f)}function PV(_,f){_.clipboardSvc?.cutToClipboard(f)}function vV(_,f){_.clipboardSvc?.copySelectedRowsToClipboard(f)}function TV(_,f){_.clipboardSvc?.copySelectedRangeToClipboard(f)}function IV(_){_.clipboardSvc?.copyRangeDown()}function yV(_){_.clipboardSvc?.pasteFromClipboard()}var FQ="paste",W2="dragCopy",B2="clipboard";function bV(_,f=","){let $=[],z=(J)=>J==="\r"||J===` -`,Q=!1;if(_==="")return[[""]];for(let J=0,q=0,X=0;X<_.length;X++){let Y=_[X-1],Z=_[X],G=_[X+1],E=()=>{if(!$[J])$[J]=[];if(!$[J][q])$[J][q]=""};if(E(),Z==='"'){if(Q)if(G==='"')$[J][q]+='"',X++;else Q=!1;else if(Y===void 0||Y===f||z(Y))Q=!0}if(!Q&&Z!=='"'){if(Z===f){q++,E();continue}else if(z(Z)){if(q=0,J++,E(),Z==="\r"&&G===` -`)X++;continue}}$[J][q]+=Z}return $}var CV=class extends A{constructor(){super(...arguments);this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){let{gos:_,rowModel:f,ctrlsSvc:$}=this.beans;if(o(_,f))this.clientSideRowModel=f;$.whenReady(this,(z)=>{this.gridCtrl=z.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){if(!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText)navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((f)=>{j(40,{e:f,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()});else this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let _=!1,f=($)=>{let z=Date.now();if(z-this.lastPasteOperationTime<50)_=!0,$.preventDefault();this.lastPasteOperationTime=z};this.executeOnTempElement(($)=>{$.addEventListener("paste",f),$.focus({preventScroll:!0})},($)=>{let z=$.value;if(!_)this.processClipboardData(z);else this.refocusLastFocusedCell();$.removeEventListener("paste",f)})}refocusLastFocusedCell(){let{focusSvc:_}=this.beans,f=_.getFocusedCell();if(f)_.setFocusedCell({rowIndex:f.rowIndex,column:f.column,rowPinned:f.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){let _=this.gos.get("clipboardDelimiter");return v(_)?_:"\t"}processClipboardData(_){if(_==null)return;let f=bV(_,this.getClipboardDelimiter()),$=this.gos.getCallback("processDataFromClipboard");if($)f=$({data:f});if(f==null)return;if(this.gos.get("suppressLastEmptyLineOnPaste"))this.removeLastLineIfBlank(f);let{rangeSvc:z,editSvc:Q}=this.beans,J=(q,X,Y,Z)=>{if(z?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(f))this.pasteIntoActiveRange(f,q,X,Z);else this.pasteStartingFromFocusedCell(f,q,X,Y,Z);Q?.stopEditing(void 0,{source:FQ})};this.doPasteOperation(J)}doPasteOperation(_){let{eventSvc:$,focusSvc:z,rowRenderer:Q,gos:J}=this.beans;$.dispatchEvent({type:"pasteStart",source:"clipboard"});let{clientSideRowModel:q}=this,X=q?.rootNode,Y=X&&this.beans.changedPathFactory?.newPath(J.get("aggregateOnlyChangedColumns")),Z={},G=[],E=z.getFocusedCell();_(Z,G,E,Y);let U=G.slice();if(Y)q.doAggregate(Y),R_(X,q.hierarchical,Y,(H)=>{U.push(H)});Q.refreshCells({rowNodes:U}),this.dispatchFlashCells(Z),this.fireRowChanged(G),this.refocusLastFocusedCell(),$.dispatchEvent({type:"pasteEnd",source:"clipboard"})}getPreProcessRangeCallback(_){return(f)=>{let{rangeSvc:$}=this.beans;if(!$)return;let{rowDiff:z,colDiff:Q}=this.getAdjustedRangeDimensionForPaste(f,_);if(z!==0)$.extendRangeRowCountBy(f,z);if(Q!==0)$.extendRangeColumnCountBy(f,Q)}}getAdjustedRangeDimensionForPaste(_,f){let $=this.beans.rangeSvc,z=f.length,Q=$.getRangeRowCount(_),J=Q>=z&&Q%z===0,q=f[0].length,X=_.columns.length,Y=X>=q&&X%q===0;return{rowDiff:J?0:z-Q,colDiff:Y?0:q-X}}pasteIntoActiveRange(_,f,$,z){let Q=0,J=0,q=(X,Y,Z,G)=>{if(G-Q>=_.length){if(G%_.length!==0)return;Q+=J,J=0}let U=_[G-Q];$.push(Y);let H=this.gos.getCallback("processCellFromClipboard"),W=Z.columns,B=W.findIndex(x0);if(B!==-1)W.splice(B,1);for(let K=0;K=U.length)F=K%U.length;let D=this.processCell(Y,L,U[F],W2,H,!0);Y.setDataValue(L,D,FQ),z?.addCell(Y.parent,L.getId());let{rowIndex:M,rowPinned:k}=X,R=g0({rowIndex:M,column:L,rowPinned:k});f[R]=!0}J++};this.iterateActiveRanges(q,!1,this.getPreProcessRangeCallback(_))}getDisplayedColumnsStartingAt(_){let f=_,$=[],{visibleCols:z}=this.beans;while(f&&k$(f))f=z.getColAfter(f);while(f!=null)$.push(f),f=z.getColAfter(f);return $}pasteStartingFromFocusedCell(_,f,$,z,Q){if(!z)return;let J={rowIndex:z.rowIndex,rowPinned:z.rowPinned},q=this.getDisplayedColumnsStartingAt(z.column);if(this.isPasteSingleValueIntoRange(_))this.pasteSingleValueIntoRange(_,$,f,Q);else this.pasteMultipleValues(_,J,$,q,f,B2,Q)}isPasteSingleValueIntoRange(_){let f=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(_)&&!!f&&!f.isEmpty()}pasteSingleValueIntoRange(_,f,$,z){let Q=_[0][0],J=(q,X,Y)=>{f.push(X),Y.columns.forEach((Z)=>this.updateCellValue(X,Z,Q,$,B2,z))};this.iterateActiveRanges(J)}hasOnlyOneValueToPaste(_){return _.length===1&&_[0].length===1}copyRangeDown(){let{rangeSvc:_,gos:f,formula:$,valueSvc:z}=this.beans;if(!_||_.isEmpty())return;let Q=[],J=(q,X,Y,Z)=>{let G=f.getCallback("processCellForClipboard"),E=f.getCallback("processCellFromClipboard"),U=(H,W,B)=>{let{columns:K}=B;if(!Q.length)K.forEach((L)=>{let F=this.processCell(W,L,z.getValue(L,W,"batch"),W2,G,!1,!0);Q.push(F)});else X.push(W),K.forEach((L,F)=>{if(!L.isCellEditable(W)||L.isSuppressPaste(W))return;if(L.isAllowFormula()&&$?.isFormula(Q[F]))Q[F]=$?.updateFormulaByOffset({value:Q[F],rowDelta:1});let M=this.processCell(W,L,Q[F],W2,E,!0);W.setDataValue(L,M,FQ),Z?.addCell(W.parent,L.getId());let{rowIndex:k,rowPinned:R}=H,O=g0({rowIndex:k,column:L,rowPinned:R});q[O]=!0})};this.iterateActiveRanges(U,!0)};this.doPasteOperation(J)}removeLastLineIfBlank(_){let f=b(_);if(f&&f.length===1&&f[0]===""){if(_.length===1)return;Q_(_,f)}}fireRowChanged(_){if(this.gos.get("editType")!=="fullRow")return;for(let f of _)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:f,data:f.data,rowIndex:f.rowIndex,rowPinned:f.rowPinned})}shouldSkipPasteRow(_,f,$){if(_.detail||_.footer)return!0;if($&&_.group){for(let z of f)if(z.isCellEditable(_))return!1;return!0}return!1}pasteMultipleValues(_,f,$,z,Q,J,q){let X=f,Y=this.beans,{gos:Z}=Y,G=this.clientSideRowModel!=null&&!Z.get("enableGroupEdit")&&!Z.get("treeData"),E=()=>{while(X){let U=D_(Y,X);if(X=K_(Y,{rowPinned:X.rowPinned,rowIndex:X.rowIndex}),U!=null&&!this.shouldSkipPasteRow(U,z,G))return U}return null};for(let U of _){let H=E();if(!H)continue;U.forEach((W,B)=>this.updateCellValue(H,z[B],W,Q,J,q)),$.push(H)}}updateCellValue(_,f,$,z,Q,J){if(!_||!f?.isCellEditable(_)||f?.isSuppressPaste(_))return;let q=this.processCell(_,f,$,Q,this.gos.getCallback("processCellFromClipboard"),!0);_.setDataValue(f,q,FQ);let{rowIndex:X,rowPinned:Y}=_,Z=g0({rowIndex:X,column:f,rowPinned:Y});z[Z]=!0,J?.addCell(_.parent,f.getId())}copyToClipboard(_={}){this.copyOrCutToClipboard(_)}cutToClipboard(_={},f="api"){if(this.gos.get("suppressCutToClipboard"))return;this.eventSvc.dispatchEvent({type:"cutStart",source:f}),this.copyOrCutToClipboard(_,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:f})}copyOrCutToClipboard(_,f){let{includeHeaders:$,includeGroupHeaders:z}=_,{gos:Q,focusSvc:J}=this.beans;if($==null)$=Q.get("copyHeadersToClipboard");if(z==null)z=Q.get("copyGroupHeadersToClipboard");let q={includeHeaders:$,includeGroupHeaders:z},X=Q.get("rowSelection"),Y=Q.get("cellSelection"),Z=null;if(this.shouldCopyCells(Y,X))this.copySelectedRangeToClipboard(q),Z=0;else if(this.shouldCopyRows(X))this.copySelectedRowsToClipboard(q),Z=1;else if(J.isAnyCellFocused())this.copyFocusedCellToClipboard(q),Z=2;if(f&&Z!==null)this.clearCellsAfterCopy(Z)}shouldCopyCells(_,f){let{rangeSvc:$,selectionSvc:z,gos:Q}=this.beans;if(!$||$.isEmpty())return!1;if(_)return!(typeof f==="object"&&f.copySelectedRows&&!z?.isEmpty());else{let J=Q.get("suppressCopySingleCellRanges");return!(!$.isMoreThanOneCell()&&J)}}shouldCopyRows(_){let{selectionSvc:f,gos:$}=this.beans;if(f?.isEmpty()??!0)return!1;if(_&&typeof _!=="string")return _.copySelectedRows??!1;else return!$.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(_){let f=this.beans,{rangeSvc:$,focusSvc:z,eventSvc:Q}=f;if(Q.dispatchEvent({type:"keyShortcutChangedCellStart"}),_===0)$.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(_===1)this.clearSelectedRows();else{let J=z.getFocusedCell();if(J==null)return;let q=D_(f,J);if(q)this.clearCellValue(q,J.column)}Q.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){let{selectionSvc:_,visibleCols:f}=this.beans,$=_?.getSelectedNodes()??[],z=f.allCols;for(let Q of $)for(let J of z)this.clearCellValue(Q,J)}clearCellValue(_,f){if(!f.isCellEditable(_))return;let $=this.beans.valueSvc.getDeleteValue(f,_);_.setDataValue(f,$,"clipboardSvc")}iterateActiveRanges(_,f,$){let z=this.beans.rangeSvc;if(!z||z.isEmpty())return;let Q=z.getCellRanges(),J=f?[Q[0]]:Q;for(let q of J)this.iterateActiveRange({cellRange:q,rowCallback:_,preProcessRange:$})}iterateActiveRange(_){let{cellRange:f,preProcessRange:$,rowCallback:z}=_,{beans:Q}=this,{rangeSvc:J}=Q;if(!J)return;if($)$(f);let q=J.getRangeStartRow(f),X=J.getRangeEndRow(f),Y=0,Z=!1;while(!Z&&q!=null){let G=D_(Q,q);Z=s(q,X),z(q,G,f,Y++),q=K_(Q,q)}}copySelectedRangeToClipboard(_={}){let f=this.beans.rangeSvc;if(!f||f.isEmpty())return;let $=f.areAllRangesAbleToMerge(),{data:z,cellsToFlash:Q}=$?this.buildDataFromMergedRanges(f,_):this.buildDataFromRanges(f,_);this.copyDataToClipboard(z),this.dispatchFlashCells(Q)}buildDataFromMergedRanges(_,f){let $=new Set,z=_.getCellRanges(),Q=new Map,J=[],q={},X=o(this.gos,this.beans.rowModel),Y=new Set;if(!X)this.beans.rowModel.forEachNode((U)=>{Y.add(U.rowIndex)});for(let U of z){U.columns.forEach((B)=>$.add(B));let{rowPositions:H,cellsToFlash:W}=this.getRangeRowPositionsAndCellsToFlash(_,U);for(let B of H){let K=Y.has(B.rowIndex);if(!X&&!K)continue;let L=`${B.rowIndex}-${B.rowPinned||"null"}`;if(!Q.get(L))Q.set(L,!0),J.push(B)}Object.assign(q,W)}let Z=this.beans.visibleCols.allCols,G=Array.from($);return G.sort((U,H)=>{let W=Z.indexOf(U),B=Z.indexOf(H);return W-B}),{data:this.buildExportParams({columns:G,rowPositions:J,includeHeaders:f.includeHeaders,includeGroupHeaders:f.includeGroupHeaders}),cellsToFlash:q}}buildDataFromRanges(_,f){let $=_.getCellRanges(),z=[],Q={};for(let J of $){let{rowPositions:q,cellsToFlash:X}=this.getRangeRowPositionsAndCellsToFlash(_,J);Object.assign(Q,X),z.push(this.buildExportParams({columns:J.columns,rowPositions:q,includeHeaders:f.includeHeaders,includeGroupHeaders:f.includeGroupHeaders}))}return{data:z.join(` -`),cellsToFlash:Q}}getRangeRowPositionsAndCellsToFlash(_,f){let $=[],z={},Q=_.getRangeStartRow(f),J=_.getRangeEndRow(f),q=Q;while(q){$.push(q);for(let X of f.columns){let{rowIndex:Y,rowPinned:Z}=q,G=g0({rowIndex:Y,column:X,rowPinned:Z});z[G]=!0}if(s(q,J))break;q=K_(this.beans,q)}return{rowPositions:$,cellsToFlash:z}}getCellsToFlashFromRowNodes(_){let f=this.beans.visibleCols.allCols,$={};for(let z=0;z<_.length;z++){let{level:Q,rowIndex:J,rowPinned:q,sibling:X}=_[z],Y=Q===-1?X.rowIndex:J;if(Y==null)continue;for(let Z=0;Z{let{value:E,valueFormatted:U}=this.beans.valueSvc.getValueForDisplay({column:G,node:Z,includeValueFormatted:!0,from:"batch"}),H=U??E??"",W=J.getCallback("processCellForClipboard");if(!W)return H;return W({column:G,node:Z,value:H,type:B2,formatValue:(B)=>this.beans.valueSvc.formatValue(G,Z,B)??B,parseValue:(B)=>this.beans.valueSvc.parseValue(G,Z,B,E)??B})},Y={columnKeys:f,rowPositions:$,skipColumnHeaders:!z,skipColumnGroupHeaders:!Q,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!$,valueFrom:"batch",processCellCallback:J.getCallback("processCellForClipboard"),processRowGroupCallback:X,processHeaderCallback:J.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:J.getCallback("processGroupHeaderForClipboard")};return q.getDataAsCsv(Y,!0)}dispatchFlashCells(_){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:_})},0)}processCell(_,f,$,z,Q,J,q){let{valueSvc:X,formula:Y}=this.beans;if(Q)return Q({column:f,node:_,value:$,type:z,formatValue:(G)=>X.formatValue(f,_??null,G)??G,parseValue:(G)=>X.parseValue(f,_??null,G,X.getValue(f,_,"edit"))});if(J&&f.getColDef().useValueParserForImport!==!1)return X.parseValue(f,_??null,$,X.getValue(f,_,"edit"));if(q&&f.getColDef().useValueFormatterForExport!==!1){if(Y?.isFormula($))return $;return X.formatValue(f,_??null,$)??$}return $}copyDataToClipboard(_){let f=this.gos.getCallback("sendToClipboard");if(f){f({data:_});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(_).catch((z)=>{j(40,{e:z,method:"writeText"}),this.copyDataToClipboardLegacy(_)});return}this.copyDataToClipboardLegacy(_)}copyDataToClipboardLegacy(_){this.executeOnTempElement((f)=>{let $=q_(this.beans),z=d(this.beans);if(f.value=_||" ",f.select(),f.focus({preventScroll:!0}),!$.execCommand("copy"))j(41);if(z?.focus!=null)z.focus({preventScroll:!0})})}executeOnTempElement(_,f){if(!this.gridCtrl)return;let $=q_(this.beans),z=$.createElement("textarea"),Q=z.style;Q.width="1px",Q.height="1px";let J=$.documentElement;Q.top=J.scrollTop+"px",Q.left=J.scrollLeft+"px",Q.position="absolute",Q.opacity="0",this.gridCtrl.getGui().appendChild(z);try{_(z)}catch(X){j(42)}if(f)window.setTimeout(()=>{f(z),z.remove()},100);else z.remove()}},hZ={moduleName:"Clipboard",version:$_,beans:[CV],apiFunctions:{copyToClipboard:OV,cutToClipboard:PV,copySelectedRowsToClipboard:vV,copySelectedRangeToClipboard:TV,copySelectedRangeDown:IV,pasteFromClipboard:yV},dependsOn:[y_,P5,f1,p5]};var uZ=class extends A{constructor(){super(...arguments);this.loadRowDataVersion=0}wireBeans(_){this.environment=_.environment}init(_,f){if(this.params=f,this.comp=_,f.pinned!=null)return;this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)})}onFullWidthRowFocused(_){let f=this.params,$={rowIndex:f.node.rowIndex,rowPinned:f.node.rowPinned},z={rowIndex:_.rowIndex,rowPinned:_.rowPinned};if(!s($,z))return;F_(this.comp.getGui(),_.fromBelow)}setAutoHeightClasses(){let _=this.gos.get("detailRowAutoHeight"),f=_?"ag-details-row-auto-height":"ag-details-row-fixed-height",$=_?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",z=this.comp;z.toggleCss(f,!0),z.toggleDetailGridCss($,!0)}setupRefreshStrategy(){let _=this.params.refreshStrategy;if(_=="everything"||_=="nothing"||_=="rows"){this.refreshStrategy=_;return}if(_!=null)j(170,{providedStrategy:_});this.refreshStrategy="rows"}createDetailGrid(){let{params:_,gos:f}=this;if(n(_.detailGridOptions)){j(171);return}let $=f.get("theme"),z=_.detailGridOptions.theme;if(z&&z!==$)j(267);let Q={themeStyleContainer:this.environment.eStyleContainer,..._.detailGridOptions,theme:$};if(f.get("detailRowAutoHeight"))Q.domLayout="autoHeight";this.comp.setDetailGrid(Q)}registerDetailWithMaster(_){let{params:f,beans:{selectionSvc:$,findSvc:z,expansionSvc:Q}}=this,J=f.node.id,q=f.api,X={id:J,api:_},Y=f.node;if(q.isDestroyed())return;q.addDetailGridInfo(J,X),Y.detailGridInfo=X;let Z=Y.parent;z?.registerDetailGrid(Y,_);function G(){if(Z)$?.refreshMasterNodeState(Z)}function E({source:H}){if(H==="expandAll")return _.expandAll();if(H==="collapseAll")return _.collapseAll()}function U({node:H,source:W}){if(H!==Z||W==="masterDetail"||_.isDestroyed())return;$?.setDetailSelectionState(Z,f.detailGridOptions,_)}_.addEventListener("firstDataRendered",()=>{if(_.isDestroyed()||q.isDestroyed())return;$?.setDetailSelectionState(Z,f.detailGridOptions,_),_.addEventListener("selectionChanged",G),q.addEventListener("rowSelected",U);let W=`${"CsrmSsrmSharedApi"}Module`;if(_.isModuleRegistered(W))q.addEventListener("expandOrCollapseAll",E),Q?.setDetailsExpansionState(_)}),this.addManagedListeners(Z,{masterChanged:(H)=>{if(!H.node.master)this.onDestroy(X)}}),this.addDestroyFunc(()=>this.onDestroy(X))}onDestroy(_){let{params:f}=this,$=f.node,z=f.api;if($.detailGridInfo!==_)return;if(!z.isDestroyed())z.removeDetailGridInfo($.id);$.detailGridInfo=null}loadRowData(){this.loadRowDataVersion++;let _=this.loadRowDataVersion,f=this.params;if(f.detailGridOptions?.rowModelType==="serverSide"){f.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}let $=f.getDetailRowData;if(!$){j(172);return}let z=(J)=>{if(this.loadRowDataVersion===_)this.comp.setRowData(J)},Q={node:f.node,data:f.node.data,successCallback:z,context:C(this.gos,{}).context};$(Q)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},wV=class{constructor(_){this.parentWrapper=_}wrap(_,f,$,z){return this.parentWrapper.wrap(_,f,$,z)}},xV={tag:"div",cls:"ag-details-row"},NV={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},gV=class extends w{constructor(){super(...arguments);this.eDetailGrid=V}wireBeans(_){this.context=_.context}init(_){this.params=_,this.selectAndSetTemplate();let f={toggleCss:($,z)=>this.toggleCss($,z),toggleDetailGridCss:($,z)=>this.eDetailGrid.classList.toggle($,z),setDetailGrid:($)=>this.setDetailGrid($),setRowData:($)=>this.setRowData($),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new uZ),this.ctrl.init(f,_)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){let _=this.params;if(_.pinned){this.setTemplate(xV);return}let f=()=>{this.setTemplate(NV)};if(n(_.template))f();else if(typeof _.template==="string")this.setTemplate(_.template,[]);else if(typeof _.template==="function"){let $=_.template,z=$(_);this.setTemplate(z,[])}else j(168),f();if(this.eDetailGrid==null)j(169)}setDetailGrid(_){if(!this.eDetailGrid)return;let f=this.context.getBean("frameworkCompWrapper"),$=new wV(f),{frameworkOverrides:z}=this.beans,Q=ZQ(this.eDetailGrid,_,{frameworkOverrides:z,providedBeanInstances:{frameworkCompWrapper:$},modules:Mq(this.params.api.getGridId(),_.rowModelType??"clientSide")});this.detailApi=Q,this.ctrl?.registerDetailWithMaster(Q),this.addDestroyFunc(()=>{Q.destroy()})}setRowData(_){this.detailApi?.setGridOption("rowData",_)}};function xQ(_,f){let $=_.masterDetailSvc?.store;return $?f($):void 0}function hV(_,f,$){xQ(_,(z)=>{z[f]=$})}function uV(_,f){xQ(_,($)=>{delete $[f]})}function iV(_,f){return xQ(_,($)=>$[f])}function mV(_,f){xQ(_,($)=>{let z=0;Object.values($).forEach((Q)=>{if(Q)f(Q,z++)})})}var cV=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}",pV=class extends A{constructor(){super(...arguments);this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){let _=this.gos;if(o(_))this.enabled=this.isEnabled();if(Kf(_))this.addEventListeners()}addEventListeners(){let _=(z)=>{this.setMaster(z.node,!1,!0)},f,$=()=>{if(f){for(let z of f)z();f=void 0}if(this.isEnabled())f=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:_})};$(),this.gos.addPropertyEventListener("masterDetail",$)}refreshModel(_){if(_.changedProps){let f=this.isEnabled();if(this.enabled!==f){this.setMasters(null);return}}if(_.rowDataUpdated)this.setMasters(_.changedRowNodes)}setMaster(_,f,$){let z=_.master,Q=this.isEnabled(),J=Q,q=this.gos,X=q.get("isRowMaster"),Y=q.get("treeData");if(Q)if(f||$){if(X){let Z=_.data;J=!!Z&&!!X(Z)}}else J=z;if(!Y){if(J&&f||!J&&z)_._expanded??(_._expanded=null)}if(J!==z)_.master=J,_.dispatchRowEvent("masterChanged")}setMasters(_){if(this.enabled=this.isEnabled(),_){for(let f of _.updates)this.setMaster(f,!1,!0);for(let f of _.adds)this.setMaster(f,!0,!1)}else{let f=DJ(this.beans)?.rootNode?._leafs;if(f)for(let $=0,z=f.length;${let q=f.clientHeight;if(q!=null&&q>0){let X=()=>{let{rowModel:Y}=this.beans,{rowNode:Z}=_;if(Z.setRowHeight(q),o($,Y)||Kf($,Y))Y.onRowHeightChanged()};window.setTimeout(X,0)}},J=S0(z,f,Q);_.addDestroyFunc(J),Q()}destroy(){this.store={},super.destroy()}},nV={moduleName:"SharedMasterDetail",version:$_,beans:[pV],userComponents:{agDetailCellRenderer:gV},dynamicBeans:{detailCellRendererCtrl:uZ},apiFunctions:{addDetailGridInfo:hV,removeDetailGridInfo:uV,getDetailGridInfo:iV,forEachDetailGridInfo:mV},dependsOn:[y_,wZ,NZ],css:[cV]},iZ={moduleName:"MasterDetail",version:$_,dependsOn:[nV,wQ,c5]},mZ=class extends w{constructor(){super(...arguments);this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:(_)=>{let f=!1;if(!this.dragging)f=!0,this.dragging=!0,T1(this.beans).classList?.add(this.getDraggingCssClass());if(this.updateValuesOnMove(_),f){this.changedCalculatedValues=!1;return}if(this.beans.rangeSvc.autoScrollService.check(_),this.changedCalculatedValues)this.onDrag(_),this.changedCalculatedValues=!1},onDragStop:(_)=>{this.dragging=!1,this.onDragEnd(_),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:OY,mousedown:OY})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(_){let f=yJ(this.gos,_);if(!f||this.shouldSkipCell(f)||this.lastCellHovered&&C1(f,this.lastCellHovered))return;this.lastCellHovered=f,this.changedCalculatedValues=!0}clearDragProperties(){if(this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),T1(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging)this.destroy()}getType(){return this.type}refresh(_,f){let $=this.cellCtrl,z=this.getGui(),Q=f??b(this.beans.rangeSvc.getCellRanges()),J=Q.startRow,q=Q.endRow;if(J&&q)if(Y_(q,J))this.rangeStartRow=q,this.rangeEndRow=J;else this.rangeStartRow=J,this.rangeEndRow=q;if($!==_||!A_(z)){this.cellCtrl=_;let X=_.comp.getParentOfValue();if(X)X.appendChild(z)}this.cellRange=Q}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){N(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(_){if(!this.cellRange)return;let{id:f,type:$}=this.cellRange;if(!f||f!==_.id)return;let z=this.beans.rangeSvc?.getCellRanges().find((Q)=>Q.id===f&&Q.type===$);if(z&&z!==this.cellRange)this.cellRange=z}},OY=(_)=>{_.stopPropagation()};function dV(_){let f=_.length,$=0;if(f<=1)return _;for(let E=0;E<_.length;E++){let U=_[E],H=U.toString().split("e-");if(H.length>1){$=Math.max($,parseInt(H[1],10));continue}if(Math.floor(U)===U)continue;$=Math.max($,U.toString().split(".")[1].length)}let z=0,Q=0,J=0,q=0,X=0;for(let E=0;Eq?"x":"y";else Y=X;if(Y!==this.dragAxis)this.dragAxis=Y,this.changedCalculatedValues=!0}shouldSkipCell(_){return I_(_.column)}onDrag(_){if(!this.initialPosition){let $=this.cellCtrl;if(!$)return;this.initialPosition=$.cellPosition}let f=this.getLastCellHovered();if(f)this.markPathFrom(this.initialPosition,f)}onDragEnd(_){if(this.initialXY=null,!this.markedCells.length)return;let f=this.dragAxis==="x",{cellRange:$,rangeStartRow:z,rangeEndRow:Q,beans:{rangeSvc:J}}=this,q=$.columns.length,X;if(!this.isUp&&!this.isLeft)X=J.createCellRangeFromCellRangeParams({rowStartIndex:z.rowIndex,rowStartPinned:z.rowPinned,columnStart:$.columns[0],rowEndIndex:f?Q.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:f?Q.rowPinned:this.lastCellMarked.rowPinned,columnEnd:f?this.lastCellMarked.column:$.columns[q-1]});else{let Y=f?z:this.lastCellMarked;X=J.createCellRangeFromCellRangeParams({rowStartIndex:Y.rowIndex,rowStartPinned:Y.rowPinned,columnStart:f?this.lastCellMarked.column:$.columns[0],rowEndIndex:Q.rowIndex,rowEndPinned:Q.rowPinned,columnEnd:$.columns[q-1]})}if(X)this.performFill({event:_,initialRange:$,finalRange:X,shouldUpdateRange:!0})}onDragCancel(){if(this.initialXY=null,!this.markedCells.length)return;this.clearMarkedPath()}performFill({event:_,initialRange:f,finalRange:$,shouldUpdateRange:z}){let{eventSvc:Q,rangeSvc:J}=this.beans;if(Q.dispatchEvent({type:"fillStart"}),this.handleValueChanged(f,$,_),z)J.setCellRanges([$]);Q.dispatchEvent({type:"fillEnd",initialRange:f,finalRange:$})}getFillHandleDirection(){let _=tz(this.gos)?.direction;if(!_)return"xy";if(_!=="x"&&_!=="y"&&_!=="xy")return j(177),"xy";return _}handleValueChanged(_,f,$){let{beans:z}=this,{rangeSvc:Q,gos:J,valueSvc:q}=z,X=Q.getRangeEndRow(_),Y=Q.getRangeStartRow(_),Z=Q.getRangeEndRow(f),G=Q.getRangeStartRow(f),E=this.dragAxis==="y";if(this.isReduce&&!tz(J)?.suppressClearOnFillReduction){let R=E?_.columns:_.columns.filter((I)=>f.columns.indexOf(I)<0),O=E?K_(z,Z):G;if(O)this.clearCellsInRange(O,X,R);return}let U=[],H=[],W=[],B=[],K=!0,L=0,F=()=>{U.length=0,H.length=0,W.length=0,B.length=0,L=0},D=(R,O)=>{let I=this.isUp?X:Y,T=!1;if(E)K=!0,F();while(!T&&I){let y=D_(z,I);if(!y)break;if(E&&R)M(U,R,y,()=>!s(I,this.isUp?Y:X));else if(O){K=!0,F();for(let i of O)M(U,i,y,()=>i!==(this.isLeft?_.columns[0]:b(_.columns)))}T=s(I,this.isUp?G:Z),I=this.isUp?m_(this.beans,I):K_(z,I)}},M=(R,O,I,T)=>{let y,i=!1;if(K)y=q.getValue(O,I,"edit"),H.push(y),W.push(q.getValue(O,I,"edit",!0)),B.push(q.getValueForDisplay({column:O,node:I,from:"edit"}).valueFormatted),K=T();else{let{value:x,fromUserFunction:a,sourceCol:t,sourceRowNode:u}=this.processValues({event:$,values:R,initialValues:H,initialNonAggregatedValues:W,initialFormattedValues:B,col:O,rowNode:I,idx:L++});if(y=x,O.isCellEditable(I)){let __=q.getValue(O,I,"edit");if(!a){if(t){let r=t.getColDef();if(r.useValueFormatterForExport!==!1&&r.valueFormatter){let O_=q.getValueForDisplay({column:t,node:u,includeValueFormatted:!0,from:"edit"}).valueFormatted;if(O_!=null)y=O_}}if(O.getColDef().useValueParserForImport!==!1)y=q.parseValue(O,I,t?y:$$(y),__)}if(!a||__!==y)I.setDataValue(O,y,"rangeSvc");else i=!0}}if(!i)R.push({value:y,column:O,rowNode:I})},{changeDetectionSvc:k}=this.beans;k?.beginDeferred();try{if(E)_.columns.forEach((R)=>{D(R)});else{let R=this.isLeft?[...f.columns].reverse():f.columns;D(void 0,R)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{k?.endDeferred()}}clearCellsInRange(_,f,$){let z={startRow:_,endRow:f,columns:$,startColumn:$[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[z],restoreSourceInBatch:!0})}processValues(_){let{formula:f,valueSvc:$}=this.beans,{event:z,values:Q,initialValues:J,initialNonAggregatedValues:q,initialFormattedValues:X,col:Y,rowNode:Z,idx:G}=_,E=tz(this.gos)?.setFillValue,U=this.dragAxis==="y",H;if(U)H=this.isUp?"up":"down";else H=this.isLeft?"left":"right";if(E){let K=C(this.gos,{event:z,values:Q.map(({value:F})=>F),initialValues:J,initialNonAggregatedValues:q,initialFormattedValues:X,currentIndex:G,currentCellValue:$.getValue(Y,Z,"edit"),direction:H,column:Y,rowNode:Z}),L=E(K);if(L!==!1)return{value:L,fromUserFunction:!0}}let W=(K)=>typeof K==="number"&&Number.isFinite(K)||typeof K==="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(K.trim()),B=Q.every(({value:K})=>W(K));if(z.altKey||!B){let K=String(b(Q)?.value??"");if(B&&J.length===1){let R=this.isUp||this.isLeft?-1:1;return{value:parseFloat(K)+1*R,fromUserFunction:!1}}let{value:L,column:F,rowNode:D}=Q[G%Q.length],M,k=F.isAllowFormula()&&f?.isFormula(K);if(k){let R=H==="up"?-1:H==="down"?1:0,O=H==="left"?-1:H==="right"?1:0;M=f.updateFormulaByOffset({value:K,rowDelta:R,columnDelta:O})}else M=L;return{value:M,fromUserFunction:!1,sourceCol:k?void 0:F,sourceRowNode:D}}return{value:b(dV(Q.map(({value:K})=>Number(K)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(let _ of this.markedCells){if(!_.isAlive())continue;let{comp:f}=_;f.toggleCss("ag-selection-fill-top",!1),f.toggleCss("ag-selection-fill-right",!1),f.toggleCss("ag-selection-fill-bottom",!1),f.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(_,f){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(s(f,_))return;let $=Y_(f,_),{rangeStartRow:z,rangeEndRow:Q}=this;if($&&(f.rowPinned==z.rowPinned&&f.rowIndex>=z.rowIndex||z.rowPinned!=Q.rowPinned&&f.rowPinned==Q.rowPinned&&f.rowIndex<=Q.rowIndex))this.reduceVertical(_,f),this.isReduce=!0;else this.extendVertical(_,f,$),this.isReduce=!1}else{let $=_.column,z=f.column;if($===z)return;let Q=this.beans.visibleCols.allCols,J=Q.indexOf($),q=Q.indexOf(z);if(q<=J&&q>=Q.indexOf(this.cellRange.columns[0]))this.reduceHorizontal(_,f),this.isReduce=!0;else this.extendHorizontal(_,f,q=4),_.toggleCss(eV,J),r6(z,Q>0?!0:void 0),_.toggleCss(_O,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){let _=this.getRangeBorders(),f=this.isSingleCell(),$=!f&&_.top,z=!f&&_.right,Q=!f&&_.bottom,J=!f&&_.left,q=this.cellComp;q.toggleCss($O,$),q.toggleCss(zO,z),q.toggleCss(QO,Q),q.toggleCss(JO,J)}isSingleCell(){let{rangeSvc:_}=this;return this.rangeCount===1&&!!_&&!_.isMoreThanOneCell()}getHasChartRange(){let{rangeSvc:_}=this;if(!this.rangeCount||!_)return!1;let f=_.getCellRanges();return f.length>0&&f.every(($)=>[N0.DIMENSION,N0.VALUE].includes($.type))}updateRangeBordersIfRangeCount(){if(this.rangeCount>0)this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}getRangeBorders(){let _=this.beans.gos.get("enableRtl"),f=!1,$=!1,z=!1,Q=!1,{rangeSvc:J,beans:{visibleCols:q},cellCtrl:{cellPosition:X}}=this,Y=X.column,Z=J.getCellRanges().filter((U)=>J.isCellInSpecificRange(X,U));if(!Z.length)return{top:f,right:$,bottom:z,left:Q};let G,E;if(_)G=q.getColAfter(Y),E=q.getColBefore(Y);else G=q.getColBefore(Y),E=q.getColAfter(Y);if(!G)Q=!0;if(!E)$=!0;for(let U=0;U=0;z--){let Q=$[z],J=Q.colorClass;if(!J)continue;if(_.isCellInSpecificRange(this.cellCtrl.cellPosition,Q))return J}return null}refreshHandleColor(_){let f=this.selectionHandle?.getGui?.(),$=_?.colorClass??null;if(!f){this.handleColorClass=null;return}if(this.handleColorClass&&this.handleColorClass!==$)f.classList.remove(this.handleColorClass);if($)f.classList.add($);else if(this.handleColorClass)f.classList.remove(this.handleColorClass);this.handleColorClass=$??null}getRangeForHandle(){let{gos:_,editSvc:f}=this.beans,$=this.rangeSvc,z=$.getCellRanges(),Q=z.length;if(this.rangeCount<1||Q<1)return null;let J=f?.isRangeSelectionEnabledWhileEditing(),q=J?z:[b(z)];for(let X of q){let{cellPosition:Y,column:Z}=this.cellCtrl,G=TY(_)&&!Z.isSuppressFillHandle(),E=qO(_),H=!f?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(J||Q===1&&(G||E));if(this.hasChartRange)H=X.type===N0.VALUE;if(H&&X.endRow!=null&&$.isContiguousRange(X)&&$.isBottomRightCell(X,Y))return X}return null}addSelectionHandle(_){let{beans:f}=this,$=f.editSvc?.isRangeSelectionEnabledWhileEditing(),z=_.type,J=!$&&TY(f.gos)&&n(z)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==J)this.selectionHandle=f.context.destroyBean(this.selectionHandle);if(!this.selectionHandle){let q=f.registry.createDynamicBean(J===0?"fillHandle":"rangeHandle",!1);if(q)this.selectionHandle=f.context.createBean(q)}this.selectionHandle?.refresh(this.cellCtrl,_)}destroy(){this.unsetComp()}},YO=class extends A{constructor(_){super();this.eContainer=_}postConstruct(){let{beans:_,gos:f,eContainer:$}=this,z=_.rangeSvc,Q={eElement:$,onDragStart:z.onDragStart.bind(z),onDragStop:z.onDragStop.bind(z),onDragging:z.onDragging.bind(z)},J=_.dragSvc,q=J.addDragSource.bind(J,Q),X=J.removeDragSource.bind(J,Q);if(this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(i_(f))q();else X()}),this.addDestroyFunc(X),i_(f))q()}},ZO=class extends A{constructor(_,f){super();this.column=_,this.eGui=f}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(_)=>_&&this.onClick(_)})}onClick(_){this.beans.rangeSvc?.handleColumnSelection(this.column,_)}},GO=class extends A{constructor(_,f){super();this.column=_,this.comp=f,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let _;if(this.column.isColumn)_=[this.column];else _=this.column.getDisplayedLeafColumns();for(let f of _)this.columnMap.set(f,!1)}refreshActive(){let{gos:_,rangeSvc:f}=this.beans,$=_.get("cellSelection");this.isActive=!!($&&f&&typeof $==="object"&&$.enableHeaderHighlight)}setupRangeHeaderHighlight(){let _=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:_,columnPinned:_,columnMoved:_,columnGroupOpened:_}),_()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();let _=this.beans.rangeSvc.getCellRanges(),f=!1,$=!0;for(let z of _){if(f)break;for(let Q of z.columns)if(this.columnMap.has(Q))this.columnMap.set(Q,!0),f||(f=!0)}for(let z of Array.from(this.columnMap.values()))if(z===!1){$=!1;break}this.comp.toggleCss("ag-header-range-highlight",f&&$)}destroy(){super.destroy(),this.comp=null,this.column=null}},EO=class extends A{constructor(){super(...arguments);this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(_){this.rowModel=_.rowModel,this.dragSvc=_.dragSvc,this.colModel=_.colModel,this.visibleCols=_.visibleCols,this.cellNavigation=_.cellNavigation,this.ctrlsSvc=_.ctrlsSvc}postConstruct(){let _=this.onColumnsChanged.bind(this),f=()=>this.removeAllCellRanges(),$=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:_,columnVisible:_,columnValueChanged:_,columnPivotModeChanged:f,columnRowGroupChanged:f,columnPivotChanged:f,columnGroupOpened:$,columnMoved:$,columnPinned:$}),this.ctrlsSvc.whenReady(this,(z)=>{let Q=z.gridBodyCtrl;this.autoScrollService=new QQ({scrollContainer:Q.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>Q.scrollFeature.getVScrollPosition().top,setVerticalPosition:(J)=>Q.scrollFeature.setVerticalScrollPosition(J),getHorizontalPosition:()=>Q.scrollFeature.getHScrollPosition().left,setHorizontalPosition:(J)=>Q.scrollFeature.setHorizontalScrollPosition(J),shouldSkipVerticalScroll:()=>!S_(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!Q.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(_){if(this.rangeSelectionExtensions.includes(_))return;this.rangeSelectionExtensions.push(_)}unregisterRangeSelectionExtension(_){Q_(this.rangeSelectionExtensions,_)}shouldSuppressRangeSelection(_){return this.rangeSelectionExtensions.some((f)=>f.shouldSuppressRangeSelection?.(_))}shouldSkipColumn(_){return this.rangeSelectionExtensions.some((f)=>f.shouldSkipColumn?.(_))}isAllColumnsSelectionCell(_){return this.rangeSelectionExtensions.some((f)=>f.isAllColumnsSelectionCell?.(_))}isAllColumnsRange(_,f){return this.rangeSelectionExtensions.some(($)=>$.isAllColumnsRange?.(_,f))}updateSelectionModeForCell(_){this.setSelectionMode(this.isAllColumnsSelectionCell(_))}onDragStart(_){let f=this.gos,$=_.target;if(!i_(f)||vJ(f,$)?.isSuppressMouseEvent(_))return;if(this.shouldSuppressRangeSelection($))return;let{shiftKey:z}=_,Q=this.isMultiRange(_),J=z&&!!this.cellRanges?.length;if(!Q&&(!J||v(b(this.cellRanges).type)))this.removeAllCellRanges(!0);let q=this.dragSvc.startTarget;if(q)this.updateValuesOnMove(q);if(!this.lastCellHovered)return;if(this.dragging=!0,this.lastMouseEvent=_,this.intersectionRange=Q&&this.getCellRangeCount(this.lastCellHovered)>1,!J)this.setNewestRangeStartCell(this.lastCellHovered);if(this.cellRanges.length>0)this.draggingRange=b(this.cellRanges);else{let X={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},Y=this.getColumnsFromModel([this.lastCellHovered.column]);if(!Y?.length)return;this.draggingRange={startRow:X,endRow:X,columns:Y,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}onDragging(_){let{dragging:f,lastCellHovered:$,newestRangeStartCell:z,autoScrollService:Q,cellHasChanged:J}=this;if(!f||!_)return;this.updateValuesOnMove(_.target),this.lastMouseEvent=_;let q=(H)=>$&&$.rowPinned===H&&z.rowPinned===H,X=q("top")||q("bottom");if(Q.check(_,X),!J||!$)return;let Y=z?.column,Z=$?.column,G=this.calculateColumnsBetween(Y,Z);if(!G)return;let{rowIndex:E,rowPinned:U}=$;this.draggingRange.endRow={rowIndex:E,rowPinned:U},this.draggingRange.columns=G,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;let{id:_}=this.draggingRange;if(this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange)this.intersectionRange=!1,this.intersectLastRange();this.dispatchChangedEvent(!1,!0,_)}onColumnsChanged(){this.refreshLastRangeStart();let _=this.visibleCols.allCols;for(let $ of this.cellRanges){let z=$.columns;if($.columns=$.columns.filter((J)=>J.isVisible()&&_.indexOf(J)!==-1),!J_(z,$.columns))this.dispatchChangedEvent(!1,!0,$.id)}let f=this.cellRanges.length;if(this.cellRanges=this.cellRanges.filter(($)=>$.columns.length>0),f>this.cellRanges.length)this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){let _=b(this.cellRanges);if(!_)return;this.refreshRangeStart(_)}isContiguousRange(_){let f=_.columns;if(!f.length)return!1;let $=this.visibleCols.allCols,z=f.map((Q)=>$.indexOf(Q)).sort((Q,J)=>Q-J);return b(z)-z[0]+1===f.length}getRangeStartRow(_){if(_.startRow&&_.endRow)return Y_(_.startRow,_.endRow)?_.startRow:_.endRow;return{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(_){if(_.startRow&&_.endRow)return Y_(_.startRow,_.endRow)?_.endRow:_.startRow;let f=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;if(f>0)return{rowIndex:f-1,rowPinned:"bottom"};return{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(_){let f=this.beans,$=this.getRangeStartRow(_),z=this.getRangeEndRow(_),Q=kJ(f,$);return kJ(f,z)-Q+1}handleCellMouseDown(_,f){let $=_.ctrlKey||_.metaKey;this.handleCellSelectionInput(f,{target:_.target,shiftKey:_.shiftKey,isRightClick:XJ(this.beans,_),isMultiRange:this.isMultiRange(_),isMultiKey:$,preventDefault:()=>_.preventDefault()})}handleCellKeyboardSelect(_,f){let $=_.ctrlKey||_.metaKey;this.handleCellSelectionInput(f,{target:_.target,shiftKey:_.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState($),isMultiKey:$,preventDefault:()=>_.preventDefault()})}handleCellSelectionInput(_,f){let{target:$,shiftKey:z,isRightClick:Q,isMultiRange:J,isMultiKey:q,preventDefault:X}=f;if(this.shouldSuppressRangeSelection($))return;let Y=this.isAllColumnsSelectionCell(_);if(Y)X();if(z)return this.extendLatestRangeToCell(_);if(Y&&Q)return;this.updateSelectionModeForCell(_);let Z=this.calculateColumnsBetween(_.column,_.column);if(!Z)return;let G=Y?this.findContainingRange({columns:Z,startRow:_,endRow:_}):void 0;if(Y&&!!G&&J&&q&&G)this.removeRowFromAllColumnsRange(_,G);else this.setRangeToCell(_,J)}isMultiRange(_){return this.isMultiRangeForKeyState(_.ctrlKey||_.metaKey)}isMultiRangeForKeyState(_){let{editingWithRanges:f,allowMulti:$}=this.getMultiRangeContext();return f||($?_:!1)}getMultiRangeContext(){let{gos:_,editSvc:f}=this.beans,$=!!f?.isEditing()&&!!f?.isRangeSelectionEnabledWhileEditing(),z=bq(_)&&!$;return{editingWithRanges:$,suppressMultiRanges:z,allowMulti:!z}}removeRowFromAllColumnsRange(_,f){let{beans:$,cellRanges:z}=this,Q=O1($),J=Wf($),q=this.getRangeStartRow(f),X=this.getRangeEndRow(f);if(!q&&s(Q,_))DQ(f,K_($,Q),"top");else if(!X&&s(J,_))DQ(f,m_($,J),"bottom");else if(s(q,X))Q_(z,f);else if(s(q,_))DQ(f,K_($,_),"top");else if(s(X,_))DQ(f,m_($,_),"bottom");else{let Y=m_($,_),Z=K_($,_);f.startRow=q,f.endRow=Y??void 0,z.push({...f,startRow:Z??void 0,endRow:X})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(_,f=!1){let{gos:$}=this;if(!i_($))return;this.updateSelectionModeForCell(_);let z=this.calculateColumnsBetween(_.column,_.column);if(!z)return;let{suppressMultiRanges:Q}=this.getMultiRangeContext();if(Q||!f||n(this.cellRanges))this.removeAllCellRanges(!0);let J={rowIndex:_.rowIndex,rowPinned:_.rowPinned},q={startRow:J,endRow:J,columns:z,startColumn:_.column},X=this.ensureRangeStartColumn(q);if(!X)return;this.cellRanges.push(q),this.setNewestRangeStartCell({..._,column:X}),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(_){let f=_.columns[0],$=b(_.columns);return this.newestRangeStartCell?.column===f?$:f}extendRangeRowCountBy(_,f){let{beans:$}=this,{startRow:z,endRow:Q}=_;if(!z||!Q)return;let J=0,q,X=Y_(Q,z);if(X)q=z;else q=Q;let Y=f>0?K_:m_,Z=Math.abs(f);while(Jf.indexOf(z)).filter((z)=>z>-1).sort((z,Q)=>z-Q);return{left:f[$[0]],right:f[b($)]}}extendLatestRangeInDirection(_){if(this.isEmpty()||!this.newestRangeStartCell)return;let f=_.key,$=_.ctrlKey||_.metaKey,z=b(this.cellRanges),Q=this.newestRangeStartCell,J=z.endRow.rowIndex,q=z.endRow.rowPinned,Y={column:this.getRangeLastColumn(z),rowIndex:J,rowPinned:q},Z=this.cellNavigation.getNextCellToFocus(f,Y,$);if(!Z)return;if(this.shouldSkipColumn(Z.column))return;return this.setCellRange({rowStartIndex:Q.rowIndex,rowStartPinned:Q.rowPinned,rowEndIndex:Z.rowIndex,rowEndPinned:Z.rowPinned,columnStart:Q.column,columnEnd:Z.column}),Z}setCellRange(_){if(!i_(this.gos))return;this.removeAllCellRanges(!0),this.addCellRange(_)}setCellRanges(_){if(J_(this.cellRanges,_))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);let f=this.getColumnsFromModel(this.visibleCols.allCols)??[],$=!1;for(let z of _){if(z.columns&&z.startRow){let Q=this.getColumnsFromModel(z.columns);if(!Q||Q.length===0)continue;z.columns=Q;let{startRow:J}=z;this.setNewestRangeStartCell({rowIndex:J.rowIndex,rowPinned:J.rowPinned,column:z.columns[0]})}if(!$&&f.length>0&&this.isAllColumnsRange(z,f))$=!0;this.cellRanges.push(z)}this.setSelectionMode($),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(_){let{beans:f,eventSvc:$}=this,{cellEventSource:z="rangeSvc",dispatchWrapperEvents:Q,wrapperEventSource:J="deleteKey",restoreSourceInBatch:q}=_,{cellRanges:X}=_;if(Q)$.dispatchEvent({type:"cellSelectionDeleteStart",source:J}),$.dispatchEvent({type:"rangeDeleteStart",source:J});if(!X)X=this.cellRanges;let{valueSvc:Y,editSvc:Z}=f,G=!!Z?.isBatchEditing(),{changeDetectionSvc:E}=f;E?.beginDeferred();try{this.forEachEditableCellInRanges(X,(U,H)=>{if(q&&G){Z?.batchResetToSourceValue({rowNode:U,column:H});return}let W=Y.getDeleteValue(H,U);U.setDataValue(H,W,z)})}finally{E?.endDeferred()}if(Q)$.dispatchEvent({type:"cellSelectionDeleteEnd",source:J}),$.dispatchEvent({type:"rangeDeleteEnd",source:J})}createCellRangeFromCellRangeParams(_){return this.createPartialCellRangeFromRangeParams(_,!1)}createPartialCellRangeFromRangeParams(_,f){let{columns:$,columnStart:z,columnEnd:Q,rowStartIndex:J,rowStartPinned:q,rowEndIndex:X,rowEndPinned:Y}=_,Z=this.getColumnsFromParams($,z,Q);if(!Z||!f&&Z.columns.length===0)return;let{columns:G,startsOnTheRight:E}=Z,U=IY(J,q),H=IY(X,Y);return{startRow:U,endRow:H,columns:G,startColumn:this.getColumnFromModel(z)??(E?b(G):G[0])}}addCellRange(_){let f=this.gos;if(!i_(f)||!this.verifyCellRanges(f))return;this.setSelectionMode(!1);let $=this.createCellRangeFromCellRangeParams(_);if($){if($.startRow)this.setNewestRangeStartCell({rowIndex:$.startRow.rowIndex,rowPinned:$.startRow.rowPinned,column:$.startColumn});return this.cellRanges.push($),this.dispatchChangedEvent(!1,!0,$.id),$}}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){let _=this.cellRanges.length;if(_===0)return!1;if(_>1)return!0;let f=this.cellRanges[0],$=this.getRangeStartRow(f),z=this.getRangeEndRow(f);return $.rowPinned!==z.rowPinned||$.rowIndex!==z.rowIndex||f.columns.length!==1}areAllRangesAbleToMerge(){let _=new Map;if(this.cellRanges.length<=1)return!0;for(let z of this.cellRanges)this.forEachRowInRange(z,(Q)=>{let J=`${Q.rowPinned||"normal"}_${Q.rowIndex}`,q=_.get(J),X=z.columns.map((Y)=>Y.getId());if(q){let Y=X.filter((Z)=>q.indexOf(Z)===-1);q.push(...Y)}else _.set(J,X)});let $;for(let z of _.values()){let Q=z.sort().join();if($===void 0){$=Q;continue}if($!==Q)return!1}return!0}removeAllCellRanges(_){if(this.isEmpty())return;if(this.onDragStop(),this.cellRanges.length=0,!_)this.dispatchChangedEvent(!1,!0)}isCellInAnyRange(_){return this.getCellRangeCount(_)>0}isCellInSpecificRange(_,f){let $=f.columns?.includes(_.column),z=this.isRowInRange(_,f);return $&&z}isColumnInAnyRange(_){let{beans:f}=this,$=O1(f),z=Wf(f);if(!$||!z)return!1;let Q=_.isColumn?[_]:_.getDisplayedLeafColumns();return this.findContainingRange({columns:Q,startRow:$,endRow:z},!0)!=null}findContainingRange({columns:_,startRow:f,endRow:$},z=!1){let Q=this.cellRanges;for(let J=Q.length-1;J>=0;J--){let q=Q[J],X=_.every((Z)=>q.columns.includes(Z)),Y=!1;if(z)Y=s(q.startRow,f)&&s(q.endRow,$);else{let Z=f&&this.isRowInRange(f,q),G=$&&this.isRowInRange($,q);Y=!!Z&&!!G}if(X&&Y)return q}}isBottomRightCell(_,f){let $=this.visibleCols.allCols,z=_.columns.map((Z)=>$.indexOf(Z)).sort((Z,G)=>Z-G),{startRow:Q,endRow:J}=_,q=Y_(Q,J)?J:Q,X=$.indexOf(f.column)===b(z),Y=f.rowIndex===q.rowIndex&&T0(f.rowPinned)===T0(q.rowPinned);return X&&Y}getCellRangeCount(_){return this.cellRanges.filter((f)=>this.isCellInSpecificRange(_,f)).length}isRowInRange(_,f){let $=this.getRangeStartRow(f),z=this.getRangeEndRow(f),Q=s(_,$),J=s(_,z);if(Q||J)return!0;let q=!Y_(_,$),X=Y_(_,z);return q&&X}intersectLastRange(_){let{editingWithRanges:f,suppressMultiRanges:$}=this.getMultiRangeContext();if(f||$||_&&this.dragging||this.isEmpty())return;let z=b(this.cellRanges),Q=this.getRangeStartRow(z),J=this.getRangeEndRow(z),q=[];for(let X of this.cellRanges.slice(0,-1)){let Y=this.getRangeStartRow(X),Z=this.getRangeEndRow(X),G=X.columns,E=G.filter((H)=>z.columns.indexOf(H)===-1);if(E.length===G.length){q.push(X);continue}if(Y_(J,Y)||Y_(Z,Q)){q.push(X);continue}let U=q.length;if(Y_(Y,Q)){let H={columns:[...G],startColumn:z.startColumn,startRow:{...Y},endRow:m_(this.beans,Q)};q.push(H)}if(E.length>0){let H={columns:E,startColumn:E.includes(z.startColumn)?z.startColumn:E[0],startRow:UO([{...Q},{...Y}]),endRow:HO([{...J},{...Z}])};q.push(H)}if(Y_(J,Z))q.push({columns:[...G],startColumn:z.startColumn,startRow:K_(this.beans,J),endRow:{...Z}});if(q.length-U===1)q[q.length-1].id=X.id}if(this.cellRanges=q,_)this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(_,f,$){_.createManagedBean(new GO(f,$))}setSelectionMode(_){this.selectionMode=_?1:0}refreshRangeStart(_){let{columns:f}=_,$=this.ensureRangeStartColumn(_);if(!$)return;let z=(Y,Z)=>{let G=_.columns.filter((E)=>E!==Y);if(Y)_.startColumn=Y,_.columns=Z?[Y,...G]:[...G,Y];else _.columns=G},{left:Q,right:J}=this.getRangeEdgeColumns(_);if($===f[0]&&$!==Q){z(Q,!0);return}if($===b(f)&&$===J)z(J,!1)}setNewestRangeStartCell(_){this.newestRangeStartCell=_}getColumnsFromParams(_,f,$){let z=!_&&!f&&!$,Q,J=!1;if(z||_)Q=this.getColumnsFromModel(z?void 0:_);else if(f&&$){if(Q=this.calculateColumnsBetween(f,$),Q?.length)J=Q[0]!==this.getColumnFromModel(f)}return Q?{columns:Q,startsOnTheRight:J}:void 0}verifyCellRanges(_){let{suppressMultiRanges:f}=this.getMultiRangeContext(),$=yq(_)&&f&&this.cellRanges.length>1;if($)j(93);return!$}forEachRowInRange(_,f){let $=this.getRangeStartRow(_),z=this.getRangeEndRow(_),Q=$;while(Q){if(f(Q),s(Q,z))break;Q=K_(this.beans,Q)}}forEachEditableCellInRanges(_,f){let{beans:$}=this;for(let z of _)this.forEachRowInRange(z,(Q)=>{let J=D_($,Q);if(!J)return;for(let q=0;q0,Z=f.ctrlKey||f.metaKey,G=!X||Z,E=O1(z),U=Wf(z);if(!E||!U)return;if(f.key===S.ENTER)f.preventDefault();if(f.shiftKey){let W=Q.root;if(!W)return;let B=_.isColumn?_:b(_.getLeafColumns()),K=this.findContainingRange({columns:[W],startRow:E,endRow:U},!0);if(!K){Q_(J,Q.lastCellRange),this.selectColumns(this.calculateColumnsBetween(W,B),E,U);return}this.updateRangeRowBoundary({cellRange:K,boundary:"end",cellPosition:{column:B,...U}});return}if(Y&&(q||!Z&&!X))this.removeAllCellRanges(!0);let H=(W,B)=>{let K=this.findContainingRange({columns:W,startRow:E,endRow:U},!0);if(K&&G)this.deselectColumnsFromRange(K,W);else{let L=this.selectColumns(W,E,U);if(L)Q.lastCellRange=L}Q.root=B};if(_.isColumn)H([_],_);else{let W=_.getDisplayedLeafColumns();H(W,W[0])}}deselectColumnsFromRange(_,f){if(K$(_.columns,f),f.includes(_.startColumn))_.startColumn=_.columns[0];if(_.columns.length===0)Q_(this.cellRanges,_);this.dispatchChangedEvent(!0,!0)}selectColumns(_,f,$){return this.addCellRange({columns:_,columnStart:_[0],columnEnd:b(_),rowStartIndex:f.rowIndex,rowStartPinned:f.rowPinned,rowEndIndex:$.rowIndex,rowEndPinned:$.rowPinned})}};function IY(_,f){return _!=null?{rowIndex:_,rowPinned:f}:void 0}function UO(_){let f;for(let $ of _)if(f===void 0||Y_(f,$))f=$;return f}function HO(_){let f;for(let $ of _)if(f===void 0||Y_($,f))f=$;return f}function WO(_,f){let{startRow:$,endRow:z}=_,Q=Y_($,z)?z:$,J=f.rowIndex===Q.rowIndex&&f.rowPinned===Q.rowPinned,q=_.columns[0],X=b(_.columns),Y=_.startColumn===q?X:q;return f.column===Y&&J}function DQ(_,f,$){let z;if($==="top")z=!_.startRow||!_.endRow||Y_(_.startRow,_.endRow)?"startRow":"endRow";else z=!_.startRow||!_.endRow||Y_(_.startRow,_.endRow)?"endRow":"startRow";_[z]=f??void 0}var cZ={moduleName:"CellSelection",version:$_,beans:[EO],dynamicBeans:{fillHandle:rV,rangeHandle:lV},apiFunctions:{getCellRanges:aV,addCellRange:oV,clearRangeSelection:PY,clearCellSelection:PY},dependsOn:[y_,f1,JQ],css:[sV]};function BO(_){return _.colModel.isPivotMode()}function KO(_,f,$){return _.pivotResultCols?.lookupPivotResultCol(f,$)??null}function LO(_,f){_.valueColsSvc?.setColumns(f,"api")}function FO(_){return _.valueColsSvc?.columns??[]}function DO(_,f){_.valueColsSvc?.removeColumns(f,"api")}function MO(_,f){_.valueColsSvc?.addColumns(f,"api")}function kO(_,f){_.pivotColsSvc?.setColumns(f,"api")}function SO(_,f){_.pivotColsSvc?.removeColumns(f,"api")}function AO(_,f){_.pivotColsSvc?.addColumns(f,"api")}function RO(_){return _.pivotColsSvc?.columns??[]}function jO(_,f){_.pivotResultCols?.setPivotResultCols(f,"api")}function VO(_){let f=_.pivotResultCols?.getPivotResultCols();return f?f.list:null}var yY="PivotRowTotal_",OO=({headerName:_},{headerName:f})=>{if(_&&!f)return 1;else if(!_&&f)return-1;else if(!_&&!f)return 0;if(_f)return 1;else return 0},PO=(_)=>(f,$)=>_(f.headerName,$.headerName),vO=class extends A{constructor(){super(...arguments);this.beanName="pivotColDefSvc"}wireBeans(_){this.colModel=_.colModel,this.pivotColsSvc=_.pivotColsSvc,this.valueColsSvc=_.valueColsSvc,this.colNames=_.colNames}postConstruct(){let _=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=_(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=_()});let f=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=f(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=f()})}createPivotColumnDefs(_){let f=this.createPivotColumnsFromUniqueValues(_);function $(Q,J=[]){return Q.forEach((q)=>{if(q.children!==void 0)$(q.children,J);else J.push(q)}),J}let z=$(f);return this.addRowGroupTotals(f,z),this.addExpandablePivotGroups(f,z),this.addPivotTotalsToGroups(f,z),f}createPivotColumnsFromUniqueValues(_){let f=this.pivotColsSvc?.columns??[],$=f.length;return this.recursivelyBuildGroup(0,_,[],$,f)}recursivelyBuildGroup(_,f,$,z,Q){if(_>=z)return this.buildMeasureCols($);let{pivotComparator:J}=Q[_].getColDef(),q=J?PO(J):OO,X=this.valueColsSvc?.columns;if(X?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&_===z-1){let Z=[];for(let G of f.keys()){let E=[...$,G],U=this.createColDef(X[0],G,E);U.columnGroupShow="open",Z.push(U)}return Z.sort(q),Z}let Y=[];for(let Z of f.keys()){let G=this.pivotDefaultExpanded===-1||_{let z=this.colNames.getDisplayNameForColumn($,"header"),Q=this.createColDef($,z,_);return Q.columnGroupShow="open",Q})}addExpandablePivotGroups(_,f){let $=this.gos.get("suppressExpandablePivotGroups");if($||this.gos.get("pivotColumnGroupTotals"))return;let z=(Q,J,q)=>{if("children"in Q){let{valueColsSvc:Z}=this,{columns:G=[]}=Z??{},E=new Map;Q.children.forEach((W)=>{z(W,J,E)});let U=!Q.children.some((W)=>W.children),H=U&&G.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let W of G){let B=this.colNames.getDisplayNameForColumn(W,"header"),K=this.createColDef(W,B,Q.pivotKeys);if(K.pivotTotalColumnIds=E.get(W.getColId()),K.columnGroupShow=!$?"closed":"open",K.aggFunc=W.getAggFunc(),!U||H)Q.children.push(K),J.push(K)}this.merge(q,E);return}if(!Q.pivotValueColumn)return;let X=Q.pivotValueColumn.getColId();if(q.has(X))q.get(X).push(Q.colId);else q.set(X,[Q.colId])};_.forEach((Q)=>{z(Q,f,new Map)})}addPivotTotalsToGroups(_,f){if(!this.gos.get("pivotColumnGroupTotals"))return;let $=this.gos.get("pivotColumnGroupTotals")==="after",z=this.valueColsSvc?.columns,Q=z?.map((J)=>J.getAggFunc());if(!Q||Q.length<1||!this.sameAggFuncs(Q))return;if(z){let J=z[0];_.forEach((q)=>{this.recursivelyAddPivotTotal(q,f,J,$)})}}recursivelyAddPivotTotal(_,f,$,z){let Q=_;if(!Q.children){let q=_;return q.colId?[q.colId]:null}let J=[];if(Q.children.forEach((q)=>{let X=this.recursivelyAddPivotTotal(q,f,$,z);if(X)J=J.concat(X)}),Q.children.length>1){let X=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),Y=this.createColDef($,X,_.pivotKeys,!0);Y.pivotTotalColumnIds=J,Y.aggFunc=$.getAggFunc(),Y.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;let Z=_.children;if(z)Z.push(Y);else Z.unshift(Y);f.push(Y)}return J}addRowGroupTotals(_,f){if(!this.gos.get("pivotRowTotals"))return;let $=this.gos.get("pivotRowTotals")==="after",Q=(this.valueColsSvc?.columns??[]).slice();if(!$)Q.reverse();let J=Q.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let q=0;qJ.data?.[J.colDef.field],Q.pivotKeys=$,Q.pivotValueColumn=_,Q.filter===!0)Q.filter="agNumberColumnFilter";return Q}sameAggFuncs(_){if(_.length==1)return!0;for(let f=1;f<_.length;f++)if(_[f]!==_[0])return!1;return!0}merge(_,f){f.forEach(($,z)=>{let J=[..._.has(z)?_.get(z):[],...$];_.set(z,J)})}generateColumnGroupId(_){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(($)=>$.getColId()).join("-")}_${_.join("-")}`}generateColumnId(_,f){return`pivot_${(this.pivotColsSvc?.columns??[]).map((z)=>z.getColId()).join("-")}_${_.join("-")}_${f}`}createColDefsFromFields(_){let f=new Map;for(let Q=0;Q<_.length;Q++){let q=_[Q].split(this.fieldSeparator),X=f;for(let Y=0;Y{let Y=[];for(let[E,U]of q){let H=$(`${Q}${this.fieldSeparator}${E}`,E,U,X+1);Y.push(H)}if(Y.length===0){let E=this.colModel.getColDefCol(J);if(E){let H=this.colNames.getDisplayNameForColumn(E,"header")??J,W=this.createColDef(E,H,void 0,!1);return W.colId=Q,W.aggFunc=E.getAggFunc(),W.valueGetter=(B)=>B.data?.[Q],W}return{colId:Q,headerName:J,valueGetter:(H)=>H.data?.[Q]}}if(this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&Y.length===1&&"colId"in Y[0])return Y[0].headerName=J,Y[0];return{openByDefault:this.pivotDefaultExpanded===-1||X{Q.forEach((J)=>{if(v(J.children)){let X=J;if($)$(X);z(X.children)}else{let X=J;if(f)f(X)}})};if(_)z(_)}},bY="Exceeded maximum allowed pivot column count.",RQ=(_)=>{let f={};return _.forEach(($,z)=>f[z]=$ instanceof Map?RQ($):$),f},IO=class extends A{constructor(){super(...arguments);this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(_){this.valueSvc=_.valueSvc,this.colModel=_.colModel,this.pivotResultCols=_.pivotResultCols,this.rowGroupColsSvc=_.rowGroupColsSvc,this.valueColsSvc=_.valueColsSvc,this.pivotColsSvc=_.pivotColsSvc,this.pivotColDefSvc=_.pivotColDefSvc}execute(_){if(this.colModel.isPivotActive())return this.executePivotOn(_);else return this.executePivotOff()}executePivotOff(){if(this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent())return this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),!0;return!1}executePivotOn(_){let f=this.valueColsSvc?.columns.length??1,$=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=$===-1?-1:$/f;let z;try{z=this.bucketUpRowNodes(_)}catch(L){if(L.message===bY)return this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:L.message}),this.lastTimeFailed=!0,!1;throw L}let Q=this.setUniqueValues(z),J=this.valueColsSvc?.columns??[],q=J.map((L)=>`${L.getId()}-${L.getColDef().headerName}`).join("#"),X=J.map((L)=>L.getAggFunc().toString()).join("#"),Y=this.aggregationColumnsHashLastTime!==q,Z=this.aggregationFuncsHashLastTime!==X;this.aggregationColumnsHashLastTime=q,this.aggregationFuncsHashLastTime=X;let G=(this.rowGroupColsSvc?.columns??[]).map((L)=>L.getId()).join("#"),E=G!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=G;let U=this.gos.get("pivotRowTotals"),H=this.gos.get("pivotColumnGroupTotals"),W=this.gos.get("suppressExpandablePivotGroups"),B=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),K=U!==this.pivotRowTotalsLastTime||H!==this.pivotColumnGroupTotalsLastTime||W!==this.suppressExpandablePivotGroupsLastTime||B!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=U,this.pivotColumnGroupTotalsLastTime=H,this.suppressExpandablePivotGroupsLastTime=W,this.removePivotHeaderRowWhenSingleValueColumnLastTime=B,this.lastTimeFailed||Q||Y||E||Z||K){let L=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(L,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(_){if(!wz(RQ(this.uniqueValues),RQ(_)))return this.uniqueValues=_,!0;return!1}bucketUpRowNodes(_){this.currentUniqueCount=0;let f=new Map;R_(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,_,(z)=>{if(z.leafGroup)z.childrenMapped=null});let $=(z)=>{if(z.leafGroup)this.bucketRowNode(z,f);else{let Q=z.childrenAfterFilter;if(Q)for(let J=0,q=Q.length;Jthis.maxUniqueValues;if(q&&U)throw Error(bY)}if(!Q.has(E))Q.set(E,[]);Q.get(E).push(G)}if($===f.length-1)return Q;let X=new Map;for(let Y of Q.keys())X.set(Y,this.bucketChildren(Q.get(Y),f,$+1,z.get(Y)));return X}},yO={moduleName:"SharedPivot",version:$_,beans:[TO,vO,yZ],apiFunctions:{isPivotMode:BO,getPivotResultColumn:KO,setValueColumns:LO,getValueColumns:FO,removeValueColumns:DO,addValueColumns:MO,setPivotColumns:kO,removePivotColumns:SO,addPivotColumns:AO,getPivotColumns:RO,setPivotResultColumns:jO,getPivotResultColumns:VO},dependsOn:[gZ,wJ]},pZ={moduleName:"Pivot",version:$_,rowModels:["clientSide"],beans:[IO],dependsOn:[yO,VV,wQ]};var YC=String.fromCodePoint(31,41150,8291);var nZ=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],CY=new Map;for(let _ of nZ){let f=CY.get(_.symbol)??[];f.push(_),CY.set(_.symbol,f)}var ZC=[...new Set(nZ.map((_)=>_.symbol))].sort((_,f)=>f.length-_.length);var GC=Symbol("WrappedFunctionMarker");var bO={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},CO=new Set(["columnLineCombo","areaColumnCombo","customCombo"]);function wO(_){return CO.has(_)}function xO(_){return _==="doughnut"?"donut":_}function NO(_){return bO[_]}var gO=["number","category","grouped-category","log","time"];var EC=gO.reduce((_,f)=>({..._,[f]:{title:{_enabledFromTheme:!0}}}),{});var NQ=(_)=>{return(f)=>{if(f==null)return!0;return _(f)}};var hO=["doughnut"];function uO(_){return!!NO(_)||wO(_)}function iO(_){return hO.includes(_)}var HC=NQ((_)=>{if(uO(_))return!0;if(iO(_)){let f=xO(_);return Yf(`The chart type '${_}' has been deprecated. Please use '${f}' instead.`),f}return!1}),WC=NQ((_)=>{return typeof _==="object"}),BC=NQ((_)=>{return typeof _==="object"}),KC=NQ((_)=>{return typeof _==="string"||typeof _==="function"});function dZ(_){return _.map((f,$,z)=>f.map((Q,J)=>z.slice(0,$+1).reduce((q,X)=>q+X[J],0)))}function tZ(_){let f=_.map(($,z)=>_.reduce((Q,J)=>Math.max(Q,J[z]),0));return _.map(($)=>$.map((z,Q)=>z/f[Q]*19))}var rZ=[[1,3,5],[2,6,4],[5,3,1]];var mO=dZ(rZ);var LC=tZ(mO);var cO=rZ;var pO=dZ(cO);var FC=tZ(pO);var nO=["number","category","time","grouped-category"],dO=["angle-category","angle-number","radius-category","radius-number"],DC=[...nO,...dO];kq.registerModules([s5,O5,l5,m5,r5,x5,j5,VZ,cZ,pZ,iZ,R2,KZ,FZ,MZ,SZ,hZ]);var xx=(_)=>{let{data:f,options:$,api:z,on:Q,class:J,style:q="height: 100%; width: 100%;"}=_,X=null,Y=()=>{return document.documentElement.getAttribute("data-theme")==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches},Z=(E)=>{return E?"ag-theme-alpine-dark":"ag-theme-alpine"};return bf("div",{class:J,style:q,ref:(E)=>{if(!E)return;let U=typeof f==="function"?f():f,H=typeof $==="function"?$():$,W=["onFilterChanged","onModelUpdated","onGridSizeChanged","onFirstDataRendered","onRowValueChanged","onSelectionChanged","onCellClicked","onCellDoubleClicked","onCellValueChanged","onRowClicked","onSortChanged","onContextMenu","onColumnResized","onColumnMoved","onRowDataUpdated","onCellEditingStarted","onCellEditingStopped","onPaginationChanged","onBodyScroll"],B={};W.forEach((k)=>{if(Q?.[k])B[k]=(R)=>Q[k](R)});let K={...H,theme:Z(Y()),rowData:U||[],onGridReady:(k)=>{if(X=k.api,z)z.current=X;if(Q?.onGridReady)Q.onGridReady(k);if(H?.autoSizeColumns)setTimeout(()=>{if(X&&!X.isDestroyed()){let R=X.getColumns();if(R?.length)X.autoSizeColumns(R)}},100)},...B};X=ZQ(E,K);let L=e0(f,()=>{if(!X||X.isDestroyed())return;let k=typeof f==="function"?f():f;if(Array.isArray(k)){let R=X.getGridOption("rowData");if(k!==R)X.setGridOption("rowData",k)}},!0),F=e0(Y,()=>{if(X&&!X.isDestroyed()){let k=Y(),R=Z(k),O=X.getGridOption("theme");if(R!==O)X.setGridOption("theme",R)}},!0),D=["pagination","paginationPageSize","suppressRowClickSelection","rowSelection","enableCellTextSelection","ensureDomOrder","stopEditingWhenCellsLoseFocus","enterMovesDown","enterMovesDownAfterEdit"],M=e0($,()=>{if(!X||X.isDestroyed()||!$)return;let k=typeof $==="function"?$():$;D.forEach((R)=>{if(k[R]!==void 0)try{X.setGridOption(R,k[R])}catch(O){}})},!0);o0(()=>{if(L(),F(),M(),X&&!X.isDestroyed()){if(X.destroy(),z)z.current=null;X=null}})}})};export{Y5 as themeQuartz,hH as iconSetQuartzLight,ZQ as createGrid,kq as ModuleRegistry,xx as Grid}; +var{defineProperty:BQ,getOwnPropertyNames:g9}=Object;var GU=Object.prototype.hasOwnProperty;function DU(G){return this[G]}var L=(G,D,z)=>{var B=g9(D);for(let Q of B)if(!GU.call(G,Q)&&Q!=="default")BQ(G,Q,{get:DU.bind(D,Q),enumerable:!0});if(z){for(let Q of B)if(!GU.call(z,Q)&&Q!=="default")BQ(z,Q,{get:DU.bind(D,Q),enumerable:!0});return z}};var T9=(G)=>G;function y9(G,D){this[G]=T9.bind(null,D)}var x9=(G,D)=>{for(var z in D)BQ(G,z,{get:D[z],enumerable:!0,configurable:!0,set:y9.bind(D,z)})};import{ModuleRegistry as Hn,ValidationModule as _n,ColumnAutoSizeModule as kn,CellStyleModule as wn,QuickFilterModule as Kn,RowSelectionModule as fn,TextEditorModule as Nn,ClientSideRowModelModule as Fn,themeQuartz as WzG,iconSetQuartzLight as qzG,createGrid as En}from"ag-grid-community";var $={};x9($,{getMultipleSheetsAsExcel:()=>x1,exportMultipleSheetsAsExcel:()=>mX,distributeGroupValue:()=>i8,_AgVirtualListDragFeature:()=>C6,_AgVirtualList:()=>R6,_AgTabbedLayout:()=>YJ,_AgSliderSelector:()=>WG,_AgSlider:()=>kG,_AgPanel:()=>LJ,_AgMenuList:()=>uB,_AgMenuItemRenderer:()=>O6,_AgMenuItemComponent:()=>NB,_AgInputRangeSelector:()=>b6,_AgInputRange:()=>V6,_AgGroupComponentSelector:()=>p,_AgGroupComponent:()=>jG,_AgDialog:()=>SJ,_AgContextMenuService:()=>v6,_AgColorPickerSelector:()=>uY,_AgColorPicker:()=>XJ,ViewportRowModelModule:()=>a7,TreeDataModule:()=>$8,StatusBarModule:()=>xB,SparklinesModule:()=>T8,SideBarModule:()=>jD,SetFilterModule:()=>R7,ServerSideRowModelModule:()=>L8,ServerSideRowModelApiModule:()=>S8,RowNumbersModule:()=>bJ,RowGroupingPanelModule:()=>o7,RowGroupingModule:()=>VJ,RowGroupingEditModule:()=>d8,RichSelectModule:()=>I7,RangeSelectionModule:()=>qb,PivotModule:()=>pB,NewFiltersToolPanelModule:()=>B8,MultiFilterModule:()=>iB,MenuModule:()=>Qf,MasterDetailModule:()=>lB,LicenseManager:()=>j1,IntegratedChartsModule:()=>j9,GroupFilterModule:()=>r7,GridChartsModule:()=>Sn,FormulaModule:()=>g8,FindModule:()=>x8,FiltersToolPanelModule:()=>z8,ExcelExportModule:()=>cB,ContextMenuModule:()=>FJ,ColumnsToolPanelModule:()=>yB,ColumnMenuModule:()=>W0,ClipboardModule:()=>nB,CellSelectionModule:()=>Xz,BatchEditModule:()=>c8,AllEnterpriseModule:()=>Yn,AiToolkitModule:()=>o6,AggregationModule:()=>MJ,AdvancedFilterModule:()=>l6});L($,XzG);import{BeanStub as c9,_getDocument as h9}from"ag-grid-community";import{_exists as i9,_logPreInitWarn as n9}from"ag-grid-community";import{Component as l9,RefPlaceholder as p9}from"ag-grid-community";import{BaseCreator as r9,_addGridCommonParams as zU,_downloadFile as P1,_getHeaderClassesFromColDef as a9,_getHeaderRowCount as e9,_warn as W6}from"ag-grid-community";import{BaseGridSerializingSession as G$,_addGridCommonParams as QQ,_isExpressionString as D$,_last as z$,_mergeDeep as B$,_warn as Q$}from"ag-grid-community";import{_escapeString as J$}from"ag-grid-community";import{_escapeString as H$,_warn as ZJ}from"ag-grid-community";import{_escapeString as JU}from"ag-grid-community";import{_escapeString as NL}from"ag-grid-community";import{_escapeString as gL}from"ag-grid-community";import{_escapeString as HS}from"ag-grid-community";import{_escapeString as LU}from"ag-grid-community";import{_errMsg as vX}from"ag-grid-community";import{KeyCode as MG,RefPlaceholder as sX,_AgTabGuardComp as oX,_createAgElement as rX,_getAriaPosInSet as aX,_observeResize as eX,_requestAnimationFrame as YU,_setAriaLabel as GY,_setAriaPosInSet as DY,_setAriaRole as zY,_setAriaSetSize as BY,_waitUntil as QY}from"ag-grid-community";import{AutoScrollService as ZY,_AgBeanStub as $Y,_radioCssClass as WU}from"ag-grid-community";import{AgAbstractLabel as SY,AgInputNumberFieldSelector as XY,RefPlaceholder as LQ}from"ag-grid-community";import{AgAbstractInputField as YY}from"ag-grid-community";import{AgPickerField as WY,_createElement as qU}from"ag-grid-community";import{KeyCode as xG,RefPlaceholder as cG,_AgComponentStub as qY,_exists as HY,_setDisplayed as _Y}from"ag-grid-community";import{AgInputTextField as kY,RefPlaceholder as wY}from"ag-grid-community";import{_AgComponentStub as FY,_AgTabGuardFeature as EY,_findNextFocusableElement as IY,_setDisplayed as _U}from"ag-grid-community";import{RefPlaceholder as E0,_AgComponentStub as kU,_AgPositionableFeature as MY,_getActiveDomElement as AY,_getInnerHeight as RY,_getInnerWidth as CY,_isVisible as VY,_setDisplayed as bY}from"ag-grid-community";import{AgPromise as SQ,KeyCode as AG,_AgTabGuardComp as jY,_createAgElement as PY,_last as gY}from"ag-grid-community";import{KeyCode as wU,_AgBeanStub as TY,_createElement as yY,_setAriaDisabled as xY,_setAriaExpanded as cY,_setAriaHasPopup as hY,_setAriaRole as iY}from"ag-grid-community";import{KeyCode as nY,_AgTabGuardComp as dY}from"ag-grid-community";import{_AgBeanStub as pY,_AgComponentStub as mY,_anchorElementToMouseMoveEvent as KU,_createAgElement as tY,_focusInto as sY,_getPageBody as oY,_getRootNode as rY,_isPromise as aY,_isVisible as eY}from"ag-grid-community";import{_AgComponentStub as B4,_createAgElement as I0,_isNodeOrElement as Q4,_setAriaChecked as J4,_setAriaExpanded as U4}from"ag-grid-community";import{KeyCode as wz,RefPlaceholder as fU,_AgTabGuardComp as Z4,_clearElement as $4,_createAgElement as M0,_findNextFocusableElement as L4,_focusInto as NU,_getActiveDomElement as FU,_getDocument as S4,_isKeyboardMode as X4,_setAriaLabel as EU,_setAriaRole as Y4}from"ag-grid-community";import{TabGuardClassNames as W4,_FOCUS_MANAGED_CLASS as q4,_findFocusableElements as H4}from"ag-grid-community";import{AgCheckboxSelector as k4,AgToggleButton as w4,KeyCode as Kz,RefPlaceholder as Gz,_AgComponentStub as j6,_isComponent as XQ,_removeFromParent as K4,_setAriaExpanded as f4,_setAriaRole as YQ,_setDisplayed as AD}from"ag-grid-community";import{TooltipModule as M4,_FilterCoreModule as A4,_FilterValueModule as R4,_PopupModule as C4,_SharedDragAndDropModule as V4}from"ag-grid-community";import{BeanStub as P4,_exists as g4,_parseDateTimeFromString as IU,_serialiseDate as MU,_toStringOrNull as xD}from"ag-grid-community";import{_parseBigIntOrNull as P6}from"ag-grid-community";import{BeanStub as l4,_exists as p4,_isClientSideRowModel as m4,_isServerSideRowModel as t4,_warn as s4}from"ag-grid-community";import{BeanStub as o4,_getAbsoluteHeight as r4,_getAbsoluteWidth as a4,_removeFromParent as e4}from"ag-grid-community";import{_STOP_PROPAGATION_CALLBACKS as GW,_focusNextGridCoreContainer as DW}from"ag-grid-community";import{AgFilterButtonSelector as zW,Component as BW,RefPlaceholder as fz,_createIconNoSpan as QW,_makeNull as JW,_setDisabled as RU,_setDisplayed as CU}from"ag-grid-community";import{AgInputTextFieldSelector as UW,Component as ZW,KeyCode as RG,RefPlaceholder as $W,_isNothingFocused as LW,_makeNull as VU}from"ag-grid-community";import{AgPopupComponent as SW,KeyCode as XW,RefPlaceholder as YW,_exists as WW,_fuzzySuggestions as qW,_isVisible as HW}from"ag-grid-community";import{_STOP_PROPAGATION_CALLBACKS as _W}from"ag-grid-community";import{Component as kW,_clearElement as wW,_createElement as KW,_exists as fW}from"ag-grid-community";import{Component as CW,KeyCode as Nz,_clearElement as VW,_findNextFocusableElement as bW,_focusInto as vW,_getActiveDomElement as OW,_getFloatingFiltersHeight as uW,_setAriaColIndex as jW,_setAriaColSpan as PW,_setAriaRole as gW,_setAriaRowIndex as TW,_setDisplayed as yW}from"ag-grid-community";import{Component as hW,FilterButtonComp as iW,RefPlaceholder as nW,_exists as dW,_removeFromParent as lW}from"ag-grid-community";import{BeanStub as pW,DragSourceType as mW}from"ag-grid-community";import{Component as sW,RefPlaceholder as oW,_setAriaLabel as rW,_setAriaLevel as aW}from"ag-grid-community";import{AgInputTextFieldSelector as eW,_setAriaLabel as Gq,_setAriaLabelledBy as Dq,_setDisplayed as zq,_stopPropagationForAgGrid as Bq}from"ag-grid-community";import{AgInputTextFieldSelector as vU,AgPickerField as Qq,KeyCode as o,RefPlaceholder as OU,_addGridCommonParams as Jq,_addOrRemoveAttribute as Uq,_clearElement as HQ,_createIconNoSpan as Zq,_debounce as _Q,_exists as $q,_fuzzySuggestions as Lq,_getActiveDomElement as uU,_getEditorRendererDetails as Sq,_isElementOverflowingCallback as Xq,_isEventFromPrintableCharacter as Yq,_isVisible as Wq,_setAriaActiveDescendant as qq,_setScrollLeft as jU,_stopPropagationForAgGrid as Hq}from"ag-grid-community";import{_consoleError as kQ}from"ag-grid-community";import{Component as Kq,KeyCode as oG,_clearElement as fq,_findFocusableElements as Nq,_findNextFocusableElement as Fq,_getActiveDomElement as PU,_getDocument as Eq,_setAriaPosInSet as Iq,_setAriaRole as Mq,_setAriaSetSize as Aq}from"ag-grid-community";import{Component as Rq,RefPlaceholder as gU}from"ag-grid-community";import{KeyCode as uq,_addOrRemoveAttribute as jq,_createElement as TU,_createIconNoSpan as Pq,_requestAnimationFrame as wQ,_setAriaActiveDescendant as gq,_setAriaControlsAndLabel as Tq,_setAriaLabel as yq,_setDisplayed as kD}from"ag-grid-community";import{Component as xq,_addGridCommonParams as cq,_clearElement as hq,_createElement as yU,_exists as Fz,_getEditorRendererDetails as iq,_isElementOverflowingCallback as nq,_setAriaSelected as dq,_toString as lq}from"ag-grid-community";import{BeanStub as eq,KeyCode as Ez,_getActiveDomElement as iU,_isStopPropagationForAgGrid as nU,_stopPropagationForAgGrid as R0}from"ag-grid-community";import{DragSourceType as zH,KeyCode as KQ,RefPlaceholder as rG,TabGuardComp as BH,_createElement as dU,_createIconNoSpan as Iz,_removeAriaExpanded as QH,_setAriaDisabled as lU,_setAriaExpanded as pU,_setAriaLabel as C0,_setAriaLevel as JH,_setDisplayed as V0,_setVisible as UH,_stopPropagationForAgGrid as fQ}from"ag-grid-community";import{Component as ZH,_exists as Mz,_removeFromParent as $H,_toStringOrNull as LH}from"ag-grid-community";import{AgInputDateField as b0,AgInputNumberField as XH,AgInputTextField as v0,Component as YH,KeyCode as NQ,RefPlaceholder as mU,_exists as WH,_setAriaDescribedBy as qH,_setAriaLabel as HH,_setDisplayed as tU,_stopPropagationForAgGrid as FQ}from"ag-grid-community";import{Component as KH}from"ag-grid-community";import{AgInputTextFieldSelector as NH,_setAriaLabel as FH,_setAriaLabelledBy as EH,_stopPropagationForAgGrid as IH}from"ag-grid-community";import{ColumnApiModule as gH}from"ag-grid-community";import{STRUCTURED_SCHEMA_FEATURES as TH}from"ag-grid-community";import{_ColumnMoveModule as E_,_PopupModule as I_,_SharedDragAndDropModule as M_}from"ag-grid-community";import{_HorizontalResizeModule as A_}from"ag-grid-community";import{_unwrapUserComp as R_}from"ag-grid-community";import{BeanStub as y_}from"ag-grid-community";import{Component as x_,KeyCode as O0,ManagedFocusFeature as c_,RefPlaceholder as h_,_addFocusableContainerListener as i_,_addGridCommonParams as sU,_findNextFocusableElement as n_,_focusInto as d_,_focusNextGridCoreContainer as l_,_getActiveDomElement as oU,_isVisible as p_,_removeFromParent as rU,_setAriaControlsAndLabel as m_,_skipFocusableContainerListenerForAgGrid as t_,_warn as IQ}from"ag-grid-community";import{Component as o_,KeyCode as r_,_clearElement as a_,_focusNextGridCoreContainer as e_,_stopPropagationForAgGrid as Gk}from"ag-grid-community";import{Component as Dk,RefPlaceholder as MQ,_createIconNoSpan as zk,_setAriaExpanded as Bk}from"ag-grid-community";import{_warn as r6}from"ag-grid-community";import{Component as Yk,RefPlaceholder as Wk}from"ag-grid-community";import{Component as qk}from"ag-grid-community";import{_warn as Mk}from"ag-grid-community";import{Component as Ak,FilterButtonComp as Rk,_addGridCommonParams as Ck,_areEqual as aG,_clearElement as Vk,_last as bk,_warn as vk}from"ag-grid-community";import{Component as Ok,PositionableFeature as uk,RefPlaceholder as eU}from"ag-grid-community";import{AgCheckboxSelector as Pk,AgInputTextFieldSelector as gk,Component as Tk,KeyCode as yk,RefPlaceholder as AQ,_createIconNoSpan as RQ,_debounce as xk,_setDisplayed as hD}from"ag-grid-community";import{Component as dk,DragSourceType as lk,_exists as GZ,_setAriaLabel as pk,_setAriaLevel as mk,_warn as tk,isProvidedColumnGroup as sk}from"ag-grid-community";import{AgProvidedColumnGroup as ok,_warn as rk,isProvidedColumnGroup as ak}from"ag-grid-community";import{_last as ek}from"ag-grid-community";import{LocalEventService as z3}from"ag-grid-community";import{isProvidedColumnGroup as B3}from"ag-grid-community";import{AgCheckboxSelector as Q3,Component as J3,DragSourceType as U3,KeyCode as CQ,RefPlaceholder as Az,TouchListener as zZ,_createIcon as BZ,_createIconNoSpan as Z3,_getShouldDisplayTooltip as $3,_getToolPanelClassesFromColDef as L3,_setAriaDescribedBy as S3,_setAriaExpanded as X3,_setAriaLabel as Y3,_setDisplayed as VQ}from"ag-grid-community";import{Component as w3,_createIconNoSpan as QZ,_focusInto as K3,isColumn as f3,isProvidedColumnGroup as N3}from"ag-grid-community";import{AgPromise as $Z,_STOP_PROPAGATION_CALLBACKS as E3,_addGridCommonParams as I3,_warn as M3}from"ag-grid-community";import{_getRootNode as A3,_isBrowserFirefox as R3,_isBrowserSafari as C3}from"ag-grid-community";import{AgCheckboxSelector as T3,Component as y3,DragSourceType as x3,KeyCode as c3,RefPlaceholder as XZ,TouchListener as h3,_createIconNoSpan as i3,_getShouldDisplayTooltip as n3,_getToolPanelClassesFromColDef as d3,_setAriaDescribedBy as l3,_setAriaLabel as p3,_setDisplayed as m3,_warn as t3}from"ag-grid-community";import{BeanStub as Jw}from"ag-grid-community";import{_addFocusableContainerListener as Uw,_createIconNoSpan as Zw}from"ag-grid-community";import{DragSourceType as YZ,_shouldUpdateColVisibilityAfterGroup as $w}from"ag-grid-community";import{Component as Lw,KeyCode as iD,ManagedFocusFeature as Sw,PositionableFeature as Xw,_areEqual as Yw,_clearElement as WZ,_createElement as u0,_createIconNoSpan as Ww,_findFocusableElements as qw,_findNextFocusableElement as vQ,_getActiveDomElement as qZ,_isKeyboardMode as Hw,_last as _w,_setAriaHidden as kw,_setAriaLabel as ww,_setAriaPosInSet as Kw,_setAriaRole as fw,_setAriaSetSize as Nw}from"ag-grid-community";import{Component as Iw,DragSourceType as Mw,KeyCode as nD,RefPlaceholder as Aw,_createElement as Rw}from"ag-grid-community";import{Component as Cw,KeyCode as _Z,RefPlaceholder as OQ,TouchListener as Vw,_createIconNoSpan as kZ,_setAriaLabel as bw,_setDisplayed as vw}from"ag-grid-community";import{_addFocusableContainerListener as Pw,_createIconNoSpan as gw}from"ag-grid-community";import{_createIconNoSpan as Tw}from"ag-grid-community";import{AgToggleButtonSelector as xw,Component as cw,RefPlaceholder as hw}from"ag-grid-community";import{BeanStub as lw}from"ag-grid-community";import{BeanStub as pw,_applyColumnState as J0,_areEqual as j0,isColumnGroupAutoCol as mw,isSpecialCol as tw}from"ag-grid-community";import{_ColumnMoveModule as DK,_PopupModule as zK,_SharedDragAndDropModule as BK,_SharedMenuModule as QK}from"ag-grid-community";import{BeanStub as JK,_createIconNoSpan as f7,_warn as fZ}from"ag-grid-community";import{BeanStub as LK,_addGridCommonParams as SK,_findNextFocusableElement as XK}from"ag-grid-community";import{BeanStub as WK,_addGridCommonParams as qK,_getDisplaySortForColumn as HK,_getGrandTotalRow as _K,_isClientSideRowModel as kK,_isLegacyMenuEnabled as wK}from"ag-grid-community";import{BeanStub as KK,_createIconNoSpan as a,_exists as fK,_getRowNode as NK,_normalizeSortType as FK,_resetColumnState as EK,_warn as IK}from"ag-grid-community";import{BeanStub as vK,_addGridCommonParams as OK,_attemptToRestoreCellFocus as uK,_exists as NZ,_getGrandTotalRow as jK,_isIOSUserAgent as PK}from"ag-grid-community";import{AgPromise as TQ,BeanStub as F7,Component as TK,FilterComp as yK,RefPlaceholder as xK,_createElement as cK,_createIconNoSpan as yQ,_error as hK,_focusInto as iK,_isColumnMenuAnchoringEnabled as nK,_isLegacyMenuEnabled as P0,_setColMenuVisible as EZ,_warn as dK,isColumn as lK}from"ag-grid-community";import{BeanStub as aK,_findTabbableParent as eK,_getActiveDomElement as Gf,_isNothingFocused as IZ,_isVisible as Df,_last as zf}from"ag-grid-community";import{_EditCoreModule as Jf}from"ag-grid-community";import{AgAbstractCellEditor as Uf,KeyCode as MZ,_addGridCommonParams as Zf,_consoleError as $f,_missing as AZ,_warn as Cz}from"ag-grid-community";import{_ColumnFilterModule as Sf}from"ag-grid-community";import{AgInputTextFieldSelector as Xf,KeyCode as Vz,ProvidedFilter as Yf,RefPlaceholder as bz,_areEqual as Wf,_createIconNoSpan as qf,_exists as Hf,_getActiveDomElement as _f,_makeNull as CZ,_setDisplayed as xQ,_warn as vz}from"ag-grid-community";import{AgCheckboxSelector as wf,Component as Kf,RefPlaceholder as g0,_addGridCommonParams as ff,_createIcon as cQ,_getCellRendererDetails as VZ,_getShouldDisplayTooltip as Nf,_isShowTooltipWhenTruncated as Ff,_setAriaChecked as Ef,_setAriaDescribedBy as If,_setAriaExpanded as Mf,_setAriaLabel as Af,_setAriaLabelledBy as Rf,_setAriaLevel as Cf,_setDisplayed as hQ,_toStringOrNull as bZ,_warn as Vf}from"ag-grid-community";import{_defaultComparator as uf,_last as jf,_makeNull as Pf,_toStringOrNull as gf,_translate as Tf,_warn as yf}from"ag-grid-community";import{_getDateParts as nf,_warn as df}from"ag-grid-community";import{BeanStub as tf,_addGridCommonParams as sf,_debounce as of,_error as OZ,_isClientSideRowModel as rf,_last as af,_makeNull as iQ,_toStringOrNull as nQ}from"ag-grid-community";import{AgPromise as ef,BeanStub as GN,_makeNull as DN}from"ag-grid-community";import{AgPromise as T0,BeanStub as QN,_addGridCommonParams as JN,_defaultComparator as uZ,_error as UN,_makeNull as ZN,_warn as jZ}from"ag-grid-community";import{AgInputTextFieldSelector as SN,Component as XN,RefPlaceholder as YN,_error as WN}from"ag-grid-community";import{_KeyboardNavigationModule as _N}from"ag-grid-community";import{AgPromise as y0,Component as kN,RefPlaceholder as lQ,_addFocusableContainerListener as wN,_addGridCommonParams as PZ,_clearElement as pQ,_removeFromParent as KN,_warn as fN}from"ag-grid-community";import{Component as CN,RefPlaceholder as Oz,_createCellId as VN,_exists as bN,_formatNumberCommas as vN,_getRowBelow as ON,_getRowNode as uN,_isRowBefore as jN,_missing as mQ,_parseBigIntOrNull as PN}from"ag-grid-community";import{Component as gN,RefPlaceholder as gZ,_addGridCommonParams as TN}from"ag-grid-community";import{_formatNumberCommas as lN}from"ag-grid-community";import{_formatNumberCommas as mN}from"ag-grid-community";import{_formatNumberCommas as TZ}from"ag-grid-community";import{_formatNumberCommas as oN}from"ag-grid-community";import{_unwrapUserComp as aN}from"ag-grid-community";import{BeanStub as GF}from"ag-grid-community";import{_SharedExportModule as zF}from"ag-grid-community";import{_warn as BF}from"ag-grid-community";import{_ColumnFilterModule as LF}from"ag-grid-community";import{AgPromise as eG,FilterWrapperComp as SF,LocalEventService as XF,ProvidedFilter as YF,_getFilterModel as WF,_refreshFilterUi as qF,_refreshHandlerAndUi as yZ,_removeFromArray as HF,_updateFilterModel as _F}from"ag-grid-community";import{AgPromise as dD,KeyCode as uz,TabGuardComp as kF,_createElement as wF,_focusInto as KF,_getActiveDomElement as fF,_isNothingFocused as NF,_setAriaRole as FF}from"ag-grid-community";import{ProvidedFilter as EF}from"ag-grid-community";import{BeanStub as MF,_removeFromArray as AF,_warn as xZ}from"ag-grid-community";import{BeanStub as CF,_getDefaultSimpleFilter as VF,_getFilterParamsForDataType as bF}from"ag-grid-community";import{AgPromise as tQ,_getFilterDetails as OF,_isUseApplyButton as uF,_refreshFilterUi as jF,_warn as PF}from"ag-grid-community";import{AgPromise as gF,Component as TF,_clearElement as yF,_error as xF,_getDefaultFloatingFilterType as cF,_getFloatingFilterCompDetails as hF,_mergeDeep as iF,_setDisplayed as jz}from"ag-grid-community";import{_ColumnFilterModule as lF,_PopupModule as pF}from"ag-grid-community";import{BeanStub as mF,_exists as tF}from"ag-grid-community";import{BeanStub as oF,_exists as cZ,_last as rF}from"ag-grid-community";import{BeanStub as LE,_getGroupAggFiltering as SE}from"ag-grid-community";import{BeanStub as HE,_forEachChangedGroupDepthFirst as hZ,_getGrandTotalRow as _E,_getGroupAggFiltering as kE,_warn as wE}from"ag-grid-community";import{BeanStub as EE,_forEachChangedGroupDepthFirst as IE,_getGroupAggFiltering as ME}from"ag-grid-community";import{BeanStub as RE,_addGridCommonParams as CE,_getGrandTotalRow as VE,_getGroupTotalRowCallback as bE,_warn as vE}from"ag-grid-community";import{_createRowNodeSibling as OE}from"ag-grid-community";import{BaseColsService as PE,_exists as gE,_removeFromArray as TE,_warn as yE}from"ag-grid-community";import{BaseColsService as xE,_removeFromArray as cE}from"ag-grid-community";import{BaseColsService as hE,_removeFromArray as iE,_shouldUpdateColVisibilityAfterGroup as nE}from"ag-grid-community";import{AgColumn as lE,BeanStub as pE,GROUP_AUTO_COLUMN_ID as iZ,_addColumnDefaultAndTypes as mE,_applyColumnState as tE,_areColIdsEqual as sE,_columnsMatch as oE,_convertColumnEventSourceType as rE,_destroyColumnTree as nZ,_getColumnStateFromColDef as aE,_isColumnsSortingCoupledToGroup as eE,_isGroupHideColumnsUntilExpanded as GI,_isGroupMultiAutoColumn as DI,_isGroupUseEntireRow as zI,_mergeDeep as BI,_missing as sQ,_updateColsMap as QI,_warn as JI,isColumnGroupAutoCol as UI}from"ag-grid-community";import{BeanStub as $I}from"ag-grid-community";import{_exists as WI}from"ag-grid-community";import{BeanStub as qI,_addGridCommonParams as HI,_createGlobalRowEvent as _I,_setAriaExpanded as kI}from"ag-grid-community";import{BeanStub as KI}from"ag-grid-community";import{_getGrandTotalRow as fI,_getGroupTotalRowCallback as NI,_isGroupMultiAutoColumn as FI}from"ag-grid-community";import{BeanStub as II,_ChangedRowNodes as d7,_csrmFirstLeaf as MI,_csrmReorderAllLeafs as AI,_getCellByPosition as RI,_isClientSideRowModel as CI,_prevOrNextDisplayedRow as VI}from"ag-grid-community";import{BeanStub as uI}from"ag-grid-community";import{Component as TI,RefPlaceholder as Pz,_setAriaRole as yI,_setDisplayed as sZ}from"ag-grid-community";import{BeanStub as xI,KeyCode as oZ,_createIconNoSpan as cI,_getCellRendererDetails as rZ,_getCheckboxLocation as hI,_getCheckboxes as iI,_getInnerCellRendererDetails as x0,_isElementInEventPath as aZ,_isRowSelection as nI,_isStopPropagationForAgGrid as eZ,_removeAriaExpanded as dI,_setAriaExpanded as lI,_stopPropagationForAgGrid as pI}from"ag-grid-community";import{BeanStub as sI}from"ag-grid-community";import{BeanStub as rI}from"ag-grid-community";import{BeanStub as eI,_isClientSideRowModel as GM,_isGroupRowsSticky as DM,_isServerSideRowModel as zM}from"ag-grid-community";import{BeanStub as BM,_getRowHeightForNode as QM,_isClientSideRowModel as JM,_isGroupRowsSticky as UM,_last as ZM}from"ag-grid-community";import{AgColumn as YM,BeanStub as WM,GROUP_HIERARCHY_COLUMN_ID_PREFIX as qM,_addColumnDefaultAndTypes as z2,_areColIdsEqual as HM,_columnsMatch as B2,_destroyColumnTree as _M,_removeAllFromArray as kM,_updateColsMap as wM}from"ag-grid-community";import{_MONTHS as s7,_getDateParts as KM,_parseDateTimeFromString as fM}from"ag-grid-community";import{Component as RM,_createElement as CM}from"ag-grid-community";import{AgPromise as gz,AgSelect as vM,FilterComp as OM,RefPlaceholder as J2,TabGuardComp as uM,_clearElement as oQ,_createElement as jM,_setDisplayed as PM,_warn as rQ}from"ag-grid-community";import{BeanStub as xM,_warn as U2}from"ag-grid-community";import{BeanStub as hM}from"ag-grid-community";import{AgInputTextField as nM,AgPromise as aQ,Component as dM,RefPlaceholder as lM,_clearElement as pM,_isGroupMultiAutoColumn as mM}from"ag-grid-community";import{BeanStub as oM,RowNode as rM,_csrmFirstLeaf as Z2,_forEachChangedGroupDepthFirst as $2,_warn as aM}from"ag-grid-community";import{BeanStub as $A,RowNode as X2,_addGridCommonParams as LA,_getRowHeightAsNumber as Y2,_getRowIdCallback as SA,_warn as XA}from"ag-grid-community";import{CsvExportModule as WA,HighlightChangesModule as qA,_KeyboardNavigationModule as HA}from"ag-grid-community";import{BeanStub as FA,_createCellId as lD,_exists as EA,_forEachChangedGroupDepthFirst as IA,_getActiveDomElement as MA,_getDocument as W2,_getRowBelow as eQ,_getRowNode as G1,_isClientSideRowModel as q2,_isSameRow as H2,_last as AA,_removeFromArray as RA,_warn as c0,isColumnSelectionCol as CA,isSpecialCol as VA}from"ag-grid-community";import{CellStyleModule as OA,_SharedDragAndDropModule as uA}from"ag-grid-community";import{Component as PA,Direction as gA,_getRowNode as TA}from"ag-grid-community";import{AgColumn as cA,BeanStub as hA,KeyCode as B1,ROW_NUMBERS_COLUMN_ID as iA,_addGridCommonParams as nA,_applyColumnState as dA,_areColIdsEqual as lA,_convertColumnEventSourceType as pA,_createElement as mA,_debounce as tA,_destroyColumnTree as _2,_getColumnStateFromColDef as sA,_getFirstRow as oA,_getRowNode as rA,_interpretAsRightClick as aA,_isRowNumbers as pD,_selectAllCells as eA,_setAriaLabel as GR,_updateColsMap as DR,isRowNumberCol as wD}from"ag-grid-community";import{_isRowNumbers as zR,_warn as BR}from"ag-grid-community";import{_ColumnFilterModule as G8}from"ag-grid-community";import{Component as UR,RefPlaceholder as k2}from"ag-grid-community";import{AgInputTextFieldSelector as ZR,Component as $R,RefPlaceholder as w2,_createIconNoSpan as Q1,_debounce as LR,_setDisplayed as Tz}from"ag-grid-community";import{Component as WR,_addGridCommonParams as qR,_clearElement as HR,_exists as J1,_getActiveDomElement as _R,_mergeDeep as kR,_setAriaLabel as wR,_warn as K2,isProvidedColumnGroup as f2}from"ag-grid-community";import{Component as KR,FilterComp as fR,KeyCode as N2,RefPlaceholder as yz,_clearElement as NR,_createElement as FR,_createIconNoSpan as U1,_setAriaExpanded as F2,_setAriaLabel as ER,_setAriaRole as IR,_setDisplayed as zD}from"ag-grid-community";import{Component as AR,RefPlaceholder as RR,_clearElement as CR,_createIconNoSpan as VR,_getShouldDisplayTooltip as bR,_setAriaLabel as vR,_setAriaRole as OR,isProvidedColumnGroup as i0}from"ag-grid-community";import{BeanStub as yR,FilterComp as xR}from"ag-grid-community";import{BeanStub as hR,_addGridCommonParams as iR,_getDefaultSimpleFilter as nR,_getFilterParamsForDataType as dR,_isSetFilterByDefault as lR,_warn as pR}from"ag-grid-community";import{_removeFromParent as mR,_translate as tR}from"ag-grid-community";import{Component as aR,_warn as eR}from"ag-grid-community";import{Component as GC,FilterButtonComp as DC,RefPlaceholder as zC,_focusInto as I2,_getActiveDomElement as BC,_isNothingFocused as M2,_removeFromParent as QC,_translateForFilter as JC}from"ag-grid-community";import{Component as UC,_clearElement as A2,_createElement as ZC,_createIconNoSpan as $C}from"ag-grid-community";import{Component as XC,RefPlaceholder as mD,_clearElement as YC,_createIcon as Z1,_removeFromParent as WC,_setAriaControls as R2,_setAriaExpanded as qC,_setAriaLabel as C2,_setDisplayed as HC}from"ag-grid-community";import{AgSelectSelector as _C,Component as kC,RefPlaceholder as wC,_removeFromParent as KC}from"ag-grid-community";import{Component as FC}from"ag-grid-community";import{EventApiModule as uC}from"ag-grid-community";import{Component as jC,RefPlaceholder as PC,_getGridRegisteredModules as gC,_missing as TC,_warn as V2,createGrid as yC}from"ag-grid-community";import{BeanStub as xC,_addGridCommonParams as cC,_focusInto as hC,_isSameRow as iC,_missing as nC,_warn as n0}from"ag-grid-community";import{BeanStub as eC,RowNode as GV,_exists as DV,_getClientSideRowModel as zV,_isClientSideRowModel as b2,_isServerSideRowModel as v2,_observeResize as BV}from"ag-grid-community";import{_DragModule as UV,_KeyboardNavigationModule as ZV}from"ag-grid-community";import{_addGridCommonParams as $V,_getCellByPosition as d0,_getFillHandle as $1,_getLastRow as LV,_getNormalisedMousePosition as O2,_getRowAbove as L1,_getRowBelow as xz,_getRowNode as SV,_isRowBefore as XV,_isSameRow as FG,_last as tD,_stopPropagationForAgGrid as YV,_toStringOrNull as WV,_warn as qV,isRowNumberCol as HV}from"ag-grid-community";import{Component as _V,_areCellsEqual as kV,_getCellPositionForEvent as wV,_getPageBody as u2,_isRowBefore as KV,_isVisible as fV,_last as NV,_setDisplayed as FV}from"ag-grid-community";import{CellRangeType as P2,_isSameRow as AV,_last as g2}from"ag-grid-community";import{AutoScrollService as vV,BeanStub as OV,KeyCode as uV,_areCellsEqual as jV,_areEqual as y2,_exists as PV,_getAbsoluteRowIndex as x2,_getCellCtrlForEventTarget as gV,_getEnableColumnSelection as TV,_getFirstRow as S1,_getLastRow as X1,_getRowAbove as cz,_getRowBelow as sD,_getRowCtrlForEventTarget as yV,_getRowNode as xV,_getSuppressMultiRanges as cV,_interpretAsRightClick as hV,_isCellSelectionEnabled as l0,_isDomLayout as iV,_isRowBefore as XG,_isSameRow as CG,_isUsingNewCellSelectionAPI as nV,_last as DG,_makeNull as c2,_missing as dV,_removeAllFromArray as lV,_removeFromArray as p0,_warn as Y1}from"ag-grid-community";import{CellRangeType as hz,_isSameRow as h2,_last as pV,_missing as mV,_setAriaSelected as tV}from"ag-grid-community";import{BeanStub as Qb,_isCellSelectionEnabled as d2}from"ag-grid-community";import{BeanStub as Ub}from"ag-grid-community";import{BeanStub as $b}from"ag-grid-community";import{_CsrmSsrmSharedApiModule as Hb,_RowModelSharedApiModule as _b,_SharedRowSelectionModule as kb,_SortModule as wb,_SsrmInfiniteSharedApiModule as Kb,onRowHeightChanged as fb,resetRowHeights as Nb}from"ag-grid-community";import{Component as Fb,RefPlaceholder as p2,_createIconNoSpan as Eb}from"ag-grid-community";import{_ColumnGroupModule as Rb}from"ag-grid-community";import{BeanStub as cb}from"ag-grid-community";import{BeanStub as db,_areEqual as lb,_createColumnTree as pb,_createColumnTreeWithIds as mb,_destroyColumnTree as t2,_exists as tb,_getColumnsFromTree as sb}from"ag-grid-community";import{BeanStub as rb,_forEachChangedGroupDepthFirst as ab,_jsonEquals as eb,_missing as Gv}from"ag-grid-community";import{BeanStub as zv,RowNode as Bv,_removeFromArray as Qv,_warn as t0}from"ag-grid-community";import{BeanStub as $v,RowNode as Lv,_doOnce as Sv,_exists as H1,_getGroupTotalRowCallback as r2,_getRowHeightAsNumber as Xv,_getRowHeightForNode as a2,_warn as Yv}from"ag-grid-community";import{BeanStub as Hv,_isServerSideRowModel as _v}from"ag-grid-community";import{BeanStub as wv,_isServerSideRowModel as Kv,_jsonEquals as fv}from"ag-grid-community";import{BeanStub as Fv}from"ag-grid-community";import{BeanStub as Iv,_isServerSideRowModel as Mv}from"ag-grid-community";import{BeanStub as Rv,_warn as Cv}from"ag-grid-community";import{BeanStub as bv,RowNode as vv,_debounce as Ov,_getRowHeightAsNumber as uv,_getRowHeightForNode as dz,_isGetRowHeightFunction as jv,_isRowSelection as Pv,_jsonEquals as gv,_warn as Tv}from"ag-grid-community";import{_getServerSideRowModel as mB,_warn as xv}from"ag-grid-community";import{RowNode as sv,_exists as ov,_getRowHeightForNode as rv}from"ag-grid-community";import{BeanStub as av}from"ag-grid-community";import{BeanStub as ev}from"ag-grid-community";import{BaseSelectionService as DO,_error as zO,_getGroupSelectsDescendants as G5,_getRowSelectionMode as D5,_isMultiRowSelection as BO,_isRowSelection as a0,_isUsingNewRowSelectionAPI as QO,_warn as ED}from"ag-grid-community";import{BeanStub as JO,_error as e0,_isMultiRowSelection as z5,_isUsingNewRowSelectionAPI as UO,_warn as GB}from"ag-grid-community";import{BeanStub as ZO,_error as KD,_isMultiRowSelection as $O,_warn as LO}from"ag-grid-community";import{BeanStub as XO}from"ag-grid-community";import{BeanStub as WO,_addGridCommonParams as qO,_getMaxConcurrentDatasourceRequests as HO}from"ag-grid-community";import{BeanStub as kO,_warn as Q5}from"ag-grid-community";import{BeanStub as wO,ServerSideTransactionResultStatus as k1,_getGroupTotalRowCallback as J5,_getRowHeightAsNumber as U5,_getRowIdCallback as KO,_warn as fO}from"ag-grid-community";import{BeanStub as NO,_getRowHeightAsNumber as FO,_getRowIdCallback as EO,_warn as IO}from"ag-grid-community";import{BeanStub as VO,_isServerSideRowModel as Z5}from"ag-grid-community";import{BeanStub as vO,ServerSideTransactionResultStatus as fD}from"ag-grid-community";import{AgAbstractCellEditor as uO,KeyCode as K1,RefPlaceholder as jO,_isBrowserSafari as PO,_placeCaretAtEnd as gO}from"ag-grid-community";import{AgContentEditableField as TO,_createElement as yO,_getDocument as vJ,_getWindow as X8,_placeCaretAtEnd as xO}from"ag-grid-community";import{BeanStub as nO,KeyCode as iG,_getDocument as dO}from"ag-grid-community";import{isSpecialCol as lO}from"ag-grid-community";import{BeanStub as Gu,_last as N1,isSpecialCol as Du}from"ag-grid-community";import{BeanStub as Ku,_addGridCommonParams as fu,_isExpressionString as Nu}from"ag-grid-community";import{BeanStub as Eu}from"ag-grid-community";import{BeanStub as Mu,_convertColumnEventSourceType as Au,_isExpressionString as Ru,_warn as oD}from"ag-grid-community";import{_getClientSideRowModel as Cu,_isExpressionString as Vu}from"ag-grid-community";import{_getClientSideRowModel as yu}from"ag-grid-community";import{_getClientSideRowModel as TJ}from"ag-grid-community";import{_preInitErrMsg as Pj}from"ag-grid-community";import{Component as Tj,RefPlaceholder as yj,_batchCall as xj,_formatNumberCommas as cj,_setAriaLabel as hj,_setAriaLabelledBy as A5}from"ag-grid-community";import{Component as SP,_clearElement as XP,_createElement as YP,_toString as b5}from"ag-grid-community";import{BeanStub as HP,_addGridCommonParams as v5,_debounce as _P,_isClientSideRowModel as O5,_isFullWidthGroupRow as kP,_jsonEquals as wP,_missing as C1,_toString as y8,isSpecialCol as KP}from"ag-grid-community";import{_EditCoreModule as FP}from"ag-grid-community";import{_isClientSideRowModel as EP,_warn as IP}from"ag-grid-community";import{BeanStub as VP}from"ag-grid-community";import{_PopupModule as PP,_SharedDragAndDropModule as gP,_preInitErrMsg as l8}from"ag-grid-community";import{BeanStub as TP}from"ag-grid-community";import{BeanStub as xP}from"ag-grid-community";import{_parseDateTimeFromString as cP}from"ag-grid-community";import{_warn as Gg}from"ag-grid-community";import{GROUP_AUTO_COLUMN_ID as Yg}from"ag-grid-community";import{BeanStub as Eg,CellRangeType as pz,_normalizeSortType as Ig,isColumnGroupAutoCol as Mg}from"ag-grid-community";import{BeanStub as Ag,GROUP_AUTO_COLUMN_ID as Rg,_isClientSideRowModel as Cg,_isServerSideRowModel as Vg,_last as bg,_warn as b1}from"ag-grid-community";import{BeanStub as Og,_getRowNode as ug,_warn as g5}from"ag-grid-community";import{BeanStub as Pg,_warn as v1}from"ag-grid-community";import{BeanStub as ig,TabGuardComp as ng,_findFocusableElements as G9,_findNextFocusableElement as dg}from"ag-grid-community";import{Component as lg}from"ag-grid-community";import{BeanStub as pg,_removeFromParent as mg}from"ag-grid-community";import{AgInputNumberFieldSelector as tg,Component as sg}from"ag-grid-community";import{AgCheckboxSelector as rg,Component as ag}from"ag-grid-community";import{AgCheckboxSelector as GT,Component as DT}from"ag-grid-community";import{AgCheckboxSelector as BT,Component as QT,RefPlaceholder as JT}from"ag-grid-community";import{BeanStub as XT,Component as YT,RefPlaceholder as WT,_addGridCommonParams as qT,_createIconNoSpan as HT,_focusInto as _T,_isNothingFocused as kT}from"ag-grid-community";import{BeanStub as fT,_warn as NT}from"ag-grid-community";import{BeanStub as AT,_warn as y5}from"ag-grid-community";import{BeanStub as VT}from"ag-grid-community";import{BeanStub as OT,_focusInto as uT,_warn as zB}from"ag-grid-community";import{Component as jT,RefPlaceholder as mz,_addGridCommonParams as PT,_clearElement as gT,_errMsg as x5,_focusGridInnerElement as TT,_focusInto as yT,_getAbsoluteHeight as xT,_getAbsoluteWidth as cT,_mergeDeep as hT,_removeFromParent as iT,_setDisplayed as c5,_warn as h5}from"ag-grid-community";import{BeanStub as nT,_warn as i5}from"ag-grid-community";import{_warnOnce as U0}from"ag-grid-community";import{AgPromise as Yy,Component as Wy,_warn as qy}from"ag-grid-community";import{Component as Hy,RefPlaceholder as _y,_clearElement as ky,_createElement as wy,_createIconNoSpan as Ky}from"ag-grid-community";import{AgPromise as Ny,Component as Fy,_createElement as d5}from"ag-grid-community";import{AgToggleButton as Ey,Component as Iy,_getDocument as My,_setDisplayed as Ay,_warn as Ry}from"ag-grid-community";import{AgSelect as Cy,AgToggleButton as Vy}from"ag-grid-community";import{AgSelect as by,Component as vy}from"ag-grid-community";import{AgSelect as Oy,Component as uy,DragSourceType as $9,_escapeString as jy,_getActiveDomElement as Py,_removeFromParent as gy}from"ag-grid-community";import{AgSelect as l5,AgToggleButton as ny,Component as dy,RefPlaceholder as ly}from"ag-grid-community";import{BeanStub as py}from"ag-grid-community";import{AgCheckbox as ty,AgSelect as sy,Component as oy,_areEqual as ry,_clearElement as ay}from"ag-grid-community";import{AgToggleButton as Gx}from"ag-grid-community";import{Component as Qx,_warn as p5}from"ag-grid-community";import{AgCheckbox as Jx,AgSelectSelector as Ux,Component as Zx,RefPlaceholder as BB,_removeFromParent as m5,_setDisplayed as $x}from"ag-grid-community";import{AgAbstractLabel as Lx,AgInputNumberFieldSelector as Sx,RefPlaceholder as QB,_exists as Xx,_getActiveDomElement as Yx,_setFixedWidth as Wx}from"ag-grid-community";import{AgSelectSelector as Hx,Component as _x,RefPlaceholder as kx,_removeFromParent as wx}from"ag-grid-community";import{Component as fx,RefPlaceholder as Nx}from"ag-grid-community";import{Component as Ex}from"ag-grid-community";import{AgSelect as Ax,Component as Rx,RefPlaceholder as Cx}from"ag-grid-community";import{Component as bx,RefPlaceholder as vx}from"ag-grid-community";import{Component as Ox}from"ag-grid-community";import{Component as jx,RefPlaceholder as Px}from"ag-grid-community";import{BeanStub as yx}from"ag-grid-community";import{AgCheckbox as cx,AgSelect as hx,Component as ix,RefPlaceholder as t5}from"ag-grid-community";import{AgSelect as O1,Component as dx,RefPlaceholder as lx,_error as px,_removeFromParent as mx}from"ag-grid-community";import{Component as tx,RefPlaceholder as sx,_removeFromParent as ox}from"ag-grid-community";import{Component as ax}from"ag-grid-community";import{Component as Gc}from"ag-grid-community";import{Component as zc}from"ag-grid-community";import{AgSelectSelector as Qc,Component as Jc}from"ag-grid-community";import{AgSelectSelector as Zc,Component as $c,RefPlaceholder as Lc,_removeFromParent as Sc}from"ag-grid-community";import{Component as Yc}from"ag-grid-community";import{Component as qc}from"ag-grid-community";import{AgSelectSelector as _c,Component as kc,RefPlaceholder as wc}from"ag-grid-community";import{Component as Nc}from"ag-grid-community";import{Component as Ic,RefPlaceholder as Mc}from"ag-grid-community";import{AgInputTextField as Ac,Component as Rc}from"ag-grid-community";import{Component as Oc,RefPlaceholder as oz,_areEqual as uc,_clearElement as o5,_createIconNoSpan as r5,_getAbsoluteWidth as jc,_radioCssClass as a5,_setDisplayed as Pc}from"ag-grid-community";import{Component as gc,KeyCode as e5,_setAriaLabel as Tc,_warn as G6}from"ag-grid-community";import{Component as yc,_error as xc}from"ag-grid-community";import{_last as X9}from"ag-grid-community";import{_flatten as Qh}from"ag-grid-community";import{_flatten as Yh}from"ag-grid-community";import{BeanStub as fi,_error as Ni}from"ag-grid-community";import{_errMsg as Ri}from"ag-grid-community";import{AllCommunityModule as Xn}from"ag-grid-community";import"ag-grid-community";var d9=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(G,D){let z=G[0],B=G[1],Q=G[2],J=G[3];z=this.ff(z,B,Q,J,D[0],7,-680876936),J=this.ff(J,z,B,Q,D[1],12,-389564586),Q=this.ff(Q,J,z,B,D[2],17,606105819),B=this.ff(B,Q,J,z,D[3],22,-1044525330),z=this.ff(z,B,Q,J,D[4],7,-176418897),J=this.ff(J,z,B,Q,D[5],12,1200080426),Q=this.ff(Q,J,z,B,D[6],17,-1473231341),B=this.ff(B,Q,J,z,D[7],22,-45705983),z=this.ff(z,B,Q,J,D[8],7,1770035416),J=this.ff(J,z,B,Q,D[9],12,-1958414417),Q=this.ff(Q,J,z,B,D[10],17,-42063),B=this.ff(B,Q,J,z,D[11],22,-1990404162),z=this.ff(z,B,Q,J,D[12],7,1804603682),J=this.ff(J,z,B,Q,D[13],12,-40341101),Q=this.ff(Q,J,z,B,D[14],17,-1502002290),B=this.ff(B,Q,J,z,D[15],22,1236535329),z=this.gg(z,B,Q,J,D[1],5,-165796510),J=this.gg(J,z,B,Q,D[6],9,-1069501632),Q=this.gg(Q,J,z,B,D[11],14,643717713),B=this.gg(B,Q,J,z,D[0],20,-373897302),z=this.gg(z,B,Q,J,D[5],5,-701558691),J=this.gg(J,z,B,Q,D[10],9,38016083),Q=this.gg(Q,J,z,B,D[15],14,-660478335),B=this.gg(B,Q,J,z,D[4],20,-405537848),z=this.gg(z,B,Q,J,D[9],5,568446438),J=this.gg(J,z,B,Q,D[14],9,-1019803690),Q=this.gg(Q,J,z,B,D[3],14,-187363961),B=this.gg(B,Q,J,z,D[8],20,1163531501),z=this.gg(z,B,Q,J,D[13],5,-1444681467),J=this.gg(J,z,B,Q,D[2],9,-51403784),Q=this.gg(Q,J,z,B,D[7],14,1735328473),B=this.gg(B,Q,J,z,D[12],20,-1926607734),z=this.hh(z,B,Q,J,D[5],4,-378558),J=this.hh(J,z,B,Q,D[8],11,-2022574463),Q=this.hh(Q,J,z,B,D[11],16,1839030562),B=this.hh(B,Q,J,z,D[14],23,-35309556),z=this.hh(z,B,Q,J,D[1],4,-1530992060),J=this.hh(J,z,B,Q,D[4],11,1272893353),Q=this.hh(Q,J,z,B,D[7],16,-155497632),B=this.hh(B,Q,J,z,D[10],23,-1094730640),z=this.hh(z,B,Q,J,D[13],4,681279174),J=this.hh(J,z,B,Q,D[0],11,-358537222),Q=this.hh(Q,J,z,B,D[3],16,-722521979),B=this.hh(B,Q,J,z,D[6],23,76029189),z=this.hh(z,B,Q,J,D[9],4,-640364487),J=this.hh(J,z,B,Q,D[12],11,-421815835),Q=this.hh(Q,J,z,B,D[15],16,530742520),B=this.hh(B,Q,J,z,D[2],23,-995338651),z=this.ii(z,B,Q,J,D[0],6,-198630844),J=this.ii(J,z,B,Q,D[7],10,1126891415),Q=this.ii(Q,J,z,B,D[14],15,-1416354905),B=this.ii(B,Q,J,z,D[5],21,-57434055),z=this.ii(z,B,Q,J,D[12],6,1700485571),J=this.ii(J,z,B,Q,D[3],10,-1894986606),Q=this.ii(Q,J,z,B,D[10],15,-1051523),B=this.ii(B,Q,J,z,D[1],21,-2054922799),z=this.ii(z,B,Q,J,D[8],6,1873313359),J=this.ii(J,z,B,Q,D[15],10,-30611744),Q=this.ii(Q,J,z,B,D[6],15,-1560198380),B=this.ii(B,Q,J,z,D[13],21,1309151649),z=this.ii(z,B,Q,J,D[4],6,-145523070),J=this.ii(J,z,B,Q,D[11],10,-1120210379),Q=this.ii(Q,J,z,B,D[2],15,718787259),B=this.ii(B,Q,J,z,D[9],21,-343485551),G[0]=this.add32(z,G[0]),G[1]=this.add32(B,G[1]),G[2]=this.add32(Q,G[2]),G[3]=this.add32(J,G[3])}cmn(G,D,z,B,Q,J){return D=this.add32(this.add32(D,G),this.add32(B,J)),this.add32(D<>>32-Q,z)}ff(G,D,z,B,Q,J,U){return this.cmn(D&z|~D&B,G,D,Q,J,U)}gg(G,D,z,B,Q,J,U){return this.cmn(D&B|z&~B,G,D,Q,J,U)}hh(G,D,z,B,Q,J,U){return this.cmn(D^z^B,G,D,Q,J,U)}ii(G,D,z,B,Q,J,U){return this.cmn(z^(D|~B),G,D,Q,J,U)}md51(G){let D=G.length,z=[1732584193,-271733879,-1732584194,271733878],B;for(B=64;B<=G.length;B+=64)this.md5cycle(z,this.md5blk(G.substring(B-64,B)));G=G.substring(B-64);let Q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(B=0;B>2]|=G.charCodeAt(B)<<(B%4<<3);if(Q[B>>2]|=128<<(B%4<<3),B>55){this.md5cycle(z,Q);for(B=0;B<16;B++)Q[B]=0}return Q[14]=D*8,this.md5cycle(z,Q),z}md5blk(G){let D=[];for(let z=0;z<64;z+=4)D[z>>2]=G.charCodeAt(z)+(G.charCodeAt(z+1)<<8)+(G.charCodeAt(z+2)<<16)+(G.charCodeAt(z+3)<<24);return D}rhex(G){let D="0123456789abcdef".split(""),z="",B=0;for(;B<4;B++)z+=D[G>>B*8+4&15]+D[G>>B*8&15];return z}hex(G){for(let D=0;D>16)+(D>>16)+(z>>16)<<16|z&65535}},w0={"01":"GRID","02":"CHARTS","0102":"BOTH"};var Y6=class G{constructor(D){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=D,this.md5=new d9,this.md5.init()}validateLicense(){let D=this.getLicenseDetails(G.licenseKey),z=`AG Grid ${D.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,B=D.suppliedLicenseType===void 0?"":`AG ${D.suppliedLicenseType==="BOTH"?"Grid and AG Charts":D.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(D.missing){if(!this.isWebsiteUrl()||this.isForceWatermark())this.outputMissingLicenseKey(z)}else if(D.expired){let Q=G.getGridReleaseDate(),J=G.formatDate(Q);this.outputExpiredKey(D.expiry,J,z,B)}else if(!D.valid)this.outputInvalidLicenseKey(!!D.incorrectLicenseType,z,B);else if(D.isTrial&&D.trialExpired)this.outputExpiredTrialKey(D.expiry,z,B)}static extractExpiry(D){let z=D.substring(D.lastIndexOf("_")+1,D.length);return new Date(parseInt(G.decode(z),10))}static extractLicenseComponents(D){let z=D.replace(/[\u200B-\u200D\uFEFF]/g,"");if(z=z.replace(/\r?\n|\r/g,""),D.length<=32)return{md5:null,license:D,version:null,isTrial:null};let B=z.length-32,Q=z.substring(B),J=z.substring(0,B),[U,Z,S]=G.extractBracketedInformation(z);return{md5:Q,license:J,version:U,isTrial:Z,type:S}}getLicenseDetails(D){let z=G.chartsLicenseManager?"BOTH":"GRID";if(!D?.length)return{licenseKey:D,valid:!1,missing:!0,currentLicenseType:z};let B=G.getGridReleaseDate(),{md5:Q,license:J,version:U,isTrial:Z,type:S}=G.extractLicenseComponents(D),X=Q===this.md5.md5(J)&&!D.includes("For_Trialing_ag-Grid_Only"),Y=void 0,W=void 0,q=null,H=!1,_=void 0;function k(){Y=qq,U){case"legacy":case"2":{if(Z)k();break}case"3":if(!S?.length)X=!1;else if(_=S,S!==w0["01"]&&S!==w0["0102"]||z==="BOTH"&&_!=="BOTH")X=!1,H=!0;else if(Z)k()}}if(!X)return{licenseKey:D,valid:X,incorrectLicenseType:H,currentLicenseType:z,suppliedLicenseType:_};return{licenseKey:D,valid:X,expiry:G.formatDate(q),expired:W,version:U,isTrial:Z,trialExpired:Y,incorrectLicenseType:H,currentLicenseType:z,suppliedLicenseType:_}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){let z=(this.document.defaultView||window).location,{hostname:B=""}=z;return B}isForceWatermark(){let z=(this.document.defaultView||window).location,{pathname:B}=z;return B?B.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(D){let z=["January","February","March","April","May","June","July","August","September","October","November","December"],B=D.getDate(),Q=D.getMonth(),J=D.getFullYear();return B+" "+z[Q]+" "+J}static getGridReleaseDate(){return new Date(parseInt(G.decode(G.RELEASE_INFORMATION),10))}static decode(D){let B="",Q,J,U,Z,S,X,Y,W=0,q=D.replace(/[^A-Za-z0-9+/=]/g,"");while(W>4,J=(S&15)<<4|X>>2,U=(X&3)<<6|Y,B=B+String.fromCharCode(Q),X!=64)B=B+String.fromCharCode(J);if(Y!=64)B=B+String.fromCharCode(U)}return B=G.utf8_decode(B),B}static utf8_decode(D){D=D.replace(/rn/g,"n");let z="";for(let B=0;B127&&Q<2048)z+=String.fromCharCode(Q>>6|192),z+=String.fromCharCode(Q&63|128);else z+=String.fromCharCode(Q>>12|224),z+=String.fromCharCode(Q>>6&63|128),z+=String.fromCharCode(Q&63|128)}return z}static setChartsLicenseManager(D){this.chartsLicenseManager=D,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(D){if(i9(this.licenseKey)&&this.licenseKey!==D)n9(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used.");this.licenseKey=D,this.chartsLicenseManager?.setLicenseKey(D,!0)}static extractBracketedInformation(D){if(!D.includes("["))return["legacy",!1,void 0];let z=D.match(/\[(.*?)\]/g).map((Z)=>Z.replace("[","").replace("]",""));if(!z||z.length===0)return["legacy",!1,void 0];let B=z.filter((Z)=>Z==="TRIAL").length===1,Q=z.filter((Z)=>Z.indexOf("v")===0)[0],J=Q?Q.replace("v",""):"legacy",U=w0[z.filter((Z)=>w0[Z])[0]];return[J,B,U]}centerPadAndOutput(D){let z=this.totalMessageLength-D.length}padAndOutput(D,z="*",B=""){}outputInvalidLicenseKey(D,z,B){}outputExpiredTrialKey(D,z,B){}outputMissingLicenseKey(D){}outputExpiredKey(D,z,B,Q){}};Y6.RELEASE_INFORMATION="MTc3NDQyNTc0Nzc3NQ==";var az=Y6,m9='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',t9={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},s9=class extends l9{constructor(){super(t9);this.eLicenseTextRef=p9,this.registerCSS(m9)}wireBeans(G){this.licenseManager=G.licenseManager}postConstruct(){let G=this.shouldDisplayWatermark();if(this.setDisplayed(G),G)this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5000)}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},o9={selector:"AG-WATERMARK",component:s9},j1=class extends c9{constructor(){super(...arguments);this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){let G=this.beans;if(G.withinStudio)this.licenseManager={isDisplayWatermark:()=>!1,getWatermarkMessage:()=>""};else{let D=new az(h9(G));this.licenseManager=D,D.validateLicense()}}static getLicenseDetails(G){return new az(null).getLicenseDetails(G)}getWatermarkSelector(){return o9}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(G){az.setLicenseKey(G)}static setChartsLicenseManager(G){az.setChartsLicenseManager(G)}},U$=9525,BU={"0":1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},K0=`\r +`;function QU(G,D,z){if(!D&&D!==""&&D!==0)return"";let B=D;if(typeof D==="boolean"){if(z)B=z(D)}return` ${G}="${B}"`}function Z$(G={}){let B=["version"];if(!G.version)G.version="1.0";if(G.encoding)B.push("encoding");if(G.standalone)B.push("standalone");return``${J}="${G[J]}"`).join(" ")} ?>`}function q6(G,D){let z="";if(G.properties){if(G.properties.prefixedAttributes)G.properties.prefixedAttributes.forEach((Q)=>{for(let J of Object.keys(Q.map))z+=QU(Q.prefix+J,Q.map[J],D)});if(G.properties.rawMap)for(let Q of Object.keys(G.properties.rawMap))z+=QU(Q,G.properties.rawMap[Q],D)}let B="<"+G.name+z;if(!G.children&&G.textNode==null)return B+"/>"+K0;if(G.textNode!=null)return B+">"+G.textNode+""+K0;if(B+=">"+K0,G.children)for(let Q of G.children)B+=q6(Q,D);return B+""+K0}var $$=(G)=>{return Math.round(G*96/72)},yD=(G)=>{return Math.ceil(G*U$)},L$=(G)=>{if(G===void 0)return;let z=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(G||"Automatic");return Math.max(z,0)},$B=(G,D)=>{if(!D)return;let z;if(typeof D==="number")z=D;else z=D({rowIndex:G});return z},S$=(G,D)=>{let{colSpan:z,column:B}=G.position;if(!G.width)return;if(z){let Q=D.slice(B-1,B+z-1),J=0;for(let U=0;U{let{rowSpan:z,row:B}=G.position;if(!G.height)return;if(z){let Q=0,J=0;for(let U=B;U{let z=Z$({encoding:"UTF-8",standalone:"yes"}),B=q6(G);if(D)return B;return`${z}${B}`},OD=(G)=>{let B=String.fromCharCode,Q=Math.floor(G/26),J=G%26;if(!Q||G===26)return B(65+G-1);if(!J)return OD(Q-1)+"Z";if(Q<26)return B(65+Q-1)+B(65+J-1);return OD(Q)+B(65+J-1)},Y$=(G)=>{return G.replaceAll(` +`,"_x000a_")},kB=(G)=>{if(G==null)return null;let D="";for(let z=0;z=0&&B<=31&&B!==10){let U=`_x${B.toString(16).toUpperCase().padStart(4,"0")}_`;D+=U}else D+=G[z]}return D},W$=(G)=>{let D=[];for(let z of G.keys()){let B=z.toString(),Q={name:"t",textNode:J$(kB(B))};if(B.trim().length!==B.length)Q.properties={rawMap:{"xml:space":"preserve"}};D.push({name:"si",children:[Q]})}return D},q$=class extends G${constructor(G){super(G);this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=G.formulaSvc,this.config=Object.assign({},G),this.workbook=G.workbook,this.stylesByIds={};for(let z of this.config.baseExcelStyles)this.stylesByIds[z.id]=z;let D={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[D.id]=D,this.excelStyles=[...this.config.baseExcelStyles,D]}addCustomContent(G){for(let D of G){let z=this.rows.length+1,B;if(!this.config.suppressRowOutline&&D.outlineLevel!=null)B=D.outlineLevel;let Q={height:$B(z,D.height||this.config.rowHeight),cells:(D.cells||[]).map((J,U)=>{let Z=this.addImage(z,this.columnsToExport[U],J.data?.value),S=null;if(J.styleId)S=typeof J.styleId==="string"?[J.styleId]:J.styleId;let X=this.getStyleId(S);if(Z)return this.createCell(X,this.getDataTypeForValue(Z.value),Z.value==null?"":Z.value);let Y=J.data?.value??"",W=this.getDataTypeForValue(Y);if(J.mergeAcross)return this.createMergedCell(X,W,Y,J.mergeAcross);return this.createCell(X,W,Y)}),outlineLevel:B};if(D.collapsed!=null)Q.collapsed=D.collapsed;if(D.hidden!=null)Q.hidden=D.hidden;this.rows.push(Q)}}onNewHeaderGroupingRow(){let G=[],{freezeRows:D,headerRowHeight:z}=this.config;if(this.rows.push({cells:G,height:$B(this.rows.length+1,z)}),D)this.frozenRowCount++;return{onColumn:(B,Q,J,U,Z)=>{let S=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${Q}`,columnGroup:B});G.push({...this.createMergedCell(this.getStyleId(S),this.getDataTypeForValue("string"),Q,U),collapsibleRanges:Z})}}}onNewHeaderRow(){let{freezeRows:G,headerRowHeight:D}=this.config;if(G)this.frozenRowCount++;return this.onNewRow(this.onNewHeaderColumn,D)}onNewBodyRow(G){let{freezeRows:D,rowHeight:z}=this.config;if(!this.skipFrozenRows)if(D==="headersAndPinnedRows"&&G?.rowPinned==="top")this.frozenRowCount++;else if(typeof D==="function")if(D(QQ(this.gos,{node:G})))this.frozenRowCount++;else this.skipFrozenRows=!0;else this.skipFrozenRows=!0;let B=this.onNewRow(this.onNewBodyColumn,z);if(G)this.addRowOutlineIfNecessary(G);return B}prepare(G){super.prepare(G),this.columnsToExport=[...G],this.cols=G.map((D,z)=>this.convertColumnToExcel(D,z))}parse(){let G=this.rows.reduce((z,B)=>Math.max(z,B.cells.length),0);while(this.cols.length{let B=this.extractHeaderValue(z),Q=this.config.styleLinker({rowType:"HEADER",rowIndex:G,value:B,column:z});D.push(this.createCell(this.getStyleId(Q),this.getDataTypeForValue("string"),B))}}onNewBodyColumn(G,D){let z=0,{freezeColumns:B,rightToLeft:Q}=this.config;return(J,U,Z)=>{if(z>0){z-=1;return}if(!this.skipFrozenColumns){let w=J.getPinned();if(B==="pinned"&&w&&(w===!0||w==="left")!==Q)this.frozenColumnCount++;else if(typeof B==="function"&&B(QQ(this.gos,{column:J})))this.frozenColumnCount++;else this.skipFrozenColumns=!0}let{value:S,valueFormatted:X}=this.extractRowCellValue({column:J,node:Z,currentColumnIndex:U,accumulatedRowIndex:G,type:"excel",useRawFormula:!0}),Y=S,W=typeof Y==="bigint"?Y.toString():Y,q=this.config.styleLinker({rowType:"BODY",rowIndex:G,value:Y,column:J,node:Z}),H=this.getStyleId(q),_=J.getColSpan(Z),k=this.addImage(G,J,W);if(k)D.push(this.createCell(H,this.getDataTypeForValue(k.value),k.value==null?"":k.value));else if(_>1)z=_-1,D.push(this.createMergedCell(H,this.getDataTypeForValue(Y),W,_-1));else{let w=J.isAllowFormula()&&this.formulaSvc?.isFormula(W),K=this.createCell(H,w?"f":this.getDataTypeForValue(Y),w?this.formulaSvc?.updateFormulaByOffset({value:W,rowDelta:G-(Z.formulaRowIndex+1),useRefFormat:!1}):W,X);D.push(K)}}}onNewRow(G,D){let z=[];return this.rows.push({cells:z,height:$B(this.rows.length+1,D)}),{onColumn:G.bind(this,this.rows.length,z)()}}addWorksheetToWorkbook(G){let{excelStyles:D,config:z}=this;if(this.mapSharedStrings(G),this.frozenColumnCount)z.frozenColumnCount=this.frozenColumnCount;if(this.frozenRowCount)z.frozenRowCount=this.frozenRowCount;return this.workbook.addWorksheet(D,G,z)}mapSharedStrings(G){let D;for(let z of G.table.rows)for(let B of z.cells){let Q=B.data;if(!Q||Q.type!=="s")continue;let J=Q.value;if(J==null)continue;if(J===""){D??(D=this.workbook.getStringPosition("").toString()),Q.value=D;continue}Q.value=this.workbook.getStringPosition(String(J)).toString()}}getDataTypeForValue(G){if(G===void 0)return"empty";let D="s";try{if(this.isNumerical(G))D="n"}catch(z){}return D}getTypeFromStyle(G,D){if(this.isFormula(D))return"f";if(G?.dataType)switch(G.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:Q$(162,{id:G.id,dataType:G.dataType})}return null}addImage(G,D,z){if(!this.config.addImageToCell)return;let B=this.config.addImageToCell(G,D,z);if(!B)return;return this.workbook.addBodyImageToMap(B.image,G,D,this.columnsToExport,this.config.rowHeight),B}createCell(G,D,z,B){let Q=this.getStyleById(G);if(!Q?.dataType&&D==="s"&&B!=null)z=B;let J=this.getTypeFromStyle(Q,z)||D,{value:U,escaped:Z}=this.getCellValue(J,z),S=[];if(Q)S.push(G);if(Z)S.push("_quotePrefix");return G=this.getStyleId(S)||void 0,{styleId:G,data:{type:J,value:U}}}createMergedCell(G,D,z,B){let Q=z==null?"":z;return{styleId:this.getStyleById(G)?G:void 0,data:{type:D,value:D==="s"?String(Q):z},mergeAcross:B}}getCellValue(G,D){let z=!1;if(D==null||G==="s"&&D==="")return{value:"",escaped:!1};if(G==="s"){if(D=String(D),D[0]==="'")z=!0,D=D.slice(1)}else if(G==="f")D=this.addXlfnPrefix(D).slice(1);else if(G==="n"){let B=Number(D);if(isNaN(B))D="";else if(D!=="")D=B.toString()}return{value:D,escaped:z}}addXlfnPrefix(G){if(!G)return G;let D=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return G.replace(D,(z,B,Q,J)=>`${B}_xlfn.${Q}${J}`)}getStyleId(G){if(!G?.length)return null;let D=G.filter((B)=>this.stylesByIds[B]!=null);if(!D.length)return null;if(D.length===1)return D[0];let z=D.join("-");if(!this.mixedStyles[z])this.addNewMixedStyle(D);return this.mixedStyles[z].excelID}addNewMixedStyle(G){this.mixedStyleCounter+=1;let D=`mixedStyle${this.mixedStyleCounter}`,z={};for(let Q of G){let J=this.stylesByIds[Q];if(J)B$(z,J,!0,!0)}z.id=D;let B=G.join("-");this.mixedStyles[B]={excelID:D,key:B,result:z},this.excelStyles.push(z),this.stylesByIds[D]=z}isFormula(G){if(G==null)return!1;let D=String(G);return this.config.autoConvertFormulas&&D$(D)}isNumerical(G){if(typeof G==="bigint")return!1;return isFinite(G)&&G!==""&&!isNaN(parseFloat(G))}getStyleById(G){if(G==null)return null;return this.stylesByIds[G]||null}},_$={getTemplate(G){let{name:D,ContentType:z,Extension:B,PartName:Q}=G;return{name:D,properties:{rawMap:{Extension:B,PartName:Q,ContentType:z}}}}},k$=_$,vB=(G)=>G==="jpg"?"jpeg":G,w$={getTemplate({sheetLen:G,hasCustomProperties:D}){let z=Array(G).fill(void 0).map((W,q)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${q+1}.xml`})),B=qD.size,Q=mG.size,J={};Qz.forEach((W)=>{J[vB(W.type)]=!0});let U=Array(B).fill(void 0).map((W,q)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${q+1}.xml`})),Z=[];uG.forEach(({name:W})=>{Z.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${W}.xml`})});let S=D?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],X=Object.keys(J).map((W)=>({name:"Default",ContentType:`image/${W}`,Extension:W}));if(Q)X.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});let Y=[...X,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...z,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...U,...Z,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...S].map((W)=>k$.getTemplate(W));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:Y}}},K$=w$,f$={getTemplate(G){let z=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:G},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:z},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:z}]}}},N$=f$,F$="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",E$=(G)=>{return Object.keys(G).filter((z)=>z&&G[z]!=null).map((z,B)=>({name:"property",properties:{rawMap:{fmtid:F$,pid:(B+2).toString(),name:JU(z)??""}},children:[{name:"vt:lpwstr",textNode:JU(kB(String(G[z])))??""}]}))},I$={getTemplate(G){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:E$(G)}}},M$=I$,UU=(G,D)=>({name:`xdr:${G}`,children:[{name:"xdr:col",textNode:D.col.toString()},{name:"xdr:colOff",textNode:D.offsetX.toString()},{name:"xdr:row",textNode:D.row.toString()},{name:"xdr:rowOff",textNode:D.offsetY.toString()}]}),A$=(G)=>{let D=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(G.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":D.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:D}},R$=(G,D)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:D,name:G.id,descr:G.altText!=null?G.altText:void 0}},children:[A$(G)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),ZU=(G)=>{if(!G.saturation&&!G.tint)return;let D=[];if(G.saturation)D.push({name:"a:satMod",properties:{rawMap:{val:G.saturation*1000}}});if(G.tint)D.push({name:"a:tint",properties:{rawMap:{val:G.tint*1000}}});return D},C$=(G,D)=>{return{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:G.color}},children:ZU(G)},{name:"a:srgbClr",properties:{rawMap:{val:D.color}},children:ZU(D)}]}},V$=(G,D)=>{let z;if(G.transparency){let B=Math.min(Math.max(G.transparency,0),100);z=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(B*1000)}}}]}if(G.recolor){if(!z)z=[];switch(G.recolor.toLocaleLowerCase()){case"grayscale":z.push({name:"a:grayscl"});break;case"sepia":z.push(C$({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":z.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${D}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:z},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},b$=(G,D)=>{let z={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:D.width,cy:D.height}}}]};if(G.rotation){let J=G.rotation;z.properties={rawMap:{rot:Math.min(Math.max(J,0),360)*60000}}}return{name:"xdr:spPr",children:[z,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},v$=(G)=>{G.fitCell=!!G.fitCell||!G.width||!G.height;let{position:D={},fitCell:z,width:B=0,height:Q=0,totalHeight:J,totalWidth:U}=G,{offsetX:Z=0,offsetY:S=0,row:X=1,rowSpan:Y=1,column:W=1,colSpan:q=1}=D;return{from:{row:X-1,col:W-1,offsetX:yD(Z),offsetY:yD(S)},to:{row:X-1+(z?1:Y-1),col:W-1+(z?1:q-1),offsetX:yD(B+Z),offsetY:yD(Q+S)},height:yD(J||Q),width:yD(U||B)}},O$=(G,D,z,B)=>{return{name:"xdr:pic",children:[R$(G,D+1),V$(G,z+1),b$(G,B)]}},u$={getTemplate(G){let{sheetIndex:D}=G,z=qD.get(D),B=Jz.get(D),Q=z.map((J,U)=>{let Z=v$(J);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[UU("from",Z.from),UU("to",Z.to),O$(J,U,B.get(J.id).index,Z),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:Q}}},j$=u$,P$={getTemplate(G){let{Id:D,Type:z,Target:B}=G;return{name:"Relationship",properties:{rawMap:{Id:D,Type:z,Target:B}}}}},g$=P$,T$={getTemplate(G){let D=G.map((z)=>g$.getTemplate(z));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:D}}},Y0=T$,y$={getTemplate(G){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:G.size,uniqueCount:G.size}},children:W$(G)}}},x$=y$,c$=(G)=>{switch(G){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},h$={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},i$=["Dashed","DashDot","DashDotDot"],n$={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},d$={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},l$={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},p$=(G)=>{if(!G)return"none";return n$[G]||G},LD=(G)=>{if(G==null)return G;if(G.charAt(0)==="#")G=G.substring(1);return G.length===6?"FF"+G:G},f0=(G,D)=>{if(!G)return"thin";let z=c$(D);if(G==="Continuous")return z;let B=h$[G];if(z==="medium"&&i$.some((Q)=>Q===B))return`medium${B}`;return`${B.charAt(0).toLowerCase()}${B.substring(1)}`},m$=(G)=>{return d$[G]||"general"},t$=(G)=>{return l$[G]||void 0},kz=(G)=>{return{name:"color",properties:{rawMap:{rgb:LD(G||"#000000")}}}},s$={getTemplate(G){let{left:D,right:z,top:B,bottom:Q,diagonal:J}=G,U=D?[kz(D.color)]:void 0,Z=z?[kz(z.color)]:void 0,S=B?[kz(B.color)]:void 0,X=Q?[kz(Q.color)]:void 0,Y=J?[kz(J.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:D?.style}},children:U},{name:"right",properties:{rawMap:{style:z?.style}},children:Z},{name:"top",properties:{rawMap:{style:B?.style}},children:S},{name:"bottom",properties:{rawMap:{style:Q?.style}},children:X},{name:"diagonal",properties:{rawMap:{style:J?.style}},children:Y}]}}},o$=s$,r$={getTemplate(G){return{name:"borders",properties:{rawMap:{count:G.length}},children:G.map((D)=>o$.getTemplate(D))}}},a$=r$,e$=(G)=>{let z=["Context","LeftToRight","RightToLeft"].indexOf(G);return Math.max(z,0)},GL={getTemplate(G){let{horizontal:D,indent:z,readingOrder:B,rotate:Q,shrinkToFit:J,vertical:U,wrapText:Z}=G;return{name:"alignment",properties:{rawMap:{horizontal:D&&m$(D),indent:z,readingOrder:B&&e$(B),textRotation:Q,shrinkToFit:J,vertical:U&&t$(U),wrapText:Z}}}}},DL=GL,zL={getTemplate(G){let D=G.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:G.hideFormula===!0?1:0,locked:D}}}}},BL=zL,QL={getTemplate(G){let{alignment:D,borderId:z,fillId:B,fontId:Q,numFmtId:J,protection:U,quotePrefix:Z,xfId:S}=G,X=[];if(D)X.push(DL.getTemplate(D));if(U)X.push(BL.getTemplate(U));return{name:"xf",properties:{rawMap:{applyAlignment:D?1:void 0,applyProtection:U?1:void 0,applyBorder:z?1:void 0,applyFill:B?1:void 0,borderId:z,fillId:B,applyFont:Q?1:void 0,fontId:Q,applyNumberFormat:J?1:void 0,numFmtId:J,quotePrefix:Z?1:void 0,xfId:S}},children:X.length?X:void 0}}},H6=QL,JL={getTemplate(G){return{name:"cellStyleXfs",properties:{rawMap:{count:G.length}},children:G.map((D)=>H6.getTemplate(D))}}},UL=JL,ZL={getTemplate(G){let{builtinId:D,name:z,xfId:B}=G;return{name:"cellStyle",properties:{rawMap:{builtinId:D,name:z,xfId:B}}}}},$L=ZL,LL={getTemplate(G){return{name:"cellStyles",properties:{rawMap:{count:G.length}},children:G.map((D)=>$L.getTemplate(D))}}},SL=LL,XL={getTemplate(G){return{name:"cellXfs",properties:{rawMap:{count:G.length}},children:G.map((D)=>H6.getTemplate(D))}}},YL=XL,WL={getTemplate(G){let{patternType:D,fgTheme:z,fgTint:B,fgRgb:Q,bgRgb:J,bgIndexed:U}=G,Z={name:"patternFill",properties:{rawMap:{patternType:D}}};if(z||B||Q)Z.children=[{name:"fgColor",properties:{rawMap:{theme:z,tint:B,rgb:Q}}}];if(U||J){if(!Z.children)Z.children=[];Z.children.push({name:"bgColor",properties:{rawMap:{indexed:U,rgb:J}}})}return{name:"fill",children:[Z]}}},qL=WL,HL={getTemplate(G){return{name:"fills",properties:{rawMap:{count:G.length}},children:G.map((D)=>qL.getTemplate(D))}}},_L=HL,kL={getTemplate(G){let{size:D,colorTheme:z,color:B="FF000000",fontName:Q="Calibri",family:J,scheme:U,italic:Z,bold:S,strikeThrough:X,outline:Y,shadow:W,underline:q,verticalAlign:H}=G,_=[{name:"sz",properties:{rawMap:{val:D}}},{name:"color",properties:{rawMap:{theme:z,rgb:B}}},{name:"name",properties:{rawMap:{val:Q}}}];if(J)_.push({name:"family",properties:{rawMap:{val:J}}});if(U)_.push({name:"scheme",properties:{rawMap:{val:U}}});if(Z)_.push({name:"i"});if(S)_.push({name:"b"});if(X)_.push({name:"strike"});if(Y)_.push({name:"outline"});if(W)_.push({name:"shadow"});if(q)_.push({name:"u",properties:{rawMap:{val:q}}});if(H)_.push({name:"vertAlign",properties:{rawMap:{val:H}}});return{name:"font",children:_}}},wL=kL,KL={getTemplate(G){return{name:"fonts",properties:{rawMap:{count:G.length}},children:G.map((D)=>wL.getTemplate(D))}}},fL=KL;function FL(G){let D=G.split(/(\[[^\]]*\])/);for(let z=0;zIL.getTemplate(D))}}},AL=ML,wB,rD,G0,D0,z0,_6,KB,k6,g1,w6=(G,D)=>{if(G.includes("mixedStyle")&&D>1)G+=`_${D}`;return G},K6=()=>{wB={base:0},rD=[],G0=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],D0=[{patternType:"none"},{patternType:"gray125"}],z0=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],_6=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],KB=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],k6=[{builtinId:0,name:"Normal",xfId:0}]},RL=(G)=>{let D=p$(G.pattern),z=LD(G.color),B=LD(G.patternColor),Q=D0.findIndex((J)=>{let{patternType:U,fgRgb:Z,bgRgb:S}=J;return!(U!=D||Z!=z||S!=B)});if(Q===-1)Q=D0.length,D0.push({patternType:D,fgRgb:z,bgRgb:B});return Q},CL=(G)=>{if(BU[G])return BU[G];let D=rD.findIndex((z)=>z.formatCode===G);if(D===-1)D=rD.length+164,rD.push({formatCode:G,numFmtId:D});else D=rD[D].numFmtId;return D},VL=(G)=>{let{borderBottom:D,borderTop:z,borderLeft:B,borderRight:Q}=G,J,U,Z,S,X,Y,W,q;if(B)Z=f0(B.lineStyle,B.weight),W=LD(B.color);if(Q)S=f0(Q.lineStyle,Q.weight),q=LD(Q.color);if(D)J=f0(D.lineStyle,D.weight),X=LD(D.color);if(z)U=f0(z.lineStyle,z.weight),Y=LD(z.color);let H=z0.findIndex((_)=>{let{left:k,right:w,top:K,bottom:f}=_;if(!k&&(Z||W))return!1;if(!w&&(S||q))return!1;if(!K&&(U||Y))return!1;if(!f&&(J||X))return!1;let{style:N,color:F}=k||{},{style:E,color:I}=w||{},{style:V,color:A}=K||{},{style:R,color:O}=f||{};if(N!=Z||F!=W)return!1;if(E!=S||I!=q)return!1;if(V!=U||A!=Y)return!1;if(R!=J||O!=X)return!1;return!0});if(H===-1)H=z0.length,z0.push({left:{style:Z,color:W},right:{style:S,color:q},top:{style:U,color:Y},bottom:{style:J,color:X},diagonal:{style:void 0,color:void 0}});return H},bL=(G)=>{let{fontName:D="Calibri",color:z,size:B,bold:Q,italic:J,outline:U,shadow:Z,strikeThrough:S,underline:X,family:Y,verticalAlign:W}=G,q=LD(z),H=L$(Y),_=X?X.toLocaleLowerCase():void 0,k=W?W.toLocaleLowerCase():void 0,w=G0.findIndex((K)=>{return!(K.fontName!=D||K.color!=q||K.size!=B||K.bold!=Q||K.italic!=J||K.outline!=U||K.shadow!=Z||K.strikeThrough!=S||K.underline!=_||K.verticalAlign!=k||K.family!=H)});if(w===-1)w=G0.length,G0.push({fontName:D,color:q,size:B,bold:Q,italic:J,outline:U,shadow:Z,strikeThrough:S,underline:_,verticalAlign:k,family:H!=null?H.toString():void 0});return w},vL=(G)=>{let{alignment:D,borders:z,font:B,interior:Q,numberFormat:J,protection:U,quotePrefix:Z}=G,{id:S}=G,X=0,Y=0,W=0,q=0;if(!S)return;if(S=w6(S,g1),wB[S]!=null)return;if(Q)X=RL(Q);if(z)Y=VL(z);if(B)W=bL(B);if(J)q=CL(J.format);wB[S]=KB.length,KB.push({alignment:D,borderId:Y||0,fillId:X||0,fontId:W||0,numFmtId:q||0,protection:U,quotePrefix:Z,xfId:0})},OL={getTemplate(G){let D=AL.getTemplate(rD),z=fL.getTemplate(G0.map((S)=>({...S,size:S.size!=null?S.size:G}))),B=_L.getTemplate(D0),Q=a$.getTemplate(z0),J=UL.getTemplate(_6),U=YL.getTemplate(KB),Z=SL.getTemplate(k6);return K6(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[D,z,B,Q,J,U,Z,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},uL=(G,D)=>{return wB[w6(G,D)]||0},jL=(G,D)=>{if(g1=D,g1===1)K6();G.forEach(vL)},PL=OL,TL={getTemplate(G,D){let{name:z,columns:B,rowRange:Q,displayName:J,showRowStripes:U,showColumnStripes:Z,showFilterButtons:S,highlightFirstColumn:X,highlightLastColumn:Y}=G||{},W=!Q||Q[0]-Q[1]===0;if(!G||!z||!Array.isArray(B)||!B.length||W)return{name:"table"};let q=B.map((f,N)=>({name:"filterColumn",properties:{rawMap:{colId:N.toString(),hiddenButton:S[N]?0:1}}})),H=`A${Q[0]}`,_=`${OD(B.length)}${Q[1]}`,k=`${H}:${_}`,w=`${D+1}`,K=D?`${J}_${w}`:J;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:K,displayName:K,ref:k,totalsRowShown:0,id:w}},children:[{name:"autoFilter",properties:{rawMap:{ref:k}},children:q},{name:"tableColumns",properties:{rawMap:{count:B.length}},children:B.map((f,N)=>({name:"tableColumn",properties:{rawMap:{id:(N+1).toString(),name:gL(Y$(f)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:X?1:0,showLastColumn:Y?1:0,showRowStripes:U?1:0,showColumnStripes:Z?1:0}}}]}}},yL=TL,NG=(G)=>{let[D,z,B,Q]=G;return{name:`a:${D}`,children:[{name:`a:${z}`,properties:{rawMap:{val:B,lastClr:Q}}}]}},xL={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[NG(["dk1","sysClr","windowText","000000"]),NG(["lt1","sysClr","window","FFFFFF"]),NG(["dk2","srgbClr","44546A"]),NG(["lt2","srgbClr","E7E6E6"]),NG(["accent1","srgbClr","4472C4"]),NG(["accent2","srgbClr","ED7D31"]),NG(["accent3","srgbClr","A5A5A5"]),NG(["accent4","srgbClr","FFC000"]),NG(["accent5","srgbClr","5B9BD5"]),NG(["accent6","srgbClr","70AD47"]),NG(["hlink","srgbClr","0563C1"]),NG(["folHlink","srgbClr","954F72"])]}}},cL=xL,C=(G)=>{let[D,z,B,Q]=G;return{name:`a:${D}`,properties:{rawMap:{script:B,typeface:z,panose:Q}}}},hL={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[C(["latin","Calibri Light",void 0,"020F0302020204030204"]),C(["ea",""]),C(["cs",""]),C(["font","游ゴシック Light","Jpan"]),C(["font","맑은 고딕","Hang"]),C(["font","等线 Light","Hans"]),C(["font","新細明體","Hant"]),C(["font","Times New Roman","Arab"]),C(["font","Times New Roman","Hebr"]),C(["font","Tahoma","Thai"]),C(["font","Nyala","Ethi"]),C(["font","Vrinda","Beng"]),C(["font","Shruti","Gujr"]),C(["font","MoolBoran","Khmr"]),C(["font","Tunga","Knda"]),C(["font","Raavi","Guru"]),C(["font","Euphemia","Cans"]),C(["font","Plantagenet Cherokee","Cher"]),C(["font","Microsoft Yi Baiti","Yiii"]),C(["font","Microsoft Himalaya","Tibt"]),C(["font","MV Boli","Thaa"]),C(["font","Mangal","Deva"]),C(["font","Gautami","Telu"]),C(["font","Latha","Taml"]),C(["font","Estrangelo Edessa","Syrc"]),C(["font","Kalinga","Orya"]),C(["font","Kartika","Mlym"]),C(["font","DokChampa","Laoo"]),C(["font","Iskoola Pota","Sinh"]),C(["font","Mongolian Baiti","Mong"]),C(["font","Times New Roman","Viet"]),C(["font","Microsoft Uighur","Uigh"]),C(["font","Sylfaen","Geor"]),C(["font","Arial","Armn"]),C(["font","Leelawadee UI","Bugi"]),C(["font","Microsoft JhengHei","Bopo"]),C(["font","Javanese Text","Java"]),C(["font","Segoe UI","Lisu"]),C(["font","Myanmar Text","Mymr"]),C(["font","Ebrima","Nkoo"]),C(["font","Nirmala UI","Olck"]),C(["font","Ebrima","Osma"]),C(["font","Phagspa","Phag"]),C(["font","Estrangelo Edessa","Syrn"]),C(["font","Estrangelo Edessa","Syrj"]),C(["font","Estrangelo Edessa","Syre"]),C(["font","Nirmala UI","Sora"]),C(["font","Microsoft Tai Le","Tale"]),C(["font","Microsoft New Tai Lue","Talu"]),C(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[C(["latin","Calibri",void 0,"020F0502020204030204"]),C(["ea",""]),C(["cs",""]),C(["font","游ゴシック","Jpan"]),C(["font","맑은 고딕","Hang"]),C(["font","等线","Hans"]),C(["font","新細明體","Hant"]),C(["font","Arial","Arab"]),C(["font","Arial","Hebr"]),C(["font","Tahoma","Thai"]),C(["font","Nyala","Ethi"]),C(["font","Vrinda","Beng"]),C(["font","Shruti","Gujr"]),C(["font","DaunPenh","Khmr"]),C(["font","Tunga","Knda"]),C(["font","Raavi","Guru"]),C(["font","Euphemia","Cans"]),C(["font","Plantagenet Cherokee","Cher"]),C(["font","Microsoft Yi Baiti","Yiii"]),C(["font","Microsoft Himalaya","Tibt"]),C(["font","MV Boli","Thaa"]),C(["font","Mangal","Deva"]),C(["font","Gautami","Telu"]),C(["font","Latha","Taml"]),C(["font","Estrangelo Edessa","Syrc"]),C(["font","Kalinga","Orya"]),C(["font","Kartika","Mlym"]),C(["font","DokChampa","Laoo"]),C(["font","Iskoola Pota","Sinh"]),C(["font","Mongolian Baiti","Mong"]),C(["font","Arial","Viet"]),C(["font","Microsoft Uighur","Uigh"]),C(["font","Sylfaen","Geor"]),C(["font","Arial","Armn"]),C(["font","Leelawadee UI","Bugi"]),C(["font","Microsoft JhengHei","Bopo"]),C(["font","Javanese Text","Java"]),C(["font","Segoe UI","Lisu"]),C(["font","Myanmar Text","Mymr"]),C(["font","Ebrima","Nkoo"]),C(["font","Nirmala UI","Olck"]),C(["font","Ebrima","Osma"]),C(["font","Phagspa","Phag"]),C(["font","Estrangelo Edessa","Syrn"]),C(["font","Estrangelo Edessa","Syrj"]),C(["font","Estrangelo Edessa","Syre"]),C(["font","Nirmala UI","Sora"]),C(["font","Microsoft Tai Le","Tale"]),C(["font","Microsoft New Tai Lue","Talu"]),C(["font","Ebrima","Tfng"])]}]}}},iL=hL,vG=(G,D,z)=>({name:`a:${G}`,properties:{rawMap:{val:D}},children:z}),JQ=(G)=>{let[D,z,B,Q,J,U]=G,Z=[];if(Z.push(vG("satMod",B)),Q)Z.push(vG("lumMod",Q));if(J)Z.push(vG("tint",J));if(U)Z.push(vG("shade",U));return{name:"a:gs",properties:{rawMap:{pos:D}},children:[{name:"a:schemeClr",properties:{rawMap:{val:z}},children:Z}]}},fB=(G,D)=>({name:"a:solidFill",children:[vG("schemeClr",G,D)]}),T1=(G)=>{let[D,z,B,Q,J]=G,[U,Z]=J;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:D}},children:[{name:"a:gsLst",children:[JQ(z),JQ(B),JQ(Q)]},{name:"a:lin",properties:{rawMap:{ang:U,scaled:Z}}}]}},UQ=(G)=>{let[D,z,B,Q]=G;return{name:"a:ln",properties:{rawMap:{w:D,cap:z,cmpd:B,algn:Q}},children:[fB("phClr"),vG("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},ZQ=(G)=>{let D=[];if(G){let[z,B,Q,J,U]=G;D.push({name:"a:outerShdw",properties:{rawMap:{blurRad:z,dist:B,dir:Q,algn:J,rotWithShape:U}},children:[vG("srgbClr","000000",[vG("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},D.length?{children:D}:{})]}},nL=()=>({name:"a:fillStyleLst",children:[fB("phClr"),T1(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),T1(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),dL=()=>({name:"a:lnStyleLst",children:[UQ(["6350","flat","sng","ctr"]),UQ(["12700","flat","sng","ctr"]),UQ(["19050","flat","sng","ctr"])]}),lL=()=>({name:"a:effectStyleLst",children:[ZQ(),ZQ(),ZQ(["57150","19050","5400000","ctr","0"])]}),pL=()=>({name:"a:bgFillStyleLst",children:[fB("phClr"),fB("phClr",[vG("tint","95000"),vG("satMod","170000")]),T1(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),mL={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[nL(),dL(),lL(),pL()]}}},tL=mL,sL={getTemplate(){return{name:"a:themeElements",children:[cL.getTemplate(),iL.getTemplate(),tL.getTemplate()]}}},oL=sL,rL={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[oL.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},aL=rL,eL=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),GS=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),DS=(G)=>({name:"v:formulas",children:G.map((D)=>({name:"v:f",properties:{rawMap:{eqn:D}}}))}),zS=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),f6=(G)=>{let{aspectratio:D,rotation:z}=G||{},B={};if(D)B.aspectratio="t";if(z)B.rotation="t";return{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:B}}};function BS(G,D,z,B,Q){return(G-D)/(z-D)*(Q-B)+B}var QS=(G,D)=>{let z,{recolor:B,brightness:Q,contrast:J,id:U}=G;if(B){if(z={},B==="Washout"||B==="Grayscale")z.gain="19661f",z.blacklevel="22938f";if(B==="Black & White"||B==="Grayscale"){if(z.grayscale="t",B==="Black & White")z.bilevel="t"}}if(!B||B==="Grayscale"){if(!z)z={};if(J!=null&&J!==50){let Z="1";if(J>=0){if(J<50)Z=String(J/50);else if(J<100)Z=String(50/(100-J));else if(J===100)Z="2147483647f"}z.gain=Z}if(Q!=null&&Q!==50)z.blacklevel=BS(Q,0,100,-0.5,0.5).toString()}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${D}`,title:U}}],rawMap:z}}},JS=()=>{let G=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[GS(),DS(G),zS(),f6({aspectratio:!0})]}},$U=(G)=>Math.floor((G??0)*0.74999943307122),US=(G,D)=>{let{width:z=0,height:B=0,altText:Q}=G,J=$U(z),U=$U(B);return{name:"v:shape",properties:{rawMap:{id:G.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${J}pt; height: ${U}pt; z-index: ${D+1}`,type:"#_x0000_t75",alt:Q}},children:[QS(G,D+1),f6({rotation:!0})]}},ZS={getTemplate(G){let D=mG.get(G.sheetIndex)||[],z=[eL(),JS(),...D.map((B,Q)=>US(B,Q))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:z}}},$S=ZS,LS={getTemplate(G,D){let z=(D+1).toString();return{name:"sheet",properties:{rawMap:{name:G,sheetId:z,"r:id":`rId${z}`}}}}},SS=LS,XS={getTemplate(G){return{name:"sheets",children:G.map((D,z)=>SS.getTemplate(D,z))}}},YS=XS,WS={getTemplate(G,D){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:D}}}]},YS.getTemplate(G)]}}},qS=WS,_S=(G)=>Math.ceil((G-12)/7+1),kS={getTemplate(G){let{min:D,max:z,outlineLevel:B,s:Q,width:J,hidden:U,bestFit:Z}=G,S=1,X="0";if(J>1)S=_S(J),X="1";return{name:"col",properties:{rawMap:{min:D,max:z,outlineLevel:B!=null?B:void 0,width:S,style:Q,hidden:U?"1":"0",bestFit:Z?"1":"0",customWidth:X}}}}},wS=kS,KS={getTemplate(G){return{name:"mergeCell",properties:{rawMap:{ref:G}}}}},fS=KS,NS=(G)=>{let D=G.charAt(0).toLowerCase();return D==="s"?"inlineStr":D},FS={getTemplate(G,D,z){let{ref:B,data:Q,styleId:J}=G,{type:U,value:Z}=Q||{type:"empty",value:null},S=U;if(U==="f")S="str";else if(U.charAt(0)===U.charAt(0).toUpperCase())S=NS(U);let X={name:"c",properties:{rawMap:{r:B,t:S==="empty"?void 0:S,s:J?uL(J,z):void 0}}};if(S==="empty")return X;let Y;if(S==="str"&&U==="f")Y=[{name:"f",textNode:LU(kB(Z))}];else if(S==="inlineStr")Y=[{name:"is",children:[{name:"t",textNode:LU(kB(Z))}]}];else Y=[{name:"v",textNode:Z}];return Object.assign({},X,{children:Y})}},ES=FS,IS=(G,D)=>{let z=[],B=0;for(let Q=0;Q=0;Q--){let J=[],U=G[z[Q].pos];for(let Z=1;Z<=U.mergeAcross;Z++)J.push({ref:`${OD(z[Q].excelPos+1+Z)}${D+1}`,styleId:U.styleId,data:{type:"empty",value:null}});if(J.length)G.splice(z[Q].pos+1,0,...J)}},MS=(G)=>G.data?.value!==""||G.styleId!==void 0,AS={getTemplate(G,D,z){let{collapsed:B,hidden:Q,height:J,outlineLevel:U,cells:Z=[]}=G;IS(Z,D);let S=Z.filter(MS).map((X,Y)=>ES.getTemplate(X,Y,z));return{name:"row",properties:{rawMap:{r:D+1,collapsed:B?"1":"0",hidden:Q?"1":"0",ht:J,customHeight:J!=null?"1":"0",spans:"1:1",outlineLevel:U||void 0}},children:S}}},RS=AS,CS=(G,D,z)=>{let B=[],Q=[];G.forEach((Z,S)=>{let X=Z.cells,Y=0,W;X.forEach((q,H)=>{let _=H+Y+1,k=OD(_),w=S+1;if(q.mergeAcross){Y+=q.mergeAcross;let f=OD(H+Y+1);B.push(`${k}${w}:${f}${w}`)}if(!D[_-1])D[_-1]={};let{collapsibleRanges:K}=q;if(K)K.forEach((f)=>{Q.push([_+f[0],_+f[1]])});W=D[_-1],W.min=_,W.max=_,q.ref=`${k}${w}`})}),Q.sort((Z,S)=>{if(Z[0]!==S[0])return Z[0]-S[0];return S[1]-Z[1]});let J=new Map,U=new Map;return Q.filter((Z)=>{let S=Z.toString();if(J.get(S))return!1;return J.set(S,!0),!0}).forEach((Z)=>{let S=D.find((Y)=>Y.min==Z[0]&&Y.max==Z[1]),X=U.get(Z[0]);D.push({min:Z[0],max:Z[1],outlineLevel:z?void 0:X||1,width:(S||{width:100}).width}),U.set(Z[0],(X||0)+1)}),B},VS=(G)=>{if(!G||G!=="Portrait"&&G!=="Landscape")return"portrait";return G.toLocaleLowerCase()},bS=(G)=>{if(G==null)return 1;let z=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(G);return z===-1?1:z+1},vS=(G)=>{let D={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(let z of Object.keys(D))G=G.replace(z,D[z]);return G},OS=(G)=>{if(G==="Center")return"C";if(G==="Right")return"R";return"L"},uS=(G,D)=>{if(!D)return G;if(G+="&"",G+=D.fontName||"Calibri",D.bold!==D.italic)G+=D.bold?",Bold":",Italic";else if(D.bold)G+=",Bold Italic";else G+=",Regular";if(G+=""",D.size)G+=`&${D.size}`;if(D.strikeThrough)G+="&S";if(D.underline)G+=`&${D.underline==="Double"?"E":"U"}`;if(D.color)G+=`&K${D.color.replace("#","").toUpperCase()}`;return G},jS=(G,D,z)=>G.reduce((B,Q,J)=>{let U=OS(Q.position),Z=uS(`${B}&${U}`,Q.font),S=["Left","Center","Right"];if(!Q.position)Q.position=S[J];let{image:X}=Q;if(Q.value==="&[Picture]"&&X){let Y=`${U}${D}${z}`;N6(X,Y)}return`${Z}${HS(vS(Q.value))}`},""),PS=(G)=>{let D=["all","first","even"],z=[];return D.forEach((B)=>{let Q=G[B],J=B==="all"?"odd":B;if(!Q)return;for(let U of Object.keys(Q)){let Z=Q[U],S=`${U.charAt(0).toUpperCase()}${U.slice(1)}`,X=U[0].toUpperCase();if(Z){let Y=B==="all"?"":B.toUpperCase();z.push({name:`${J}${S}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:jS(Z,X,Y)})}}}),z},gS=(G)=>{return(D)=>{if(G.length)D.children.push({name:"cols",children:G.map((z)=>wS.getTemplate(z))});return D}},TS=(G,D)=>{return(z)=>{if(G.length)z.children.push({name:"sheetData",children:G.map((B,Q)=>RS.getTemplate(B,Q,D))});return z}},yS=(G)=>{let D=G.length;if(!D)return"";let z=Array(D+1);z[0]=D;for(let Q=1;Q<=D;Q++)z[Q]=G.charCodeAt(Q-1)&255;let B=0;for(let Q=z.length-1;Q>=0;Q--){let J=z[Q],U=(B&16384)===0?0:1,Z=B<<1&32767;B=(U|Z)^J}return(B^52811).toString(16).toUpperCase().padStart(4,"0")},xS=(G)=>{return(D)=>{if(!G)return D;let z=typeof G==="boolean"?{}:G,B={sheet:1},Q=z.password?yS(z.password):"";if(Q)B.password=Q;let J={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(J).forEach((U)=>{let Z=z[U];if(Z==null||Z===J[U])return;B[U]=Z?0:1}),D.children.push({name:"sheetProtection",properties:{rawMap:B}}),D}},cS=(G)=>{return(D)=>{if(G.length)D.children.push({name:"mergeCells",properties:{rawMap:{count:G.length}},children:G.map((z)=>fS.getTemplate(z))});return D}},hS=(G)=>{return(D)=>{let{top:z=0.75,right:B=0.7,bottom:Q=0.75,left:J=0.7,header:U=0.3,footer:Z=0.3}=G;return D.children.push({name:"pageMargins",properties:{rawMap:{bottom:Q,footer:Z,header:U,left:J,right:B,top:z}}}),D}},iS=(G)=>{return(D)=>{if(G)D.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:VS(G.orientation),paperSize:bS(G.pageSize)}}});return D}},nS=(G)=>{return(D)=>{if(!G)return D;let z=G.first!=null?1:0,B=G.even!=null?1:0;return D.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:z,differentOddEven:B}},children:PS(G)}),D}},dS=(G)=>{return(D)=>{if(G)D.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++D.rIdCounter}`}}}]});return D}},lS=(G)=>{return(D)=>{if(qD.get(G)?.length)D.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++D.rIdCounter}`}}});return D}},pS=(G)=>{return(D)=>{if(mG.get(G))D.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++D.rIdCounter}`}}});return D}},mS=(G=0,D=0)=>{let z=G>0||D>0;return z?[{name:"pane",properties:{rawMap:{state:z?"frozen":void 0,topLeftCell:z?`${OD(G+1)}${D+1}`:void 0,xSplit:G===0?void 0:G,ySplit:D===0?void 0:D}}}]:void 0},tS=(G=!1,D,z)=>{return(B)=>{return B.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:G===!0?"1":"0",workbookViewId:"0"}},children:mS(D,z)}]}),B}},sS=()=>{return(G)=>{return G.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),G}},oS=(G)=>{return(D)=>{let z=G.reduce((B,Q)=>{if(Q.outlineLevel&&Q.outlineLevel>B)return Q.outlineLevel;return B},0);return D.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:z?z:void 0}}}),D}},rS={getTemplate(G){let{worksheet:D,currentSheet:z,config:B}=G,{margins:Q={},pageSetup:J,headerFooterConfig:U,suppressColumnOutline:Z,rightToLeft:S,frozenRowCount:X,frozenColumnCount:Y,protectSheet:W}=B,{table:q}=D,{rows:H,columns:_}=q,k=_?.length?CS(H,_,!!Z):[],w=uG.get(z),{children:K}=[sS(),tS(S,Y,X),oS(H),gS(_),TS(H,z+1),xS(W),cS(k),hS(Q),iS(J),nS(U),lS(z),pS(z),dS(w)].reduce((f,N)=>N(f),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:K}}},aS=rS,MD=new Map,KG=[],bD=[],vD=new Map,WD=new Map,qD=new Map,mG=new Map,Qz=new Map,Jz=new Map,uG=new Map,eS="AG-GRID-TABLE",$J="SINGLE_SHEET";function GX(){return $J}function DX(G){$J=G}function zX(G,D,z){ZX(D),jL(G,KG.length);let B=Object.assign({},z);if(z.exportAsExcelTable&&z.pivotModeActive)ZJ(163,{featureName:"pivot mode"}),B.exportAsExcelTable=!1;JX(D,B);let Q=MX(D,B);return AX(Q),Q}function BX(G){return G.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function QX(G,D){if(uG.has(G)){ZJ(164);return}uG.set(G,D)}function JX(G,D){let{exportAsExcelTable:z,prependContent:B,appendContent:Q,headerRowCount:J=0}=D;if(!z)return;let U=typeof z==="boolean"?{}:z,{name:Z,showColumnStripes:S,showRowStripes:X,showFilterButton:Y,highlightFirstColumn:W,highlightLastColumn:q}=U,H=BX(Z||eS),_=KG.length-1,{table:k}=G,{rows:w,columns:K}=k,f=B?B.length:0,N=Q?Q.length:0,F=w.length,E=K.length,I=[],V=[];for(let A=0;AJ.id===G.id))Q.push(G)}function UX(G,D,z,B,Q){let J=KG.length,{row:U,column:Z}=G.position||{},S=G;if(B){if(D!=null&&z!=null&&(!U||!Z)){if(!G.position)G.position={};G.position=Object.assign({},G.position,{row:D,column:B.indexOf(z)+1})}S$(S,B),X$(S,Q)}F6({imageToAdd:S,idx:J});let X=Jz.get(J);if(!X)X=new Map,Jz.set(J,X);let Y=qD.get(J);if(!Y)qD.set(J,[S]);else Y.push(S);if(!X.get(G.id))X.set(G.id,{index:X.size,type:G.imageType})}function F6(G){let{imageToAdd:D,idx:z}=G,B=WD.get(D.id);if(B){let Q=B.find((J)=>J.sheetId===z);if(Q)Q.image.push(D);else B.push({sheetId:z,image:[D]})}else WD.set(D.id,[{sheetId:z,image:[D]}]),Qz.set(D.id,{type:D.imageType,index:Qz.size})}function ZX(G){let D=H$(G.name)||"",z="";while(KG.indexOf(`${D}${z}`)!==-1)if(z==="")z="_1";else z=`_${parseInt(z.slice(1),10)+1}`;G.name=`${D}${z}`,KG.push(G.name)}function $X(G){if(MD.has(G))return MD.get(G);return MD.set(G,MD.size),MD.size-1}function LX(){MD.clear(),WD.clear(),qD.clear(),mG.clear(),Qz.clear(),Jz.clear(),uG.clear(),KG=[],bD=[],vD=new Map,$J="SINGLE_SHEET"}function SX(G){return SG(qS.getTemplate(KG,G))}function XX(G){return SG(PL.getTemplate(G))}function YX(){return SG(x$.getTemplate(MD))}function WX(G){return SG(N$.getTemplate(G))}function qX(G){return SG(M$.getTemplate(G))}function HX(G,D){return SG(K$.getTemplate({sheetLen:G,hasCustomProperties:D}))}function _X(G){let D=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];if(G)D.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});let z=Y0.getTemplate(D);return SG(z)}function kX(){return SG(aL.getTemplate())}function wX(G,D){return SG(yL.getTemplate(G,D))}function KX(G){let D=Array(G).fill(void 0).map((B,Q)=>({Id:`rId${Q+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${Q+1}.xml`})),z=Y0.getTemplate([...D,{Id:`rId${G+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${G+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${G+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return SG(z)}function fX(G){return SG(j$.getTemplate({sheetIndex:G}))}function NX(G){let D=Jz.get(G)||[],z=[];for(let[B,Q]of D){let{index:J,type:U}=Q;z.push({Id:`rId${J+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${Qz.get(B).index+1}.${vB(U)}`})}return SG(Y0.getTemplate(z))}function FX(G){return SG($S.getTemplate({sheetIndex:G}),!0)}function EX(G){let D=mG.get(G)||[],z=[];for(let B=0;B{if(!G.size)return;let z=new Map;D.forEach((B,Q)=>{if(G.has(B))z.set(Q,G.get(B))}),G.clear(),z.forEach((B,Q)=>G.set(Q,B))},AX=(G)=>{let D=vD.get(G)??[];D.push(KG.length-1),vD.set(G,D),bD.push(G)},RX=(G)=>{let D=new Map(vD),z=[];for(let B of G){let Q=D.get(B);if(!Q?.length)return null;let J=Q.shift();z.push(J),D.set(B,Q)}return z},CX=(G)=>{if(!G.length||bD.length===0)return null;let D=new Set,z=[];for(let B of G){let Q=bD.findIndex((J,U)=>!D.has(U)&&J===B);if(Q===-1)return null;D.add(Q),z.push(Q)}return z},VX=(G)=>{let D=new Map;G.forEach((z,B)=>D.set(z,B)),KG=G.map((z)=>KG[z]),bD=G.map((z)=>bD[z]),N0(qD,G),N0(mG,G),N0(uG,G),N0(Jz,G),WD.forEach((z)=>{z.forEach((B)=>{let Q=D.get(B.sheetId);if(Q!=null)B.sheetId=Q})}),vD=new Map,bD.forEach((z,B)=>{let Q=vD.get(z)??[];Q.push(B),vD.set(z,Q)})},bX=(G)=>{if(G.length<=1)return;let D=RX(G)??CX(G);if(!D)return;VX(D)},OB=class{getStringPosition(G){return $X(G)}addBodyImageToMap(G,D,z,B,Q){UX(G,D,z,B,Q)}addHeaderFooterImageToMap(G,D){N6(G,D)}addWorksheet(G,D,z){return zX(G,D,z)}syncOrderWithSheetData(G){bX(G)}reset(){LX()}setFactoryMode(G){DX(G)}getFactoryMode(){return GX()}getSheetNames(){return[...KG]}},OX=async(G)=>{let D=0,z=[],B=new WritableStream({write:(U)=>{z.push(U),D+=U.length}}),Q=new ReadableStream({start:(U)=>{let Z=new FileReader;Z.onload=(S)=>{if(S.target?.result)U.enqueue(S.target.result);U.close()},Z.readAsArrayBuffer(G)}}),J=new window.CompressionStream("deflate-raw");return await Q.pipeThrough(J).pipeTo(B),{size:D,content:new Blob(z)}},uX=async(G)=>{let D=new Blob([G]),{size:z,content:B}=await OX(D),Q=new Uint8Array(await B.arrayBuffer());return{size:z,content:Q}},jX=(G)=>{let D=G.getHours();return D<<=6,D=D|G.getMinutes(),D<<=5,D=D|G.getSeconds()/2,D},PX=(G)=>{let D=G.getFullYear()-1980;return D<<=4,D=D|G.getMonth()+1,D<<=5,D=D|G.getDate(),D};function LG(G,D){let z="";for(let B=0;B>>=8;return z}var SU=(G)=>{if(!G.length)return 0;let D=-1,z=0,B=0,Q=0;for(let J=0;J>>8^Q;return D^-1},XU=(G)=>{if(!G.length)return 0;if(typeof G==="string")return SU(new TextEncoder().encode(G));return SU(G)},gX=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function TX(G){let D=String.fromCharCode;function z(W){let q=[];if(!W)return[];let H=W.length,_=0,k,w;while(_=55296&&k<=56319&&_=55296&&W<=57343)throw Error(vX(255,{point:W}))}function Q(W,q){return D(W>>q&63|128)}function J(W){if((W&4294967168)==0)return D(W);let q="";if((W&4294965248)==0)q=D(W>>6&31|192);else if((W&4294901760)==0)B(W),q=D(W>>12&15|224),q+=Q(W,6);else if((W&4292870144)==0)q=D(W>>18&7|240),q+=Q(W,12),q+=Q(W,6);return q+=D(W&63|128),q}let U=z(G),Z=U.length,S=-1,X,Y="";while(++S{let{content:U,path:Z,created:S}=G,X=jX(S),Y=PX(S),W=XU(Q),q=J!==void 0?J:B,H=TX(Z),_=H!==Z,k="";if(_){let N=LG(1,1)+LG(XU(H),4)+H;k="up"+LG(N.length,2)+N}let w="\x14\x00"+(_?"\x00\b":"\x00\x00")+LG(D?8:0,2)+LG(X,2)+LG(Y,2)+LG(q?W:0,4)+LG(J??B,4)+LG(B,4)+LG(H.length,2)+LG(k.length,2),K="PK\x03\x04"+w+H+k,f="PK\x01\x02\x14\x00"+w+"\x00\x00\x00\x00\x00\x00"+(U?"\x00\x00\x00\x00":"\x10\x00\x00\x00")+LG(z,4)+H+k;return{localFileHeader:Uint8Array.from(K,(N)=>N.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(f,(N)=>N.charCodeAt(0))}},I6=(G)=>{let D;if(typeof G==="string"){let z=atob(G.split(";base64,")[1]);D=Uint8Array.from(z,(B)=>B.charCodeAt(0))}else D=G;return{size:D.length,content:D}},yX=async(G)=>{let{content:D}=G,{size:z,content:B}=!D?{size:0,content:Uint8Array.from([])}:I6(D),Q,J,U=!1;if(G.type==="file"&&B&&z>0){let S=await uX(B);Q=S.content,J=S.size,U=!0}return{rawContent:B,rawSize:z,deflatedContent:Q,deflatedSize:J,isCompressed:U}},xX=(G,D)=>{let{content:z}=G,{content:B}=!z?{content:Uint8Array.from([])}:I6(z);return{...E6(G,!1,D,B.length,B,void 0),content:B,isCompressed:!1}},cX=(G,D,z)=>{let B="PK\x05\x06\x00\x00\x00\x00"+LG(G,2)+LG(G,2)+LG(D,4)+LG(z,4)+"\x00\x00";return Uint8Array.from(B,(Q)=>Q.charCodeAt(0))},M6=class{constructor(){this.folders=[],this.files=[]}addFolders(G){G.forEach(this.addFolder.bind(this))}addFolder(G){this.folders.push({path:G,created:new Date,isBase64:!1,type:"folder"})}addFile(G,D,z=!1){this.files.push({path:G,created:new Date,content:z?D:new TextEncoder().encode(D),isBase64:z,type:"file"})}async getZipFile(G="application/zip"){let D=await this.buildCompressedFileStream();return this.clearStream(),new Blob([D],{type:G})}getUncompressedZipFile(G="application/zip"){let D=this.buildFileStream();return this.clearStream(),new Blob([D],{type:G})}clearStream(){this.folders=[],this.files=[]}packageFiles(G){let D=0,z=0;for(let X of G){let{localFileHeader:Y,centralDirectoryHeader:W,content:q}=X;D+=Y.length+q.length,z+=W.length}let B=new Uint8Array(D),Q=new Uint8Array(z),J=0,U=0;for(let X of G){let{localFileHeader:Y,centralDirectoryHeader:W,content:q}=X;B.set(Y,J),J+=Y.length,B.set(q,J),J+=q.length,Q.set(W,U),U+=W.length}let Z=cX(G.length,z,D),S=new Uint8Array(B.length+Q.length+Z.length);return S.set(B),S.set(Q,B.length),S.set(Z,B.length+Q.length),S}async buildCompressedFileStream(){let G=[...this.folders,...this.files],D=await Promise.all(G.map(yX)),z=[],B=0;for(let Q=0;Q{if(G.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!WD.size)return;G.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let D=0;WD.forEach((z)=>{let B=z[0].image[0],{base64:Q,imageType:J}=B;G.addFile(`xl/media/image${++D}.${vB(J)}`,Q,!0)})},iX=(G,D)=>{let z=0,B=0;for(let Q=0;Q0&&qD.has(Q),Z=uG.size>0&&uG.get(Q),S=WD.size&&mG.has(Q);if(!U&&!Z&&!S)continue;let X,Y,W;if(U)nX(G,Q,z),Y=z,z++;if(S)dX(G,Q,B),W=B,B++;if(Z)X=Z.name;let q=`xl/worksheets/_rels/sheet${Q+1}.xml.rels`;G.addFile(q,IX({tableName:X,drawingIndex:Y,vmlDrawingIndex:W}))}},nX=(G,D,z)=>{let Q=`xl/drawings/drawing${z+1}.xml`,J=`xl/drawings/_rels/drawing${z+1}.xml.rels`;G.addFile(J,NX(D)),G.addFile(Q,fX(D))},dX=(G,D,z)=>{let Q=`xl/drawings/vmlDrawing${z+1}.vml`,J=`xl/drawings/_rels/vmlDrawing${z+1}.vml.rels`;G.addFile(Q,FX(D)),G.addFile(J,EX(D))},lX=(G)=>{let D=uG,z=Array.from(D.keys());for(let B=0;B{let U=!!J&&Object.keys(J).some((Z)=>J[Z]!=null);if(G.addFile("xl/workbook.xml",SX(Q)),G.addFile("xl/styles.xml",XX(D)),G.addFile("xl/sharedStrings.xml",YX()),G.addFile("xl/theme/theme1.xml",kX()),G.addFile("xl/_rels/workbook.xml.rels",KX(B)),G.addFile("docProps/core.xml",WX(z)),U)G.addFile("docProps/custom.xml",qX(J));G.addFile("[Content_Types].xml",HX(B,U)),G.addFile("_rels/.rels",_X(U))},A6=(G,D,z={},B)=>{if(!D||D.length===0)return W6(159),B.reset(),!1;B.syncOrderWithSheetData(D);let{fontSize:Q=11,author:J="AG Grid",activeTab:U=0,customMetadata:Z}=z,S=D.length,X=Math.max(Math.min(U,S-1),0);return hX(G),lX(G),iX(G,D),pX(G,Q,J,S,X,Z),B.reset(),!0},y1=(G,D=new OB)=>{let{data:z,fontSize:B,author:Q,activeSheetIndex:J,customMetadata:U}=G,Z=G.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",S=new M6;if(!A6(S,z,{author:Q,fontSize:B,activeTab:J,customMetadata:U},D))return Promise.resolve(void 0);return S.getZipFile(Z)},x1=(G,D=new OB)=>{let{data:z,fontSize:B,author:Q,activeSheetIndex:J,customMetadata:U}=G,Z=G.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",S=new M6;if(!A6(S,z,{author:Q,fontSize:B,activeTab:J,customMetadata:U},D))return;return S.getUncompressedZipFile(Z)},mX=(G)=>{let{fileName:D="export.xlsx"}=G,z=new OB;y1(G,z).then((B)=>{if(B){let Q=typeof D==="function"?D():D;P1(Q,B)}})},tX=class extends r9{constructor(){super(...arguments);this.beanName="excelCreator",this.workbook=new OB}getMergedParams(G){let D=this.gos.get("defaultExcelExportParams");return Object.assign({},D,G)}export(G){if(this.isExportSuppressed()){W6(160);return}let D=()=>{let B=this.getMergedParams(G),Q=this.getData(B),{fontSize:J,author:U,mimeType:Z,customMetadata:S}=B,X={data:[Q],fontSize:J,author:U,mimeType:Z,customMetadata:S};this.packageCompressedFile(X).then((Y)=>{if(Y){let{fileName:W}=B,q=typeof W==="function"?W(zU(this.gos,{})):W;P1(this.getFileName(q),Y)}})},{overlays:z}=this.beans;if(z)z.showExportOverlay(D);else D()}exportDataAsExcel(G){this.export(G)}getDataAsExcel(G){let D=this.getMergedParams(G),z=this.getData(D),{fontSize:B,author:Q,mimeType:J,customMetadata:U}=D,Z={data:[z],fontSize:B,author:Q,mimeType:J,customMetadata:U};return this.packageFile(Z)}setFactoryMode(G){this.workbook.setFactoryMode(G)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(G){let D=this.getMergedParams(G);return this.getData(D)}getMultipleSheetsAsExcel(G){return x1(G,this.workbook)}exportMultipleSheetsAsExcel(G){y1(G,this.workbook).then((D)=>{let{fileName:z="export.xlsx"}=G;if(D){let B=typeof z==="function"?z():z;P1(B,D)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(G){let{colModel:D,colNames:z,rowGroupColsSvc:B,valueSvc:Q,formula:J,gos:U}=this.beans,Z=U.get("excelStyles")||[],S=this.createStyleLinker(Z),X={...G,colModel:D,colNames:z,rowGroupColsSvc:B,valueSvc:Q,formulaSvc:J,gos:U,suppressRowOutline:G.suppressRowOutline||G.skipRowGroups,headerRowHeight:G.headerRowHeight||G.rowHeight,baseExcelStyles:Z,rightToLeft:G.rightToLeft??U.get("enableRtl"),styleLinker:S,headerRowCount:e9(D),pivotModeActive:D.isPivotActive(),workbook:this.workbook};return new q$(X)}createStyleLinker(G){let D=[],z=new Set,B=new Map;G.forEach((U,Z)=>{D.push(U.id),z.add(U.id),B.set(U.id,Z)});let{gos:Q,cellStyles:J}=this.beans;return(U)=>{let{rowType:Z,rowIndex:S,value:X,column:Y,columnGroup:W,node:q}=U,H=Z==="HEADER",_=Z==="HEADER_GROUPING",k=H?Y:W,w=[];if(H||_){if(w.push("header"),_)w.push("headerGroup");if(k)w=w.concat(a9(k.getDefinition(),Q,Y||null,W||null));return w}let K=["cell"];if(!D.length)return K;let f=Y.getDefinition();return J?.processAllCellClasses(f,zU(Q,{value:X,data:q.data,node:q,colDef:f,column:Y,rowIndex:S}),(N)=>{if(z.has(N))K.push(N)}),K.sort((N,F)=>{let E=B.get(N)??-1,I=B.get(F)??-1;return E===I?0:Ethis.onFocusIn(G),onFocusOut:(G)=>this.onFocusOut(G),focusInnerElement:(G)=>this.focusInnerElement(G),onTabKeyDown:(G)=>this.onTabKeyDown(G),handleKeyDown:(G)=>this.handleKeyDown(G)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(G){if(G.listItemHeightChanged)this.rowHeight=this.getItemHeight(),this.refresh()}refreshAriaProperties(){let D=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),z=this.eContainer;zY(z,this.model?.getRowCount()>0?this.ariaRole:"presentation"),GY(z,D)}addResizeObserver(){let G=()=>YU(this.beans,()=>this.drawVirtualRows()),D=eX(this.beans,this.getGui(),G);this.addDestroyFunc(D)}focusInnerElement(G){return this.focusRow(G?this.model.getRowCount()-1:0),!0}onFocusIn(G){let D=G.target;if(D.classList.contains("ag-virtual-list-item"))this.lastFocusedRowIndex=aX(D)-1}onFocusOut(G){if(!this.getFocusableElement().contains(G.relatedTarget))this.lastFocusedRowIndex=null}handleKeyDown(G){let{key:D,shiftKey:z}=G;switch(D){case MG.UP:case MG.DOWN:{let B=D===MG.UP;if(G.preventDefault(),z)this.moveItem(B);else this.navigate(B)}break;case MG.PAGE_HOME:case MG.PAGE_END:case MG.PAGE_UP:case MG.PAGE_DOWN:if(this.navigateToPage(D)!==null)G.preventDefault();break}}onTabKeyDown(G){this.stopPropagationCallbacks?.stopPropagation(G),this.forceFocusOutOfContainer(G.shiftKey)}getNextRow(G){if(this.lastFocusedRowIndex==null)return;let D=this.lastFocusedRowIndex+(G?-1:1);if(D<0||D>=this.model.getRowCount())return;return D}moveItem(G){if(!this.moveItemCallback)return;let D=this.getComponentAt(this.lastFocusedRowIndex);if(!D)return;this.moveItemCallback(D,G)}navigate(G){let D=this.getNextRow(G);if(D===void 0)return;this.focusRow(D)}navigateToPage(G,D="focused"){let z=!1;if(D==="focused")D=this.getLastFocusedRow(),z=!0;let B=this.model.getRowCount()-1,Q=-1;if(G===MG.PAGE_HOME)Q=0;else if(G===MG.PAGE_END)Q=B;else if(G===MG.PAGE_DOWN)Q=Math.min(D+this.pageSize,B);else if(G===MG.PAGE_UP)Q=Math.max(D-this.pageSize,0);if(Q===-1)return null;if(z)this.focusRow(Q);else this.ensureIndexVisible(Q);return Q}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(G){if(this.isScrolling)return;this.isScrolling=!0,this.ensureIndexVisible(G),YU(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;let D=this.renderedRows.get(G);if(D)D.eDiv.focus()})}getComponentAt(G){let D=this.renderedRows.get(G);return D&&D.rowComponent}forEachRenderedRow(G){this.renderedRows.forEach((D,z)=>G(D.rowComponent,z))}getItemHeight(){if(!this.isHeightFromTheme)return this.rowHeight;return this.beans.environment.getDefaultListItemHeight()}ensureIndexVisible(G,D=!0){let z=this.model.getRowCount();if(typeof G!=="number"||G<0||G>=z)return!1;let B=G*this.rowHeight,Q=B+this.rowHeight,J=this.getGui(),U=J.scrollTop,Z=J.offsetHeight,S=U+Z,X=D?0:this.rowHeight,Y=U>B+X,W=S{if(!this.isAlive())return;if(this.canSoftRefresh(G))this.drawVirtualRows(!0);else this.clearVirtualRows(),this.drawVirtualRows()})}awaitStable(G){if(this.awaitStableCallbacks.push(G),this.awaitStableCallbacks.length>1)return;let D=this.model.getRowCount();QY(this,()=>this.eContainer.clientHeight>=D*this.rowHeight,()=>{if(!this.isAlive())return;let z=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(let B of z)B()})}canSoftRefresh(G){return!!(G&&this.renderedRows.size&&typeof this.model.areRowsEqual==="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((G,D)=>this.removeRow(D))}drawVirtualRows(G){if(!this.isAlive()||!this.model)return;let D=this.getGui(),z=D.scrollTop,B=z+D.offsetHeight;if(z===B)this.clearVirtualRows();else{let Q=Math.floor(z/this.rowHeight),J=Math.floor(B/this.rowHeight);this.pageSize=Math.floor((B-z)/this.rowHeight),this.ensureRowsRendered(Q,J,G)}}ensureRowsRendered(G,D,z){if(this.renderedRows.forEach((B,Q)=>{if((QD)&&Q!==this.lastFocusedRowIndex)this.removeRow(Q)}),z)this.refreshRows();for(let B=G;B<=D;B++){if(this.renderedRows.has(B))continue;if(B=D.getRowCount())return;let{cssIdentifier:z,ariaRole:B,renderedRows:Q,eContainer:J}=this,U=D.getRow(G),Z=B==="tree"?"treeitem":"option",S=rX({tag:"div",cls:`ag-virtual-list-item ag-${z}-virtual-list-item`,role:Z,attrs:{tabindex:"-1"}});BY(S,D.getRowCount()),DY(S,G+1);let X=this.rowHeight;S.style.height=`${X}px`,S.style.top=`${X*G}px`;let Y=this.componentCreator(U,S);if(Y.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=G),S.appendChild(Y.getGui()),Q.has(G-1))Q.get(G-1).eDiv.insertAdjacentElement("afterend",S);else if(Q.has(G+1))Q.get(G+1).eDiv.insertAdjacentElement("beforebegin",S);else J.appendChild(S);Q.set(G,{rowComponent:Y,eDiv:S,value:U})}removeRow(G){let D=this.renderedRows.get(G);D.eDiv.remove(),this.destroyBean(D.rowComponent),this.renderedRows.delete(G)}refreshRows(){let G=this.model.getRowCount();this.renderedRows.forEach((D,z)=>{if(z>=G)this.removeRow(z);else{let B=this.model.getRow(z);if(this.model.areRowsEqual?.(D.value,B))this.componentUpdater(B,D.rowComponent);else this.removeRow(z)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(G){this.model=G}getAriaElement(){return this.eContainer}destroy(){if(!this.isAlive())return;this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy()}},LY='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',$Q="ag-list-item-hovered",C6=class extends $Y{constructor(G,D,z){super();this.comp=G,this.virtualList=D,this.params=z,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(LY,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(G){this.currentDragValue=this.params.getCurrentDragValue(G),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){let G={isInterestedIn:(D)=>D===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:(D)=>this.onDragging(D),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(G)}createAutoScrollService(){let G=this.virtualList.getGui();this.autoScrollService=new ZY({scrollContainer:G,scrollAxis:"y",getVerticalPosition:()=>G.scrollTop,setVerticalPosition:(D)=>G.scrollTop=D})}onDragging(G){if(!this.currentDragValue||this.moveBlocked)return;let D=this.getListDragItem(G),z=this.virtualList.getComponentAt(D.rowIndex);if(!z)return;let B=z.getGui().parentElement;if(this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===D.rowIndex&&this.lastHoveredListItem.position===D.position)return;this.autoScrollService.check(G.event),this.clearHoveredItems(),this.lastHoveredListItem=D,WU(B,$Q),WU(B,`ag-item-highlight-${D.position}`)}getListDragItem(G){let D=this.virtualList.getGui(),z=Number.parseFloat(window.getComputedStyle(D).paddingTop),B=this.virtualList.getRowHeight(),Q=this.virtualList.getScrollTop(),J=Math.max(0,(G.y-z+Q)/B),U=this.params.getNumRows(this.comp)-1,Z=Math.min(U,J)|0;return{rowIndex:Z,position:Math.round(J)>J||J>U?"bottom":"top",component:this.virtualList.getComponentAt(Z)}}onDragStop(){if(this.moveBlocked)return;this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties()}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){let G=this.virtualList.getGui();for(let D of G.querySelectorAll(`.${$Q}`))for(let z of[$Q,"ag-item-highlight-top","ag-item-highlight-bottom"])D.classList.remove(z);this.lastHoveredListItem=null}},V6=class extends YY{constructor(G){super(G,"ag-range-field","range")}postConstruct(){super.postConstruct();let{min:G,max:D,step:z}=this.config;if(G!=null)this.setMinValue(G);if(D!=null)this.setMaxValue(D);this.setStep(z||1)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:(G)=>{let D=G.target.value;this.setValue(D)}})}setMinValue(G){return this.min=G,this.eInput.setAttribute("min",G.toString()),this}setMaxValue(G){return this.max=G,this.eInput.setAttribute("max",G.toString()),this}setStep(G){return this.eInput.setAttribute("step",G.toString()),this}setValue(G,D){if(this.min!=null)G=Math.max(parseFloat(G),this.min).toString();if(this.max!=null)G=Math.min(parseFloat(G),this.max).toString();let z=super.setValue(G,D);return this.eInput.value=G,z}},b6={selector:"AG-INPUT-RANGE",component:V6},kG=class extends SY{constructor(G){super(G,`
+ +
+ + +
+
`,[b6,XY]);this.eLabel=LQ,this.eSlider=LQ,this.eText=LQ,this.labelAlignment="top"}postConstruct(){super.postConstruct(),this.eSlider.addCss("ag-slider-field");let{minValue:G,maxValue:D,textFieldWidth:z,step:B,value:Q,onValueChange:J}=this.config;if(G!=null)this.setMinValue(G);if(D!=null)this.setMaxValue(D);if(z!=null)this.setTextFieldWidth(z);if(B!=null)this.setStep(B);if(Q!=null)this.setValue(Q);if(J!=null)this.onValueChange(J)}onValueChange(G){return this.addManagedListeners(this.eText,{fieldValueChanged:()=>{let D=parseFloat(this.eText.getValue());this.eSlider.setValue(D.toString(),!0),G(D||0)}}),this.addManagedListeners(this.eSlider,{fieldValueChanged:()=>{let D=this.eSlider.getValue();this.eText.setValue(D,!0),G(parseFloat(D))}}),this}setSliderWidth(G){return this.eSlider.setWidth(G),this}setTextFieldWidth(G){return this.eText.setWidth(G),this}setMinValue(G){return this.eSlider.setMinValue(G),this.eText.setMin(G),this}setMaxValue(G){return this.eSlider.setMaxValue(G),this.eText.setMax(G),this}getValue(){return this.eText.getValue()}setValue(G,D){if(this.getValue()===G)return this;if(this.eText.setValue(G,!0),this.eSlider.setValue(G,!0),!D)this.dispatchLocalEvent({type:"fieldValueChanged"});return this}setStep(G){return this.eSlider.setStep(G),this.eText.setStep(G),this}},WG={selector:"AG-SLIDER",component:kG},KY=class extends kY{constructor(){super({template:{tag:"div",cls:"ag-color-input",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:"input",ref:"eInput",cls:"ag-input-field-input"},{tag:"div",ref:"eColor",cls:"ag-color-input-color"}]}]}});this.eColor=wY}wireBeans(G){this.color=G.agChartsExports._Util.Color}setColor(G){let D=G.toRgbaString();this.setValue(this.color.fromString(D).toHexString().toUpperCase(),!0),this.eColor.style.backgroundColor=D}setValue(G,D){let z=this.color.validColorString(G??"");if(this.eInput.setCustomValidity(z?"":this.getLocaleTextFunc()("invalidColor","Color value is invalid")),super.setValue(G,D),z&&!D)this.dispatchLocalEvent({type:"colorChanged"});return this}onColorChanged(G){this.addManagedListeners(this,{colorChanged:()=>G(this.color.fromString(this.value))})}},fY={selector:"AG-COLOR-INPUT",component:KY},HU=8,F0=[],NY=class extends qY{constructor(G){super(`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
`,[fY]);this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.spectrumColor=cG,this.spectrumVal=cG,this.spectrumDragger=cG,this.spectrumHue=cG,this.spectrumHueSlider=cG,this.spectrumAlpha=cG,this.spectrumAlphaSlider=cG,this.colorInput=cG,this.recentColors=cG,this.picker=G.picker}wireBeans(G){this._Color=G.agChartsExports._Util.Color}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",(G)=>{if(G.key===xG.ENTER&&!G.defaultPrevented)this.destroy()}),this.addManagedListeners(this.spectrumColor,{keydown:(G)=>this.moveDragger(G)}),this.addManagedListeners(this.spectrumAlphaSlider,{keydown:(G)=>this.moveAlphaSlider(G)}),this.addManagedListeners(this.spectrumHueSlider,{keydown:(G)=>this.moveHueSlider(G)}),this.addManagedListeners(this.spectrumVal,{mousedown:this.onSpectrumDraggerDown.bind(this)}),this.addManagedListeners(this.spectrumHue,{mousedown:this.onSpectrumHueDown.bind(this)}),this.addManagedListeners(this.spectrumAlpha,{mousedown:this.onSpectrumAlphaDown.bind(this)}),this.addGuiEventListener("mousemove",(G)=>{this.onSpectrumDraggerMove(G),this.onSpectrumHueMove(G),this.onSpectrumAlphaMove(G)}),this.addManagedListeners(document,{mouseup:this.onMouseUp.bind(this)}),this.colorInput.onColorChanged(this.setColor.bind(this)),this.addManagedListeners(this.recentColors,{click:this.onRecentColorClick.bind(this),keydown:(G)=>{if(G.key===xG.ENTER||G.key===xG.SPACE)G.preventDefault(),this.onRecentColorClick(G)}})}initTabIndex(){let G=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",G),this.spectrumHueSlider.setAttribute("tabindex",G),this.spectrumAlphaSlider.setAttribute("tabindex",G)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(G){G.preventDefault(),this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(G)}onSpectrumDraggerMove(G){if(this.isSpectrumDragging)this.moveDragger(G)}onSpectrumHueDown(G){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(G)}onSpectrumHueMove(G){if(this.isSpectrumHueDragging)this.moveHueSlider(G)}onSpectrumAlphaDown(G){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(G)}onSpectrumAlphaMove(G){if(this.isSpectrumAlphaDragging)this.moveAlphaSlider(G)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(G){let D=this.spectrumValRect;if(!D)return;let z,B;if(G instanceof MouseEvent)z=G.clientX-D.left,B=G.clientY-D.top;else{let Q=G.key===xG.LEFT,J=G.key===xG.RIGHT,U=G.key===xG.UP,Z=G.key===xG.DOWN,S=U||Z,X=Q||J;if(!S&&!X)return;G.preventDefault();let{x:Y,y:W}=this.getSpectrumValue();z=Y+(X?Q?-5:5:0),B=W+(S?U?-5:5:0)}z=Math.max(z,0),z=Math.min(z,D.width),B=Math.max(B,0),B=Math.min(B,D.height),this.setSpectrumValue(z/D.width,1-B/D.height)}moveHueSlider(G){let D=this.spectrumHueRect;if(!D)return;let z=this.moveSlider(this.spectrumHueSlider,G);if(z==null)return;this.H=1-z/D.width,this.update()}moveAlphaSlider(G){let D=this.spectrumAlphaRect;if(!D)return;let z=this.moveSlider(this.spectrumAlphaSlider,G);if(z==null)return;this.A=z/D.width,this.update()}moveSlider(G,D){let z=G.getBoundingClientRect(),B=G.parentElement?.getBoundingClientRect();if(!G||!B)return null;let Q=z.width/2,J;if(D instanceof MouseEvent)J=Math.floor(D.clientX-B.left);else{let U=D.key===xG.LEFT,Z=D.key===xG.RIGHT;if(!U&&!Z)return null;D.preventDefault();let S=U?-5:5;J=parseFloat(G.style.left)+Q+S}return J=Math.max(J,0),J=Math.min(J,B.width),G.style.left=J-Q+"px",J}update(G){let{A:D,S:z,B,H:Q,_Color:J}=this,U=Q*360,Z=J.fromHSB(U,z,B,D),S=Z.toRgbaString(),Y=J.fromHSB(U,z,B).toRgbaString(),q=J.fromHSB(U,1,1).toRgbaString(),H=this.picker;if(J.fromString(H.getValue()).toRgbaString()!==S)this.colorChanged=!0;if(H.setValue(S),this.spectrumColor.style.backgroundColor=q,this.spectrumDragger.style.backgroundColor=Y,this.spectrumHueSlider.style.backgroundColor=q,this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-from",J.fromHSB(U,z,B,0).toRgbaString()),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-to",Y),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color",S),!G)this.colorInput.setColor(Z)}setSpectrumValue(G,D,z){let B=this.spectrumValRect||this.refreshSpectrumRect();if(B==null)return;let Q=this.spectrumDragger,J=Q.getBoundingClientRect();G=Math.max(0,G),G=Math.min(1,G),D=Math.max(0,D),D=Math.min(1,D),this.S=G,this.B=D,Q.style.left=G*B.width-J.width/2+"px",Q.style.top=(1-D)*B.height-J.height/2+"px",this.update(z)}getSpectrumValue(){let G=this.spectrumDragger,D=G.getBoundingClientRect(),z=parseFloat(G.style.left)+D.width/2,B=parseFloat(G.style.top)+D.height/2;return{x:z,y:B}}initRecentColors(){let G=F0,D=G.map((z,B)=>{return`
`});this.recentColors.innerHTML=D.join(""),_Y(this.recentColors,!!G.length)}setValue(G){let D=this._Color.fromString(G);this.setColor(D,!0)}setColor(G,D){let[z,B,Q]=G.toHSB();this.H=(isNaN(z)?0:z)/360,this.A=G.a;let J=this.spectrumHueRect||this.refreshHueRect(),U=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=`${(this.H-1)*-J.width-this.spectrumHueSlider.getBoundingClientRect().width/2}px`,this.spectrumAlphaSlider.style.left=`${this.A*U.width-this.spectrumAlphaSlider.getBoundingClientRect().width/2}px`,this.setSpectrumValue(B,Q,!D)}onRecentColorClick(G){let D=G.target;if(!HY(D.id))return;let z=parseInt(D.id,10);this.setValue(F0[z]),this.destroy()}addRecentColor(){let D=this._Color.fromHSB(this.H*360,this.S,this.B,this.A).toRgbaString(),z=F0;if(!this.colorChanged||z[0]===D)return;if(z=z.filter((B)=>B!=D),z=[D].concat(z),z.length>HU)z=z.slice(0,HU);F0=z}destroy(){this.addRecentColor(),super.destroy()}},vY=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function OY(G){return G??(G=G||"default"),{tag:"div",cls:`ag-panel ag-${G}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${G}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${G}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${G}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${G}-panel-content-wrapper`}]}}var LJ=class extends kU{constructor(G){super(OY(G.cssIdentifier));this.config=G,this.closable=!0,this.eContentWrapper=E0,this.eTitleBar=E0,this.eTitleBarButtons=E0,this.eTitle=E0,this.registerCSS(vY)}postConstruct(){let{component:G,closable:D,hideTitleBar:z,title:B,minWidth:Q=250,width:J,minHeight:U=250,height:Z,centered:S,popup:X,x:Y,y:W,postProcessPopupParams:q}=this.config,H=this.beans,_=this.createManagedBean(new MY(this.getGui(),{minWidth:Q,width:J,minHeight:U,height:Z,centered:S,x:Y,y:W,popup:X,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=_;let k=this.getGui();if(G)this.setBodyComponent(G);if(!z){if(B)this.setTitle(B);this.setClosable(D!=null?D:this.closable)}else bY(this.eTitleBar,!1);if(this.addManagedElementListeners(this.eTitleBar,{mousedown:(K)=>{if(k.contains(K.relatedTarget)||k.contains(AY(H))||this.eTitleBarButtons.contains(K.target)){K.preventDefault();return}let f=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");if(f)f.focus()}}),X&&_.isPositioned())return;if(this.renderComponent)this.renderComponent();let w;if(q){let{type:K,eventSource:f,mouseEvent:N}=q;w=()=>H.popupSvc?.callPostProcessPopup(q,K,k,f,N)}_.initialisePosition(w),this.eContentWrapper.style.height="0"}renderComponent(){let G=this.getGui();G.focus(),this.close=()=>{G.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(G){this.positionableFeature.setHeight(G)}getWidth(){return this.positionableFeature.getWidth()}setWidth(G){this.positionableFeature.setWidth(G)}setClosable(G){if(G!==this.closable)this.closable=G;if(G){let D=this.closeButtonComp=new kU({tag:"div",cls:"ag-button"});this.createBean(D);let z=D.getGui(),B=this.beans.iconSvc.createIconNoSpan("close",this.beans);B.classList.add("ag-panel-title-bar-button-icon"),z.appendChild(B),this.addTitleBarButton(D),D.addManagedElementListeners(z,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp)this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}setBodyComponent(G){G.setParentComponent(this),this.eContentWrapper.appendChild(G.getGui())}addTitleBarButton(G,D){let z=this.eTitleBarButtons,B=z.children,Q=B.length;if(D==null)D=Q;D=Math.max(0,Math.min(D,Q)),G.addCss("ag-panel-title-bar-button");let J=G.getGui();if(D===0)z.prepend(J);else if(D===Q)z.append(J);else B[D-1].after(J);G.setParentComponent(this)}getBodyHeight(){return RY(this.eContentWrapper)}getBodyWidth(){return CY(this.eContentWrapper)}setTitle(G){this.eTitle.innerText=G}onBtClose(){this.close()}destroy(){if(this.closeButtonComp)this.closeButtonComp=this.destroyBean(this.closeButtonComp);let G=this.getGui();if(G&&VY(G))this.close();super.destroy()}},SJ=class extends LJ{constructor(G,D){super({...G,popup:!0});this.callbacks=D,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(G){this.popupSvc=G.popupSvc}postConstruct(){let G=this.getGui(),{movable:D,resizable:z,maximizable:B,modal:Q}=this.config;if(this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new EY(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(G)},onTabKeyDown:(J)=>{if(Q)return;let U=J.shiftKey,Z=IY(this.beans,G,!1,U);if(!Z||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(Z)){if(this.callbacks?.focusNextContainer(this.beans,U))J.preventDefault()}}}),D)this.setMovable(D);if(B)this.setMaximizable(B);if(z)this.setResizable(z);if(!this.config.modal)this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(G){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(G)}renderComponent(){let G=this.getGui(),{alwaysOnTop:D,modal:z,title:B,afterGuiAttached:Q}=this.config,J=this.getLocaleTextFunc(),U=this.popupSvc?.addPopup({modal:z,eChild:G,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:D,ariaLabel:B||J("ariaLabelDialog","Dialog"),afterGuiAttached:Q});if(U)this.close=U.hideFunc}onClosed(G){this.destroy(),this.config.closedCallback?.(G)}setMaximized(G){if(this.isMaximizable&&G!==this.isMaximized)this.toggleMaximize()}toggleMaximize(){let G=this.positionableFeature.getPosition();if(this.isMaximized){let{x:D,y:z,width:B,height:Q}=this.lastPosition;this.setWidth(B),this.setHeight(Q),this.positionableFeature.offsetElement(D,z)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=G.x,this.lastPosition.y=G.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){_U(this.maximizeIcon,!this.isMaximized),_U(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(let G of this.maximizeListeners)G();this.maximizeListeners.length=0}if(this.resizeListenerDestroy)this.resizeListenerDestroy(),this.resizeListenerDestroy=null}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(G){this.positionableFeature.setResizable(G)}setMovable(G){this.positionableFeature.setMovable(G,this.eTitleBar)}setMaximizable(G){if(!G){if(this.clearMaximizebleListeners(),this.maximizeButtonComp)this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0;return}let D=this.eTitleBar;if(!D||G===this.isMaximizable)return;this.isMaximizable=G;let z=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),z.addManagedElementListeners(z.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(z,0),this.maximizeListeners.push(...this.addManagedElementListeners(D,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){let G=this.maximizeButtonComp=this.createBean(new FY({tag:"div",cls:"ag-dialog-button"})),D=G.getGui(),z=this.beans.iconSvc;return this.maximizeIcon=z.createIconNoSpan("maximize"),D.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=z.createIconNoSpan("minimize"),D.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),G}},XJ=class extends WY{constructor(G){super({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"chartsColorPicker",...G})}postConstruct(){if(this.eDisplayFieldColor=qU({tag:"span",cls:"ag-color-picker-color"}),this.eDisplayFieldText=qU({tag:"span",cls:"ag-color-picker-value"}),this.eDisplayField.append(this.eDisplayFieldColor,this.eDisplayFieldText),super.postConstruct(),this.value)this.setValue(this.value)}createPickerComponent(){let G=this.eWrapper.getBoundingClientRect(),D=this.beans.popupSvc.getParentRect();return this.createBean(new SJ({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:G.right-D.left-190,y:G.top-D.top-250-(this.config.pickerGap??0),postProcessPopupParams:{type:"colorPicker",eventSource:this.eWrapper}},this.config.dialogCallbacks))}renderAndPositionPicker(){let G=this.pickerComponent,D=this.createBean(new NY({picker:this}));return G.addCss("ag-color-dialog"),D.addDestroyFunc(()=>{if(G.isAlive())this.destroyBean(G)}),G.setParentComponent(this),G.setBodyComponent(D),D.setValue(this.getValue()),D.getGui().focus(),G.addDestroyFunc(()=>{if(!this.isDestroyingPicker){if(this.beforeHidePicker(),this.isDestroyingPicker=!0,D.isAlive())this.destroyBean(D);if(this.isAlive())this.getFocusableElement().focus()}else this.isDestroyingPicker=!1}),()=>this.pickerComponent?.close()}setValue(G){if(this.value===G)return this;return this.eDisplayFieldColor.style.backgroundColor=G,this.eDisplayFieldText.textContent=this.beans.agChartsExports._Util.Color.fromString(G).toHexString().toUpperCase(),super.setValue(G)}getValue(){return this.value}},uY={selector:"AG-COLOR-PICKER",component:XJ},lY=class extends dY{constructor(G){super();this.setTemplateFromElement(G.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(G)=>this.onTabKeyDown(G),handleKeyDown:(G)=>this.handleKeyDown(G)})}handleKeyDown(G){if(G.key===nY.ESCAPE)this.closePanel()}onTabKeyDown(G){if(G.defaultPrevented)return;this.closePanel(),G.preventDefault()}closePanel(){let G=this.parentComponent;G.closeSubMenu(),setTimeout(()=>G.getGui().focus(),0)}},NB=class extends TY{constructor(G){super();this.callbacks=G,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(G){let{menuItemDef:D,isAnotherSubMenuOpen:z,level:B,childComponent:Q,contextParams:J}=G;return this.params=G.menuItemDef,this.level=B,this.isAnotherSubMenuOpen=z,this.childComponent=Q,this.contextParams=J,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...D,level:B,isAnotherSubMenuOpen:z,openSubMenu:(U)=>this.openSubMenu(U),closeSubMenu:()=>this.closeSubMenu(),closeMenu:(U)=>this.closeMenu(U),updateTooltip:(U,Z)=>this.refreshTooltip(U,Z),onItemActivated:()=>this.onItemActivated()}).then((U)=>{if(!U)return;this.menuItemComp=U;let Z=U.configureDefaults?.();if(Z)this.configureDefaults(Z===!0?void 0:Z)})}addListeners(G,D){if(!D?.suppressClick)this.addManagedElementListeners(G,{click:(z)=>this.onItemSelected(z)});if(!D?.suppressKeyboardSelect)this.addManagedElementListeners(G,{keydown:(z)=>{if(z.key===wU.ENTER||z.key===wU.SPACE)z.preventDefault(),this.onItemSelected(z)}});if(!D?.suppressMouseDown)this.addManagedElementListeners(G,{mousedown:(z)=>{z.stopPropagation(),z.preventDefault()}});if(!D?.suppressMouseOver)this.addManagedElementListeners(G,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(G=!1,D){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;let z=yY({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=z;let B,Q=()=>{this.subMenuIsOpening=!1};if(this.childComponent){let X=this.createBean(new lY(this.childComponent));X.setParentComponent(this);let Y=X.getGui(),W="mouseenter",q=()=>this.cancelDeactivate();if(Y.addEventListener(W,q),B=()=>{Y.removeEventListener(W,q),this.destroyBean(X)},z.appendChild(Y),this.childComponent.afterGuiAttached)Q=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1}}else if(this.params.subMenu){let X=this.createBean(new uB(this.level+1,this.contextParams,this.callbacks));if(X.setParentComponent(this),X.addMenuItems(this.params.subMenu),z.appendChild(X.getGui()),this.addManagedListeners(X,{closeMenu:(Y)=>this.dispatchLocalEvent(Y)}),X.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),B=()=>this.destroyBean(X),G)Q=()=>{X.activateFirstItem(),this.subMenuIsOpening=!1}}let J=this.beans.popupSvc,U=()=>{let X=this.eGui;J?.positionPopupForMenu({eventSource:X,ePopup:z,event:D instanceof MouseEvent?D:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},Z=this.getLocaleTextFunc(),S=J?.addPopup({modal:!0,eChild:z,positionCallback:U,anchorToElement:this.eGui,ariaLabel:Z("ariaLabelSubMenu","SubMenu"),afterGuiAttached:Q});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{if(S)S.hideFunc();this.subMenuIsOpen=!1,this.setAriaExpanded(!1),B(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(G){if(!this.suppressAria)cY(this.eGui,G)}closeSubMenu(){if(!this.hideSubMenu)return;this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1)}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(G,D){if(this.cancelActivate(),this.params.disabled&&!D)return;if(this.isActive=!0,!this.suppressRootStyles)this.eGui.classList.add(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!0),!this.suppressFocus)this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!D}));if(G&&this.params.subMenu)window.setTimeout(()=>{if(this.isAlive()&&this.isActive)this.openSubMenu()},300);this.onItemActivated()}deactivate(){if(this.cancelDeactivate(),!this.suppressRootStyles)this.eGui.classList.remove(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen)this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(G){this.parentComponent=G}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(G){if(this.menuItemComp.select?.(),this.params.action)this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams})));else this.openSubMenu(G&&G.type==="keydown",G);if(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)return;this.closeMenu(G)}closeMenu(G){let D={type:"closeMenu"};if(G)if(G instanceof MouseEvent)D.mouseEvent=G;else D.keyboardEvent=G;this.dispatchLocalEvent(D)}onItemActivated(){let G={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(G)}cancelActivate(){if(this.activateTimeoutId)window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0}cancelDeactivate(){if(this.deactivateTimeoutId)window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0}onMouseEnter(){if(this.cancelDeactivate(),this.isAnotherSubMenuOpen())this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY);else this.activate(!0)}onMouseLeave(){if(this.cancelActivate(),this.isSubMenuOpen())this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY);else this.deactivate()}refreshRootElementGui(G){let D=this.menuItemComp.getGui(),{cssClassPrefix:z,params:{cssClasses:B,disabled:Q}}=this,J=this.menuItemComp.getRootElement?.();if(J){if(!G)D.classList.add("ag-menu-option-custom");D=J}if(this.suppressRootStyles=!!G,!this.suppressRootStyles){D.classList.add(z);for(let U of B??[])D.classList.add(U);if(Q)D.classList.add(`${z}-disabled`)}return D}applyAriaProperties(G){let{params:{checked:D,subMenu:z,subMenuRole:B,disabled:Q}}=this,J=D!=null;if(iY(G,J?"menuitemcheckbox":"menuitem"),z)hY(G,B??"menu");if(Q)xY(G,!0)}configureDefaults(G){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(G));return}let{suppressRootStyles:D,suppressTooltip:z,suppressAria:B,suppressTabIndex:Q,suppressFocus:J}=G||{},{params:{tooltip:U,disabled:Z}}=this,S=this.eGui=this.refreshRootElementGui(!!D);if(this.suppressAria=!!B,!B)this.applyAriaProperties(S);if(!Q)S.setAttribute("tabindex","-1");if(!z)this.refreshTooltip(U);if(!Z)this.addListeners(S,G);this.suppressFocus=!!J}refreshTooltip(G,D){if(this.tooltip=G,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!G||!this.menuItemComp)return;let z=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:D});if(z)this.tooltipFeature=this.createBean(z)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},uB=class extends jY{constructor(G=0,D,z){super({tag:"div",cls:"ag-menu-list",role:"menu"});this.level=G,this.menuActionParams=D,this.callbacks=z,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(G)=>this.onTabKeyDown(G),handleKeyDown:(G)=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(G)),onFocusIn:(G)=>this.handleFocusIn(G),onFocusOut:(G)=>this.handleFocusOut(G)})}onTabKeyDown(G){if(!this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed"))G.preventDefault();if(G.shiftKey)this.closeIfIsChild(G)}handleKeyDown(G){switch(G.key){case AG.UP:case AG.RIGHT:case AG.DOWN:case AG.LEFT:G.preventDefault(),this.handleNavKey(G.key);break;case AG.ESCAPE:if(this.closeIfIsChild())this.callbacks.stopPropagationCallbacks.stopPropagation(G);break}}handleFocusIn(G){let D=G.relatedTarget;if(!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(D)&&(this.getGui().contains(D)||this.activeMenuItem?.getSubMenuGui()?.contains(D)))return;if(this.activeMenuItem)this.activeMenuItem.activate();else this.activateFirstItem()}handleFocusOut(G){let D=G.relatedTarget;if(!this.activeMenuItem||this.getGui().contains(D)||this.activeMenuItem.getSubMenuGui()?.contains(D))return;if(!this.activeMenuItem.isSubMenuOpening())this.activeMenuItem.deactivate()}clearActiveItem(){if(this.activeMenuItem)this.activeMenuItem.deactivate(),this.activeMenuItem=null}addMenuItems(G){if(G==null)return;SQ.all(G.map((D)=>{if(D==="separator")return SQ.resolve({eGui:this.createSeparator()});else if(typeof D==="string")return this.callbacks.warnNoItem?.(D),SQ.resolve({eGui:null});else return this.addItem(D)})).then((D)=>{for(let z of D??[])if(z?.eGui){if(this.appendChild(z.eGui),z.comp)this.menuItems.push(z.comp)}})}addItem(G){let D=this.createManagedBean(new NB(this.callbacks));return D.init({menuItemDef:G,isAnotherSubMenuOpen:()=>this.menuItems.some((z)=>z.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>{return D.setParentComponent(this),this.addManagedListeners(D,{closeMenu:(z)=>{this.dispatchLocalEvent(z)},menuItemActivated:(z)=>{if(this.activeMenuItem&&this.activeMenuItem!==z.menuItem)this.activeMenuItem.deactivate();this.activeMenuItem=z.menuItem}}),{comp:D,eGui:D.getGui()}})}activateFirstItem(){let G=this.menuItems.filter((D)=>!D.isDisabled())[0];if(!G)return;G.activate()}createSeparator(){let G={tag:"div",cls:"ag-menu-separator-part"};return PY({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[G,G,G,G]})}handleNavKey(G){switch(G){case AG.UP:case AG.DOWN:{let z=this.findNextItem(G===AG.UP);if(z&&z!==this.activeMenuItem)z.activate(!1,!0);return}}let D=this.gos.get("enableRtl")?AG.RIGHT:AG.LEFT;if(G===D)this.closeIfIsChild();else this.openChild()}closeIfIsChild(G){let D=this.getParentComponent();if(D&&D instanceof NB){if(G)G.preventDefault();return D.closeSubMenu(),D.getGui().focus(),!0}return!1}openChild(){if(this.activeMenuItem)this.activeMenuItem.openSubMenu(!0)}findNextItem(G){let D=[...this.menuItems];if(!D.length)return;if(!this.activeMenuItem)return G?gY(D):D[0];if(G)D.reverse();let z,B=!1;for(let Q of D){if(!B){if(Q===this.activeMenuItem)B=!0;continue}z=Q;break}if(B&&!z)return D[0];return z||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},G4="ag-menu",D4="ag-context-menu-loading-icon",v6=class extends pY{constructor(G){super();this.params=G,this.destroyLoadingSpinner=null,this.lastPromise=0}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenu(G,D,z){let{getMenuItems:B,shouldBlockMenuOpen:Q}=this.params,J=B(G,D);if(aY(J)){let U=this.lastPromise+1;if(this.lastPromise=U,!this.destroyLoadingSpinner)this.createLoadingIcon(D);return J.then((Z)=>{if(this.lastPromise!==U)return;let{target:S}=D,X=!S;if(Z?.length&&(X||eY(S))&&!Q?.())this.createContextMenu({menuItems:Z,menuActionParams:G,mouseEvent:D,anchorToElement:z});this.destroyLoadingSpinner?.()}),!0}if(!J?.length)return!1;return this.createContextMenu({menuItems:J,menuActionParams:G,mouseEvent:D,anchorToElement:z}),!0}createLoadingIcon(G){let{beans:D}=this,z=this.getLocaleTextFunc(),B=D.iconSvc.createIconNoSpan("loadingMenuItems"),Q=tY({tag:"div",cls:D4});Q.appendChild(B);let J=rY(D),U=oY(D);if(!U)return;U.appendChild(Q),D.ariaAnnounce?.announceValue(z("ariaLabelLoadingContextMenu","Loading Context Menu"),"contextmenu"),D.environment.applyThemeClasses(Q),KU(Q,G,D);let Z=(S)=>{KU(Q,S,D)};J.addEventListener("mousemove",Z),this.destroyLoadingSpinner=()=>{J.removeEventListener("mousemove",Z),Q.remove(),this.destroyLoadingSpinner=null}}createContextMenu(G){let{mapMenuItems:D,menuItemCallbacks:z,beforeMenuOpen:B,onMenuClose:Q,afterMenuDestroyed:J,onVisibleChanged:U,onMenuOpen:Z}=this.params,{menuItems:S,menuActionParams:X,mouseEvent:Y,anchorToElement:W}=G,q=this.beans.popupSvc,_=new z4(D?(F)=>D(S,X,F):()=>S,X,z);this.createBean(_);let k=_.getGui();B?.(X);let w={additionalParams:z.getPostProcessPopupParams(X),type:"contextMenu",mouseEvent:Y,ePopup:k,nudgeY:1},K=this.getLocaleTextFunc(),f=q?.addPopup({modal:!0,eChild:k,closeOnEsc:!0,closedCallback:(F)=>{z.preserveRangesWhile(this.beans,()=>{Q?.(),this.destroyBean(_),J?.(),U?.(!1,F===void 0?"api":"ui")})},click:Y,positionCallback:()=>{let F=this.gos.get("enableRtl");q?.positionPopupUnderMouseEvent({...w,nudgeX:F?(k.offsetWidth+1)*-1:1})},anchorToElement:W,ariaLabel:K("ariaLabelContextMenu","Context Menu")});if(f)Z?.(),_.afterGuiAttached({container:"contextMenu",hidePopup:f.hideFunc});if(this.activeMenu)this.hideActiveMenu();if(this.activeMenu=_,_.addEventListener("destroyed",()=>{if(this.activeMenu===_)this.activeMenu=null}),f)_.addEventListener("closeMenu",(F)=>f.hideFunc({mouseEvent:F.mouseEvent??void 0,keyboardEvent:F.keyboardEvent??void 0,forceHide:!0}));let N=Y&&Y instanceof MouseEvent&&Y.type==="mousedown";U?.(!0,N?"api":"ui")}destroy(){this.destroyLoadingSpinner?.(),super.destroy()}},z4=class extends mY{constructor(G,D,z){super({tag:"div",cls:G4,role:"presentation"});this.getMenuItems=G,this.menuActionParams=D,this.callbacks=z,this.menuList=null}postConstruct(){let G=this.createManagedBean(new uB(0,this.menuActionParams,this.callbacks)),D=this.getMenuItems(()=>this.getGui());G.addMenuItems(D),this.appendChild(G),this.menuList=G,G.addEventListener("closeMenu",(z)=>this.dispatchLocalEvent(z))}afterGuiAttached({hidePopup:G}){if(G)this.addDestroyFunc(G);let D=this.menuList;if(D)this.callbacks.preserveRangesWhile(this.beans,()=>sY(D.getGui()))}},O6=class extends B4{constructor(G){super({tag:"div"});this.callbacks=G}init(G){this.params=G,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){let{checked:G,subMenu:D}=this.params,z=this.getGui();if(G)J4(z,G);if(D)U4(z,!1)}addIcon(){if(this.params.isCompact)return;let G=I0({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:D,icon:z}=this.params;if(D)G.appendChild(this.beans.iconSvc.createIconNoSpan("check"));else if(z)if(Q4(z))G.appendChild(z);else if(typeof z==="string")G.innerHTML=z;else this.callbacks?.warnNoIcon?.();this.getGui().appendChild(G)}addName(){let G=I0({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(G)}addShortcut(){if(this.params.isCompact)return;let G=I0({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(G)}addSubMenu(){let G=I0({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),D=this.getGui();if(this.params.subMenu){let z=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";G.appendChild(this.beans.iconSvc.createIconNoSpan(z))}D.appendChild(G)}getClassName(G){return`${this.cssClassPrefix}-${G}`}};function c1(G,D){if(!D)return null;let z=H4(G),B=z.indexOf(D);if(B===-1)return null;let Q=-1;for(let J=B-1;J>=0;J--)if(z[J].classList.contains(W4.TAB_GUARD_TOP)){Q=J;break}if(Q<=0)return null;return z[Q-1]}function u6(G,D){if(!D)return!1;let z=G.querySelectorAll(`.${q4}`);if(!z.length)return!1;for(let B=0;Bthis.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){let{enableCloseButton:G,cssClass:D}=this.params,z=(B,Q)=>{if(B.classList.add(`ag-tabs-${Q}`),D)B.classList.add(`${D}-${Q}`)};if(G)this.setupCloseButton(z),this.eTabHeader=M0({tag:"div",role:"presentation"}),z(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader);else this.eTabHeader=this.eHeader;Y4(this.eTabHeader,"tablist"),z(this.eTabHeader,"header")}setupCloseButton(G){let D=M0({tag:"button"});G(D,"close-button");let z=this.beans.iconSvc.createIconNoSpan("close");EU(D,this.params.closeButtonAriaLabel),D.appendChild(z),this.addManagedElementListeners(D,{click:()=>this.params.onCloseClicked?.()});let B=M0({tag:"div",role:"presentation"});G(B,"close-button-wrapper"),B.appendChild(D),this.eHeader.appendChild(B),this.eCloseButton=D}handleKeyDown(G){switch(G.key){case wz.RIGHT:case wz.LEFT:{if(!this.eTabHeader.contains(FU(this.beans)))return;let D=G.key===wz.RIGHT,z=this.gos.get("enableRtl"),B=this.items.indexOf(this.activeItem),Q=D!==z?Math.min(B+1,this.items.length-1):Math.max(B-1,0);if(B===Q)return;G.preventDefault();let J=this.items[Q];this.showItemWrapper(J),J.eHeaderButton.focus();break}case wz.UP:case wz.DOWN:G.stopPropagation();break}}onTabKeyDown(G){if(G.defaultPrevented)return;let{beans:D,eHeader:z,eBody:B,activeItem:Q,params:J}=this,{suppressTrapFocus:U,enableCloseButton:Z}=J,S=FU(D),X=G.target,Y=G.shiftKey;if(z.contains(S)){if(G.preventDefault(),Z&&Y&&!this.eCloseButton?.contains(S))this.eCloseButton?.focus();else if(U&&Y)c1(S4(D).body,X)?.focus();else this.focusBody(G.shiftKey);return}let W=null;if(u6(B,X)){if(Y)W=c1(B,X);if(!W&&!U)W=Q.eHeaderButton}if(!W&&B.contains(S)){if(W=L4(D,B,!1,Y),!W){if(U&&!Y)this.forceFocusOutOfContainer(Y);else if(Z&&!Y)G.preventDefault(),this.eCloseButton?.focus();else G.preventDefault(),this.focusHeader();return}}if(W)G.preventDefault(),W.focus()}focusInnerElement(G){if(G)return this.focusBody(!0);else return this.focusHeader(),!0}focusHeader(G){this.activeItem.eHeaderButton.focus({preventScroll:G})}focusBody(G){return NU(this.eBody,G)}setAfterAttachedParams(G){this.afterAttachedParams=G}showFirstItem(){if(this.items.length>0)this.showItemWrapper(this.items[0])}addItem(G){let D=M0({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});D.appendChild(G.title),this.eTabHeader.appendChild(D),EU(D,G.titleLabel);let z={tabbedItem:G,eHeaderButton:D};this.items.push(z),D.addEventListener("click",this.showItemWrapper.bind(this,z))}showItem(G){let D=this.items.find((z)=>z.tabbedItem===G);if(D)this.showItemWrapper(D)}showItemWrapper(G){let{tabbedItem:D,eHeaderButton:z}=G;if(this.params.onItemClicked?.({item:D}),this.activeItem===G){this.params.onActiveItemClicked?.();return}if(this.lastScrollListener)this.lastScrollListener=this.lastScrollListener();if($4(this.eBody),D.bodyPromise.then((B)=>{this.eBody.appendChild(B);let Q=!X4();if(!this.params.suppressFocusBodyOnOpen)NU(this.eBody,!1,Q);if(D.afterAttachedCallback)D.afterAttachedCallback(this.afterAttachedParams);if(this.params.keepScrollPosition){let J=D.getScrollableContainer?.()||B;[this.lastScrollListener]=this.addManagedElementListeners(J,{scroll:()=>{this.tabbedItemScrollMap.set(D.name,J.scrollTop)}});let U=this.tabbedItemScrollMap.get(D.name);if(U!==void 0)setTimeout(()=>{J.scrollTop=U},0)}}),this.activeItem)this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.();z.classList.add("ag-tab-selected"),this.activeItem=G}},N4=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function F4(G){let D=G.cssIdentifier||"default",z=G.direction||"vertical";return{tag:"div",cls:`ag-group ag-${D}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${D}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${z} ag-${D}-group-container`}]}}var jG=class extends j6{constructor(G={}){super(F4(G),[k4]);this.params=G,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=Gz,this.cbGroupEnabled=Gz,this.eContainer=Gz,this.registerCSS(N4);let{enabled:D,items:z,suppressEnabledCheckbox:B,expanded:Q,suppressToggleExpandOnEnableChange:J,useToggle:U}=G;if(this.cssIdentifier=G.cssIdentifier||"default",this.enabled=D!=null?D:!0,this.items=z||[],this.useToggle=U??!1,this.alignItems=G.alignItems||"center",this.expanded=Q==null?!0:Q,B!=null)this.suppressEnabledCheckbox=B;if(J!=null)this.suppressToggleExpandOnEnableChange=J}postConstruct(){if(this.setupTitleBar(),this.items.length){let Q=this.items;this.items=[],this.addItems(Q)}let G=this.getLocaleTextFunc();if(this.cbGroupEnabled.setLabel(G("enabled","Enabled")),this.enabled)this.setEnabled(this.enabled,void 0,!0);this.setAlignItems(this.alignItems);let{onEnableChange:D,onExpandedChange:z,suppressOpenCloseIcons:B}=this.params;if(this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(B??!1),this.refreshChildDisplay(),AD(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange((Q)=>{this.setEnabled(Q,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(Q)}),D!=null)this.onEnableChange(D);if(z!=null)this.onExpandedChange(z)}refreshChildDisplay(){AD(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(G){if(this.alignItems!==G)this.removeCss(`ag-group-item-alignment-${this.alignItems}`);this.alignItems=G;let D=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(D),this}toggleGroupExpand(G,D){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)G=!0,D=!0;else if(G=G!=null?G:!this.expanded,this.expanded===G)return this;if(this.expanded=G,this.refreshChildDisplay(),AD(this.eContainer,G),!D)this.dispatchLocalEvent({type:G?"expanded":"collapsed"});return this}addItems(G){for(let D of G)this.addItem(D)}prependItem(G){this.insertItem(G,!0)}addItem(G){this.insertItem(G,!1)}updateItems(G){let D=this.items,z=0;for(let B=0;BG(D.enabled)}),this}onExpandedChange(G){return this.addManagedListeners(this,{expanded:()=>G(!0),collapsed:()=>G(!1)}),this}hideEnabledCheckbox(G){return this.suppressEnabledCheckbox=G,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(G){return this.eTitleBar?.hideOpenCloseIcons(G),this}refreshDisabledStyles(){let G=!this.enabled;this.eContainer.classList.toggle("ag-disabled",G),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&G),this.eContainer.classList.toggle("ag-disabled-group-container",G)}setupTitleBar(){let G=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",G.getGui())}createDefaultTitleBar(){let G=this.createManagedBean(new I4(this.params));return this.eTitleBar=G,G.refreshOnExpand(this.expanded),this.addManagedListeners(G,{expandedChanged:(D)=>this.toggleGroupExpand(D.expanded)}),G}createToggleTitleBar(){let G=this.createManagedBean(new w4({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:(D)=>{this.setEnabled(D,!0),this.dispatchEnableChangeEvent(D)}}));return G.addCss("ag-group-title-bar"),G.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=G,this.toggleGroupExpand(this.enabled),G}},WQ="ag-disabled-group-title-bar";function E4(G){let D=G.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${D}-group-title-bar ag-unselectable`,role:G.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${D}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${D}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${D}-group-title`}]}}var I4=class extends j6{constructor(G={}){super(E4(G));this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=Gz,this.eGroupClosedIcon=Gz,this.eTitle=Gz;let{title:D,suppressOpenCloseIcons:z,suppressKeyboardNavigation:B}=G;if(!!D&&D.length>0)this.title=D;if(z!=null)this.suppressOpenCloseIcons=z;this.suppressKeyboardNavigation=B??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){let G=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(G.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(G.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:(D)=>{switch(D.key){case Kz.ENTER:case Kz.SPACE:D.preventDefault(),this.dispatchExpandChanged();break;case Kz.RIGHT:case Kz.LEFT:D.preventDefault(),this.dispatchExpandChanged(D.key===Kz.RIGHT);break}}})}refreshOnExpand(G){this.refreshAriaStatus(G),this.refreshOpenCloseIcons(G)}refreshAriaStatus(G){if(!this.suppressOpenCloseIcons)f4(this.getGui(),G)}refreshOpenCloseIcons(G){let D=!this.suppressOpenCloseIcons;AD(this.eGroupOpenedIcon,D&&G),AD(this.eGroupClosedIcon,D&&!G)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(G){let D={type:"expandedChanged",expanded:G};this.dispatchLocalEvent(D)}setTitle(G){let D=this.getGui(),z=!!G&&G.length>0;if(G=z?G:void 0,this.eTitle.textContent=G??"",AD(D,z),G!==this.title)this.title=G;let B=D.classList.contains(WQ);return this.refreshDisabledStyles(B),this}addWidget(G){return this.getGui().appendChild(G),this}hideOpenCloseIcons(G){if(this.suppressOpenCloseIcons=G,G)this.dispatchExpandChanged(!0);return this}refreshDisabledStyles(G){let D=this.getGui();if(G)D.classList.add(WQ),D.removeAttribute("tabindex"),YQ(D,"presentation");else if(D.classList.remove(WQ),typeof this.title==="string"&&!this.suppressKeyboardNavigation)this.activateTabIndex([D]),YQ(D,"group");else D.removeAttribute("tabindex"),YQ(D,"presentation")}},p={selector:"AG-GROUP-COMPONENT",component:jG},j="35.2.0",i={moduleName:"EnterpriseCore",version:j,beans:[j1],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:j1.setLicenseKey},b4=".ag-advanced-filter-header{align-items:center;background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);display:flex;position:relative}.ag-advanced-filter{align-items:center;display:flex;width:100%}.ag-advanced-filter-buttons{display:contents}.ag-advanced-filter-header-cell{height:100%;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding)}.ag-advanced-filter-apply-button,.ag-advanced-filter-builder-button{align-items:center;background-color:unset;border:0;display:flex;font-size:var(--ag-font-size);font-weight:600;line-height:normal;padding:var(--ag-spacing);white-space:nowrap;&:where(.ag-standard-button):where(:not(:disabled)){cursor:pointer;&:where(.ag-standard-button):hover{background-color:var(--ag-row-hover-color)}}}:where(.ag-ltr) .ag-advanced-filter-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-button{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-advanced-filter-builder-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-advanced-filter-builder-button-label{margin-right:var(--ag-spacing)}.ag-advanced-filter-builder{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-advanced-filter-builder-list{flex:1;overflow:auto}.ag-advanced-filter-builder-button-panel{border-top:var(--ag-advanced-filter-builder-button-bar-border);display:flex;justify-content:flex-end;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-advanced-filter-builder-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-cancel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-builder-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-cancel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-advanced-filter-builder-item-wrapper{align-items:center;display:flex;flex:1 1 auto;justify-content:space-between;overflow:hidden}:where(.ag-ltr) .ag-advanced-filter-builder-item-wrapper{padding-left:calc(var(--ag-icon-size)/2);padding-right:var(--ag-icon-size)}:where(.ag-rtl) .ag-advanced-filter-builder-item-wrapper{padding-left:var(--ag-icon-size);padding-right:calc(var(--ag-icon-size)/2)}:where(.ag-virtual-list-viewport) .ag-advanced-filter-builder-item-wrapper .ag-tab-guard{position:absolute}.ag-advanced-filter-builder-item-tree-line{width:var(--ag-advanced-filter-builder-indent-size)}.ag-advanced-filter-builder-item-tree-line-root{width:var(--ag-icon-size)}.ag-advanced-filter-builder-item-tree-line-root:before{height:50%;top:50%}.ag-advanced-filter-builder-item-tree-line-horizontal,.ag-advanced-filter-builder-item-tree-line-vertical,.ag-advanced-filter-builder-item-tree-line-vertical-bottom,.ag-advanced-filter-builder-item-tree-line-vertical-top{align-items:center;display:flex;height:100%;position:relative}.ag-advanced-filter-builder-item-tree-line-horizontal:after,.ag-advanced-filter-builder-item-tree-line-horizontal:before,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:after,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before,.ag-advanced-filter-builder-item-tree-line-vertical-top:after,.ag-advanced-filter-builder-item-tree-line-vertical-top:before,.ag-advanced-filter-builder-item-tree-line-vertical:after,.ag-advanced-filter-builder-item-tree-line-vertical:before{content:\"\";height:100%;position:absolute}.ag-advanced-filter-builder-item-tree-line-horizontal:after{border-bottom:var(--ag-border-width) solid var(--ag-border-color);height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size))}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-horizontal:after{left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-horizontal:after{right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical:before{top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-top:before{height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{height:calc(50% - var(--ag-icon-size)*1.5/2);top:calc(50% + var(--ag-icon-size)*1.5/2);width:calc(var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-condition{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing)}.ag-advanced-filter-builder-item,.ag-advanced-filter-builder-item-buttons,.ag-advanced-filter-builder-item-condition,.ag-advanced-filter-builder-item-tree-lines,.ag-advanced-filter-builder-pill,.ag-advanced-filter-builder-pill-wrapper{align-items:center;display:flex;height:100%}.ag-advanced-filter-builder-pill-wrapper{margin:0 var(--ag-spacing)}.ag-advanced-filter-builder-pill{border-radius:var(--ag-border-radius);min-height:calc(100% - var(--ag-spacing)*3);min-width:calc(var(--ag-spacing)*2);padding:var(--ag-spacing) calc(var(--ag-spacing)*2);position:relative}:where(.ag-advanced-filter-builder-pill){.ag-advanced-filter-builder-value-number{font-family:monospace;font-weight:700}.ag-advanced-filter-builder-value-empty{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-left:var(--ag-spacing)}}.ag-advanced-filter-builder-pill-display{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-advanced-filter-builder-join-pill{background-color:var(--ag-advanced-filter-builder-join-pill-color);cursor:pointer}.ag-advanced-filter-builder-column-pill{background-color:var(--ag-advanced-filter-builder-column-pill-color);cursor:pointer}.ag-advanced-filter-builder-option-pill{background-color:var(--ag-advanced-filter-builder-option-pill-color);cursor:pointer}.ag-advanced-filter-builder-value-pill{background-color:var(--ag-advanced-filter-builder-value-pill-color);cursor:text;max-width:140px;:where(.ag-advanced-filter-builder-pill-display){display:block}}.ag-advanced-filter-builder-item-buttons{display:flex;gap:var(--ag-spacing);padding:0 calc(var(--ag-spacing)*.5)}.ag-advanced-filter-builder-item-button{color:var(--ag-subtle-text-color);cursor:pointer;position:relative}.ag-advanced-filter-builder-item-button,.ag-advanced-filter-builder-pill{&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-advanced-filter-builder-item-button-disabled{cursor:default;opacity:.5}.ag-advanced-filter-builder-virtual-list-container{top:var(--ag-spacing)}.ag-advanced-filter-builder-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height)}.ag-advanced-filter-builder-virtual-list-item:hover{background-color:var(--ag-row-hover-color);:where(.ag-advanced-filter-builder-item-button){opacity:1}}.ag-advanced-filter-builder-invalid{color:var(--ag-subtle-text-color);cursor:default;margin:0 var(--ag-spacing)}:where(.ag-advanced-filter-builder-validation) .ag-advanced-filter-builder-invalid{color:var(--ag-invalid-color)}:where(.ag-advanced-filter-builder-virtual-list-item-highlight) .ag-advanced-filter-builder-item-button:focus-visible{opacity:1}";function v4(G){return G.filterManager?.getAdvFilterModel()??null}function O4(G,D){G.filterManager?.setAdvFilterModel(D)}function u4(G){G.filterManager?.toggleAdvFilterBuilder(!0,"api")}function j4(G){G.filterManager?.toggleAdvFilterBuilder(!1,"api")}var T4={ariaAdvancedFilterBuilderItem:(G)=>`${G[0]}. Level ${G[1]}. Press ENTER to edit`,ariaAdvancedFilterBuilderItemValidation:(G)=>`${G[0]}. Level ${G[1]}. ${G[2]} Press ENTER to edit`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterReset:"Reset",advancedFilterCancel:"Cancel",advancedFilterClear:"Clear",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationNotABigInt:"Value is not a big integer",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:(G)=>`Expression has an error. ${G[0]} - ${G[1]}.`,advancedFilterValidationMessageAtEnd:(G)=>`Expression has an error. ${G[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderClear:"Clear",advancedFilterBuilderReset:"Reset",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};function h1(G,D,z){if(!G)return"";let B=z-D;return B?G.slice(0,G.length-B):G}function XD(G,D,z,B,Q,J,U){let Z=z+(!G.length||U?0:1),S=0;if(Q){if(G[Z]===" ")S=1;else if(B+=" ",J)B+='"'}return{updatedValue:G.slice(0,D)+B+G.slice(Z),updatedPosition:D+B.length+S}}function y4(G,D,z){let B=D;while(B{if(this.quotes||isNaN(this.modelValue))this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationNotANumber")},bigint:()=>{if(this.quotes||P6(this.modelValue)===null)this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationNotABigInt")},date:(Q)=>{if(Q==null)this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidDate")},dateString:(...Q)=>this.filterValidationSetters.date(...Q),dateTime:(...Q)=>this.filterValidationSetters.date(...Q),dateTimeString:(...Q)=>this.filterValidationSetters.date(...Q),boolean(){},object(){},text(){}}}parse(G,D){if(G===" ")if(this.quotes)this.operand+=G;else return this.parseOperand(!1,D),!0;else if(G===")")if(this.baseCellDataType==="number"||!this.quotes)return this.parseOperand(!1,D-1),!0;else this.operand+=G;else if(!this.operand&&!this.quotes&&(G==="'"||G==='"'))this.quotes=G;else if(this.quotes&&G===this.quotes)return this.parseOperand(!1,D),!1;else this.operand+=G;return}complete(G){this.parseOperand(!0,G)}getValidationError(){return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(G,D){let{advFilterExpSvc:z}=this.params;if(this.endPosition=D,this.modelValue=this.operand,G&&this.quotes)this.valid=!1,this.validationMessage=z.translate("advancedFilterValidationMissingQuote");else if(this.modelValue==="")this.valid=!1,this.validationMessage=z.translate("advancedFilterValidationMissingValue");else{let B=z.getOperandModelValue(this.operand,this.baseCellDataType,this.column);if(B!=null)this.modelValue=B;this.filterValidationSetters[this.baseCellDataType](B)}}},n1="[",d1="]",i4=class{constructor(G,D){this.params=G,this.startPosition=D,this.isAwaiting=!0,this.operandValueGetters={number:Number,bigint:(z)=>P6(z),date:(z)=>this.params.valueSvc.parseValue(this.columnParser.column,null,z,void 0),dateString:(z)=>this.operandValueGetters.date(z),dateTime:(z)=>this.operandValueGetters.date(z),dateTimeString:(z)=>this.operandValueGetters.date(z),boolean:(z)=>z,object:(z)=>z,text:(z)=>z}}parseExpression(){let G=this.startPosition,{expression:D}=this.params;while(G{return(J,U,Z)=>Z.operators[z].evaluator(J.getValue(B,U),U,Z.evaluatorParams[Q],D==null?void 0:Z.operands[D])})}getAutocompleteListParams(G){if(this.isColumnPosition(G))return this.getColumnAutocompleteListParams(G);if(this.isOperatorPosition(G))return this.getOperatorAutocompleteListParams(G);if(this.isBeyondEndPosition(G))return;return{enabled:!1}}updateExpression(G,D,z){let{expression:B}=this.params;if(this.isColumnPosition(G))return XD(this.params.expression,this.startPosition,this.columnParser?.getColId()?this.columnParser.endPosition:i1(B,G).endPosition,this.params.advFilterExpSvc.getColumnValue(D),!0);else if(this.isOperatorPosition(G)){let Q=this.getBaseCellDataTypeFromOperatorAutocompleteType(z),J=this.hasOperand(Q,D.key),U=J&&this.doesOperandNeedQuotes(Q),Z;if(this.operatorParser?.startPosition!=null&&Gthis.endPosition+1&&this.endPosition+10,Q=this.columnParser?.hasEndChar&&z.length===D.length+2;if(B)return z.slice(1,Q?-1:void 0);return z}getOperatorAutocompleteListParams(G){let D=this.columnParser?.column;if(!D)return{enabled:!1};let z=this.columnParser.baseCellDataType,B=this.operatorParser?.startPosition!=null&&G0}doesOperandNeedQuotes(G){return G!=="number"&&G!=="bigint"}addToListAndGetIndex(G,D){let z=G.length;return G.push(D),z}};function jB(G,D,z){let B=!1,Q=G.toLocaleLowerCase(),J=Q+" ",U=Object.keys(D).find((Z)=>{let S=D[Z],X=z(S).toLocaleLowerCase();if(X.startsWith(J))B=!0;return X===Q});if(U)return U;else if(B)return null;else return}function qJ(G,D){return(D??Object.keys(G)).map((B)=>({key:B,displayValue:G[B].displayValue}))}var AU=class{constructor(G){this.params=G,this.initOperators()}getEntries(G){return qJ(this.operators,G)}findOperator(G){return jB(G,this.operators,({displayValue:D})=>D)}initOperators(){let{translate:G}=this.params;this.operators={contains:{displayValue:G("advancedFilterContains"),evaluator:(D,z,B,Q)=>this.evaluateExpression(D,z,B,Q,!1,(J,U)=>J.includes(U)),numOperands:1},notContains:{displayValue:G("advancedFilterNotContains"),evaluator:(D,z,B,Q)=>this.evaluateExpression(D,z,B,Q,!0,(J,U)=>!J.includes(U)),numOperands:1},equals:{displayValue:G("advancedFilterTextEquals"),evaluator:(D,z,B,Q)=>this.evaluateExpression(D,z,B,Q,!1,(J,U)=>J===U),numOperands:1},notEqual:{displayValue:G("advancedFilterTextNotEqual"),evaluator:(D,z,B,Q)=>this.evaluateExpression(D,z,B,Q,!0,(J,U)=>J!=U),numOperands:1},startsWith:{displayValue:G("advancedFilterStartsWith"),evaluator:(D,z,B,Q)=>this.evaluateExpression(D,z,B,Q,!1,(J,U)=>J.startsWith(U)),numOperands:1},endsWith:{displayValue:G("advancedFilterEndsWith"),evaluator:(D,z,B,Q)=>this.evaluateExpression(D,z,B,Q,!1,(J,U)=>J.endsWith(U)),numOperands:1},blank:{displayValue:G("advancedFilterBlank"),evaluator:(D)=>D==null||typeof D==="string"&&D.trim().length===0,numOperands:0},notBlank:{displayValue:G("advancedFilterNotBlank"),evaluator:(D)=>D!=null&&(typeof D!=="string"||D.trim().length>0),numOperands:0}}}evaluateExpression(G,D,z,B,Q,J){if(G==null)return Q;return z.caseSensitive?J(z.valueConverter(G,D),B):J(z.valueConverter(G,D).toLocaleLowerCase(),B.toLocaleLowerCase())}},cD=class{constructor(G){this.params=G,this.initOperators()}getEntries(G){return qJ(this.operators,G)}findOperator(G){return jB(G,this.operators,({displayValue:D})=>D)}initOperators(){let{translate:G,equals:D}=this.params;this.operators={equals:{displayValue:G("advancedFilterEquals"),evaluator:(z,B,Q,J)=>this.evaluateSingleOperandExpression(z,B,Q,J,!!Q.includeBlanksInEquals,D),numOperands:1},notEqual:{displayValue:G("advancedFilterNotEqual"),evaluator:(z,B,Q,J)=>this.evaluateSingleOperandExpression(z,B,Q,J,!!Q.includeBlanksInEquals,(U,Z)=>!D(U,Z)),numOperands:1},greaterThan:{displayValue:G("advancedFilterGreaterThan"),evaluator:(z,B,Q,J)=>this.evaluateSingleOperandExpression(z,B,Q,J,!!Q.includeBlanksInGreaterThan,(U,Z)=>U>Z),numOperands:1},greaterThanOrEqual:{displayValue:G("advancedFilterGreaterThanOrEqual"),evaluator:(z,B,Q,J)=>this.evaluateSingleOperandExpression(z,B,Q,J,!!Q.includeBlanksInGreaterThan,(U,Z)=>U>=Z),numOperands:1},lessThan:{displayValue:G("advancedFilterLessThan"),evaluator:(z,B,Q,J)=>this.evaluateSingleOperandExpression(z,B,Q,J,!!Q.includeBlanksInLessThan,(U,Z)=>Uthis.evaluateSingleOperandExpression(z,B,Q,J,!!Q.includeBlanksInLessThan,(U,Z)=>U<=Z),numOperands:1},blank:{displayValue:G("advancedFilterBlank"),evaluator:(z)=>z==null,numOperands:0},notBlank:{displayValue:G("advancedFilterNotBlank"),evaluator:(z)=>z!=null,numOperands:0}}}evaluateSingleOperandExpression(G,D,z,B,Q,J){if(G==null)return Q;return J(z.valueConverter(G,D),B)}},n4=class{constructor(G){this.params=G,this.initOperators()}getEntries(G){return qJ(this.operators,G)}findOperator(G){return jB(G,this.operators,({displayValue:D})=>D)}initOperators(){let{translate:G}=this.params;this.operators={true:{displayValue:G("advancedFilterTrue"),evaluator:(D)=>!!D,numOperands:0},false:{displayValue:G("advancedFilterFalse"),evaluator:(D)=>D===!1,numOperands:0},blank:{displayValue:G("advancedFilterBlank"),evaluator:(D)=>D==null,numOperands:0},notBlank:{displayValue:G("advancedFilterNotBlank"),evaluator:(D)=>D!=null,numOperands:0}}}},d4=class extends P4{constructor(){super(...arguments);this.beanName="advFilterExpSvc",this.filterOperandGetters={number:(G)=>xD(G.filter)??"",bigint:(G)=>xD(G.filter)??"",date:(G)=>{let D=this.colModel.getColDefCol(G.colId);if(!D)return null;return this.valueSvc.formatValue(D,null,IU(xD(G.filter)??""))},dateTime:(G)=>this.filterOperandGetters.date(G),dateString:(G)=>{let D=this.colModel.getColDefCol(G.colId);if(!D)return null;let{filter:z}=G,Q=this.dataTypeSvc?.getDateFormatterFunction(D)?.(IU(xD(G.filter)??"")??void 0)??z;return this.valueSvc.formatValue(D,null,Q)},dateTimeString:(G)=>this.filterOperandGetters.dateString(G),boolean:()=>null,object:()=>null,text:()=>null},this.operandModelValueGetters={number:(G)=>g4(G)?Number(G):null,bigint:(G)=>G,date:(G,D,z)=>MU(this.valueSvc.parseValue(D,null,G,void 0),!!this.dataTypeSvc?.getDateIncludesTimeFlag(z)),dateTime:(...G)=>this.operandModelValueGetters.date(...G),dateString:(G,D,z)=>{let B=this.valueSvc.parseValue(D,null,G,void 0);if(this.dataTypeSvc)return MU(this.dataTypeSvc.getDateParserFunction(D)(B)??null,this.dataTypeSvc.getDateIncludesTimeFlag(z));return B},dateTimeString:(...G)=>this.operandModelValueGetters.dateString(...G),boolean:(G)=>G,object:(G)=>G,text:(G)=>G},this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}wireBeans(G){this.valueSvc=G.valueSvc,this.colModel=G.colModel,this.colNames=G.colNames,this.dataTypeSvc=G.dataTypeSvc}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(G){let{type:D}=G;return this.expressionJoinOperators[D]??D}getColumnDisplayValue(G){let{colId:D}=G,B=this.getColumnAutocompleteEntries().find(({key:J})=>J===D),Q;if(B)Q=B.displayValue,this.columnNameToIdMap[Q.toLocaleUpperCase()]={colId:D,columnName:Q};else Q=D;return Q}getOperatorDisplayValue(G){return this.getExpressionOperator(G.filterType,G.type)?.displayValue??G.type}getOperandModelValue(G,D,z){return this.operandModelValueGetters[D](G,z,D)}getOperandDisplayValue(G,D){let{filter:z,filterType:B}=G;if(z==null)return"";let Q=this.filterOperandGetters[B](G);if(B!=="number"&&B!=="bigint"){if(Q??(Q=xD(z)??""),!D)Q=`"${Q}"`}return D?Q:` ${Q}`}parseColumnFilterModel(G){let D=this.getColumnDisplayValue(G)??"",z=this.getOperatorDisplayValue(G)??"",B=this.getOperandDisplayValue(G);return`[${D}] ${z}${B}`}updateAutocompleteCache(G,D){if(D==="column"){let{key:z,displayValue:B}=G;this.columnNameToIdMap[G.displayValue.toLocaleUpperCase()]={colId:z,columnName:B}}}translate(G,D){let z=T4[G];if(typeof z==="function")z=z(D);return this.getLocaleTextFunc()(G,z,D)}generateAutocompleteListParams(G,D,z){return{enabled:!0,type:D,searchString:z,entries:G}}getColumnAutocompleteEntries(){if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;let G=this.colModel.getColDefCols()??[],D=[],z=this.gos.get("includeHiddenColumnsInAdvancedFilter");for(let B of G)if(B.getColDef().filter&&(z||B.isVisible()||B.isRowGroupActive()))D.push({key:B.getColId(),displayValue:this.colNames.getDisplayNameForColumn(B,"advancedFilter")});return D.sort((B,Q)=>{let J=B.displayValue??"",U=Q.displayValue??"";if(JJ)return 1;return 0}),D}getOperatorAutocompleteEntries(G,D){let z=this.getActiveOperators(G);return this.getDataTypeExpressionOperator(D).getEntries(z)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([G,D])=>({key:G,displayValue:D}))}getDefaultAutocompleteListParams(G){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",G)}getDataTypeExpressionOperator(G){return this.expressionOperators[G]}getExpressionOperator(G,D){return this.getDataTypeExpressionOperator(G)?.operators?.[D]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(G){let D=G.toLocaleUpperCase(),z=this.columnNameToIdMap[D];if(z)return z;let Q=this.getColumnAutocompleteEntries().find(({displayValue:J})=>J.toLocaleUpperCase()===D);if(Q){let{key:J,displayValue:U}=Q,Z={colId:J,columnName:U};return this.columnNameToIdMap[D]=Z,Z}return null}getExpressionEvaluatorParams(G){let D=this.expressionEvaluatorParams[G];if(D)return D;let z=this.colModel.getColDefCol(G);if(!z)return{valueConverter:(J)=>J};switch(this.dataTypeSvc?.getBaseDataType(z)){case"dateTimeString":case"dateString":D={valueConverter:this.dataTypeSvc?.getDateParserFunction(z)??((J)=>J)};break;case"object":if(z.getColDef().filterValueGetter)D={valueConverter:(J)=>J};else D={valueConverter:(J,U)=>this.valueSvc.formatValue(z,U,J)??(typeof J.toString==="function"?J.toString():"")};break;case"text":case void 0:D={valueConverter:(J)=>xD(J)};break;default:D={valueConverter:(J)=>J};break}let{filterParams:Q}=z.getColDef();if(Q)["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach((J)=>{let U=Q[J];if(U)D[J]=U});return this.expressionEvaluatorParams[G]=D,D}getColumnDetails(G){let D=this.colModel.getColDefCol(G)??void 0,z=(D?this.dataTypeSvc?.getBaseDataType(D):void 0)??"text";return{column:D,baseCellDataType:z}}generateExpressionOperators(){let G=(z,B)=>this.translate(z,B),D={translate:G,equals:(z,B)=>z.getTime()===B.getTime()};return{text:new AU({translate:G}),boolean:new n4({translate:G}),object:new AU({translate:G}),number:new cD({translate:G,equals:(z,B)=>z===B}),bigint:new cD({translate:G,equals:(z,B)=>z===B}),date:new cD(D),dateString:new cD(D),dateTime:new cD(D),dateTimeString:new cD(D)}}getColumnValue({displayValue:G}){return`${n1}${G}${d1}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(G){let D=G.getColDef().filterParams?.filterOptions;if(!D)return;return D.every((B)=>typeof B==="string")?D:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}},g6={stopPropagationCallbacks:GW,focusNextContainer:(G,D)=>{return DW(G,D)},configureFocusableContainer:(G,D)=>{let z=G.ctrlsSvc.get("gridCtrl");z.addFocusableContainer(D),D.addDestroyFunc(()=>z.removeFocusableContainer(D))}},PB=class extends SJ{constructor(G){super(G,g6)}getFocusableContainerName(){return"dialog"}},T6=".ag-autocomplete{align-items:center;display:flex;width:100%;>:where(.ag-text-field){flex:1 1 auto}}.ag-autocomplete-list-popup{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-autocomplete-list{height:calc(var(--ag-row-height)*6.5);min-width:200px;position:relative;width:100%}.ag-autocomplete-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:focus-visible:after{content:none}}.ag-autocomplete-virtual-list-item:hover{background-color:var(--ag-row-hover-color)}.ag-autocomplete-row{align-items:center;display:flex;flex:1 1 auto;overflow:hidden}.ag-autocomplete-row-label{margin:0 var(--ag-widget-container-horizontal-padding);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-autocomplete-row-selected{background-color:var(--ag-selected-row-background-color)}",Lz=class extends R6{constructor(G){super(_W,G)}},NW={tag:"div",cls:"ag-autocomplete-row",role:"presentation",children:[{tag:"div",cls:"ag-autocomplete-row-label"}]},FW=class extends kW{constructor(){super(NW);this.hasHighlighting=!1}setState(G,D){this.value=G,this.render(),this.updateSelected(D)}updateSelected(G){this.toggleCss("ag-autocomplete-row-selected",G)}setSearchString(G){let D=!1,{value:z}=this;if(z&&fW(G)){let B=z.toLocaleLowerCase().indexOf(G.toLocaleLowerCase());if(B>=0){D=!0,this.hasHighlighting=!0;let Q=B+G.length,J=this.getGui().lastElementChild;wW(J),J.append(z.slice(0,B),KW({tag:"b",children:z.slice(B,Q)}),z.slice(Q))}}if(!D&&this.hasHighlighting)this.hasHighlighting=!1,this.render()}render(){this.getGui().lastElementChild.textContent=this.value??" "}},EW={tag:"div",cls:"ag-autocomplete-list-popup",children:[{tag:"div",ref:"eList",cls:"ag-autocomplete-list"}]},y6=class extends SW{constructor(G){super(EW);this.params=G,this.eList=YW,this.searchString="",this.lastAutoListHeight=null}postConstruct(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Lz({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:(D)=>this.autocompleteEntries[D]});let G=this.virtualList.getGui();this.addManagedListeners(G,{click:()=>this.params.onConfirmed(),mousemove:this.onMouseMove.bind(this),mousedown:(D)=>D.preventDefault()}),this.setSelectedValue(0),this.updateListHeight()}onNavigationKeyDown(G,D){G.preventDefault();let z=this.autocompleteEntries.indexOf(this.selectedValue),B=D===XW.UP?z-1:z+1;this.checkSetSelectedValue(B)}setSearch(G){if(this.searchString=G,WW(G))this.runSearch();else this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0),this.updateListHeight();this.updateSearchInList()}runContainsSearch(G,D){let z,B=!1,Q=G.toLocaleLowerCase(),J=D.filter((U)=>{let S=U.toLocaleLowerCase().indexOf(Q),X=S===0,Y=S>=0;if(Y&&(!z||!B&&X||B===X&&U.lengthJ.toLocaleLowerCase().startsWith(z));return{topMatch:B[0],allMatches:B}}runSearch(){let{autocompleteEntries:G,useFuzzySearch:D,useStartsWithSearch:z,forceLastSelection:B}=this.params,Q=G.map((X)=>X.displayValue??X.key),J,U;if(D)J=qW({inputValue:this.searchString,allSuggestions:Q,hideIrrelevant:!0}).values,U=J.length?J[0]:void 0;else{let X=z?this.runStartsWithSearch(this.searchString,Q):this.runContainsSearch(this.searchString,Q);J=X.allMatches,U=X.topMatch}let Z=G.filter(({key:X,displayValue:Y})=>J.includes(Y??X));if(!Z.length&&this.selectedValue&&B?.(this.selectedValue,this.searchString))Z=[this.selectedValue];if(this.autocompleteEntries=Z,this.virtualList.refresh(),this.updateListHeight(),!U)return;let S=J.indexOf(U);this.checkSetSelectedValue(S)}updateSearchInList(){this.virtualList.forEachRenderedRow((G)=>G.setSearchString(this.searchString))}updateListHeight(){if(!this.params.autoSizeList)return;let G=this.autocompleteEntries.length,D=this.virtualList.getRowHeight(),z=this.params.maxVisibleItems??G,Q=Math.min(G,z)*D;if(G===0)Q=D;if(this.lastAutoListHeight===Q)return;if(this.lastAutoListHeight=Q,this.eList.style.height=`${Q}px`,HW(this.eList))this.params.onListHeightChanged?.()}checkSetSelectedValue(G){if(G>=0&&G{z.updateSelected(G===B)})}createRowComponent(G){let D=new FW;return this.createBean(D),D.setState(G.displayValue??G.key,G===this.selectedValue),D}onMouseMove(G){let D=this.virtualList,z=D.getGui().getBoundingClientRect(),B=D.getScrollTop(),Q=G.clientY-z.top+B,J=Math.floor(Q/D.getRowHeight());this.checkSetSelectedValue(J)}afterGuiAttached(){this.virtualList.refresh(),this.updateListHeight()}getSelectedValue(){if(!this.autocompleteEntries.length)return null;return this.selectedValue??null}},IW={tag:"div",cls:"ag-autocomplete",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eAutocompleteInput"}]},MW=class extends ZW{constructor(){super(IW,[UW]);this.eAutocompleteInput=$W,this.isListOpen=!1,this.lastPosition=0,this.valid=!0,this.registerCSS(T6)}wireBeans(G){this.popupSvc=G.popupSvc}postConstruct(){this.eAutocompleteInput.onValueChange((G)=>this.onValueChanged(G)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(G){let D=VU(G);this.updateValue(D),this.updateAutocompleteList(D)}updateValue(G){this.updateLastPosition(),this.dispatchLocalEvent({type:"eventValueChanged",value:G}),this.validate(G)}updateAutocompleteList(G){let D=this.listGenerator?.(G,this.lastPosition)??{enabled:!1};if(!D.type||D.type!==this.autocompleteListParams?.type){if(this.isListOpen)this.closeList()}let z=this.isListOpen;if(this.autocompleteListParams=D,D?.enabled){if(!z)this.openList();let{searchString:B}=D;this.autocompleteList.setSearch(B??"")}else if(z)this.closeList()}onKeyDown(G){let D=G.key;switch(this.updateLastPosition(),D){case RG.ENTER:this.onEnterKeyDown(G);break;case RG.TAB:this.onTabKeyDown(G);break;case RG.DOWN:case RG.UP:this.onUpDownKeyDown(G,D);break;case RG.LEFT:case RG.RIGHT:case RG.PAGE_HOME:case RG.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case RG.ESCAPE:this.onEscapeKeyDown(G);break;case RG.SPACE:if(G.ctrlKey&&!this.isListOpen)G.preventDefault(),this.forceOpenList();break}}confirmSelection(){let G=this.autocompleteList?.getSelectedValue();if(G)this.closeList(),this.dispatchLocalEvent({type:"eventOptionSelected",value:this.getValue(),position:this.lastPosition,updateEntry:G,autocompleteType:this.autocompleteListParams.type})}onTabKeyDown(G){if(this.isListOpen)G.preventDefault(),G.stopPropagation(),this.confirmSelection()}onEnterKeyDown(G){if(G.preventDefault(),this.isListOpen)this.confirmSelection();else this.onCompleted()}onUpDownKeyDown(G,D){if(G.preventDefault(),!this.isListOpen)this.forceOpenList();else this.autocompleteList?.onNavigationKeyDown(G,D)}onEscapeKeyDown(G){if(this.isListOpen)G.preventDefault(),G.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0)}onFocusOut(){if(this.isListOpen)this.closeList()}updatePositionAndList(){this.updateLastPosition(),this.updateAutocompleteList(this.eAutocompleteInput.getValue()??null)}setCaret(G,D){if(D||LW(this.beans))this.eAutocompleteInput.getFocusableElement().focus();let z=this.eAutocompleteInput.getInputElement();if(z.setSelectionRange(G,G),G===z.value.length)z.scrollLeft=z.scrollWidth}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){this.lastPosition=this.eAutocompleteInput.getInputElement().selectionStart??0}validate(G){if(!this.validator)return;let D=this.validationMessage=this.validator(G);this.eAutocompleteInput.getInputElement().setCustomValidity(D??""),this.valid=!D,this.dispatchLocalEvent({type:"eventValidChanged",isValid:this.valid,validationMessage:D})}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new y6({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));let G=this.autocompleteList.getGui(),D={ePopup:G,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},z=this.popupSvc.addPopup({eChild:G,anchorToElement:this.getGui(),positionCallback:()=>this.popupSvc.positionPopupByComponent(D),ariaLabel:this.listAriaLabel});this.hidePopup=z.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){if(this.isListOpen)this.closeList();this.dispatchLocalEvent({type:"eventValueConfirmed",value:this.getValue(),isValid:this.isValid()})}getValue(){return VU(this.eAutocompleteInput.getValue())}setInputPlaceholder(G){return this.eAutocompleteInput.setInputPlaceholder(G),this}setInputAriaLabel(G){return this.eAutocompleteInput.setInputAriaLabel(G),this}setListAriaLabel(G){return this.listAriaLabel=G,this}setListGenerator(G){return this.listGenerator=G,this}setValidator(G){return this.validator=G,this}isValid(){return this.valid}setValue(G){let{value:D,position:z,silent:B,updateListOnlyIfOpen:Q,restoreFocus:J}=G;if(this.eAutocompleteInput.setValue(D,!0),this.setCaret(z??this.lastPosition,J),!B)this.updateValue(D);if(!Q||this.isListOpen)this.updateAutocompleteList(D)}setForceLastSelection(G){return this.forceLastSelection=G,this}setInputDisabled(G){return this.eAutocompleteInput.setDisabled(G),this}},AW={selector:"AG-AUTOCOMPLETE",component:MW},qQ={buttons:["apply"],suppressBuilderButton:!1},bU={apply:"advancedFilterApply",clear:"advancedFilterClear",cancel:"advancedFilterCancel",reset:"advancedFilterReset"},RW={tag:"div",cls:"ag-advanced-filter",role:"presentation",attrs:{tabindex:"-1"},children:[{tag:"ag-autocomplete",ref:"eAutocomplete"},{tag:"ag-filter-button",ref:"eButtons",cls:"ag-advanced-filter-buttons"},{tag:"button",ref:"eBuilderFilterButton",cls:"ag-button ag-advanced-filter-builder-button",children:[{tag:"span",ref:"eBuilderFilterButtonIcon",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eBuilderFilterButtonLabel",cls:"ag-advanced-filter-builder-button-label"}]}]},x6=class extends BW{constructor(){super(RW,[AW,zW]);this.eAutocomplete=fz,this.eButtons=fz,this.eBuilderFilterButton=fz,this.eBuilderFilterButtonIcon=fz,this.eBuilderFilterButtonLabel=fz,this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}wireBeans(G){this.advFilterExpSvc=G.advFilterExpSvc,this.advancedFilter=G.advancedFilter,this.filterManager=G.filterManager,this.registry=G.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipShowDelayOverride:()=>1000,getLocation:()=>"advancedFilter"})),this.eAutocomplete.setListGenerator((z,B)=>this.generateAutocompleteListParams(B)).setValidator(()=>this.validateValue()).setForceLastSelection((z,B)=>this.forceLastSelection(z,B)).setInputAriaLabel(this.advFilterExpSvc.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advFilterExpSvc.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListeners(this.eAutocomplete,{eventValueChanged:({value:z})=>this.onValueChanged(z),eventValueConfirmed:({isValid:z})=>this.onValueConfirmed(z),eventOptionSelected:({position:z,updateEntry:B,autocompleteType:Q})=>this.onOptionSelected(z,B,Q),eventValidChanged:({isValid:z,validationMessage:B})=>this.onValidChanged(z,B)});let{buttons:G,suppressBuilderButton:D}={...qQ,...this.gos.get("advancedFilterParams")};this.setupButtons(G),this.setupBuilderButton(D),this.beans.gos.addManagedPropertyListener("advancedFilterParams",(z)=>{let B={...qQ,...z.currentValue},Q={...qQ,...z.previousValue};if(B.buttons!==Q.buttons){let J=B.buttons.map((U)=>({type:U,label:this.advFilterExpSvc.translate(bU[U])}));this.eButtons.updateButtons(J)}if(B.suppressBuilderButton!==Q.suppressBuilderButton)CU(this.eBuilderFilterButton,!B.suppressBuilderButton)})}refresh(){let G=this.advancedFilter.getExpressionDisplayValue();this.eAutocomplete.setValue({value:G??"",position:G?.length,updateListOnlyIfOpen:!0})}setInputDisabled(G){this.eAutocomplete.setInputDisabled(G),this.eButtons.updateValidity(!G&&!this.isApplyDisabled&&!this.advancedFilter.isCurrentExpressionApplied())}setupButtons(G){let D=G.map((B)=>({type:B,label:this.advFilterExpSvc.translate(bU[B])})),z=(B)=>()=>{this.updateModel(B)};this.eButtons.addManagedListeners(this.eButtons,{apply:z("apply"),clear:z("clear"),reset:z("reset"),cancel:z("cancel")}),this.eButtons.updateButtons(D)}updateModel(G){switch(G){case"apply":this.onValueConfirmed(this.eAutocomplete.isValid());break;case"reset":this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"cancel":this.advancedFilter.setModel(this.advancedFilter.getModel()),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"clear":this.eAutocomplete.setValue({value:"",restoreFocus:!0});break}}setupBuilderButton(G){this.eBuilderFilterButtonIcon.appendChild(QW("advancedFilterBuilder",this.beans)),this.eBuilderFilterButtonLabel.textContent=this.advFilterExpSvc.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedElementListeners(this.eBuilderFilterButton,{click:()=>this.openBuilder()}),this.addManagedListeners(this.advancedFilter.getCtrl(),{advancedFilterBuilderClosed:()=>this.closeBuilder()}),CU(this.eBuilderFilterButton,!G)}onValueChanged(G){G=JW(G),this.advancedFilter.setExpressionDisplayValue(G),this.expressionParser=this.advancedFilter.createExpressionParser(G);let D=this.expressionParser?.parseExpression();if(D&&D!==G)this.eAutocomplete.setValue({value:D,silent:!0,restoreFocus:!0})}onValueConfirmed(G){if(!G||this.isApplyDisabled)return;this.eButtons?.updateValidity(!1),this.advancedFilter.applyExpression(),this.filterManager?.onFilterChanged({source:"advancedFilter"})}onOptionSelected(G,D,z){let{updatedValue:B,updatedPosition:Q,hideAutocomplete:J}=this.updateExpression(G,D,z);this.eAutocomplete.setValue({value:B,position:Q,updateListOnlyIfOpen:J,restoreFocus:!0})}validateValue(){return this.expressionParser?.isValid()?null:this.expressionParser?.getValidationMessage()??null}onValidChanged(G,D){this.isApplyDisabled=!G||this.advancedFilter.isCurrentExpressionApplied(),this.eButtons.updateValidity(!this.isApplyDisabled),this.tooltipFeature?.setTooltipAndRefresh(D)}generateAutocompleteListParams(G){return this.expressionParser?this.expressionParser.getAutocompleteListParams(G):this.advFilterExpSvc.getDefaultAutocompleteListParams("")}updateExpression(G,D,z){return this.advFilterExpSvc.updateAutocompleteCache(D,z),this.expressionParser?.updateExpression(G,D,z)??this.advancedFilter.getDefaultExpression(D)}forceLastSelection({key:G,displayValue:D},z){return!!z.toLocaleLowerCase().match(`^${(D??G).toLocaleLowerCase()}\\s*$`)}openBuilder(){if(this.builderOpen)return;this.builderOpen=!0,RU(this.eBuilderFilterButton,!0),this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui",eventSource:this.eBuilderFilterButton})}closeBuilder(){if(!this.builderOpen)return;this.builderOpen=!1,RU(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus()}},xW={tag:"div",cls:"ag-advanced-filter-header",role:"row"},cW=class extends CW{constructor(G){super(xW);this.enabled=G}wireBeans(G){this.colModel=G.colModel,this.focusSvc=G.focusSvc,this.ctrlsSvc=G.ctrlsSvc}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter));let G=()=>{if(this.enabled)this.setEnabledHeight()};this.addManagedEventListeners({gridColumnsChanged:()=>this.onGridColumnsChanged(),columnHeaderHeightChanged:G,stylesChanged:G}),this.addManagedPropertyListener("headerHeight",G),this.addManagedPropertyListener("floatingFiltersHeight",G),this.addGuiEventListener("keydown",(D)=>this.onKeyDown(D)),this.addGuiEventListener("focusout",(D)=>{if(!this.getFocusableElement().contains(D.relatedTarget))this.focusSvc.clearAdvancedFilterColumn()})}getFocusableElement(){return this.eAdvancedFilter?.getGui()??this.getGui()}setEnabled(G){if(G===this.enabled)return;this.setupAdvancedFilter(G)}refresh(){this.eAdvancedFilter?.refresh()}getHeight(){return this.height}setInputDisabled(G){this.eAdvancedFilter?.setInputDisabled(G)}setupAdvancedFilter(G){let D=this.getGui();if(G){this.eAdvancedFilter=this.createBean(new x6);let z=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCss("ag-advanced-filter-header-cell"),this.setEnabledHeight(),this.setAriaRowIndex(),gW(z,"gridcell"),jW(z,1),this.setAriaColumnCount(z),D.appendChild(z)}else VW(D),this.destroyBean(this.eAdvancedFilter),this.height=0;yW(D,G),this.enabled=G}setEnabledHeight(){let G=this.getGui();this.height=uW(this.beans);let D=`${this.height}px`;G.style.height=D,G.style.minHeight=D}setAriaColumnCount(G){PW(G,this.colModel.getCols().length)}setAriaRowIndex(){TW(this.getGui(),this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)}onGridColumnsChanged(){if(!this.eAdvancedFilter)return;this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex()}onKeyDown(G){switch(G.key){case Nz.ENTER:{if(this.hasFocus()){if(vW(this.getFocusableElement()))G.preventDefault()}break}case Nz.ESCAPE:if(!this.hasFocus())this.getFocusableElement().focus();break;case Nz.UP:this.navigateUpDown(!0,G);break;case Nz.DOWN:this.navigateUpDown(!1,G);break;case Nz.TAB:if(this.hasFocus())this.navigateLeftRight(G);else{let D=bW(this.beans,this.getFocusableElement(),null,G.shiftKey);if(D)G.preventDefault(),D.focus();else this.navigateLeftRight(G)}break}}navigateUpDown(G,D){if(this.hasFocus()){if(this.focusSvc.focusNextFromAdvancedFilter(G))D.preventDefault()}}navigateLeftRight(G){if(G.shiftKey?this.focusSvc.focusLastHeader():this.focusSvc.focusNextFromAdvancedFilter(!1,!0))G.preventDefault()}hasFocus(){return OW(this.beans)===this.getFocusableElement()}},c6=class extends C6{},tW=class extends pW{constructor(G,D){super();this.comp=G,this.virtualList=D}postConstruct(){this.createManagedBean(new c6(this.comp,this.virtualList,{dragSourceType:mW.AdvancedFilterBuilder,addListeners:(G,D,z)=>{G.addManagedListeners(this,{advancedFilterBuilderDragStarted:D,advancedFilterBuilderDragEnded:z})},getCurrentDragValue:(G)=>this.getCurrentDragValue(G),isMoveBlocked:()=>!1,getNumRows:(G)=>G.getNumItems(),moveItem:(G,D)=>this.moveItem(G,D)}))}getCurrentDragValue(G){return G.item}moveItem(G,D){this.comp.moveItem(G,D)}},_q=100;function kq(G){let{host:D,source:z,useAsyncSearch:B,onMisconfiguredSearchSource:Q,onFirstValuesPageLoaded:J}=G,U=new wq({host:D,source:z,onMisconfiguredSearchSource:Q,onFirstValuesPageLoaded:J??(()=>{})}),Z=typeof z.loadValuesPage==="function";return{controller:U,hasPagedSource:Z,onSearch:B?(S)=>U.onSearch(S):void 0,onLoadMoreRows:Z?(S)=>U.loadValuesPage(S??"down"):void 0}}var wq=class{constructor(G){this.ctrlParams=G,this.currentSearchRequest=0,this.currentValuesPageRequest=0,this.valuesPageLoading=!1,this.valuesPageHasMoreNext=!1,this.valuesPageHasMorePrev=!1,this.valuesPageLoadedValues=[],this.valuesPageSearch="",this.valuesPageWindowStartRow=0,this.destroyed=!1}destroy(){this.destroyed=!0,this.currentSearchRequest++,this.currentValuesPageRequest++}onSearch(G){if(this.destroyed)return;if(this.isValuesPaged()){this.resetValuesPage(G);return}let D=++this.currentSearchRequest,{host:z,source:B,onMisconfiguredSearchSource:Q}=this.ctrlParams;if(z.setValueList({refresh:!0,valueList:void 0}),!G)return;if(typeof B.searchValues!=="function"){Q?.();return}let J;try{J=B.searchValues(G)}catch(U){if(kQ("Rich Select",U),D===this.currentSearchRequest)z.setValueList({refresh:!0,valueList:[]});return}if(Array.isArray(J)){Q?.(),z.setValueList({refresh:!0,valueList:J});return}z.setValueList({valueList:J.then((U)=>{if(D===this.currentSearchRequest)return U}).catch((U)=>{if(kQ("Rich Select",U),D===this.currentSearchRequest)return[]}),refresh:!0})}resetValuesPage(G){if(this.destroyed)return;this.valuesPageSearch=G,this.valuesPageLoadedValues=[],this.valuesPageWindowStartRow=this.resolveValuesPageStartRow(G),this.valuesPageNextCursor=void 0,this.valuesPageHasMoreNext=!0,this.valuesPageHasMorePrev=this.valuesPageWindowStartRow>0,this.valuesPageLoading=!1,this.currentValuesPageRequest++,this.ctrlParams.host.setValueList({valueList:void 0,refresh:!0,isInitial:!0}),this.loadValuesPage("down")}loadValuesPage(G){if(this.destroyed)return;let D=this.ctrlParams.source.loadValuesPage;if(typeof D!=="function"||this.valuesPageLoading)return;if(G==="up"&&!this.valuesPageHasMorePrev||G==="down"&&!this.valuesPageHasMoreNext)return;let z=Math.max(this.ctrlParams.source.valuesPageSize??_q,1),B=G==="up"?Math.max(this.valuesPageWindowStartRow-z,0):this.valuesPageWindowStartRow+this.valuesPageLoadedValues.length,Q=G==="up"?this.valuesPageWindowStartRow:B+z;if(B>=Q){if(G==="up")this.valuesPageHasMorePrev=!1;else this.valuesPageHasMoreNext=!1;return}let J=this.currentValuesPageRequest,U={search:this.valuesPageSearch,startRow:B,endRow:Q,cursor:G==="down"?this.valuesPageNextCursor:void 0};if(this.valuesPageLoading=!0,this.valuesPageLoadedValues.length===0)this.ctrlParams.host.setIsLoading();let Z;try{Z=D(U)}catch(S){this.handleValuesPageError(S,J);return}Promise.resolve(Z).then((S)=>this.applyValuesPageResult(S,z,J,G,B,Q)).catch((S)=>this.handleValuesPageError(S,J))}applyValuesPageResult(G,D,z,B,Q,J){if(this.destroyed||z!==this.currentValuesPageRequest)return;this.valuesPageLoading=!1;let U=this.valuesPageLoadedValues.length===0,Z=G?.values??[];if(B==="up"){if(Z.length)this.valuesPageLoadedValues=[...Z,...this.valuesPageLoadedValues],this.valuesPageWindowStartRow=Q;let S=J-Q;this.valuesPageHasMorePrev=Q>0&&Z.length>=S}else{if(Z.length)this.valuesPageLoadedValues=[...this.valuesPageLoadedValues,...Z];this.valuesPageNextCursor=G?.cursor;let S=this.valuesPageLoadedValues.length;if(typeof G?.lastRow==="number")this.valuesPageHasMoreNext=this.valuesPageWindowStartRow+S=D}if(this.ctrlParams.host.setValueList({valueList:this.valuesPageLoadedValues,refresh:!0,isInitial:!0,scrollToCurrentValue:U,prependedRowCount:B==="up"?Z.length:void 0}),U)this.ctrlParams.onFirstValuesPageLoaded()}handleValuesPageError(G,D){if(kQ("Rich Select",G),this.destroyed||D!==this.currentValuesPageRequest)return;this.valuesPageLoading=!1,this.valuesPageHasMoreNext=!1,this.valuesPageHasMorePrev=!1,this.ctrlParams.host.setValueList({valueList:this.valuesPageLoadedValues,refresh:!0,isInitial:!0})}resolveValuesPageStartRow(G){if(G)return 0;let D=this.ctrlParams.source.valuesPageInitialStartRow?.(G);return Math.max(Math.floor(D??0),0)}isValuesPaged(){return typeof this.ctrlParams.source.loadValuesPage==="function"}},Cq={tag:"div",cls:"ag-pill",role:"option",children:[{tag:"span",ref:"eText",cls:"ag-pill-text"},{tag:"span",ref:"eButton",cls:"ag-button ag-pill-button",role:"presentation"}]},Vq=class extends Rq{constructor(G){super(Cq);this.config=G,this.eText=gU,this.eButton=gU}postConstruct(){let{config:G,eButton:D}=this,{onKeyDown:z,onButtonClick:B}=G;if(this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),this.addGuiEventListener("focus",()=>{this.eButton.focus()}),z)this.addGuiEventListener("keydown",z);if(B)this.addManagedElementListeners(D,{click:B})}toggleCloseButtonClass(G,D){this.eButton.classList.toggle(G,D)}setText(G){this.eText.textContent=G}getText(){return this.eText.textContent}},bq={tag:"div",cls:"ag-pill-container"},vq=class extends Kq{constructor(){super(bq);this.pills=[]}init(G){this.params=G,this.getKey=G.valueFormatter??((D)=>String(D)),this.refresh()}refresh(){this.clearPills();let{params:G,onPillKeyDown:D,getKey:z}=this,B=G.getValue();if(!Array.isArray(B)){if(B==null)return;B=[B]}let Q=G.valueFormatter??((U)=>String(U)),J=B.length;Mq(this.getGui(),J===0?"presentation":"listbox");for(let U=0;Uthis.onPillButtonClick(S),onKeyDown:D.bind(this)})),X=S.getGui();if(Iq(X,U+1),Aq(X,J),G.onPillMouseDown)S.addGuiEventListener("mousedown",G.onPillMouseDown);if(G.announceItemFocus)S.addGuiEventListener("focus",G.announceItemFocus);S.setText(Q(Z)??""),S.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(X),this.pills.push({key:z(Z)??U.toString(),pill:S})}}onNavigationKeyDown(G){let{key:D}=G,z=this.gos.get("enableRtl"),B=!z&&D===oG.LEFT||z&&D===oG.RIGHT,Q=!z&&D===oG.RIGHT||z&&D===oG.LEFT;if(!this.pills.length||!B&&!Q)return;G.preventDefault();let{beans:J,params:U}=this,Z=PU(J),S=this.getGui(),X=Nq(S);if(S.contains(Z)){let Y=X.find((q)=>q.contains(Z));if(Y&&Y!==Z)Y.focus();let W=Fq(J,S,!1,B);if(W)W.focus();else if(Q)U.focusAfterForwardBoundary?.()}else if(X.length>0)X[Q?0:X.length-1].focus()}clearPills(){let G=this.getGui();if(G.contains(PU(this.beans))&&this.params.eWrapper)this.params.eWrapper.focus();fq(G),this.destroyBeans(this.pills.map(({pill:D})=>D)),this.pills=[]}onPillButtonClick(G){this.deletePill(G)}onPillKeyDown(G){let D=G.key;if(D===oG.LEFT||D===oG.RIGHT){if(G.stopPropagation(),this.params.onHorizontalArrowKeyDown)this.params.onHorizontalArrowKeyDown(G);else this.onNavigationKeyDown(G);return}if(D!==oG.DELETE&&D!==oG.BACKSPACE)return;G.preventDefault();let z=Eq(this.beans),B=this.pills.findIndex(({pill:J})=>J.getGui().contains(z.activeElement));if(B===-1)return;let Q=this.pills[B];if(Q?.pill)this.deletePill(Q.pill,B)}deletePill(G,D){let{getKey:z,pills:B,params:Q}=this,J=(B[D??-1]??B.find(({pill:Z})=>Z===G))?.key,U=(Q.getValue()||[]).filter((Z)=>z(Z)!==J);if(Q.setValue(U),!U.length)if(Q.focusAfterDelete)Q.focusAfterDelete();else Q.eWrapper?.focus();else if(D!=null){let{pill:Z}=B[Math.min(D,B.length-1)];if(Z)Z.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}},Oq=".ag-rich-select{cursor:default;height:100%}.ag-rich-select-value{align-items:center;background-color:var(--ag-picker-button-background-color);display:flex;height:100%;padding:var(--ag-spacing);:where(.ag-picker-field-display){overflow:hidden;text-overflow:ellipsis;&:where(.ag-display-as-placeholder){opacity:.5}}}.ag-virtual-list-viewport.ag-rich-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-input-border-radius);box-shadow:var(--ag-dropdown-shadow);height:auto;position:relative;width:100%;:where(.ag-rich-select-loading){display:flex;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);:where(.ag-loading-text){overflow:hidden;text-overflow:ellipsis}}}.ag-rich-select-row{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;padding:0 var(--ag-spacing);white-space:nowrap}.ag-rich-select-row-selected{background-color:var(--ag-selected-row-background-color)}.ag-rich-select-row-highlighted,.ag-rich-select-row:hover{background-image:linear-gradient(var(--ag-row-hover-color),var(--ag-row-hover-color))}.ag-rich-select-row-text-highlight{font-weight:700}.ag-rich-select-field-input{flex:1 1 auto;:where(.ag-input-field-input){border:none!important;box-shadow:none!important;padding:0!important;text-overflow:ellipsis;&::-moz-placeholder{opacity:.8}&::placeholder{opacity:.8}}}:where(.ag-ltr) .ag-rich-select-field-input{left:var(--ag-spacing)}:where(.ag-rtl) .ag-rich-select-field-input{right:var(--ag-spacing)}.ag-rich-select-typing-multi{:where(.ag-picker-field-display){flex:0 1 auto;max-width:100%;min-width:0}:where(.ag-rich-select-pill-display){align-items:center;display:flex;flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;:where(.ag-pill-container){flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden}}:where(.ag-rich-select-field-input){flex:0 0 auto;max-width:100%;min-width:0;:where(.ag-input-wrapper){flex:0 0 auto;max-width:100%}:where(.ag-input-field-input){max-width:100%;min-width:1ch;width:auto}}}:where(.ag-ltr) .ag-rich-select-typing-multi{:where(.ag-rich-select-field-input){margin-left:.25rem}:where(.ag-rich-select-deselect-button){margin-left:auto}:where(.ag-rich-select-deselect-button.ag-hidden+.ag-picker-field-icon){margin-left:auto}}:where(.ag-rtl) .ag-rich-select-typing-multi{:where(.ag-rich-select-field-input){margin-right:.25rem}:where(.ag-rich-select-deselect-button){margin-right:auto}:where(.ag-rich-select-deselect-button.ag-hidden+.ag-picker-field-icon){margin-right:auto}}:where(.ag-popup-editor) .ag-rich-select-value{height:var(--ag-row-height);min-width:200px}.ag-rich-select-virtual-list-item{cursor:default;height:var(--ag-list-item-height)}.ag-pill-container{display:flex;flex-wrap:nowrap;gap:.25rem;min-width:0}.ag-pill{align-items:center;background:var(--ag-select-cell-background-color);border:var(--ag-select-cell-border);border-radius:var(--ag-border-radius);display:flex;padding:0 .25rem;white-space:nowrap}.ag-pill-button{border:none;padding:0}:where(.ag-ltr) .ag-pill-button{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-pill-button{margin-right:var(--ag-spacing)}.ag-pill-button:hover{color:var(--ag-accent-color);cursor:pointer}",pq={tag:"div",cls:"ag-rich-select-row",role:"presentation"},mq=class extends xq{constructor(G){super(pq);this.params=G,this.valueFormatter=HJ(G.valueFormatter)}wireBeans(G){this.userCompFactory=G.userCompFactory,this.registry=G.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("highlightTooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0},this))}setState(G){let D=this.valueFormatter(G);if(!this.populateWithRenderer(G,D))this.populateWithoutRenderer(G,D);this.value=G}highlightString(G){let{parsedValue:D,params:z}=this;if(z.cellRenderer||!Fz(D))return;let B=Fz(G);if(B){let Q=D?.toLocaleLowerCase().indexOf(G.toLocaleLowerCase());if(Q>=0){let J=Q+G.length,U=this.getGui().querySelector("span");if(U)hq(U),U.append(D.slice(0,Q),yU({tag:"span",cls:"ag-rich-select-row-text-highlight",children:D.slice(Q,J)}),D.slice(J))}else B=!1}if(!B)this.renderValueWithoutRenderer(D)}updateSelected(G){let D=this.getGui();dq(D.parentElement,G),this.toggleCss("ag-rich-select-row-selected",G)}getValue(){return this.value}toggleHighlighted(G){this.toggleCss("ag-rich-select-row-highlighted",G),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:G})}populateWithoutRenderer(G,D){let z=this.getGui(),B=yU({tag:"span"});B.style.overflow="hidden",B.style.textOverflow="ellipsis";let Q=lq(Fz(D)?D:G);this.parsedValue=Fz(Q)?Q:null,z.appendChild(B),this.renderValueWithoutRenderer(Q),this.shouldDisplayTooltip=nq(()=>B),this.tooltipFeature?.setTooltipAndRefresh(this.parsedValue)}renderValueWithoutRenderer(G){let D=this.getGui().querySelector("span");if(!D)return;D.textContent=Fz(G)?G:" "}populateWithRenderer(G,D){let z,B,{cellRenderer:Q,cellRendererParams:J}=this.params;if(Q){let U=this.getParentComponent()?.getParentComponent();B=iq(this.userCompFactory,this.params,cq(this.gos,{value:G,valueFormatted:D,cellRendererParams:J,getValue:()=>U?.getValue(),setValue:(Z)=>{U?.setValue(Z,!0)},setTooltip:(Z,S)=>{this.gos.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=S,this.tooltipFeature?.setTooltipAndRefresh(Z)}}))}if(B)z=B.newAgStackInstance();if(z)h6(z,this.getGui());if(z)return z.then((U)=>{this.addDestroyFunc(()=>{this.destroyBean(U)})}),!0;return!1}},xU="ag-rich-select-list",cU="ag-rich-select-row",A0=0,tq=1,LB=2,l1=3,sq=class extends Lz{constructor(G,D,z){super({cssIdentifier:"rich-select"});this.params=G,this.richSelectWrapper=D,this.getSearchString=z,this.lastRowHovered=-1,this.selectedItems=new Set,this.loadingState=l1,this.loadMoreRowsThreshold=10,this.valueFormatter=HJ(G.valueFormatter),this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct();let G=this.getLocaleTextFunc();this.loadingLabel=G("loadingOoo","Loading..."),this.noMatchesLabel=G("noMatches","No matches to show"),this.eLoadingIcon=Pq("richSelectLoading",this.beans,null),this.eStateCompLabel=TU({tag:"span",cls:"ag-loading-text",children:this.loadingLabel}),this.eStateComp=TU({tag:"div",cls:"ag-rich-select-loading",children:[{tag:"span",cls:"ag-loading-icon",children:[this.eLoadingIcon?()=>this.eLoadingIcon:void 0]},{tag:"span",cls:"ag-loading-text",children:[()=>this.eStateCompLabel]}]}),this.appendChild(this.eStateComp);let{cellRowHeight:D,pickerAriaLabelKey:z,pickerAriaLabelValue:B}=this.params;if(D)this.setRowHeight(D);let Q=this.getGui(),J=this.getAriaElement();this.addManagedListeners(Q,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this),scroll:this.onGuiScroll.bind(this)}),Q.classList.add(xU);let U=`${xU}-${this.getCompId()}`;J.setAttribute("id",U);let Z=G(z,B);yq(J,Z),Tq(this.richSelectWrapper,J)}setIsLoading(){this.setLoadingState(A0)}setLoadingState(G){let D=this.loadingState!==G;if(this.loadingState=G,this.toggleStateComp(),this.toggleVisibility(),D){let z=this.getStateAnnouncementText(G);if(z)this.stateAnnouncementCallback?.(z)}}toggleStateComp(){let{eStateComp:G,eStateCompLabel:D,eLoadingIcon:z,loadingState:B,loadingLabel:Q,noMatchesLabel:J,params:U}=this;if(!G)return;if(B===A0){if(D.textContent=Q,z)kD(z,!0);kD(G,!0);return}if(B===LB&&U.allowNoResultsCopy){if(D.textContent=J,z)kD(z,!1);kD(G,!0);return}kD(G,!1)}shouldBeVisible(){if(this.loadingState===LB)return!!this.params.allowNoResultsCopy;return this.loadingState!==l1}toggleVisibility(G){let D=this.getGui();if(G===void 0)kD(D,this.shouldBeVisible());else kD(D,G);this.scheduleMaybeRequestMoreRows()}setLoadMoreRowsCallback(G,D=10){this.loadMoreRowsCallback=G,this.loadMoreRowsThreshold=Math.max(D,1),this.maybeRequestMoreRows()}setStateAnnouncementCallback(G){this.stateAnnouncementCallback=G}navigateToPage(G){let D=super.navigateToPage(G,this.lastRowHovered);if(D!=null)wQ(this.beans,()=>{if(!this.isAlive())return null;this.highlightIndex(D)});return D}drawVirtualRows(G){if(super.drawVirtualRows(G),this.refreshSelectedItems(),this.lastRowHovered!==-1)this.updateRenderedHighlightState(this.lastRowHovered)}highlightFilterMatch(G){this.forEachRenderedRow((D)=>{D.highlightString(G)})}onNavigationKeyDown(G,D){wQ(this.beans,()=>{if(!this.currentList||!this.isAlive())return;let z=this.currentList.length,B=this.lastRowHovered,Q=G===uq.DOWN?1:-1,J=Math.min(Math.max(B===-1?0:B+Q,0),z-1);this.highlightIndex(J),D()})}selectValue(G){if(!this.currentList||G==null)return!1;let D=this.getIndicesForValues(G),z=D.length>0;if(z)this.refresh(),this.ensureIndexVisible(D[0]),this.refresh(!0);if(this.selectListItems(Array.isArray(G)?G:[G]),z)this.highlightIndex(D[0],!0);return z}selectListItems(G,D=!1){if(!D)this.selectedItems.clear();for(let z=0;zG.length,getRow:(z)=>G[z],areRowsEqual:(z,B)=>z===B})}offsetHoveredIndexOnPrependedRows(G){if(G<=0||this.lastRowHovered<0)return;this.lastRowHovered+=G}restoreScrollOnPrependedRows(G,D){if(D<=0)return;let z=this.getGui(),B=this.getRowHeight(),Q=G+D*B;this.awaitStable(()=>{if(!this.isAlive())return;z.scrollTop=Q})}getSelectedItems(){return this.selectedItems}getLastItemHovered(){return this.currentList?.[this.lastRowHovered]}highlightIndex(G,D){if(!this.currentList)return;if(G<0||G>=this.currentList.length)this.lastRowHovered=-1,this.setActiveOption();else if(this.lastRowHovered=G,this.ensureIndexVisible(G,!D)&&!D)this.refresh(!0);this.updateRenderedHighlightState(G)}updateRenderedHighlightState(G){let D;this.forEachRenderedRow((z,B)=>{let Q=G===B;if(z.toggleHighlighted(Q),Q)D=`${cU}-${z.getCompId()}`}),this.setActiveOption(D)}setActiveOption(G){gq(this.richSelectWrapper,G??null),jq(this.richSelectWrapper,"data-active-option",G)}getIndicesForValues(G){let{currentList:D}=this;if(!D||D.length===0||G===void 0)return[];let z=Array.isArray(G)?G:[G];if(z.length===0)return[];let B=[],Q;for(let J of z){let U=D.indexOf(J);if(U===-1&&J!=null){Q??(Q=D.map((S)=>this.valueFormatter(S)));let Z=this.getComparableFormattedValue(J);U=Q.indexOf(Z)}if(U>=0)B.push(U)}return B}toggleListItemSelection(G){let D=this.findItemInSelected(G);if(D!==void 0)this.selectedItems.delete(D);else this.selectedItems.add(G);this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow((G)=>{let D=this.findItemInSelected(G.getValue())!==void 0;G.updateSelected(D)})}findItemInSelected(G){if(typeof G==="object"){if(this.selectedItems.has(G))return G;let D=this.valueFormatter(G);for(let z of this.selectedItems)if(this.valueFormatter(z)===D)return z}else return this.selectedItems.has(G)?G:void 0}getComparableFormattedValue(G){return G!=null&&typeof G==="object"?this.valueFormatter(G):String(G??"")}createRowComponent(G,D){let z=new mq(this.params);D.setAttribute("id",`${cU}-${z.getCompId()}`),z.setParentComponent(this),this.createBean(z),z.setState(G);let{highlightMatch:B,searchType:Q="fuzzy"}=this.params;if(B&&Q!=="fuzzy")z.highlightString(this.getSearchString());return z}getRowForMouseEvent(G){if(!this.model)return-1;let z=this.getGui().getBoundingClientRect(),B=this.getScrollTop(),Q=G.clientY-z.top+B;return Math.min(Math.max(Math.floor(Q/this.getRowHeight()),0),this.model.getRowCount()-1)}onMouseMove(G){let D=this.getRowForMouseEvent(G);if(D!==-1&&D!=this.lastRowHovered)this.lastRowHovered=D,this.highlightIndex(D,!0)}onGuiScroll(){this.maybeRequestMoreRows(!0)}scheduleMaybeRequestMoreRows(){if(this.beans){wQ(this.beans,()=>this.maybeRequestMoreRows(!1));return}this.maybeRequestMoreRows(!1)}maybeRequestMoreRows(G=!1){let D=this.loadMoreRowsCallback,z=this.currentList;if(!D||!z||this.loadingState===A0)return;let B=this.getGui();if(B.clientHeight<=0)return;let J=(B.scrollHeight-(B.scrollTop+B.clientHeight))/this.getRowHeight(),U=B.scrollTop/this.getRowHeight(),Z=B.scrollHeight>B.clientHeight;if(U<=this.loadMoreRowsThreshold&&(G||!Z))D("up");if(J<=this.loadMoreRowsThreshold)D("down")}getStateAnnouncementText(G){if(G===A0)return this.loadingLabel;if(G===LB&&this.params.allowNoResultsCopy)return this.noMatchesLabel;return}onMouseDown(G){G.preventDefault()}onMouseOut(G){if(!this.getGui().contains(G.relatedTarget))this.highlightIndex(-1)}onClick(G){let{multiSelect:D}=this.params;if(!this.currentList?.length)return;let z=this.getRowForMouseEvent(G),B=this.currentList[z];if(D)this.toggleListItemSelection(B);else this.selectListItems([B]),this.dispatchValueSelected()}dispatchValueSelected(){this.dispatchLocalEvent({type:"richSelectListRowSelected",fromEnterKey:!1,value:this.selectedItems})}destroy(){super.destroy(),this.eStateComp=void 0}};function oq(G){if(!G)return l1;if(G.length)return tq;return LB}var hU=300,rq={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed",children:[{tag:"span",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"span",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},gB=class extends Qq{constructor(G){let D=HJ(G?.valueFormatter),z=G?.agComponents?.includes(vU)?G.agComponents:[vU,...G?.agComponents??[]];super({...G,pickerAriaLabelKey:G?.pickerAriaLabelKey??"ariaLabelRichSelectField",pickerAriaLabelValue:G?.pickerAriaLabelValue??"Rich Select Field",pickerType:G?.pickerType??"ag-list",className:G?.className??"ag-rich-select",pickerIcon:G?.pickerIcon??"richSelectOpen",ariaRole:G?.ariaRole??"combobox",template:G?.template??rq,agComponents:z,modalPicker:G?.modalPicker??!1,valueFormatter:D,maxPickerHeight:G?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"});this.searchString="",this.loadMoreRowsThreshold=10,this.hasPagedAsyncSource=!1,this.searchStringCreator=null,this.eInput=OU,this.eDeselect=OU,this.skipWrapperAnnouncement=!1,this.onPillHorizontalArrowKeyDown=(S)=>{this.handleHorizontalNavigationKey(S)},this.valueFormatter=D;let{value:B,valueList:Q,searchStringCreator:J,onSearch:U}=G??{};if(B!==void 0)this.value=B;if(J)this.searchStringCreator=J;if(Q!=null)this.setValueList({valueList:Q,isInitial:!0});let{searchDebounceDelay:Z=hU}=this.config;if(U)this.onSearchCallbackDebounced=_Q(this,U,Z);this.registerCSS(Oq)}wireBeans(G){this.userCompFactory=G.userCompFactory,this.ariaAnnounce=G.ariaAnnounce,this.registry=G.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0})),super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild(Zq("richSelectRemove",this.beans));let{allowTyping:G,placeholder:D,multiSelect:z,suppressDeselectAll:B,suppressMultiSelectPillRenderer:Q}=this.config;if(this.eDeselect.classList.add("ag-hidden"),G){if(this.eInput.setAutoComplete(!1).setInputPlaceholder(D),!z)this.eDisplayField.classList.add("ag-hidden");else if(this.eWrapper.classList.add("ag-rich-select-typing-multi"),!Q)this.eDisplayField.classList.add("ag-rich-select-pill-display")}else this.eInput.setDisplayed(!1);this.setupAriaProperties();let{searchDebounceDelay:J=300}=this.config;if(this.clearSearchString=_Q(this,this.clearSearchString.bind(this),J),this.renderSelectedValue(),G)this.eInput.onValueChange((U)=>{this.openPickerOnTypingIfNeeded(U),this.updateTypingMultiSelectPlaceholder(U),this.searchTextFromString(U)});if(this.addManagedElementListeners(this.eWrapper,{focus:this.onWrapperFocus.bind(this)}),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)}),!B)this.addManagedElementListeners(this.eDeselect,{mousedown:this.onDeselectAllMouseDown.bind(this),click:this.onDeselectAllClick.bind(this)})}setupAriaProperties(){let{eWrapper:G,gos:D}=this;G.tabIndex=D.get("tabIndex");let z=this.getLocaleTextFunc();this.ariaDeleteSelection=z("ariaLabelRichSelectDeleteSelection","Press DELETE to deselect item"),this.ariaDeselectAllItems=z("ariaLabelRichSelectDeselectAllItems","Press DELETE to deselect all items"),this.ariaToggleSelection=z("ariaLabelRichSelectToggleSelection","Press SPACE to toggle selection")}createListComponent(){this.listComponent=this.createBean(new sq(this.config,this.getFocusableElement(),()=>this.searchString)),this.listComponent.setLoadMoreRowsCallback(this.loadMoreRowsCallback,this.loadMoreRowsThreshold),this.listComponent.setStateAnnouncementCallback((G)=>this.announceAriaValue(G)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:(G)=>{this.onListValueSelected(G.value,G.fromEnterKey)}})}renderSelectedValue(G){let{value:D,eDisplayField:z,config:B,gos:Q}=this,{allowTyping:J,cellRenderer:U,cellRendererParams:Z,initialInputValue:S,multiSelect:X,suppressDeselectAll:Y,suppressMultiSelectPillRenderer:W,onSearch:q}=B,H=this.valueFormatter(D),_=!!(J&&X);if(J){let K=_?S??this.eInput.getValue()??"":S??(D===""?"":H);if(this.eInput.setValue(K,!!G&&!!q),!_)return;this.updateTypingMultiSelectPlaceholder(K)}if(X&&!Y){let K=D==null||Array.isArray(D)&&D.length===0;this.eDeselect.classList.toggle("ag-hidden",K)}let k;if(X&&!W){this.createOrUpdatePillContainer(z);return}if(U&&!J)k=Sq(this.userCompFactory,B,Jq(this.gos,{value:D,valueFormatted:H,cellRendererParams:Z,getValue:()=>this.getValue(),setValue:(K)=>{this.setValue(K,!0)},setTooltip:(K,f)=>{Q.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=f,this.tooltipFeature?.setTooltipAndRefresh(K)}}));let w;if(k)w=k.newAgStackInstance();if(w)HQ(z),h6(w,z),w.then((K)=>{this.addDestroyFunc(()=>this.destroyBean(K))});else{if(D!=null)z.innerText=H,z.classList.remove("ag-display-as-placeholder");else{let{placeholder:K}=B;if($q(K))z.textContent=K,z.classList.add("ag-display-as-placeholder");else HQ(z)}this.shouldDisplayTooltip=Xq(()=>this.eDisplayField),this.tooltipFeature?.setTooltipAndRefresh(H??null)}}createPickerComponent(){let{values:G}=this;if(G)this.setValueList({valueList:G});return this.listComponent}setSearchStringCreator(G){this.searchStringCreator=G}setAsyncValuesSource(G){let{source:D,thresholdRows:z,useAsyncSearch:B,onMisconfiguredSearchSource:Q,onFirstValuesPageLoaded:J}=G;this.asyncRequests?.destroy();let U=kq({host:{setValueList:(Z)=>this.setValueList(Z),setIsLoading:()=>this.setIsLoading()},source:D,useAsyncSearch:B,onMisconfiguredSearchSource:Q,onFirstValuesPageLoaded:J});if(this.asyncRequests=U.controller,this.hasPagedAsyncSource=U.hasPagedSource,U.onSearch){let{searchDebounceDelay:Z=hU}=this.config;this.onSearchCallbackDebounced=_Q(this,U.onSearch,Z)}else if(!this.config.onSearch)this.onSearchCallbackDebounced=void 0;this.setLoadMoreRowsCallback(U.onLoadMoreRows,z??this.loadMoreRowsThreshold)}resetAsyncValues(G=""){if(!this.hasPagedAsyncSource)return;this.asyncRequests?.resetValuesPage(G)}setLoadMoreRowsCallback(G,D=10){this.loadMoreRowsCallback=G,this.loadMoreRowsThreshold=Math.max(D,1),this.listComponent?.setLoadMoreRowsCallback(this.loadMoreRowsCallback,this.loadMoreRowsThreshold)}setIsLoading(){this.listComponent?.setIsLoading()}setValueListInternal(G){let{listComponent:D,isPickerDisplayed:z,value:B}=this,{valueList:Q,refresh:J,isInitial:U,scrollToCurrentValue:Z=!0,prependedRowCount:S=0}=G;if(U)this.setValues(Q);if(!D)return;let X=S>0?D.getScrollTop():void 0;if(S>0)D.offsetHoveredIndexOnPrependedRows(S);if(D.setCurrentList(Q),!J)return;if(z&&X!=null&&S>0)D.restoreScrollOnPrependedRows?.(X,S);if(this.values){D.refresh(!0);let Y=B!=null&&D.getIndicesForValues(B).length>0;if(z&&Y&&Z)D.selectValue(B)}else if(z){if(!D.selectValue(B))D.refresh()}this.alignPickerToComponent()}setValueList(G){let{valueList:D}=G;if(!D||Array.isArray(D)){this.setValueListInternal(G);return}this.listComponent?.setIsLoading(),D.then((z)=>{if(z!==void 0)this.setValueListInternal({...G,valueList:z})}).catch(()=>{this.setValueListInternal({...G,valueList:[],refresh:!0})})}setValues(G){this.values=G,this.searchStrings=this.getSearchStringsFromValues(G||[])}showPicker(){let{listComponent:G,value:D}=this;if(!G)return;super.showPicker();let z=D??null;G.selectValue(z);let B=G.getIndicesForValues(z)[0];if(B!=null)this.tooltipFeature?.attemptToHideTooltip(),G.highlightIndex(B);else G.refresh()}createOrUpdatePillContainer(G){if(!this.pillContainer){let z=this.pillContainer=this.createBean(new vq);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),HQ(G),G.appendChild(z.getGui());let{config:B,eWrapper:Q,ariaDeleteSelection:J}=this;z.init({eWrapper:Q,valueFormatter:this.valueFormatter,onPillMouseDown:(U)=>{U.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(J)},focusAfterDelete:B.allowTyping?()=>this.focusTypingInputAtBoundary():void 0,focusAfterForwardBoundary:B.allowTyping?()=>this.focusTypingInputAtBoundary():void 0,onHorizontalArrowKeyDown:this.onPillHorizontalArrowKeyDown,getValue:()=>this.getValue(),setValue:(U)=>this.setValue(U,!0)})}let D=this.pillContainer.getGui().childElementCount;this.doWhileBlockingAnnouncement(()=>this.pillContainer?.refresh()),this.scrollTypingMultiSelectPillsToEndOnAdd(D)}scrollTypingMultiSelectPillsToEndOnAdd(G){let{allowTyping:D,multiSelect:z,suppressMultiSelectPillRenderer:B}=this.config;if(!D||!z||B)return;let Q=this.pillContainer?.getGui();if(!Q||Q.childElementCount<=G)return;jU(Q,Q.scrollWidth,this.isRtl())}doWhileBlockingAnnouncement(G){this.skipWrapperAnnouncement=!0,G(),this.skipWrapperAnnouncement=!1}isPreviousHorizontalNavigation(G){return G===o.LEFT!==this.isRtl()}isRtl(){return!!this.gos?.get("enableRtl")}isTypingInputAtPillBoundary(){let G=this.eInput.getInputElement(),{selectionStart:D,selectionEnd:z,value:B}=G;if(D==null||z==null||D!==z)return!1;return this.isRtl()?D===(B??"").length:D===0}focusTypingInputAtBoundary(){let G=this.eInput.getInputElement();G.focus();let D=this.isRtl()?G.value.length:0;G.setSelectionRange(D,D)}getActiveElementForKeyboardNavigation(){if(this.beans?.eRootDiv)return uU(this.beans);let G=this.getTypingInputElement();if(!G)return document.activeElement;return G.ownerDocument?.activeElement??document.activeElement}onWrapperFocus(){let{eInput:G,config:D}=this,{allowTyping:z,multiSelect:B,suppressDeselectAll:Q}=D;if(z){let J=G.getFocusableElement();J.focus(),J.select()}else if(B&&!Q&&!this.skipWrapperAnnouncement)this.announceAriaValue(this.ariaDeselectAllItems)}onWrapperFocusOut(G){if(!this.eWrapper.contains(G.relatedTarget))this.hidePicker()}onDeselectAllMouseDown(G){G.stopImmediatePropagation()}onDeselectAllClick(){this.setValue([],!0)}buildSearchStringFromKeyboardEvent(G){let{key:D}=G;if(D===o.BACKSPACE)this.searchString=this.searchString.slice(0,-1),D="";else if(!Yq(G))return;G.preventDefault(),this.searchTextFromCharacter(D)}searchTextFromCharacter(G){this.searchString+=G,this.runSearch(),this.clearSearchString()}searchTextFromString(G){if(G==null)G="";if(this.searchString=G,this.onSearchCallbackDebounced)this.setValueList({valueList:void 0,refresh:!0});this.runSearch()}getSearchStringsFromValues(G){if(typeof G[0]==="object"&&this.searchStringCreator)return this.searchStringCreator(G);return G.map((D)=>D===""?"":this.valueFormatter(D))}filterListModel(G){let{filterList:D}=this.config;if(!D)return;this.setValueList({valueList:G,refresh:!0})}runSearch(){if(!this.listComponent)return;if(this.onSearchCallbackDebounced){this.onSearchCallbackDebounced(this.searchString);return}let G=this.searchStrings;if(!G){this.listComponent.highlightIndex(-1);return}let{suggestions:D,filteredValues:z}=this.getSuggestionsAndFilteredValues(this.searchString,G),{filterList:B,highlightMatch:Q,searchType:J="fuzzy"}=this.config,U=!!(B&&this.searchString!=="");if(this.filterListModel(U?z:this.values||[]),!this.highlightEmptyValue())this.highlightListValue(D,z,U);if(Q&&J!=="fuzzy")this.listComponent?.highlightFilterMatch(this.searchString);this.listComponent?.toggleVisibility()}highlightEmptyValue(){if(this.searchString===""){let G=this.searchStrings?.indexOf("");if(G!==void 0&&G!==-1)return this.listComponent?.highlightIndex(G),!0}return!1}highlightListValue(G,D,z){if(G.length){let B=z?0:this.searchStrings?.indexOf(G[0]);if(B!==void 0)this.listComponent?.highlightIndex(B)}else if(this.listComponent?.highlightIndex(-1),!z||D.length)this.listComponent?.ensureIndexVisible(0);else if(z){let B=this.getFocusableElement();Uq(B,"data-active-option",null),qq(B,null)}}getSuggestionsAndFilteredValues(G,D){let z=[],B=[];if(!G.length)return{suggestions:z,filteredValues:B};let{searchType:Q="fuzzy",filterList:J}=this.config,U=this.values||[];if(Q==="fuzzy"){let Z=Lq({inputValue:G,allSuggestions:D,hideIrrelevant:!0});z=Z.values;let S=Z.indices;if(J&&S.length)for(let X=0;X{let X=Z.toLocaleLowerCase(),Y=this.searchString.toLocaleLowerCase(),W=Q==="match"?X.startsWith(Y):X.includes(Y);if(J&&W)B.push(U[S]);return W});return{suggestions:z,filteredValues:B}}clearSearchString(){this.searchString=""}setValue(G,D,z,B){if(this.value===G)return this.updateTypingMultiSelectPlaceholder(),this;let Q=Array.isArray(G);if(G!=null){if(!Q){if(!this.listComponent?.getIndicesForValues(G)?.length)return this}if(!z)this.listComponent?.selectValue(G)}if(super.setValue(G,D),!B)this.renderSelectedValue(z);else this.updateTypingMultiSelectPlaceholder();return this}onNavigationKeyDown(G,D,z){G.preventDefault();let B=D===o.DOWN;if(!this.isPickerDisplayed&&B){this.showPicker();return}this.listComponent?.onNavigationKeyDown(D,z)}onEnterKeyDown(G){let D=!!(this.config.allowTyping&&this.config.multiSelect);if(!this.isPickerDisplayed){if(D)G.preventDefault(),this.dispatchPickerEventAndHidePicker(this.value,!0);return}if(G.preventDefault(),this.listComponent?.getCurrentList()){let z=this.listComponent.getLastItemHovered();if(D){if(z!==void 0){let B=this.getCurrentSelectionWithAppendedItem(z);this.listComponent.selectValue(B),this.setValue(B,!1,!0),this.resetTypingMultiSelectSearchState(),this.hidePicker()}return}if(this.config.multiSelect||z===void 0)this.dispatchPickerEventAndHidePicker(this.value,!0);else this.onListValueSelected(new Set([z]),!0)}}getCurrentSelectionWithAppendedItem(G){let D=this.getValue(),z=Array.isArray(D)?[...D]:D!=null?[D]:[];if(!z.some((B)=>this.areValuesEquivalent(B,G)))z.push(G);return z}areValuesEquivalent(G,D){if(G===D)return!0;if(typeof G==="object"&&typeof D==="object"&&G!=null&&D!=null)return this.valueFormatter(G)===this.valueFormatter(D);return!1}resetTypingMultiSelectSearchState(){if(this.searchString="",this.eInput.setValue("",!0),this.onSearchCallbackDebounced){this.setValueList({valueList:void 0,refresh:!0});return}if(this.config.filterList&&this.values)this.setValueList({valueList:this.values,refresh:!0})}updateTypingMultiSelectPlaceholder(G){let{allowTyping:D,multiSelect:z,placeholder:B}=this.config;if(!D||!z)return;let Q=G??this.eInput.getValue()??"",J=Q.length>0,U=this.value,Z=(Array.isArray(U)?U.length>0:U!=null)||(this.listComponent?.getSelectedItems().size??0)>0,S=!J&&!Z?B:"";this.eInput.setInputPlaceholder(S),this.updateTypingMultiSelectInputSize(Q,S)}updateTypingMultiSelectInputSize(G,D){let z=this.getTypingInputElement();if(!z)return;let Q=Math.max(1,Math.min((G||D||"").length+1,32));if(z.size!==Q)z.size=Q;if(G){let J=this.pillContainer?.getGui();if(J)jU(J,J.scrollWidth,this.isRtl())}}getTypingInputElement(){let G=this.eInput.getInputElement;if(typeof G!=="function")return;return G.call(this.eInput)}openPickerOnTypingIfNeeded(G){let{isPickerDisplayed:D,config:{allowTyping:z,multiSelect:B}}=this;if(z&&B&&!D&&!!G)this.showPicker()}onDeleteKeyDown(G){let{eWrapper:D,beans:z}=this;if(uU(z)===D)G.preventDefault(),this.setValue([],!0)}onBackspaceKeyDown(G){if(!this.isTypingInputAtPillBoundary())return;let D=this.getValue(),z=Array.isArray(D)?D:D!=null?[D]:Array.from(this.listComponent?.getSelectedItems()??[]);if(!z.length)return;G.preventDefault(),this.setValue(z.slice(0,-1),!0)}onTabKeyDown(){let{config:G,isPickerDisplayed:D,listComponent:z}=this,{multiSelect:B}=G;if(!D||!z)return;if(B){let Q=this.getValueFromSet(z.getSelectedItems());if(Q)this.setValue(Q,!1,!0,!0)}else{let Q=z.getLastItemHovered();if(Q!==void 0)this.setValue(Q,!1,!0)}this.hidePicker()}getValueFromSet(G){let{multiSelect:D}=this.config;if(!D)return G.size?G.values().next().value:null;let z=Array.from(G);return z.length?z:null}onListValueSelected(G,D){let z=this.getValueFromSet(G);this.setValue(z,!1,!0);let{multiSelect:B,allowTyping:Q}=this.config;if(B&&Q)this.resetTypingMultiSelectSearchState(),this.hidePicker();else if(!B)this.dispatchPickerEventAndHidePicker(z,D)}dispatchPickerEventAndHidePicker(G,D){let z={type:"fieldPickerValueSelected",fromEnterKey:D,value:G};this.dispatchLocalEvent(z),this.hidePicker()}getFocusableElement(){let{allowTyping:G}=this.config;if(G)return this.eInput.getFocusableElement();return super.getFocusableElement()}handleHorizontalNavigationKey(G){let{allowTyping:D,multiSelect:z}=this.config;if(!D){G.preventDefault(),this.listComponent?.highlightIndex(-1),this.pillContainer?.onNavigationKeyDown(G);return}let B=this.pillContainer;if(!B)return;if(!z)return;let Q=this.getActiveElementForKeyboardNavigation(),J=this.isPreviousHorizontalNavigation(G.key),U=this.eInput.getInputElement();if(Q===U){if(J&&this.isTypingInputAtPillBoundary())this.listComponent?.highlightIndex(-1),B.onNavigationKeyDown(G);return}if(B.getGui().contains(Q)){this.listComponent?.highlightIndex(-1);let Z=Q;if(B.onNavigationKeyDown(G),!J&&this.getActiveElementForKeyboardNavigation()===Z)this.focusTypingInputAtBoundary()}}handlePageNavigationKey(G,D){let{allowTyping:z}=this.config;if(z&&(D===o.PAGE_HOME||D===o.PAGE_END)){G.preventDefault();let B=this.eInput.getInputElement(),Q=D===o.PAGE_HOME?0:B.value.length;B.setSelectionRange(Q,Q);return}if(G.preventDefault(),this.pickerComponent)this.listComponent?.navigateToPage(D)}handleVerticalNavigationKey(G,D,z){if(z)return;this.onNavigationKeyDown(G,D,()=>{if(this.config.multiSelect)this.doWhileBlockingAnnouncement(()=>this.eWrapper.focus()),this.announceAriaValue(this.ariaToggleSelection)})}handleEscapeKey(G){if(!this.isPickerDisplayed)return;if(Wq(this.listComponent.getGui()))G.preventDefault(),Hq(G);this.hidePicker()}handleEnterKey(G,D){if(D){G.preventDefault();return}this.onEnterKeyDown(G)}handleSpaceKey(G,D){let{allowTyping:z,multiSelect:B}=this.config,{isPickerDisplayed:Q,listComponent:J}=this,U=!D&&Q&&B&&!!J&&(!z||(this.eInput.getValue()??"")==="");if(!z||D||U)G.preventDefault();if(U&&J){let Z=J.getLastItemHovered();if(Z!==void 0)J.toggleListItemSelection(Z)}}handleBackspaceKey(G,D){if(!D&&this.config.allowTyping&&this.config.multiSelect)this.onBackspaceKeyDown(G)}handleDeleteKey(G){if(this.config.multiSelect&&!this.config.suppressDeselectAll)this.onDeleteKeyDown(G)}handleSearchWithoutTyping(G){if(!this.config.allowTyping)this.buildSearchStringFromKeyboardEvent(G)}onKeyDown(G){let{key:D,isComposing:z}=G;switch(D){case o.LEFT:case o.RIGHT:this.handleHorizontalNavigationKey(G);break;case o.PAGE_HOME:case o.PAGE_END:case o.PAGE_UP:case o.PAGE_DOWN:this.handlePageNavigationKey(G,D);break;case o.DOWN:case o.UP:this.handleVerticalNavigationKey(G,D,z);break;case o.ESCAPE:this.handleEscapeKey(G);break;case o.ENTER:this.handleEnterKey(G,z);break;case o.SPACE:this.handleSpaceKey(G,z);break;case o.BACKSPACE:this.handleBackspaceKey(G,z);break;case o.TAB:this.onTabKeyDown();break;case o.DELETE:this.handleDeleteKey(G);break;default:this.handleSearchWithoutTyping(G)}}announceAriaValue(G){this.ariaAnnounce?.announceValue(G,"richSelect")}destroy(){if(this.asyncRequests?.destroy(),this.asyncRequests=void 0,this.hasPagedAsyncSource=!1,this.listComponent)this.listComponent=this.destroyBean(this.listComponent);this.searchStrings=void 0,super.destroy()}};function h6(G,D){G.then((z)=>{let B=z.getGui();if(B!=null)D.appendChild(B)})}function HJ(G){return(D)=>G?.(D)??String(D??"")}var aq={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},i6=class extends gB{constructor(G){super({...G,template:aq,agComponents:[eW]});this.params=G}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();let{wrapperClassName:G,ariaLabel:D}=this.params;if(zq(this.eDisplayField,!1),G)this.eWrapper.classList.add(G);Dq(this.eWrapper,""),Gq(this.eWrapper,D)}onEnterKeyDown(G){if(Bq(G),this.isPickerDisplayed)super.onEnterKeyDown(G);else G.preventDefault(),this.showPicker()}},n6=class extends eq{constructor(G,D,z){super();this.eGui=G,this.focusWrapper=D,this.eFocusableComp=z}postConstruct(){this.addManagedElementListeners(this.eGui,{keydown:(D)=>{switch(D.key){case Ez.TAB:if(!D.defaultPrevented)R0(D);break;case Ez.UP:case Ez.DOWN:R0(D);break;case Ez.ESCAPE:if(nU(D))return;if(this.eGui.contains(iU(this.beans)))D.preventDefault(),R0(D),this.focusWrapper.focus();break}}});let G="ag-advanced-filter-builder-virtual-list-item-highlight";this.addManagedListeners(this.focusWrapper,{keydown:(D)=>{if(D.key===Ez.ENTER){if(nU(D))return;if(iU(this.beans)===this.focusWrapper)D.preventDefault(),R0(D),this.eFocusableComp.getFocusableElement().focus()}},focusin:()=>{this.focusWrapper.classList.add(G)},focusout:(D)=>{if(!this.focusWrapper.contains(D.relatedTarget))this.focusWrapper.classList.remove(G)}})}};function d6(G,D){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:G("advancedFilterBuilderAddCondition")},{key:"join",displayValue:G("advancedFilterBuilderAddJoin")}],valueFormatter:(z)=>z==null?"":z.displayValue??z.key,pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${D??120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:G("advancedFilterBuilderAddButtonTooltip")}}var GH={tag:"div",cls:"ag-advanced-filter-builder-item-wrapper",role:"presentation",children:[{tag:"div",ref:"eItem",cls:"ag-advanced-filter-builder-item",role:"presentation",children:[{tag:"div",cls:"ag-advanced-filter-builder-item-tree-lines",attrs:{"aria-hidden":"true"},children:[{tag:"div",cls:"ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal"}]}]}]},DH=class extends sW{constructor(G,D){super(GH);this.item=G,this.focusWrapper=D,this.eItem=oW}wireBeans(G){this.advFilterExpSvc=G.advFilterExpSvc,this.registry=G.registry}postConstruct(){aW(this.focusWrapper,2);let G=d6((z)=>this.advFilterExpSvc.translate(z),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),D=this.createManagedBean(new i6(G));this.addManagedListeners(D,{fieldPickerValueSelected:({value:z})=>{this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:z.key==="join"})}}),this.eItem.appendChild(D.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>D.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new n6(this.getGui(),this.focusWrapper,D)),rW(this.focusWrapper,this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}},SH=class extends ZH{constructor(){super({tag:"div",cls:"ag-advanced-filter-builder-item-condition",role:"presentation"});this.validationMessage=null}wireBeans(G){this.advFilterExpSvc=G.advFilterExpSvc}init(G){let{item:D,createPill:z}=G;this.item=D,this.createPill=z,this.filterModel=D.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advFilterExpSvc.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(G){let D=this.advFilterExpSvc.getColumnDetails(G.colId);if(this.baseCellDataType=D.baseCellDataType,this.column=D.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:this.getColumnDisplayValue()??this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getColumnAutocompleteEntries()}),update:(z)=>this.setColumnKey(z),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),Mz(this.getColumnKey())){if(this.createOperatorPill(),this.hasOperand())this.createOperandPill()}}createOperatorPill(){this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:this.getOperatorDisplayValue()??this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:(G)=>this.setOperatorKey(G),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){let{filter:G}=this.filterModel,D=(typeof G==="number"||typeof G==="bigint"?LH(G):G)??"";this.eOperandPill=this.createPill({key:D,valueFormatter:(z)=>this.advFilterExpSvc.getOperandDisplayValue({...this.filterModel,filter:z},!0),baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:(z)=>this.setOperand(z),ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advFilterExpSvc.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advFilterExpSvc.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advFilterExpSvc.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advFilterExpSvc.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(G){if(!this.eOperatorPill)this.createOperatorPill();let D=this.advFilterExpSvc.getColumnDetails(G);this.column=D.column;let z=D.baseCellDataType;if(this.baseCellDataType!==z){if(this.baseCellDataType=z,this.setOperatorKey(void 0),this.eOperatorPill)$H(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill();this.validate()}this.filterModel.colId=G,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(G){let D=this.getNumOperands(G);if(D!==this.numOperands){if(this.numOperands=D,D===0)this.destroyOperandPill();else if(this.createOperandPill(),this.baseCellDataType!=="number")this.setOperand("")}this.filterModel.type=G,this.validate()}setOperand(G){let D=G;if(this.baseCellDataType==="number")D=Mz(G)?Number(G):"";this.filterModel.filter=D,this.validate()}getNumOperands(G){return this.advFilterExpSvc.getExpressionOperator(this.baseCellDataType,G)?.numOperands??0}destroyOperandPill(){delete this.filterModel.filter,this.eOperandPill?.getGui().remove(),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let G=null;if(!Mz(this.getColumnKey()))G=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectColumn");else if(!Mz(this.getOperatorKey()))G=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectOption");else if(this.numOperands>0&&!Mz(this.getOperandDisplayValue()))G=this.advFilterExpSvc.translate("advancedFilterBuilderValidationEnterValue");if(this.item.valid=!G,G!==this.validationMessage)this.validationMessage=G,this.dispatchLocalEvent({type:"advancedFilterBuilderValidChanged"})}getDefaultColumnDisplayValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectOption")}},_H={number:[XH],bigint:[v0],boolean:[v0],object:[v0],text:[v0],date:[b0],dateString:[b0],dateTime:[b0,(G)=>G.setIncludeTime(!0)],dateTimeString:[b0,(G)=>G.setIncludeTime(!0)]},kH={tag:"div",cls:"ag-advanced-filter-builder-pill-wrapper",role:"presentation",children:[{tag:"div",ref:"ePill",cls:"ag-advanced-filter-builder-pill",role:"button",children:[{tag:"span",ref:"eLabel",cls:"ag-advanced-filter-builder-pill-display"}]}]},wH=class extends YH{constructor(G){super(kH);this.params=G,this.ePill=mU,this.eLabel=mU;let{value:D,valueFormatter:z}=G;this.value=D,this.displayValue=z(D)}wireBeans(G){this.advFilterExpSvc=G.advFilterExpSvc}postConstruct(){let{cssClass:G,ariaLabel:D}=this.params;this.ePill.classList.add(G),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,qH(this.ePill,this.eLabel.id),HH(this.ePill,D),this.renderValue(),this.addManagedListeners(this.ePill,{click:(z)=>{z.preventDefault(),this.showEditor()},keydown:(z)=>{if(z.key===NQ.ENTER)z.preventDefault(),FQ(z),this.showEditor()}}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;tU(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);let G=this.eEditor.getGui();this.eEditor.addManagedElementListeners(G,{keydown:(D)=>{switch(D.key){case NQ.ENTER:D.preventDefault(),FQ(D),this.updateValue(!0);break;case NQ.ESCAPE:D.preventDefault(),FQ(D),this.hideEditor(!0);break}},focusout:()=>this.updateValue(!1)}),this.getGui().appendChild(G),this.eEditor.getFocusableElement().focus()}createEditorComp(G){let[D,z]=_H[G],B=this.createBean(new D);return z?.(B),B}hideEditor(G){let{eEditor:D}=this;if(!D)return;if(this.eEditor=void 0,D.getGui().remove(),this.destroyBean(D),tU(this.ePill,!0),G)this.ePill.focus()}renderValue(){let G,{displayValue:D,eLabel:z,params:B}=this,{type:Q}=B,{classList:J}=z;if(J.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),!WH(D))G=this.advFilterExpSvc.translate("advancedFilterBuilderEnterValue"),J.add("ag-advanced-filter-builder-value-empty");else if(Q==="number"||Q==="bigint")G=D,J.add("ag-advanced-filter-builder-value-number");else G=`"${D}"`,J.add("ag-advanced-filter-builder-value-text");z.textContent=G}updateValue(G){if(!this.eEditor)return;let D=this.eEditor.getValue()??"";this.dispatchLocalEvent({type:"fieldValueChanged",value:D}),this.value=D,this.displayValue=this.params.valueFormatter(D),this.renderValue(),this.hideEditor(G)}},fH=class extends KH{wireBeans(G){this.advFilterExpSvc=G.advFilterExpSvc}constructor(){super({tag:"div",cls:"ag-advanced-filter-builder-item-condition",role:"presentation"})}init(G){let{item:D,createPill:z}=G,B=D.filterModel;this.filterModel=B,this.ePill=z({key:B.type,displayValue:this.advFilterExpSvc.parseJoinOperator(B),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getJoinOperatorAutocompleteEntries()}),update:(Q)=>B.type=Q,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advFilterExpSvc.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}},MH={tag:"div",cls:"ag-picker-field ag-advanced-filter-builder-pill-wrapper",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display ag-advanced-filter-builder-pill-display"},{tag:"ag-input-text-field",ref:"eInput",cls:"ag-rich-select-field-input"},{tag:"span",ref:"eDeselect",cls:"ag-rich-select-deselect-button ag-picker-field-icon",role:"presentation"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},AH=class extends gB{constructor(G){super({...G,template:MH,agComponents:[NH]});this.params=G}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();let{wrapperClassName:G,ariaLabel:D}=this.params;this.eWrapper.classList.add(G),EH(this.eWrapper,""),FH(this.eWrapper,D)}createPickerComponent(){if(!this.values){let{values:G}=this.params.getEditorParams();this.values=G;let D=this.value.key,z=G.find((B)=>B.key===D)??{key:D,displayValue:this.value.displayValue};this.value=z}return super.createPickerComponent()}onEnterKeyDown(G){if(IH(G),this.isPickerDisplayed)super.onEnterKeyDown(G);else G.preventDefault(),this.showPicker()}},RH={tag:"div",cls:"ag-advanced-filter-builder-item-wrapper",role:"presentation",children:[{tag:"div",cls:"ag-advanced-filter-builder-item",role:"presentation",children:[{tag:"div",ref:"eTreeLines",cls:"ag-advanced-filter-builder-item-tree-lines",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eValidation",cls:"ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid",attrs:{"aria-hidden":"true"}}]},{tag:"div",ref:"eButtons",cls:"ag-advanced-filter-builder-item-buttons",children:[{tag:"span",ref:"eMoveUpButton",cls:"ag-advanced-filter-builder-item-button",role:"button"},{tag:"span",ref:"eMoveDownButton",cls:"ag-advanced-filter-builder-item-button",role:"button"},{tag:"div",ref:"eAddButton",role:"presentation"},{tag:"span",ref:"eRemoveButton",cls:"ag-advanced-filter-builder-item-button",role:"button"}]}]},EQ=class extends BH{constructor(G,D,z){super(RH);this.item=G,this.dragFeature=D,this.focusWrapper=z,this.eTreeLines=rG,this.eDragHandle=rG,this.eButtons=rG,this.eValidation=rG,this.eMoveUpButton=rG,this.eMoveDownButton=rG,this.eAddButton=rG,this.eRemoveButton=rG,this.moveUpDisabled=!1,this.moveDownDisabled=!1}wireBeans(G){this.dragAndDrop=G.dragAndDrop,this.advFilterExpSvc=G.advFilterExpSvc,this.registry=G.registry}postConstruct(){let{filterModel:G,level:D,showMove:z}=this.item,B=G.filterType==="join";if(this.ePillWrapper=this.createManagedBean(B?new fH:new SH),this.ePillWrapper.init({item:this.item,createPill:(Q)=>this.createPill(Q)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),D===0){let Q=dU({tag:"div",cls:"ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-bottom ag-advanced-filter-builder-item-tree-line-root"});this.eTreeLines.appendChild(Q),V0(this.eDragHandle,!1),V0(this.eButtons,!1),pU(this.focusWrapper,!0)}else this.setupTreeLines(D),this.eDragHandle.appendChild(Iz("advancedFilterBuilderDrag",this.beans)),this.setupValidation(),this.setupMoveButtons(z),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();JH(this.focusWrapper,D+1),this.initialiseTabGuard({}),this.createManagedBean(new n6(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListeners(this.ePillWrapper,{advancedFilterBuilderValueChanged:()=>this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}),advancedFilterBuilderValidChanged:()=>this.updateValidity()})}setState(G){let{level:D}=this.item;if(D===0)return;let{showMove:z}=this.item,{disableMoveUp:B,disableMoveDown:Q,treeLines:J,showStartTreeLine:U}=G;if(this.updateTreeLines(J,U),this.updateAriaExpanded(),z)this.moveUpDisabled=!!B,this.moveDownDisabled=!!Q,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",B),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",Q),lU(this.eMoveUpButton,!!B),lU(this.eMoveDownButton,!!Q),this.moveUpTooltipFeature?.refreshTooltip(),this.moveDownTooltipFeature?.refreshTooltip()}focusMoveButton(G){(G?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(G){for(let D=0;Dthis.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1000})),this.updateValidity()}setupAddButton(){let G=d6((z)=>this.advFilterExpSvc.translate(z),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),D=this.createManagedBean(new i6(G));this.addManagedListeners(D,{fieldPickerValueSelected:({value:z})=>this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:z.key==="join"})}),this.eAddButton.appendChild(D.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(Iz("advancedFilterBuilderRemove",this.beans)),this.addManagedListeners(this.eRemoveButton,{click:()=>this.removeItem(),keydown:(G)=>{if(G.key===KQ.ENTER)G.preventDefault(),fQ(G),this.removeItem()}}),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")})),C0(this.eRemoveButton,this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(G){if(G)this.eMoveUpButton.appendChild(Iz("advancedFilterBuilderMoveUp",this.beans)),this.addManagedListeners(this.eMoveUpButton,{click:()=>this.moveItem(!0),keydown:(D)=>{if(D.key===KQ.ENTER)D.preventDefault(),fQ(D),this.moveItem(!0)}}),this.moveUpTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")})),C0(this.eMoveUpButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(Iz("advancedFilterBuilderMoveDown",this.beans)),this.addManagedListeners(this.eMoveDownButton,{click:()=>this.moveItem(!1),keydown:(D)=>{if(D.key===KQ.ENTER)D.preventDefault(),fQ(D),this.moveItem(!1)}}),this.moveDownTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")})),C0(this.eMoveDownButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton]);else V0(this.eMoveUpButton,!1),V0(this.eMoveDownButton,!1)}updateValidity(){UH(this.eValidation,!this.item.valid),this.validationTooltipFeature?.refreshTooltip(),this.updateAriaLabel()}createPill(G){let{key:D,cssClass:z,update:B,ariaLabel:Q}=G,J=(U)=>{if(U==null)return;B(U),this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"})};if(G.isSelect){let{getEditorParams:U,pickerAriaLabelKey:Z,pickerAriaLabelValue:S,displayValue:X}=G,Y=this.gos.get("advancedFilterBuilderParams"),W=`${Y?.pillSelectMinWidth??140}px`,q=`${Y?.pillSelectMaxWidth??200}px`,H=this.createBean(new AH({pickerAriaLabelKey:Z,pickerAriaLabelValue:S,pickerType:"ag-list",value:{key:D,displayValue:X},valueFormatter:(_)=>_==null?"":_.displayValue??_.key,variableWidth:!0,minPickerWidth:W,maxPickerWidth:q,getEditorParams:U,wrapperClassName:z,ariaLabel:Q,pickerIcon:"advancedFilterBuilderSelectOpen"}));return this.addManagedListeners(H,{fieldPickerValueSelected:({value:_})=>J(_?.key)}),H}else{let{baseCellDataType:U,valueFormatter:Z}=G,S=this.createBean(new wH({value:D,valueFormatter:Z,cssClass:z,type:U,ariaLabel:Q}));return this.addManagedListeners(S,{fieldValueChanged:({value:X})=>J(X)}),S}}setupDragging(){let G={type:zH.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>"notAllowed",getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragStarted",item:this.item}),onDragStopped:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragEnded"})};this.dragAndDrop.addDragSource(G,!0),this.addDestroyFunc(()=>this.dragAndDrop.removeDragSource(G))}updateAriaLabel(){let G=this.ePillWrapper.getAriaLabel(),D=`${this.item.level+1}`,z=this.ePillWrapper.getValidationMessage(),B;if(z)B=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItemValidation",[G,D,z]);else B=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[G,D]);C0(this.focusWrapper,B)}updateAriaExpanded(){QH(this.focusWrapper);let{filterModel:G}=this.item;if(G?.filterType==="join"&&G.conditions.length)pU(this.focusWrapper,!0)}removeItem(){this.dispatchLocalEvent({type:"advancedFilterBuilderRemoved",item:this.item})}moveItem(G){this.dispatchLocalEvent({type:"advancedFilterBuilderMoved",item:this.item,backwards:G})}},CH={apply:"advancedFilterBuilderApply",clear:"advancedFilterBuilderClear",cancel:"advancedFilterBuilderCancel",reset:"advancedFilterBuilderReset"},VH={tag:"div",cls:"ag-advanced-filter-builder",role:"presentation",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eList",cls:"ag-advanced-filter-builder-list",role:"presentation"}]},bH=class extends hW{constructor(){super(VH);this.eList=nW}wireBeans(G){this.filterManager=G.filterManager,this.advancedFilter=G.advancedFilter,this.advFilterExpSvc=G.advFilterExpSvc}postConstruct(){let G=this.gos.get("advancedFilterBuilderParams");this.params={buttons:["apply","cancel"],...G},this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:D})=>{this.params.showMoveButtons=!!D?.showMoveButtons,this.params.buttons=D?.buttons??["apply","cancel"],this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new tW(this,this.virtualList)),this.resetButtonsPanel(this.params.buttons)}refresh(){let G=this.virtualList,D=G.getLastFocusedRow();if(this.setupFilterModel(),this.validateItems(),this.refreshList(!1),D!=null){if(!G.getComponentAt(D))D=0;G.focusRow(D)}}getNumItems(){return this.items.length}moveItem(G,D){if(!D||!G)return;this.moveItemToIndex(G,D.rowIndex,D.position)}afterGuiAttached(){this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}setupVirtualList(){let G=this.virtualList=this.createManagedBean(new Lz({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderList"),moveItemCallback:this.virtualListMoveItemCallback.bind(this)}));G.setComponentCreator(this.createItemComponent.bind(this)),G.setComponentUpdater(this.updateItemComponent.bind(this)),G.setRowHeight(40),this.eList.appendChild(G.getGui()),G.setModel({getRowCount:()=>this.items?.length||0,getRow:(D)=>this.items[D],areRowsEqual:(D,z)=>D===z}),this.buildList(),G.refresh()}resetButtonsPanel(G){let D=G&&G.length>0,z=this.eButtons;if(D){let B=G.map((J)=>({type:J,label:this.advFilterExpSvc.translate(CH[J])}));if(!z){z=this.createBean(new iW),this.appendChild(z.getGui());let J=(U)=>({event:Z})=>{this.updateModel(U),this.afterAction(U,Z)};z.addManagedListeners(z,{apply:J("apply"),clear:J("clear"),reset:J("reset"),cancel:J("cancel")}),this.eButtons=z}z.updateButtons(B);let Q=z.getApplyButton();if(Q){let J=(U)=>this.toggleCss("ag-advanced-filter-builder-validation",U);this.addManagedElementListeners(Q,{mouseenter:()=>J(!0),mouseleave:()=>J(!1)})}}else if(z)lW(z.getGui()),this.eButtons=this.destroyBean(z)}updateModel(G){switch(G){case"apply":this.advancedFilter.setModel(this.filterModel),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"reset":this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:"advancedFilter"});break;case"cancel":break;case"clear":this.filterModel=this.formatFilterModel(null),this.refreshList(!1);break}}afterAction(G,D){switch(G){case"apply":{D?.preventDefault(),this.close();break}case"reset":{this.close();break}case"cancel":{this.close();break}}}removeItemFromParent(G){let D=G.parent.conditions.indexOf(G.filterModel);return G.parent.conditions.splice(D,1),D}moveItemToIndex(G,D,z){let B=this.items[D],Q=B.filterModel?.filterType==="join"&&z==="bottom",J=Q?B.filterModel:B.parent;if(!J)return;if(this.isChildOrSelf(J,G.filterModel)||B===G)return;this.removeItemFromParent(G);let U;if(Q)U=0;else if(U=J.conditions.indexOf(B.filterModel),U===-1)U=J.conditions.length;else if(z==="bottom")U+=1;J.conditions.splice(U,0,G.filterModel),this.refreshList(!1)}isChildOrSelf(G,D){return G===D||D.filterType==="join"&&D.conditions.some((z)=>this.isChildOrSelf(G,z))}setupFilterModel(){let G=this.formatFilterModel(this.advancedFilter.getModel());return this.stringifiedModel=JSON.stringify(G),G}formatFilterModel(G){if(G=G??{filterType:"join",type:"AND",conditions:[]},G.filterType!=="join")G={filterType:"join",type:"AND",conditions:[G]};return G}buildList(){let G=(D,z,B,Q)=>{if(z.push({filterModel:D,level:B,parent:Q,valid:!0,showMove:this.params.showMoveButtons}),D.filterType==="join"){for(let J of D.conditions)G(J,z,B+1,D);if(B===0)z.push({filterModel:null,level:B+1,parent:D,valid:!0})}};this.items=[],G(this.filterModel,this.items,0)}refreshList(G){if(!G){let D=[];for(let z of this.items)if(!z.valid)D.push(z.filterModel);if(this.buildList(),D.length){for(let z of this.items)if(z.filterModel&&D.includes(z.filterModel))z.valid=!1}}this.virtualList.refresh(G),this.validate()}updateItemComponent(G,D){let z=this.items.indexOf(G),B=(Z,S)=>{let Y=this.items.find((W)=>W.filterModel===Z)?.parent;if(Y){let{conditions:W}=Y;B(Y,S),S.push(W[W.length-1]===Z)}},Q=[],{filterModel:J}=G;if(J)B(J,Q),Q[0]=!1;let U=J?.filterType==="join"&&!!J.conditions.length;D.setState({disableMoveUp:z===1,disableMoveDown:!this.canMoveDown(G,z),treeLines:Q,showStartTreeLine:U})}createItemComponent(G,D){let z=this.createBean(G.filterModel?new EQ(G,this.dragFeature,D):new DH(G,D));if(z.addManagedListeners(z,{advancedFilterBuilderRemoved:({item:B})=>this.removeItem(B),advancedFilterBuilderValueChanged:()=>this.validate(),advancedFilterBuilderAdded:({item:B,isJoin:Q})=>this.addItem(B,Q),advancedFilterBuilderMoved:({item:B,backwards:Q})=>this.moveItemUpDown(B,Q)}),z instanceof EQ)this.updateItemComponent(G,z);return z}addItem(G,D){let{parent:z,level:B,filterModel:Q}=G,J=Q?.filterType==="join",U=D?{filterType:"join",type:"AND",conditions:[]}:{},Z=J?Q:z,S=J?0:Z.conditions.indexOf(Q);if(S>=0){if(!J)S+=1;Z.conditions.splice(S,0,U)}else Z.conditions.push(U);let X=this.items.indexOf(G),Y=X>=0;if(Y){if(G.filterModel)X++;let W=[{filterModel:U,level:J?B+1:B,parent:Z,valid:D,showMove:this.params.showMoveButtons}];this.items.splice(X,0,...W)}if(this.refreshList(Y),Y)this.virtualList.getComponentAt(X)?.afterAdd()}removeItem(G){let D=G.parent,{filterModel:z}=G,B=D.conditions.indexOf(z);D.conditions.splice(B,1);let Q=G.filterModel?.filterType==="join",J=this.items.indexOf(G),U=!Q&&J>=0;if(U)this.items.splice(J,1);if(this.refreshList(U),J>=0)this.virtualList.focusRow(J)}moveItemUpDown(G,D,z){let B=this.items.indexOf(G),Q=D?B-1:B+1;if(Q===0||!D&&!this.canMoveDown(G,B))return;let J=this.items[Q],U=this.removeItemFromParent(G),{level:Z,filterModel:S,parent:X}=G,{level:Y,filterModel:W,parent:q}=J;if(D)if(Y===Z&&W.filterType==="join")W.conditions.push(S);else if(Y<=Z){let k=q.conditions.indexOf(W);q.conditions.splice(k,0,S)}else X.conditions[U-1].conditions.push(S);else if(Y===Z)if(W.filterType==="join")W.conditions.splice(0,0,S);else{let k=q.conditions.indexOf(W);q.conditions.splice(k+1,0,S)}else if(UK.filterModel===X),w=k.parent.conditions.indexOf(k.filterModel)+1;k.parent.conditions.splice(w,0,S)}this.refreshList(!1);let H=this.items.findIndex(({filterModel:k})=>k===S);if(H<0)return;let _=this.virtualList.getComponentAt(H);if(!(_ instanceof EQ))return;if(!z)_.focusMoveButton(D)}virtualListMoveItemCallback(G,D){let z=G.item,B=this.items.indexOf(z);if(B<=0||B===this.items.length-1)return;if(D&&B===1||!D&&!this.canMoveDown(z,B))return;this.moveItemUpDown(z,D,!0),this.virtualList.focusRow(B+(D?-1:1))}canMoveDown(G,D){return!(G.level===1&&D===this.items.length-2||G.level===1&&G.parent.conditions[G.parent.conditions.length-1]===G.filterModel)}close(){this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui"})}validate(){let G=this.items.every(({valid:z})=>z),D=null;if(G){if(G=JSON.stringify(this.filterModel)!==this.stringifiedModel,!G)D=this.advFilterExpSvc.translate("advancedFilterBuilderValidationAlreadyApplied")}else D=this.advFilterExpSvc.translate("advancedFilterBuilderValidationIncomplete");this.eButtons?.updateValidity(G,D)}validateItems(){let G=(z)=>{z.type=void 0},D=(z)=>{delete z.filter};for(let z of this.items){if(!z.valid||!z.filterModel||z.filterModel.filterType==="join")continue;let{filterModel:B}=z,{colId:Q}=B,J=this.advFilterExpSvc.getColumnAutocompleteEntries().find(({key:X})=>X===Q),U=this.advFilterExpSvc.getColumnDetails(B.colId);if(!J||!U.column){z.valid=!1,B.colId=void 0,G(B),D(B);continue}let S=this.advFilterExpSvc.getDataTypeExpressionOperator(U.baseCellDataType).operators[B.type];if(!S){z.valid=!1,G(B),D(B);continue}if(S.numOperands>0&&!dW(B.filter))z.valid=!1}}},vH=class extends o4{constructor(G){super();this.enabled=G}wireBeans(G){this.ctrlsSvc=G.ctrlsSvc,this.popupSvc=G.popupSvc,this.advFilterExpSvc=G.advFilterExpSvc,this.environment=G.environment}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsSvc.whenReady(this,()=>this.setAdvancedFilterComp()),this.addManagedEventListeners({advancedFilterEnabledChanged:({enabled:G})=>this.onEnabledChanged(G)}),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addManagedPropertyListener("advancedFilterBuilderParams",(G)=>{if(G.currentValue?.suppressFullScreenButton!==G.previousValue?.suppressFullScreenButton)this.eBuilderDialog?.setMaximizable(G.currentValue?.suppressFullScreenButton??!0)}),this.addDestroyFunc(()=>{if(this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog?.isAlive())this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(G){if(this.eHeaderComp)this.eHeaderComp?.getGui().remove(),this.destroyBean(this.eHeaderComp);this.eHeaderComp=this.createManagedBean(new cW(this.enabled&&!this.hasAdvancedFilterParent)),G.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){if(this.eHeaderComp)return this.eHeaderComp.getFocusableElement().focus(),!0;return!1}refreshComp(){this.eFilterComp?.refresh(),this.eHeaderComp?.refresh()}refreshBuilderComp(){this.eBuilderComp?.refresh()}getHeaderHeight(){return this.eHeaderComp?.getHeight()??0}setInputDisabled(G){this.eFilterComp?.setInputDisabled(G),this.eHeaderComp?.setInputDisabled(G)}toggleFilterBuilder(G){let{source:D,force:z,eventSource:B}=G;if(z&&this.eBuilderDialog||z===!1&&!this.eBuilderDialog)return;if(this.eBuilderDialog){this.builderDestroySource=D,this.destroyBean(this.eBuilderDialog);return}this.setInputDisabled(!0);let{width:Q,height:J,minWidth:U}=this.getBuilderDialogSize(),{suppressFullScreenButton:Z}={suppressFullScreenButton:!1,...this.gos.get("advancedFilterBuilderParams")};this.eBuilderComp=this.createBean(new bH),this.eBuilderDialog=this.createBean(new PB({title:this.advFilterExpSvc.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:Q,height:J,resizable:!0,movable:!0,maximizable:!Z,centered:!0,closable:!0,minWidth:U,afterGuiAttached:()=>this.eBuilderComp?.afterGuiAttached(),postProcessPopupParams:{type:"advancedFilterBuilder",eventSource:B}})),this.dispatchFilterBuilderVisibleChangedEvent(D,!0),this.eBuilderDialog.addEventListener("destroyed",()=>{this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchLocalEvent({type:"advancedFilterBuilderClosed"}),this.dispatchFilterBuilderVisibleChangedEvent(this.builderDestroySource??"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(G,D){this.eventSvc.dispatchEvent({type:"advancedFilterBuilderVisibleChanged",source:G,visible:D})}getBuilderDialogSize(){let G=this.gos.get("advancedFilterBuilderParams")?.minWidth??500,D=this.popupSvc.getPopupParent(),z=Math.round(a4(D))-2,B=Math.round(r4(D)*0.75)-2,Q=Math.min(Math.max(700,G),z),J=Math.min(600,B);return{width:Q,height:J,minWidth:G}}onEnabledChanged(G){this.enabled=G,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;let G=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!G,G){let D=this.createBean(new x6),z=D.getGui();this.environment.applyThemeClasses(z),z.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),G.appendChild(z),this.eFilterComp=D}}setHeaderCompEnabled(){this.eHeaderComp?.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){if(this.eFilterComp)e4(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp)}},OH=class{constructor(G){this.params=G,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(G){this.operators.push(""),this.operatorStartPositions.push(G),this.operatorEndPositions.push(void 0);let{expression:D}=this.params;while(GQ===this.parsedOperator);return this.params.advFilterExpSvc.generateAutocompleteListParams(B,"join",z)}updateExpression(G,D,z){let{expression:B}=this.params,Q=D.displayValue??D.key;if(z===0)for(let Z=this.operatorEndPositions.length-1;Z>0;Z--){let S=this.operatorEndPositions[Z];if(S==null)continue;B=XD(B,this.operatorStartPositions[Z],S,Q).updatedValue}let J=this.operatorStartPositions.length>z?this.operatorStartPositions[z]:G,U=(this.operatorEndPositions.length>z?this.operatorEndPositions[z]:void 0)??i1(B,G,!0).endPosition;return XD(B,J,U,Q,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(G){let D=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",z=this.params.advFilterExpSvc.getExpressionJoinOperators(),B=jB(D,z,(Q)=>Q);if(B){this.operatorEndPositions[this.activeOperator]=G;let Q=z[B];if(this.activeOperator){if(B!==this.parsedOperator){if(!this.validationError)this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:G-D.length+1,endPosition:G};return!1}}else this.parsedOperator=B;if(D!==Q)WJ(this.params,D,Q,G),this.operators[this.activeOperator]=Q;return!0}else if(B===null)return!1;else{if(!this.validationError)this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:G-D.length+1,endPosition:G};return!0}}},uH=class G{constructor(D,z){this.params=D,this.startPosition=z,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new OH(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let D=this.startPosition,{expression:z}=this.params;while(D0)this.missingEndBracket=!0;return D}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every((D)=>D.isValid())}getValidationError(){let D=this.operatorParser.getValidationError();for(let B=0;BJ.getFunction(D)),Q=z==="&&"?"every":"some";return(J,U,Z)=>B[Q]((S)=>S(J,U,Z))}getAutocompleteListParams(D){if(this.endPosition!=null&&D>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();let z=this.getExpressionParserIndex(D);if(z==null){if(this.params.expression[D]==="(")return{enabled:!1};return this.getColumnAutocompleteListParams()}let Q=this.expressionParsers[z].getAutocompleteListParams(D);if(!Q){if(zthis.endPosition+1)return null;else return this.operatorParser.updateExpression(D,z,J);return Z}getModel(){if(this.expressionParsers.length>1)return{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map((D)=>D.getModel())};else return this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(D){let z;for(let B=0;BD)break;z=B}return z}},jH=class{constructor(G){this.params=G,this.valid=!1}parseExpression(){this.joinExpressionParser=new uH(this.params,0);let G=this.joinExpressionParser.parseExpression();return this.valid=G>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){let G=this.joinExpressionParser.getValidationError();if(!G)return null;let{message:D,startPosition:z,endPosition:B}=G;return z{let z=this.colModel.getColDefCol(G);return z?this.filterValueSvc.getValue(z,D):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",(G)=>this.setEnabled(!!G.currentValue)),this.addManagedEventListeners({newColumnsLoaded:(G)=>this.onNewColumnsLoaded(G)}),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>{if(this.updateValidity())this.filterManager?.onFilterChanged({source:"advancedFilter"})})}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(G){return this.expressionFunction(this.expressionProxy,G,this.expressionParams)}getModel(){let G=this.createExpressionParser(this.appliedExpression);return G?.parseExpression(),G?.getModel()??null}setModel(G){let D=(B,Q)=>{if(B.filterType==="join"){let J=this.advFilterExpSvc.parseJoinOperator(B),U=B.conditions.map((Z)=>D(Z)).filter((Z)=>p4(Z)).join(` ${J} `);return Q||B.conditions.length<=1?U:`(${U})`}else return this.advFilterExpSvc.parseColumnFilterModel(B)},z=G?D(G,!0):null;this.setExpressionDisplayValue(z),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(G){this.expression=G}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(G){if(!G)return null;return new jH({expression:G,colModel:this.colModel,dataTypeSvc:this.dataTypeSvc,valueSvc:this.valueSvc,advFilterExpSvc:this.advFilterExpSvc})}getDefaultExpression(G){let D=this.advFilterExpSvc.getColumnValue(G)+" ";return{updatedValue:D,updatedPosition:D.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(G,D){let z=this.enabled,B=m4(this.gos)||t4(this.gos);if(G&&!B)s4(123);if(this.enabled=G&&B,!D&&this.enabled!==z)this.eventSvc.dispatchEvent({type:"advancedFilterEnabledChanged",enabled:this.enabled})}applyExpression(){let G=this.createExpressionParser(this.expression);G?.parseExpression(),this.applyExpressionFromParser(G)}getAppliedExpressionDisplayValue(){return this.appliedExpression}applyExpressionFromParser(G){if(this.isValid=!G||G.isValid(),!G||!this.isValid){this.expressionFunction=null,this.expressionParams=null,this.appliedExpression=null;return}let{expressionFunction:D,params:z}=G.getFunction();this.expressionFunction=D,this.expressionParams=z,this.appliedExpression=this.expression}updateValidity(){this.advFilterExpSvc.resetColumnCaches();let G=this.createExpressionParser(this.expression);G?.parseExpression();let z=(!G||G.isValid())!==this.isValid;return this.applyExpressionFromParser(G),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),z}onNewColumnsLoaded(G){if(G.source!=="gridInitializing"||!this.dataTypeSvc?.isPendingInference)return;this.ctrl.setInputDisabled(!0);let[D]=this.addManagedEventListeners({dataTypesInferred:()=>{D?.(),this.ctrl.setInputDisabled(!1)}})}},l6={moduleName:"AdvancedFilter",version:j,beans:[PH,d4],icons:{advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",advancedFilterBuilderSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading"},apiFunctions:{getAdvancedFilterModel:v4,setAdvancedFilterModel:O4,showAdvancedFilterBuilder:u4,hideAdvancedFilterBuilder:j4},dependsOn:[i,A4,V4,C4,R4,M4],css:[b4]},Sz=class{constructor(G){this._defs={},this._nullable=!1,this.description=G}_collectNestedDefs(G){let D={...this._defs};for(let z of G)if(z&&typeof z==="object"&&"$defs"in z)Object.assign(D,z.$defs),delete z.$defs;return D}_toJSON(G={}){let D={type:this._nullable?[this.type,"null"]:this.type,description:this.description,...G};if(Object.keys(this._defs).length>0)D.$defs=this._defs;return D}nullable(){return this._nullable=!0,this}define(G,D){return this._defs[G]=D,this}},yH=class extends Sz{constructor(G){super(typeof G==="string"?G:G?.description);if(this.type="string",typeof G==="object"&&G)this._pattern=G.pattern,this._format=G.format}pattern(G){return this._pattern=G,this}format(G){return this._format=G,this}toJSON(){return this._toJSON({pattern:this._pattern,format:this._format})}},xH=class extends Sz{constructor(G){super(typeof G==="string"?G:G?.description);if(this.type="number",typeof G==="object"&&G)this._minimum=G.minimum,this._maximum=G.maximum,this._exclusiveMinimum=G.exclusiveMinimum,this._exclusiveMaximum=G.exclusiveMaximum,this._multipleOf=G.multipleOf}minimum(G){return this._minimum=G,this}exclusiveMinimum(G){return this._exclusiveMinimum=G,this}maximum(G){return this._maximum=G,this}exclusiveMaximum(G){return this._exclusiveMaximum=G,this}multipleOf(G){return this._multipleOf=G,this}toJSON(){return this._toJSON({minimum:this._minimum,exclusiveMinimum:this._exclusiveMinimum,maximum:this._maximum,exclusiveMaximum:this._exclusiveMaximum,multipleOf:this._multipleOf})}},p6=class extends Sz{constructor(G,D){super(D);this._enum=G,this.type="string"}toJSON(){return this._toJSON({enum:this._enum})}},cH=class extends p6{constructor(G,D){super([G],D)}},hH=class extends Sz{constructor(G){super(G);this.type="boolean"}toJSON(){return this._toJSON()}},iH=class extends Sz{constructor(G,D){super(typeof D==="string"?D:D?.description);if(this.items=G,this.type="array",typeof D==="object"&&D)this._minItems=D.minItems,this._maxItems=D.maxItems}minItems(G){return this._minItems=G,this}maxItems(G){return this._maxItems=G,this}toJSON(){let G=this.items.toJSON(),D=this._collectNestedDefs([G]);return this._defs=D,this._toJSON({items:G,minItems:this._minItems,maxItems:this._maxItems})}},nH=class extends Sz{constructor(G,D){super(D);this.properties=G,this.type="object"}toJSON(){let G=Object.fromEntries(Object.keys(this.properties).map((z)=>[z,this.properties[z].toJSON()])),D=this._collectNestedDefs(Object.values(G));return this._defs=D,this._toJSON({required:Object.keys(this.properties),additionalProperties:!1,properties:G})}},dH=class{constructor(G,D){this.schemas=G,this._nullable=!1,this._defs={},this.description=D}nullable(){return this._nullable=!0,this}define(G,D){return this._defs[G]=D,this}_collectNestedDefs(G){let D=this._defs;for(let z of G)if(z&&typeof z==="object"&&"$defs"in z)Object.assign(D,z.$defs),delete z.$defs;return D}toJSON(){let G=this.schemas.map((B)=>B.toJSON()),D=this._collectNestedDefs(G),z={anyOf:this._nullable?[...G,{type:"null"}]:G};if(this.description)z.description=this.description;if(Object.keys(D).length>0)z.$defs=D;return z}},lH=class{constructor(G){this.id=G}nullable(){return this}toJSON(){return{$ref:`#/$defs/${this.id}`}}},M={string:(G)=>new yH(G),number:(G)=>new xH(G),enum:(G,D)=>new p6(G,D),boolean:(G)=>new hH(G),array:(G,D)=>new iH(G,D),object:(G,D)=>new nH(G,D),union:(G,D)=>new dH(G,D),literal:(G,D)=>new cH(G,D),ref:(G)=>new lH(G)},pH=(G)=>{let{aggFuncSvc:D}=G;if(!D)return;let B=G.colModel.getCols().filter((Q)=>Q.isAllowValue()&&D.getFuncNames(Q).length>0);if(B.length===0)return;return M.object({aggregationModel:M.array(M.union(B.map((Q)=>M.object({colId:M.literal(Q.getColId(),"Column identifier"),aggFunc:M.enum(G.aggFuncSvc?.getFuncNames(Q)||[],"Aggregation function")}))),"Array of column aggregations")},"Aggregation configuration for the grid").nullable()},mH=(G)=>{let z=G.colModel.getCols().filter((Q)=>Q.isResizable());if(z.length===0)return;let B=z.map((Q)=>Q.getColId());return M.object({columnSizingModel:M.array(M.union([M.object({colId:M.ref("resizableColumnId"),width:M.number("Fixed width in pixels").minimum(20)}),M.object({colId:M.ref("resizableColumnId"),flex:M.number("Flex sizing ratio").minimum(0)})]),"Array of column sizing configurations")},"Column sizing configuration for the grid").define("resizableColumnId",M.enum(B,"Column ID that supports resizing"))},tH=()=>{return M.object({hiddenColIds:M.array(M.ref("allColumnIds"),"Array of column IDs to hide")},"Column visibility configuration for the grid").nullable()},sH=({colModel:G,dataTypeSvc:D})=>{if(!D)return;let z=G.getCols(),B={boolean:[],object:[],date:[],dateString:[],dateTime:[],dateTimeString:[],number:[],bigint:[],text:[]};for(let U of z){let Z=D.getBaseDataType(U);if(Z)B[Z].push(U.colId)}let Q=[],J={};for(let U of Object.keys(B))if(B[U].length>0){let Z=`${U}AdvancedFilterModel`,S=J_[U];J[Z]=S(B[U]),Q.push({$ref:`#/$defs/${Z}`})}return J.joinAdvancedFilterModel=M.object({filterType:M.literal("join","Filter type identifier for joining multiple advanced filter conditions"),type:M.enum(["AND","OR"],"Logical operator to combine multiple advanced filter conditions"),conditions:M.array(M.ref("advancedFilterModel"),"Array of advanced filter conditions to be combined")}),J.advancedFilterModel={anyOf:[...Q,{$ref:"#/$defs/joinAdvancedFilterModel"}]},M.object({advancedFilterModel:M.ref("advancedFilterModel")},"Advanced filter configuration for the grid").nullable()},oH=(G)=>{return M.object({filterType:M.literal("boolean","Filter type identifier for boolean column filters"),colId:M.enum(G,"Column identifier for the boolean column to filter"),type:M.enum(["true","false"],"Boolean value to filter by")})},rH=(G)=>{return M.object({filterType:M.literal("object","Filter type identifier for object column filters"),colId:M.enum(G,"Column identifier for the object column to filter"),filter:M.string("Filter value to compare against object column values").nullable(),type:M.enum(["equals","notEqual","contains","notContains","startsWith","endsWith","blank","notBlank"],"Object filter operation type")})},aH=(G)=>{return M.object({filterType:M.literal("date","Filter type identifier for date column filters"),colId:M.enum(G,"Column identifier for the date column to filter"),filter:M.string({pattern:"^\\d{4}-\\d{2}-\\d{2}$",description:"Date value in YYYY-MM-DD format"}).nullable(),type:M.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Date filter operation type")})},eH=(G)=>{return M.object({filterType:M.literal("date","Filter type identifier for date string column filters"),colId:M.enum(G,"Column identifier for the date string column to filter"),filter:M.string({pattern:"^\\d{4}-\\d{2}-\\d{2}$",description:"Date value in YYYY-MM-DD format"}).nullable(),type:M.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Date string filter operation type")})},G_=(G)=>{return M.object({filterType:M.literal("dateTime","Filter type identifier for datetime column filters"),colId:M.enum(G,"Column identifier for the datetime column to filter"),filter:M.string({pattern:"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",description:"DateTime value in YYYY-MM-DDTHH:mm:ss format"}).nullable(),type:M.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"DateTime filter operation type")})},D_=(G)=>{return M.object({filterType:M.literal("dateTimeString","Filter type identifier for datetime string column filters"),colId:M.enum(G,"Column identifier for the datetime string column to filter"),filter:M.string({pattern:"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",description:"DateTime value in YYYY-MM-DD HH:mm:ss format"}).nullable(),type:M.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"DateTime string filter operation type")})},z_=(G)=>{return M.object({filterType:M.literal("number","Filter type identifier for number column filters"),colId:M.enum(G,"Column identifier for the number column to filter"),filter:M.number("Numeric value to filter by").nullable(),type:M.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"Number filter operation type")})},B_=(G)=>{return M.object({filterType:M.literal("bigint","Filter type identifier for bigint column filters"),colId:M.enum(G,"Column identifier for the bigint column to filter"),filter:M.string({pattern:"^-?\\d+$",description:"BigInt value to filter by"}).nullable(),type:M.enum(["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","blank","notBlank"],"BigInt filter operation type")})},Q_=(G)=>{return M.object({filterType:M.literal("text","Filter type identifier for text column filters"),colId:M.enum(G,"Column identifier for the text column to filter"),filter:M.string("Text value to filter by").nullable(),type:M.enum(["equals","notEqual","contains","notContains","startsWith","endsWith","blank","notBlank"],"Text filter operation type")})},J_={boolean:oH,object:rH,date:aH,dateString:eH,dateTime:G_,dateTimeString:D_,number:z_,bigint:B_,text:Q_},U_="agTextColumnFilter",m6="agNumberColumnFilter",t6="agDateColumnFilter",Z_="agSetColumnFilter",$_="agMultiColumnFilter",L_=[U_,m6,t6],S_=(G,D)=>{let{advancedFilter:z}=G;if(z?.isEnabled())return sH(G);else return X_(G,D)},X_=(G,D)=>{let{gos:z,colFilter:B,colModel:Q}=G;if(!B)return;let U=Q.getCols().filter((X)=>X.isFilterAllowed());if(U.length===0)return;let Z={},S=z.get("enableFilterHandlers");for(let X of U){let Y=D?.columns?D.columns[X.getColId()]:void 0,W=X.getColDef(),q=B.getDefaultFilter(X),H=Y?.includeSetValues??!1,_=s6(W.filter,W.filterParams,q,(k=!1,w=0)=>{if(!H)return[];let K=void 0;if(!k)K=B.getHandler(X,!0);else if(S)K=B.getHandler(X,!0).getHandler(w);if(!K)return[];return K.getFilterKeys()});if(_)Z[X.colId]=_.nullable()}return M.object({filterModel:M.object(Z)}).nullable()};function s6(G,D,z,B){let Q=void 0;if(typeof G==="string")Q=G;else if(typeof G==="object"&&typeof G.component==="string")Q=G.component;else if(G===!0||typeof G==="object"&&G.component===!0)Q=z;if(!Q)return null;if(L_.includes(Q)){let J=D?.maxNumConditions,U=D?.filterOptions?D.filterOptions.map((S)=>{if(typeof S==="string")return S;if(typeof S==="object"&&S.displayKey)return S.displayKey;return null}).filter(Boolean):void 0,Z=D?.useIsoSeparator||!1;return Y_(Q,{maxConditions:J,filterOptions:U,useIsoSeparator:Z})}else if(Q===Z_)return __(B);else if(Q===$_)return k_(D.filters,z,B);return null}var Y_=(G,D)=>{if(G===t6)return H_(D);else if(G===m6)return q_(D);else return W_(D)},_J=(G,D,z=2)=>{if(z===1)return G;return M.object({filterType:M.literal(D,`Filter type identifier for ${D} filters with multiple conditions`),operator:M.enum(["AND","OR"],"Logical operator to combine multiple filter conditions. Must be included even with a single filter to adhere to the API."),conditions:M.array(G,"Array of filter conditions to be combined").minItems(2).maxItems(z)})},W_=(G)=>{let D=G.filterOptions??["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],z=M.object({filterType:M.literal("text","Filter type identifier for text filters"),type:M.enum(D,"Text filter operation type"),filter:M.string("Primary filter value").nullable(),filterTo:M.string("Secondary filter value for range operations").nullable()});return _J(z,"text",G.maxConditions)},q_=(G)=>{let D=G.filterOptions??["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],z=M.object({filterType:M.literal("number","Filter type identifier for number filters"),type:M.enum(D,"Number filter operation type"),filter:M.number("Primary filter value").nullable(),filterTo:M.number("Secondary filter value for range operations").nullable()});return _J(z,"number",G.maxConditions)},H_=(G)=>{let D=G.filterOptions??["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],z=G.useIsoSeparator?"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",B=M.object({filterType:M.literal("date","Filter type identifier for date filters"),type:M.enum(D,"Date filter operation type"),dateFrom:M.string({pattern:z,description:"Primary date filter value in YYYY-MM-DD HH:mm:ss format"}).nullable(),dateTo:M.string({pattern:z,description:"Secondary date filter value for range operations in YYYY-MM-DD HH:mm:ss format"}).nullable()});return _J(B,"date",G.maxConditions)},__=(G)=>{let D=G?G().filter(Boolean):[];return M.object({filterType:M.literal("set","Filter type identifier for set filters"),values:M.array(D.length>0?M.enum(D,"Available values to filter by"):M.string("Filter values"),"Array of values to include in the filter")})},k_=(G,D,z=()=>[])=>{return M.object({filterType:M.literal("multi","Filter type identifier for multi-condition filters"),filterModels:M.array(M.union(G.map((B,Q)=>s6(B.filter,B.filterParams,D,()=>z(!0,Q))),"Union of different filter types that can be combined").nullable(),"Array of filter conditions to be combined with AND/OR logic")})},w_=(G)=>{let z=G.colModel.getCols().filter((B)=>B.isAllowPivot()).map((B)=>B.getColId());if(z.length===0)return;return M.object({pivotMode:M.boolean("Whether pivot mode is enabled"),pivotColIds:M.array(M.enum(z,"Column ID that supports pivoting"),"Array of column IDs to use as pivot columns")},"Pivot configuration for the grid").nullable()},K_=(G)=>{let z=G.colModel.getCols().filter((Q)=>Q.isAllowRowGroup());if(z.length===0)return;let B=z.map((Q)=>Q.getColId());return M.object({groupColIds:M.array(M.enum(B,"Column ID that supports row grouping"),"Array of column IDs to group by")},"Row grouping configuration for the grid")},f_=(G)=>{let{sortSvc:D}=G;if(!D)return;let B=G.colModel.getCols().filter((J)=>J.isSortable());if(B.length===0)return;let Q=B.map((J)=>J.getColId());return M.object({sortModel:M.array(M.object({colId:M.enum(Q,"Column ID that supports sorting"),sort:M.enum(["asc","desc"],"Sort direction: ascending or descending"),type:M.enum(["default","absolute"],"Sort type: default or absolute values")}),"Array of sort configurations")},"Sort configuration for the grid").nullable()},N_={aggregation:pH,filter:S_,sort:f_,pivot:w_,columnVisibility:tH,columnSizing:mH,rowGroup:K_};function F_(G,D){let z=G.colModel.getCols().map((Z)=>Z.getColId()),B={};for(let Z of TH){if(D?.exclude?.includes(Z))continue;let S=N_[Z],X=S(G,D);if(X)B[Z]=X.nullable()}let Q=D?.columns??{},J=z.map((Z)=>{if(Q[Z]?.description)return`${Z}: ${Q[Z].description}`;else return Z}).filter(Boolean).join(` +`);return M.object(B).define("allColumnIds",M.enum(z,J)).toJSON()}var o6={moduleName:"AiToolkit",version:j,beans:[],dependsOn:[i,gH],apiFunctions:{getStructuredSchema:F_}};function C_(G){return G.sideBar?.comp.isDisplayed()??!1}function V_(G,D){G.sideBar?.comp.setDisplayed(D)}function b_(G,D){G.sideBar?.comp.setSideBarPosition(D)}function v_(G,D,z){G.sideBar?.comp.openToolPanel(D,"api",z)}function O_(G){G.sideBar?.comp.close("api")}function u_(G){return G.sideBar?.comp.openedItem()??null}function j_(G){G.sideBar?.comp.refresh()}function P_(G){return G.sideBar?.comp.isToolPanelShowing()??!1}function g_(G,D){let z=G.sideBar?.comp.getToolPanelInstance(D);return R_(z)}function T_(G){return G.sideBar?.comp.getDef()}var s_=`.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{ + /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}`,Qk={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},Jk=class extends Dk{constructor(G){super();this.toolPanelDef=G,this.eToggleButton=MQ,this.eIconWrapper=MQ,this.eLabel=MQ}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(Qk,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){let G=this.toolPanelDef,D=this.getLocaleTextFunc()(G.labelKey,G.labelDefault);this.eLabel.textContent=D}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",zk(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(G){this.toggleCss("ag-selected",G),Bk(this.eToggleButton,G)}},Uk={tag:"div",cls:"ag-side-buttons",role:"tablist"},Zk=class extends o_{constructor(){super(Uk);this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(G){if(G.key!==r_.TAB||!G.shiftKey)return;if(e_(this.beans,!0)){G.preventDefault();return}Gk(G)}setActiveButton(G){for(let D of this.buttonComps)D.setSelected(G===D.getToolPanelId())}addButtonComp(G){let D=this.createBean(new Jk(G));return this.buttonComps.push(D),this.appendChild(D),D.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:G.id})}),D}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),a_(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},$k={selector:"AG-SIDE-BAR-BUTTONS",component:Zk},a6={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},e6={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},Lk={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},B0={columns:a6,filters:e6,"filters-new":Lk};function p1(G){if(!G)return;if(G===!0)return{toolPanels:[a6,e6],defaultToolPanel:"columns"};if(typeof G==="string")return p1([G]);if(Array.isArray(G)){let D=[];for(let z of G){let B=B0[z];if(!B){r6(215,{key:z,defaultByKey:B0});continue}D.push(B)}if(D.length===0)return;return{toolPanels:D,defaultToolPanel:D[0].id}}return{toolPanels:Sk(G.toolPanels),defaultToolPanel:G.defaultToolPanel,hiddenByDefault:G.hiddenByDefault,position:G.position,hideButtons:G.hideButtons}}function Sk(G){let D=[];if(!G)return D;return G.forEach((z)=>{let B=Xk(z);if(!B)return;D.push(B)}),D}function Xk(G){if(typeof G!=="string")return G;if(B0[G])return B0[G];return r6(215,{key:G,defaultByKey:B0}),null}var Hk=class extends qk{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"});this.minWidth=100,this.maxWidth=null}postConstruct(){let G=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(G),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(G,D,z){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:z,started:G,ended:D})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(G){return this.onResizing(G,!0)}onResizing(G,D=!1){let z=this.inverted?-1:1,B=Math.max(this.minWidth,Math.floor(this.startingWidth-G*z));if(this.maxWidth!=null)B=Math.min(this.maxWidth,B);this.elementToResize.style.setProperty("--ag-horizontal-size",`${B}px`),this.dispatchResizeEvent(!1,D,B)}};function _k(G,D,z){return G.getCompDetails(D,kk,void 0,z,!0)}var kk={name:"toolPanel",optionalMethods:["refresh","getState"]},wk={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},Kk=class extends Yk{constructor(){super(wk);this.eContent=Wk,this.animationId=0,this.defParent=null}postConstruct(){let G=this.getGui(),D=this.resizeBar=this.createManagedBean(new Hk);G.setAttribute("id",`ag-${this.getCompId()}`),D.elementToResize=G,this.appendChild(D)}getToolPanelId(){return this.toolPanelId}getDefParent(){return this.defParent}setDefParent(G){this.defParent=G}setToolPanelDef(G,D){let{id:z,minWidth:B,maxWidth:Q,width:J,parent:U}=G;if(this.toolPanelId=z,this.defParent=U??null,J)this.getGui().style.setProperty("--ag-side-bar-panel-width",`${J}px`);let Z=_k(this.beans.userCompFactory,G,D);if(Z==null)return!1;let S=Z.newAgStackInstance();this.params=Z.params,S.then(this.setToolPanelComponent.bind(this));let X=this.resizeBar;if(B!=null)X.minWidth=B;if(Q!=null)X.maxWidth=Q;return!0}setToolPanelComponent(G){this.toolPanelCompInstance=G;let{eContent:D}=this;D.appendChild(G.getGui()),this.addDestroyFunc(()=>{this.destroyBean(G)})}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(G){let D=this.gos.get("enableRtl"),z=G==="left",B=D?z:!z;this.resizeBar.inverted=B}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(G){if(this.isDisplayed()===G)return;let D=++this.animationId,{eContent:z}=this,B=()=>{if(this.animationId===D)Q.classList.remove("ag-tool-panel-animating"),z.style.width="",Q.style.width=""},Q=this.getGui(),J=Q.offsetWidth;this.setDisplayed(G),Q.classList.add("ag-tool-panel-animating");let U=getComputedStyle(Q).transitionDuration;if(!parseFloat(U)){B();return}Q.style.transition="none",Q.style.width="",z.style.width=`${z.offsetWidth}px`,Q.style.width=`${J}px`;let Z=Q.offsetWidth;Q.style.transition="",Q.style.width=G?"":"0";let S=setTimeout(B,100);Q.addEventListener("transitionstart",()=>clearTimeout(S),{once:!0}),Q.addEventListener("transitionend",B,{once:!0})}},fk={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},Nk=class extends x_{constructor(){super(fk,[$k]);this.sideBarButtons=h_,this.toolPanelWrappers=[],this.registerCSS(s_)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));let{beans:G,gos:D}=this,{sideBar:z}=D.get("initialState")??{};this.setSideBarDef({sideBarDef:p1(D.get("sideBar")),sideBarState:z}),this.addManagedPropertyListener("sideBar",()=>this.setState()),G.sideBar.comp=this;let B=this.getFocusableElement();this.createManagedBean(new c_(B,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),i_(G,this,B),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(G){if(G.defaultPrevented)return;let{beans:D,sideBarButtons:z}=this,B=this.getGui(),Q=z.getGui(),J=oU(D),U=B.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),Z=G.target,S=G.shiftKey;if(!U){if(l_(D,S,!0))return G.preventDefault(),!0;return t_(G),!1}if(Q.contains(J)){if(d_(U,S))G.preventDefault();return}if(!S)return;let X=null;if(U.contains(J))X=n_(D,U,void 0,!0);else if(u6(U,Z))X=c1(U,Z);if(!X)X=Q.querySelector(".ag-selected button"),X=p_(X)?X:null;if(X&&X!==G.target)G.preventDefault(),X.focus()}handleKeyDown(G){let D=oU(this.beans),z=this.sideBarButtons;if(!z.getGui().contains(D))return;let B=z.getGui(),Q=Array.prototype.slice.call(B.querySelectorAll(".ag-side-button")),J=Q.findIndex((S)=>S.contains(D)),U=null;switch(G.key){case O0.LEFT:case O0.UP:U=Math.max(0,J-1);break;case O0.RIGHT:case O0.DOWN:U=Math.min(J+1,Q.length-1);break}if(U===null)return;let Z=Q[U].querySelector("button");if(Z)Z.focus(),G.preventDefault()}onToolPanelButtonClicked(G){let D=G.toolPanelId;if(this.openedItem()===D)this.openToolPanel(void 0,"sideBarButtonClicked");else this.openToolPanel(D,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:G,sideBarState:D,existingToolPanelWrappers:z}){if(this.setDisplayed(!1),this.sideBar=G,G)this.sideBarButtons.setDisplayed(!G.hideButtons);if(G?.toolPanels){let B=G.toolPanels;if(this.createToolPanelsAndSideButtons(B,D,z),!this.toolPanelWrappers.length)return;let Q=D?D.visible:!G.hiddenByDefault;if(this.setDisplayed(Q),this.setSideBarPosition(D?D.position:G.position),Q)if(D){let{openToolPanel:J}=D;if(J)this.openToolPanel(J,"sideBarInitializing")}else this.openToolPanel(G.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(G){if(!G)G="right";this.position=G;let D=G==="left",z=D?"right":"left";this.toggleCss("ag-side-bar-left",D),this.toggleCss("ag-side-bar-right",!D);for(let B of this.toolPanelWrappers)B.setResizerSizerSide(z);return this.dispatchSideBarUpdated(),this}setDisplayed(G,D){super.setDisplayed(G,D),this.dispatchSideBarUpdated()}getState(){let G={};for(let D of this.toolPanelWrappers)G[D.getToolPanelId()]=D.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:G}}createToolPanelsAndSideButtons(G,D,z){for(let B of G)this.createToolPanelAndSideButton(B,D?.toolPanels?.[B.id],z?.[B.id])}validateDef(G){let{id:D,toolPanel:z}=G;if(D==null)return IQ(212),!1;if(aU(z)){if(this.beans.filterManager?.isAdvFilterEnabled())return IQ(213),!1}return!0}createToolPanelAndSideButton(G,D,z){if(!this.validateDef(G)){this.destroyBean(z);return}let B;if(z)B=z,B.setDefParent(G.parent??null);else if(B=this.createBean(new Kk),!B.setToolPanelDef(G,sU(this.gos,{initialState:D,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;B.setDisplayed(!1),this.renderToolPanelUnderParent(B,G.parent),this.toolPanelWrappers.push(B);let Q=this.sideBarButtons.addButtonComp(G);m_(Q.eToggleButton,B.getGui())}refresh(){for(let G of this.toolPanelWrappers)G.refresh()}renderToolPanelUnderParent(G,D){let z=G.getGui();if(D)this.beans.environment.applyThemeClasses(D,["ag-external","ag-tool-panel-external"]),z.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let B=D??G.getDefParent()??this.getGui();if(z.parentElement!==B)B.appendChild(z)}getWrapper(G){return this.toolPanelWrappers.find((D)=>D.getToolPanelId()===G)}openToolPanel(G,D="api",z){let B=this.openedItem(),J=!!G&&!!B||D==="sideBarInitializing";for(let S of this.toolPanelWrappers){let X=G===S.getToolPanelId();if(X)this.renderToolPanelUnderParent(S,z??null);if(J)S.setDisplayed(X);else S.animateDisplayed(X)}let U=this.openedItem();if(B!==U)this.sideBarButtons.setActiveButton(G),this.raiseToolPanelVisibleEvent(G,B??void 0,D)}getToolPanelInstance(G){let D=this.getWrapper(G);if(!D){IQ(214,{key:G});return}return D.getToolPanelInstance()}raiseToolPanelVisibleEvent(G,D,z){let B=!!G&&!!D,Q=this.eventSvc;if(D)Q.dispatchEvent({type:"toolPanelVisibleChanged",source:z,key:D,visible:!1,switchingToolPanel:B});if(G)Q.dispatchEvent({type:"toolPanelVisibleChanged",source:z,key:G,visible:!0,switchingToolPanel:B})}close(G="api"){this.openToolPanel(void 0,G)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let G=null;for(let D of this.toolPanelWrappers)if(D.isDisplayed())G=D.getToolPanelId();return G}setState(G){let D=p1(this.gos.get("sideBar")),z={};if(D&&this.sideBar)D.toolPanels?.forEach((B)=>{let{id:Q}=B;if(!Q)return;let J=this.sideBar.toolPanels?.find((X)=>X.id===Q);if(!J||B.toolPanel!==J.toolPanel)return;let U=this.getWrapper(Q);if(!U)return;let Z=sU(this.gos,{...B.toolPanelParams??{},initialState:G?.toolPanels?.[Q],onStateUpdated:()=>this.dispatchSideBarUpdated()});if(U.getToolPanelInstance()?.refresh(Z)!==!0)return;this.toolPanelWrappers=this.toolPanelWrappers.filter((X)=>X!==U),rU(U.getGui()),z[Q]=U});this.clearDownUi(),this.setSideBarDef({sideBarDef:D,sideBarState:G,existingToolPanelWrappers:z})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(let G of this.toolPanelWrappers)rU(G.getGui()),this.destroyBean(G);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){if(this.sideBar?.toolPanels?.some((D)=>aU(typeof D==="string"?D:D.toolPanel)))this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function aU(G){return G==="agFiltersToolPanel"||G==="agNewFiltersToolPanel"}var Fk={selector:"AG-SIDE-BAR",component:Nk},Ek=class extends y_{constructor(){super(...arguments);this.beanName="sideBar"}getSelector(){return Fk}},jD={moduleName:"SideBar",version:j,beans:[Ek],apiFunctions:{isSideBarVisible:C_,setSideBarVisible:V_,setSideBarPosition:b_,openToolPanel:v_,closeToolPanel:O_,getOpenedToolPanel:u_,refreshToolPanel:j_,isToolPanelShowing:P_,getToolPanelInstance:g_,getSideBar:T_},dependsOn:[i,A_]},Ik='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',G7=class extends O6{constructor(){super({warnNoIcon:()=>Mk(227)})}},TB={moduleName:"MenuItem",version:j,userComponents:{agMenuItem:G7},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[Ik]},jk=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}",ck=300,hk={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},ik=class extends Tk{constructor(){super(hk,[Pk,gk]);this.eExpand=AQ,this.eSelect=AQ,this.eFilterTextField=AQ}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:(D)=>{if(D.key===yk.SPACE)D.preventDefault(),this.onExpandClicked()}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});let G=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(G("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(G("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){let G=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(G),this.eSelect.toggleCss("ag-column-select-column-readonly",G)}init(G){this.params=G;let D=this.gos.get("functionsReadOnly");if(this.eSelect.setReadOnly(D),this.eSelect.toggleCss("ag-column-select-column-readonly",D),this.beans.colModel.ready)this.showOrHideOptions()}createExpandIcons(){let G=this.beans;this.eExpand.appendChild(this.eExpandChecked=RQ("columnSelectOpen",G)),this.eExpand.appendChild(this.eExpandUnchecked=RQ("columnSelectClosed",G)),this.eExpand.appendChild(this.eExpandIndeterminate=RQ("columnSelectIndeterminate",G)),this.setExpandState(0)}showOrHideOptions(){let G=this.params,D=!G.suppressColumnFilter,z=!G.suppressColumnSelectAll,B=!G.suppressColumnExpandAll,Q=!!this.beans.colModel.colDefCols?.treeDepth,J=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(J("searchOoo","Search...")),hD(this.eFilterTextField.getGui(),D),hD(this.eSelect.getGui(),z),hD(this.eExpand,B&&Q)}onFilterTextChanged(){if(!this.onFilterTextChangedDebounced)this.onFilterTextChangedDebounced=xk(this,()=>{let G=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:G})},ck);this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(G){this.expandState=G,hD(this.eExpandChecked,G===0),hD(this.eExpandUnchecked,G===1),hD(this.eExpandIndeterminate,G===2)}setSelectionState(G){this.selectState=G,this.eSelect.setValue(this.selectState)}},nk={selector:"AG-PRIMARY-COLS-HEADER",component:ik};function Dz(G){return!!G&&typeof G.children<"u"}function JD(G){return Dz(G)?G.groupId:G.colId}function D7(G,D,z){let B=(U,Z)=>{let X=U.children.map(JD).includes(JD(Z)),Y=ek(U.children),W=Y&&JD(Y)!==JD(Z);return X&&W};if(!Dz(G))return!0;let Q=G,J=z;if(B(Q,J))return Q.children.push(J),!0;if(Q.groupId===D){if(!Q.children.map(JD).includes(JD(J)))return Q.children.push(J),!0}for(let U=Q.children.length-1;U>=0;U--)if(D7(Q.children[U],D,z))break;return!1}function z7(G){let D=(Q,J)=>{return Dz(Q)&&Dz(J)&&JD(Q)===JD(J)},z=(Q,J)=>{if(!Dz(J))return Q;let U=Q,Z=J;if(Z.children&&Z.groupId){if(D7(U,Z.groupId,Z.children[0]))return U}for(let S of Z.children)z(U,S);return U},B=[];for(let Q=1;Q<=G.length;Q++){let J=G[Q-1],U=G[Q];if(D(J,U))G[Q]=z(J,U);else B.push(J)}return B}function B7(G,D){let z=[],B=(J,U)=>{if(Dz(J)){let Z=J,S=typeof Z.groupId<"u"?Z.groupId:Z.headerName,X=new ok(Z,S,!1,U),Y=[];for(let W of Z.children){let q=B(W,U+1);if(q)Y.push(q)}return X.setChildren(Y),X}else{let Z=J,S=Z.colId?Z.colId:Z.field,X=G.getColDefCol(S);if(!X)z.push(Z);return X}},Q=[];for(let J of D){let U=B(J,0);if(U)Q.push(U)}if(z.length>0)rk(217,{invalidColIds:z});return Q}function Q7(G,D){let z=J7(D3(G)),B=z7(z);D(B)}function G3(G,D){let z=J7(G),B=z7(z);D(B)}function J7(G){let D=(z,B)=>{let Q;if(ak(z))if(z.isPadding())Q=B;else{let U=Object.assign({},z.getColGroupDef());U.groupId=z.getGroupId(),U.children=[B],Q=U}else{let U=Object.assign({},z.getColDef());U.colId=z.getColId(),Q=U}let J=z.getOriginalParent();if(J)return D(J,Q);else return Q};return G.map((z)=>D(z,z.getColDef()))}function D3(G){return G.getCols().filter((D)=>{let z=D.getColDef();return D.isPrimary()&&!z.showRowGroup})}var DZ=class{constructor(G,D,z,B=!1,Q){if(this.displayName=G,this.depth=z,this.group=B,this.localEventService=new z3,B)this.columnGroup=D,this._expanded=Q,this.children=[];else this.column=D}get expanded(){return!!this._expanded}set expanded(G){if(G===this._expanded)return;this._expanded=G,this.localEventService.dispatchEvent({type:"expandedChanged"})}addEventListener(G,D){this.localEventService.addEventListener(G,D)}removeEventListener(G,D){this.localEventService.removeEventListener(G,D)}};function x(G){return!!G?.buttons?.includes("apply")}function YG(G,D){if(!x(D))return;let z=G.sideBar?.comp.openedItem();if(!z)return;G.sideBar?.comp.getToolPanelInstance(z)?.refreshDeferredUi()}function U7(G,D,z,B,Q){let J=W3(D);Z7(G,J,z,B,Q)}function Z7(G,D,z,B,Q){if(G.columnStateUpdateStrategy.getPivotMode(x(Q)))H3(G,D,z,B,Q);else q3(G,D,z,B,Q)}function W3(G){let D=[],z=(B)=>{for(let Q of B){if(!Q.passesFilter)continue;if(Q.group)z(Q.children);else D.push(Q.column)}};return z(G),D}function q3(G,D,z,B,Q){let J=G.columnStateUpdateStrategy,U=[];for(let Z of D){if(Z.getColDef().lockVisible)continue;if(J.isColumnVisibleInToolPanel(x(Q),Z)!==z)U.push({colId:Z.getId(),hide:!z})}J.applyColumnState(x(Q),U,B),YG(G,Q)}function H3(G,D,z,B,Q){_3(G,D,z,B,Q)}function _3(G,D,z,B,Q){let J=G.columnStateUpdateStrategy,U=[],X=z?(Y)=>{if(J.isColumnSelectedInPivotModeToolPanel(x(Q),Y))return;if(Y.isAllowValue()){let W=typeof Y.getAggFunc()==="string"?Y.getAggFunc():G.aggFuncSvc?.getDefaultAggFunc(Y);U.push({colId:Y.getId(),aggFunc:W})}else if(Y.isAllowRowGroup())U.push({colId:Y.getId(),rowGroup:!0});else if(Y.isAllowPivot())U.push({colId:Y.getId(),pivot:!0})}:(Y)=>{if(J.isColumnSelectedInPivotModeToolPanel(x(Q),Y))U.push({colId:Y.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};D.forEach(X),J.applyColumnState(x(Q),U,B),YG(G,Q)}function $7(G,D){let{columns:z,visibleState:B,pivotState:Q,eventType:J}=D,U=G.columnStateUpdateStrategy,Z=U.getPivotMode(x(D)),S=z.map((X)=>{let Y=X.getColId();if(Z){let W=Q?.[Y];return{colId:Y,pivot:W?.pivot,rowGroup:W?.rowGroup,aggFunc:W?.aggFunc}}else return{colId:Y,hide:!B?.[Y]}});U.applyColumnState(x(D),S,J),YG(G,D)}function k3(G){return{pivot:G.isPivotActive(),rowGroup:G.isRowGroupActive(),aggFunc:G.isValueActive()?G.getAggFunc():void 0}}function L7(G,D,z){if(!z)return k3(G);let B=D.getRowGroupColumns(z).includes(G),Q=D.getPivotColumns(z).includes(G),J=D.getValueColumns(z).includes(G);return{pivot:Q,rowGroup:B,aggFunc:J?D.getColumnAggFunc(z,G):void 0}}var S7=(G,D)=>{if(!D)return[];let z=G;for(let B=0,Q=D.length;B{let B=G.aggData;if(B===D)return;if(G.aggData=D,G.__localEventService)F3(G,B,D,z)},JZ=(G,D,z)=>{aD(G,D,z);let B=G.pinnedSibling;if(B)aD(B,D,z);let Q=G.sibling;if(Q){aD(Q,D,z);let J=Q.pinnedSibling;if(J)aD(J,D,z)}},F3=(G,D,z,B)=>{if(!z){if(!D)return;let U=Object.keys(D);for(let Z=0,S=U.length;Z{let Q=D.getCol(z),J=G._groupData;if(!J)J={},G._groupData=J;let U=Q.getColId(),Z=J[U];if(Z===B)return;J[U]=B,G.dispatchCellChangedEvent(Q,B,Z)},ZZ=(G,D,z)=>{if(!G)return;let B=G.group;if(B===z)return;if(G.group=z,G.updateHasChildren(),B&&!z)aD(G,null,D.colModel),G.setAllChildrenCount(null);D.selectionSvc?.updateRowSelectable(G),G.dispatchRowEvent("groupChanged")},kJ=(G,D,z)=>{ZZ(G,D,z),ZZ(G.pinnedSibling,D,z)},Z0=(G,D)=>{let{gos:z,rowGroupColsSvc:B}=D;if(!B||!G)return!1;let Q=z.get("groupLockGroupColumns");if(!G.isRowGroupActive()||Q===0)return!1;if(Q===-1)return!0;let J=B.columns.findIndex((U)=>U.getColId()===G.getColId());return Q>J},Q0=(G,D,z)=>{let Q=G(D,`${D==="groupBy"?"Group by":"Un-Group by"} ${z}`,[z]);if(Q.indexOf(z)>=0)return Q;else return`${Q} ${z}`};function V3(G){let D=A3(G),z="getSelection"in D?D.getSelection():null,B=[];for(let Q=0;Q<(z?.rangeCount??0);Q++){let J=z?.getRangeAt(Q);if(J)B.push(J)}return{selection:z,ranges:B}}function b3(G,D){if(!G.gos.get("enableCellTextSelection"))return D();if(!R3()&&!C3())return D();let{selection:B,ranges:Q}=V3(G);D(),B?.removeAllRanges();for(let J of Q)B?.addRange(J)}var v3={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},wJ={getMenuItemComp:(G,D,z)=>{return G.userCompFactory.getCompDetails(D,v3,"agMenuItem",I3(G.gos,z),!0)?.newAgStackInstance()??$Z.resolve()},getPostProcessPopupParams:({column:G,node:D})=>({column:G,rowNode:D}),preserveRangesWhile:b3,stopPropagationCallbacks:E3,warnNoItem:(G)=>{M3(228,{menuItemOrString:G})}},O3=class extends NB{constructor(){super(wJ)}},KJ=class extends uB{constructor(G,D={column:null,node:null,value:null}){super(G,D,wJ)}},X7=class extends w3{constructor(G,D,z,B={}){super({tag:"div",cls:"ag-menu"});this.column=G,this.mouseEventOrTouch=D,this.parentEl=z,this.params=B,this.displayName=null}postConstruct(){let{column:G,beans:{colNames:D}}=this;this.initializeProperties(G);let z;if(f3(G))z=D.getDisplayNameForColumn(G,"columnToolPanel");else z=D.getDisplayNameForProvidedColumnGroup(null,G,"columnToolPanel");if(this.displayName=z,this.buildMenuItemMap(),this.isActive()){let B=this.mouseEventOrTouch;if("preventDefault"in B)B.preventDefault();let Q=this.getMappedMenuItems();if(Q.length===0)return;this.displayContextMenu(Q)}}initializeProperties(G){let D=this.beans.columnStateUpdateStrategy,z;if(N3(G))z=G.getLeafColumns();else z=[G];this.columns=z;let B=D.getPivotMode(x(this.params));this.allowScrollIntoView=!B&&z.some(this.isColumnValidForScrollIntoView),this.allowGrouping=z.some((Q)=>Q.isPrimary()&&Q.isAllowRowGroup()),this.allowValues=z.some((Q)=>Q.isPrimary()&&Q.isAllowValue()),this.allowPivoting=B&&z.some((Q)=>Q.isPrimary()&&Q.isAllowPivot())}buildMenuItemMap(){let G=this.getLocaleTextFunc(),{beans:D,displayName:z}=this,B=this.beans.columnStateUpdateStrategy,Q=new Map;this.menuItemMap=Q;let J=x(this.params),U=B.getPivotMode(J),Z=new Set(B.getRowGroupColumns(J).map((H)=>H.getColId())),S=new Set(B.getValueColumns(J).map((H)=>H.getColId())),X=new Set(B.getPivotColumns(J).map((H)=>H.getColId()));Q.set("scrollIntoView",{allowedFunction:(H)=>!H.isPinned()&&!U&&this.isColumnValidForScrollIntoView(H),activeFunction:()=>!1,activateLabel:()=>G("scrollColumnIntoView",`Scroll ${z} into View`,[z]),activateFunction:()=>{let H=this.columns.find(this.isColumnValidForScrollIntoView);if(H)this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(H)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});let Y=(H)=>H.isPrimary()&&H.isAllowRowGroup()&&!Z0(H,D);Q.set("rowGroup",{allowedFunction:Y,activeFunction:(H)=>Z.has(H.getColId()),activateLabel:()=>Q0(G,"groupBy",z),deactivateLabel:()=>Q0(G,"ungroupBy",z),activateFunction:()=>{let H=this.addColumnsToList(B.getRowGroupColumns(J),Y);B.setRowGroupColumns(J,H,"toolPanelUi"),YG(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(B.getRowGroupColumns(J),Y);B.setRowGroupColumns(J,H,"toolPanelUi"),YG(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});let W=(H)=>H.isPrimary()&&H.isAllowValue();Q.set("value",{allowedFunction:W,activeFunction:(H)=>S.has(H.getColId()),activateLabel:()=>G("addToValues",`Add ${z} to values`,[z]),deactivateLabel:()=>G("removeFromValues",`Remove ${z} from values`,[z]),activateFunction:()=>{let H=this.addColumnsToList(B.getValueColumns(J),W);B.setValueColumns(J,H,"toolPanelUi"),YG(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(B.getValueColumns(J),W);B.setValueColumns(J,H,"toolPanelUi"),YG(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});let q=(H)=>U&&H.isPrimary()&&H.isAllowPivot();Q.set("pivot",{allowedFunction:q,activeFunction:(H)=>X.has(H.getColId()),activateLabel:()=>G("addToLabels",`Add ${z} to labels`,[z]),deactivateLabel:()=>G("removeFromLabels",`Remove ${z} from labels`,[z]),activateFunction:()=>{let H=this.addColumnsToList(B.getPivotColumns(J),q);B.setPivotColumns(J,H,"toolPanelUi"),YG(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(B.getPivotColumns(J),q);B.setPivotColumns(J,H,"toolPanelUi"),YG(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(G){if(!G.isVisible())return!1;let z=G.getParent();if(!z)return!0;return z.getDisplayedChildren()?.includes(G)??!0}addColumnsToList(G,D){return[...G].concat(this.columns.filter((z)=>D(z)&&!G.includes(z)))}removeColumnsFromList(G,D){return G.filter((z)=>!D(z)||!this.columns.includes(z))}displayContextMenu(G){let D=this.getGui(),z=this.createBean(new KJ),B=this.getLocaleTextFunc(),Q=()=>{};D.appendChild(z.getGui()),z.addMenuItems(G),z.addManagedListeners(z,{closeMenu:()=>{this.parentEl.focus(),Q()}});let J=this.beans.popupSvc,U=J.addPopup({modal:!0,eChild:D,closeOnEsc:!0,afterGuiAttached:()=>K3(z.getGui()),ariaLabel:B("ariaLabelContextMenu","Context Menu"),closedCallback:(Z)=>{if(Z instanceof KeyboardEvent)this.parentEl.focus();this.destroyBean(z)}});if(U)Q=U.hideFunc;J.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:D})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){let G=[],{menuItemMap:D,columns:z,displayName:B,beans:Q}=this;for(let J of D.values()){let U=z.some((S)=>J.allowedFunction(S)&&!J.activeFunction(S)),Z=z.some((S)=>J.allowedFunction(S)&&J.activeFunction(S));if(U)G.push({name:J.activateLabel(B),icon:QZ(J.addIcon,Q,null),action:()=>J.activateFunction()});if(Z&&J.removeIcon&&J.deactivateLabel)G.push({name:J.deactivateLabel(B),icon:QZ(J.removeIcon,Q,null),action:()=>J.deActivateFunction?.()})}return G}},u3={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},Y7=class extends J3{constructor(G,D,z,B,Q){super();this.modelItem=G,this.allowDragging=D,this.eventType=z,this.focusWrapper=B,this.params=Q,this.cbSelect=Az,this.eLabel=Az,this.eGroupOpenedIcon=Az,this.eGroupClosedIcon=Az,this.eColumnGroupIcons=Az,this.processingColumnStateChange=!1;let{columnGroup:J,depth:U,displayName:Z}=G;this.columnGroup=J,this.columnDepth=U,this.displayName=Z}postConstruct(){this.setTemplate(u3,[Q3]);let{beans:G,cbSelect:D,eLabel:z,displayName:B,columnDepth:Q,modelItem:J,focusWrapper:U,columnGroup:Z}=this,{registry:S,gos:X}=G,Y=Z3("columnDrag",G);this.eDragHandle=Y,Y.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");let W=D.getGui(),q=D.getInputElement();W.after(Y),q.setAttribute("tabindex","-1"),z.textContent=B??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+Q),this.getGui().style.setProperty("--ag-indentation-level",String(Q)),this.tooltipFeature=this.createOptionalManagedBean(S.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:$3(X,()=>z)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(z,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(D,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(J,{expandedChanged:this.onExpandChanged.bind(this)});let H=new zZ(this.getGui(),!1);this.addManagedListeners(H,{longTap:(k)=>this.onContextMenu(k.touchStart)}),this.addDestroyFunc(H.destroy.bind(H)),this.addManagedListeners(U,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();let _=L3(Z.getColGroupDef(),X,null,Z);for(let k of _)this.toggleCss(k,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){let G=this.columnGroup.getColGroupDef();if(!G)return;let D=()=>this.tooltipFeature?.setTooltipAndRefresh(G.headerTooltip);D(),this.addManagedEventListeners({newColumnsLoaded:D})}handleKeyDown(G){switch(G.key){case CQ.LEFT:G.preventDefault(),this.modelItem.expanded=!1;break;case CQ.RIGHT:G.preventDefault(),this.modelItem.expanded=!0;break;case CQ.SPACE:if(G.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(G){let{columnGroup:D,gos:z}=this;if(z.get("functionsReadOnly"))return;let B=this.createBean(new X7(D,G,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(B.isAlive())this.destroyBean(B)})}addVisibilityListenersToAllChildren(){let G=this.onColumnStateChanged.bind(this);for(let D of this.columnGroup.getLeafColumns())this.addManagedListeners(D,{visibleChanged:G,columnValueChanged:G,columnPivotChanged:G,columnRowGroupChanged:G})}setupDragging(){if(!this.allowDragging){VQ(this.eDragHandle,!1);return}let G=this.beans,{gos:D,eventSvc:z,dragAndDrop:B}=G,Q=!D.get("suppressDragLeaveHidesColumns"),J={type:U3.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>Q?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{Q=!D.get("suppressDragLeaveHidesColumns"),z.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{z.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(U)=>{if(Q)$7(G,{columns:this.columnGroup.getLeafColumns(),visibleState:U?.visibleState,pivotState:U?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{if(Q)this.onChangeCommon(!1)}};B.addDragSource(J,!0),this.addDestroyFunc(()=>B.removeDragSource(J))}createDragItem(){let G=this.columnGroup.getLeafColumns(),D={},z={},B=this.beans.columnStateUpdateStrategy,Q=x(this.params);for(let J of G){let U=J.getId();D[U]=J.isVisible(),z[U]=L7(J,B,Q)}return{columns:G,visibleState:D,pivotState:z}}setupExpandContract(){let{beans:G,eGroupClosedIcon:D,eGroupOpenedIcon:z,eColumnGroupIcons:B}=this;D.appendChild(BZ("columnSelectClosed",G,null)),z.appendChild(BZ("columnSelectOpen",G,null));let Q=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(D,{click:Q}),this.addManagedElementListeners(z,{click:Q});let J=new zZ(B,!0);this.addManagedListeners(J,{tap:Q}),this.addDestroyFunc(J.destroy.bind(J))}onLabelClicked(){let G=!this.cbSelect.getValue();this.onChangeCommon(G)}onCheckboxChanged(G){this.onChangeCommon(G.selected)}getVisibleLeafColumns(){let G=[],D=(z)=>{for(let B of z)if(B.passesFilter)if(B.group)D(B.children);else G.push(B.column)};return D(this.modelItem.children),G}onChangeCommon(G){if(this.refreshAriaLabel(),this.processingColumnStateChange)return;U7(this.beans,this.modelItem.children,G,this.eventType,this.params)}refreshAriaLabel(){let{cbSelect:G,focusWrapper:D,displayName:z}=this,B=this.getLocaleTextFunc(),Q=B("ariaColumnGroup","Column Group"),J=G.getValue(),U=J===void 0?B("ariaIndeterminate","indeterminate"):J?B("ariaVisible","visible"):B("ariaHidden","hidden"),Z=B("ariaToggleVisibility","Press SPACE to toggle visibility");Y3(D,`${z} ${Q}`),G.setInputAriaLabel(`${Z} (${U})`),S3(D,G.getInputElement().id)}onColumnStateChanged(){let G=this.workOutSelectedValue(),D=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;let z=this.cbSelect;z.setValue(G),z.setReadOnly(D),this.toggleCss("ag-column-select-column-group-readonly",D),this.processingColumnStateChange=!1}workOutSelectedValue(){let D=this.beans.columnStateUpdateStrategy.getPivotMode(x(this.params)),z=this.getVisibleLeafColumns(),B=0,Q=0;for(let J of z)if(D||!J.getColDef().lockVisible)if(this.isColumnChecked(J))B++;else Q++;if(B>0&&Q>0)return;return B>0}workOutReadOnlyValue(){let G=this.beans.columnStateUpdateStrategy.getPivotMode(x(this.params)),D=0;for(let z of this.columnGroup.getLeafColumns())if(G){if(z.isAnyFunctionAllowed())D++}else if(!z.getColDef().lockVisible)D++;return D===0}isColumnChecked(G){let D=this.beans.columnStateUpdateStrategy;if(D.getPivotMode(x(this.params)))return D.isColumnSelectedInPivotModeToolPanel(x(this.params),G);return D.isColumnVisibleInToolPanel(x(this.params),G)}onExpandOrContractClicked(){let G=this.modelItem,D=G.expanded;G.expanded=!D}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){let G=this.modelItem.expanded;VQ(this.eGroupClosedIcon,!G),VQ(this.eGroupOpenedIcon,G)}refreshAriaExpanded(){X3(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(G){let D=this.cbSelect,z=D.getValue();if(!D.isReadOnly()&&(G&&!z||!G&&z))D.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(G){this.cbSelect.setValue(G,!0)}},bQ=(G)=>{if(B3(G))return G.getLeafColumns();return G?[G]:[]},j3=(G,D,z,B)=>{if(!D||!G)return null;let Q=B.indexOf(D),J=z?Q:Q+1,U=P3(B,G,J);return J-U},P3=(G,D,z)=>{if(!D)return 0;let B=D[0],Q=D.length;if(G.indexOf(B){let Q=x(B);if(G.get("suppressMovableColumns")||D.columnStateUpdateStrategy.getPivotMode(Q))return!0;return!!z.find(({colDef:Z})=>!!Z.suppressMovable||!!Z.lockPosition)},SZ=(G,D,z,B)=>{if(!z)return;let{component:Q}=z,J=null,U=z.position==="top";if(Q instanceof Y7)J=Q.getColumns()[0],U=!0;else if(Q)J=Q.column;if(!J)return;let Z=x(B),S=Z?G.columnStateUpdateStrategy.getPrimaryColumns(Z):G.colModel.getCols(),X=j3(D,J,U,S);if(X!=null)G.columnStateUpdateStrategy.moveColumns(Z,D,X,"toolPanelUi"),YG(G,B)},g3=(G)=>{return G.column},s3={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},o3=class extends y3{constructor(G,D,z,B,Q){super();this.modelItem=G,this.allowDragging=D,this.groupsExist=z,this.focusWrapper=B,this.params=Q,this.eLabel=XZ,this.cbSelect=XZ,this.processingColumnStateChange=!1;let{column:J,depth:U,displayName:Z}=G;this.column=J,this.columnDepth=U,this.displayName=Z}postConstruct(){this.setTemplate(s3,[T3]);let{beans:G,cbSelect:D,displayName:z,eLabel:B,columnDepth:Q,groupsExist:J,column:U,gos:Z,focusWrapper:S}=this,X=i3("columnDrag",G);this.eDragHandle=X,X.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");let Y=D.getGui(),W=D.getInputElement();if(Y.after(X),W.setAttribute("tabindex","-1"),B.textContent=z,J)this.addCss("ag-column-select-add-group-indent");this.addCss(`ag-column-select-indent-${Q}`),this.getGui().style.setProperty("--ag-indentation-level",String(Q)),this.tooltipFeature=this.createOptionalManagedBean(G.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:n3(Z,()=>B),getAdditionalParams:()=>({colDef:U.getColDef()})})),this.setupDragging();let q=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:q}),this.addManagedListeners(U,{columnValueChanged:q,columnPivotChanged:q,columnRowGroupChanged:q,visibleChanged:q}),this.addManagedListeners(S,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});let H=new h3(S);this.addManagedListeners(H,{longTap:(k)=>this.onContextMenu(k.touchStart)}),this.addDestroyFunc(H.destroy.bind(H)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(D,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(B,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();let _=d3(U.getColDef(),Z,U,null);for(let k of _)this.toggleCss(k,!0)}getColumn(){return this.column}setupTooltip(){let G=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);G(),this.addManagedEventListeners({newColumnsLoaded:G})}onContextMenu(G){let{column:D,gos:z}=this;if(z.get("functionsReadOnly"))return;let B=this.createBean(new X7(D,G,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(B.isAlive())this.destroyBean(B)})}handleKeyDown(G){if(G.key===c3.SPACE){if(G.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected())}}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;let G=!this.cbSelect.getValue();this.onChangeCommon(G)}onCheckboxChanged(G){this.onChangeCommon(G.selected)}onChangeCommon(G){if(this.cbSelect.isReadOnly())return;if(this.refreshAriaLabel(),this.processingColumnStateChange)return;Z7(this.beans,[this.column],G,"toolPanelUi",this.params)}refreshAriaLabel(){let{cbSelect:G,focusWrapper:D,displayName:z}=this,B=this.getLocaleTextFunc(),Q=B("ariaColumn","Column"),J=G.getValue()?B("ariaVisible","visible"):B("ariaHidden","hidden"),U=B("ariaToggleVisibility","Press SPACE to toggle visibility");p3(D,`${z} ${Q}`),this.cbSelect.setInputAriaLabel(`${U} (${J})`),l3(D,G.getInputElement().id)}setupDragging(){let G=this.eDragHandle;if(!this.allowDragging){m3(G,!1);return}let D=this.beans,{gos:z,eventSvc:B,dragAndDrop:Q}=D;if(x(this.params))G.setAttribute("data-column-tool-panel-deferred","");let J=!z.get("suppressDragLeaveHidesColumns"),U={type:x3.ToolPanel,eElement:G,dragItemName:this.displayName,getDefaultIconName:()=>J&&!x(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{J=!z.get("suppressDragLeaveHidesColumns"),B.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{B.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(Z)=>{if(J&&!x(this.params))$7(D,{columns:[this.column],visibleState:Z?.visibleState,pivotState:Z?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{if(J&&!x(this.params))this.onChangeCommon(!1)}};Q.addDragSource(U,!0),this.addDestroyFunc(()=>Q.removeDragSource(U))}createDragItem(){let G=this.column.getColId(),D={[G]:this.column.isVisible()},z=this.beans.columnStateUpdateStrategy,B={[G]:L7(this.column,z,x(this.params))};return{columns:[this.column],visibleState:D,pivotState:B}}onColumnStateChanged(){this.processingColumnStateChange=!0;let G=this.beans.columnStateUpdateStrategy,D=G.getPivotMode(x(this.params));if(D){let Q=G.isColumnSelectedInPivotModeToolPanel(x(this.params),this.column);this.cbSelect.setValue(Q)}else this.cbSelect.setValue(G.isColumnVisibleInToolPanel(x(this.params),this.column));let z=!0,B=!0;if(D){let Q=this.gos.get("functionsReadOnly"),J=!this.column.isAnyFunctionAllowed();z=!Q&&!J,B=z}else{let{enableRowGroup:Q,enableValue:J,lockPosition:U,suppressMovable:Z,lockVisible:S}=this.column.getColDef(),X=!!Q||!!J,Y=!!U||!!Z;z=!S,B=X||!Y}this.cbSelect.setReadOnly(!z),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!B),this.toggleCss("ag-column-select-column-readonly",!B&&!z),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(G){let D=this.cbSelect;if(G!==D.getValue()){if(!D.isReadOnly())D.toggle()}}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(G){t3(158)}},r3=class{constructor(G){this.items=G}getRowCount(){return this.items.length}getRow(G){return this.items[G]}},a3="ag-column-select-list",e3=class extends dk{constructor(){super({tag:"div",cls:a3,role:"presentation"});this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(G){this.colModel=G.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(let G of this.destroyColumnItemFuncs)G();this.destroyColumnItemFuncs=[]}init(G,D,z){this.params=G;let{suppressSyncLayoutWithGrid:B,contractColumnSelection:Q,suppressColumnMove:J}=G;if(this.allowDragging=D,this.eventType=z,!B)this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)});this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});let U=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:U,columnPivotModeChanged:U,columnRowGroupChanged:U,columnValueChanged:U,columnVisible:U,newColumnsLoaded:U}),this.expandGroupsByDefault=!Q;let Z=J||B,S=this.createManagedBean(new Lz({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(X,Y)=>{if(Z)return;this.moveItems(X,Y)}}));if(this.virtualList=S,this.appendChild(S.getGui()),S.setComponentCreator((X,Y)=>{return mk(Y,X.depth+1),this.createComponentFromItem(X,Y)}),this.colModel.ready)this.onColumnsChanged();if(Z)return;this.createItemDragFeature()}createItemDragFeature(){let{gos:G,beans:D,virtualList:z}=this;this.createManagedBean(new c6(this,z,{dragSourceType:lk.ToolPanel,addListeners:(B,Q,J)=>{B.addManagedEventListeners({columnPanelItemDragStart:Q,columnPanelItemDragEnd:J})},getCurrentDragValue:(B)=>g3(B),isMoveBlocked:(B)=>LZ(G,D,bQ(B),this.params),getNumRows:(B)=>B.getDisplayedColsList().length,moveItem:(B,Q)=>SZ(D,bQ(B),Q,this.params)}))}moveItems(G,D){let{gos:z,beans:B}=this,{modelItem:Q}=G,{group:J,columnGroup:U,column:Z,expanded:S}=Q,X=bQ(J?U:Z);if(LZ(z,B,X,this.params))return;let Y=this.displayedColsList.indexOf(Q),W=D?-1:1,q=0;if(D){let _=G.columnDepth>0?Z.getParent()?.getChildren():null;if(_?.length&&Z===_[0])q=-1}else if(J)q=S?Q.children.length:0;let H=Math.min(Math.max(Y+q+W,0),this.displayedColsList.length-1);this.skipRefocus=!0,SZ(B,X,{rowIndex:H,position:D?"top":"bottom",component:this.virtualList.getComponentAt(H)},this.params),this.focusRowIfAlive(H-q).then(()=>{this.skipRefocus=!1})}createComponentFromItem(G,D){let z=this.allowDragging;if(G.group){let Q=new Y7(G,z,this.eventType,D,this.params);return this.createBean(Q),Q}let B=new o3(G,z,this.groupsExist,D,this.params);return this.createBean(B),B}onColumnsChanged(){let G=this.params;if(!this.hasLoadedInitialState)this.hasLoadedInitialState=!0,this.isInitialState=!!G.initialState;let D=this.getExpandedStates(),z=this.colModel.isPivotMode(),B=x(G),Q=B&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(B);if((!G.suppressSyncLayoutWithGrid||B)&&!z||Q)this.buildTreeFromWhatGridIsDisplaying();else this.buildTreeFromProvidedColumnDefs();this.setExpandedStates(D),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){let G={};if(this.isInitialState){let{expandedGroupIds:D}=this.params.initialState;for(let z of D)G[z]=!0;return G}if(!this.allColsTree)return{};return this.forEachItem((D)=>{if(!D.group)return;let z=D.columnGroup;if(z)G[z.getId()]=D.expanded}),G}setExpandedStates(G){if(!this.allColsTree)return;let{isInitialState:D}=this;this.forEachItem((z)=>{if(!z.group)return;let B=z.columnGroup;if(B){let Q=G[B.getId()];if(Q!=null||D)z.expanded=!!Q}})}buildTreeFromWhatGridIsDisplaying(){let G=x(this.params);if(G&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(G)){let D=this.beans.columnStateUpdateStrategy.getPrimaryColumns(G);if(D.length>0){G3(D,this.setColumnLayout.bind(this));return}}if(this.params.suppressSyncLayoutWithGrid){this.buildTreeFromProvidedColumnDefs();return}Q7(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(G){let D=B7(this.colModel,G);this.buildListModel(D),this.groupsExist=G.some((z)=>{return z&&typeof z.children<"u"}),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){let G=this.colModel;this.buildListModel(G.getColDefColTree()),this.groupsExist=!!G.colDefCols?.treeDepth}buildListModel(G){let D=this.onColumnExpanded.bind(this),z=(Z)=>{Z.addEventListener("expandedChanged",D);let S=Z.removeEventListener.bind(Z,"expandedChanged",D);this.destroyColumnItemFuncs.push(S)},B=this.beans.colNames,Q=(Z,S,X)=>{for(let Y of Z)if(sk(Y))J(Y,S,X);else U(Y,S,X)},J=(Z,S,X)=>{if(Z.getColGroupDef()?.suppressColumnsToolPanel)return;if(Z.isPadding()){Q(Z.getChildren(),S,X);return}let q=B.getDisplayNameForProvidedColumnGroup(null,Z,"columnToolPanel"),H=new DZ(q,Z,S,!0,this.expandGroupsByDefault);X.push(H),z(H),Q(Z.getChildren(),S+1,H.children)},U=(Z,S,X)=>{if(Z.getColDef()?.suppressColumnsToolPanel)return;let W=B.getDisplayNameForColumn(Z,"columnToolPanel");X.push(new DZ(W,Z,S))};this.destroyColumnTree(),Q(G,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];let G=(B)=>{if(!B.passesFilter)return;if(this.displayedColsList.push(B),B.group&&B.expanded)B.children.forEach(G)},D=this.virtualList;this.allColsTree.forEach(G),D.setModel(new r3(this.displayedColsList));let z=null;if(!this.skipRefocus)z=D.getLastFocusedRow();if(D.refresh(),z!=null)this.focusRowIfAlive(z);this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){let G=this.getLocaleTextFunc(),D=G("ariaColumnPanelList","Column List"),z=G("columns","Columns"),B=this.displayedColsList.length;pk(this.virtualList.getAriaElement(),`${D} ${B} ${z}`)}focusRowIfAlive(G){if(G===-1)return Promise.resolve();return new Promise((D)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(G);D()},0)})}forEachItem(G){let D=(B)=>{for(let Q of B)if(G(Q),Q.group)D(Q.children)},z=this.allColsTree;if(!z)return;D(z)}doSetExpandedAll(G){this.forEachItem((D)=>{if(D.group)D.expanded=G})}setGroupsExpanded(G,D){if(!D){this.doSetExpandedAll(G);return}let z=[];this.forEachItem((Q)=>{if(!Q.group)return;let J=Q.columnGroup.getId();if(D.indexOf(J)>=0)Q.expanded=G,z.push(J)});let B=D.filter((Q)=>!z.includes(Q));if(B.length>0)tk(157,{unrecognisedGroupIds:B})}getExpandState(){let G=0,D=0;if(this.forEachItem((z)=>{if(!z.group)return;if(z.expanded)G++;else D++}),G>0&&D>0)return 2;if(D>0)return 1;return 0}doSetSelectedAll(G){U7(this.beans,this.allColsTree,G,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let G=0;G{if(Q.group)return;if(!Q.passesFilter)return;let J=Q.column,U=J.getColDef(),Z;if(B){if(!J.isAllowPivot()&&!J.isAllowRowGroup()&&!J.isAllowValue())return;Z=z.isColumnSelectedInPivotModeToolPanel(x(this.params),J)??!1}else{if(U.lockVisible)return;Z=z.isColumnVisibleInToolPanel(x(this.params),J)??!1}if(Z)G++;else D++}),G>0&&D>0)return;return!(G===0||D>0)}setFilterText(G){this.filterText=GZ(G)?G.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){let G=(z)=>{if(!GZ(this.filterText))return!0;let B=z.displayName;return B==null||B.toLowerCase().indexOf(this.filterText)!==-1},D=(z,B)=>{let Q=!1;if(z.group){let U=G(z);for(let Z of z.children){let S=D(Z,U||B);if(S)Q=S}}let J=B||Q?!0:G(z);return z.passesFilter=J,J};for(let z of this.allColsTree)D(z,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){let G=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:G})}fireSelectionChangedEvent(){if(!this.allColsTree)return;let G=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:G})}getExpandedGroups(){let G=[];if(!this.allColsTree)return G;return this.forEachItem((D)=>{if(D.group&&D.expanded)G.push(D.columnGroup.getId())}),G}},Gw={selector:"AG-PRIMARY-COLS-LIST",component:e3},Dw={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},W7=class extends Ok{constructor(){super(Dw,[nk,Gw]);this.primaryColsHeaderPanel=eU,this.primaryColsListPanel=eU,this.registerCSS(jk)}init(G,D,z){let{primaryColsHeaderPanel:B,primaryColsListPanel:Q}=this;B.init(D);let{suppressColumnFilter:J,suppressColumnSelectAll:U}=D;if(D.suppressColumnExpandAll&&J&&U)B.setDisplayed(!1);this.addManagedListeners(Q,{groupExpanded:(S)=>{B.setExpandState(S.state),D.onStateUpdated()},selectionChanged:(S)=>B.setSelectionState(S.state)}),Q.init(D,G,z),this.addManagedListeners(B,{expandAll:Q.doSetExpandedAll.bind(Q,!0),collapseAll:Q.doSetExpandedAll.bind(Q,!1),selectAll:Q.doSetSelectedAll.bind(Q,!0),unselectAll:Q.doSetSelectedAll.bind(Q,!1),filterChanged:(S)=>Q.setFilterText(S.filterText)}),this.positionableFeature=this.createManagedBean(new uk(this.getGui(),{minHeight:100}))}toggleResizable(G){this.positionableFeature.setResizable(G?{bottom:!0}:!1)}expandGroups(G){this.primaryColsListPanel.setGroupsExpanded(!0,G)}collapseGroups(G){this.primaryColsListPanel.setGroupsExpanded(!1,G)}setColumnLayout(G){this.primaryColsListPanel.setColumnLayout(G)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},zw=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}",Bw="ag-column-panel-deferred",Qw=class extends Ak{constructor(){super({tag:"div",cls:"ag-column-panel"});this.initialised=!1,this.childDestroyFuncs=[],this.isDeferModeEnabled=!1,this.isCommitting=!1,this.onDeferredApply=()=>{this.isCommitting=!0;try{this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled)}finally{this.isCommitting=!1}this.deferredButtonsComp?.updateValidity(!1),this.lastKnownGridState=this.captureGridState()},this.onDeferredCancel=()=>{this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy(),this.lastKnownGridState=this.captureGridState()},this.onPivotModePanelValueChanged=()=>{this.refreshToolPanelLayouts(),this.setLastVisible(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))},this.onColumnEverythingChanged=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;let G=this.captureGridState();if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)){this.lastKnownGridState=G;return}let D=this.lastKnownGridState&&this.isGridStateEqual(this.lastKnownGridState,G);if(this.lastKnownGridState=G,!D)return;this.resetDeferredState()},this.onExternalGridChange=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))return;this.resetDeferredState(),this.lastKnownGridState=this.captureGridState()},this.registerCSS(zw)}wireBeans(G){this.colToolPanelFactory=G.colToolPanelFactory}setVisible(G){if(super.setDisplayed(G),G&&!this.initialised)this.init(this.params)}init(G){let z={...Ck(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...G};this.params=z;let{childDestroyFuncs:B,colToolPanelFactory:Q,gos:J}=this,U=J.isModuleRegistered("SharedPivot"),Z=U||J.isModuleRegistered("SharedRowGrouping");if(this.isDeferModeEnabled=x(z),this.toggleCss(Bw,this.isDeferModeEnabled),!z.suppressPivotMode&&Q&&U)this.pivotModePanel=Q.createPivotModePanel(this,B,z,this.onPivotModePanelValueChanged);let S=this.createBean(new W7);if(this.primaryColsPanel=S,B.push(()=>this.destroyBean(this.primaryColsPanel)),S.init(!0,z,"toolPanelUi"),S.addCss("ag-column-panel-column-select"),this.appendChild(S),Q){if(!z.suppressRowGroups&&Z)this.rowGroupDropZonePanel=Q.createRowGroupPanel(this,B,z);if(!z.suppressValues&&Z)this.valuesDropZonePanel=Q.createValuesPanel(this,B,z);if(!z.suppressPivots&&U)this.pivotDropZonePanel=Q.createPivotPanel(this,B,z);this.setLastVisible();let[X]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});B.push(()=>X())}if(this.isDeferModeEnabled){let X=this.onExternalGridChange;B.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:X,columnVisible:X,columnRowGroupChanged:X,columnValueChanged:X,columnPivotChanged:X,columnPivotModeChanged:X,newColumnsLoaded:X,...z.suppressSyncLayoutWithGrid?{}:{columnMoved:X}}))}if(z.buttons){if(!z.buttons.includes("apply"))vk(298);if(z.buttons.length)this.initDeferredButtons(z.buttons)}this.initialised=!0}initDeferredButtons(G){let D=this.createBean(new Rk({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=D,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});let z=this.getLocaleTextFunc(),B=G.map((Q)=>({type:Q,label:z(Q==="apply"?"applyColumnToolPanel":"cancelColumnToolPanel",Q==="apply"?"Apply":"Cancel")}));D.updateButtons(B),D.updateValidity(!1),D.addManagedListeners(D,{apply:this.onDeferredApply,cancel:this.onDeferredCancel}),this.appendChild(D)}resetDeferredState(){this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy()}captureGridState(){let{beans:G}=this,D=(z)=>(z??[]).map((B)=>B.getColId());return{rowGroupColIds:D(G.rowGroupColsSvc?.columns),valueColIds:D(G.valueColsSvc?.columns),pivotColIds:D(G.pivotColsSvc?.columns),pivotMode:G.colModel.isPivotMode(),columnOrder:G.colModel.getCols().map((z)=>z.getColId()),visibleColIds:G.colModel.getCols().filter((z)=>z.isVisible()).map((z)=>z.getColId()),sortState:G.colModel.getCols().filter((z)=>z.getSort()).map((z)=>`${z.getColId()}:${z.getSort()}:${z.getSortIndex()}`),aggFuncState:(G.valueColsSvc?.columns??[]).map((z)=>z.getAggFunc()),widthState:G.colModel.getCols().map((z)=>`${z.getColId()}:${z.getActualWidth()}`)}}isGridStateEqual(G,D){return aG(G.rowGroupColIds,D.rowGroupColIds)&&aG(G.valueColIds,D.valueColIds)&&aG(G.pivotColIds,D.pivotColIds)&&G.pivotMode===D.pivotMode&&aG(G.columnOrder,D.columnOrder)&&aG(G.visibleColIds,D.visibleColIds)&&aG(G.sortState,D.sortState)&&aG(G.aggFuncState,D.aggFuncState)&&aG(G.widthState,D.widthState)}refreshDeferredUi(){this.refreshToolPanelLayouts(),this.setLastVisible(),this.pivotModePanel?.refreshEditStrategy(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))}refreshToolPanelLayouts(){this.primaryColsPanel.syncLayoutWithGrid(),this.rowGroupDropZonePanel?.refreshGui(),this.valuesDropZonePanel?.refreshGui(),this.pivotDropZonePanel?.refresh()}setPivotModeSectionVisible(G){let D=this.colToolPanelFactory;if(!D)return;this.pivotModePanel=D.setPanelVisible(this.pivotModePanel,G,D.createPivotModePanel.bind(D,this,this.childDestroyFuncs,this.params,this.onPivotModePanelValueChanged,!0)),this.setLastVisible()}setRowGroupsSectionVisible(G){let D=this.colToolPanelFactory;if(!D)return;this.rowGroupDropZonePanel=D.setPanelVisible(this.rowGroupDropZonePanel,G,D.createRowGroupPanel.bind(D,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setValuesSectionVisible(G){let D=this.colToolPanelFactory;if(!D)return;this.valuesDropZonePanel=D.setPanelVisible(this.valuesDropZonePanel,G,D.createValuesPanel.bind(D,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setPivotSectionVisible(G){let D=this.colToolPanelFactory;if(!D)return;this.pivotDropZonePanel=D.setPanelVisible(this.pivotDropZonePanel,G,D.createPivotPanel.bind(D,this,this.childDestroyFuncs,this.params)),this.pivotDropZonePanel?.setDisplayed(G),this.setLastVisible()}setResizers(){for(let G of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!G)continue;let D=G.getGui();G.toggleResizable(!D.classList.contains("ag-last-column-drop")&&!D.classList.contains("ag-hidden")&&!D.classList.contains("ag-last-visible-child"))}}setLastVisible(){let G=this.getGui(),D=Array.prototype.slice.call(G.querySelectorAll(".ag-column-drop"));for(let Q of D)Q.classList.remove("ag-last-column-drop");let z=G.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),B=bk(z);if(B)B.classList.add("ag-last-column-drop");this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!B),this.setResizers()}resetChildrenHeight(){let D=this.getGui().children;for(let z=0;zJ.getGui().getBoundingClientRect()),Q=B.findIndex((J)=>this.horizontal?J.right>z&&J.leftz);if(Q===-1){let J=this.gos.get("enableRtl");if(B.every((S)=>z>(this.horizontal?S.right:S.bottom)))return J&&this.horizontal?0:this.childPillComponents.length;if(B.every((S)=>z<(this.horizontal?S.left:S.top)))return J&&this.horizontal?this.childPillComponents.length:0;return this.insertIndex}if(this.insertIndex<=Q)return Q+1;return Q}checkDragStartedBySelf(G){if(this.state!=="notDragging")return;this.state="rearrangeItems",this.potentialDndItems=this.getItems(G.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(G),this.refreshGui()}onDragging(G){if(this.checkDragStartedBySelf(G),this.checkInsertIndex(G))this.refreshGui()}handleDragEnterEnd(G){}onDragEnter(G){let D=this.getItems(G.dragSource.getDragItem());this.state="newItemsIn";let z=D.filter((Q)=>this.isItemDroppable(Q,G)),B=z.every((Q)=>this.childPillComponents.map((J)=>J.getItem()).indexOf(Q)!==-1);if(z.length===0)return;if(this.potentialDndItems=z,B){this.state="notDragging";return}this.handleDragEnterEnd(G),this.checkInsertIndex(G),this.refreshGui()}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(G){}onDragLeave(G){if(this.state==="rearrangeItems"){let D=this.getItems(G.dragSource.getDragItem());this.removeItems(D)}if(this.isPotentialDndItems())this.handleDragLeaveEnd(G),this.potentialDndItems=[],this.refreshGui();this.state="notDragging"}onDragCancel(G){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.handleDragLeaveEnd(G);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}onDragStop(){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.addItems(this.potentialDndItems);else this.rearrangeItems(this.potentialDndItems);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}removeItems(G){let D=this.getExistingItems().filter((z)=>!G.includes(z));this.updateItems(D),this.refreshGui()}addItems(G){if(!G)return;let D=this.getExistingItems().slice(),z=G.filter((B)=>D.indexOf(B)<0);HZ(D,z,this.insertIndex),this.updateItems(D),this.refreshGui()}addItem(G){this.insertIndex=this.getExistingItems().length,this.addItems([G])}rearrangeItems(G,D){let z;if(!D)z=this.getNonGhostItems().slice();else z=this.getExistingItems().filter((B)=>G.indexOf(B)===-1);if(HZ(z,G,this.insertIndex),Yw(z,this.getExistingItems()))return!1;return this.updateItems(z),this.refreshGui(),!0}refreshGui(){let G=0;if(!this.horizontal)G=this.ePillDropList.scrollTop;let D=this.resizeEnabled,z=this.getFocusedItem(),{eGridDiv:B}=this.beans,Q=Hw(),J=null;if(Q)J=vQ(this.beans,B)??vQ(this.beans,B,!1,!0);if(this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),G!==0)this.ePillDropList.scrollTop=G;if(D)this.toggleResizable(D);if(Q)this.restoreFocus(z,J)}getFocusedItem(){let G=this.getGui(),D=qZ(this.beans);if(!G.contains(D))return-1;return Array.from(G.querySelectorAll(".ag-column-drop-cell")).indexOf(D)}focusItemAtIndex(G){let D=this.getGui(),B=Array.from(D.querySelectorAll(".ag-column-drop-cell"))[G];if(!B)return;B.focus({preventScroll:!0})}restoreFocus(G,D){let z=this.getGui(),B=Array.from(z.querySelectorAll(".ag-column-drop-cell"));if(G===-1)return;if(B.length===0)D.focus();let Q=Math.min(B.length-1,G),J=B[Q];if(J)J.focus()}focusList(G){let D=G?this.childPillComponents.length-1:0;this.restoreFocus(D,this.getFocusableElement())}getNonGhostItems(){let G=this.getExistingItems();if(this.isPotentialDndItems())return G.filter((D)=>!this.potentialDndItems.includes(D));return G}addItemsToGui(){let D=this.getNonGhostItems().map((z)=>this.createItemComponent(z,!1));if(this.isPotentialDndItems()){let z=this.potentialDndItems.map((B)=>this.createItemComponent(B,!0));if(this.insertIndex>=D.length)D.push(...z);else D.splice(this.insertIndex,0,...z)}this.appendChild(this.ePillDropList),D.forEach((z,B)=>{if(B>0)this.addArrow(this.ePillDropList);this.ePillDropList.appendChild(z.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){let{childPillComponents:G,ePillDropList:D}=this,z=G.length;fw(D,z===0?"presentation":"listbox");for(let B=0;Bthis.destroyBean(z)),!D)this.childPillComponents.push(z);return z}addIconAndTitleToGui(){let{title:G,icon:D}=this.params;if(!G||!D)return;let z=u0({tag:"div"});if(kw(z,!0),this.addElementClasses(z,"title-bar"),this.addElementClasses(D,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),z.appendChild(D),!this.horizontal){let B=u0({tag:"span"});this.addElementClasses(B,"title"),B.textContent=G,z.appendChild(B)}this.appendChild(z)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){let{emptyMessage:G}=this.params;if(!G||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;let D=u0({tag:"span"});D.textContent=G,this.addElementClasses(D,"empty-message"),this.ePillDropList.appendChild(D)}addArrow(G){if(this.horizontal){let D=this.gos.get("enableRtl"),z=Ww(D?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(z,"cell-separator"),G.appendChild(z)}}},Ow={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},H7=class extends Cw{constructor(G,D,z,B,Q){super();this.dragSourceDropTarget=G,this.ghost=D,this.horizontal=z,this.template=B,this.agComponents=Q,this.eText=OQ,this.eDragHandle=OQ,this.eButton=OQ}postConstruct(){this.setTemplate(this.template??Ow,this.agComponents);let G=this.getGui(),{beans:D,eDragHandle:z,eText:B,eButton:Q}=this;if(this.addElementClasses(G),this.addElementClasses(z,"drag-handle"),this.addElementClasses(B,"text"),this.addElementClasses(Q,"button"),z.appendChild(kZ("columnDrag",D)),Q.appendChild(kZ("cancel",D)),this.tooltipFeature=this.createOptionalManagedBean(D.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable())this.addDragSource();this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){let G=this.getLocaleTextFunc(),D=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(D,G),bw(this.getGui(),D.join(". "))}addAdditionalAriaInstructions(G,D){if(this.isRemovable()){let z=D("ariaDropZoneColumnComponentDescription","Press DELETE to remove");G.push(z)}}setupTooltip(){let G=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());G(),this.addManagedEventListeners({newColumnsLoaded:G})}getDragSourceId(){return}getDefaultIconName(){return"notAllowed"}addDragSource(){let{beans:{dragAndDrop:G},eDragHandle:D}=this,z=this.createGetDragItem(),B=this.getDefaultIconName(),Q={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:D,getDefaultIconName:()=>B,getDragItem:z,dragItemName:this.getDisplayName()};G?.addDragSource(Q,!0),this.addDestroyFunc(()=>G?.removeDragSource(Q))}setupComponents(){if(this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost)this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){vw(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();let G={type:"columnRemove"};this.addGuiEventListener("keydown",(z)=>this.onKeyDown(z)),this.addManagedElementListeners(this.eButton,{click:(z)=>{this.dispatchLocalEvent(G),z.stopPropagation()}});let D=new Vw(this.eButton);this.addManagedListeners(D,{tap:()=>this.dispatchLocalEvent(G)}),this.addDestroyFunc(D.destroy.bind(D))}onKeyDown(G){if(G.key===_Z.DELETE){if(this.isRemovable())G.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"})}}getDisplayValue(){return this.getDisplayName()}addElementClasses(G,D){D=D?`-${D}`:"";let z=this.horizontal?"horizontal":"vertical";G.classList.add(`ag-column-drop-cell${D}`,`ag-column-drop-${z}-cell${D}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},uw=class extends H7{constructor(G,D,z,B,Q,J){super(D,z,Q);this.column=G,this.dropZonePurpose=B,this.updateParams=J,this.eSortIndicator=Aw,this.popupShowing=!1,this.deferApply=x(J)}postConstruct(){let{sortSvc:G,colNames:D}=this.beans;if(this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},G?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},G)this.agComponents=[G.getSortIndicatorSelector()];if(this.displayName=D.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.deferApply)this.eDragHandle.setAttribute("data-column-tool-panel-deferred","");if(G)this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}});if(this.isGroupingZone())this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(G,D){let z=this.gos.get("rowGroupPanelSuppressSort"),B=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!B){let Q=D("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");G.push(Q)}if(this.isGroupingZone()&&this.column.isSortable()&&!z){let Q=D("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");G.push(Q)}super.addAdditionalAriaInstructions(G,D)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){let G=this.getLocaleTextFunc(),{name:D,aggFuncName:z}=this.getColumnAndAggFuncName(),B=G("ariaDropZoneColumnComponentAggFuncSeparator"," of "),Q={asc:G("ariaDropZoneColumnComponentSortAscending","ascending"),desc:G("ariaDropZoneColumnComponentSortDescending","descending")},J=this.getCurrentSortDirection(this.column),U=this.gos.get("rowGroupPanelSuppressSort");return[z&&`${z}${B}`,D,this.isGroupingZone()&&!U&&J&&`, ${Q[J]}`].filter((Z)=>!!Z).join("")}getColumnAndAggFuncName(){let G=this.displayName,D="";if(this.isAggregationZone()){let z=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),B=typeof z==="string"?z:"agg";D=this.getLocaleTextFunc()(B,B)}return{name:G,aggFuncName:D}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;let{gos:G,column:D,eSortIndicator:z}=this;if(!G.get("rowGroupPanelSuppressSort")){z.setupSort(D,!0,this.getSortDefOverride.bind(this));let B=(Q)=>{Q.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,D,Q),z.refresh(),this.setupAria(),YG(this.beans,this.updateParams)};this.addGuiEventListener("click",B),this.addGuiEventListener("keydown",(Q)=>{if(Q.key===nD.ENTER&&this.isGroupingZone())B(Q)})}}getCurrentSortDirection(G){return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,G)?.direction??null}getSortDefOverride(){if(!this.deferApply)return;return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,this.column)}getDefaultIconName(){return"hide"}createGetDragItem(){let{column:G}=this;return()=>{let D={};return D[G.getId()]=G.isVisible(),{columns:[G],visibleState:D}}}setupComponents(){if(super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(G){if(super.onKeyDown(G),G.key===nD.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))G.preventDefault(),this.onShowAggFuncSelection()}getDisplayValue(){let{name:G,aggFuncName:D}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${D}(${G})`:G}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;let{aggFuncSvc:G,popupSvc:D}=this.beans,z=new Lz({cssIdentifier:"select-agg-func"}),B=G.getFuncNames(this.column),Q=this.getGui(),J=z.getGui();z.setModel({getRow:function(H){return B[H]},getRowCount:function(){return B.length}}),this.createBean(z);let U=Rw({tag:"div",cls:"ag-select-agg-func-popup"});U.style.top="0px",U.style.left="0px",U.appendChild(J),U.style.width=`${Q.clientWidth}px`;let[Z]=this.addManagedElementListeners(U,{focusout:(H)=>{if(!U.contains(H.relatedTarget)&&Y)Y.hideFunc()}}),S=(H)=>{if(this.destroyBean(z),this.popupShowing=!1,H?.key==="Escape")Q.focus();if(Z)Z()},X=this.getLocaleTextFunc(),Y=D.addPopup({modal:!0,eChild:U,closeOnEsc:!0,closedCallback:S,ariaLabel:X("ariaLabelAggregationFunction","Aggregation Function")});if(Y)z.setComponentCreator(this.createAggSelect.bind(this,Y.hideFunc));z.addGuiEventListener("keydown",(H)=>{if(H.key===nD.ENTER||H.key===nD.SPACE){let _=z.getLastFocusedRow();if(_==null)return;let k=z.getComponentAt(_);if(k)k.selectItem()}}),D.positionPopupByComponent({type:"aggFuncSelect",eventSource:Q,ePopup:U,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),z.refresh();let W=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),q=B.findIndex((H)=>H===W);if(q===-1)q=0;z.focusRow(q)}createAggSelect(G,D){let z=()=>{if(G(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,D,"toolPanelDragAndDrop"),this.column){let Z=this.getGui().querySelector(".ag-column-drop-cell-text");if(Z)Z.textContent=this.getDisplayValue();this.setupAria()}YG(this.beans,this.updateParams)},B=this.getLocaleTextFunc(),Q=(D||"").toString(),J=B(Q,Q);return new jw(z,J)}isGroupingAndLocked(){return this.isGroupingZone()&&Z0(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return Mw.ToolPanel}destroy(){super.destroy(),this.column=null}},jw=class extends Iw{constructor(G,D){super({tag:"div",cls:"ag-select-agg-func-item",children:D});this.selectItem=G,this.addGuiEventListener("click",this.selectItem)}},fJ=class extends q7{constructor(G,D,z){super(G);this.dropZonePurpose=D,this.updateParams=z,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(G){super.init(G),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(G){return G.columns??[]}isInterestedIn(G,D){if(G===YZ.HeaderCell)return!0;if(G!==YZ.ToolPanel)return!1;if(!this.horizontal)return!0;return!D.hasAttribute("data-column-tool-panel-deferred")}minimumAllowedNewInsertIndex(){let{gos:G,rowGroupColsSvc:D}=this.beans,z=G.get("groupLockGroupColumns"),B=D?.columns.length??0;if(z===-1)return B;return Math.min(z,B)}showOrHideColumnOnExit(G){return this.isRowGroupPanel()&&$w(this.gos,!0)&&!G.fromNudge}handleDragEnterEnd(G){if(this.showOrHideColumnOnExit(G)){let B=G.dragSource.getDragItem().columns;this.setColumnsVisible(B,!1,"uiColumnDragged")}}handleDragLeaveEnd(G){if(this.showOrHideColumnOnExit(G)){let z=G.dragSource.getDragItem();this.setColumnsVisible(z.columns,!0,"uiColumnDragged")}}setColumnsVisible(G,D,z){if(!G)return;if(x(this.updateParams))return;let B=G.filter((Q)=>!Q.getColDef().lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,B,D,z)}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(G,D,z,B){return new uw(G,D,z,this.dropZonePurpose,B,this.updateParams)}},_7=class extends fJ{constructor(G,D){super(G,"pivot",D)}postConstruct(){let G=this.getLocaleTextFunc(),D=G("pivotColumnsEmptyMessage","Drag here to set column labels"),z=G("pivots","Column Labels");if(super.init({icon:Zw("pivotPanel",this.beans,null),emptyMessage:D,title:z}),this.horizontal)Uw(this.beans,this,this.getGui());this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){let G=this.beans.colModel,D=G.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(D);break;case"onlyWhenPivoting":{let z=G.isPivotActive();this.setDisplayed(D&&z);break}default:this.setDisplayed(!1);break}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(x(this.updateParams)))}isItemDroppable(G,D){if(this.gos.get("functionsReadOnly")||!G.isPrimary())return!1;let z=this.beans.columnStateUpdateStrategy.getPivotColumns(x(this.updateParams)).includes(G);return G.isAllowPivot()&&(!z||this.isSourceEventFromTarget(D))}updateItems(G){this.beans.columnStateUpdateStrategy.setPivotColumns(x(this.updateParams),G,"toolPanelUi"),YG(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(x(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},k7=class extends fJ{constructor(G,D){super(G,"rowGroup",D)}postConstruct(){let G=this.getLocaleTextFunc(),D=G("rowGroupColumnsEmptyMessage","Drag here to set row groups"),z=G("groups","Row Groups");if(super.init({icon:gw("rowGroupPanel",this.beans,null),emptyMessage:D,title:z}),this.horizontal)Pw(this.beans,this,this.getGui());this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(G,D){if(this.gos.get("functionsReadOnly")||!G.isPrimary()||G.colDef.showRowGroup)return!1;let z=this.beans.columnStateUpdateStrategy.getRowGroupColumns(x(this.updateParams)).includes(G);return G.isAllowRowGroup()&&(!z||this.isSourceEventFromTarget(D))}updateItems(G){this.beans.columnStateUpdateStrategy.setRowGroupColumns(x(this.updateParams),G,"toolPanelUi"),YG(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(x(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},yw=class extends fJ{constructor(G,D){super(G,"aggregation",D)}postConstruct(){let G=this.getLocaleTextFunc(),D=G("valueColumnsEmptyMessage","Drag here to aggregate"),z=G("values","Values");super.init({icon:Tw("valuePanel",this.beans,null),emptyMessage:D,title:z}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(G,D){if(this.gos.get("functionsReadOnly")||!G.isPrimary())return!1;let z=this.beans.columnStateUpdateStrategy.getValueColumns(x(this.updateParams)).includes(G);return G.isAllowValue()&&(!z||this.isSourceEventFromTarget(D))}updateItems(G){this.beans.columnStateUpdateStrategy.setValueColumns(x(this.updateParams),G,"toolPanelUi"),YG(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(x(this.updateParams))}},iw={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},nw=class extends cw{constructor(G,D){super();this.params=G,this.onPivotModeValueChanged=D,this.cbPivotMode=hw}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(x(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(iw,[xw]);let G=this.cbPivotMode;G.setValue(this.getCurrentPivotMode());let D=this.getLocaleTextFunc();G.setLabel(D("pivotMode","Pivot Mode"));let z=()=>{let Q=!!G.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(x(this.params),Q,"toolPanelUi"),this.onPivotModeValueChanged?.()},B=()=>{G.setValue(this.getCurrentPivotMode())};this.addManagedListeners(G,{fieldValueChanged:z}),this.addManagedEventListeners({newColumnsLoaded:B,columnPivotModeChanged:B})}},dw=class extends Jw{constructor(){super(...arguments);this.beanName="colToolPanelFactory"}setPanelVisible(G,D,z){if(G)G.setDisplayed(D);else if(D)G=z();return G}createRowGroupPanel(G,D,z){return this.createPanel(G,D,new k7(!1,z))}createValuesPanel(G,D,z){return this.createPanel(G,D,new yw(!1,z))}createPivotPanel(G,D,z){return this.createPanel(G,D,new _7(!1,z))}createPivotModePanel(G,D,z,B,Q){return this.createPanel(G,D,new nw(z,B),Q)}createPanel(G,D,z,B){if(z=G.createBean(z),D.push(()=>G.destroyBean(z)),B)G.prependChild(z);else G.appendChild(z);return z}},wZ=()=>{},sw=class extends pw{constructor(){super(...arguments);this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(G,D,z){this.getUpdateStrategy(G).applyColumnState(D,z)}commit(G){this.getUpdateStrategy(G).commit()}hasPendingChanges(G){return this.getUpdateStrategy(G).hasPendingChanges()}moveColumns(G,D,z,B){this.getUpdateStrategy(G).moveColumns(D,z,B)}reset(G){this.getUpdateStrategy(G).reset()}setColumnsVisible(G,D,z,B){this.getUpdateStrategy(G).setColumnsVisible(D,z,B)}isColumnVisibleInToolPanel(G,D){return this.getUpdateStrategy(G).isColumnVisibleInToolPanel(D)}setRowGroupColumns(G,D,z){this.getUpdateStrategy(G).setRowGroupColumns(D,z)}getRowGroupColumns(G){return this.getUpdateStrategy(G).getRowGroupColumns()}getPrimaryColumns(G){return this.getUpdateStrategy(G).getPrimaryColumns()}hasDeferredColumnOrder(G){return this.getUpdateStrategy(G).hasDeferredColumnOrder()}setValueColumns(G,D,z){this.getUpdateStrategy(G).setValueColumns(D,z)}getValueColumns(G){return this.getUpdateStrategy(G).getValueColumns()}setColumnAggFunc(G,D,z,B){this.getUpdateStrategy(G).setColumnAggFunc(D,z,B)}getColumnAggFunc(G,D){return this.getUpdateStrategy(G).getColumnAggFunc(D)}setPivotColumns(G,D,z){this.getUpdateStrategy(G).setPivotColumns(D,z)}getPivotColumns(G){return this.getUpdateStrategy(G).getPivotColumns()}setPivotMode(G,D,z){this.getUpdateStrategy(G).setPivotMode(D,z)}getPivotMode(G){return this.getUpdateStrategy(G).getPivotMode()}isColumnSelectedInPivotModeToolPanel(G,D){return this.getUpdateStrategy(G).isColumnSelectedInPivotModeToolPanel(D)}progressSortFromEvent(G,D,z){this.getUpdateStrategy(G).progressSortFromEvent(D,z)}getSortDef(G,D){return this.getUpdateStrategy(G).getSortDef(D)}getUpdateStrategy(G){return G?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new ow(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new rw(this.beans))}},ow=class{constructor(G){this.beans=G,this.lastPivotColIds=[],this.reset=wZ,this.commit=wZ,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(G,D){if(G.length===0)return;J0(this.beans,{state:G},D)}moveColumns(G,D,z){this.beans.colMoves?.moveColumns(G,D,z),aw(this.beans)}setColumnsVisible(G,D,z){let B=G.filter((Q)=>!Q.getColDef().lockVisible);this.beans.colModel.setColsVisible(B,D,z)}setRowGroupColumns(G,D){this.beans.rowGroupColsSvc?.setColumns(G,D)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return NJ(this.beans)}setValueColumns(G,D){this.beans.valueColsSvc?.setColumns(G,D)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(G,D,z){this.beans.valueColsSvc?.setColumnAggFunc?.(G,D,z)}getColumnAggFunc(G){return G.getAggFunc()}setPivotColumns(G,D){this.lastPivotColIds=G.map((z)=>z.getColId()),this.beans.pivotColsSvc?.setColumns(G,D)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(G,D){let{colModel:z,gos:B,ctrlsSvc:Q}=this.beans;if(G===z.isPivotMode())return;let J=this.beans.pivotColsSvc?.columns.map((U)=>U.getColId())??[];if(J.length>0)this.lastPivotColIds=J;if(!G){let U=this.beans.colModel.getColDefCols()??[];J0(this.beans,{state:U.map((Z)=>({colId:Z.getColId(),pivot:!1,pivotIndex:null}))},D)}if(B.updateGridOptions({options:{pivotMode:G},source:D}),G&&this.lastPivotColIds.length>0)this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,D);for(let U of Q.getHeaderRowContainerCtrls())U.refresh()}progressSortFromEvent(G,D){this.beans.sortSvc?.progressSortFromEvent(G,D)}isColumnVisibleInToolPanel(G){return G.isVisible()}isColumnSelectedInPivotModeToolPanel(G){return G.isAnyFunctionActive()}getPivotMode(){return this.beans.colModel.isPivotMode()}getSortDef(G){return G.getSortDef()}},rw=class{constructor(G){this.beans=G,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){let{state:G,beans:D}=this,{columnState:z,columnOrder:B,rowGroup:Q,aggregation:J,pivot:U,pivotMode:Z,sort:S,aggFuncs:X}=G,Y=(W)=>(W??[]).map((q)=>q.getColId());if(z)for(let[W,q]of z.patches){let H=D.colModel.getColDefCol(W);if(!H)continue;if(q.hide!==void 0&&q.hide!==!H.isVisible()||q.rowGroup!==void 0&&!!q.rowGroup!==H.isRowGroupActive()||q.pivot!==void 0&&!!q.pivot!==H.isPivotActive()||q.aggFunc!==void 0&&(q.aggFunc??null)!==(H.getAggFunc()??null))return!0}if(B&&!j0(B.colIds,jQ(D)))return!0;if(Q&&!j0(Q.colIds,Y(D.rowGroupColsSvc?.columns)))return!0;if(J&&!j0(J.colIds,Y(D.valueColsSvc?.columns)))return!0;if(U&&!j0(U.colIds,Y(D.pivotColsSvc?.columns)))return!0;if(Z&&Z.pivotMode!==D.colModel.isPivotMode())return!0;if(S){for(let[W,q]of S.sortDefsByColId){let H=D.colModel.getColDefCol(W);if(!H)continue;if((q?.direction??null)!==(H.getSortDef()?.direction??null))return!0}if(S.baselineCleared){let W=NJ(D);for(let q of W)if(!S.sortDefsByColId.has(q.getColId())&&q.getSortDef()!==null)return!0}}if(X)for(let[W,q]of X.values){let H=D.colModel.getColDefCol(W);if(!H)continue;if(q!==H.getAggFunc())return!0}return!1}commit(){let{beans:G,state:D}=this,z=[];for(let Q of Object.keys(D)){let J=D[Q];if(J)z.push({type:Q,...J})}let B=z.sort((Q,J)=>Q.seq-J.seq);for(let Q of B)switch(Q.type){case"columnState":{J0(G,{state:[...Q.patches.values()]},Q.eventType);break}case"columnOrder":{let J=Q.colIds.map((U)=>G.colModel.getColDefCol(U)).filter((U)=>!!U&&$0(U));if(!G.colModel.isPivotMode())for(let U=0;U$0(W)),Y=(X>=0?X:0)+U;if(S[Y]!==Z)G.colMoves?.moveColumns([Z],Y,Q.eventType,!0)}w7(G,J);break}case"rowGroup":{G.rowGroupColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"aggregation":{G.valueColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"pivot":{this.lastPivotColIds=Q.colIds,G.pivotColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"pivotMode":{let{colModel:J,ctrlsSvc:U,gos:Z,stateSvc:S}=G;if(Q.pivotMode!==J.isPivotMode()){let X=G.pivotColsSvc?.columns.map((q)=>q.getColId())??[];if(X.length>0)this.lastPivotColIds=X;let Y=S?.getState().pivot?.pivotColIds??X,W=Q.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:Y;if(S?.setState({...S.getState(),pivot:{pivotMode:Q.pivotMode,pivotColIds:W}},["pivot"]),!Q.pivotMode){let q=G.colModel.getColDefCols()??[];J0(G,{state:q.map((H)=>({colId:H.getColId(),pivot:!1,pivotIndex:null}))},Q.eventType)}if(Z.updateGridOptions({options:{pivotMode:Q.pivotMode},source:Q.eventType}),Q.pivotMode&&W.length>0)G.pivotColsSvc?.setColumns(W,Q.eventType);for(let q of U.getHeaderRowContainerCtrls())q.refresh()}break}case"sort":{let J=[],U=0;for(let[Z,S]of Q.sortDefsByColId)J.push({colId:Z,sort:S?.direction??null,sortIndex:S?.direction?U++:null,sortType:S?.type??void 0});J0(G,{state:J,defaultState:Q.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},Q.eventType);break}case"aggFuncs":{for(let[J,U]of Q.values){let Z=G.colModel.getColDefCol(J);if(!Z)continue;G.valueColsSvc?.setColumnAggFunc?.(Z,U,Q.eventType)}break}}this.reset()}applyColumnState(G,D){for(let B of G)PQ(this.state,B);let z=SB(this.state);z.seq=hG(this.sequence),this.sequence=z.seq,z.eventType=D}moveColumns(G,D,z){let B=new Set(G.map((S)=>S.getColId())),J=(this.state.columnOrder?.colIds??jQ(this.beans)).filter((S)=>!B.has(S)),U=G.map((S)=>S.getColId()),Z=hG(this.sequence);this.sequence=Z,this.state.columnOrder={colIds:[...J.slice(0,D),...U,...J.slice(D)],eventType:z,seq:Z}}setColumnsVisible(G,D,z){for(let Q of G){if(Q.getColDef().lockVisible)continue;PQ(this.state,{colId:Q.getColId(),hide:!D})}let B=SB(this.state);B.seq=hG(this.sequence),this.sequence=B.seq,B.eventType=z}setRowGroupColumns(G,D){gQ(this.state,"rowGroup");let z=hG(this.sequence);this.sequence=z,this.state.rowGroup={colIds:G.map((B)=>B.getColId()),eventType:D,seq:z}}setValueColumns(G,D){gQ(this.state,"aggFunc");let z=new Set((this.beans.valueColsSvc?.columns??[]).map((J)=>J.getColId())),B=KZ(this.state);for(let J of G)if(!z.has(J.getColId())&&!B.values.has(J.getColId())){let U=J.getAggFunc(),Z=U!=null?U:this.beans.aggFuncSvc?.getDefaultAggFunc(J);if(Z!=null)B.values.set(J.getColId(),Z)}let Q=hG(this.sequence);this.sequence=Q,B.seq=Q,B.eventType=D,this.state.aggregation={colIds:G.map((J)=>J.getColId()),eventType:D,seq:Q}}setColumnAggFunc(G,D,z){PQ(this.state,{colId:G.getColId(),aggFunc:D});let B=SB(this.state);B.seq=hG(this.sequence),this.sequence=B.seq,B.eventType=z;let Q=KZ(this.state);Q.seq=B.seq,Q.eventType=z,Q.values.set(G.getColId(),D)}getColumnAggFunc(G){let D=G.getColId();if(this.state.aggFuncs?.values.has(D))return this.state.aggFuncs.values.get(D);return G.getAggFunc()}isColumnVisibleInToolPanel(G){let D=this.state.columnState?.patches.get(G.getColId());if(D?.hide!==void 0)return!D.hide;return G.isVisible()}isColumnSelectedInPivotModeToolPanel(G){let D=G.getColId(),z=this.state.columnState?.patches.get(D),B;if(z?.rowGroup!==void 0)B=!!z.rowGroup;else if(this.state.rowGroup)B=this.state.rowGroup.colIds.includes(D);else B=G.isRowGroupActive();let Q;if(z?.pivot!==void 0)Q=!!z.pivot;else if(this.state.pivot)Q=this.state.pivot.colIds.includes(D);else Q=G.isPivotActive();let J;if(z?.aggFunc!==void 0)J=z.aggFunc!=null;else if(this.state.aggregation)J=this.state.aggregation.colIds.includes(D);else J=G.isValueActive();return B||Q||J}setPivotColumns(G,D){gQ(this.state,"pivot");let z=hG(this.sequence);this.sequence=z,this.state.pivot={colIds:G.map((B)=>B.getColId()),eventType:D,seq:z}}setPivotMode(G,D){let z=hG(this.sequence);this.sequence=z,this.state.pivotMode={pivotMode:G,eventType:D,seq:z}}getRowGroupColumns(){return Rz(this.beans,uQ(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,(G)=>G.rowGroup==null?void 0:!!G.rowGroup))}getPrimaryColumns(){return Rz(this.beans,this.state.columnOrder?.colIds??jQ(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return Rz(this.beans,uQ(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,(G)=>G.aggFunc===void 0?void 0:G.aggFunc!=null))}getPivotColumns(){if(!this.getPivotMode())return[];let G=this.beans.pivotColsSvc?.columns,D=G?.length?G:Rz(this.beans,this.lastPivotColIds);return Rz(this.beans,uQ(this.state.pivot?.colIds,D,this.state.columnState?.patches,(z)=>z.pivot==null?void 0:!!z.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.isPivotMode()}getSortDef(G){let D=this.state.sort,z=G.getColId(),B=D?.sortDefsByColId;if(B?.has(z))return B.get(z)??null;if(D?.baselineCleared)return null;return G.getSortDef()}progressSortFromEvent(G,D){let z=this.state.sort??{sortDefsByColId:new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:B}=this.beans,Q=G.getColId(),J;if(z.sortDefsByColId.has(Q))J=z.sortDefsByColId.get(Q);else if(z.baselineCleared)J=null;else J=G.getSortDef();let U=B?.getNextSortDirection(G,J);if(!U)return;let{gos:Z}=this.beans;if(!(((Z.get("multiSortKey")==="ctrl"?D.ctrlKey||D.metaKey:D.shiftKey)||Z.get("alwaysMultiSort"))&&!Z.get("suppressMultiSort")))z.sortDefsByColId.clear(),z.baselineCleared=!0;z.sortDefsByColId.set(Q,U.direction?U:null),z.seq=hG(this.sequence),this.sequence=z.seq,this.state.sort=z}};function Rz(G,D){if(!D)return[];return D.map((z)=>G.colModel.getColDefCol(z)).filter((z)=>!!z)}function uQ(G,D,z,B){let Q=[...G??D?.map((U)=>U.getColId())??[]];if(!z?.size)return Q;let J=new Set(Q);for(let[U,Z]of z){let S=B(Z);if(S===void 0)continue;if(S){if(!J.has(U))Q.push(U),J.add(U);continue}if(!J.has(U))continue;J.delete(U);let X=Q.indexOf(U);if(X>=0)Q.splice(X,1)}return Q}function aw(G){let D=G.colModel.getCols().filter((z)=>$0(z)).map((z)=>G.colModel.getColDefCol(z.getColId())).filter((z)=>!!z);w7(G,D)}function w7(G,D){let z=ew(G);if(!z)return;let B=new Set(D);z.list=[...D,...z.list.filter((Q)=>$0(Q)&&!B.has(Q))]}function jQ(G){return NJ(G).map((D)=>D.getColId())}function NJ(G){return(G.colModel.getColDefCols()??G.colModel.getCols()).filter((D)=>$0(D))}function ew(G){let D=G.colModel.colDefCols,z=D?.list;if(!Array.isArray(z))return;return D}function $0(G){if(!G.isPrimary())return!1;return!mw(G)&&!tw(G)}function hG(G){return G+1}function PQ(G,D){let z=SB(G),B=z.patches.get(D.colId);z.patches.set(D.colId,B?{...B,...D}:D)}function gQ(G,D){let z=G.columnState?.patches;if(!z?.size)return;for(let[B,Q]of z){if(!(D in Q))continue;let J={...Q};if(delete J[D],Object.keys(J).length===1){z.delete(B);continue}z.set(B,J)}}function SB(G){let{columnState:D}=G;if(!D)D={patches:new Map,seq:0,eventType:"toolPanelUi"},G.columnState=D;return D}function KZ(G){let{aggFuncs:D}=G;if(!D)D={values:new Map,seq:0,eventType:"toolPanelUi"},G.aggFuncs=D;return D}var GK=class extends lw{constructor(){super(...arguments);this.beanName="columnStateUpdateStrategy"}applyColumnState(G,D,z){this.delegate("applyColumnState",G,D,z)}commit(G){this.delegate("commit",G)}hasPendingChanges(G){return this.delegate("hasPendingChanges",G)}moveColumns(G,D,z,B){this.delegate("moveColumns",G,D,z,B)}reset(G){this.delegate("reset",G)}setColumnsVisible(G,D,z,B){this.delegate("setColumnsVisible",G,D,z,B)}isColumnVisibleInToolPanel(G,D){return this.delegate("isColumnVisibleInToolPanel",G,D)}setRowGroupColumns(G,D,z){this.delegate("setRowGroupColumns",G,D,z)}getRowGroupColumns(G){return this.delegate("getRowGroupColumns",G)}getPrimaryColumns(G){return this.delegate("getPrimaryColumns",G)}hasDeferredColumnOrder(G){return this.delegate("hasDeferredColumnOrder",G)}setValueColumns(G,D,z){this.delegate("setValueColumns",G,D,z)}getValueColumns(G){return this.delegate("getValueColumns",G)}setColumnAggFunc(G,D,z,B){this.delegate("setColumnAggFunc",G,D,z,B)}getColumnAggFunc(G,D){return this.delegate("getColumnAggFunc",G,D)}setPivotColumns(G,D,z){this.delegate("setPivotColumns",G,D,z)}getPivotColumns(G){return this.delegate("getPivotColumns",G)}setPivotMode(G,D,z){this.delegate("setPivotMode",G,D,z)}getPivotMode(G){return this.delegate("getPivotMode",G)}isColumnSelectedInPivotModeToolPanel(G,D){return this.delegate("isColumnSelectedInPivotModeToolPanel",G,D)}progressSortFromEvent(G,D,z){this.delegate("progressSortFromEvent",G,D,z)}getSortDef(G,D){return this.delegate("getSortDef",G,D)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new sw))}delegate(G,...D){let z=this.getUpdateStrategy();return z[G].bind(z)(...D)}},K7={moduleName:"SharedColumnStateUpdateStrategy",version:j,beans:[GK],dependsOn:[i]},yB={moduleName:"ColumnsToolPanel",version:j,beans:[dw],userComponents:{agColumnsToolPanel:Qw},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[i,K7,jD,E_,M_,I_,TB]},UK=class extends JK{constructor(){super(...arguments);this.beanName="chartMenuItemMapper"}getChartItems(G){let D=this.beans,z=D.chartSvc,B=G==="pivotChart";if(!z)return null;let Q=this.getLocaleTextFunc.bind(this),J=B?new ZK(D,z,Q):new $K(D,z,Q),U=z.isEnterprise(),Z=J.getMenuItem();if(Z?.subMenu&&!U){let X=(Y)=>({...Y,subMenu:Y.subMenu?.filter((W)=>!W._enterprise).map((W)=>X(W))});Z=X(Z)}let S=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(S)Z=this.filterAndOrderChartMenu(Z,S,J.getConfigLookup());return this.cleanInternals(Z)}cleanInternals(G){if(!G)return G;let D=(z)=>{delete z?._key,delete z?._enterprise;for(let B of z?.subMenu??[])D(B);return z};return D(G)}buildLookup(G){let D={},z=(B)=>{if(D[B._key]=B,B.subMenu)for(let Q of B.subMenu)z(Q)};return z(G),D}filterAndOrderChartMenu(G,D,z){let B=this.buildLookup(G),Q={...G,subMenu:[]};for(let J of Object.keys(D)){let U=D[J],Z=z[J];if(Z===null)continue;if(Z==null){fZ(173,{group:J});continue}let S=B[Z._key];if(S)if(S.subMenu){let X=U.map((Y)=>{let W=Z[Y];if(W==null){fZ(174,{group:J,chartType:Y});return}return B[W]}).filter((Y)=>Y!==void 0);if(X.length>0)S.subMenu=X,Q.subMenu?.push(S)}else Q.subMenu?.push(S)}if(Q.subMenu?.length==0)return null;return Q}},ZK=class{constructor(G,D,z){this.beans=G,this.chartSvc=D,this.getLocaleTextFunc=z}getMenuItem(){let G=this.getLocaleTextFunc(),D=(z,B,Q,J,U=!1)=>{return{name:G(z,B+"‎"),action:()=>this.chartSvc.createPivotChart({chartType:Q}),_key:J,_enterprise:U}};return{name:G("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:G("columnChart","Column"),subMenu:[D("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),D("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),D("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:G("barChart","Bar"),subMenu:[D("groupedBar","Grouped","groupedBar","pivotGroupedBar"),D("stackedBar","Stacked","stackedBar","pivotStackedBar"),D("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:G("pieChart","Pie"),subMenu:[D("pie","Pie","pie","pivotPie"),D("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:G("lineChart","Line"),subMenu:[D("lineChart","Line","line","pivotLineChart"),D("stackedLine","Stacked","stackedLine","pivotStackedLine"),D("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:G("areaChart","Area"),subMenu:[D("areaChart","Area","area","pivotArea"),D("stackedArea","Stacked","stackedArea","pivotStackedArea"),D("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:G("xyChart","X Y (Scatter)"),subMenu:[D("scatter","Scatter","scatter","pivotScatter"),D("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:G("statisticalChart","Statistical"),subMenu:[D("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:G("hierarchicalChart","Hierarchical"),subMenu:[D("treemapChart","Treemap","treemap","pivotTreemap",!0),D("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:G("funnel","Funnel"),subMenu:[D("funnel","Funnel","funnel","pivotFunnel"),D("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),D("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:G("combinationChart","Combination"),subMenu:[D("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),D("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:f7("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},$K=class{constructor(G,D,z){this.beans=G,this.chartSvc=D,this.getLocaleTextFunc=z}getMenuItem(){let G=this.getLocaleTextFunc(),D=(z,B,Q,J,U=!1)=>{return{name:G(z,B),action:()=>this.chartSvc.createChartFromCurrentRange(Q),_key:J,_enterprise:U}};return{name:G("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:G("columnChart","Column"),subMenu:[D("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),D("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),D("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:G("barChart","Bar"),subMenu:[D("groupedBar","Grouped","groupedBar","rangeGroupedBar"),D("stackedBar","Stacked","stackedBar","rangeStackedBar"),D("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:G("pieChart","Pie"),subMenu:[D("pie","Pie","pie","rangePie"),D("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:G("lineChart","Line"),subMenu:[D("lineChart","Line","line","rangeLineChart"),D("stackedLine","Stacked","stackedLine","rangeStackedLine"),D("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:G("areaChart","Area"),subMenu:[D("areaChart","Area","area","rangeArea"),D("stackedArea","Stacked","stackedArea","rangeStackedArea"),D("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:G("xyChart","X Y (Scatter)"),subMenu:[D("scatter","Scatter","scatter","rangeScatter"),D("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:G("polarChart","Polar"),subMenu:[D("radarLine","Radar Line","radarLine","rangeRadarLine"),D("radarArea","Radar Area","radarArea","rangeRadarArea"),D("nightingale","Nightingale","nightingale","rangeNightingale"),D("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),D("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:G("statisticalChart","Statistical"),subMenu:[D("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),D("histogramChart","Histogram","histogram","rangeHistogram",!1),D("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),D("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:G("hierarchicalChart","Hierarchical"),subMenu:[D("treemap","Treemap","treemap","rangeTreemap"),D("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:G("specializedChart","Specialized"),subMenu:[D("heatmap","Heatmap","heatmap","rangeHeatmap"),D("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:G("funnel","Funnel"),subMenu:[D("funnel","Funnel","funnel","rangeFunnel"),D("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),D("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:G("combinationChart","Combination"),subMenu:[D("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),D("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:f7("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},YK=class extends LK{constructor(){super(...arguments);this.beanName="colChooserFactory"}createColumnSelectPanel(G,D,z,B){let Q=G.createManagedBean(new W7),J=B??D?.getColDef().columnChooserParams??{},{contractColumnSelection:U,suppressColumnExpandAll:Z,suppressColumnFilter:S,suppressColumnSelectAll:X,suppressSyncLayoutWithGrid:Y,columnLayout:W}=J;if(Q.init(!!z,SK(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!U,suppressColumnExpandAll:!!Z,suppressColumnFilter:!!S,suppressColumnSelectAll:!!X,suppressSyncLayoutWithGrid:!!W||!!Y,onStateUpdated:()=>{}}),"columnMenu"),W)Q.setColumnLayout(W);return Q}showColumnChooser({column:G,chooserParams:D,eventSource:z,headerPosition:B}){this.hideActiveColumnChooser();let Q=this.createColumnSelectPanel(this,G,!0,D),J=this.getLocaleTextFunc(),U=this.beans,{visibleCols:Z,focusSvc:S,menuUtils:X}=U,Y=Z.allCols.indexOf(G),W=G?S.focusedHeader??B??null:null;this.activeColumnChooserDialog=this.createBean(new PB({title:J("chooseColumns","Choose Columns"),component:Q,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{XK(U,Q.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,G)},closedCallback:(q)=>{let H=this.activeColumnChooser.getGui();if(this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,G),G)X.restoreFocusOnClose({column:G,headerPosition:W,columnIndex:Y,eventSource:z},H,q,!0)},postProcessPopupParams:{type:"columnChooser",column:G,eventSource:z}})),this.activeColumnChooser=Q}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(G,D){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:G,switchingTab:!1,key:"columnChooser",column:D??null})}},MK={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function AK(G,D){let z=MK[D];if(z)G.assertModuleRegistered(z,`menu item '${D}'`)}var ND="separator";function N7(G,D){if(!G)return;for(let z=G.length-2;z>=0;z--){let B=G[z]===D,Q=G[z+1]===D;if(B&&Q)G.splice(z+1,1)}}var RK={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:(G)=>({type:FK(G.getSortDef()?.type),direction:null})}},CK=class extends KK{constructor(){super(...arguments);this.beanName="menuItemMapper"}mapWithStockItems(G,D,z,B,Q){if(!G)return[];let J=[],U=this.getLocaleTextFunc(),{beans:Z,gos:S}=this,{pinnedCols:X,colAutosize:Y,aggFuncSvc:W,rowGroupColsSvc:q,colNames:H,colModel:_,clipboardSvc:k,expansionSvc:w,focusSvc:K,csvCreator:f,excelCreator:N,menuSvc:F,colChooserFactory:E,sortSvc:I,chartMenuItemMapper:V,valueColsSvc:A,pinnedRowModel:R}=Z,O=(u,v,h,P)=>{switch(AK(S,u),u){case"pinSubMenu":return X&&v?{name:U("pinColumn","Pin Column"),icon:a("menuPin",Z,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return X&&v?{name:U("pinLeft","Pin Left"),action:()=>X.setColsPinned([v],"left",P),checked:!!v&&v.isPinnedLeft()}:null;case"pinRight":return X&&v?{name:U("pinRight","Pin Right"),action:()=>X.setColsPinned([v],"right",P),checked:!!v&&v.isPinnedRight()}:null;case"clearPinned":return X&&v?{name:U("noPin","No Pin"),action:()=>X.setColsPinned([v],null,P),checked:!!v&&!v.isPinned()}:null;case"pinRowSubMenu":{let b=S.get("enableRowPinning"),g=[],c=z?.rowPinned??z?.pinnedSibling?.rowPinned;if(c)g.push("unpinRow");if(b&&b!=="bottom"&&c!="top")g.push("pinTop");if(b&&b!=="top"&&c!="bottom")g.push("pinBottom");return R?.isManual()?{name:U("pinRow","Pin Row"),icon:a("rowPin",Z,v),subMenu:g}:null}case"pinTop":return R?.isManual()?{name:U("pinTop","Pin to Top"),icon:a("rowPinTop",Z,v),action:({node:b,column:g})=>b&&R.pinRow(b,"top",g)}:null;case"pinBottom":return R?.isManual()?{name:U("pinBottom","Pin to Bottom"),icon:a("rowPinBottom",Z,v),action:({node:b,column:g})=>b&&R.pinRow(b,"bottom",g)}:null;case"unpinRow":return R?.isManual()?{name:U("unpinRow","Unpin Row"),icon:a("rowUnpin",Z,v),action:({node:b,column:g})=>b&&R.pinRow(b,null,g)}:null;case"valueAggSubMenu":if(W&&A&&(v?.isPrimary()||v?.getColDef().pivotValueColumn))return{name:U("valueAggregation","Value Aggregation"),icon:a("menuValue",Z,null),subMenu:VK(v,W,A,U),disabled:S.get("functionsReadOnly")};else return null;case"autoSizeThis":return Y?{name:U("autosizeThisColumn","Autosize This Column"),action:()=>v&&Y.autoSizeColumn(v,P,S.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return Y?{name:U("autosizeAllColumns","Autosize All Columns"),action:()=>Y.autoSizeAllColumns({source:P,skipHeader:S.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return q?{name:Q0(U,"groupBy",H.getDisplayNameForColumn(v,"header")),disabled:S.get("functionsReadOnly")||v?.isRowGroupActive()||!v?.getColDef().enableRowGroup,action:()=>q.addColumns([v],P),icon:a("menuAddRowGroup",Z,null)}:null;case"rowUnGroup":if(q&&S.isModuleRegistered("SharedRowGrouping")){let b=v?.getColDef().showRowGroup,g=S.get("groupLockGroupColumns"),c,s,m;if(b===!0)c=U("ungroupAll","Un-Group All"),s=S.get("functionsReadOnly")||g===-1||g>=(q.columns.length??0),m=()=>q.setColumns(q.columns.slice(0,g),P);else if(typeof b==="string"){let zG=_.getColDefCol(b),fG=zG!=null?H.getDisplayNameForColumn(zG,"header"):b;c=Q0(U,"ungroupBy",fG),s=S.get("functionsReadOnly")||Z0(zG,Z),m=()=>{q.removeColumns([b],P)}}else c=Q0(U,"ungroupBy",H.getDisplayNameForColumn(v,"header")),s=S.get("functionsReadOnly")||!v?.isRowGroupActive()||!v?.getColDef().enableRowGroup||Z0(v,Z),m=()=>q.removeColumns([v],P);return{name:c,disabled:s,action:m,icon:a("menuRemoveRowGroup",Z,null)}}else return null;case"resetColumns":return{name:U("resetColumns","Reset Columns"),action:()=>EK(Z,P)};case"expandAll":return w?{name:U("expandAll","Expand All Row Groups"),action:()=>w.expandAll(!0)}:null;case"contractAll":return w?{name:U("collapseAll","Collapse All Row Groups"),action:()=>w.expandAll(!1)}:null;case"copy":return k?{name:U("copy","Copy"),shortcut:U("ctrlC","Ctrl+C"),icon:a("clipboardCopy",Z,null),action:()=>k.copyToClipboard()}:null;case"copyWithHeaders":return k?{name:U("copyWithHeaders","Copy with Headers"),icon:a("clipboardCopy",Z,null),action:()=>k.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return k?{name:U("copyWithGroupHeaders","Copy with Group Headers"),icon:a("clipboardCopy",Z,null),action:()=>k.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(k){let b=K.getFocusedCell(),g=b?NK(Z,b):null,c=g?b?.column.isCellEditable(g):!1;return{name:U("cut","Cut"),shortcut:U("ctrlX","Ctrl+X"),icon:a("clipboardCut",Z,null),disabled:!c||S.get("suppressCutToClipboard"),action:()=>k.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(k){let b=S.get("suppressClipboardApi")||S.get("suppressClipboardPaste")||!v||!z||!v.isCellEditable(z)||v.isSuppressPaste(z);return{name:U("paste","Paste"),shortcut:U("ctrlV","Ctrl+V"),icon:a("clipboardPaste",Z,null),disabled:b,action:()=>k.pasteFromClipboard()}}else return null;case"export":{let b=[];if(!S.get("suppressCsvExport")&&f)b.push("csvExport");if(!S.get("suppressExcelExport")&&N)b.push("excelExport");return b.length?{name:U("export","Export"),subMenu:b,icon:a("save",Z,null)}:null}case"csvExport":return f?{name:U("csvExport","CSV Export"),icon:a("csvExport",Z,null),action:()=>f.exportDataAsCsv()}:null;case"excelExport":return N?{name:U("excelExport","Excel Export"),icon:a("excelExport",Z,null),action:()=>N.exportDataAsExcel()}:null;case"separator":return u;case"pivotChart":case"chartRange":return V.getChartItems(u);case"columnFilter":return F&&v?{name:U("columnFilter","Column Filter"),icon:a("filter",Z,null),action:()=>F.showFilterMenu({column:v,buttonElement:h(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{let b=K.focusedHeader;return E?{name:U("columnChooser","Choose Columns"),icon:a("columns",Z,null),action:()=>E.showColumnChooser({column:v,eventSource:h(),headerPosition:b})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!I||!v)return null;let{fallback:b,getSortDef:g}=RK[u];return{name:U(u,b),icon:a(u,Z,null),action:()=>I.setSortForColumn(v,g(v),!1,P)}}default:return IK(176,{key:u}),null}};for(let u of G){let v;if(typeof u==="string")v=O(u,D,B,Q);else v={...u};if(!v)continue;let h=v,{subMenu:P}=h;if(P&&P instanceof Array)h.subMenu=this.mapWithStockItems(P,D,z,B,Q);if(v!=null)J.push(v)}return N7(J,ND),J}};function VK(G,D,z,B){let Q;if(G.isPrimary())Q=G;else{let U=G.getColDef().pivotValueColumn;Q=fK(U)?U:void 0}let J=[];if(Q){let U=Q.isValueActive(),Z=D.getFuncNames(Q);J.push({name:B("noAggregation","None"),action:()=>{z.removeColumns([Q],"contextMenu"),z.setColumnAggFunc(Q,void 0,"contextMenu")},checked:!U});for(let S of Z)J.push({name:B(S,D.getDefaultFuncLabel(S)),action:()=>{z.setColumnAggFunc(Q,S,"contextMenu"),z.addColumns([Q],"contextMenu")},checked:U&&Q.getAggFunc()===S})}return J}var bK=class extends WK{constructor(){super(...arguments);this.beanName="colMenuFactory"}createMenu(G,D,z,B){let Q=G.createManagedBean(new KJ(0,{column:z??null,node:null,value:null})),J=this.beans.menuItemMapper.mapWithStockItems(D,z??null,null,B,"columnMenu");return Q.addMenuItems(J),Q}getMenuItems(G=null,D=null){let z=this.getDefaultMenuOptions(G),B,Q=(G?.getColDef()??D?.getColGroupDef())?.mainMenuItems;if(Array.isArray(Q))B=Q;else if(typeof Q==="function")B=Q(qK(this.gos,{column:G,columnGroup:D,defaultItems:z}));else{let J=this.gos.getCallback("getMainMenuItems");if(J)B=J({column:G,columnGroup:D,defaultItems:z});else B=z}return N7(B,ND),B}getDefaultMenuOptions(G){let D=[],{beans:z,gos:B}=this,{colChooserFactory:Q,rowGroupColsSvc:J,colModel:U,expansionSvc:Z,sortSvc:S,menuSvc:X,pinnedCols:Y,aggFuncSvc:W,colAutosize:q}=z,H=wK(B),_=()=>{if(!H&&Q)D.push("columnChooser");D.push("resetColumns")};if(!G)return _(),D;let{colDef:k}=G,w=Y&&!k.lockPinned,K=J?.columns.length??0,f=K>0,N=_K(B),F=B.get("treeData"),E=G.isPrimary(),I=!E||W&&G.isAllowValue()&&(f||N||F);if(S&&!H&&G.isSortable()){let{isDefaultSortAllowed:V,isAbsoluteSortAllowed:A,isAbsoluteSort:R,isDefaultSort:O,isAscending:u,isDescending:v,direction:h}=HK(G,z);if(V&&!(u&&O))D.push("sortAscending");if(V&&!(v&&O))D.push("sortDescending");if(A&&!(u&&R))D.push("sortAbsoluteAscending");if(A&&!(v&&R))D.push("sortAbsoluteDescending");if(h)D.push("sortUnSort");D.push(ND)}if(X?.isFilterMenuItemEnabled(G))D.push("columnFilter"),D.push(ND);if(w)D.push("pinSubMenu");if(I)D.push("valueAggSubMenu");if(w||I)D.push(ND);if(q){if(!k.suppressAutoSize)D.push("autoSizeThis");D.push("autoSizeAll"),D.push(ND)}if(J&&B.isModuleRegistered("SharedRowGrouping")){let V=D.length;if(k.showRowGroup)D.push("rowUnGroup");else if(G.isAllowRowGroup()&&E)if(G.isRowGroupActive()){if(!Z0(G,z))D.push("rowUnGroup")}else D.push("rowGroup");if(D.length>V)D.push(ND)}if(_(),Z&&(kK(B)||B.get("ssrmExpandAllAffectsAllRows"))&&(F||K>(U.isPivotMode()?1:0)))D.push("expandAll"),D.push("contractAll");return D}},FZ="ag-context-menu-open",gK=class extends vK{constructor(){super(...arguments);this.beanName="contextMenuSvc",this.focusedCell=null}postConstruct(){this.menu=this.createManagedBean(new v6({menuItemCallbacks:wJ,getMenuItems:this.getMenuItems.bind(this),mapMenuItems:this.mapWithStockItems.bind(this),beforeMenuOpen:this.beforeMenuOpen.bind(this),onMenuOpen:this.onMenuOpen.bind(this),onMenuClose:this.onMenuClose.bind(this),afterMenuDestroyed:this.afterMenuDestroyed.bind(this),onVisibleChanged:this.dispatchVisibleChangedEvent.bind(this),shouldBlockMenuOpen:()=>!!this.beans.overlays?.exclusive}))}hideActiveMenu(){this.menu.hideActiveMenu()}getMenuItems(G,D){let{column:z,node:B,value:Q}=G,J=[],{clipboardSvc:U,chartSvc:Z,csvCreator:S,excelCreator:X,colModel:Y,rangeSvc:W,gos:q}=this.beans;if(NZ(B)&&U){if(z){if(!q.get("suppressCutToClipboard"))J.push("cut");J.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")}}if(q.get("enableCharts")&&Z){if(Y.isPivotMode())J.push("pivotChart");if(W&&!W.isEmpty())J.push("chartRange")}if(NZ(B)){let w=q.get("enableRowPinning"),K=q.get("isRowPinnable");if(w){let I=B.level>-1&&B.footer,V=B.level===-1&&B.footer,A=jK(q);if(V&&!(A==="pinnedBottom"||A==="pinnedTop")||!V&&!I){if(K?.(B)??!0)J.push("pinRowSubMenu")}}let f=q.get("suppressExcelExport")||!X,N=q.get("suppressCsvExport")||!S;if(!PK()&&(!f||!N))J.push("export")}let H=J.length?J:void 0,_=z?.getColDef().contextMenuItems;if(Array.isArray(_))return _;if(typeof _==="function")return _(OK(q,{column:z,node:B,value:Q,defaultItems:H,event:D}));return q.getCallback("getContextMenuItems")?.({column:z,node:B,value:Q,defaultItems:H,event:D})??J}getContextMenuPosition(G,D){let z=this.getRowCtrl(G),B=this.getCellGui(z,D);if(!B)return{x:0,y:z?.getRowYPosition()??0};let Q=B.getBoundingClientRect();return{x:Q.x+Q.width/2,y:Q.y+Q.height/2}}showContextMenu(G){let D=G.rowNode??null,z=G.column??null,{anchorToElement:B,value:Q,source:J}=G;if(D&&z&&Q==null)Q=this.beans.valueSvc.getValueForDisplay({column:z,node:D,from:"edit"}).value;if(B==null)B=this.getContextMenuAnchorElement(D,z);this.beans.menuUtils.onContextMenu({mouseEvent:G.mouseEvent??null,touchEvent:G.touchEvent??null,showMenuCallback:(U)=>this.menu.showMenu({node:D,column:z,value:Q},U,B),source:J})}handleContextMenuMouseEvent(G,D,z,B){let Q=B?.rowNode??z?.rowNode??null,J=B?.column??z?.findFullWidthInfoForEvent(G||D)?.column??null,{valueSvc:U,ctrlsSvc:Z}=this.beans,S=J?U.getValue(J,Q,"edit"):null,X=Z.getGridBodyCtrl(),Y=B?B.eGui:X.eGridBody;this.showContextMenu({mouseEvent:G,touchEvent:D,rowNode:Q,column:J,value:S,anchorToElement:Y,source:"ui"})}beforeMenuOpen(G){if(!G.column)this.beans.focusSvc.clearFocusedCell()}onMenuOpen(){let{ctrlsSvc:G,focusSvc:D}=this.beans;G.getGridBodyCtrl().eGridBody.classList.add(FZ),this.focusedCell=D.getFocusedCell()}onMenuClose(){this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(FZ)}afterMenuDestroyed(){let{beans:G,focusedCell:D}=this;uK(G,D)}dispatchVisibleChangedEvent(G,D){this.eventSvc.dispatchEvent({type:"contextMenuVisibleChanged",visible:G,source:D})}getRowCtrl(G){let{rowIndex:D,rowPinned:z}=G||{};if(D==null)return;return this.beans.rowRenderer.getRowByPosition({rowIndex:D,rowPinned:z})||void 0}getCellGui(G,D){if(!G||!D)return;return G.getCellCtrl(D)?.eGui||void 0}getContextMenuAnchorElement(G,D){let z=this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,B=this.getRowCtrl(G);if(!B)return z;let Q=this.getCellGui(B,D);if(Q)return Q;if(B.isFullWidth())return B.getFullWidthElement();return z}mapWithStockItems(G,D,z){let{column:B,node:Q}=D;return this.beans.menuItemMapper.mapWithStockItems(G,B,Q,z,"contextMenu")}},UD="filterMenuTab",ZD="generalMenuTab",FD="columnsMenuTab",XB=[ZD,UD,FD],pK=class extends F7{constructor(){super(...arguments);this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(G,D,z,B,Q){let{column:J,columnGroup:U}=this.splitColumnOrGroup(G),Z=Q?"filterMenuTab":void 0;this.showMenu(J,U,(S)=>{let X=S.getGui();if(this.beans.popupSvc.positionPopupUnderMouseEvent({type:z,additionalParams:{column:J},mouseEvent:D,ePopup:X}),Z)S.showTab?.(Z);this.dispatchVisibleChangedEvent(!0,!1,J,U,Z)},z,Z,void 0,D.target,B)}splitColumnOrGroup(G){let D=G&&lK(G);return{column:D?G:void 0,columnGroup:D?void 0:G}}showMenuAfterButtonClick(G,D,z,B,Q){let J=-1,U="left";if(this.gos.get("enableRtl"))J=1,U="right";let Z=Q?"filterMenuTab":void 0,S=Z?[Z]:void 0,X=P0(this.gos),Y=(X?9:4)*J,W=X?-23:4,{column:q,columnGroup:H}=this.splitColumnOrGroup(G);this.showMenu(q,H,(_)=>{let k=_.getGui();if(this.beans.popupSvc.positionPopupByComponent({type:z,additionalParams:{column:q},eventSource:D,ePopup:k,alignSide:U,nudgeX:Y,nudgeY:W,position:"under",keepWithinBounds:!0}),Z)_.showTab?.(Z);this.dispatchVisibleChangedEvent(!0,!1,q,H,Z)},z,Z,S,D,B)}showMenu(G,D,z,B,Q,J,U,Z){let S=this.getMenuParams(G,D,J,U);if(!S)return;let{menu:X,eMenuGui:Y,anchorToElement:W,restoreFocusParams:q}=S,H=[],{menuUtils:_,popupSvc:k}=this.beans;H.push((K)=>{let f=X.getGui();if(this.destroyBean(X),G)EZ(G,!1,"contextMenu"),_.restoreFocusOnClose(q,f,K);Z?.()});let w=this.getLocaleTextFunc();if(k.addPopup({modal:!0,eChild:Y,closeOnEsc:!0,closedCallback:(K)=>{for(let f of H)f(K);this.dispatchVisibleChangedEvent(!1,!1,G,D,Q)},afterGuiAttached:(K)=>X.afterGuiAttached(Object.assign({},{container:B},K)),positionCallback:Q?()=>z(X):void 0,ariaLabel:w("ariaLabelColumnMenu","Column Menu")}),!Q)X.showTabBasedOnPreviousSelection?.(),z(X);if(nK(this.gos)){let K=k.setPopupPositionRelatedToElement(Y,W);if(K&&G)this.addStopAnchoring(K,G,H)}if(X.addEventListener("tabSelected",(K)=>{this.dispatchVisibleChangedEvent(!1,!0,G),this.lastSelectedTab=K.key,this.dispatchVisibleChangedEvent(!0,!0,G)}),G)EZ(G,!0,"contextMenu");this.activeMenu=X,X.addEventListener("destroyed",()=>{if(this.activeMenu===X)this.activeMenu=null})}addStopAnchoring(G,D,z){G.then((B)=>{D.__addEventListener("leftChanged",B),D.__addEventListener("visibleChanged",B),z.push(()=>{D.__removeEventListener("leftChanged",B),D.__removeEventListener("visibleChanged",B)})})}getMenuParams(G,D,z,B){let{focusSvc:Q,visibleCols:J,ctrlsSvc:U}=this.beans,Z={column:G,headerPosition:Q.focusedHeader,columnIndex:J.allCols.indexOf(G),eventSource:B},S=this.createMenu(G,D,Z,z,B);return S?{menu:S,eMenuGui:S.getGui(),anchorToElement:B||U.getGridBodyCtrl().eGridBody,restoreFocusParams:Z}:void 0}createMenu(G,D,z,B,Q){if(P0(this.gos))return this.createBean(new mK(G,z,this.lastSelectedTab,B,Q));else{let J=this.beans.colMenuFactory.getMenuItems(G,D);return J.length?this.createBean(new tK(J,G,z,Q)):void 0}}dispatchVisibleChangedEvent(G,D,z,B,Q){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:G,switchingTab:D,key:this.lastSelectedTab??Q??(P0(this.gos)?ZD:"columnMenu"),column:z??null,columnGroup:B??null})}isMenuEnabled(G){if(!P0(this.gos))return!0;let D=!this.beans.filterManager?.isFilterAllowed(G),z=G.getColDef().menuTabs??XB;return(D&&z.includes(UD)?z.length-1:z.length)>0}showMenuAfterContextMenuEvent(G,D,z){this.beans.menuUtils.onContextMenu({mouseEvent:D,touchEvent:z,source:"ui",showMenuCallback:(B)=>{return this.showMenuAfterMouseEvent(G,B,"columnMenu"),!0}})}},mK=class extends F7{constructor(G,D,z,B,Q){super();this.column=G,this.restoreFocusParams=D,this.initialSelection=z,this.restrictTo=B,this.sourceElement=Q,this.tabFactories={},this.includeChecks={};let{tabFactories:J,includeChecks:U}=this;J[ZD]=this.createMainPanel.bind(this),J[UD]=this.createFilterPanel.bind(this),J[FD]=this.createColumnsPanel.bind(this),U[ZD]=()=>!0,U[UD]=()=>G?!!this.beans.filterManager?.isFilterAllowed(G):!1,U[FD]=()=>!0}postConstruct(){let G=this.getTabsToCreate().map((z)=>this.createTab(z)),D=new YJ({items:G,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(D),this.mainMenuList?.setParentComponent(D),this.addDestroyFunc(()=>this.destroyBean(D))}getTabsToCreate(){if(this.restrictTo)return this.restrictTo;return(this.column?.getColDef().menuTabs??XB).filter((G)=>this.isValidMenuTabItem(G)&&this.isNotSuppressed(G))}isValidMenuTabItem(G){let D=!0,z=XB;if(this.restrictTo!=null)D=this.restrictTo.indexOf(G)>-1,z=this.restrictTo;if(D=D&&XB.indexOf(G)>-1,!D)dK(175,{menuTabName:G,itemsToConsider:z});return D}isNotSuppressed(G){return this.includeChecks[G]()}createTab(G){return this.tabFactories[G]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(G){let{tabItemColumns:D,tabbedLayout:z,tabItemFilter:B,tabItemGeneral:Q}=this;if(D&&G===FD)z.showItem(D);else if(B&&G===UD)z.showItem(B);else if(Q&&G===ZD)z.showItem(Q);else z.showFirstItem()}onTabItemClicked(G){let D=null;switch(G.item){case this.tabItemColumns:D=FD;break;case this.tabItemFilter:D=UD;break;case this.tabItemGeneral:D=ZD;break}if(D)this.activateTab(D)}activateTab(G){let D={type:"tabSelected",key:G};this.dispatchLocalEvent(D)}createMainPanel(){let{beans:G,column:D}=this,z=G.colMenuFactory,B=z.createMenu(this,z.getMenuItems(D),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=B,B.addEventListener("closeMenu",this.onHidePopup.bind(this));let Q={title:yQ("legacyMenu",G,D),titleLabel:ZD.replace("MenuTab",""),bodyPromise:TQ.resolve(B.getGui()),name:ZD};return this.tabItemGeneral=Q,Q}onHidePopup(G){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,G)}createFilterPanel(){let G=this.column?this.createBean(new yK(this.column,"COLUMN_MENU")):null;if(this.filterComp=G,!G?.hasFilter())hK(119);let D=(B)=>G?.afterGuiAttached(B),z=()=>G?.afterGuiDetached();return this.tabItemFilter={title:yQ("filterTab",this.beans,this.column),titleLabel:UD.replace("MenuTab",""),bodyPromise:TQ.resolve(G?.getGui()),afterAttachedCallback:D,afterDetachedCallback:z,name:UD},this.tabItemFilter}createColumnsPanel(){let G=cK({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:D,column:z}=this,Q=D.colChooserFactory.createColumnSelectPanel(this,z).getGui();Q.classList.add("ag-menu-column-select"),G.appendChild(Q);let J={title:yQ("columns",D,z),titleLabel:FD.replace("MenuTab",""),bodyPromise:TQ.resolve(G),name:FD};return this.tabItemColumns=J,J}afterGuiAttached(G){let{container:D,hidePopup:z}=G;if(this.tabbedLayout.setAfterAttachedParams({container:D,hidePopup:z}),z)this.hidePopupFunc=z,this.addDestroyFunc(z)}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},tK=class extends TK{constructor(G,D,z,B){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"});this.menuItems=G,this.column=D,this.restoreFocusParams=z,this.sourceElement=B,this.eColumnMenu=xK}postConstruct(){let G=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=G,G.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(G.getGui())}onHidePopup(G){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,G)}afterGuiAttached({hidePopup:G}){if(G)this.hidePopupFunc=G,this.addDestroyFunc(G);iK(this.mainMenuList.getGui())}};function sK(G,D){let{contextMenuSvc:z}=G;if(!z)return;let{rowNode:B,column:Q,value:J,x:U,y:Z}=D||{},{x:S,y:X}=z.getContextMenuPosition(B,Q);if(U!=null)S=U;if(Z!=null)X=Z;z.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:S,clientY:X}),rowNode:B,column:Q,value:J,source:"api"})}function oK(G,D){G.colChooserFactory?.showColumnChooser({chooserParams:D})}function rK(G){G.colChooserFactory?.hideActiveColumnChooser()}var Bf=class extends aK{constructor(){super(...arguments);this.beanName="menuUtils"}restoreFocusOnClose(G,D,z,B){let{eventSource:Q}=G,J=z instanceof KeyboardEvent;if(!B&&!J||!Q)return;let U=Gf(this.beans);if(!D.contains(U)&&!IZ(this.beans))return;this.focusHeaderCell(G)}closePopupAndRestoreFocusOnSelect(G,D,z){let B;if(z?.keyboardEvent)B=z.keyboardEvent;G(B&&{keyboardEvent:B});let Q=this.beans,J=Q.focusSvc,U=J.getFocusedCell();if(IZ(Q))if(U){let{rowIndex:Z,rowPinned:S,column:X}=U;J.setFocusedCell({rowIndex:Z,column:X,rowPinned:S,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(D)}onContextMenu(G){let{mouseEvent:D,touchEvent:z,showMenuCallback:B,source:Q}=G;if(!this.gos.get("allowContextMenuWithControlKey")){if(D&&(D.ctrlKey||D.metaKey))return}if(D)this.blockMiddleClickScrollsIfNeeded(D);if(Q==="ui"&&this.gos.get("suppressContextMenu"))return;let J=D??z.touches[0];if(B(J)){let U=D??z;if(U?.cancelable)U.preventDefault()}}async focusHeaderCell(G){let{column:D,columnIndex:z,headerPosition:B,eventSource:Q}=G,{visibleCols:J,headerNavigation:U,focusSvc:Z}=this.beans,S=await J.allCols.some((X)=>X===D);if(!this.isAlive())return;if(D?.isAlive()&&S&&Q&&Df(Q)){let X=eK(Q);if(X)U?.scrollToColumn(D),X.focus()}else if(B&&z!==-1){let X=J.allCols,Y=X[z]||zf(X);if(Y)Z.focusHeaderPosition({headerPosition:{headerRowIndex:B.headerRowIndex,column:Y}})}}blockMiddleClickScrollsIfNeeded(G){if(this.gos.get("suppressMiddleClickScrolls")&&G.which===2)G.preventDefault()}},E7={moduleName:"MenuCore",version:j,beans:[CK,UK,Bf],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[i,zK,QK,TB]},W0={moduleName:"ColumnMenu",version:j,beans:[pK,bK,YK],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:oK,hideColumnChooser:rK},dependsOn:[E7,BK,DK]},FJ={moduleName:"ContextMenu",version:j,beans:[gK],apiFunctions:{showContextMenu:sK},dependsOn:[E7]},Qf={moduleName:"Menu",version:j,dependsOn:[W0,FJ]},Lf=10,RZ=class extends Uf{constructor(){super({tag:"div",cls:"ag-cell-edit-wrapper"});this.pendingInitialEventKey=null,this.initialEventKeyProcessed=!1}initialiseEditor(G){let{cellStartedEdit:D,values:z,valuesPage:B,eventKey:Q}=this.params;if(this.pendingInitialEventKey=null,this.initialEventKeyProcessed=!1,AZ(z)&&AZ(B))Cz(180);let J=this.resolveAsyncMode(),{params:U,valueList:Z}=this.buildRichSelectParams(J),S=this.createManagedBean(new gB(U));this.eEditor=S,S.addCss("ag-cell-editor"),this.appendChild(S);let X=this.getAsyncValuesSource(J);if(X)S.setAsyncValuesSource({source:X,thresholdRows:this.params.valuesPageLoadThreshold??Lf,useAsyncSearch:J.isFullAsync,onMisconfiguredSearchSource:J.isFullAsync?()=>Cz(294):void 0,onFirstValuesPageLoaded:()=>{if(this.pendingInitialEventKey!=null)this.consumeInitialEventKey(this.pendingInitialEventKey),this.pendingInitialEventKey=null}});if(this.eEditor.setValueList({valueList:Z,refresh:!0,isInitial:!0}),J.isValuesPaged)if(this.eEditor.resetAsyncValues(""),J.isFullAsync)this.consumeInitialEventKey(Q);else this.pendingInitialEventKey=Q;else if(Z&&!Array.isArray(Z))Z.then((Y)=>{let W=this.getSearchStringCallback(Y);if(W)S.setSearchStringCreator(W);this.consumeInitialEventKey(Q)}).catch((Y)=>{$f("Rich Select",Y),this.consumeInitialEventKey(Q)});this.addManagedListeners(S,{fieldPickerValueSelected:this.onEditorPickerValueSelected.bind(this)}),this.focusAfterAttached=D}onEditorPickerValueSelected(G){if(this.gos.get("editType")!=="fullRow")setTimeout(()=>this.params.stopEditing(!G.fromEnterKey))}getPlaceholderText(G=this.isFullAsync()){let{valuePlaceholder:D}=this.params;if(D!==void 0)return D;let z=this.getLocaleTextFunc();return G?z("typeToSearchOoo","Type to search..."):z("advancedFilterBuilderSelectOption","Select an option...")}isFullAsync(){let{allowTyping:G,filterListAsync:D,values:z,valuesPage:B}=this.params,Q=typeof z==="function"||typeof B==="function";if(D&&!G)return Cz(294),!1;if(!Q&&D)return Cz(294),!1;return!!(G&&D&&Q)}isValuesPaged(){return typeof this.params.valuesPage==="function"}resolveAsyncMode(){return{isValuesPaged:this.isValuesPaged(),isFullAsync:this.isFullAsync()}}getInitialValueList(G=this.resolveAsyncMode()){let D=this.params,{values:z}=D;if(G.isValuesPaged)return;if(!z)return[];if(Array.isArray(z))return z;if(typeof z!=="function")return[];if(G.isFullAsync)return;return z({...D})}buildRichSelectParams(G=this.resolveAsyncMode()){let D=this.params,{cellRenderer:z,cellRendererParams:B,cellHeight:Q,value:J,values:U,formatValue:Z,searchDebounceDelay:S,valueListGap:X,valueListMaxHeight:Y,valueListMaxWidth:W,allowTyping:q,filterList:H,searchType:_,highlightMatch:k,eventKey:w,multiSelect:K,suppressDeselectAll:f,suppressMultiSelectPillRenderer:N}=D,{isValuesPaged:F,isFullAsync:E}=G,I=Z??((v)=>String(v??"")),A={value:J,cellRenderer:z,cellRendererParams:B,cellRowHeight:Q,searchDebounceDelay:S,valueFormatter:(v)=>{if(Array.isArray(v))return v.map((h)=>I(h)).join(", ");return I(v)},pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:X,allowTyping:q,filterList:H,searchType:_,highlightMatch:k,maxPickerHeight:Y,maxPickerWidth:W,placeholder:this.getPlaceholderText(E),initialInputValue:w?.length===1?w:w===MZ.BACKSPACE?"":void 0,multiSelect:K,suppressDeselectAll:f,suppressMultiSelectPillRenderer:N},R=this.getInitialValueList(G),O=Array.isArray(U),u=typeof U==="function";if(F){if(R)A.valueList=R;if(E)A.allowNoResultsCopy=!0,A.filterList=!0}else if(O)A.valueList=R,A.searchStringCreator=this.getSearchStringCallback(R);else if(u&&E)A.allowNoResultsCopy=!0,A.filterList=!0;return{params:A,valueList:R}}getAsyncValuesSource(G=this.resolveAsyncMode()){let{isFullAsync:D,isValuesPaged:z}=G;if(!D&&!z)return;return{searchValues:D?(B)=>this.getAsyncSearchValues(B):void 0,loadValuesPage:z?(B)=>this.getAsyncValuesPage(B):void 0,valuesPageInitialStartRow:z?(B)=>this.resolveValuesPageInitialStartRow(B):void 0,valuesPageSize:z?this.params.valuesPageSize:void 0}}getAsyncSearchValues(G){let{values:D}=this.params;if(typeof D!=="function")return[];return D({...this.params,search:G})}getAsyncValuesPage(G){let{valuesPage:D}=this.params;if(typeof D!=="function")return{values:[]};return D({...this.params,search:G.search,startRow:G.startRow,endRow:G.endRow,cursor:G.cursor})}resolveValuesPageInitialStartRow(G){if(G)return 0;let{valuesPageInitialStartRow:D,value:z}=this.params,B=typeof D==="function"?D(z):D;return Math.max(Math.floor(B??0),0)}getSearchStringCallback(G){if(typeof G[0]!=="object")return;let D=this.params,{colDef:z,formatValue:B}=D,Q=B??((U)=>String(U??""));if(z.cellEditorParams?.formatValue)return(U)=>U.map(Q);let{keyCreator:J}=z;if(J){Cz(266);let{column:U,node:Z,data:S}=D;return(X)=>X.map((Y)=>{let W=Zf(this.gos,{value:Y,colDef:z,column:U,node:Z,data:S});return J(W)})}return(U)=>U.map(Q)}afterGuiAttached(){let{focusAfterAttached:G,params:D}=this;setTimeout(()=>{if(!this.isAlive())return;let z=this.eEditor,{allowTyping:B,eventKey:Q,cellStartedEdit:J}=D;if(G){let U=z.getFocusableElement();if(U.focus(),B&&(!Q||Q.length!==1))U.select()}if(J)z.showPicker();if(this.pendingInitialEventKey==null)this.consumeInitialEventKey(Q)})}consumeInitialEventKey(G){if(!G||this.initialEventKeyProcessed)return;this.initialEventKeyProcessed=!0,this.processEventKey(G)}processEventKey(G){if(!G)return;if(G===MZ.BACKSPACE)this.eEditor.searchTextFromString(null);else if(G?.length===1)this.eEditor.searchTextFromString(G)}focusIn(){this.eEditor.getFocusableElement().focus()}agSetEditValue(G){this.params.value=G,this.eEditor.setValue(G??null,!0)}getValue(){let{params:G}=this,D=this.eEditor.getValue();return G.parseValue?.(D)??D}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){let{params:G}=this,{getValidationErrors:D}=G;if(!D)return null;return D({value:this.getValue(),internalErrors:null,cellEditorParams:G})}},I7={moduleName:"RichSelect",version:j,beans:[],userComponents:{agRichSelect:RZ,agRichSelectCellEditor:RZ},icons:{richSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading"},dependsOn:[i,Jf]},RD="__AG_SELECT_ALL__",CD="__AG_ADD_SELECTION_TO_FILTER__",kf=class{constructor(G,D,z,B){this.valueSvc=G,this.getValueFormatter=D,this.formatter=z,this.column=B,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(G,D,z){this.displayedKeys=Array.from(z)}updateDisplayedValuesToMatchMiniFilter(G,D,z,B,Q){this.displayedKeys=[];let J=this.getValueFormatter();for(let U of z)if(U==null){if(Q)this.displayedKeys.push(U)}else{let Z=G(U),S=this.valueSvc.formatValue(this.column,null,Z,J,!1),X=this.formatter(S);if(B(X))this.displayedKeys.push(U)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(G){return this.displayedKeys[G]}getSelectAllItem(){return RD}getAddSelectionToFilterItem(){return CD}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(G){this.displayedKeys.forEach(G)}someDisplayedKey(G){return this.displayedKeys.some(G)}hasGroups(){return!1}refresh(){}},bf={tag:"div",cls:"ag-set-filter-item",attrs:{"aria-hidden":"true"},children:[{tag:"span",cls:"ag-set-filter-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-set-filter-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-set-filter-group-opened-icon"},{tag:"span",ref:"eGroupIndeterminateIcon",cls:"ag-set-filter-group-indeterminate-icon"}]},{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},vf={tag:"div",cls:"ag-set-filter-item",children:[{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},Of=class extends Kf{constructor(G){super(G.isGroup?bf:vf,[wf]);this.eCheckbox=g0,this.eGroupOpenedIcon=g0,this.eGroupClosedIcon=g0,this.eGroupIndeterminateIcon=g0,this.formattedValue=null,this.focusWrapper=G.focusWrapper,this.value=G.value,this.params=G.params,this.translate=G.translate,this.valueFormatter=G.valueFormatter,this.item=G.item,this.isSelected=G.isSelected,this.isTree=G.isTree,this.depth=G.depth??0,this.isGroup=G.isGroup,this.groupsExist=G.groupsExist,this.isExpanded=G.isExpanded,this.hasIndeterminateExpandState=G.hasIndeterminateExpandState}postConstruct(){if(this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"setFilterValue",shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0,getAdditionalParams:()=>{let{colDef:G,column:D}=this.params,z={colDef:G,column:D,valueFormatted:this.formattedValue??void 0};if(this.isTree)z.level=this.depth;return z}})),this.addDestroyFunc(()=>this.destroyCellRendererComponent?.()),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree){if(this.depth>0)this.addCss("ag-set-filter-indent-"+this.depth),this.getGui().style.setProperty("--ag-indentation-level",String(this.depth));if(this.isGroup)this.setupExpansion();else if(this.groupsExist)this.addCss("ag-set-filter-add-group-indent");Cf(this.getAriaElement(),this.depth+1)}if(this.refreshAriaChecked(),this.params.readOnly)return;this.eCheckbox.onValueChange((G)=>this.onCheckboxChanged(!!G))}getFocusableElement(){return this.focusWrapper}setupExpansion(){let{eGroupClosedIcon:G,eGroupOpenedIcon:D,eGroupIndeterminateIcon:z,hasIndeterminateExpandState:B,beans:Q}=this;G.appendChild(cQ("setFilterGroupClosed",Q,null)),D.appendChild(cQ("setFilterGroupOpen",Q,null));let J=this.onExpandOrContractClicked.bind(this);if(this.addManagedElementListeners(G,{click:J}),this.addManagedElementListeners(D,{click:J}),B)z.appendChild(cQ("setFilterGroupIndeterminate",Q,null)),this.addManagedElementListeners(z,{click:J});this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(G,D){if(this.isGroup&&G!==this.isExpanded){this.isExpanded=G;let z={type:"expandedChanged",isExpanded:!!G,item:this.item};if(!D)this.dispatchLocalEvent(z);this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){let{isExpanded:G,hasIndeterminateExpandState:D,eGroupClosedIcon:z,eGroupOpenedIcon:B,eGroupIndeterminateIcon:Q}=this;if(hQ(z,D?G===!1:!G),hQ(B,G===!0),D)hQ(Q,G===void 0)}onCheckboxChanged(G){this.isSelected=G;let D={type:"selectionChanged",isSelected:G,item:this.item};this.dispatchLocalEvent(D),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){if(this.params.readOnly)return;this.setSelected(!this.isSelected)}setSelected(G,D){this.isSelected=G,this.eCheckbox.setValue(G,D),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;let G=this.getLocaleTextFunc(),D=this.eCheckbox.getValue(),z=D===void 0?G("ariaIndeterminate","indeterminate"):D?G("ariaVisible","visible"):G("ariaHidden","hidden"),B=G("ariaToggleVisibility","Press SPACE to toggle visibility");Rf(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${B} (${z})`)}setupFixedAriaLabels(G){if(!this.isTree)return;let z=this.getLocaleTextFunc()("ariaFilterValue","Filter Value"),B=this.getAriaElement();Af(B,`${G} ${z}`),If(B,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){let G=this.getAriaElement();Ef(G,this.eCheckbox.getValue())}refreshAriaExpanded(){Mf(this.getAriaElement(),!!this.isExpanded)}refresh(G,D,z){if(this.item=G,D!==this.isSelected)this.setSelected(D,!0);this.setExpanded(z,!0);let{cellRendererComponent:B,cellRendererParams:Q,beans:J,params:U}=this;if(this.valueFunction){let Z=this.valueFunction();if(this.setTooltipAndCellRendererParams(Z,Z),!B)this.renderCellWithoutCellRenderer()}if(B){let Z=VZ(J.userCompFactory,U,Q);if(!B.refresh?.(Z?.params??Q)){let X=B;this.renderCell(),this.destroyBean(X)}}}render(){let{params:{column:G}}=this,{value:D}=this,z=null;if(typeof D==="function")this.valueFunction=D,z=this.valueFunction(),D=z;else if(this.isTree)z=bZ(D);else z=this.getFormattedValue(G,D);this.formattedValue=z,this.setTooltipAndCellRendererParams(D,z),this.renderCell()}setTooltipAndCellRendererParams(G,D){let z=this.gos;if(this.params.showTooltips&&(!Ff(z)||!this.params.cellRenderer)){let B=D!=null?D:bZ(G);this.shouldDisplayTooltip=Nf(z,()=>this.eCheckbox.getGui().querySelector(".ag-label")),this.tooltipFeature?.setTooltipAndRefresh(B)}this.cellRendererParams=ff(z,{value:G,valueFormatted:D,colDef:this.params.colDef,column:this.params.column,setTooltip:(B,Q)=>{z.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=Q,this.tooltipFeature?.setTooltipAndRefresh(B)}})}getFormattedValue(G,D){return this.beans.valueSvc.formatValue(G,null,D,this.valueFormatter,!1)}renderCell(){let D=VZ(this.beans.userCompFactory,this.params,this.cellRendererParams)?.newAgStackInstance();if(D==null){this.renderCellWithoutCellRenderer();return}D.then((z)=>{if(z)this.cellRendererComponent=z,this.eCheckbox.setLabel(z.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(z)})}renderCellWithoutCellRenderer(){let{valueFormatted:G,value:D}=this.cellRendererParams,z=(G==null?D:G)??this.translate("blanks");if(typeof z!=="string")Vf(208),z="";this.eCheckbox.setLabel(z),this.setupFixedAriaLabels(z)}getComponentHolder(){return this.params.column.getColDef()}},xf={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches.",ariaSearchFilterValues:"Search filter values",ariaFilterList:"Filter List",filterSummaryListInactive:"is (All)",filterSummaryListSeparator:", ",filterSummaryListShort:(G)=>`is (${G[0]})`,filterSummaryListLong:(G)=>`is (${G[0]}) and ${G[1]} more`};function m1(G,D,z){let B=G;if(!B)return null;if(B=B.map((Q)=>gf(Pf(Q))),!D&&z&&B.some((Q)=>Q==null)){if(jf(B)==null)return null;return B.filter((Q)=>Q!=null)}return B}function _G(G,D,z){return Tf(G,xf,D,z)}function cf(G){if(G.excelMode==="windows"){if(!G.buttons)G.buttons=["apply","cancel"];if(G.closeOnApply==null)G.closeOnApply=!0}else if(G.excelMode==="mac"){if(!G.buttons)G.buttons=["reset"];if(G.applyMiniFilterWhileTyping==null)G.applyMiniFilterWhileTyping=!0;if(G.debounceMs==null)G.debounceMs=500}if(G.excelMode&&G.defaultToNothingSelected)G.defaultToNothingSelected=!1,yf(207)}function hf(){return([G,D],[z,B])=>{if(D==null)return B==null?0:-1;else if(B==null)return 1;for(let Q=0;Q=B.length)return 1;let J=uf(D[Q],B[Q]);if(J!==0)return J}return 0}}var vZ=class{constructor(G,D,z,B){this.formatter=G,this.treeListPathGetter=D,this.treeListFormatter=z,this.treeDataOrGrouping=B,this.allDisplayedItemsTree=new Map,this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:RD,children:this.allDisplayedItemsTree,expanded:!0,key:RD,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:CD,expanded:!0,key:CD,parentTreeKeys:[]}}updateParams(G,D){this.treeListPathGetter=G,this.treeListFormatter=D}updateDisplayedValuesToAllAvailable(G,D,z,B){if(B==="reload")this.generateItemTree(G,D,z);else if(B==="otherFilter")this.updateAvailable(z),this.updateExpandAll();else if(B==="miniFilter")this.resetFilter(),this.updateExpandAll();this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(G,D,z,B,Q,J){if(J==="reload")this.generateItemTree(G,D,z);else if(J==="otherFilter")this.updateAvailable(z);this.updateFilter(B,Q),this.updateExpandAll(),this.flattenItems()}generateItemTree(G,D,z){let B=new Map;this.allDisplayedItemsTree=B;let Q=!1,J=this.getTreeListPathGetter(G,z);for(let U of D){let Z=G(U),S=J(Z)??[null],X=S.length;if(X>1)Q=!0;let Y=z.has(U),W=B,q,H=[];for(let _=0;_B;let z=!1;for(let B of D){let Q=G(B);if(Q instanceof Date){z=!0;break}else if(Q!=null)break}if(z)return(B)=>nf(B,!1);return df(211),(B)=>[String(B)]}flattenItems(){this.activeDisplayedItemsFlat=[];let G=(D)=>{for(let z of D.values()){if(!z.filterPasses||!z.available)continue;if(this.activeDisplayedItemsFlat.push(z),z.children&&z.expanded)G(z.children)}};G(this.allDisplayedItemsTree)}resetFilter(){let G=(D)=>{let z=D.children;if(z)for(let B of z.values())G(B);D.filterPasses=!0};for(let D of this.allDisplayedItemsTree.values())G(D)}updateFilter(G,D){let z=(B)=>{if(!B.available)return!1;if(B.treeKey==null)return D;return G(this.formatter(this.treeListFormatter?this.treeListFormatter(B.treeKey,B.depth,B.parentTreeKeys):B.treeKey))};for(let B of this.allDisplayedItemsTree.values())this.recursiveItemCheck(B,!1,z,"filterPasses")}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(G){return this.activeDisplayedItemsFlat[G]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){let G=[];return this.forEachDisplayedKey((D)=>G.push(D)),G}forEachDisplayedKey(G){let D=(z,B)=>{let Q=z.children;if(Q){if(!z.expanded||!B){for(let J of Q.values())if(J.filterPasses)D(J,!1)}}else G(z.key)};for(let z of this.activeDisplayedItemsFlat)D(z,!0)}someDisplayedKey(G){let D=(z,B)=>{let Q=z.children;if(Q){if(!z.expanded||!B){for(let J of Q.values())if(J.filterPasses&&D(J,!1))return!0;return!1}}else return G(z.key);return!1};return this.activeDisplayedItemsFlat.some((z)=>D(z,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){let G=(z,B,Q)=>{for(let J of z.values()){if(!J.filterPasses||!J.available||!J.children)continue;if(B=B||!!J.expanded,Q=Q||!J.expanded,B&&Q)return;let U=G(J.children,B,Q);if(U===void 0)return;else if(U)B=!0;else Q=!0}return B&&Q?void 0:B},D=this.getSelectAllItem();D.expanded=G(D.children,!1,!1)}recursiveItemCheck(G,D,z,B){let Q=!1,J=G.children;if(J)for(let Z of J.values()){let S=this.recursiveItemCheck(Z,D||z(G),z,B);Q=Q||S}let U=D||Q||z(G);return G[B]=U,U}updateAvailable(G){let D=(z)=>G.has(z.key);for(let z of this.allDisplayedItemsTree.values())this.recursiveItemCheck(z,!1,D,"available")}},M7=class extends Yf{constructor(){super("setFilter","set-filter");this.filterType="set",this.eMiniFilter=bz,this.eFilterLoading=bz,this.eFilterLoadingIcon=bz,this.eSetFilterList=bz,this.eFilterNoMatches=bz,this.hardRefreshVirtualList=!1,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.selectedKeys=new Set}setParams(G){super.setParams(G);let D=this.updateHandler(G.getHandler()),{column:z,textFormatter:B,treeList:Q,treeListPathGetter:J,treeListFormatter:U}=G;if(this.formatter=B??((Z)=>Z??null),this.displayValueModel=Q?new vZ(this.formatter,J,U,D.isTreeDataOrGrouping()):new kf(this.beans.valueSvc,()=>this.handler.valueFormatter,this.formatter,z),D.valueModel.allKeys.then((Z)=>{if(!this.isAlive())return;this.updateDisplayedValues("reload",Z??[]),this.resetSelectionState(Z??[])}),D.valueModel.isLoading())this.setIsLoading(!0);this.initialiseFilterBodyUi()}refresh(G){if(this.params.treeList!==G.treeList)return!1;return this.updateHandler(G.getHandler()),super.refresh(G)}updateParams(G,D){if(super.updateParams(G,D),this.updateMiniFilter(),G.suppressSelectAll!==D.suppressSelectAll)this.createVirtualListModel(G);let{textFormatter:z,treeListPathGetter:B,treeListFormatter:Q}=G;if(this.formatter=z??((J)=>J??null),this.displayValueModel instanceof vZ)this.displayValueModel.updateParams(B,Q);this.handler.refreshFilterValues(!0)}updateHandler(G){if(this.handler!==G){for(let z of this.handlerDestroyFuncs??[])z();this.handlerDestroyFuncs=[...this.addManagedListeners(G,{anyFilterChanged:(z)=>{G.valueModel.allKeys.then((B)=>{if(this.isAlive()){if(this.updateDisplayedValues("otherFilter",B??[]),z.updated)this.checkAndRefreshVirtualList(),this.showOrHideResults()}})},dataChanged:({hardRefresh:z})=>{G.valueModel.allKeys.then((B)=>{if(this.isAlive()){if(this.updateDisplayedValues("reload",B??[]),this.setSelectedModel(this.state.model?.values??null),z)this.hardRefreshVirtualList=!0;this.checkAndRefreshVirtualList()}})}}),...this.addManagedListeners(G.valueModel,{loadingStart:()=>this.setIsLoading(!0),loadingEnd:()=>this.setIsLoading(!1)})],this.handler=G}return G}updateUiVisibility(){}createBodyTemplate(){return{tag:"div",cls:"ag-set-filter",children:[{tag:"div",ref:"eFilterLoading",cls:"ag-filter-loading ag-loading ag-hidden",children:[{tag:"span",ref:"eFilterLoadingIcon",cls:"ag-loading-icon"},{tag:"span",cls:"ag-loading-text",children:_G(this,"loadingOoo")}]},{tag:"ag-input-text-field",ref:"eMiniFilter",cls:"ag-mini-filter"},{tag:"div",ref:"eFilterNoMatches",cls:"ag-filter-no-matches ag-hidden",children:_G(this,"noMatches")},{tag:"div",ref:"eSetFilterList",cls:"ag-set-filter-list",role:"presentation"}]}}getAgComponents(){return[Xf]}handleKeyDown(G){if(super.handleKeyDown(G),G.defaultPrevented)return;let D=()=>{if(!this.eSetFilterList.contains(_f(this.beans)))return;let z=this.virtualList.getLastFocusedRow();if(z==null)return;let B=this.virtualList.getComponentAt(z);if(B==null)return;G.preventDefault();let{readOnly:Q}=this.params;if(Q)return;return B};switch(G.key){case Vz.SPACE:D()?.toggleSelected();break;case Vz.ENTER:this.handleKeyEnter(G);break;case Vz.LEFT:D()?.setExpanded(!1);break;case Vz.RIGHT:D()?.setExpanded(!0);break}}handleKeyEnter(G){G.preventDefault();let{excelMode:D,readOnly:z}=this.params;if(!D||!!z)return;if(this.params.onAction("apply",void 0,G),this.params.excelMode==="mac")this.eMiniFilter.getInputElement().select()}setModelAndRefresh(G){return this.setSelectedModel(G).then(()=>{if(this.isAlive())this.checkAndRefreshVirtualList()})}setModelIntoUi(G){this.setMiniFilter(this.params.state.state?.miniFilterValue??null,!0);let D=G==null?null:G.values;return this.setModelAndRefresh(D)}getModelFromUi(){let G=this.getSelectedModel();if(!G)return null;return{values:G,filterType:this.filterType}}areNonNullModelsEqual(G,D){return Wf(G.values,D.values)}setIsLoading(G){if(xQ(this.eFilterLoading,G),!G)this.hardRefreshVirtualList=!0}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter(),this.initLoading()}initLoading(){let G=qf("setFilterLoading",this.beans,this.params.column);if(G)this.eFilterLoadingIcon.appendChild(G)}initVirtualList(){let G=_G(this,"ariaFilterList"),D=!!this.params.treeList,z=this.virtualList=this.createBean(new Lz({cssIdentifier:"filter",ariaRole:D?"tree":"listbox",listName:G})),B=this.eSetFilterList;if(D)B.classList.add("ag-set-filter-tree-list");B.appendChild(z.getGui());let{cellHeight:Q}=this.params;if(Q!=null)z.setRowHeight(Q);let J=(Z,S)=>this.createSetListItem(Z,D,S);z.setComponentCreator(J);let U=(Z,S)=>this.updateSetListItem(Z,S);z.setComponentUpdater(U),this.createVirtualListModel(this.params)}createVirtualListModel(G){let D;if(G.suppressSelectAll)D=new lf(this.displayValueModel);else D=new pf(this.displayValueModel,this.showAddCurrentSelectionToFilter.bind(this));if(G.treeList)D=new mf(D);this.virtualList.setModel(D)}getSelectAllLabel(){let G=this.miniFilterText==null||!this.params.excelMode?"selectAll":"selectAllSearchResults";return _G(this,G)}getAddSelectionToFilterLabel(){return _G(this,"addCurrentSelectionToFilter")}createSetListItem(G,D,z){let B=this.displayValueModel.hasGroups(),{isSelected:Q,isExpanded:J}=this.isSelectedExpanded(G),{value:U,depth:Z,isGroup:S,hasIndeterminateExpandState:X,selectedListener:Y,expandedListener:W}=this.newSetListItemAttributes(G),q={focusWrapper:z,value:U,params:this.params,translate:(_)=>_G(this,_),valueFormatter:this.handler.valueFormatter,item:G,isSelected:Q,isTree:D,depth:Z,groupsExist:B,isGroup:S,isExpanded:J,hasIndeterminateExpandState:X},H=this.createBean(new Of(q));if(H.addEventListener("selectionChanged",Y),W)H.addEventListener("expandedChanged",W);return H}newSetTreeItemAttributes(G){let D=this.displayValueModel.hasGroups();if(G.key===RD)return{value:()=>this.getSelectAllLabel(),isGroup:D,depth:G.depth,hasIndeterminateExpandState:!0,selectedListener:(z)=>this.onSelectAll(z.isSelected),expandedListener:(z)=>this.onExpandAll(z.item,z.isExpanded)};if(G.key===CD)return{value:()=>this.getAddSelectionToFilterLabel(),depth:G.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:(z)=>{this.addCurrentSelectionToFilter=z.isSelected,this.refreshAfterSelection()}};if(G.children)return{value:this.params.treeListFormatter?.(G.treeKey,G.depth,G.parentTreeKeys)??G.treeKey,depth:G.depth,isGroup:!0,selectedListener:(z)=>this.onGroupItemSelected(z.item,z.isSelected),expandedListener:(z)=>this.onExpandedChanged(z.item,z.isExpanded)};return{value:this.params.treeListFormatter?.(G.treeKey,G.depth,G.parentTreeKeys)??G.treeKey,depth:G.depth,selectedListener:(z)=>this.onItemSelected(z.item.key,z.isSelected)}}newSetListItemAttributes(G){if(this.isSetFilterModelTreeItem(G))return this.newSetTreeItemAttributes(G);if(G===RD)return{value:()=>this.getSelectAllLabel(),selectedListener:(D)=>this.onSelectAll(D.isSelected)};if(G===CD)return{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:(D)=>{this.addCurrentSelectionToFilter=D.isSelected,this.refreshAfterSelection()}};return{value:this.handler.valueModel.allValues.get(G)??null,selectedListener:(D)=>this.onItemSelected(D.item,D.isSelected)}}updateSetListItem(G,D){let{isSelected:z,isExpanded:B}=this.isSelectedExpanded(G);D.refresh(G,z,B)}isSelectedExpanded(G){let D,z;if(this.isSetFilterModelTreeItem(G))if(z=G.expanded,G.key===RD)D=this.isSelectAllSelected();else if(G.key===CD)D=this.isAddCurrentSelectionToFilterChecked();else if(G.children)D=this.areAllChildrenSelected(G);else D=this.selectedKeys.has(G.key);else if(G===RD)D=this.isSelectAllSelected();else if(G===CD)D=this.isAddCurrentSelectionToFilterChecked();else D=this.selectedKeys.has(G);return{isSelected:D,isExpanded:z}}isSetFilterModelTreeItem(G){return G?.treeKey!==void 0}initMiniFilter(){let{eMiniFilter:G}=this;this.updateMiniFilter(),G.onValueChange(()=>this.onMiniFilterInput()),G.setInputAriaLabel(_G(this,"ariaSearchFilterValues")),this.addManagedElementListeners(G.getInputElement(),{keydown:(D)=>this.onMiniFilterKeyDown(D)})}updateMiniFilter(){let{eMiniFilter:G,miniFilterText:D,params:z}=this;G.setDisplayed(!z.suppressMiniFilter),G.setValue(D)}afterGuiAttached(G){super.afterGuiAttached(G),this.resetExpansion(),this.refreshVirtualList();let{eMiniFilter:D}=this;if(D.setInputPlaceholder(_G(this,"searchOoo")),!G?.suppressFocus)if(D.isDisplayed())D.getFocusableElement().focus();else this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}afterGuiDetached(){super.afterGuiDetached();let{column:G,excelMode:D,model:z,onStateChange:B}=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(G))return;if(D)this.resetMiniFilter();if(D||z!==this.state.model)B({model:z,state:this.getState()}),this.showOrHideResults()}canApply(G){return this.params.excelMode?G==null||G.values.length>0:!0}onNewRowsLoaded(){}setFilterValues(G){vz(283),this.handler.setFilterValues(G)}resetFilterValues(){vz(283),this.handler.resetFilterValues()}refreshFilterValues(){vz(283),this.doRefreshFilterValues()}doRefreshFilterValues(){this.handler.refreshFilterValues()}onAnyFilterChanged(){}onMiniFilterInput(G){if(!this.doSetMiniFilter(this.eMiniFilter.getValue()))return;if(G){this.showOrHideResults();return}let{applyMiniFilterWhileTyping:D,readOnly:z,excelMode:B}=this.params,Q=!z&&(D||!!B),J=D&&!z?"debounce":void 0;this.updateUiAfterMiniFilterChange(Q,J)}updateUiAfterMiniFilterChange(G,D){if(G){let{excelMode:z,readOnly:B,model:Q}=this.params;if(z&&!B&&this.miniFilterText==null)this.setModelAndRefresh(Q?.values??null);else this.selectAllMatchingMiniFilter(!0)}this.checkAndRefreshVirtualList(),this.onUiChanged(G?D:"prevent"),this.showOrHideResults()}showOrHideResults(){let G=this.miniFilterText!=null&&this.displayValueModel.getDisplayedValueCount()<1;xQ(this.eFilterNoMatches,G),xQ(this.eSetFilterList,!G)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.doSetMiniFilter(null)}onMiniFilterKeyDown(G){let{excelMode:D,readOnly:z}=this.params;if(G.key===Vz.ENTER&&!D&&!z)this.updateUiAfterMiniFilterChange(!0,"immediately")}focusRowIfAlive(G){if(G==null)return Promise.resolve();return new Promise((D)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(G);D()},0)})}onSelectAll(G){if(G)this.selectAllMatchingMiniFilter();else this.deselectAllMatchingMiniFilter();this.refreshAfterSelection()}onGroupItemSelected(G,D){let z=(B)=>{if(!B.filterPasses)return;let Q=B.children;if(Q)for(let J of Q.values())z(J);else this.setKeySelected(B.key,D)};z(G),this.refreshAfterSelection()}onItemSelected(G,D){this.setKeySelected(G,D),this.refreshAfterSelection()}onExpandAll(G,D){let z=(B)=>{if(B.filterPasses&&B.available&&B.children){for(let Q of B.children.values())z(Q);B.expanded=D}};z(G),this.refreshAfterExpansion()}onExpandedChanged(G,D){G.expanded=D,this.refreshAfterExpansion()}refreshAfterExpansion(){let G=this.virtualList.getLastFocusedRow();this.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(G)}refreshAfterSelection(){let G=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(G)}setMiniFilter(G,D){this.eMiniFilter.setValue(G,D),this.onMiniFilterInput(D)}doSetMiniFilter(G){if(G=CZ(G),this.miniFilterText===G)return!1;if(G===null)this.addCurrentSelectionToFilter=!1;return this.miniFilterText=G,this.updateDisplayedValues("miniFilter"),!0}getMiniFilter(){return this.miniFilterText}getUiChangeEventParams(){return{miniFilterValue:this.miniFilterText}}getState(){let G=this.miniFilterText;return G?{miniFilterValue:G}:void 0}checkAndRefreshVirtualList(){if(this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList)this.hardRefreshVirtualList=!1}getFilterKeys(){return vz(283),this.handler.getFilterKeys()}getFilterValues(){return vz(283),this.handler.getFilterValues()}refreshVirtualList(){if(this.params.refreshValuesOnOpen)this.doRefreshFilterValues();else this.checkAndRefreshVirtualList()}isSelectAllSelected(){if(!this.params.defaultToNothingSelected){if(this.hasSelections()&&this.isNothingVisibleSelected())return!1;if(this.isEverythingVisibleSelected())return!0}else{if(this.hasSelections()&&this.isEverythingVisibleSelected())return!0;if(this.isNothingVisibleSelected())return!1}return}areAllChildrenSelected(G){let D=(z)=>{if(z.children){let B=!1,Q=!1;for(let J of z.children.values()){if(!J.filterPasses||!J.available)continue;let U=D(J);if(U===void 0)return;if(U)B=!0;else Q=!0;if(B&&Q)return}return B}else return this.selectedKeys.has(z.key)};if(!this.params.defaultToNothingSelected)return D(G);else return this.hasSelections()&&D(G)}resetExpansion(){if(!this.params.treeList)return;let G=this.displayValueModel.getSelectAllItem();if(this.isSetFilterModelTreeItem(G)){let D=(z)=>{let B=z.children;if(B){for(let Q of B.values())D(Q);z.expanded=!1}};D(G),this.updateDisplayedValues("expansion")}}getModelAsString(G){return this.handler.getModelAsString(G)}getPositionableElement(){return this.eSetFilterList}updateDisplayedValues(G,D){if(G==="expansion"){this.displayValueModel.refresh();return}let z=this.handler,B=z.valueModel;if(this.miniFilterText==null){this.displayValueModel.updateDisplayedValuesToAllAvailable((Z)=>B.allValues.get(Z)??null,D,B.availableKeys,G);return}let Q=z.caseFormat(this.formatter(this.miniFilterText)||""),J=(Z)=>Z!=null&&z.caseFormat(Z).includes(Q),U=!!this.params.excelMode&&J(_G(this,"blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter((Z)=>B.allValues.get(Z)??null,D,B.availableKeys,J,U,G)}hasSelections(){return this.params.defaultToNothingSelected?this.selectedKeys.size>0:this.handler.valueModel.allValues.size!==this.selectedKeys.size}isInWindowsExcelMode(){return this.params.excelMode==="windows"}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&Hf(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(G=!1){if(this.miniFilterText==null)this.selectedKeys=new Set(this.handler.valueModel.allValues.keys());else{if(G)this.selectedKeys.clear();this.displayValueModel.forEachDisplayedKey((D)=>this.selectedKeys.add(D))}}deselectAllMatchingMiniFilter(){if(this.miniFilterText==null)this.selectedKeys.clear();else this.displayValueModel.forEachDisplayedKey((G)=>this.selectedKeys.delete(G))}setKeySelected(G,D){if(D)this.selectedKeys.add(G);else{if(this.params.excelMode&&this.isEverythingVisibleSelected())this.resetSelectionState(this.displayValueModel.getDisplayedKeys());this.selectedKeys.delete(G)}}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey((G)=>!this.selectedKeys.has(G))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey((G)=>this.selectedKeys.has(G))}getSelectedModel(){if(!this.hasSelections())return null;let G=this.isAddCurrentSelectionToFilterChecked()?this.params.model?.values:void 0;if(G?.length){if(this.selectedKeys){let D=new Set([...G,...this.selectedKeys]);return Array.from(D)}return Array.from(G)}return Array.from(this.selectedKeys)}setSelectedModel(G){let D=this.handler,z=D.valueModel;return z.allKeys.then((B)=>{if(G==null)this.resetSelectionState(B??[]);else{this.selectedKeys.clear();let Q=new Map;z.allValues.forEach((J,U)=>{Q.set(D.caseFormat(U),U)}),G.forEach((J)=>{let U=D.caseFormat(CZ(J)),Z=Q.get(U);if(Z!==void 0)this.selectedKeys.add(Z)})}})}resetSelectionState(G){if(this.params.defaultToNothingSelected)this.selectedKeys.clear();else this.selectedKeys=new Set(G)}getFilterHandler(){return this.handler}destroy(){this.virtualList=this.destroyBean(this.virtualList);for(let G of this.handlerDestroyFuncs??[])G();this.handler=void 0,this.displayValueModel=void 0,this.selectedKeys.clear(),super.destroy()}},lf=class{constructor(G){this.model=G}getRowCount(){return this.model.getDisplayedValueCount()}getRow(G){return this.model.getDisplayedItem(G)}areRowsEqual(G,D){return G===D}},pf=class{constructor(G,D){this.model=G,this.showAddCurrentSelectionToFilter=D}getRowCount(){let D=this.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+D}getRow(G){if(G===0)return this.model.getSelectAllItem();let D=this.showAddCurrentSelectionToFilter(),z=D?2:1;if(G===1&&D)return this.model.getAddSelectionToFilterItem();return this.model.getDisplayedItem(G-z)}areRowsEqual(G,D){return G===D}},mf=class{constructor(G){this.model=G}getRowCount(){return this.model.getRowCount()}getRow(G){return this.model.getRow(G)}areRowsEqual(G,D){if(G==null&&D==null)return!0;return G!=null&&D!=null&&G.treeKey===D.treeKey&&G.depth===D.depth}},zN=class extends GN{constructor(G,D,z,B,Q){super();this.createKey=G,this.caseFormat=D,this.getValue=z,this.isTreeDataOrGrouping=B,this.isTreeData=Q}extractUniqueValuesAsync(G,D){return new ef((z)=>{if(this.beans.rowModel.rowCountReady)z(this.extractUniqueValues(G,D));else{let[B]=this.addManagedEventListeners({rowCountReady:()=>{B?.(),z(this.extractUniqueValues(G,D))}})}})}extractUniqueValues(G,D){let z=new Map,B=this.extractExistingFormattedKeys(D),Q=new Set,J=this.isTreeData(),U=this.isTreeDataOrGrouping(),Z=this.beans.rowGroupColsSvc?.columns,S=this.gos.get("groupAllowUnbalanced"),X=(Y,W)=>{let q=this.caseFormat(Y);if(!Q.has(q)){Q.add(q);let H=Y,_=DN(W),k=B?.get(q);if(k!=null)H=k,_=D.get(k);z.set(H,_)}};return this.beans.rowModel.forEachLeafNode((Y)=>{if(!Y.data||!G(Y))return;if(U){this.addValueForTreeDataOrGrouping(Y,J,Z,X,S);return}let W=this.getValue(Y);if(W!=null&&Array.isArray(W)){for(let q of W)X(this.createKey(q,Y),q);if(W.length===0)X(null,null)}else X(this.createKey(W,Y),W)}),z}addValueForTreeDataOrGrouping(G,D,z=[],B,Q){let J;if(D){if(G.childrenAfterGroup?.length)return;J=G.getRoute()??[G.key??G.id]}else J=z.map((Z)=>this.beans.valueSvc.getKeyForNode(Z,G)),J.push(this.getValue(G));let U=m1(J,D,Q);B(this.createKey(U),U)}extractExistingFormattedKeys(G){if(!G)return null;let D=new Map;return G.forEach((z,B)=>{D.set(this.caseFormat(B),B)}),D}},BN=class{constructor(G){this.caseFormat=G,this.keys=null}isNull(){return this.keys==null}isEmpty(){return!this.keys?.size}update(G){let D=new Set;this.keys=D;let z=G?.values;if(z){let B=this.caseFormat;for(let Q=0,J=z.length;Q{return G[G.PROVIDED_LIST=0]="PROVIDED_LIST",G[G.PROVIDED_CALLBACK=1]="PROVIDED_CALLBACK",G[G.TAKEN_FROM_GRID_VALUES=2]="TAKEN_FROM_GRID_VALUES",G})(A7||{}),dQ=A7,$N=class extends QN{constructor(G,D,z,B,Q){super();this.clientSideValuesExtractor=G,this.caseFormat=D,this.createKey=z,this.isTreeDataOrGrouping=B,this.params=Q,this.allValues=new Map,this.availableKeys=new Set,this.providedValues=null,this.initialised=!1}postConstruct(){let G=this.params,D=G.handlerParams.filterParams.values;if(this.updateParams(G),D==null)this.valuesType=2;else this.valuesType=Array.isArray(D)?0:1,this.providedValues=D;this.updateAllValues()}refresh(G){let D=G.handlerParams;if(D.source!=="colDef")return;let{values:z,suppressSorting:B}=D.filterParams,Q=this.providedValues,J=this.params.handlerParams.filterParams.suppressSorting;if(this.params=G,this.updateParams(G),this.providedValues=z??null,this.providedValues!==Q||B!==J){if(!z||z.length===0)this.valuesType=2,this.providedValues=null;else this.valuesType=Array.isArray(z)?0:1;this.updateAllValues()}}updateParams(G){let{handlerParams:{colDef:D,filterParams:{comparator:z,treeList:B,treeListPathGetter:Q}},usingComplexObjects:J}=G,U=z??D.comparator,Z=this.isTreeDataOrGrouping(),S;if(Z&&!U)S=hf();else if(B&&!Q&&!U)S=([X,Y],[W,q])=>uZ(Y,q);else S=([X,Y],[W,q])=>U(Y,q);this.entryComparator=S,this.keyComparator=U??uZ,this.compareByValue=!!(J&&U||Z||B&&!Q)}updateAllValues(){return this.allKeys=new T0((G)=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync().then((D)=>G(this.processAllValues(D)));break;case 0:{G(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break}case 1:{this.dispatchLocalEvent({type:"loadingStart"});let D=this.providedValues,{column:z,colDef:B}=this.params.handlerParams,Q=JN(this.gos,{success:(J)=>{this.dispatchLocalEvent({type:"loadingEnd"}),G(this.processAllValues(this.uniqueValues(this.validateProvidedValues(J))))},colDef:B,column:z});window.setTimeout(()=>D(Q),0);break}}}),this.allKeys.then((G)=>{this.updateAvailableKeys(G??[]),this.initialised=!0}),this.allKeys}getAvailableValues(G){return this.sortKeys(this.getValuesFromRows(G))}overrideValues(G){return this.allKeys.then(()=>{this.valuesType=0,this.providedValues=G})}refreshAvailable(){return new T0((G)=>{if(this.showAvailableOnly()){this.allKeys.then((D)=>{let z=D??[];this.updateAvailableKeys(z),G(!0)});return}G(!1)})}refreshAll(){return new T0((G)=>{this.allKeys.then(()=>{this.updateAllValues().then(()=>{G()})})})}isLoading(){return!this.initialised&&this.valuesType===1}isInitialised(){return this.initialised}getValueForFormatter(G){return this.initialised?this.allValues.get(G):G}getAvailableKeys(G){return this.initialised?G.filter((D)=>this.availableKeys.has(D)):G}getParamsForValuesFromRows(G){if(!this.clientSideValuesExtractor){UN(113);return}return G&&!this.params.handlerParams.filterParams.caseSensitive?this.allValues:void 0}getValuesFromRows(G){let D=this.getParamsForValuesFromRows(!0);return this.clientSideValuesExtractor?.extractUniqueValues(G,D)??null}getValuesFromRowsAsync(){let G=this.getParamsForValuesFromRows(!1);return this.clientSideValuesExtractor?.extractUniqueValuesAsync(()=>!0,G)??T0.resolve(null)}processAllValues(G){let D=this.sortKeys(G);return this.allValues=G??new Map,D}uniqueValues(G){let D=new Map,z=new Set,{caseFormat:B,createKey:Q}=this;for(let J of G??[]){let U=ZN(J),Z=Q(U),S=B(Z);if(!z.has(S))z.add(S),D.set(Z,U)}return D}validateProvidedValues(G){if(this.params.usingComplexObjects&&G?.length){let D=G[0];if(D&&typeof D!=="object"&&typeof D!=="function")if(this.createKey(D)==null)jZ(209);else jZ(210)}return G}sortKeys(G){let D=G??new Map,z=this.params.handlerParams.filterParams;if(z.suppressSorting)return Array.from(D.keys());let B;if(this.compareByValue)B=Array.from(D.entries()).sort(this.entryComparator).map(([Q])=>Q);else B=Array.from(D.keys()).sort(this.keyComparator);if(z.excelMode&&D.has(null))B=B.filter((Q)=>Q!=null),B.push(null);return B}showAvailableOnly(){return this.valuesType===2}updateAvailableKeys(G){let D=this.showAvailableOnly()?this.getAvailableValues((z)=>this.params.handlerParams.doesRowPassOtherFilter(z)):G;this.availableKeys=new Set(D),window.setTimeout(()=>{if(this.isAlive())this.dispatchLocalEvent({type:"availableValuesChanged"})})}},LN=class extends tf{constructor(){super(...arguments);this.filterType="set",this.treeDataTreeList=!1,this.groupingTreeList=!1,this.caseSensitive=!1,this.noValueFormatterSupplied=!1}init(G){this.updateParams(G);let D=this.isTreeDataOrGrouping.bind(this),z=()=>this.treeDataTreeList,B=this.createKey,Q=this.caseFormat.bind(this),{gos:J,beans:U}=this,Z=rf(J,U.rowModel)?this.createManagedBean(new zN(B,Q,G.getValue,D,z)):void 0,S=this.createManagedBean(new $N(Z,Q,B,D,{handlerParams:G,usingComplexObjects:!!(G.filterParams.keyCreator??G.colDef.keyCreator)}));this.addManagedListeners(S,{availableValuesChanged:G.onModelAsStringChange}),this.valueModel=S,this.appliedModel=new BN(this.caseFormat.bind(this)),this.appliedModel.update(G.model),this.validateModel(G),this.addEventListenersForDataChanges()}refresh(G){this.updateParams(G),this.valueModel.refresh({handlerParams:G,usingComplexObjects:!!(G.filterParams.keyCreator??G.colDef.keyCreator)}),this.appliedModel.update(G.model),this.validateModel(G)}updateParams(G){this.params=G;let{colDef:D,filterParams:{caseSensitive:z,treeList:B,keyCreator:Q,valueFormatter:J}}=G;this.caseSensitive=!!z;let U=!!D.showRowGroup;this.treeDataTreeList=this.gos.get("treeData")&&!!B&&U,this.groupingTreeList=!!this.beans.rowGroupColsSvc?.columns.length&&!!B&&U;let Z=Q??D.keyCreator;this.createKey=this.generateCreateKey(Z,this.isTreeDataOrGrouping()),this.setValueFormatter(J,Z,!!B,!!D.refData)}doesFilterPass(G){let{appliedModel:D,treeDataTreeList:z,groupingTreeList:B}=this;if(D.isNull())return!0;if(D.isEmpty())return!1;let{node:Q}=G;if(z)return this.doesFilterPassForTreeData(Q);if(B)return this.doesFilterPassForGrouping(Q);let J=this.params.getValue(Q);if(J!=null&&Array.isArray(J)){if(J.length===0)return D.has(null);return J.some((U)=>D.has(this.createKey(U,Q)))}return D.has(this.createKey(J,Q))}getFormattedValue(G){let D=this.valueModel.getValueForFormatter(G);if(this.noValueFormatterSupplied&&this.isTreeDataOrGrouping()&&Array.isArray(D))D=af(D);let z=this.beans.valueSvc.formatValue(this.params.column,null,D,this.valueFormatter,!1);return(z==null?nQ(D):z)??_G(this,"blanks")}getModelAsString(G,D){let{values:z}=G??{},B=D==="filterToolPanel";if(z==null)return B?_G(this,"filterSummaryListInactive"):"";let Q=this.valueModel.getAvailableKeys(z),J=Q.length,U=B?3:10,Z=Q.slice(0,U).map((S)=>this.getFormattedValue(S));if(B){let S=Z.join(_G(this,"filterSummaryListSeparator"));if(J>3)return _G(this,"filterSummaryListLong",[S,String(J-3)]);else return _G(this,"filterSummaryListShort",[S])}return`(${J}) ${Z.join(",")}${J>10?",...":""}`}onAnyFilterChanged(){window.setTimeout(()=>{if(!this.isAlive())return;this.valueModel.refreshAvailable().then((G)=>{this.dispatchLocalEvent({type:"anyFilterChanged",updated:!!G})})})}onNewRowsLoaded(){this.syncAfterDataChange()}setFilterValues(G){this.valueModel.overrideValues(G).then(()=>{this.refreshFilterValues()})}resetFilterValues(){this.valueModel.valuesType=dQ.TAKEN_FROM_GRID_VALUES,this.syncAfterDataChange()}refreshFilterValues(G){if(!this.valueModel.isInitialised())return;this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged",hardRefresh:!0}),this.validateModel(this.params,void 0,!G)})}getFilterKeys(){return Array.from(this.valueModel.allValues.keys())}getFilterValues(){return Array.from(this.valueModel.allValues.values())}isTreeDataOrGrouping(){return this.treeDataTreeList||this.groupingTreeList}caseFormat(G){if(G==null||typeof G!=="string")return G;return this.caseSensitive?G:G.toUpperCase()}addEventListenersForDataChanges(){this.addManagedPropertyListeners(["groupAllowUnbalanced"],()=>this.syncAfterDataChange());let G=of(this,this.syncAfterDataChange.bind(this),0);this.addManagedEventListeners({cellValueChanged:(D)=>{if(D.column===this.params.column)G()}})}syncAfterDataChange(){if(!this.isValuesTakenFromGrid())return;this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged"}),this.validateModel(this.params,{afterDataChange:!0})})}validateModel(G,D,z){let B=this.valueModel;B.allKeys.then(()=>{let Q=G.model;if(Q==null)return;let J=new Map,U=(H)=>J.set(this.caseFormat(H),H);if(z)for(let H of B.availableKeys)U(H);else B.allValues.forEach((H,_)=>U(_));let Z=[],S=!1;for(let H of Q.values){let _=this.caseFormat(iQ(H)),k=J.get(_);if(k!==void 0){if(Z.push(k),k!==H)S=!0}else S=!0}let X=Z.length,Y=G.filterParams;if(X===0&&Y.excelMode){G.onModelChange(null,D);return}let q=!Y.defaultToNothingSelected&&(this.valueModel.valuesType===dQ.TAKEN_FROM_GRID_VALUES||!Y.suppressClearModelOnRefreshValues)&&X===J.size;if(S||!Q.filterType||q){let H=q?null:{filterType:this.filterType,values:Z};G.onModelChange(H,D)}})}isValuesTakenFromGrid(){return this.valueModel.valuesType===dQ.TAKEN_FROM_GRID_VALUES}doesFilterPassForTreeData(G){if(G.childrenAfterGroup?.length)return!1;let{gos:D,appliedModel:z}=this;return z.has(this.createKey(m1(G.getRoute()??[G.key??G.id],!0,D.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(G){let{appliedModel:D,params:z,gos:B,beans:{rowGroupColsSvc:Q,valueSvc:J}}=this,U=(Q?.columns??[]).map((Z)=>J.getKeyForNode(Z,G));return U.push(z.getValue(G)),D.has(this.createKey(m1(U,!1,B.get("groupAllowUnbalanced"))))}generateCreateKey(G,D){if(D&&!G)return OZ(250),()=>null;if(G)return(z,B=null)=>{let Q=this.getKeyCreatorParams(z,B);return iQ(G(Q))};return(z)=>iQ(nQ(z))}getKeyCreatorParams(G,D=null){let{colDef:z,column:B}=this.params;return sf(this.gos,{value:G,colDef:z,column:B,node:D,data:D?.data})}setValueFormatter(G,D,z,B){let Q=G;if(!Q){if(D&&!z){OZ(249);return}if(this.noValueFormatterSupplied=!0,!B)Q=(J)=>nQ(J.value)}this.valueFormatter=Q}getCrossFilterModel(G){let{createKey:D,valueModel:z,params:B}=this;return G(D,z.availableKeys,B.model?.values)}destroy(){this.appliedModel.destroy(),super.destroy(),this.valueModel=void 0}},qN={tag:"div",cls:"ag-floating-filter-input ag-set-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},HN=class extends XN{constructor(){super(qN,[SN]);this.eFloatingFilterText=YN}init(G){this.params=G,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(G)}setParams(G){let D=this.beans.colNames.getDisplayNameForColumn(G.column,"header",!0),z=this.getLocaleTextFunc();if(this.eFloatingFilterText.setInputAriaLabel(`${D} ${z("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){let B=G;this.updateFloatingFilterText(B.model)}}refresh(G){this.params=G,this.setParams(G)}onParentModelChanged(G){this.updateFloatingFilterText(G)}parentSetFilterInstance(G){this.params.parentFilterInstance((D)=>{if(!(D instanceof M7)){WN(248);return}G(D)})}updateFloatingFilterText(G){if(G==null)this.eFloatingFilterText.setValue("");else if(this.gos.get("enableFilterHandlers"))this.eFloatingFilterText.setValue(this.params.getHandler().getModelAsString?.(G)??"");else this.parentSetFilterInstance((D)=>{this.eFloatingFilterText.setValue(D.getModelAsString(G))})}},R7={moduleName:"SetFilter",version:j,userComponents:{agSetColumnFilter:{classImp:M7,params:{useForm:!0},processParams:(G)=>{return cf(G),G}},agSetColumnFloatingFilter:HN},dynamicBeans:{agSetColumnFilterHandler:LN},icons:{setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",setFilterLoading:"loading"},dependsOn:[i,Sf]},NN=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function FN(G,D,z){return G.getCompDetails(D,EN,void 0,z,!0)}var EN={name:"statusPanel",optionalMethods:["refresh"]},IN={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},MN={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},AN=class extends kN{constructor(){super(MN);this.updateQueued=!1,this.panelsPromise=y0.resolve(),this.eStatusBarLeft=lQ,this.eStatusBarCenter=lQ,this.eStatusBarRight=lQ,this.compDestroyFunctions={},this.registerCSS(NN)}wireBeans(G){this.userCompFactory=G.userCompFactory,this.statusBarSvc=G.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),wN(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){let G=this.gos,D=G.get("statusBar")?.statusPanels;if(!D)return D;return D.filter((z)=>{let{rowModels:B,warnArgs:Q}=IN[z.statusPanel]??{};if(!B)return!0;if(B.includes(G.get("rowModelType")))return!0;return fN(...Q),!1})}processStatusPanels(G){let D=this.getValidPanels();if(D){let z=D.filter((J)=>J.align==="left"),B=D.filter((J)=>J.align==="center"),Q=D.filter((J)=>!J.align||J.align==="right");this.panelsPromise=y0.all([this.createAndRenderComponents(z,this.eStatusBarLeft,G),this.createAndRenderComponents(B,this.eStatusBarCenter,G),this.createAndRenderComponents(Q,this.eStatusBarRight,G)])}else this.setDisplayed(!1)}handleStatusBarChanged(){if(this.updateQueued)return;this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1})}updateStatusBar(){let G=this.getValidPanels(),D=Array.isArray(G)&&G.length>0;this.setDisplayed(D);let z=new Map;if(D)for(let B of G){let Q=B.key??B.statusPanel,J=this.statusBarSvc.getStatusPanel(Q);if(J?.refresh){let U=PZ(this.gos,{...B.statusPanelParams??{},key:Q});if(J.refresh(U))z.set(Q,J),delete this.compDestroyFunctions[Q],KN(J.getGui())}}if(this.resetStatusBar(),D)this.processStatusPanels(z)}resetStatusBar(){pQ(this.eStatusBarLeft),pQ(this.eStatusBarCenter),pQ(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(let G of Object.values(this.compDestroyFunctions))G();this.compDestroyFunctions={}}createAndRenderComponents(G,D,z){let B=[];for(let Q of G){let J=Q.key||Q.statusPanel,U=z.get(J),Z;if(U)Z=y0.resolve(U);else{let S=FN(this.userCompFactory,Q,PZ(this.gos,{key:J}));if(S==null)continue;Z=S.newAgStackInstance()}B.push({key:J,promise:Z})}return y0.all(B.map((Q)=>Q.promise)).then(()=>{for(let Q of B)Q.promise.then((J)=>{let U=()=>{this.destroyBean(J)};if(this.isAlive())this.statusBarSvc.registerStatusPanel(Q.key,J),D.appendChild(J.getGui()),this.compDestroyFunctions[Q.key]=U;else U()})})}},RN={selector:"AG-STATUS-BAR",component:AN},yN={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},": ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},xN=BigInt(Number.MIN_SAFE_INTEGER),cN=BigInt(Number.MAX_SAFE_INTEGER),q0=class extends gN{constructor(){super(yN);this.eLabel=gZ,this.eValue=gZ}setLabel(G,D){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(G,D)}setValue(G,D){let z=null,B;if(typeof G==="bigint"){if(B=G,G>=xN&&G<=cN)z=Number(G)}else z=G;this.eValue.textContent=this.valueFormatter(TN(this.gos,{value:z,bigintValue:B,totalRows:D,key:this.key}))}},hN={selector:"AG-NAME-VALUE",component:q0},C7=(G)=>{let D=0;return G.forEachNodeAfterFilter((z)=>{if(z.data)D++}),D},H0=(G)=>{let D=0;return G.forEachNode((z)=>{if(z.data)D++}),D};function iN(G,D){if(typeof G!=="number")return"";return vN(Math.round(G*100)/100,D)}var nN={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},dN=class extends CN{constructor(){super(nN,[hN]);this.sumAggregationComp=Oz,this.countAggregationComp=Oz,this.minAggregationComp=Oz,this.maxAggregationComp=Oz,this.avgAggregationComp=Oz}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(G){this.refresh(G)}refresh(G){this.params=G;let D=G.valueFormatter??((B)=>{let{value:Q,bigintValue:J}=B;if(J!=null)return J.toString();return iN(Q,this.getLocaleTextFunc.bind(this))}),z=["avg","count","min","max","sum"];for(let B of z){let Q=this.getAllowedAggregationValueComponent(B);if(Q)Q.key=B,Q.valueFormatter=D.bind(this)}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(G,D,z){let B=this.getAllowedAggregationValueComponent(G),Q=H0(this.beans.rowModel);if(bN(B)&&B)B.setValue(D,Q),B.setDisplayed(z);else this.getAggregationValueComponent(G)?.setDisplayed(!1)}getAllowedAggregationValueComponent(G){let{aggFuncs:D}=this.params;if(!D||D.includes(G))return this.getAggregationValueComponent(G);return null}getAggregationValueComponent(G){let D=`${G}AggregationComp`;return this[D]}onCellSelectionChanged(){let G=this.beans,{rangeSvc:D,valueSvc:z}=G,B=D?.getCellRanges(),Q=0,J=0n,U=!1,Z=!1,S=0,X=0,Y=null,W=null,q=null,H=null,_=(R)=>{if(typeof R==="number"){if(Q+=R,Y===null||RW)W=R;if(!Number.isInteger(R)||!Number.isSafeInteger(R))Z=!0;else{let O=BigInt(R);if(J+=O,q===null||OH)H=O}}else{if(U=!0,J+=R,q===null||RH)H=R;let O=Number(R);if(Q+=O,Y===null||OW)W=O}X++},k={};if(B?.length&&D)for(let R=0;R{if(u===null)return;let b=VN({rowPinned:u.rowPinned,column:P,rowIndex:u.rowIndex});if(k[b])return;k[b]=!0;let g=uN(G,u);if(mQ(g))return;let c=z.getValue(P,g,"data");if(mQ(c)||c==="")return;if(S++,typeof c==="object"&&"value"in c){if(c=c.value,c==="")return}if(typeof c==="string"){let s=c.trim();if(s==="")return;let m=Number(s);if(!Number.isFinite(m))return;if(Q+m>=Number.MAX_SAFE_INTEGER||Q+m<=Number.MIN_SAFE_INTEGER||m>=Number.MAX_SAFE_INTEGER||m<=Number.MIN_SAFE_INTEGER){if(c=PN(s),c===null)c=m}else c=m}if(typeof c==="number"&&!isNaN(c)||typeof c==="bigint")_(c)}),u=ON(G,u)}}let w=S>1,K=X>1,f=U&&!Z,N;if(f)N=J/BigInt(X);else N=Q/X;let F=K?f?J:Q:null,E=K?f?q:Y:null,I=K?f?H:W:null,V=K?N:null,A=K;this.setAggregationComponentValue("count",S,w),this.setAggregationComponentValue("sum",F,K),this.setAggregationComponentValue("min",E,K),this.setAggregationComponentValue("max",I,K),this.setAggregationComponentValue("avg",V,A)}},pN=class extends q0{postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);let G=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:G})}onDataChanged(){let{rowModel:G}=this.beans,D=H0(G),z=C7(G);this.setValue(z,D),this.setDisplayed(D!==z)}init(G){this.refresh(G),this.onDataChanged()}updateValueFormatter(G){this.valueFormatter=G??(({value:D})=>lN(D,this.getLocaleTextFunc.bind(this)))}refresh(G){let{key:D,valueFormatter:z}=G;return this.key=D,this.updateValueFormatter(z),!0}},tN=class extends q0{postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");let G=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:G,selectionChanged:G})}onRowSelectionChanged(){let{selectionSvc:G,rowModel:D}=this.beans,z=G?.getSelectionCount()??0,B=H0(D);if(this.setValue(z,B),z<0){this.setDisplayed(!0);return}this.setDisplayed(z>0)}init(G){this.refresh(G),this.onRowSelectionChanged()}updateValueFormatter(G){this.valueFormatter=G??(({value:D})=>{if(D==null||D>=0)return mN(D,this.getLocaleTextFunc.bind(this));return this.getLocaleTextFunc()("statusBarLastRowUnknown","?")})}refresh(G){let{key:D,valueFormatter:z}=G;return this.key=D,this.updateValueFormatter(z),!0}},sN=class extends q0{postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let{rowModel:G}=this.beans,D=C7(G),z=H0(G);this.setValue(D,z)}init(G){this.refresh(G),this.onDataChanged()}updateValueFormatter(G){this.valueFormatter=G??(({value:D,totalRows:z})=>{let B=this.getLocaleTextFunc.bind(this),Q=TZ(D,B),J=TZ(z??D,B);if(D===z)return Q;let U=B();return`${Q} ${U("of","of")} ${J}`})}refresh(G){let{key:D,valueFormatter:z}=G;return this.key=D,this.updateValueFormatter(z),!0}},rN=class extends q0{postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let G=H0(this.beans.rowModel);this.setValue(G,G)}init(G){this.refresh(G),this.onDataChanged()}updateValueFormatter(G){this.valueFormatter=G??(({value:D})=>oN(D,this.getLocaleTextFunc.bind(this)))}refresh(G){let{key:D,valueFormatter:z}=G;return this.key=D,this.updateValueFormatter(z),!0}};function eN(G,D){let z=G.statusBarSvc?.getStatusPanel(D);return aN(z)}var DF=class extends GF{constructor(){super();this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(G,D){this.comps.set(G,D)}unregisterStatusPanel(G){this.comps.delete(G)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(G){return this.comps.get(G)}destroy(){this.unregisterAllComponents(),super.destroy()}},xB={moduleName:"StatusBar",version:j,beans:[DF],userComponents:{agAggregationComponent:dN,agTotalRowCountComponent:rN,agFilteredRowCountComponent:pN,agTotalAndFilteredRowCountComponent:sN,agSelectedRowCountComponent:tN},selectors:[RN],apiFunctions:{getStatusPanel:eN},dependsOn:[i,_N]};function V7(G){if(G.excelCreator?.getFactoryMode()==="MULTI_SHEET")return BF(161),!1;return!0}function QF(G,D){if(V7(G))return G.excelCreator?.getDataAsExcel(D);return}function JF(G,D){if(V7(G))G.excelCreator?.exportDataAsExcel(D)}function UF(G,D){return G.excelCreator?.setFactoryMode("MULTI_SHEET"),G.excelCreator?.getSheetDataForExcel(D)}function ZF(G,D){return G.excelCreator?.getMultipleSheetsAsExcel(D)}function $F(G,D){G.excelCreator?.exportMultipleSheetsAsExcel(D)}var cB={moduleName:"ExcelExport",version:j,beans:[tX],apiFunctions:{getDataAsExcel:QF,exportDataAsExcel:JF,getSheetDataForExcel:UF,getMultipleSheetsAsExcel:ZF,exportMultipleSheetsAsExcel:$F},dependsOn:[zF,i]};function hB(G){let{filters:D}=G;return D&&D.length>0?D:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function FB(G,D){if(G==null)return;for(let z=G.length-1;z>=0;z--)D(G[z],z)}function IF(G,D){if(D.title!=null)return D.title;return G instanceof EF?G.getFilterTitle():"Filter"}function EB(G,D,z,B){let Q=[],J=G?.filterModels;for(let U=0;UU==null)?null:{filterType:"multi",filterModels:Q}}function dG(G,D){return G?.filterModels?.[D]??null}function IB(G,D,z,B){let Q=z.filterValueGetter;return Q?G.colFilter.createGetValue(D,Q):B}var b7=class extends kF{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"});this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:(G)=>this.onFocusIn(G)})}refreshGui(G){if(G===this.lastOpenedInContainer)return dD.resolve();return this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),dD.all(this.getFilterWrappers().map((D,z)=>{if(!D)return dD.resolve(null);let B=this.getFilterFromWrapper(D),Q=this.getCompFromWrapper(D),J=this.filterDefs[z],U=IF(B,J),Z;if(J.display==="subMenu"&&G!=="toolPanel")Z=this.insertFilterMenu(Q,B,U).then((S)=>S.getGui());else if(J.display==="subMenu"||J.display==="accordion"){let S=this.insertFilterGroup(B,Q,U);Z=dD.resolve(S.getGui())}else Z=dD.resolve(Q.getGui());return Z})).then((D)=>{D.forEach((z,B)=>{if(!z)return;if(B>0)this.appendChild(wF({tag:"div",cls:"ag-filter-separator"}));this.appendChild(z)}),this.filterGuis=D,this.lastOpenedInContainer=G})}destroyChildren(){for(let G of this.guiDestroyFuncs)G();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(G,D,z){let B=G.getGui();FF(B,"dialog");let Q=this.createBean(new O3),J={getGui:()=>G.getGui(),afterGuiAttached:(U)=>{if(G.afterGuiAttached?.(U),G!==D)D.afterGuiAttached?.(U)}};return Q.init({menuItemDef:{name:z,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:G7,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:J,contextParams:{column:null,node:null,value:null}}).then(()=>{Q.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(Q)),this.addManagedListeners(Q,{menuItemActivated:(Z)=>{if(this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==Z.menuItem)this.lastActivatedMenuItem.deactivate();this.lastActivatedMenuItem=Z.menuItem}});let U=Q.getGui();return Q.addManagedElementListeners(U,{keydown:(Z)=>{let{key:S}=Z;switch(S){case uz.UP:case uz.RIGHT:case uz.DOWN:case uz.LEFT:if(Z.preventDefault(),S===uz.RIGHT)Q.openSubMenu(!0);break}},focusin:()=>Q.activate(),focusout:()=>{if(!Q.isSubMenuOpen()&&!Q.isSubMenuOpening())Q.deactivate()}}),Q})}insertFilterGroup(G,D,z){let B=this.createBean(new jG({title:z,cssIdentifier:"multi-filter"}));if(this.guiDestroyFuncs.push(()=>this.destroyBean(B)),B.addItem(D.getGui()),B.toggleGroupExpand(!1),G.afterGuiAttached)B.addManagedListeners(B,{expanded:()=>G.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})});return B}afterGuiAttached(G){let D;if(G)this.hidePopup=G.hidePopup,D=this.refreshGui(G.container);else this.hidePopup=void 0,D=dD.resolve();let z=G?.suppressFocus;D.then(()=>{let{filterDefs:B,filterGuis:Q,beans:J}=this,U=this.getFilterWrappers(),Z=!!z;if(B)FB(B,(X,Y)=>{let W=Y===0,q=X.display&&X.display!=="inline",H=z||!W||q,_={...G??{},suppressFocus:H},k=U[Y],w=k?this.getFilterFromWrapper(k):void 0;if(k){let K=this.getCompFromWrapper(k);if(K!==w)K.afterGuiAttached(_)}if(w){if(this.executeFunctionIfExistsOnFilter(w,"afterGuiAttached",_),W&&!H)Z=!0}if(!z&&W&&q){let K=Q[Y];if(K){if(!KF(K))K.focus({preventScroll:!0});Z=!0}}});let S=fF(J);if(!Z&&(NF(J)||this.getGui().contains(S)))this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",(G)=>this.executeOnWrapper(G,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",(G)=>this.executeOnWrapper(G,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(G,D){}executeFunctionIfExists(G,D){FB(this.getFilterWrappers(),(z)=>{if(z)D?.(z),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(z),G)})}executeFunctionIfExistsOnFilter(G,D,...z){let B=G[D];if(typeof B==="function")B.apply(G,z)}onFocusIn(G){let D=this.lastActivatedMenuItem;if(D!=null&&!D.getGui().contains(G.target))D.deactivate(),this.lastActivatedMenuItem=null}},v7=class extends b7{constructor(){super(...arguments);this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(G){this.params=G,this.filterDefs=hB(G);let D=WF(this.beans.colFilter.model,G.column.getColId()),{filterChangedCallback:z}=G;this.filterChangedCallback=z;let B=this.filterDefs.map((Q,J)=>this.createFilter(Q,J,D));return new eG((Q)=>{eG.all(B).then((J)=>{this.wrappers=J,this.refreshGui("columnMenu").then(()=>{Q()})})}).then(()=>{for(let Q of this.afterFiltersReadyFuncs)Q();this.afterFiltersReadyFuncs.length=0})}refresh(G){return this.params=G,!0}isFilterActive(){return this.wrappers.some((G)=>{if(!G)return!1;let{filter:D,handler:z,model:B}=G;if(z)return B!=null;return D.isFilterActive()})}getLastActiveFilterIndex(){let G=this.activeFilterIndices;return G.length>0?G[G.length-1]:null}doesFilterPass(G,D){return this.wrappers.every((z,B)=>{if(!z||D!=null&&B===D)return!0;let{handler:Q,filter:J,model:U}=z;if(Q)return U==null||Q.doesFilterPass({...G,model:U,handlerParams:z.handlerParams});return!J.isFilterActive()||J.doesFilterPass(G)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map((D)=>{if(!D)return null;let z=D.filter;if(typeof z.getModelFromUi==="function")return z.getModelFromUi();return null})}}getModel(){if(!this.isFilterActive())return null;return{filterType:this.filterType,filterModels:this.wrappers.map((D)=>{if(!D)return null;let{filter:z,handler:B,model:Q}=D;if(B)return Q;return z.isFilterActive()?z.getModel():null})}}setModel(G){let D=(B,Q)=>{return new eG((J)=>{let U=B.setModel(Q);if(U)U.then(J);else J()})},z=[];return this.wrappers.forEach((B,Q)=>{if(!B)return;let J=dG(G,Q),{filter:U,filterParams:Z,handler:S,handlerParams:X,state:Y}=B;if(S){let W={model:J,state:Y?.state};B.state=W,B.model=J,z.push(yZ(()=>eG.resolve({filter:U,filterParams:Z}),S,X,J,W,"api").then(()=>{this.updateActiveListForHandler(Q,B.model)}))}else z.push(D(U,J).then(()=>{this.updateActiveListForFilter(Q,U)}))}),eG.all(z).then(()=>{})}applyModel(G="api"){let D=!1;for(let z of this.wrappers)if(z){let B=z.filter;if(B instanceof YF)D=B.applyModel(G)||D}return D}getChildFilterInstance(G){return this.wrappers[G]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(let G of this.wrappers)this.destroyBean(G?.filter),this.destroyBean(G?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(G){return G.filter}getCompFromWrapper(G){return G.comp}executeOnWrapper(G,D){G.handler?.[D]?.()}createFilter(G,D,z){let B=this.params.column,Q=null,J,U=this.beans,Z=(H,_)=>{let k=this.wrappers[D];if(!k)return;let w={model:H,state:k.state?.state};k.state=w,k.model=H,yZ(()=>eG.resolve({filter:k.filter,filterParams:k.filterParams}),k.handler,k.handlerParams,H,w,"ui").then(()=>{this.onHandlerModelChanged(D,k.model,_)})},{compDetails:S,handler:X,handlerParams:Y,createFilterUi:W}=U.colFilter.createFilterInstance(B,G,"agTextColumnFilter",(H,_)=>{let k={...H,filterChangedCallback:_?()=>{}:(w)=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(D,w))},doesRowPassOtherFilter:(w)=>H.doesRowPassOtherFilter(w)&&this.doesFilterPass({node:w,data:w.data},D),getValue:IB(U,B,G,H.getValue)};if(_)Q=dG(z,D),J=this.updateDisplayParams(k,D,Q,()=>S,()=>X,Z);return k});if(!W)return eG.resolve(null);let q;if(X){let{doesRowPassOtherFilter:H,getValue:_}=Y;q={...Y,onModelChange:Z,doesRowPassOtherFilter:(k)=>H(k)&&this.doesFilterPass({node:k,data:k.data},D),getValue:IB(U,B,G,_)},X.init?.({...q,model:Q,source:"init"})}return W().then((H)=>{if(!X)return{filter:H,comp:H};let _=S?.params,k=J(H);return{filter:H,comp:k,filterParams:_,handler:X,handlerParams:q,model:Q}})}updateDisplayParams(G,D,z,B,Q,J){let U=this.params.column,Z=new XF;G.model=z,G.state={model:z},G.onModelChange=J,G.getHandler=Q;let S=(Y,W)=>{Y.state=W,Z.dispatchEvent({type:"filterStateChanged",column:U,state:W})};G.onStateChange=(Y)=>{let W=this.wrappers[D];if(!W)return;S(W,Y),qF(W.filter,W.filterParams,W.model??null,Y,"ui")};let X=(Y,W,q)=>{let H=this.wrappers[D];if(!H)return;let _=()=>H?.model??null;_F({action:W,filterParams:H.filterParams,getFilterUi:()=>{let k=eG.resolve(H.filter);return{created:!0,filterParams:H.filterParams,compDetails:B(),create:()=>k,promise:k}},getModel:_,getState:()=>H?.state??{model:_()},updateState:(k)=>S(H,k),updateModel:(k)=>H.filterParams?.onModelChange(k,q),processModelToApply:H.handler?.processModelToApply?.bind(H.handler)})};return G.onAction=(Y,W,q)=>{X(U,Y,W),Z.dispatchEvent({type:"filterAction",column:U,action:Y,event:q})},(Y)=>{let W=B()?.params;return this.createManagedBean(new SF(U,{comp:Y,params:W,isHandler:!0},Z,X,!1))}}executeWhenAllFiltersReady(G){if((this.wrappers?.length??0)>0)G();else this.afterFiltersReadyFuncs.push(G)}updateActiveListForFilter(G,D){this.updateActiveList(G,()=>D?.isFilterActive())}updateActiveListForHandler(G,D){this.updateActiveList(G,()=>D!=null)}updateActiveList(G,D){let z=this.activeFilterIndices;if(HF(this.activeFilterIndices,G),D())z.push(G)}onFilterModelChanged(G,D){this.updateActiveListForFilter(G,this.wrappers[G]?.filter),this.filterChanged(G,D)}onHandlerModelChanged(G,D,z){this.updateActiveListForHandler(G,D),this.filterChanged(G,z)}filterChanged(G,D){this.filterChangedCallback(D),this.wrappers.forEach((z,B)=>{if(G===B||!z)return;let{filter:Q,handler:J}=z;if(J?.onAnyFilterChanged?.(),typeof Q.onAnyFilterChanged==="function")Q.onAnyFilterChanged()})}getModelAsString(G){if(!G?.filterModels?.length)return"";let D=this.getLastActiveFilterIndex()??0;return this.wrappers[D]?.filter?.getModelAsString?.(G.filterModels[D])??""}},RF=class extends MF{constructor(){super(...arguments);this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(G){this.params=G;let D=hB(G.filterParams);this.filterDefs=D,D.forEach((z,B)=>{let Q=this.beans.colFilter.createHandler(G.column,z,"agTextColumnFilter");if(this.handlerWrappers.push(Q),!Q){xZ(278,{colId:G.column.getColId()});return}let{handler:J,handlerParams:U}=Q;J.init?.({...this.updateHandlerParams(U,B,!0),model:dG(G.model,B),source:"init"})}),this.resetActiveList(G.model)}refresh(G){this.params=G;let{model:D,source:z,filterParams:B}=G,Q=B?.filters;if(this.handlerWrappers.forEach((J,U)=>{if(J){let Z=this.updateHandlerParams(G,U,!1,Q?.[U].filterParams);J.handlerParams=Z,J.handler.refresh?.({...Z,model:dG(D,U),source:z})}}),G.source!=="floating"&&G.source!=="ui")this.resetActiveList(G.model);if(G.additionalEventAttributes?.fromButtons)this.onAnyFilterChanged()}updateHandlerParams(G,D,z,B){let{onModelChange:Q,doesRowPassOtherFilter:J,getValue:U}=G,Z={...G,onModelChange:(S,X)=>Q(EB(this.params.model,this.handlerWrappers.length,S,D),X),doesRowPassOtherFilter:(S)=>J(S)&&this.doesFilterPass({node:S,data:S.data,model:this.params.model,handlerParams:Z},D),getValue:IB(this.beans,G.column,this.filterDefs[D],U),filterParams:this.updateFilterParams(G,z,B)};return Z}updateFilterParams(G,D,z){let B=G.filterParams;if(z?.buttons&&D)xZ(292,{colId:G.column.getColId()});let Q=z?{...B,...z}:B;if(!Q.buttons)return Q;if(z)return delete Q.buttons,Q;let{buttons:J,...U}=Q;return U}doesFilterPass(G,D){let z=G.model?.filterModels;if(z==null)return!0;return this.handlerWrappers.every((B,Q)=>{let J=z[Q];if(J==null||D!=null&&Q===D)return!0;let U=B?.handler;return!U||U.doesFilterPass({...G,model:J,handlerParams:B.handlerParams})})}resetActiveList(G){this.activeFilterIndices=[];let D=G?.filterModels;if(D==null)return;for(let z=0;z0?G[G.length-1]:null}getModelAsString(G,D){let z=D==="filterToolPanel",B=()=>z?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!G?.filterModels?.length)return B();let Q=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[Q]?.handler.getModelAsString?.(G.filterModels[Q],D)??B()}getHandler(G){return this.handlerWrappers[G]?.handler}onAnyFilterChanged(){FB(this.handlerWrappers,(G)=>G?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){FB(this.handlerWrappers,(G)=>G?.handler?.onNewRowsLoaded?.())}destroy(){for(let G of this.handlerWrappers)this.destroyBean(G?.handler);this.handlerWrappers.length=0,super.destroy()}},vF=class extends CF{constructor(){super(...arguments);this.beanName="multiFilter"}getParamsForDataType(G,D,z,B){let Q=G?.filters,J=this.beans;if(!Q)Q=[{filter:VF(z.baseDataType)},{filter:"agSetColumnFilter"}];let U=this.getLocaleTextFunc();return Q=Q.map((Z)=>{let{filter:S,filterParams:X,filterValueGetter:Y}=Z;if(typeof S!=="string")return Z;let{filterParams:W,filterValueGetter:q}=bF(S,X,Y??D,z,B,J,U);return{...Z,filterParams:W,filterValueGetter:q}}),{filterParams:{...G,filters:Q}}}},O7=class extends b7{constructor(){super(...arguments);this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(G){this.params=G;let D=hB(G).map((B)=>{if(B.filterParams?.buttons){PF(292,{colId:G.column.getColId()});let Q={...B.filterParams};return delete Q.buttons,{...B,filterParams:Q}}return B});this.filterDefs=D,this.allState=G.state;let z=this.filterDefs.map((B,Q)=>this.createFilter(B,Q));return new tQ((B)=>{tQ.all(z).then((Q)=>{this.filters=Q,this.refreshGui("columnMenu").then(()=>{B()})})})}refresh(G){let{model:D,state:z,source:B}=G;if(B==="colDef")return!1;this.params=G;let Q=this.filterParams;if(z===this.allState)return!0;this.allState=z;let J=z.state;return this.filters.forEach((U,Z)=>{let S=dG(D,Z),X={state:J?.[Z],model:dG(z.model,Z)};jF(U,Q[Z],S,X,B)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(G){return this.filters[G]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(let G of this.filters)this.destroyBean(G);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(G){return G}getCompFromWrapper(G){return G}createFilter(G,D){let z=this.beans.userCompFactory,B=this.updateParams(G,this.params,D),Q=OF(z,G,B,"agTextColumnFilter");if(!Q)return tQ.resolve(null);return this.filterParams[D]=Q.params,Q.newAgStackInstance()}updateParams(G,D,z){let{doesRowPassOtherFilter:B,model:Q,onModelChange:J,state:U,onStateChange:Z,column:S,source:X,onAction:Y,onUiChange:W,getValue:q}=D,H=dG(Q,z),_=U?{model:dG(U.model,z),state:U.state?.[z]}:{model:H},k=()=>{let K=this.getHandler();this.filters.forEach((f,N)=>{if(z!==N)K.getHandler(N)?.onAnyFilterChanged?.(),f?.onAnyFilterChanged?.()})},w=this.beans.colFilter;return{...w.createBaseFilterParams(S),...G,doesRowPassOtherFilter:(K)=>B(K)&&this.getHandler().doesFilterPass({node:K,data:K.data,model:this.params.model,handlerParams:w.getHandlerParams(S)},z),model:H,state:_,onModelChange:(K,f)=>{let{filters:N,params:F}=this,E=EB(F.model,N.length,K,z);this.updateActiveList(z,K),J(E,f),k()},onStateChange:(K)=>this.onStateChange(Z,z,K),getHandler:()=>this.getHandler().getHandler(z),onAction:(K,f,N)=>{if(uF(D))return;let F=K==="apply"||K==="reset";if(F)this.updateActiveList(z,dG(this.params.state.model,z));if(Y(K,f,N),F)k()},onUiChange:W,source:X,getValue:IB(this.beans,S,G,q)}}updateActiveList(G,D){this.getHandler().updateActiveList?.(G,D)}getHandler(){return this.params.getHandler()}onStateChange(G,D,z){let{model:B,state:Q,valid:J}=z,U=this.validity;U[D]=J;let Z=this.allState,S=EB(Z.model,this.filters.length,B,D),X=U.every((q)=>q!==!1),Y=[...Z.state??[]];Y[D]=Q;let W={state:Y,model:S,valid:X};this.allState=W,G(W)}getModelAsString(G){return this.getHandler().getModelAsString?.(G)??""}},nF={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},dF=class extends TF{constructor(){super(nF);this.floatingFilters=[],this.compDetailsList=[]}init(G){this.params=G;let{compDetailsList:D}=this.getCompDetailsList(G);return this.setParams(D)}setParams(G){let D=[];return G.forEach((z)=>{let B=z?.newAgStackInstance();if(B!=null)this.compDetailsList.push(z),D.push(B)}),gF.all(D).then((z)=>{z.forEach((B,Q)=>{this.floatingFilters.push(B);let J=B.getGui();if(this.appendChild(J),Q>0)jz(J,!1)})})}refresh(G){this.params=G;let{compDetailsList:D,floatingFilterParamsList:z}=this.getCompDetailsList(G);if(D.length===this.compDetailsList.length&&D.every((Q,J)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[J],Q))){if(z.forEach((Q,J)=>{this.floatingFilters[J].refresh?.(Q)}),this.gos.get("enableFilterHandlers")){let Q=G;if(Q.model==null)this.floatingFilters.forEach((J,U)=>{jz(J.getGui(),U===0)});else{let J=Q.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((U,Z)=>{let S=J==null?Z===0:Z===J;jz(U.getGui(),S)})}}}else yF(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(D)}getCompDetailsList(G){let D=[],z=[],B=G.filterParams,Q=G.currentParentModel,J=hB(B);return J.forEach((U,Z)=>{let S={...G,parentFilterInstance:(Y)=>{this.parentMultiFilterInstance((W)=>{let q=W.getChildFilterInstance(Z);if(q==null)return;Y(q)})},currentParentModel:()=>Q()?.filterModels?.[Z]??null};if(this.gos.get("enableFilterHandlers")){let Y=S;Y.model=Y.model?.filterModels?.[Z]??null;let{onModelChange:W,getHandler:q}=Y;Y.onModelChange=(H,_)=>W(EB(this.params.model,J.length,H,Z),_),Y.getHandler=()=>{return q().getHandler(Z)}}iF(S.filterParams,U.filterParams);let X=this.getCompDetails(U,S);if(X)D.push(X),z.push(S)}),{compDetailsList:D,floatingFilterParamsList:z}}onParentModelChanged(G,D){if(D?.afterFloatingFilter)return;this.parentMultiFilterInstance((z)=>{if(G==null)this.floatingFilters.forEach((B,Q)=>{B.onParentModelChanged(null,D),jz(B.getGui(),Q===0)});else{let B=z.getLastActiveFilterIndex();this.floatingFilters.forEach((Q,J)=>{let U=G.filterModels.length>J?G.filterModels[J]:null;Q.onParentModelChanged(U,D);let Z=B==null?J===0:J===B;jz(Q.getGui(),Z)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(G,D){let{colFilter:z,frameworkOverrides:B,userCompFactory:Q}=this.beans,J=cF(B,G,()=>z.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return hF(Q,G,D,J)}parentMultiFilterInstance(G){this.params.parentFilterInstance((D)=>{if(!(D instanceof v7||D instanceof O7))xF(120);G(D)})}},iB={moduleName:"MultiFilter",version:j,userComponents:{agMultiColumnFilter:{getComp:(G)=>G.gos.get("enableFilterHandlers")?{classImp:O7,params:{useForm:!0}}:v7},agMultiColumnFloatingFilter:dF},beans:[vF],dynamicBeans:{agMultiColumnFilterHandler:RF},dependsOn:[i,LF,TB]},sF=class extends mF{constructor(){super(...arguments);this.beanName="aggColNameSvc"}getHeaderName(G,D){if(this.gos.get("suppressAggFuncInHeader"))return D;let{valueColsSvc:z,colModel:B,rowGroupColsSvc:Q}=this.beans,J=G.getColDef().pivotValueColumn,U=tF(J),Z=null,S;if(U){let X=z?.columns??[],Y=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&X.length===1,W=G.getColDef().pivotTotalColumnIds!==void 0;if(Y&&!W)return D;Z=J?J.getAggFunc():null,S=!0}else{let X=G.isValueActive(),Y=Q?.columns.length!==0,W=B.isPivotMode()||Y||this.gos.get("treeData");if(X&&W)Z=G.getAggFunc(),S=!0;else S=!1}if(S){let X=typeof Z==="string"?Z:"func";return`${this.getLocaleTextFunc()(X,X)}(${D})`}return D}},aF={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},eF=class extends oF{constructor(){super(...arguments);this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){if(this.initialised)return;this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs"))}initialiseWithDefaultAggregations(){let G=this.aggFuncsMap;G.sum=GE,G.first=DE,G.last=zE,G.min=BE,G.max=QE,G.count=UE,G.avg=$E,this.initialised=!0}isAggFuncPossible(G,D){let B=this.getFuncNames(G).includes(D),Q=cZ(this.aggFuncsMap[D]);return B&&Q}getDefaultFuncLabel(G){return aF[G]??G}getDefaultAggFunc(G){let D=G.getColDef().defaultAggFunc;if(cZ(D)&&this.isAggFuncPossible(G,D))return D;if(this.isAggFuncPossible(G,"sum"))return"sum";let z=this.getFuncNames(G);return z?.length?z[0]:null}addAggFuncs(G){if(this.init(),!G)return;for(let D of Object.keys(G))if(G[D])this.aggFuncsMap[D]=G[D]}getAggFunc(G){return this.init(),this.aggFuncsMap[G]}getFuncNames(G){let D=G.getColDef().allowedAggFuncs;return D==null?Object.keys(this.aggFuncsMap).sort():D}clear(){this.aggFuncsMap={}}};function GE(G){let{values:D}=G,z=null;for(let B=0;B0?G.values[0]:null}function zE(G){return G.values.length>0?rF(G.values):null}function BE(G){let{values:D}=G,z=null;for(let B=0;BQ))z=Q}return z}function QE(G){let{values:D}=G,z=null;for(let B=0;B0)Q=z/(typeof z==="number"?B:BigInt(B));let J=G.rowNode?.aggData?.[G.column?.getColId()];if(J&&J.count===B&&J.value===Q)return J;let U=Object.create(ZE);return U.count=B,U.value=Q,U}var XE=class extends LE{constructor(){super(...arguments);this.beanName="aggChildrenSvc"}getAggregatedChildren(G,D,z){if(!G?.group)return[];if(G.rowPinned){if(G=G.pinnedSibling,!G)return[]}let B=this.gos,Q=u7(G,D,B);if(!z)return Q;let J=[];return j7(Q,D,B,J),J}},u7=(G,D,z)=>{let B=D?.colDef,Q=B?.pivotKeys;if(Q){if(G.leafGroup&&Q.length&&!B.pivotTotalColumnIds)return S7(G.childrenMapped,Q);return G.childrenAfterFilter??G.childrenAfterGroup??[]}if(SE(z)||z.get("suppressAggFilteredOnly"))return G.childrenAfterGroup??[];return G.childrenAfterFilter??G.childrenAfterGroup??[]},j7=(G,D,z,B)=>{for(let Q=0,J=G.length;Q{JZ(I,null,F)})}return}this.hadAgg=!0;let{colModel:J,aggFuncSvc:U}=z,Z=D.get("alwaysAggregateAtRootLevel")||!!_E(D)||J.isPivotMode(),S=!kE(D)&&!D.get("suppressAggFilteredOnly"),X=z.valueSvc,Y=z.gridApi,W=z.gridOptions.context,q=Q??[],H=q.length,_=G?.kind==="cells"?G:void 0,k,w=Array(H);for(let F=0;F=0)k=_;w[F]={column:E,colId:E.colId,colDef:E.colDef,aggFunc:P7(E.getAggFunc(),U,E),colSlot:I}}let K=FE(J,z.pivotResultCols,U),f=H>0?Array(H):null,N=z.rowModel;hZ(N.rootNode,N.hierarchical,G,(F)=>{if(F.level===-1&&!Z){aD(F,null,J);return}let E;if(B)E=B({nodes:F.childrenAfterFilter});else if(!f)E=null;else if(K)E=NE(F,K,X,Y,W);else E=fE(F,w,H,f,k,S,X,Y,W);JZ(F,E,J)})}},fE=(G,D,z,B,Q,J,U,Z,S)=>{let X=(J?G.childrenAfterFilter:G.childrenAfterGroup)??[],Y=X.length,W=G.data,q=Object.create(null),H=Q?Q.getSlot(G):-1,_=H>=0?G.aggData:void 0,k=0;for(let w=0;w=0&&!Q.hasCellBySlot(H,K.colSlot)){if(B[w]=null,_)q[K.colId]=_[K.colId]}else B[w]=Array(Y),++k}if(k===0)return q;for(let w=0;w{let J=D.length,U=G.leafGroup,Z=G.data,S=G.childrenMapped,X=G.childrenAfterFilter??[],Y=Object.create(null),W,q;for(let H=0;H{if(typeof G==="function")return G;if(G==null)return null;let B=D.getAggFunc(G);if(typeof B!=="function")return wE(109,{inputValue:G.toString(),allSuggestions:D.getFuncNames(z)}),null;return B},FE=(G,D,z)=>{if(!G.isPivotActive())return null;let B=D?.getAggregationOrderedList();if(!B||B.length===0)return null;let Q=B.length,J=Array(Q),U=0;for(let Z=0;Z{let D=G.childrenAfterAggFilter,z=0;if(D){let Q=D.length;z=Q;for(let J=0;J=0?null:z;G.setAllChildrenCount(B),G.pinnedSibling?.setAllChildrenCount(B)},this.setAllChildrenCountGridGrouping=(G)=>{let D=G.childrenAfterAggFilter,z=0;for(let B=0,Q=D.length;B!_.node.group,X=(_)=>_.node.leafGroup,Y=ME(this.gos)||(J?X:S),W=Z?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,q=(_,k=!1)=>{if(_.childrenAfterFilter){if(_.childrenAfterAggFilter=_.childrenAfterFilter,k){let w=_.childrenAfterAggFilter;for(let K=0,f=w.length;K{if(_.childrenAfterAggFilter=_.childrenAfterFilter?.filter((k)=>{if(Y({node:k})){if(Q.doesRowPassAggregateFilters({rowNode:k}))return q(k,!0),!0}return k.childrenAfterAggFilter?.length})||null,_.hasChildren())W(_);else _.setAllChildrenCount(null),_.pinnedSibling?.setAllChildrenCount(null);if(_.sibling)_.sibling.childrenAfterAggFilter=_.childrenAfterAggFilter};IE(D.rootNode,D.hierarchical,G,U?H:q)}};function pG(G,D){if(G.sibling)return;let z=OE(G,D);z.footer=!0,z.setRowTop(null),z.setRowIndex(null),z.oldRowTop=null,z.id="rowGroupFooter_"+G.id,z.sibling=G,G.sibling=z}function EJ(G){let D=G.sibling;if(!D)return;D._destroy(!1),G.sibling=void 0,D.sibling=void 0}var uE=class extends RE{constructor(){super(...arguments);this.beanName="footerSvc"}addTotalRows(G,D,z,B,Q,J){let U=G;if(Q){let X=B&&VE(this.gos);if(jE(J,X))pG(D,this.beans),z(D.sibling,U++);return U}let Z=bE(this.gos);if((B&&Z({node:D}))===J)pG(D,this.beans),z(D.sibling,U++);return U}getTopDisplayIndex(G,D,z,B){let Q=D;if(G[0].footer){if(D===0)return 0;Q-=1}let J=G[G.length-1],U=Q>=z.length;if(J.footer&&U)return J.rowIndex;return B(Q)}doesCellShowTotalPrefix(G,D){if(!G.footer||!D?.getColDef().showRowGroup)return!1;if(this.gos.get("treeData"))return!0;if(G.level===-1)return this.beans.showRowGroupCols?.columns[0]===D;return!!G.rowGroupColumn&&D?.isRowGroupDisplayed(G.rowGroupColumn.getId())}applyTotalPrefix(G,D,z,B){let Q=B.getColDef().cellRendererParams?.totalValueGetter;if(Q){let J=CE(this.gos,{column:B,node:z,value:G,formattedValue:D});if(typeof Q==="function")return Q(J);if(typeof Q==="string")return this.beans.expressionSvc?.evaluate(Q,J);vE(179)}if(z.level===-1)return this.getLocaleTextFunc()("footerTotal","Total")+" ";return this.getTotalValue(D??G)??""}getTotalValue(G){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(G??"")}};function jE(G,D){switch(D){case"top":case"pinnedTop":return G==="top";case"bottom":case"pinnedBottom":return G==="bottom";default:return!1}}var g7=class extends PE{constructor(){super(...arguments);this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(G,D,z)=>this.setValueActive(D,G,z),add:(G,D,z)=>this.setValueActive(!0,G,z),remove:(G,D,z)=>this.setValueActive(!1,G,z)},this.columnExtractors={setFlagFunc:(G,D,z)=>this.setColValueActive(G,D,z),getIndexFunc:()=>{return},getInitialIndexFunc:()=>{return},getValueFunc:(G)=>{let D=G.aggFunc;if(D===null||D==="")return null;if(D===void 0)return;return!!D},getInitialValueFunc:(G)=>{return G.initialAggFunc!=null&&G.initialAggFunc!=""}},this.modifyColumnsNoEventsCallbacks={addCol:(G)=>this.columns.push(G),removeCol:(G)=>TE(this.columns,G)}}extractCols(G,D){this.columns=super.extractCols(G,D);for(let z of this.columns){let B=z.getColDef();if(B.aggFunc!=null&&B.aggFunc!="")this.setColAggFunc(z,B.aggFunc);else if(!z.getAggFunc())this.setColAggFunc(z,B.initialAggFunc)}return this.columns}setColumnAggFunc(G,D,z){if(!G)return;let B=this.colModel.getColDefCol(G);if(!B)return;this.setColAggFunc(B,D),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[B],z)}syncColumnWithState(G,D,z){let B=z("aggFunc").value1;if(B!==void 0)if(typeof B==="string"){if(this.setColAggFunc(G,B),!G.isValueActive())this.setColValueActive(G,!0,D),this.modifyColumnsNoEventsCallbacks.addCol(G)}else{if(gE(B))yE(33);if(G.isValueActive())this.setColValueActive(G,!1,D),this.modifyColumnsNoEventsCallbacks.removeCol(G)}}setValueActive(G,D,z){if(G===D.isValueActive())return;if(this.setColValueActive(D,G,z),G&&!D.getAggFunc()&&this.aggFuncSvc){let B=this.aggFuncSvc.getDefaultAggFunc(D);this.setColAggFunc(D,B)}}setColAggFunc(G,D){G.aggFunc=D,G.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(G,D,z){if(G.aggregationActive!==D)G.aggregationActive=D,G.dispatchColEvent("columnValueChanged",z)}},IJ={moduleName:"SharedAggregation",version:j,beans:[eF,sF,uE,g7],apiFunctions:{addAggFuncs:YE,clearAggFuncs:WE,setColumnAggFunc:qE},dependsOn:[i]},MJ={moduleName:"Aggregation",version:j,beans:[KE,AE,XE],rowModels:["clientSide"],dependsOn:[IJ]},T7=class extends xE{constructor(){super(...arguments);this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(G,D,z)=>this.setColPivotActive(G,D,z),add:(G,D,z)=>this.setColPivotActive(G,!0,z),remove:(G,D,z)=>this.setColPivotActive(G,!1,z)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(G,D,z)=>this.setColPivotActive(G,D,z),getIndexFunc:(G)=>G.pivotIndex,getInitialIndexFunc:(G)=>G.initialPivotIndex,getValueFunc:(G)=>G.pivot,getInitialValueFunc:(G)=>G.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:(G)=>{if(!this.columns.includes(G))this.columns.push(G)},removeCol:(G)=>cE(this.columns,G)}}syncColumnWithState(G,D,z,B){let{value1:Q,value2:J}=z("pivot","pivotIndex");if(Q!==void 0||J!==void 0){if(typeof J==="number"||Q){if(!G.isPivotActive())this.setColPivotActive(G,!0,D),this.modifyColumnsNoEventsCallbacks.addCol(G);if(B&&typeof J==="number")B[G.getId()]=J}else if(G.isPivotActive())this.setColPivotActive(G,!1,D),this.modifyColumnsNoEventsCallbacks.removeCol(G)}}setColPivotActive(G,D,z){if(G.pivotActive!==D){if(G.pivotActive=D,D)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,G)?.forEach((Q)=>this.setColPivotActive(Q,D,z));G.dispatchColEvent("columnPivotChanged",z)}G.dispatchStateUpdatedEvent("pivot")}},dE=class extends hE{constructor(){super(...arguments);this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(G,D,z)=>this.setActive(D,G,z),add:(G,D,z)=>this.setActive(!0,G,z),remove:(G,D,z)=>this.setActive(!1,G,z)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(G,D,z)=>this.setColRowGroupActive(G,D,z),getIndexFunc:(G)=>G.rowGroupIndex,getInitialIndexFunc:(G)=>G.initialRowGroupIndex,getValueFunc:(G)=>G.rowGroup,getInitialValueFunc:(G)=>G.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:(G)=>{if(!this.columns.includes(G))this.columns.push(G)},removeCol:(G)=>iE(this.columns,G)}}moveColumn(G,D,z){if(this.columns.length===0)return;let B=this.columns[G],Q=this.columns.slice(G,D);this.columns.splice(G,1),this.columns.splice(D,0,B),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:Q,column:Q.length===1?Q[0]:null,source:z})}syncColumnWithState(G,D,z,B){let{value1:Q,value2:J}=z("rowGroup","rowGroupIndex");if(Q!==void 0||J!==void 0){if(typeof J==="number"||Q){if(!G.isRowGroupActive())this.setColRowGroupActive(G,!0,D),this.modifyColumnsNoEventsCallbacks.addCol(G);if(B&&typeof J==="number")B[G.getId()]=J}else if(G.isRowGroupActive())this.setColRowGroupActive(G,!1,D),this.modifyColumnsNoEventsCallbacks.removeCol(G)}}setActive(G,D,z){if(G===D.isRowGroupActive())return;this.setColRowGroupActive(D,G,z);let B=this.beans.groupHierarchyColSvc?.getColumn(D);if(nE(this.gos,G)&&!B)this.colModel.setColsVisible([D],!G,z)}setColRowGroupActive(G,D,z){if(G.rowGroupActive!==D){if(G.rowGroupActive=D,D)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,G)?.forEach((Q)=>this.setColRowGroupActive(Q,D,z));G.dispatchColEvent("columnRowGroupChanged",z)}G.dispatchStateUpdatedEvent("rowGroup")}},ZI=class extends pE{constructor(){super(...arguments);this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this)),this.setupGroupHideColumnsUntilExpanded()}setupGroupHideColumnsUntilExpanded(){let G=()=>this.updateGroupColumnVisibility();this.addManagedEventListeners({modelUpdated:G}),this.addManagedPropertyListeners(["groupHideColumnsUntilExpanded","groupDisplayType","groupHideOpenParents"],G)}addColumns(G){let{columns:D}=this;if(D==null)return;G.list=D.list.concat(G.list),G.tree=D.tree.concat(G.tree),QI(G)}createColumns(G,D,z){let B=this.beans,{colModel:Q,gos:J,rowGroupColsSvc:U,colGroupSvc:Z}=B,S=Q.isPivotMode(),X=zI(J,S),Y=S?J.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),W=U?.columns,H=!(W&&W.length>0||J.get("treeData"))||Y||X,_=()=>{if(this.columns)nZ(B,this.columns.tree),this.columns=null};if(H){_();return}let k=this.generateAutoCols(W),w=sE(k,this.columns?.list||null),K=G.treeDepth,N=(this.columns?this.columns.treeDepth:-1)==K;if(w&&N){let V=new Map(k.map((A)=>[A.getId(),A]));for(let A of this.columns?.list??[]){let R=V.get(A.getId());if(R)A.setColDef(R.getColDef(),null,z)}return}_();let F=Z?.findDepth(G.tree)??0,E=Z?.balanceTreeForAutoCols(k,F)??[];this.columns={list:k,tree:E,treeDepth:F,map:{}},D((V)=>{if(!V)return null;let A=V.filter((R)=>!UI(R));return[...k,...A]})}updateColumns(G){let D=rE(G.source);this.columns?.list.forEach((z,B)=>this.updateOneAutoCol(z,B,D))}getColumn(G){return this.columns?.list.find((D)=>oE(D,G))??null}getColumns(){return this.columns?.list??null}generateAutoCols(G=[]){let D=[],{gos:z}=this,B=z.get("treeData"),Q=DI(z);if(B&&Q)JI(182),Q=!1;if(Q)G.forEach((J,U)=>{D.push(this.createOneAutoCol(J,U))});else D.push(this.createOneAutoCol());return D}isSuppressAutoCol(){let G=this.gos;if(G.get("groupDisplayType")==="custom")return!0;return G.get("treeDataDisplayType")==="custom"}createOneAutoCol(G,D){let z;if(G)z=`${iZ}-${G.getId()}`;else z=iZ;let B=this.createAutoColDef(z,G,D);B.colId=z;let Q=new lE(B,null,z,!0);return this.createBean(Q),Q}updateOneAutoCol(G,D,z){let B=G.getColDef(),Q=typeof B.showRowGroup=="string"?B.showRowGroup:void 0,J=this.beans,U=Q!=null?J.colModel.getColDefCol(Q):void 0,Z=G.getId(),S=this.createAutoColDef(Z,U??void 0,D);G.setColDef(S,null,z),tE(J,{state:[aE(S,Z)]},z)}createAutoColDef(G,D,z){let B=this.createBaseColDef(D),Q=this.gos.get("autoGroupColumnDef");if(BI(B,Q),B=mE(this.beans,B,G,!0),Q?.groupRowEditable==null)B.groupRowEditable=void 0;if(Q?.groupRowValueSetter==null)B.groupRowValueSetter=void 0;if(!this.gos.get("treeData")){if(sQ(B.field)&&sQ(B.valueGetter)&&sQ(B.filterValueGetter)&&B.filter!=="agGroupColumnFilter")B.filter=!1}if(z&&z>0)B.headerCheckboxSelection=!1;let J=eE(this.gos),U=B.valueGetter||B.field!=null;if(J&&!U)B.sortIndex=void 0,B.initialSort=void 0;return B}createBaseColDef(G){let D=this.gos.get("autoGroupColumnDef"),B={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:G?.getColId()??!0};if(!(D&&(D.cellRenderer||D.cellRendererSelector)))B.cellRenderer="agGroupCellRenderer";if(G)B.headerName=this.beans.colNames.getDisplayNameForColumn(G,"header")??void 0,B.headerValueGetter=G.colDef.headerValueGetter;return B}getDeepestExpandedLevel(G,D){let z=-1;if(!G)return z;for(let B of G){if(!B.group||!B.expanded)continue;if(B.level>z)z=B.level;if(z>=D)return z;let Q=this.getDeepestExpandedLevel(B.childrenAfterGroup,D);if(Q>z)z=Q;if(z>=D)return z}return z}updateGroupColumnVisibility(){let G=this.columns?.list;if(!G||G.length===0)return;let{gos:D,visibleCols:z,rowModel:B}=this.beans,Q=GI(D),J=!1,U=(S,X)=>{if(X!==S.isVisible())S.setVisible(X,"api"),J=!0},Z=()=>{for(let S of G)U(S,!0)};if(!Q)Z();else if(G.length>1){let S=G.length-2,X=B?.rootNode?.childrenAfterGroup,Y=this.getDeepestExpandedLevel(X,S);if(Y>=S)Z();else for(let W=0;W=W)}if(J)z.refresh("api")}destroy(){nZ(this.beans,this.columns?.tree),super.destroy()}},t1=null,dZ=(G)=>{let D=t1,z=new Uint32Array(1<<32-Math.clz32(G|63));if(D)z.set(D);return t1=z,z},LI=(G,D,z,B)=>{let Q=D-B,J=z-1;if(Q===1){let X=0;while(G[X].level===J)++X;if(X0){let Y=G[X];G.copyWithin(1,0,X),G[0]=Y}return G}let U=Array(Q),Z=0,S=0;for(let X=0;X{let z=G[0].level+1,B=z,Q=0,J=z,U=t1;if(!U||z>=U.length)U=dZ(z);++U[z];for(let W=1;Wz){if(z=q,z>=U.length)U=dZ(z)}else if(q=0)return U.fill(0,B,z+1),G;let Z=U[B],S=U[z];if(Z+S===D)return U[B]=0,U[z]=0,LI(G,D,z,S);let X=0;for(let W=z;W>=B;--W){let q=U[W];U[W]=X,X+=q}let Y=Array(D);for(let W=0;W{if(D===2){if(G[0].level16)return SI(G,D);for(let z=1;z=0&&G[J].level=0)z.set(D,-1),D=D.parent;return}let B=this.rows;do z.set(D,-1),B.push(D),D=D.parent;while(D!=null&&!z.has(D));this.unsorted=!0}addCell(G,D){if(D==null){this.addRow(G);return}if(G==null)return;let z=this.slots,B=this.bits,Q=z.get(D)??this.ensureCol(D),J=z.get(G);if(J===void 0)J=this.ensureRow(G);else if(J<0)return;let U=Q<32?B:this.extraBits[(Q>>>5)-1],Z=1<<(Q&31),S=U[J];if((S&Z)!==0)return;U[J]=S|Z;let X=G.parent;while(X!=null){let Y=z.get(X);if(Y<0)break;let W=U[Y];if((W&Z)!==0)break;U[Y]=W|Z,X=X.parent}}hasRow(G){return this.slots.has(G)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let G=y7(this.rows);return this.rows=G,G}getSlot(G){return this.slots.get(G)??-1}hasCellBySlot(G,D){if(G<0)return!0;if(D<32)return D>=0&&(this.bits[G]&1<>>5)-1][G]&1<<(D&31))!==0}ensureRow(G){let D=this.slots,z=this.rows,B=this.bits,Q=this.extraBits,J=B.push(0),U=J-1;if(Q!==null)for(let S=0,X=Q.length;S=32){let z=(D>>>5)-1,B=this.extraBits;if(B===null)B=[],this.extraBits=B;if(z>=B.length)B.push(Array(this.bits.length).fill(0))}return D}},lZ=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=new Set}addRow(G){let D=G;if(D==null)return;let z=this.rowSet;if(z.has(D))return;let B=this.rows;do z.add(D),B.push(D),D=D.parent;while(D!=null&&!z.has(D));this.unsorted=!0}addCell(G,D){this.addRow(G)}hasRow(G){return this.rowSet.has(G)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let G=y7(this.rows);return this.rows=G,G}},YI=class extends $I{constructor(){super(...arguments);this.beanName="changedPathFactory"}newPath(G){return G?new XI:new lZ}ensureRowsPath(G){let D=G.changedPath;if(!D&&G.changedRowNodes&&!G.newData){let z=this.beans.rowModel;if(z.hierarchical)D=new lZ,G.changedPath=D,D.addRow(z.rootNode)}return D}},x7=class extends qI{addExpandedCss(G,D){if(D.isExpandable())G.push("ag-row-group"),G.push(D.expanded?"ag-row-group-expanded":"ag-row-group-contracted")}getRowExpandedListeners(G){let{rowNode:D}=G,z=this.updateExpandedCss.bind(this,G,D);return{expandedChanged:z,hasChildrenChanged:z}}setExpanded(G,D,z,B){if(G.expanded===D)return;G._expanded=D,G.dispatchRowEvent("expandedChanged");let Q={..._I(G,this.gos,"rowGroupOpened"),expanded:D,event:z||null};this.dispatchExpandedEvent(Q,B)}defaultExpanded(G){let z=this.beans.gos,B=G.level??0,Q=G.group&&z.get("isGroupOpenByDefault");if(!Q){let U=z.get("groupDefaultExpanded");return U===-1||B{let J=Q.rowComp;J.toggleCss("ag-row-group",z),J.toggleCss("ag-row-group-expanded",z&&B),J.toggleCss("ag-row-group-contracted",z&&!B),kI(Q.element,z&&B)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},wI=class extends x7{constructor(){super(...arguments);this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(G){let D=new Set(G.expandedRowGroupIds);this.beans.rowModel.forEachNode((z)=>{let B=z.id;if(!B)return;z._expanded=D.has(B)}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(G=!1){let D=[],z=[];return this.beans.rowModel.forEachNode((B)=>{let Q=B.id;if(!Q)return;if(B.expanded)D.push(Q);else if(G&&B.isExpandable())z.push(Q)}),{expandedRowGroupIds:D,collapsedRowGroupIds:z}}getExpansionState(){return this.getInternalExpansionState()}isExpanded(G){if(G.footer)return!!G._expanded;if(!(G.group||G.master)||G.leafGroup&&this.beans.colModel.isPivotMode())return!1;let D=G._expanded;if(D===null)D=this.defaultExpanded(G)??!1,G._expanded=D;return!!D}resetExpansion(){let{rowModel:G}=this.beans;G.forEachNode((D)=>{if(!D.group&&!D.master)return;D._expanded=null}),this.onGroupExpandedOrCollapsed()}expandAll(G){let{gos:D,rowModel:z,colModel:B,eventSvc:Q}=this.beans,J=D.get("treeData"),U=B.isPivotActive(),Z=(X)=>{if(!X)return;for(let Y of X){let W=()=>{Y._expanded=G,Z(Y.childrenAfterGroup)};if(Y.master){W();continue}if(J){if(WI(Y.childrenAfterGroup))W();continue}if(U){if(!Y.leafGroup)W();continue}if(Y.group)W()}},S=z.rootNode;if(S)Z(S.childrenAfterGroup);this.onGroupExpandedOrCollapsed(),Q.dispatchEvent({type:"expandOrCollapseAll",source:G?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(G){let D=this.getInternalExpansionState(!0),z=D.collapsedRowGroupIds.length===0;if(D.expandedRowGroupIds.length===0===z)return;return z?G.expandAll():G.collapseAll()}dispatchExpandedEvent(G,D){if((this.events??(this.events=[])).push(G),D){this.dispatchExpandedEvents();return}let z=this.dispatchExpandedDebounced;if(!z){if(!this.isAlive())return;z=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=z}z()}dispatchExpandedEvents(){let{eventSvc:G,rowRenderer:D}=this.beans,z=this.events,B=z?.length;if(!B)return;this.events=null;let Q=Array(B);for(let J=0;Jwindow.setTimeout(G,0);let z=!1;return()=>{if(!D.active){window.setTimeout(G,0);return}if(z)return;z=!0,D.addDestroyTask(()=>{z=!1,G()})}}};function c7(G){let D=G.get("groupHideParentOfSingleChild");if(!D){if(D=G.get("groupRemoveSingleChildren"),!D&&G.get("groupRemoveLowestSingleChildren"))D="leafGroupsOnly"}return{groupHideParentOfSingleChild:D,isGroupMultiAutoColumn:FI(G),hideOpenParents:G.get("groupHideOpenParents"),grandTotalRow:fI(G),groupTotalRow:NI(G)}}function h7(G,D,z){return G.groupHideParentOfSingleChild===!0&&z&&D.childrenAfterGroup.length===1}function i7(G,D,z){return G.groupHideParentOfSingleChild==="leafGroupsOnly"&&z&&D.leafGroup&&D.childrenAfterGroup.length===1}function n7(G,D,z,B,Q,J){if(B&&!z)return!1;if(Q||J)return!1;if(!G.hideOpenParents)return!0;if(D.master||D.level===-1)return!0;if(!(B&&D.leafGroup)&&D.expanded)return!1;return!0}var EI=class extends KI{constructor(){super(...arguments);this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){let{beans:G,gos:D}=this,z=[],B=G.rowModel.rootNode;if(!B)return z;let Q=G.colModel.isPivotMode(),J=Q&&B.leafGroup&&B.aggData,U=J?[B]:B.childrenAfterSort,Z=c7(D);this.recursivelyAddToRowsToDisplay(Z,U,z,Q,0);let S=z.length>0,X=Z.grandTotalRow;if(!J&&S&&X)if(pG(B,G),X==="pinnedBottom"||X==="pinnedTop")this.beans.pinnedRowModel?.setGrandTotalPinned(X==="pinnedBottom"?"bottom":"top");else{let W=X==="top";this.addRowNodeToRowsToDisplay(Z,B.sibling,z,0,W)}return z}recursivelyAddToRowsToDisplay(G,D,z,B,Q){if(!D?.length)return;let J=this.beans.masterDetailSvc;for(let U=0;Uthis.onCsrmCellChange(G),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(G){if(!G.rowDragManaged||!G.sameGrid)return!1;if(!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()}initDraggingGroups(G){let D=new Map,z=(B)=>{let Q=B.childrenAfterGroup;if(Q){if(D.has(B))return;let J=Q.slice();D.set(B,J);for(let U of J)z(U)}};for(let B of G.rows)if(B.group)z(B);this.draggingGroups=D}canSetParent(G){if(!G.sameGrid)return!1;if(this.beans.groupStage?.treeData)return!0;if(G.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length}canDropRow(G,D){if(this.beans.groupStage?.treeData)return!vI(G,D.newParent);let{position:z,target:B,newParent:Q,rootNode:J}=D,U=G.parent;if(G.group&&(mZ(G,B)||mZ(G,Q)))return!1;if(z==="inside")return!0;if(Q&&Q!==U)return Q!==J||U===J;let Z=Q??B?.parent??J;if(Z!==U)return!1;let S=G.group?G.level:U.level??-1,X=-1;if(B)X=B.group?B.level:B.parent?.level??-1;else if(Z)X=Z.level;if(S>=0&&X>=0&&X!==S)return!1;return!0}fixRowsDrop(G,D,z,B){let Q=!!this.beans.groupStage?.treeData;if(G.treeData=Q,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!Q)return;if(!this.draggingGroups&&this.isGroupingDrop(G)&&!G.suppressMoveWhenRowDragging)this.initDraggingGroups(G);let U=G.target,Z=null,S=!1,X=G.rootNode,Y=this.beans.rowModel,W=this.canStartGroup(U,Q);this.updateDropTarget(G,z,W);let q=this.beans.pageBounds?.getLastRow?.()??Y.getRowCount()-1;if(D){if(!U||B>=0.5&&U.rowIndex===q)Z=X;else if(G.moved&&U&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(G))Z=U;if(!Z)Z=U?.parent??X}if(!z&&U&&W&&!(U.group&&U.expanded))this.startDropGroupDelay(U);if(Z){if(U&&Z===U&&Z!==X){let H=Z.expanded?VI(Y,1,U):null;if(H?.parent===Z)U=H,B=-0.5;else S=!0}if(U&&!S){let H=U;while(H&&H!==X&&H!==Z)U=H,H=H.parent}}G.target=U,G.newParent=Z,G.yDelta=B,G.inside=S}clearNewSameParent(G,D){let z=G.newParent;if(z&&(!D||OI(G.rows,z)))G.newParent=null}updateDropTarget(G,D,z){let B=z?G.target:null;if(this.dropGroupTarget&&this.dropGroupTarget!==B)this.resetDragGroup();if(!B?.childrenAfterSort?.length)return;if(D&&this.dropGroupThrottled&&!B.expanded&&B.isExpandable?.())B.setExpanded(!0,void 0,!0);if(this.canDropInTarget(B,G))this.dropGroupThrottled=!0,this.dropGroupTarget=B}canDropInTarget(G,D){if(G.expanded)return!0;if(!G.group)return!1;if(D.pointerPos==="inside")return!0;if(D.treeData)return!1;let z=D.rows,B=G.level;for(let Q=0,J=z.length;Q{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},D)}resetDragGroup(){if(this.dropGroupTimer!==null)window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null;this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(G){if(G)this.draggingGroups=null;this.resetDragGroup()}shouldDropTargetBeParent({target:G,rows:D,pointerPos:z,treeData:B}){if(!G||z==="none")return!1;if(z==="inside")return!0;if(!B&&G.group&&!G.expanded)return!0;if(z==="above")return!1;let Q=this.beans.rowModel,U=G.rowIndex+1,Z;do Z=Q.getRow(U++);while(Z?.footer);let S=this.draggingGroups?.get(G)??G.childrenAfterGroup;if(Z&&Z.parent===G&&S?.length){let X=new Set(D);for(let Y=0,W=S.length;Y{if(X.has(f))return;if(X.add(f),q??(q=this.newGroupValues(J)),this.setRowGroup(f,q))W.add(f)},_=(f)=>{let N=this.draggingGroups?.get(f)??f.childrenAfterGroup,F=N?.length;if(F)for(let E=0;E=0)H(I);else _(I)}};for(let f of G.rows)if(f.group)_(f);else{let N=f.sourceRowIndex>=0&&!f.destroyed?f:this.csrmFirstLeaf(f);if(N)H(N)}let k=z==="inside"?"above":z,w=z==="inside"?this.findFirstLeafForParent(J,X)??B:B,K=!1;if(X.size&&k!=="none")K=AI(Q._leafs,X,w,k==="above");if(!W.size&&!K)return!1;Y.reordered=K;for(let f of X)Y.updates.add(f);if(this.csrmRefresh(Y),S)S.focusCell();else U.clearFocusedCell();return!0}canStartGroup(G,D){if(!G||G.level<0||G.footer||G.detail)return!1;if(G.group)return!0;return D}flushGroupEdits(){let G=this.pendingEditRefresh;if(G)this.pendingEditRefresh=null,this.csrmRefresh(G)}csrmRefresh(G){let D=this.beans.rowModel;if(!D.rootNode)return;D.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:G})}newGroupValues(G){let D=this.beans.rowGroupColsSvc?.columns??[],z=Array(D.length),B=-1,Q=G;while(Q&&Q.level>=0){let J=D[Q.level];if(J){let U=J.getColId(),Z=Q.level;if(z[Z]=Q.groupData?.[U]??Q.key??void 0,Z>B)B=Z}Q=Q.parent}return{values:z,columns:D,maxLevel:B}}setRowGroup(G,{values:D,columns:z,maxLevel:B}){if(B<0)return!1;let{valueSvc:Q,changeDetectionSvc:J}=this.beans,U=!1;J?.beginDeferred();try{for(let Z=0;ZB)continue;let X=D[Z],Y=Q.getValue(S,G,"data");if(Y===X||Y==null&&X==null)continue;let W=X,q=Q.parseValue(S,G,X,Y);if(q!==void 0)W=q;if(G.setDataValue(S,W,"rowDrag"))U=!0}}finally{J?.endDeferred()}return U}onCsrmCellChange(G){let{column:D,node:z,source:B}=G;if(!this.gos.get("refreshAfterGroupEdit"))return;if(B==="rowDrag")return;if(!D?.isRowGroupActive())return;if(z.group||!z.data)return;if(this.beans.editSvc?.isBatchEditing()){let J=this.pendingEditRefresh;if(!J)J=pZ(),this.pendingEditRefresh=J;J.updates.add(z)}else{let J=pZ();J.updates.add(z),this.csrmRefresh(J)}}csrmFirstLeaf(G){if(!G)return null;let D=this.draggingGroups,z=D?.get(G)??G.childrenAfterGroup;while(z?.length){let B=z[0];if(B.sourceRowIndex>=0){if(!B.destroyed)return B;return this.firstAliveChildLeaf(B)}z=D?.get(B)??B.childrenAfterGroup}return MI(G)}firstAliveChildLeaf(G){let D=this.draggingGroups?.get(G)??G.childrenAfterGroup;if(D){for(let z of D)if(z.sourceRowIndex>=0&&!z.destroyed)return z}return null}findFirstLeafForParent(G,D){if(!G)return null;let z=this.draggingGroups?.get(G)??G?.childrenAfterGroup;if(!z)return null;for(let B=0,Q=z.length;B=0&&!D.has(J))return J;let U=this.findFirstLeafForParent(J,D);if(U!==null)return U}return null}},pZ=()=>{let G=new d7;return G.reordered=!0,G},mZ=(G,D)=>{if(!G||!D)return!1;let z=D;while(z){if(z===G)return!0;z=z.parent}return!1},vI=(G,D)=>{if(!D||G.parent===D)return!1;let z=D,B=G.id;while(z){if(z===G)return!0;if(B!=null&&z.id===B)return!0;z=z.parent}return!1},OI=(G,D)=>{for(let z=0,B=G.length;zthis.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.columnsInvalidated=!0,this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(G){return this.strategy?.nonLeafsById?.get(G)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(G){let D=this.gos,z=this.strategy?.nestedDataGetter;if(G.has("treeData"))this.gosTreeData=D.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0;return this.strategy?.onPropChange?.(G),this.getNestedDataGetter()!==z}extractData(){let G=this.beans.rowModel.rootNode,D=this.nested?G?.childrenAfterGroup:G?._leafs;if(!D)return this.gos.get("rowData")??[];let z=D.length,B=Array(z),Q=0;for(let J=0;J{let D=G.sibling;if(!D)return null;let z=D._leafs;if(z!==void 0)return z;return MB(D)},MB=(G)=>{let D=G.childrenAfterGroup,z=D?.length;if(G._leafs=null,!z)return null;let B,Q=z===1?D[0]:null;if(Q?.group&&Q.sourceRowIndex<0){if(B=Q._leafs,B===void 0)B=MB(Q)}else if(G.leafGroup)B=D;else{B=[];for(let J=0;J=0)B.push(U);if(!U.group)continue;let Z=U._leafs;if(Z===void 0)Z=MB(U);if(Z)for(let S=0,X=Z.length;S{let{_leafs:B,sibling:Q}=G;if(G.treeNodeFlags=0,G.childrenAfterGroup=B,G.childrenMapped=null,G._groupData=void 0,G.aggData=null,Q)Q.childrenAfterGroup=G.childrenAfterGroup,Q.childrenAfterAggFilter=G.childrenAfterAggFilter,Q.childrenAfterFilter=G.childrenAfterFilter,Q.childrenAfterSort=G.childrenAfterSort,Q.childrenMapped=null,Q._groupData=void 0,Q.aggData=null;for(let J=0,U=B.length??0;J{G.key=null,G.treeNodeFlags=0,G.allChildrenCount=null,G.childrenAfterGroup=null,G.childrenAfterAggFilter=null,G.childrenAfterFilter=null,G.childrenAfterSort=null,G.childrenMapped=null,G.level=0,G._groupData=void 0};function G2(G,D,z){let B=G,Q=B.level-D.level;if(Q<=0)return!1;if(!z.get("groupHideOpenParents"))return!1;for(let U=0;U{let{rowDragSvc:D}=this.beans;if(!this.params.rowDrag||!D)return;let z=D.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(z),this.eGui.insertAdjacentElement("afterbegin",z.getGui())};this.setupExpand(),G(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){let G=this.params.colDef?.cellAriaRole,D=this.params.column?.getColDef().cellAriaRole;return G||D||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;let{visibleCols:G}=this.beans,D=this.params.pinned==="left",z=this.params.pinned==="right",B=!D&&!z;if(this.gos.get("enableRtl")){if(G.isPinningLeft())return!z;return!B}if(G.isPinningLeft())return!D;return!B}addGroupValue(){let{params:{value:G,valueFormatted:D}}=this,z=this.getInnerCompDetails();this.comp.setInnerRenderer(z,D??G??null)}setupExpand(){let{colModel:G}=this.beans,{eGridCell:D,suppressDoubleClickExpand:z}=this.params,B=(S,X)=>{let Y=cI(S,this.beans,null);if(Y)X.appendChild(Y),this.addDestroyFunc(()=>Y.remove())};B("groupExpanded",this.eExpanded),B("groupContracted",this.eContracted);let Q=this.comp,J=()=>{if(!this.isExpandable())return;let X=!!this.displayedNode.expanded;Q.setExpandedDisplayed(X),Q.setContractedDisplayed(!X),lI(D,X)},U=()=>{let S=this.isExpandable();Q.toggleCss("ag-cell-expandable",S),Q.toggleCss("ag-row-group",S);let X=!S&&G.isPivotMode();Q.toggleCss("ag-pivot-leaf-group",X);let Y=!G.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);Q.toggleCss("ag-row-group-leaf-indent",!S&&Y);let W=this.getChildCount(),q=W>0?`(${W})`:"";if(Q.setChildCount(q),!S)Q.setExpandedDisplayed(!1),Q.setContractedDisplayed(!1),dI(D);else J()};(()=>{if(!z&&!this.isGroupCellEditable(this.displayedNode))this.addManagedListeners(D,{dblclick:this.onCellDblClicked.bind(this)});this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(D,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:U,masterChanged:U,groupChanged:U,hasChildrenChanged:U,expandedChanged:J})})(),U()}getInnerCompDetails(){let{userCompFactory:G,findSvc:D}=this.beans,z=this.params;if(z.fullWidth){let S=this.gos.get("groupRowRendererParams"),X=x0(G,S,z);if(X)return X;if(D?.isMatch(z.node,null))return x0(G,{...S,innerRenderer:"agFindCellRenderer"},z);return}let B=(S)=>S&&S.componentClass==this.compClass,Q=x0(G,z,z);if(Q&&!B(Q))return Q;let{displayedNode:{rowGroupColumn:J}}=this,U=J?.colDef,Z=J&&z.column?.isRowGroupDisplayed(J.getId());if(U&&Z){let S=rZ(G,U,z);if(S)if(B(S)){if(U?.cellRendererParams?.innerRenderer)return x0(G,U.cellRendererParams,z)}else return S}if(D?.isMatch(z.node,z.column))return rZ(G,{...U??z.colDef,cellRenderer:"agFindCellRenderer"},z)}getChildCount(){let{column:G,suppressCount:D}=this.params;if(D)return 0;let{allChildrenCount:z,rowGroupColumn:B}=this.displayedNode;if(!((z??0)>0&&(!B||!G||G?.isRowGroupDisplayed(B.getId()))))return 0;if(this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!G2(this.node,this.displayedNode,this.gos))return 0;return z??0}isExpandable(){let{node:G,column:D,colDef:z}=this.params;if(!this.displayedNode.isExpandable())return!1;if(G.rowPinned)return!1;if(!D)return!0;if(G.hasChildren()&&z){let{showRowGroup:J}=z;if(!J)return!1;if(J===!0)return!0}if(G===this.displayedNode){if(G.rowGroupColumn){if(D?.isRowGroupDisplayed(G.rowGroupColumn.getId()))return!0}if(G.master)return z?.showRowGroup===!0||z?.showRowGroup==null;return!1}return G2(this.node,this.displayedNode,this.gos)}setupIndent(){let{suppressPadding:G,node:D,colDef:z}=this.params;if(G)return;let B=()=>{let Q=D.uiLevel;if(z&&z.showRowGroup!==!0)Q=0;let J="ag-row-group-indent-"+Q;if(J===this.indentClass)return;if(this.indentClass)this.comp.toggleCss(this.indentClass,!1);this.indentClass=J,this.comp.toggleCss(J,!0),this.eGui.style.setProperty("--ag-indentation-level",String(Q))};this.addManagedListeners(D,{uiLevelChanged:B.bind(this)}),B()}setupCheckbox(){let{node:G}=this.params;if(!(!G.footer&&!G.rowPinned&&!G.detail))return;this.addManagedPropertyListener("rowSelection",({currentValue:z,previousValue:B})=>{let Q=typeof z==="object"?z:void 0,J=typeof B==="object"?B:void 0;if(Q?.checkboxLocation!==J?.checkboxLocation)this.destroyCheckbox(),this.addCheckbox()}),this.addCheckbox()}addCheckbox(){let{selectionSvc:G}=this.beans;if(!G||!nI(this.gos))return;let{node:D,column:z}=this.params,B=this.gos.get("rowSelection"),Q=hI(B);if(Q==="selectionColumn")return;if(Q==="autoGroupColumn"){let X=z?.getColDef().showRowGroup!=null,Y=!z&&D.group;if(!(X||Y))return}let J=typeof B==="object"?iI(B):this.params.checkbox;if(!(typeof J==="function"||J===!0))return;if(typeof z?.getColDef().showRowGroup==="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}let S=G.createCheckboxSelectionComponent();this.cbComp=S,this.createBean(S),S.init({rowNode:D,column:z,overrides:{isVisible:J,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(S.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}isGroupCellEditable(G){let D=this.params.column;return!!D&&(!!D.getColDef().groupRowEditable||this.gos.get("enableGroupEdit"))&&D.isCellEditable(G)}onExpandClicked(G){if(eZ(G))return;pI(G),this.onExpandOrContract(G)}onKeyDown(G){if(G.key!==oZ.ENTER||this.params.suppressEnterExpand)return;if(this.isGroupCellEditable(this.params.node))return;this.onExpandOrContract(G)}onCellDblClicked(G){if(eZ(G))return;if(!(aZ(this.eExpanded,G)||aZ(this.eContracted,G)))this.onExpandOrContract(G)}onExpandOrContract(G){if(!this.isExpandable())return;let D=this.displayedNode,z=!D.expanded;if(!z&&D.sticky)this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(D.rowTop-D.stickyRowTop);D.setExpanded(z,G)}destroy(){super.destroy(),this.destroyCheckbox()}},mI={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},D2=class extends TI{constructor(){super(mI);this.eExpanded=Pz,this.eContracted=Pz,this.eCheckbox=Pz,this.eValue=Pz,this.eChildCount=Pz}init(G){let D={setInnerRenderer:(J,U)=>this.setRenderDetails(J,U),setChildCount:(J)=>this.eChildCount.textContent=J,toggleCss:(J,U)=>this.toggleCss(J,U),setContractedDisplayed:(J)=>sZ(this.eContracted,J),setExpandedDisplayed:(J)=>sZ(this.eExpanded,J),setCheckboxVisible:(J)=>this.eCheckbox.classList.toggle("ag-invisible",!J),setCheckboxSpacing:(J)=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",J)},z=this.createManagedBean(new l7),B=!G.colDef,Q=this.getGui();if(z.init(D,Q,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,G),B)yI(Q,z.getCellAriaRole())}setRenderDetails(G,D){if(G)G.newAgStackInstance().then((z)=>{if(!z)return;let B=()=>this.destroyBean(z);if(this.isAlive())this.eValue.appendChild(z.getGui()),this.addDestroyFunc(B);else B()});else this.eValue.innerText=D}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},tI=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}",oI=class extends sI{constructor(){super(...arguments);this.beanName="showRowGroupColValueSvc"}getGroupValue(G,D,z){if(!D){if(!G.group)return null;return{displayedNode:G,value:G.groupValue}}let B=this.beans.valueSvc,Q=D.colDef.showRowGroup;if(!Q)return null;if(G.level===-1&&G.footer)return{displayedNode:G,value:null};if(typeof Q==="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex(Q)??-1)>G.level)return null;let Z=this.getDisplayedNode(G,D,!0);if(Z)return{displayedNode:Z,value:B.getValue(D,Z,"data",z)}}let J=B.getValue(D,G,"data",z);if(J==null){let U=this.getDisplayedNode(G,D);if(U)return{displayedNode:U,value:B.getValue(D,U,"data",z)}}return{displayedNode:G,value:J}}formatAndPrefixGroupColValue(G,D,z=!1){let B=this.formatGroupColValue(G,D,z),{value:Q,displayedNode:J}=G,U=this.beans.footerSvc;if(U?.doesCellShowTotalPrefix(J,D))return U.applyTotalPrefix(Q,B,J,D);if(J.footer&&J.level===-1)return null;return B}formatGroupColValue(G,D,z=!1){let B=this.beans.valueSvc,{displayedNode:Q,value:J}=G,U=Q.rowGroupColumn,Z=Q.group&&!D;if(U&&(Z||D?.isRowGroupDisplayed(U.colId))){if(z&&U.colDef.useValueFormatterForExport===!1)return null;let X=B.formatValue(U,Q,J);if(X==null&&Q.key==="")return this.getLocaleTextFunc()("blanks","(Blanks)");return X}if(!D||Q.group)return null;if(z&&D.colDef.useValueFormatterForExport===!1)return null;return B.formatValue(D,Q,J)}getDisplayedNode(G,D,z=!1){let B=this.gos,Q=B.get("groupHideOpenParents"),J=B.get("showOpenedGroup")&&!z;if(!Q&&!J)return;let U=D.colDef.showRowGroup;if(U===!0){if(G.group)return;return G.parent??void 0}let Z=G;while(Z&&Z.rowGroupColumn?.getId()!=U){let S=Z===Z.parent?.getFirstChild();if(!J&&!S)return;Z=Z.parent}if(Z===G)return;return Z??void 0}},aI=class extends rI{constructor(){super(...arguments);this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){let{colModel:G,rowGroupColsSvc:D}=this.beans,z=this.columns,B=this.colsSet,Q=this.colsMap;Q.clear();let J=z.length,U=0,Z=!1,S=G.getCols();for(let X=0,Y=S.length;X=J||!B.has(W)),z[U++]=W}if(Z||(Z=U!==J),Z){z.length=U,B.clear();for(let X=0;X{this.gridBodyCtrl=G.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(G){if(this.extraTopHeight===G)return;this.extraTopHeight=G,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:G})}setOffsetBottom(G){if(this.extraBottomHeight===G)return;this.extraBottomHeight=G}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(G){return this.isClientSide?SM(G):LM(G)}getFirstPixelOfGroup(G){if(G.footer)return G.sibling.rowTop+G.sibling.rowHeight-1;if(G.hasChildren())return G.rowTop-1;return 0}updateStickyRows(G){let D=G==="top",z=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(G,new Set,z);let B=new Set,{rowModel:Q,rowRenderer:J,pinnedRowModel:U,pageBounds:Z,rowContainerHeight:S}=this.beans,{pageFirstPixel:X,pageLastPixel:Y}=Z.getCurrentPagePixelRange(),W=D?J.firstVisibleVPixel-this.extraTopHeight:J.lastVisibleVPixel-this.extraTopHeight,q=S.divStretchOffset??0,H=X+q,_=Y+q,k=(N)=>{if(B.add(N),D){let F=this.getLastPixelOfGroup(N),E=W+z+N.rowHeight;if(FE)N.stickyRowTop=z-(F-E);else N.stickyRowTop=z}z=0,B.forEach((F)=>{let E=F.stickyRowTop+F.rowHeight;if(z{if(!N.displayed)return!1;if(N.footer){if(w===!0)return!1;if(w==="grand"&&N.level===-1)return!1;if(w==="group"&&N.level>-1)return!1;let F=N.sibling.rowIndex?N.sibling.rowIndex+1===N.rowIndex:!1;if(G==="bottom"&&F)return!1;if(N.level===-1&&U?.getGrandTotalPinned())return!1;return!B.has(N)}if(N.isExpandable()){if(K===!0)return!1;if(G==="bottom")return!1;return!B.has(N)&&!!N.expanded}return!1};for(let N=0;N<100;N++){let F=W+z;if(!D)F=W-z;if(D&&F_)F=_;let E=Q.getRowIndexAtPixel(F),I=Q.getRow(E);if(I==null)break;let A=this.getStickyAncestors(I).find((O)=>(D?O.rowIndexE)&&f(O));if(A){k(A);continue}if((D?I.rowTopF)&&f(I)){k(I);continue}break}if(!D)B.forEach((N)=>{N.stickyRowTop=z-(N.stickyRowTop+N.rowHeight)});return this.refreshNodesAndContainerHeight(G,B,z)}areFooterRowsStickySuppressed(){let G=this.gos.get("suppressStickyTotalRow");if(G===!0)return!0;let D=G==="group",z=G==="grand";if(D&&z)return!0;if(z)return"grand";if(D)return"group";return!1}canRowsBeSticky(){let G=UM(this.gos),D=this.areFooterRowsStickySuppressed(),z=this.gos.get("suppressGroupRowsSticky");return G&&(!D||!z)}getStickyAncestors(G){let D=[],z=G.footer?G.sibling:G.parent;while(z){if(z.sibling)D.push(z.sibling);D.push(z),z=z.parent}return D.reverse()}checkStickyRows(){let G=this.updateStickyRows("top"),D=this.updateStickyRows("bottom");return G||D}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(G){let D=new Set;if(this.stickyTopRowCtrls.some((z)=>z.rowNode===G)){for(let z=0;z{if(Z.has(H))return;H.sticky=!0,S.push(this.createRowCon(H,!1,!1))});let X=!!S.length||U.length!==Q.length;if(B){if(this.topContainerHeight!==z)this.topContainerHeight=z,this.gridBodyCtrl.setStickyTopHeight(z),X=!0}else if(this.bottomContainerHeight!==z)this.bottomContainerHeight=z,this.gridBodyCtrl.setStickyBottomHeight(z),X=!0;this.destroyRowCtrls(J,!1);let Y=[...U,...S];if(Y.sort((H,_)=>_.rowNode.rowIndex-H.rowNode.rowIndex),!B)Y.reverse();for(let H of Y)H.setRowTop(H.rowNode.stickyRowTop);let W=this.beans.pageBounds,q=0;if(B){for(let H of D)if(H.rowIndexthis.topContainerHeight)q=this.topContainerHeight;this.setOffsetTop(q)}else{for(let H of D)if(H.rowIndex>W.getLastRow())q+=H.rowHeight;if(q>this.bottomContainerHeight)q=this.bottomContainerHeight;this.setOffsetBottom(q)}if(!X)return!1;if(B)this.stickyTopRowCtrls=Y;else this.stickyBottomRowCtrls=Y;return!0}ensureRowHeightsValid(){let G=!1,D=(z)=>{let B=z.rowNode;if(B.rowHeightEstimated){let Q=QM(this.beans,B);B.setRowHeight(Q.height),G=!0}};return this.stickyTopRowCtrls.forEach(D),this.stickyBottomRowCtrls.forEach(D),G}};function LM(G){if(G.isExpandable()||G.footer){if(G.master&&G.detailNode)return G.detailNode.rowTop+G.detailNode.rowHeight;if(!G.sibling||Math.abs(G.sibling.rowIndex-G.rowIndex)===1){let z=G.childStore?.getStoreBounds();if(G.footer)z=G.sibling.childStore?.getStoreBounds();return(z?.heightPx??0)+(z?.topPx??0)}if(G.footer)return G.rowTop+G.rowHeight;return G.sibling.rowTop+G.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function SM(G){if(G.isExpandable()||G.footer){if(G.footer&&G.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!G.sibling||Math.abs(G.sibling.rowIndex-G.rowIndex)===1){let B=G.footer?G.sibling:G;while(B.isExpandable()&&B.expanded)if(B.master&&B.detailNode)B=B.detailNode;else if(B.childrenAfterSort){if(B.childrenAfterSort.length===0)break;B=ZM(B.childrenAfterSort)}return B.rowTop+B.rowHeight}if(G.footer)return G.rowTop+G.rowHeight;return G.sibling.rowTop+G.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var XM=class extends eI{constructor(){super(...arguments);this.beanName="stickyRowSvc"}createStickyRowFeature(G,D,z){let B=this.gos;if(DM(B)&&GM(B)||zM(B))return G.createManagedBean(new $M(D,z));return}},p7={moduleName:"GroupCellRenderer",version:j,userComponents:{agGroupRowRenderer:D2,agGroupCellRenderer:D2},dynamicBeans:{groupCellRendererCtrl:l7},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[tI],dependsOn:[i]},m7={moduleName:"GroupColumn",version:j,beans:[ZI,aI,oI,dE,T7,g7],dependsOn:[i,p7]},AJ={moduleName:"ChangedPath",version:j,beans:[YI],dependsOn:[i]},_0={moduleName:"ClientSideRowModelHierarchy",version:j,rowModels:["clientSide"],beans:[jI,EI,wI],dependsOn:[i,AJ]},RJ={moduleName:"StickyRow",version:j,beans:[XM]},t7={moduleName:"GroupEdit",version:j,beans:[bI],dependsOn:[i,_0]},NM=({valueSvc:G,dataTypeSvc:D},z,B)=>{let Q=G.getValue(z,B,"data"),J=null;if(Q instanceof Date)J=Q;else if(typeof Q==="string")J=(D?.getDateParserFunction(z)??fM)(Q)??null;return J},GD=(G,D,z,B)=>(Q)=>{let J=NM(G,D,Q.node),U=KM(J);if(!U)return null;return B?.(U[z])??U[z]},DD=({colNames:G},D,z)=>(B)=>{let Q=G.getDisplayNameForColumn(D,B.location);if(Q)return`${Q} (${z})`;return""},FM=Object.fromEntries(s7.map((G)=>[G,G.toLowerCase()])),EM=(G)=>{let D=s7[Number.parseInt(G,10)-1]??G,z=FM[D]??G;return{month:D,localeKey:z}};function Q2(G){return G.groupHierarchy??G.rowGroupingHierarchy}var IM=class extends WM{constructor(){super(...arguments);this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(G){let D=this.columns;if(D==null)return;G.list=D.list.filter((z)=>!G.list.some((B)=>B.getColId()===z.getColId())).concat(G.list),G.tree=D.tree.filter((z)=>!G.tree.some((B)=>B.getId()===z.getId())).concat(G.tree),wM(G)}createColumns(G){let D=new WeakMap,z=new WeakMap,B=this.createGroupHierarchyColumns(G,D,z);if(HM(B,this.columns?.list??[]))return;_M(this.beans,this.columns?.tree),this.columns=null;let{colGroupSvc:J}=this.beans,U=J?.findDepth(G.tree)??0,Z=J?.balanceTreeForAutoCols(B,U)??[];this.columns={list:B,tree:Z,treeDepth:U,map:{}},this.sourceColumnMap=D,this.inverseColumnMap=z}updateColumns(G){}getColumn(G){return this.columns?.list.find((D)=>B2(D,G))??null}getColumns(){return this.columns?.list??null}expandColumnInto(G,D){let z=this.getVirtualColumnsForColumn(D).concat(D);for(let B of z)if(!G.some((Q)=>B2(Q,B)||Q.getColId()===B.getColId()))G.push(B)}compareVirtualColumns(G,D){let z=this.inverseColumnMap.get(G),B=this.inverseColumnMap.get(D);if(z&&z===B){let Q=this.sourceColumnMap.get(z)??[];return Q?.indexOf(G)-Q?.indexOf(D)}if(this.sourceColumnMap.get(G)?.includes(D))return 1;if(this.sourceColumnMap.get(D)?.includes(G))return-1;return null}insertVirtualColumnsForCol(G,D){let z=this.getVirtualColumnsForColumn(D);if(!z)return[];let B=G.indexOf(D);if(B<0)B=G.length-1;return kM(G,z),G.splice(B,0,...z),z}getVirtualColumnsForColumn(G){if(this.isGroupHierarchyColsEnabledForCol(G))return this.sourceColumnMap.get(G)??[];return[]}isGroupHierarchyColsEnabled(G){return G.list.some((D)=>this.isGroupHierarchyColsEnabledForCol(D))}isGroupHierarchyColsEnabledForCol(G){let D=G.getColDef();return!!(Q2(D)&&(D.rowGroup||D.enableRowGroup||D.rowGroupIndex!=null||D.pivot||D.enablePivot||D.pivotIndex!=null))}createGroupHierarchyColDefs(G){let D=[],z=G.getColDef(),B=Q2(z);if(!B)return D;if(!this.isGroupHierarchyColsEnabledForCol(G))return D;for(let Q of B){let J=null;if(typeof Q==="string")J=this.createColDefForPart(Q,G,z);else J=Q;if(J)D.push(J)}return D}createGroupHierarchyColumns(G,D,z){if(!this.isGroupHierarchyColsEnabled(G))return[];let B=[];for(let Q of G.list)for(let J of this.createGroupHierarchyColDefs(Q)){let U=J.colId;this.gos.validateColDef(J,U,!0);let Z=new YM(J,null,U,!0);this.createBean(Z),B.push(Z),MM(D,Q,Z),z.set(Z,Q)}return B}createColDefForPart(G,D,z){let{beans:B,gos:Q}=this,J=`${qM}-${D.getColId()}-${G}`,U={enableRowGroup:z.enableRowGroup,rowGroup:z.rowGroup,enablePivot:z.enablePivot,hide:!0,editable:!1},Z=Q.get("groupHierarchyConfig")??{};if(G in Z){let W={...U,...Z[G]};return W.colId??(W.colId=J),z2(B,W,W.colId,!0)}let S=z2(B,{colId:J,...U},J,!0),X=this.getLocaleTextFunc(),Y=(W,q)=>X?.(W,q)??q;switch(G){case"year":return{...S,headerValueGetter:DD(B,D,Y(G,"Year")),valueGetter:GD(B,D,0)};case"quarter":return{...S,headerValueGetter:DD(B,D,Y(G,"Quarter")),valueGetter:GD(B,D,1,(W)=>(Math.floor(Number(W)/4)+1).toString())};case"month":return{...S,headerValueGetter:DD(B,D,Y(G,"Month")),valueGetter:GD(B,D,1)};case"formattedMonth":return{...S,headerValueGetter:DD(B,D,Y("month","Month")),valueGetter:GD(B,D,1,(W)=>{let q=EM(W);return Y(q.localeKey,q.month)})};case"day":return{...S,headerValueGetter:DD(B,D,Y(G,"Day")),valueGetter:GD(B,D,2)};case"hour":return{...S,headerValueGetter:DD(B,D,Y(G,"Hour")),valueGetter:GD(B,D,3)};case"minute":return{...S,headerValueGetter:DD(B,D,Y(G,"Minute")),valueGetter:GD(B,D,4)};case"second":return{...S,headerValueGetter:DD(B,D,Y(G,"Second")),valueGetter:GD(B,D,5)};default:return null}}};function MM(G,D,z){let B=G.get(D);G.set(D,(B??[]).concat(z))}var AM={moduleName:"GroupHierarchy",version:j,beans:[IM],dependsOn:[AJ]},VM=class extends RM{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());let G=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:G,newColumnsLoaded:G}),this.addManagedPropertyListener("rowGroupPanelShow",G),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){let G=CM({tag:"div",cls:"ag-column-drop-wrapper",role:"presentation"}),D=new k7(!0);this.rowGroupComp=this.createManagedBean(D);let z=new _7(!0);this.pivotComp=this.createManagedBean(z),G.appendChild(D.getGui()),G.appendChild(z.getGui());let B=this.onDropPanelVisible.bind(this);return this.addManagedListeners(D,{displayChanged:B}),this.addManagedListeners(z,{displayChanged:B}),this.onDropPanelVisible(),G}onDropPanelVisible(){let{rowGroupComp:G,pivotComp:D}=this,z=G.isDisplayed()&&D.isDisplayed(),B="ag-column-drop-horizontal-half-width";G.toggleCss("ag-column-drop-horizontal-half-width",z),D.toggleCss("ag-column-drop-horizontal-half-width",z)}onRowGroupChanged(){let G=this.rowGroupComp;if(!G)return;let D=this.gos.get("rowGroupPanelShow");if(D==="always")G.setDisplayed(!0);else if(D==="onlyWhenGrouping"){let z=this.beans.rowGroupColsSvc?.columns?.length!==0;G.setDisplayed(z)}else G.setDisplayed(!1)}onPivotPanelShow(){let G=this.pivotComp;if(!G)return;let D=this.gos.get("pivotPanelShow");if(D==="always")G.setDisplayed(!0);else if(D==="onlyWhenPivoting"){let z=this.beans.colModel.isPivotActive();G.setDisplayed(z)}else G.setDisplayed(!1)}getFocusableContainers(){return[this.rowGroupComp,this.pivotComp].filter((G)=>!!G)}},bM={selector:"AG-GRID-HEADER-DROP-ZONES",component:VM};function gM(G){if(G.buttons)G.buttons=[];return G}var TM={tag:"div",cls:"ag-group-filter",children:[{tag:"div",ref:"eGroupField"},{tag:"div",ref:"eUnderlyingFilter"}]},yM=class extends uM{constructor(){super(TM);this.filterType="group",this.eGroupField=J2,this.eUnderlyingFilter=J2}wireBeans(G){this.groupFilterSvc=G.groupFilter}postConstruct(){this.initialiseTabGuard({})}init(G){return this.params=G,this.updateParams().then(()=>{this.addHandlerListeners(this.updateGroups.bind(this))})}refresh(G){let D=G;if(this.params=D,D.source==="colDef")this.updateParams();return!0}updateParams(){return this.validateParams(),this.updateGroups()}validateParams(){let{colDef:G}=this.params;if(G.field)rQ(234);if(G.filterValueGetter)rQ(235);if(G.filterParams)rQ(236)}addHandlerListeners(G){let D=this.addManagedListeners(this.getHandler(),{sourceColumnsChanged:()=>{this.updateGroups()},destroyed:()=>{for(let z of D)z();this.addHandlerListeners(G)}})}updateGroups(){let{sourceColumns:G,selectedColumn:D}=this.updateGroupField();return this.dispatchLocalEvent({type:"columnsChanged"}),this.getUnderlyingFilters(G,D)}updateGroupField(){this.groupColumn=this.params.column;let G=this.getHandler();if(!G)return{sourceColumns:null};let{sourceColumns:D,hasMultipleColumns:z,selectedColumn:B}=G,Q=this.eGroupField;if(oQ(Q),this.eGroupFieldSelect)this.destroyBean(this.eGroupFieldSelect);if(z&&D)this.createGroupFieldSelectElement(D,B),Q.appendChild(this.eGroupFieldSelect.getGui()),Q.appendChild(jM({tag:"div",cls:"ag-filter-separator"}));return PM(Q,z),{sourceColumns:D,selectedColumn:B}}createGroupFieldSelectElement(G,D){let z=this.createManagedBean(new vM);this.eGroupFieldSelect=z;let B=this.getLocaleTextFunc();if(z.setLabel(B("groupFilterSelect","Select field:")),z.setLabelAlignment("top"),z.addOptions(G.map((Q)=>({value:Q.getColId(),text:this.beans.colNames.getDisplayNameForColumn(Q,"groupFilter",!1)??void 0}))),z.setValue(D.getColId()),z.onValueChange((Q)=>this.updateSelectedColumn(Q)),z.addCss("ag-group-filter-field-select-wrapper"),G.length===1)z.setDisabled(!0)}getUnderlyingFilters(G,D){if(!G)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,gz.resolve();let z=[],B=[],Q=this.beans.colFilter;for(let J of G){let U=Q.getOrCreateFilterUi(J);if(U)z.push(U.then((Z)=>{if(Z)B.push({filter:Z,column:J});if(J.getColId()===D.getColId())this.selectedFilter=Z??void 0}))}return gz.all(z).then(()=>{this.filterColumnPairs=B})}addUnderlyingFilterElement(G){if(oQ(this.eUnderlyingFilter),!G)return gz.resolve();let D=this.createManagedBean(new OM(G,"COLUMN_MENU"));if(this.filterComp=D,!D.hasFilter())return gz.resolve();return this.eUnderlyingFilter.appendChild(D.getGui()),D.getFilter()?.then(()=>{if(D.afterGuiAttached?.(this.afterGuiAttachedParams),!this.afterGuiAttachedParams?.suppressFocus&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled())this.eGroupFieldSelect.getFocusableElement().focus()})??gz.resolve()}updateSelectedColumn(G){if(!G)return;this.filterComp?.afterGuiDetached(),this.destroyBean(this.filterComp);let D=this.getFilterColumnPair(G),z=D?.column;this.selectedFilter=D?.filter,this.getHandler().setSelectedColumn(z),this.dispatchLocalEvent({type:"columnsChanged"}),this.addUnderlyingFilterElement(z)}isFilterActive(){return this.groupFilterSvc.isFilterActive(this.groupColumn)}doesFilterPass(){return!0}getModel(){return null}setModel(){}afterGuiAttached(G){this.afterGuiAttachedParams=G,this.addUnderlyingFilterElement(this.getHandler().selectedColumn)}afterGuiDetached(){oQ(this.eUnderlyingFilter),this.selectedFilter?.afterGuiDetached?.()}getSelectedColumn(){return this.getHandler().selectedColumn}getHandler(){return this.params.getHandler()}getFilterColumnPair(G){if(!G)return;return this.filterColumnPairs?.find(({column:D})=>D.getColId()===G)}},cM=class extends xM{init(G){this.params=G,this.validateModel(G),this.updateColumns(),this.addManagedEventListeners({columnRowGroupChanged:this.updateColumns.bind(this),filterDestroyed:(D)=>this.onFilterDestroyed(D)})}refresh(G){if(this.params=G,this.validateModel(G),G.source==="colDef")this.updateColumns()}doesFilterPass(){return!0}setSelectedColumn(G){this.selectedColumn=G,this.dispatchLocalEvent({type:"selectedColumnChanged"})}validateModel(G){if(G.model!=null)G.onModelChange(null)}getSourceColumns(){let G=this.params.column;if(this.gos.get("treeData"))return U2(237),[];let D=this.beans.groupFilter.getSourceColumns(G);if(!D)return U2(183),[];return D}updateColumns(){let G=this.getSourceColumns(),D=G.filter((Q)=>Q.isFilterAllowed());this.sourceColumns=D;let z,B;if(!D.length)z=void 0,B=!1;else if(G.length===1)z=D[0],B=!1;else{if(z=this.selectedColumn,!z||!D.some((Q)=>Q.getId()===z.getId()))z=D[0];B=!0}this.selectedColumn=z,this.hasMultipleColumns=B,this.dispatchLocalEvent({type:"sourceColumnsChanged"})}onFilterDestroyed({column:G,source:D}){if(D==="gridDestroyed")return;let z=G.getColId();if(this.sourceColumns?.some((B)=>B.getColId()===z))setTimeout(()=>{if(this.isAlive())this.updateColumns()})}},iM=class extends hM{constructor(){super(...arguments);this.beanName="groupFilter"}postConstruct(){this.addManagedEventListeners({columnRowGroupChanged:()=>this.updateFilterFlags("columnRowGroupChanged")})}isGroupFilter(G){return G.getColDef().filter==="agGroupColumnFilter"}isFilterAllowed(G){let D=this.beans.colFilter;return!!this.getSourceColumns(G)?.some((z)=>D?.isFilterAllowed(z))}isFilterActive(G){let D=this.beans.colFilter;return!!this.getSourceColumns(G)?.some((z)=>D?.isFilterActive(z))}getSourceColumns(G){return this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(G)}updateFilterFlags(G,D){let{autoColSvc:z,colFilter:B}=this.beans;z?.getColumns()?.forEach((Q)=>{if(this.isGroupFilter(Q))B?.setColFilterActive(Q,this.isFilterActive(Q),G,D)})}},tM={tag:"div",ref:"eFloatingFilter",cls:"ag-group-floating-filter ag-floating-filter-input",role:"presentation"},sM=class extends dM{constructor(){super(tM);this.eFloatingFilter=lM,this.haveAddedColumnListeners=!1}init(G){this.params=G;let D=mM(this.gos),z=this.onColChange.bind(this),B=(Q)=>{if(D)this.setupUnderlyingFloatingFilterElement().then(()=>Q());else this.setupReadOnlyFloatingFilterElement(),Q()};if(this.gos.get("enableFilterHandlers"))return new aQ((Q)=>B(Q)).then(()=>{this.addHandlerListeners(G,z)});else return new aQ((Q)=>{this.params.parentFilterInstance((J)=>{this.parentFilterInstance=J,B(Q)})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{columnsChanged:z})})}refresh(G){if(this.params=G,this.setParams(),this.gos.get("enableFilterHandlers"))if(this.showingUnderlyingFloatingFilter){let D=this.getSelectedColumn(),z=this.beans.colFilter.getFloatingFilterCompDetails(D,this.params.showParentFilter);this.underlyingFloatingFilter?.refresh?.(z?.params)}else this.updateDisplayedValue()}setParams(){let G=this.beans.colNames.getDisplayNameForColumn(this.params.column,"header",!0),D=this.getLocaleTextFunc();this.eFloatingFilterText?.setInputAriaLabel(`${G} ${D("ariaFilterInput","Filter Input")}`)}addHandlerListeners(G,D){let z=this.addManagedListeners(G.getHandler(),{selectedColumnChanged:D,sourceColumnsChanged:D,destroyed:()=>{for(let B of z)B();this.addHandlerListeners(this.params,D)}})}setupReadOnlyFloatingFilterElement(){if(!this.eFloatingFilterText)this.eFloatingFilterText=this.createManagedBean(new nM),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams();this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,pM(this.eFloatingFilter);let G=this.getSelectedColumn();if(G&&!G.isVisible()){let D=this.beans.colFilter,z=D.getFloatingFilterCompDetails(G,this.params.showParentFilter);if(z){if(!this.haveAddedColumnListeners)this.haveAddedColumnListeners=!0,this.addManagedListeners(G,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)});return z.newAgStackInstance().then((B)=>{this.underlyingFloatingFilter=B,this.underlyingFloatingFilter?.onParentModelChanged(D.getModelForColumn(G)),this.appendChild(B.getGui()),this.showingUnderlyingFloatingFilter=!0})}}return this.setupReadOnlyFloatingFilterElement(),aQ.resolve()}getSelectedColumn(){if(this.gos.get("enableFilterHandlers"))return this.params.getHandler().selectedColumn;else return this.parentFilterInstance.getSelectedColumn()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(G){if(!G.column)return;let D=this.beans.colFilter.getFloatingFilterCompDetails(G.column,this.params.showParentFilter);if(D)this.underlyingFloatingFilter?.refresh?.(D.params)}onParentModelChanged(G,D){if(this.showingUnderlyingFloatingFilter)this.underlyingFloatingFilter?.onParentModelChanged(this.beans.colFilter.getModelForColumn(this.getSelectedColumn()),D);else this.updateDisplayedValue()}updateDisplayedValue(){let G=this.eFloatingFilterText;if(!G)return;let D=this.beans.colFilter,z=this.getSelectedColumn(),B=(Q)=>{if(!Q)G.setValue(""),G.setDisplayed(!1);else{let J=z?D.getModelForColumn(z):null;G.setValue(J==null?"":Q.getModelAsString?.(J)??""),G.setDisplayed(!0)}};if(!z)B();else if(this.gos.get("enableFilterHandlers"))B(D.getHandler(z));else D.getOrCreateFilterUi(z)?.then((Q)=>{B(Q)})}onColChange(){if(!this.showingUnderlyingFloatingFilter)this.updateDisplayedValue()}},eM=(G,D)=>{if(!G){D.length=0;return}let z=G.length;D.length=z;for(let B=0;B{let z=G.length;if(z!==D?.length)return!0;for(let B=0;B0){z=!0;break}if(!z)return!1;return G.sort(L2),!0}function L2(G,D){let z=G.sourceRowIndex,B=D.sourceRowIndex,Q=z>=0,J=B>=0,U=Q&&J,Z=!Q&&!J;if(U)return z-B;if(Z)return G.__objectId-D.__objectId;if(Q)return 1;return-1}var zA=class extends oM{constructor(){super(...arguments);this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){let G=this.nonLeafsById;for(let D of G.values())D._destroy(!1);G.clear()}loadGroupData(G){if(!G.group)return G._groupData=null,null;let D=G.rowGroupColumn,{valueSvc:z,showRowGroupCols:B}=this.beans,Q={};if(G._groupData=Q,!D)return Q;let J=Z2(G),U=D.getId();if(!B)return Q;let Z=B.columns;for(let S=0,X=Z.length;S{let B=z.childrenAfterGroup,Q=B?.length;if(!Q)return;let J=Array(Q),U=0,Z=!1,S;for(let X=0;X1)}}if(Q.size)for(let S of Q){this.insertOneNode(G,S);let X=S.parent;D?.addRow(X),J||(J=(X?.childrenAfterGroup?.length??0)>1)}if(Z.size)S2(Z),this.removeEmptyGroups(Z,U);if(J)this.sortChildren(G,D)}sortChildren(G,D){$2(G,!0,void 0,(z)=>{if(DA(z.childrenAfterGroup))D?.addRow(z)})}orderGroups(G){let D=this.gos.getCallback("initialGroupOrderComparator");if(!D)return;let z=this.beans,B=z.gridApi,Q=z.gridOptions.context,J=(Z,S)=>D({api:B,context:Q,nodeA:Z,nodeB:S}),U=(Z)=>{let S=Z.childrenAfterGroup,X=S?.length;if(!X||Z.leafGroup)return;if(X>1)S.sort(J);for(let Y=0,W=X;Y=0;--Z){let{col:S}=U[Z],X=z.getKeyForNode(S,D);if(X==null||X===""){if(!B)continue;X=""}if(!Q?.parent||Q.key!==X){J=!0;break}Q=Q.parent}if(J||(J=!!Q?.parent),!J)return!1;return this.removeFromParent(D),this.insertOneNode(G,D),D.setData(D.data),!0}groupShouldBeRemoved(G){let D=this.getChildrenMappedKey(G.key,G.rowGroupColumn),z=G.parent?.childrenMapped;if(z?!z[D]:!0)return!1;return!!G.group&&(G.childrenAfterGroup?.length??0)===0}removeEmptyGroups(G,D){let z=this.beans.selectionSvc,B,Q=Array.from(G),J=this.nonLeafsById;do{G.clear();for(let U=0;U=Z-1,k=this.createGroup(z,X,W,H,_,D);this.addToParent(k,z),z=k}if(!z.group)aM(184,{parentGroupData:z.data,childNodeData:D.data});D.parent=z,D.level=z.level+1,z.childrenAfterGroup.push(D),z.updateHasChildren(),YB(z)}createGroup(G,D,z,B,Q,J){let U=D.col,Z=(G.level>=0?G.id+"-":"row-group-")+(U.getColId()+"-"+z),S=this.nonLeafsById,X=S.get(Z),Y=!0;if(X){if(X.childrenAfterGroup!==null)return X._expanded??(X._expanded=null),X;Y=!1,YB(X)}else X=new rM(this.beans),X.group=!0,X.key=z,X.id=Z,X.aggData=null,S.set(Z,X);let W=(k)=>{k.childrenAfterGroup=q,k.childrenMapped=H,k.parent=G,k.level=B,k.rowGroupIndex=B,k.leafGroup=Q},q=[],H={};if(W(X),X.field=D.field??null,X.rowGroupColumn=U,X.groupValue=this.beans.valueSvc.getValue(U,J,"data"),X._expanded??(X._expanded=null),Y)return X.setAllChildrenCount(0),X.updateHasChildren(),X;let _=X.sibling;if(_)W(_);return X.dispatchRowEvent("hasChildrenChanged"),X}getChildrenMappedKey(G,D){return D?D.getId()+"-"+G:G}onShowRowGroupColsSetChanged(){let{rowModel:G,valueSvc:D}=this.beans;for(let B of this.nonLeafsById.values()){B._groupData=void 0;let Q=B.rowGroupColumn,J=Q&&Z2(B);B.groupValue=J&&D.getValue(Q,J,"data")}let z=G.rootNode?._leafs;if(z)for(let B=0,Q=z.length;B{for(let D of G){let z=D?.childrenAfterGroup;if(!z)continue;let B=z.length,Q=0;for(let J=0;J{while(G._leafs!==void 0){let D=G.parent;if(!D)break;G._leafs=void 0,G=D}};function BA(G,D){G.rowGroupColsSvc?.setColumns(D,"api")}function QA(G,D){G.rowGroupColsSvc?.removeColumns(D,"api")}function JA(G,D){G.rowGroupColsSvc?.addColumns(D,"api")}function UA(G,D,z){G.rowGroupColsSvc?.moveColumn?.(D,z,"api")}function ZA(G){return G.rowGroupColsSvc?.columns??[]}var CJ={moduleName:"SharedRowGrouping",version:j,apiFunctions:{setRowGroupColumns:BA,removeRowGroupColumns:QA,addRowGroupColumns:JA,getRowGroupColumns:ZA,moveRowGroupColumn:UA},dependsOn:[i,IJ,m7,RJ,AM]},VJ={moduleName:"RowGrouping",version:j,dynamicBeans:{groupStrategy:zA},rowModels:["clientSide"],dependsOn:[CJ,MJ,_0,t7]},o7={moduleName:"RowGroupingPanel",version:j,selectors:[bM],icons:{pivotPanel:"pivot",rowGroupPanel:"group",panelDelimiter:"small-right",panelDelimiterRtl:"small-left"},dependsOn:[K7,pF]},r7={moduleName:"GroupFilter",version:j,userComponents:{agGroupColumnFilter:{classImp:yM,processParams:gM},agGroupColumnFloatingFilter:sM},beans:[iM],dynamicBeans:{agGroupColumnFilterHandler:cM},dependsOn:[i,lF]},YA=class extends $A{constructor(){super(...arguments);this.beanName="rowModel",this.hierarchical=!1,this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={},this.rootNode=null,this.viewportChangedContext=!1}ensureRowHeightsValid(G,D,z,B){return!1}postConstruct(){let G=this.beans,D=new X2(G);this.rootNode=D,D.level=-1,this.rowHeight=Y2(G),this.addManagedEventListeners({viewportChanged:this.onViewportChanged.bind(this)}),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Y2(G),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){let G=this.datasource;if(!G)return;G.destroy?.(),this.beans.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1}updateDatasource(){let G=this.gos.get("viewportDatasource");if(G)this.setViewportDatasource(G)}getPageSize(){return this.gos.get("viewportRowModelPageSize")}getBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(G){let D=this.getBufferSize(),z=this.getPageSize(),B=G-D;if(B<0)return 0;return Math.floor(B/z)*z}calculateLastRow(G){if(G===-1)return G;let D=this.getBufferSize(),z=this.getPageSize(),B=G+D,Q=Math.ceil(B/z)*z,J=this.rowCount-1;return Math.min(Q,J)}onViewportChanged(G){let D=this.calculateFirstRow(G.firstRow),z=this.calculateLastRow(G.lastRow);if(this.firstRow!==D||this.lastRow!==z)this.firstRow=D,this.lastRow=z,this.purgeRowsNotInViewport(),this.viewportChangedContext=!0,this.datasource?.setViewportRange(this.firstRow,this.lastRow),this.viewportChangedContext=!1}purgeRowsNotInViewport(){let G=this.rowNodesByIndex;for(let D of Object.keys(G)){let z=parseInt(D,10);if(zthis.lastRow){if(this.isRowFocused(z)||this.beans.editSvc?.isRowEditing(G[z]))continue;delete G[z]}}}isRowFocused(G){let D=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!D)return!1;if(D.rowPinned!=null)return!1;return D.rowIndex===G}setViewportDatasource(G){if(this.destroyDatasource(),this.datasource=G,this.rowCount=-1,!G.init)XA(226);else G.init(LA(this.gos,{setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}))}getType(){return"viewport"}getRow(G){if(!this.rowNodesByIndex[G])this.rowNodesByIndex[G]=this.createBlankRowNode(G);return this.rowNodesByIndex[G]}getRowNode(G){let D;return this.forEachNode((z)=>{if(z.id===G)D=z}),D}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(G){if(this.rowHeight!==0)return Math.floor(G/this.rowHeight);return 0}resetRowHeights(){}onRowHeightChanged(){}getRowBounds(G){let D=this.rowHeight;return{rowHeight:D,rowTop:D*G}}updateRowHeights(){let G=this.rowHeight;this.forEachNode((D)=>{D.setRowHeight(G),D.setRowTop(G*D.rowIndex)}),this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(G){return G}isEmpty(){return this.rowCount>0}getOverlayType(){return null}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(G,D){let z=G.rowIndex,B=D.rowIndex,Q=zthis.lastRow,J=Bthis.lastRow;if(Q||J)return[];let U=[],Z=z<=B?z:B,S=z<=B?B:z;for(let X=Z;X<=S;X++)U.push(this.rowNodesByIndex[X]);return U}forEachNode(G){let D=0;for(let z of Object.keys(this.rowNodesByIndex)){let B=parseInt(z,10),Q=this.rowNodesByIndex[B];G(Q,D),D++}}setRowData(G){let D=SA(this.beans.gos),z=new Map;if(D)for(let B of Object.values(this.rowNodesByIndex))z.set(B.id,B);for(let B=this.firstRow;B<=this.lastRow;B++){let Q=G[B];if(!Q)continue;let J,U;if(D)J=D({data:Q,rowPinned:void 0,level:0,parentKeys:void 0}),U=z.get(J);else U=this.rowNodesByIndex[B];if(U)U.updateData(Q),U.setRowIndex(B),U.setRowTop(this.rowHeight*B);else U=this.createBlankRowNode(B),U.setDataAndId(Q,J??B.toString());this.rowNodesByIndex[B]=U}if(!this.viewportChangedContext)this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}createBlankRowNode(G){let D=new X2(this.beans),z=this.rowHeight;return D.setRowHeight(z),D.setRowTop(z*G),D.setRowIndex(G),D}setRowCount(G,D=!1){if(G===this.rowCount)return;this.rowCount=G;let z=this.eventSvc;z.dispatchEventOnce({type:"rowCountReady"}),z.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:D,animate:!1})}isRowPresent(G){return!!this.getRowNode(G.id)}},a7={moduleName:"ViewportRowModel",version:j,rowModels:["viewport"],beans:[YA],dependsOn:[i]};function _A(G,D){G.clipboardSvc?.copyToClipboard(D)}function kA(G,D){G.clipboardSvc?.cutToClipboard(D)}function wA(G,D){G.clipboardSvc?.copySelectedRowsToClipboard(D)}function KA(G,D){G.clipboardSvc?.copySelectedRangeToClipboard(D)}function fA(G){G.clipboardSvc?.copyRangeDown()}function NA(G){G.clipboardSvc?.pasteFromClipboard()}var h0="paste",D1="dragCopy",z1="clipboard";function bA(G,D=","){let z=[],B=(J)=>J==="\r"||J===` +`,Q=!1;if(G==="")return[[""]];for(let J=0,U=0,Z=0;Z{if(!z[J])z[J]=[];if(!z[J][U])z[J][U]=""};if(W(),X==='"'){if(Q)if(Y==='"')z[J][U]+='"',Z++;else Q=!1;else if(S===void 0||S===D||B(S))Q=!0}if(!Q&&X!=='"'){if(X===D){U++,W();continue}else if(B(X)){if(U=0,J++,W(),X==="\r"&&Y===` +`)Z++;continue}}z[J][U]+=X}return z}var vA=class extends FA{constructor(){super(...arguments);this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){let{gos:G,rowModel:D,ctrlsSvc:z}=this.beans;if(q2(G,D))this.clientSideRowModel=D;z.whenReady(this,(B)=>{this.gridCtrl=B.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){if(!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText)navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((D)=>{c0(40,{e:D,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()});else this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let G=!1,D=(z)=>{let B=Date.now();if(B-this.lastPasteOperationTime<50)G=!0,z.preventDefault();this.lastPasteOperationTime=B};this.executeOnTempElement((z)=>{z.addEventListener("paste",D),z.focus({preventScroll:!0})},(z)=>{let B=z.value;if(!G)this.processClipboardData(B);else this.refocusLastFocusedCell();z.removeEventListener("paste",D)})}refocusLastFocusedCell(){let{focusSvc:G}=this.beans,D=G.getFocusedCell();if(D)G.setFocusedCell({rowIndex:D.rowIndex,column:D.column,rowPinned:D.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){let G=this.gos.get("clipboardDelimiter");return EA(G)?G:"\t"}processClipboardData(G){if(G==null)return;let D=bA(G,this.getClipboardDelimiter()),z=this.gos.getCallback("processDataFromClipboard");if(z)D=z({data:D});if(D==null)return;if(this.gos.get("suppressLastEmptyLineOnPaste"))this.removeLastLineIfBlank(D);let{rangeSvc:B,editSvc:Q}=this.beans,J=(U,Z,S,X)=>{if(B?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(D))this.pasteIntoActiveRange(D,U,Z,X);else this.pasteStartingFromFocusedCell(D,U,Z,S,X);Q?.stopEditing(void 0,{source:h0})};this.doPasteOperation(J)}doPasteOperation(G){let{eventSvc:z,focusSvc:B,rowRenderer:Q,gos:J}=this.beans;z.dispatchEvent({type:"pasteStart",source:"clipboard"});let{clientSideRowModel:U}=this,Z=U?.rootNode,S=Z&&this.beans.changedPathFactory?.newPath(J.get("aggregateOnlyChangedColumns")),X={},Y=[],W=B.getFocusedCell();G(X,Y,W,S);let q=Y.slice();if(S)U.doAggregate(S),IA(Z,U.hierarchical,S,(H)=>{q.push(H)});Q.refreshCells({rowNodes:q}),this.dispatchFlashCells(X),this.fireRowChanged(Y),this.refocusLastFocusedCell(),z.dispatchEvent({type:"pasteEnd",source:"clipboard"})}getPreProcessRangeCallback(G){return(D)=>{let{rangeSvc:z}=this.beans;if(!z)return;let{rowDiff:B,colDiff:Q}=this.getAdjustedRangeDimensionForPaste(D,G);if(B!==0)z.extendRangeRowCountBy(D,B);if(Q!==0)z.extendRangeColumnCountBy(D,Q)}}getAdjustedRangeDimensionForPaste(G,D){let z=this.beans.rangeSvc,B=D.length,Q=z.getRangeRowCount(G),J=Q>=B&&Q%B===0,U=D[0].length,Z=G.columns.length,S=Z>=U&&Z%U===0;return{rowDiff:J?0:B-Q,colDiff:S?0:U-Z}}pasteIntoActiveRange(G,D,z,B){let Q=0,J=0,U=(Z,S,X,Y)=>{if(Y-Q>=G.length){if(Y%G.length!==0)return;Q+=J,J=0}let q=G[Y-Q];z.push(S);let H=this.gos.getCallback("processCellFromClipboard"),_=X.columns,k=_.findIndex(CA);if(k!==-1)_.splice(k,1);for(let w=0;w<_.length;w++){let K=_[w];if(!K.isCellEditable(S)||K.isSuppressPaste(S))continue;let f=w;if(w>=q.length)f=w%q.length;let N=this.processCell(S,K,q[f],D1,H,!0);S.setDataValue(K,N,h0),B?.addCell(S.parent,K.getId());let{rowIndex:F,rowPinned:E}=Z,I=lD({rowIndex:F,column:K,rowPinned:E});D[I]=!0}J++};this.iterateActiveRanges(U,!1,this.getPreProcessRangeCallback(G))}getDisplayedColumnsStartingAt(G){let D=G,z=[],{visibleCols:B}=this.beans;while(D&&VA(D))D=B.getColAfter(D);while(D!=null)z.push(D),D=B.getColAfter(D);return z}pasteStartingFromFocusedCell(G,D,z,B,Q){if(!B)return;let J={rowIndex:B.rowIndex,rowPinned:B.rowPinned},U=this.getDisplayedColumnsStartingAt(B.column);if(this.isPasteSingleValueIntoRange(G))this.pasteSingleValueIntoRange(G,z,D,Q);else this.pasteMultipleValues(G,J,z,U,D,z1,Q)}isPasteSingleValueIntoRange(G){let D=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(G)&&!!D&&!D.isEmpty()}pasteSingleValueIntoRange(G,D,z,B){let Q=G[0][0],J=(U,Z,S)=>{D.push(Z),S.columns.forEach((X)=>this.updateCellValue(Z,X,Q,z,z1,B))};this.iterateActiveRanges(J)}hasOnlyOneValueToPaste(G){return G.length===1&&G[0].length===1}copyRangeDown(){let{rangeSvc:G,gos:D,formula:z,valueSvc:B}=this.beans;if(!G||G.isEmpty())return;let Q=[],J=(U,Z,S,X)=>{let Y=D.getCallback("processCellForClipboard"),W=D.getCallback("processCellFromClipboard"),q=(H,_,k)=>{let{columns:w}=k;if(!Q.length)w.forEach((K)=>{let f=this.processCell(_,K,B.getValue(K,_,"batch"),D1,Y,!1,!0);Q.push(f)});else Z.push(_),w.forEach((K,f)=>{if(!K.isCellEditable(_)||K.isSuppressPaste(_))return;if(K.isAllowFormula()&&z?.isFormula(Q[f]))Q[f]=z?.updateFormulaByOffset({value:Q[f],rowDelta:1});let F=this.processCell(_,K,Q[f],D1,W,!0);_.setDataValue(K,F,h0),X?.addCell(_.parent,K.getId());let{rowIndex:E,rowPinned:I}=H,V=lD({rowIndex:E,column:K,rowPinned:I});U[V]=!0})};this.iterateActiveRanges(q,!0)};this.doPasteOperation(J)}removeLastLineIfBlank(G){let D=AA(G);if(D&&D.length===1&&D[0]===""){if(G.length===1)return;RA(G,D)}}fireRowChanged(G){if(this.gos.get("editType")!=="fullRow")return;for(let D of G)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:D,data:D.data,rowIndex:D.rowIndex,rowPinned:D.rowPinned})}shouldSkipPasteRow(G,D,z){if(G.detail||G.footer)return!0;if(z&&G.group){for(let B of D)if(B.isCellEditable(G))return!1;return!0}return!1}pasteMultipleValues(G,D,z,B,Q,J,U){let Z=D,S=this.beans,{gos:X}=S,Y=this.clientSideRowModel!=null&&!X.get("enableGroupEdit")&&!X.get("treeData"),W=()=>{while(Z){let q=G1(S,Z);if(Z=eQ(S,{rowPinned:Z.rowPinned,rowIndex:Z.rowIndex}),q!=null&&!this.shouldSkipPasteRow(q,B,Y))return q}return null};for(let q of G){let H=W();if(!H)continue;q.forEach((_,k)=>this.updateCellValue(H,B[k],_,Q,J,U)),z.push(H)}}updateCellValue(G,D,z,B,Q,J){if(!G||!D?.isCellEditable(G)||D?.isSuppressPaste(G))return;let U=this.processCell(G,D,z,Q,this.gos.getCallback("processCellFromClipboard"),!0);G.setDataValue(D,U,h0);let{rowIndex:Z,rowPinned:S}=G,X=lD({rowIndex:Z,column:D,rowPinned:S});B[X]=!0,J?.addCell(G.parent,D.getId())}copyToClipboard(G={}){this.copyOrCutToClipboard(G)}cutToClipboard(G={},D="api"){if(this.gos.get("suppressCutToClipboard"))return;this.eventSvc.dispatchEvent({type:"cutStart",source:D}),this.copyOrCutToClipboard(G,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:D})}copyOrCutToClipboard(G,D){let{includeHeaders:z,includeGroupHeaders:B}=G,{gos:Q,focusSvc:J}=this.beans;if(z==null)z=Q.get("copyHeadersToClipboard");if(B==null)B=Q.get("copyGroupHeadersToClipboard");let U={includeHeaders:z,includeGroupHeaders:B},Z=Q.get("rowSelection"),S=Q.get("cellSelection"),X=null;if(this.shouldCopyCells(S,Z))this.copySelectedRangeToClipboard(U),X=0;else if(this.shouldCopyRows(Z))this.copySelectedRowsToClipboard(U),X=1;else if(J.isAnyCellFocused())this.copyFocusedCellToClipboard(U),X=2;if(D&&X!==null)this.clearCellsAfterCopy(X)}shouldCopyCells(G,D){let{rangeSvc:z,selectionSvc:B,gos:Q}=this.beans;if(!z||z.isEmpty())return!1;if(G)return!(typeof D==="object"&&D.copySelectedRows&&!B?.isEmpty());else{let J=Q.get("suppressCopySingleCellRanges");return!(!z.isMoreThanOneCell()&&J)}}shouldCopyRows(G){let{selectionSvc:D,gos:z}=this.beans;if(D?.isEmpty()??!0)return!1;if(G&&typeof G!=="string")return G.copySelectedRows??!1;else return!z.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(G){let D=this.beans,{rangeSvc:z,focusSvc:B,eventSvc:Q}=D;if(Q.dispatchEvent({type:"keyShortcutChangedCellStart"}),G===0)z.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(G===1)this.clearSelectedRows();else{let J=B.getFocusedCell();if(J==null)return;let U=G1(D,J);if(U)this.clearCellValue(U,J.column)}Q.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){let{selectionSvc:G,visibleCols:D}=this.beans,z=G?.getSelectedNodes()??[],B=D.allCols;for(let Q of z)for(let J of B)this.clearCellValue(Q,J)}clearCellValue(G,D){if(!D.isCellEditable(G))return;let z=this.beans.valueSvc.getDeleteValue(D,G);G.setDataValue(D,z,"clipboardSvc")}iterateActiveRanges(G,D,z){let B=this.beans.rangeSvc;if(!B||B.isEmpty())return;let Q=B.getCellRanges(),J=D?[Q[0]]:Q;for(let U of J)this.iterateActiveRange({cellRange:U,rowCallback:G,preProcessRange:z})}iterateActiveRange(G){let{cellRange:D,preProcessRange:z,rowCallback:B}=G,{beans:Q}=this,{rangeSvc:J}=Q;if(!J)return;if(z)z(D);let U=J.getRangeStartRow(D),Z=J.getRangeEndRow(D),S=0,X=!1;while(!X&&U!=null){let Y=G1(Q,U);X=H2(U,Z),B(U,Y,D,S++),U=eQ(Q,U)}}copySelectedRangeToClipboard(G={}){let D=this.beans.rangeSvc;if(!D||D.isEmpty())return;let z=D.areAllRangesAbleToMerge(),{data:B,cellsToFlash:Q}=z?this.buildDataFromMergedRanges(D,G):this.buildDataFromRanges(D,G);this.copyDataToClipboard(B),this.dispatchFlashCells(Q)}buildDataFromMergedRanges(G,D){let z=new Set,B=G.getCellRanges(),Q=new Map,J=[],U={},Z=q2(this.gos,this.beans.rowModel),S=new Set;if(!Z)this.beans.rowModel.forEachNode((q)=>{S.add(q.rowIndex)});for(let q of B){q.columns.forEach((k)=>z.add(k));let{rowPositions:H,cellsToFlash:_}=this.getRangeRowPositionsAndCellsToFlash(G,q);for(let k of H){let w=S.has(k.rowIndex);if(!Z&&!w)continue;let K=`${k.rowIndex}-${k.rowPinned||"null"}`;if(!Q.get(K))Q.set(K,!0),J.push(k)}Object.assign(U,_)}let X=this.beans.visibleCols.allCols,Y=Array.from(z);return Y.sort((q,H)=>{let _=X.indexOf(q),k=X.indexOf(H);return _-k}),{data:this.buildExportParams({columns:Y,rowPositions:J,includeHeaders:D.includeHeaders,includeGroupHeaders:D.includeGroupHeaders}),cellsToFlash:U}}buildDataFromRanges(G,D){let z=G.getCellRanges(),B=[],Q={};for(let J of z){let{rowPositions:U,cellsToFlash:Z}=this.getRangeRowPositionsAndCellsToFlash(G,J);Object.assign(Q,Z),B.push(this.buildExportParams({columns:J.columns,rowPositions:U,includeHeaders:D.includeHeaders,includeGroupHeaders:D.includeGroupHeaders}))}return{data:B.join(` +`),cellsToFlash:Q}}getRangeRowPositionsAndCellsToFlash(G,D){let z=[],B={},Q=G.getRangeStartRow(D),J=G.getRangeEndRow(D),U=Q;while(U){z.push(U);for(let Z of D.columns){let{rowIndex:S,rowPinned:X}=U,Y=lD({rowIndex:S,column:Z,rowPinned:X});B[Y]=!0}if(H2(U,J))break;U=eQ(this.beans,U)}return{rowPositions:z,cellsToFlash:B}}getCellsToFlashFromRowNodes(G){let D=this.beans.visibleCols.allCols,z={};for(let B=0;B{let{value:W,valueFormatted:q}=this.beans.valueSvc.getValueForDisplay({column:Y,node:X,includeValueFormatted:!0,from:"batch"}),H=q??W??"",_=J.getCallback("processCellForClipboard");if(!_)return H;return _({column:Y,node:X,value:H,type:z1,formatValue:(k)=>this.beans.valueSvc.formatValue(Y,X,k)??k,parseValue:(k)=>this.beans.valueSvc.parseValue(Y,X,k,W)??k})},S={columnKeys:D,rowPositions:z,skipColumnHeaders:!B,skipColumnGroupHeaders:!Q,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!z,valueFrom:"batch",processCellCallback:J.getCallback("processCellForClipboard"),processRowGroupCallback:Z,processHeaderCallback:J.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:J.getCallback("processGroupHeaderForClipboard")};return U.getDataAsCsv(S,!0)}dispatchFlashCells(G){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:G})},0)}processCell(G,D,z,B,Q,J,U){let{valueSvc:Z,formula:S}=this.beans;if(Q)return Q({column:D,node:G,value:z,type:B,formatValue:(Y)=>Z.formatValue(D,G??null,Y)??Y,parseValue:(Y)=>Z.parseValue(D,G??null,Y,Z.getValue(D,G,"edit"))});if(J&&D.getColDef().useValueParserForImport!==!1)return Z.parseValue(D,G??null,z,Z.getValue(D,G,"edit"));if(U&&D.getColDef().useValueFormatterForExport!==!1){if(S?.isFormula(z))return z;return Z.formatValue(D,G??null,z)??z}return z}copyDataToClipboard(G){let D=this.gos.getCallback("sendToClipboard");if(D){D({data:G});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(G).catch((B)=>{c0(40,{e:B,method:"writeText"}),this.copyDataToClipboardLegacy(G)});return}this.copyDataToClipboardLegacy(G)}copyDataToClipboardLegacy(G){this.executeOnTempElement((D)=>{let z=W2(this.beans),B=MA(this.beans);if(D.value=G||" ",D.select(),D.focus({preventScroll:!0}),!z.execCommand("copy"))c0(41);if(B?.focus!=null)B.focus({preventScroll:!0})})}executeOnTempElement(G,D){if(!this.gridCtrl)return;let z=W2(this.beans),B=z.createElement("textarea"),Q=B.style;Q.width="1px",Q.height="1px";let J=z.documentElement;Q.top=J.scrollTop+"px",Q.left=J.scrollLeft+"px",Q.position="absolute",Q.opacity="0",this.gridCtrl.getGui().appendChild(B);try{G(B)}catch(Z){c0(42)}if(D)window.setTimeout(()=>{D(B),B.remove()},100);else B.remove()}},nB={moduleName:"Clipboard",version:j,beans:[vA],apiFunctions:{copyToClipboard:_A,cutToClipboard:kA,copySelectedRowsToClipboard:wA,copySelectedRangeToClipboard:KA,copySelectedRangeDown:fA,pasteFromClipboard:NA},dependsOn:[i,WA,HA,qA]},jA=".ag-row-number-cell{background-color:var(--ag-header-background-color);border:none;color:var(--ag-header-text-color);font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}:where(.ag-ltr) .ag-row-number-cell{text-align:right}:where(.ag-rtl) .ag-row-number-cell{text-align:left}.ag-row-numbers-resizer{bottom:-2px;cursor:ns-resize;height:4px;position:absolute;width:100%}:where(.ag-ltr) .ag-row-numbers-resizer{left:0}:where(.ag-rtl) .ag-row-numbers-resizer{right:0}.ag-floating-bottom .ag-row-numbers-resizer{bottom:unset;top:-2px}:where(.ag-row-number-header.ag-row-number-selection-enabled){cursor:cell}.ag-row-number-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-row-number-range-selected{background-color:var(--ag-row-numbers-selected-color)}:where(.ag-ltr){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-last-left-pinned){border-right:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik0zLjQ0NSA4LjkxMVY3LjQwOUg5Ljc1VjYuMDE0bDIuNTM1IDIuMTQ2LTIuNTM1IDIuMTQ2VjguOTExeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+\"),auto}}:where(.ag-rtl){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-first-right-pinned){border-left:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik01Ljk3OSA4LjkxMXYxLjM5NUwzLjQ0NSA4LjE2bDIuNTM0LTIuMTQ2djEuMzk1aDYuMzA2djEuNTAyeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+\"),auto}}",yA={tag:"div",cls:"ag-row-numbers-resizer"},xA=class extends PA{constructor(G){super(yA);this.cellCtrl=G,this.initialYPosition=-1,this.dragging=!1}postConstruct(){let{beans:G,cellCtrl:D}=this,{dragSvc:z,environment:B}=G;this.defaultRowHeight=B.getDefaultRowHeight(),z.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:this.onDragging.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:!0,stopPropagationForTouch:!0});let Q=D.getRowPosition();this.node=TA(this.beans,Q)}onDragStart(G){if(!this.node)return;let{beans:{ctrlsSvc:D,eventSvc:z}}=this;D.get("gridCtrl").setResizeCursor(gA.Vertical),this.dragging=!0,this.initialHeight=this.node.rowHeight,z.dispatchEvent({type:"rowResizeStarted",node:this.node,event:G,rowHeight:this.initialHeight})}onDragging(G){let{clientY:D}=G;if(this.cellCtrl.rowNode.rowPinned==="bottom")D*=-1;if(this.initialYPosition===-1||!this.dragging){this.initialYPosition=D;return}let{beans:z,initialHeight:B,initialYPosition:Q,defaultRowHeight:J,node:U}=this;if(B==null)return;let Z=U?.rowHeight,S=Math.max(B-(Q-D),J);if(Z===S)return;U?.setRowHeight(S);let{rowRenderer:X,rowModel:Y,pinnedRowModel:W}=z,q=!!U?.rowPinned;if(q)X.redraw({afterScroll:!0});if(!q||W?.isManual())Y.onRowHeightChanged({animate:!1})}onDragStop(G){this.beans.eventSvc.dispatchEvent({type:"rowResizeEnded",node:this.node,event:G,rowHeight:this.node?.rowHeight}),this.clearDragDetails(!0)}onDragCancel(){this.clearDragDetails(!0)}clearDragDetails(G){if(this.initialYPosition=-1,this.initialHeight=null,this.dragging=!1,G)this.beans.ctrlsSvc.get("gridCtrl").setResizeCursor(!1)}destroy(){this.clearDragDetails(!1),this.node=void 0,super.destroy()}};function e7(G){let D=zR(G);return!(!D||typeof D!=="object"||!D.enableRowResizer)}var QR=class{constructor(G,D){this.beans=G,this.cellCtrl=D}refreshRowResizer(){if(!e7(this.beans)||!this.isRowResizeSupported(this.cellCtrl.rowNode))this.removeRowResizerFromCellComp();else this.addResizerToCellComp()}isRowResizeSupported(G){let{pinnedRowModel:D,rowModel:z,visibleCols:B}=this.beans,Q=!!z.onRowHeightChanged;if(B.autoHeightCols.length)return BR(276),!1;if(G.rowPinned!=null)return D?.isManual()?Q:!0;return Q}addResizerToCellComp(){let{beans:G,cellCtrl:D}=this,{rowResizer:z}=this;if(!z){if(z=G.registry.createDynamicBean("rowNumberRowResizer",!1,D),!z)return;this.rowResizer=G.context.createBean(z)}D.comp.setRowResizerElement(z.getGui())}removeRowResizerFromCellComp(){let{rowResizer:G,beans:{context:D},cellCtrl:z}=this;if(!G)return;z.comp?.setRowResizerElement(null),this.rowResizer=D.destroyBean(G)}destroy(){this.removeRowResizerFromCellComp()}},JR=class extends hA{constructor(){super(...arguments);this.beanName="rowNumbersSvc",this.isIntegratedWithSelection=!1,this.lastColumnResized=0}postConstruct(){let G=tA(this,this.refreshCells.bind(this),10);this.addManagedEventListeners({columnResized:()=>{this.lastColumnResized=Date.now()},cellFocused:this.onGridCellFocused.bind(this),modelUpdated:(D)=>{G(!1,!D.keepRenderedRows)},rangeSelectionChanged:()=>this.refreshCells(!0),pinnedRowsChanged:()=>G(!1,!0)}),this.addManagedPropertyListeners(["rowNumbers","cellSelection"],(D)=>{this.updateColumns(D)}),this.refreshSelectionIntegration(),this.registerRangeSelectionExtension()}shouldSkipColumn(G){return pD(this.beans)&&wD(G)}isAllColumnsSelectionCell(G){return pD(this.beans)&&wD(G.column)}isAllColumnsRange(G,D){if(!pD(this.beans)||D.length===0)return!1;return G.columns.length===D.length&&D.every((z)=>G.columns.includes(z))}registerRangeSelectionExtension(){let G=this.beans.rangeSvc;if(!G)return;G.registerRangeSelectionExtension(this),this.addDestroyFunc(()=>G.unregisterRangeSelectionExtension?.(this))}addColumns(G){if(this.columns==null)return;G.list=this.columns.list.concat(G.list),G.tree=this.columns.tree.concat(G.tree),DR(G)}createColumns(G,D){let z=()=>{_2(this.beans,this.columns?.tree),this.columns=null},{beans:B}=this;if(!pD(B)){z();return}let Q=G.treeDepth,U=(this.columns?.treeDepth??-1)==Q,Z=this.generateRowNumberCols();if(lA(Z,this.columns?.list??[])&&U)return;z();let{colGroupSvc:X}=this.beans,Y=X?.findDepth(G.tree)??0,W=X?.balanceTreeForAutoCols(Z,Y)??[];this.columns={list:Z,tree:W,treeDepth:Y,map:{}},D((H)=>{if(!H)return null;let _=H.filter((k)=>!wD(k));return[...Z,..._]})}handleMouseDownOnCell(G,D){if(!this.isIntegratedWithSelection||D.target.classList.contains("ag-row-numbers-resizer")){if(this.beans.rangeSvc)D.preventDefault();return D.stopImmediatePropagation(),!1}if(!D.shiftKey&&!aA(this.beans,D))this.focusFirstRenderedCellAtRowPosition(G);return!0}handleKeyDownOnCell(G,D){if(!this.isIntegratedWithSelection)return!1;if(D.key===B1.ENTER)return this.selectRowCells(G,D),D.preventDefault(),!0;return!1}selectRowCells(G,D){let{rangeSvc:z}=this.beans;if(!z)return;z.handleCellKeyboardSelect(D,G)}updateColumns(G){let D=pA(G.source);this.refreshSelectionIntegration();for(let z of this.columns?.list??[]){let B=this.createRowNumbersColDef();z.setColDef(B,null,D),dA(this.beans,{state:[sA(B,z.getColId())]},D)}}getColumn(){return this.columns?.list.find(wD)??null}getColumns(){return this.columns?.list??null}setupForHeader(G){let{column:D,eGridHeader:z}=G.params;if(!wD(D))return;GR(z,"Row Number"),this.addManagedElementListeners(z,{click:this.onHeaderClick.bind(this),keydown:this.onHeaderKeyDown.bind(this),focus:this.onHeaderFocus.bind(this)})}onGridCellFocused(G){if(!this.isIntegratedWithSelection||G.rowIndex==null||!G.column||!wD(G.column))return;let z=this.getLocaleTextFunc()("ariaSelectAllRowCells","Press Enter to select all cells on this row");this.beans.ariaAnnounce?.announceValue(z,"ariaSelectAllRowCells")}createRowNumbersRowResizerFeature(G){if(!e7(this.beans))return;return new QR(this.beans,G)}refreshSelectionIntegration(){let{beans:G}=this,{gos:D,rangeSvc:z}=G,B=D.get("cellSelection");this.refreshRowNumberOverrides(),this.isIntegratedWithSelection=!!z&&!!B&&!this.isSuppressCellSelectionIntegration}refreshRowNumberOverrides(){let G=pD(this.beans);if(this.rowNumberOverrides={},this.isSuppressCellSelectionIntegration=!1,!G||typeof G!=="object")return;if(G.suppressCellSelectionIntegration)this.isSuppressCellSelectionIntegration=!0;let D=["contextMenuItems","context","onCellClicked","onCellContextMenu","onCellDoubleClicked","headerTooltip","headerStyle","headerComponent","headerComponentParams","suppressHeaderKeyboardEvent","suppressNavigable","tooltipField","tooltipValueGetter","tooltipComponent","tooltipComponentParams","tooltipComponentSelector","valueGetter","valueFormatter","width","maxWidth","minWidth","resizable","cellRenderer","cellRendererSelector","cellRendererParams"];for(let z of D)if(G[z]!=null)this.rowNumberOverrides[z]=G[z]}onHeaderFocus(){if(!this.isIntegratedWithSelection)return;let D=this.getLocaleTextFunc()("ariaSelectAllCells","Press Space or Enter to select all cells");this.beans.ariaAnnounce?.announceValue(D,"ariaSelectAllCells")}onHeaderKeyDown(G){if(!this.isIntegratedWithSelection||G.key!==B1.SPACE&&G.key!==B1.ENTER)return;G.preventDefault(),this.selectAllCellsFromHeader()}onHeaderClick(G){if(Date.now()-this.lastColumnResized<100||!this.isIntegratedWithSelection||this.getColumn()?.resizing)return;this.focusAllCellsFromHeaderClick()}selectAllCellsFromHeader(){eA(this.beans)}focusAllCellsFromHeaderClick(){this.selectAllCellsFromHeader(),this.focusFirstRenderedCellAtRowPosition()}refreshCells(G,D){let z=this.getColumn();if(!z)return;if(D){let B=this.beans.autoWidthCalc?.getPreferredWidthForElements([this.createDummyElement(z)],2);if(B!=null)this.beans.colResize?.setColumnWidths([{key:z,newWidth:B}],!1,!0,"rowNumbersService")}this.beans.rowRenderer.refreshCells({columns:[z],force:G})}createDummyElement(G){let D=mA({tag:"div",cls:"ag-cell-value ag-cell"}),z=String(this.beans.rowModel.getRowCount()+1);if(typeof this.rowNumberOverrides.valueFormatter==="function"){let B=nA(this.beans.gos,{data:void 0,value:z,node:null,column:G,colDef:G.colDef});z=this.rowNumberOverrides.valueFormatter(B)}return D.textContent=z,D}createRowNumbersColDef(){let{gos:G,contextMenuSvc:D}=this.beans,z=G.get("enableRtl");return{minWidth:60,width:60,resizable:!1,valueGetter:this.valueGetter.bind(this),contextMenuItems:this.isIntegratedWithSelection||!D?void 0:()=>[],...this.rowNumberOverrides,colId:iA,chartDataType:"excluded",suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPinned:!0,pinned:z?"right":"left",lockPosition:z?"right":"left",editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,suppressSizeToFit:!0,suppressHeaderContextMenu:!0,headerClass:this.getHeaderClass(),cellClass:this.getCellClass.bind(this),cellAriaRole:"rowheader"}}valueGetter(G){let D=G.node,z=this.beans.formula?.active,B=D?.pinnedSibling;if(D?.rowPinned&&B){let Q=z?B.formulaRowIndex:B.rowIndex;return`${Q==null?"-":Q+1}`}return String(((z?D?.formulaRowIndex:D?.rowIndex)||0)+1)}getHeaderClass(){let G=["ag-row-number-header"];if(this.isIntegratedWithSelection)G.push("ag-row-number-selection-enabled");return G}getCellClass(G){let{beans:D}=this,{rangeSvc:z,gos:B}=D,{node:Q}=G,J=["ag-row-number-cell"],U=B.get("cellSelection");if(!z||!U)return J;if(this.isIntegratedWithSelection)J.push("ag-row-number-selection-enabled");let Z=z.getCellRanges();if(!Z.length)return J;let S=this.beans.visibleCols.allCols.length-1,X=typeof U==="object"&&U.enableHeaderHighlight;for(let Y of Z)if(z.isRowInRange({rowIndex:Q.rowIndex,rowPinned:Q.rowPinned},Y)){if(X)J.push("ag-row-number-range-highlight");if(Y.columns.length===S)J.push("ag-row-number-range-selected")}return J}generateRowNumberCols(){let{gos:G,beans:D}=this;if(!pD(D))return[];let z=this.createRowNumbersColDef(),B=z.colId;G.validateColDef(z,B,!0);let Q=new cA(z,null,B,!1);return this.createBean(Q),[Q]}focusFirstRenderedCellAtRowPosition(G){let D=this.beans.editSvc;if(D?.isEditing()&&D.isRangeSelectionEnabledWhileEditing?.())return;if(!G){if(G=oA(this.beans),!G)return}let{beans:z,gos:B}=this,{visibleCols:Q,colViewport:J}=z,U=B.get("enableRtl")?Q.rightCols:Q.leftCols,Z;if(U.length==1){let W=rA(z,G);if(!W)return;Z=J.getColsWithinViewport(W)}else Z=U;let S=Z.find((W)=>!wD(W));if(!S)return;let{rowPinned:X,rowIndex:Y}=G;setTimeout(()=>{z.focusSvc.setFocusedCell({rowIndex:Y,rowPinned:X,column:S,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})})}destroy(){_2(this.beans,this.columns?.tree),this.rowNumberOverrides=null,super.destroy()}},bJ={moduleName:"RowNumbers",version:j,beans:[JR],dynamicBeans:{rowNumberRowResizer:xA},dependsOn:[i,OA,uA],css:[jA]},SR={tag:"div",cls:"ag-filter-toolpanel-search",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-filter-toolpanel-expand"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-filter-toolpanel-search-input"}]},XR=class extends $R{constructor(){super(...arguments);this.eExpand=w2,this.eFilterTextField=w2}postConstruct(){this.setTemplate(SR,[ZR]);let G=this.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(G("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedElementListeners(this.eExpand,{click:this.onExpandClicked.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)})}init(G){if(this.params=G,this.beans.colModel.ready)this.showOrHideOptions()}createExpandIcons(){let{eExpand:G,beans:D}=this;G.appendChild(this.eExpandChecked=Q1("accordionOpen",D)),G.appendChild(this.eExpandUnchecked=Q1("accordionClosed",D)),G.appendChild(this.eExpandIndeterminate=Q1("accordionIndeterminate",D))}showOrHideOptions(){let{params:G,eFilterTextField:D}=this,z=!G.suppressFilterSearch,B=!G.suppressExpandAll,Q=this.getLocaleTextFunc();D.setInputPlaceholder(Q("searchOoo","Search..."));let J=(Z)=>Z.getOriginalParent()&&Z.isFilterAllowed(),U=this.beans.colModel.getCols().some(J);Tz(D.getGui(),z),Tz(this.eExpand,B&&U)}onSearchTextChanged(){if(!this.onSearchTextChangedDebounced)this.onSearchTextChangedDebounced=LR(this,()=>this.dispatchLocalEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()}),300);this.onSearchTextChangedDebounced()}onExpandClicked(){let G=this.currentExpandState===0?{type:"collapseAll"}:{type:"expandAll"};this.dispatchLocalEvent(G)}setExpandState(G){this.currentExpandState=G,Tz(this.eExpandChecked,G===0),Tz(this.eExpandUnchecked,G===1),Tz(this.eExpandIndeterminate,G===2)}},YR={selector:"AG-FILTERS-TOOL-PANEL-HEADER",component:XR},MR={tag:"div",cls:"ag-filter-toolpanel-instance",children:[{tag:"div",ref:"eFilterToolPanelHeader",cls:"ag-filter-toolpanel-header ag-filter-toolpanel-instance-header",role:"button",attrs:{"aria-expanded":"false"},children:[{tag:"div",ref:"eExpand",cls:"ag-filter-toolpanel-expand"},{tag:"span",ref:"eFilterName",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilterIcon",cls:"ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon"}]},{tag:"div",ref:"agFilterToolPanelBody",cls:"ag-filter-toolpanel-instance-body ag-filter"}]},D8=class extends KR{constructor(G,D){super(MR);this.hideHeader=G,this.expandedCallback=D,this.eFilterToolPanelHeader=yz,this.eFilterName=yz,this.agFilterToolPanelBody=yz,this.eFilterIcon=yz,this.eExpand=yz,this.expanded=!1}postConstruct(){let{beans:G,eExpand:D,eFilterIcon:z}=this,B=U1("accordionOpen",G);this.eExpandChecked=B;let Q=U1("accordionClosed",G);this.eExpandUnchecked=Q,D.appendChild(B),D.appendChild(Q);let J=this.getLocaleTextFunc();ER(z,J("ariaFilterActive","Filter Active")),IR(z,"img")}setColumn(G){this.column=G;let{beans:D,eFilterToolPanelHeader:z,eFilterIcon:B,eExpandChecked:Q,hideHeader:J}=this;if(this.eFilterName.innerText=D.colNames.getDisplayNameForColumn(G,"filterToolPanel",!1)||"",this.addManagedListeners(z,{click:this.toggleExpanded.bind(this),keydown:this.onKeyDown.bind(this)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),this.addInIcon("filterActive",B,G),zD(B,this.isFilterActive()),zD(Q,!1),J)zD(z,!1),z.removeAttribute("tabindex");else z.setAttribute("tabindex","0");this.addManagedListeners(G,{filterChanged:this.onFilterChanged.bind(this)})}onKeyDown(G){let{key:D}=G,{ENTER:z,SPACE:B,LEFT:Q,RIGHT:J}=N2;if(D!==z&&D!==B&&D!==Q&&D!==J)return;if(G.preventDefault(),D===z||D===B)this.toggleExpanded();else if(D===N2.LEFT)this.collapse();else this.expand()}getColumn(){return this.column}getColumnFilterName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(G){this.eFilterToolPanelHeader.classList.add(G)}addInIcon(G,D,z){if(D==null)return;let B=U1(G,this.beans,z);D.appendChild(B)}isFilterActive(){return!!this.beans.colFilter?.isFilterActive(this.column)}onFilterChanged(){zD(this.eFilterIcon,this.isFilterActive()),this.dispatchLocalEvent({type:"filterChanged"})}toggleExpanded(){if(this.expanded)this.collapse();else this.expand()}expand(){if(this.expanded)return;this.expanded=!0,F2(this.eFilterToolPanelHeader,!0),zD(this.eExpandChecked,!0),zD(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback()}addFilterElement(G){let D=FR({tag:"div",cls:"ag-filter-toolpanel-instance-filter"}),z=this.createManagedBean(new fR(this.column,"TOOLBAR"));if(this.filterComp=z,!z.hasFilter())return;z.getFilter()?.then((B)=>{if(this.underlyingFilter=B,!B)return;D.appendChild(z.getGui()),this.agFilterToolPanelBody.appendChild(D),z.afterGuiAttached({container:"toolPanel",suppressFocus:G})})}collapse(){if(!this.expanded)return;this.expanded=!1,F2(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),zD(this.eExpandChecked,!1),zD(this.eExpandUnchecked,!0);let G=this.filterComp;G?.afterGuiDetached(),this.destroyBean(G),this.expandedCallback()}removeFilterElement(){NR(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}onPanelHidden(){if(!this.expanded)return;let G=this.underlyingFilter;if(!G)return;G.afterGuiDetached?.()}onFilterOpened(G){if(G.source!=="COLUMN_MENU")return;if(G.column!==this.column)return;if(!this.expanded)return;this.collapse()}},BD=class extends AR{constructor(G,D,z,B,Q){super();this.columnGroup=G,this.childFilterComps=D,this.expandedCallback=z,this.depth=B,this.showingColumn=Q,this.filterGroupComp=RR}postConstruct(){let G={cssIdentifier:"filter-toolpanel",direction:"vertical"};this.setTemplate({tag:"div",cls:"ag-filter-toolpanel-group-wrapper",children:[{tag:"ag-group-component",ref:"filterGroupComp"}]},[p],{filterGroupComp:G}),this.setGroupTitle();let{filterGroupComp:D,depth:z,childFilterComps:B,gos:Q}=this;D.setAlignItems("stretch"),D.addCss(`ag-filter-toolpanel-group-level-${z}`),D.getGui().style.setProperty("--ag-indentation-level",String(z)),D.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${z}-header`);for(let U of B)D.addItem(U),U.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${z+1}-header`),U.getGui().style.setProperty("--ag-indentation-level",String(z+1));let J=this.showingColumn?this.columnGroup:void 0;this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getLocation:()=>"filterToolPanelColumnGroup",shouldDisplayTooltip:bR(Q,()=>D.getGui().querySelector(".ag-group-title")),getAdditionalParams:()=>({colDef:J?.getColDef(),column:J})})),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filterActive")}setupTooltip(){if(!this.showingColumn)return;let G=()=>{this.tooltipFeature?.setTooltipAndRefresh(this.columnGroup.getColDef().headerTooltip)};G(),this.addManagedEventListeners({newColumnsLoaded:G})}addCssClassToTitleBar(G){this.filterGroupComp.addCssClassToTitleBar(G)}onPanelHidden(){for(let G of this.childFilterComps)G.onPanelHidden()}isColumnGroup(){return i0(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName??""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(G,D){this.filterGroupComp.hideItem(G,D)}hideGroup(G){this.setDisplayed(!G)}addInIcon(G){let D=VR(G,this.beans);if(D){D.classList.add("ag-filter-toolpanel-group-instance-header-icon");let z=this.getLocaleTextFunc();vR(D,z("ariaFilterActive","Filter Active")),OR(D,"img")}this.filterGroupComp.addTitleBarWidget(D)}forEachToolPanelFilterChild(G){for(let D of this.childFilterComps)if(D instanceof D8)G(D)}addExpandCollapseListeners(){let G=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild((z)=>z.expand()),D=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild((z)=>z.collapse());this.addManagedListeners(this.filterGroupComp,{expanded:G,collapsed:D})}getColumns(){if(i0(this.columnGroup))return this.columnGroup.getLeafColumns();return[this.columnGroup]}addFilterChangedListeners(){for(let G of this.getColumns())this.addManagedListeners(G,{filterChanged:()=>this.refreshFilterClass()});if(!i0(this.columnGroup))this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){let G=this.getColumns(),D=()=>G.some((z)=>z.isFilterActive());this.filterGroupComp.toggleCss("ag-has-filter",D())}onFilterOpened(G){if(G.source!=="COLUMN_MENU")return;if(G.column!==this.columnGroup)return;if(!this.isExpanded())return;this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){let G=this.columnGroup,D=i0(G)?this.getColumnGroupName(G):this.getColumnName(G);this.filterGroupName=D,this.filterGroupComp.setTitle(D||"")}getColumnGroupName(G){return this.beans.colNames.getDisplayNameForProvidedColumnGroup(null,G,"filterToolPanel")}getColumnName(G){return this.beans.colNames.getDisplayNameForColumn(G,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),CR(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},uR=class extends WR{constructor(){super({tag:"div",cls:"ag-filter-list-panel"});this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(G){this.colModel=G.colModel}init(G){this.initialised=!0;let D=qR(this.gos,{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});if(kR(D,G),this.params=D,!D.suppressSyncLayoutWithGrid)this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()});if(this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:(z)=>{if(z.key==="filters"&&!z.visible)this.onPanelHidden()},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{if(this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending)this.onColumnsChangedPending=!1,this.onColumnsChanged()}}),this.colModel.ready)this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}let G=this.colModel.isPivotMode();if(!this.params.suppressSyncLayoutWithGrid&&!G)this.syncFilterLayout();else this.buildTreeFromProvidedColumnDefs();this.refreshAriaLabel()}syncFilterLayout(){Q7(this.colModel,this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){let G=this.colModel.getColDefColTree();this.recreateFilters(G)}setFiltersLayout(G){let D=B7(this.colModel,G);this.recreateFilters(D)}recreateFilters(G){let D=_R(this.beans);if(!this.hasLoadedInitialState)this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState;let z=this.getExpansionState();this.destroyFilters();let B=this.recursivelyAddComps(G,0,z);this.filterGroupComps=B;let Q=B.length;if(Q){for(let U of B)this.appendChild(U);this.setFirstAndLastVisible(0,Q-1)}let J=this.searchFilterText;if(J1(J))this.searchFilters(J);if(this.fireExpandedEvent(),this.getGui().contains(D))D.focus();this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(G,D,z){return G.map((B)=>{if(f2(B))return this.recursivelyAddFilterGroupComps(B,D,z)?.flatMap((S)=>S)??[];let Q=B;if(!this.shouldDisplayFilter(Q))return[];let U=new D8(D===0,()=>this.onFilterExpanded());if(this.createBean(U),U.setColumn(Q),z.get(Q.getId()))U.expand();if(D>0)return U;let Z=this.createBean(new BD(Q,[U],this.onGroupExpanded.bind(this),D,!0));if(Z.addCssClassToTitleBar("ag-filter-toolpanel-header"),!z.get(Z.getFilterGroupId()))Z.collapse();return Z}).flatMap((B)=>B)}refreshAriaLabel(){let G=this.getLocaleTextFunc(),D=G("ariaFilterPanelList","Filter List"),z=G("filters","Filters"),B=this.getGui(),Q=".ag-filter-toolpanel-group-wrapper",J=".ag-filter-toolpanel-group-item",U=".ag-hidden",S=B.querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;wR(this.getAriaElement(),`${D} ${S} ${z}`)}recursivelyAddFilterGroupComps(G,D,z){if(!this.filtersExistInChildren(G.getChildren()))return;if(G.getColGroupDef()?.suppressFiltersToolPanel)return[];let Q=G.isPadding()?D:D+1,J=this.recursivelyAddComps(G.getChildren(),Q,z).flatMap((S)=>S);if(G.isPadding())return J;let U=new BD(G,J,this.onGroupExpanded.bind(this),D,!1);this.createBean(U),U.addCssClassToTitleBar("ag-filter-toolpanel-header");let Z=z.get(U.getFilterGroupId());if(this.isInitialState&&!Z||Z===!1)U.collapse();return[U]}filtersExistInChildren(G){return G.some((D)=>{if(f2(D))return this.filtersExistInChildren(D.getChildren());return this.shouldDisplayFilter(D)})}shouldDisplayFilter(G){let D=G.getColDef()?.suppressFiltersToolPanel;return G.isFilterAllowed()&&!D}getExpansionState(){let G=new Map;if(this.isInitialState){let{expandedColIds:z,expandedGroupIds:B}=this.params.initialState;for(let Q of z)G.set(Q,!0);for(let Q of B)G.set(Q,!0);return G}let D=(z)=>{G.set(z.getFilterGroupId(),z.isExpanded());for(let B of z.getChildren())if(B instanceof BD)D(B);else G.set(B.getColumn().getId(),B.isExpanded())};return this.filterGroupComps.forEach(D),G}refresh(){}setVisible(G){if(super.setDisplayed(G),G&&!this.initialised)this.init(this.params)}expandFilterGroups(G,D){let z=[],B=(Q)=>{let J=Q.getFilterGroupId();if(!D||D.includes(J)){if(G&&Q.isColumnGroup())Q.expand();else Q.collapse();z.push(J)}for(let Z of Q.getChildren())if(Z instanceof BD)B(Z)};if(this.filterGroupComps.forEach(B),this.onGroupExpanded(),D){let Q=D.filter((J)=>z.indexOf(J)<0);if(Q.length>0)K2(166,{unrecognisedGroupIds:Q})}}expandFilters(G,D){let z=[],B=(Q)=>{if(Q instanceof BD){let Z=!1;for(let S of Q.getChildren())if(B(S)){if(G)Q.expand(),Z=!0;else if(!Q.isColumnGroup())Q.collapse()}return Z}let J=Q.getColumn().getColId(),U=!D||D.includes(J);if(U){if(G)Q.expand();else Q.collapse();z.push(J)}return U};if(this.filterGroupComps.forEach(B),this.onGroupExpanded(),D){let Q=D.filter((J)=>z.indexOf(J)<0);if(Q.length>0)K2(167,{unrecognisedColIds:Q})}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:"filterExpanded"})}fireExpandedEvent(){let G=0,D=0,z=(Q)=>{if(!Q.isColumnGroup())return;if(Q.isExpanded())G++;else D++;for(let J of Q.getChildren())if(J instanceof BD)z(J)};this.filterGroupComps.forEach(z);let B;if(G>0&&D>0)B=2;else if(D>0)B=1;else B=0;this.dispatchLocalEvent({type:"groupExpanded",state:B})}performFilterSearch(G){this.searchFilterText=J1(G)?G.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(G){let D=(J)=>{return!J1(G)||J.toLowerCase().indexOf(G)!==-1},z=(J,U)=>{if(!(J instanceof BD))return D(J.getColumnFilterName()||"");let Z=J.getChildren(),S=D(J.getFilterGroupName()),X=U||S;if(X){J.hideGroup(!1);for(let W=0;W{let H=z(W,U);if(J.hideGroupItem(!H,q),H)Y=!0}),J.hideGroup(!Y),Y},B,Q;this.filterGroupComps.forEach((J,U)=>{z(J,!1);let Z=J.getGui()?.classList.contains("ag-hidden");if(B===void 0){if(!Z)B=U,Q=U}else if(!Z&&Q!==U)Q=U}),this.setFirstAndLastVisible(B,Q),this.refreshAriaLabel()}setFirstAndLastVisible(G,D){this.filterGroupComps.forEach((z,B)=>{if(z.removeCss("ag-first-group-visible"),z.removeCss("ag-last-group-visible"),B===G)z.addCss("ag-first-group-visible");if(B===D)z.addCss("ag-last-group-visible")})}onPanelHidden(){for(let G of this.filterGroupComps)G.onPanelHidden()}getExpandedFiltersAndGroups(){let G=[],D=new Set,z=(B)=>{if(B instanceof BD){for(let J of B.getChildren())z(J);let Q=B.getFilterGroupId();if(B.isExpanded()&&!D.has(Q))G.push(Q)}else if(B.isExpanded())D.add(B.getColumn().getColId())};return this.filterGroupComps.forEach(z),{expandedGroupIds:G,expandedColIds:Array.from(D)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),HR(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},jR={selector:"AG-FILTERS-TOOL-PANEL-LIST",component:uR},PR=".ag-filter-toolpanel{flex:1 1 0px;min-width:0}.ag-filter-toolpanel-header,.ag-filter-toolpanel-search{align-items:center;color:var(--ag-header-text-color);display:flex;font-weight:var(--ag-header-font-weight);padding:0 var(--ag-spacing);>:where(.ag-filter-icon),>:where(.ag-filter-toolpanel-expand),>:where(.ag-filter-toolpanel-search-input),>:where(.ag-header-cell-text){align-items:center;display:flex}}.ag-filter-toolpanel-header{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing);position:relative;&:focus-visible{border-radius:var(--ag-border-radius);box-shadow:inset var(--ag-focus-shadow)}}:where(.ag-ltr) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-ltr) .ag-filter-toolpanel-instance-header-icon{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-rtl) .ag-filter-toolpanel-instance-header-icon{margin-right:var(--ag-spacing)}.ag-filter-toolpanel-search{min-height:var(--ag-header-height);padding-bottom:var(--ag-spacing);padding-top:var(--ag-widget-container-vertical-padding)}:where(.ag-filter-toolpanel-group:not(.ag-has-filter)>.ag-group-title-bar) .ag-filter-toolpanel-group-instance-header-icon{display:none}.ag-filter-toolpanel-search-input{flex-grow:1;height:calc(var(--ag-spacing)*4)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar-icon{margin-left:var(--ag-spacing)}.ag-filter-toolpanel-expand{cursor:pointer}:where(.ag-ltr) .ag-filter-toolpanel-expand{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-expand{margin-left:var(--ag-spacing)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar,:where(.ag-ltr) .ag-filter-toolpanel-instance-header{padding-left:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar,:where(.ag-rtl) .ag-filter-toolpanel-instance-header{padding-right:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-ltr) .ag-filter-toolpanel-instance-body{margin-left:var(--ag-filter-tool-panel-group-indent)}:where(.ag-rtl) .ag-filter-toolpanel-instance-body{margin-right:var(--ag-filter-tool-panel-group-indent)}.ag-filter-toolpanel-instance-filter{background-color:var(--ag-chrome-background-color)}.ag-filter-toolpanel-group-level-0{border-top:none}",gR={tag:"div",cls:"ag-filter-toolpanel",children:[{tag:"ag-filters-tool-panel-header",ref:"filtersToolPanelHeaderPanel"},{tag:"ag-filters-tool-panel-list",ref:"filtersToolPanelListPanel"}]},TR=class extends UR{constructor(){super(gR,[YR,jR]);this.filtersToolPanelHeaderPanel=k2,this.filtersToolPanelListPanel=k2,this.initialised=!1,this.listenerDestroyFuncs=[],this.registerCSS(PR)}init(G){if(this.initialised){for(let Z of this.listenerDestroyFuncs)Z();this.listenerDestroyFuncs=[]}this.initialised=!0;let z={...{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1},...G};this.params=z;let{filtersToolPanelHeaderPanel:B,filtersToolPanelListPanel:Q}=this;B.init(z),Q.init(z);let{suppressExpandAll:J,suppressFilterSearch:U}=z;if(J&&U)B.setDisplayed(!1);this.listenerDestroyFuncs.push(...this.addManagedListeners(B,{expandAll:()=>Q.expandFilterGroups(!0),collapseAll:()=>Q.expandFilterGroups(!1),searchChanged:(Z)=>Q.performFilterSearch(Z.searchText)}),...this.addManagedListeners(Q,{filterExpanded:z.onStateUpdated,groupExpanded:(Z)=>{B.setExpandState(Z.state),z.onStateUpdated()}}))}setVisible(G){if(super.setDisplayed(G),G&&!this.initialised)this.init(this.params)}setFilterLayout(G){this.filtersToolPanelListPanel.setFiltersLayout(G)}expandFilterGroups(G){this.filtersToolPanelListPanel.expandFilterGroups(!0,G)}collapseFilterGroups(G){this.filtersToolPanelListPanel.expandFilterGroups(!1,G)}expandFilters(G){this.filtersToolPanelListPanel.expandFilters(!0,G)}collapseFilters(G){this.filtersToolPanelListPanel.expandFilters(!1,G)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(G){return this.init(G),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}},cR=class extends yR{constructor(){super(...arguments);this.beanName="filterPanelSvc",this.states=new Map,this.orderedStates=[],this.initialStateApplied=!1,this.columnsLoaded=!1,this.isActive=!1}postConstruct(){if(!this.gos.get("enableFilterHandlers"))return;let G=this.updateFilterStates.bind(this),D=()=>this.dispatchStatesUpdates(void 0,!0),z=this.onFilterDestroyed.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>{if(this.columnsLoaded=!0,!this.initialStateApplied)this.applyState();G()},dataTypesInferred:G,filterChanged:G,filterDestroyed:z,filterHandlerDestroyed:z,filterOpened:D,filterClosed:D});let B=({column:Q})=>{this.states.get(Q.getColId())?.refresh?.(),D()};this.addManagedListeners(this.beans.colFilter,{filterStateChanged:B,filterModelAsStringChanged:B})}updateParams(G,D){this.params=G;let z=!1;if(D){if(this.currState=D,this.columnsLoaded){let B=new Set(D.filters?.map((Q)=>Q.colId));for(let Q of this.getIds())if(!B.has(Q))this.remove(Q);this.clear(),this.applyState(),this.updateFilterStates(),z=!0}}if(!z)this.dispatchStatesUpdates();this.beans.colFilter?.setGlobalButtons(!!G.buttons?.length)}getIds(){return Array.from(this.states.keys())}getAvailable(){let G=this.beans,D=[];for(let z of G.colModel.getColDefCols()??[]){let B=z.getColId();if(z.isFilterAllowed()&&!z.colDef.suppressFiltersToolPanel&&!this.states.get(B))D.push({id:B,name:E2(G,z)})}return D}add(G){this.createFilter(G,!0),this.dispatchStatesUpdates(G)}remove(G){let{states:D,orderedStates:z,beans:{colFilter:B,selectableFilter:Q}}=this,J=D.get(G);if(!J)return;J.destroy?.();let U=J.state.column;D.delete(G),Q?.clearActive(G),B?.destroyFilter(U),this.eventSvc.dispatchEvent({type:"filterSwitched",column:U});let Z=z.indexOf(G);z.splice(Z,1);let S=z[Z];this.dispatchStatesUpdates(S)}getState(G){return this.states.get(G)?.state}updateFilterState(G,D,z,B){let Q=this.getState(G);if(!Q)return;if(Q[D]=z,!B)this.dispatchLocalEvent({type:"filterPanelStateChanged",id:G,state:Q})}expand(G,D){let z=this.states.get(G);if(!z)return;z.destroy?.();let{handler:B,state:{column:Q}}=z,J=this.createFilterState(Q,B,D);this.states.set(G,J),this.dispatchLocalEvent({type:"filterPanelStateChanged",id:G,state:J.state})}updateType(G,D){let z=this.states.get(G);if(!z)return;let B=z.state;if(B.expanded===!1)return;let Q=B.filterDefs;if(!Q)return;let{colFilter:J,selectableFilter:U}=this.beans;U?.setActive(G,Q,D),J.filterParamsChanged(G,"columnFilter");let Z=B.column;this.eventSvc.dispatchEvent({type:"filterSwitched",column:Z});let S=this.states.get(G);if(!S)return;let X=S.state;this.dispatchLocalEvent({type:"filterPanelStateChanged",id:G,state:X})}getActions(){let G=this.params?.buttons;if(!G?.length)return;let D=!!this.beans.colFilter?.canApplyAll();return{actions:G,canApply:D}}doAction(G){this.beans.colFilter?.updateAllModels(G)}getGridState(){let G=[];return this.states.forEach((D,z)=>{G.push({colId:z,expanded:D.state.expanded})}),{filters:G}}createFilter(G,D){let z=this.createFilterStateWrapper(G,D);if(z)this.states.set(G,z),this.orderedStates.push(G)}createFilterStateWrapper(G,D){let{colModel:z,colFilter:B}=this.beans,Q=z.getColDefCol(G);if(Q&&!Q.colDef.suppressFiltersToolPanel){let J=B.getHandler(Q,!0);if(J)return this.createFilterState(Q,J,D)}return}updateFilterStates(){if(!this.params)return;let G=this.beans.colFilter.getModel(),D=new Set;for(let z of Object.keys(G)){let B=this.states.get(z);if(!B)this.createFilter(z);else B.refresh?.();D.add(z)}this.states.forEach((z,B)=>{if(!D.has(B))z.refresh?.()}),this.dispatchStatesUpdates()}createFilterState(G,D,z){let B=this.beans,{colFilter:Q,selectableFilter:J}=B,U=E2(B,G),Z=G.getColId(),S=()=>!!this.params?.buttons&&Q.hasUnappliedModel(Z),X=S();if(z){let Y=G.colDef,{filterDefs:W,activeFilterDef:q}=J?.getDefs(G,Y)??{},H=this.createBean(new xR(G,"TOOLBAR",!0));return{state:{column:G,name:U,isEditing:X,expanded:z,detail:H.getGui(),activeFilterDef:q,filterDefs:W,afterGuiAttached:H.afterGuiAttached.bind(H),afterGuiDetached:H.afterGuiDetached.bind(H)},handler:D,refresh:()=>{this.updateFilterState(Z,"isEditing",S())},destroy:()=>this.destroyBean(H)}}else{let Y=G.getColId(),W=()=>D.getModelAsString?.(Q.getStateForColumn(Y).model,"filterToolPanel")??"";return{state:{column:G,name:U,isEditing:X,expanded:!1,summary:W()},handler:D,refresh:()=>{this.updateFilterState(Y,"isEditing",S(),!0),this.updateFilterState(Y,"summary",W())}}}}onFilterDestroyed({column:G,source:D}){let{colFilter:z,filterManager:B}=this.beans;if(!z?.isAlive()||!B?.isFilterAllowed(G))return;let Q=this.states,J=G.getColId(),U=Q.get(J);if(U){let Z=this.createFilterStateWrapper(J,U.state.expanded);if(Z)U.destroy?.(),Q.set(J,Z);else this.remove(J);if(D==="api")this.dispatchStatesUpdates()}}dispatchStatesUpdates(G,D){this.dispatchLocalEvent({type:"filterPanelStatesChanged",activeId:G,action:D})}applyState(){if(this.params&&this.columnsLoaded){this.initialStateApplied=!0;for(let{colId:G,expanded:D}of this.currState?.filters??[])this.createFilter(G,D)}}destroy(){this.clear(),this.params=void 0,this.currState=void 0,super.destroy()}clear(){let{states:G,orderedStates:D}=this;G.forEach((z)=>z.destroy?.()),G.clear(),D.length=0}};function E2(G,D){return G.colNames.getDisplayNameForColumn(D,"filterToolPanel")??D.getColId()}var sR={addFilterCard:"Add Filter",ariaLabelAddFilterField:"Add Filter Field",ariaLabelFilterCardDelete:"Delete Filter",ariaLabelFilterCardHasEdits:"Has Edits",agTextColumnFilterDisplayName:"Simple Filter",agNumberColumnFilterDisplayName:"Simple Filter",agDateColumnFilterDisplayName:"Simple Filter",agSetColumnFilterDisplayName:"Selection Filter",agMultiColumnFilterDisplayName:"Combo Filter",addFilterPlaceholder:"Search columns..."};function zz(G,D){return tR(G,sR,D)}function oR(G,D,z){let B=0;for(let Q=0;Q{let{filter:F,filterParams:E,name:I,filterValueGetter:V=S.filterValueGetter}=N,A=H?{...H,...E}:E,R;if(Y&&W)if(F==="agMultiColumnFilter")R=B.multiFilter?.getParamsForDataType(A,V,Y,W);else R=dR(F,A,V,Y,W,B,this.getLocaleTextFunc());let O;if(!I){let u=F;if(typeof F==="boolean")u=U?.getDefaultFilterFromDataType(()=>X);if(typeof u==="string")O=zz(this,`${u}DisplayName`);else pR(280,{colId:G.getColId()}),O=""}if(H||R||O)return{...N,filterParams:A,name:O??I,...R};return N},w=(q??this.getDefaultFilters(G)).map(k),K=z??this.selectedFilters.get(G.getColId())??_??(!q&&lR(Q)?1:0);if(K>=w.length)K=0;let f=w[K];return{filterDefs:w,activeFilterDef:f}}setActive(G,D,z,B){let Q=D.indexOf(z);if(Q<0)return;let{selectedFilters:J,valueGetters:U}=this;J.set(G,Q);let Z=z.filterValueGetter;if(Z)U.set(G,Z);else U.delete(G);if(!B)this.onChange()}clearActive(G){let{selectedFilters:D,valueGetters:z}=this;D.delete(G),z.delete(G),this.onChange()}getState(){return Object.fromEntries(this.selectedFilters)}setState(G){this.clearAll();let D=this.beans.colModel;for(let z of Object.keys(G)){let B=D.getColDefCol(z);if(B){let Q=this.getDefs(B,B.colDef,G[z]);if(Q)this.setActive(z,Q.filterDefs,Q.activeFilterDef,!0)}}}destroy(){this.clearAll(),super.destroy()}clearAll(){let{selectedFilters:G,valueGetters:D}=this;G.clear(),D.clear()}onChange(){this.dispatchLocalEvent({type:"selectedFilterChanged"})}getDefaultFilters(G){let D=this.beans,{gos:z,dataTypeSvc:B}=D,Q=z.isModuleRegistered("MultiFilter"),J=B?.getBaseDataType(G);return[{filter:nR(J,!1)},{filter:"agSetColumnFilter"},...Q?[{filter:"agMultiColumnFilter"}]:[]]}},LC={tag:"div",cls:"ag-filter-card ag-filter-card-add"},SC=class extends UC{constructor(G){super(LC);this.options=new Map,this.setOptions(G)}postConstruct(){this.showButton()}refresh(G){this.setOptions(G);let{eSelect:D,options:z}=this;if(D)D.setValueList({valueList:Array.from(z.keys()),refresh:!0})}showButton(){A2(this.getGui()),this.destroySelect();let G=ZC({tag:"button",cls:"ag-button ag-standard-button ag-filter-add-button",children:[{tag:"span",children:[()=>$C("filterAdd",this.beans)]},{tag:"span",cls:"ag-filter-add-button-label",children:zz(this,"addFilterCard")}]});this.activateTabIndex([G]);let D=this.showSelect.bind(this);G.addEventListener("click",D),this.removeButton=()=>{G.removeEventListener("click",D)},this.appendChild(G),G.focus()}showSelect(){A2(this.getGui()),this.destroyButton();let G="ariaLabelAddFilterField",D={className:"ag-filter-add-select",pickerType:"virtual-list",pickerAriaLabelKey:G,pickerAriaLabelValue:zz(this,G),placeholder:zz(this,"addFilterPlaceholder"),value:"",valueList:Array.from(this.options.keys()),searchType:"matchAny",allowTyping:!0,filterList:!0,highlightMatch:!0,valueFormatter:(B)=>this.options.get(B)},z=this.createManagedBean(new gB(D));this.eSelect=z,this.appendChild(z.getGui()),z.showPicker(),z.getFocusableElement().focus(),z.addManagedListeners(z,{fieldPickerValueSelected:({value:B})=>this.dispatchLocalEvent({type:"filterSelected",id:B}),pickerHidden:()=>{this.showButton()}})}setOptions(G){let D=this.options;D.clear();for(let{id:z,name:B}of G)D.set(z,B)}destroySelect(){this.eSelect=this.destroyBean(this.eSelect)}destroyButton(){this.removeButton=this.removeButton?.()}destroy(){this.destroySelect(),this.destroyButton(),super.destroy()}},fC={tag:"div",cls:"ag-filter-card-body",children:[{tag:"ag-select",cls:"ag-filter-type-select",ref:"eFilterType"}]},NC=class extends kC{constructor(){super(...arguments);this.eFilterType=wC}postConstruct(){let G={onValueChange:(D)=>this.dispatchLocalEvent({type:"filterTypeChanged",filterDef:D})};this.setTemplate(fC,[_C],{eFilterType:G}),this.eFilterType.setDisplayed(!1)}refresh(G){let D=this.state;this.state=G;let{activeFilterDef:z,filterDefs:B,detail:Q,afterGuiAttached:J,afterGuiDetached:U}=G,{activeFilterDef:Z,filterDefs:S,detail:X}=D??{},Y=this.eFilterType;if(B!==S){Y.clearOptions();let W=B?.map((q)=>({value:q,text:q.name}));if(W)Y.clearOptions().addOptions(W).setValue(z,!0);Y.setDisplayed(!!W)}else if(z!==Z)Y.setValue(z,!0);if(Q!==X){if(X)KC(X),U();this.appendChild(Q),J({container:"newFiltersToolPanel",suppressFocus:!0})}}},EC={tag:"div",cls:"ag-filter-card-summary",attrs:{"aria-hidden":"true"}},IC=class extends FC{constructor(){super(EC)}refresh(G){this.getGui().textContent=G.summary}},MC={tag:"div",cls:"ag-filter-card",children:[{tag:"div",cls:"ag-filter-card-header",role:"presentation",children:[{tag:"div",cls:"ag-filter-card-heading",role:"heading",attrs:{"aria-level":"2"},children:[{tag:"button",ref:"eExpand",cls:"ag-button ag-filter-card-expand",children:[{tag:"span",ref:"eTitle",cls:"ag-filter-card-title"},{tag:"span",ref:"eEditing",cls:"ag-filter-card-editing-icon"},{tag:"span",ref:"eExpandIcon",cls:"ag-filter-card-expand-icon"}]}]},{tag:"button",ref:"eDelete",cls:"ag-button ag-filter-card-delete",children:[{tag:"span",ref:"eDeleteIcon",cls:"ag-filter-card-delete-icon"}]}]}]},AC=class extends XC{constructor(G){super(MC);this.id=G,this.eTitle=mD,this.eExpand=mD,this.eDelete=mD,this.eExpandIcon=mD,this.eDeleteIcon=mD,this.eEditing=mD}postConstruct(){let{beans:G,eDelete:D,eExpand:z,eDeleteIcon:B,eEditing:Q,id:J}=this,U=G.filterPanelSvc;C2(D,zz(this,"ariaLabelFilterCardDelete")),B.appendChild(Z1("close",G,null)),this.activateTabIndex([z,D]),this.addManagedElementListeners(z,{click:()=>U.expand(J,!this.state?.expanded)}),this.addManagedElementListeners(D,{click:()=>U.remove(J)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),Q.appendChild(Z1("filterCardEditing",G,null))}refresh(G){let{eExpand:D,eEditing:z,state:B,beans:Q}=this;this.state=G;let{name:J,expanded:U,isEditing:Z}=G;if(this.eTitle.textContent=J,HC(z,Z),!B||U!==B.expanded)this.toggleExpand(G);let S=U?null:`${J} ${G.summary}`;if(Z)S=`${S??J}. ${zz(this,"ariaLabelFilterCardHasEdits")}`;C2(D,S);let X=(W)=>{if(!W)return;return WC(W.getGui()),this.destroyBean(W)},Y=(W,q,H)=>{if(!W)W=this.createBean(new q),H?.(W),this.appendChild(W.getGui());return W.refresh(G),W};if(G.expanded){this.summaryComp=X(this.summaryComp);let W=Y(this.detailComp,NC,(H)=>H.addManagedListeners(H,{filterTypeChanged:({filterDef:_})=>Q.filterPanelSvc.updateType(this.id,_)}));this.detailComp=W;let q=`ag-${this.getCompId()}-filter`;W.getGui().id=q,R2(D,q)}else this.detailComp=X(this.detailComp),this.summaryComp=Y(this.summaryComp,IC),R2(D,null)}toggleExpand(G){let D=!!G.expanded,{eExpandIcon:z,eExpand:B,beans:Q}=this;YC(z),z.appendChild(Z1(D?"filterCardCollapse":"filterCardExpand",Q,null)),qC(B,D)}onFilterOpened(G){let{state:D,beans:z,id:B}=this;if(G.source==="COLUMN_MENU"&&G.column===D?.column&&D?.expanded)z.filterPanelSvc.expand(B,!1)}destroy(){this.detailComp=this.destroyBean(this.detailComp),this.summaryComp=this.destroyBean(this.summaryComp),this.state=void 0,super.destroy()}};function RC(G){return!!G?.id}function CC(G){return!!G?.action}var VC={tag:"div",cls:"ag-filter-panel",children:[{tag:"div",cls:"ag-filter-panel-container",ref:"eContainer"}]},bC=class extends GC{constructor(){super(VC);this.eContainer=zC,this.filters=new Map}refresh(G){if(CC(G)){this.refreshActions();return}if(RC(G)){this.filters.get(G.id)?.refresh(G.state);return}let{eContainer:D,filters:z,beans:B}=this,Q=B.filterPanelSvc,J=Q.getIds(),U=new Map,Z=!M2(B),S=Z?BC(B):void 0,X=Z&&D.contains(S),Y=[],W=[];for(let K of J){let f=z.get(K)??this.createBean(new AC(K));f.refresh(Q.getState(K)),U.set(K,f),W.push(f.getGui())}this.filters=U;let q=[];z.forEach((K,f)=>{if(Y.push(K.getGui()),!U.has(f))q.push(K)});let H=this.addFilterComp;if(H)Y.push(H.getGui());let _=Q.getAvailable();if(_.length){if(!H)H=this.createBean(new SC(_)),H.addManagedListeners(H,{filterSelected:({id:K})=>Q.add(K)});H.refresh(_),W.push(H.getGui())}else H=this.destroyBean(H);this.addFilterComp=H,oR(D,W,Y);for(let K of q)this.destroyBean(K);let k=G?.activeId,w=k&&U.get(k)?.getGui();if(w)I2(w);else if(X&&M2(B))I2(W[W.length-1]??D);this.refreshActions()}refreshActions(){let G=this.beans.filterPanelSvc,{actions:D,canApply:z}=G.getActions()??{},B=this.buttonComp;if(D?.length){let Q=D.map((J)=>({type:J,label:JC(this,`${J}Filter`)}));if(!B){B=this.createBean(new DC({className:"ag-filter-panel-buttons"})),this.getGui().appendChild(B.getGui());let J={};for(let U of["apply","clear","reset","cancel"])J[U]=()=>G.doAction(U);B.addManagedListeners(B,J)}B.updateButtons(Q),B.updateValidity(z!==!1)}else if(B)QC(B.getGui()),B=this.destroyBean(B);this.buttonComp=B}destroy(){this.beans.filterPanelSvc?.clear?.(),this.addFilterComp=this.destroyBean(this.addFilterComp),this.buttonComp=this.destroyBean(this.buttonComp);let G=this.filters;G.forEach((D)=>this.destroyBean(D)),G.clear(),super.destroy()}},vC=".ag-filter-panel{display:flex;flex-direction:column;width:100%;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-filter-panel .ag-simple-filter-body-wrapper{padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel .ag-mini-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-vertical-spacing)}.ag-filter-panel-container{display:flex;flex:1;flex-direction:column;gap:var(--ag-widget-container-vertical-padding);overflow:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-card{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius)}.ag-filter-card-header{align-items:center;display:flex;flex-direction:row;gap:var(--ag-spacing);padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-heading{flex:1;overflow:hidden;padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));padding-top:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing))}:where(.ag-ltr) .ag-filter-card-heading{padding-left:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-heading{padding-right:var(--ag-widget-horizontal-spacing)}.ag-filter-card-expand{align-items:center;display:flex;flex-direction:row;width:100%}.ag-filter-card-title{font-weight:var(--ag-header-font-weight);overflow:hidden;text-overflow:ellipsis}.ag-filter-card-expand-icon{display:flex;flex:1;justify-content:end}.ag-filter-card-editing-icon{margin:0 var(--ag-spacing)}.ag-filter-card-delete-icon,.ag-filter-card-editing-icon,.ag-filter-card-expand-icon,.ag-filter-card-summary{color:var(--ag-filter-panel-card-subtle-color)}.ag-filter-card-delete-icon,.ag-filter-card-expand-icon{transition:color .25s ease-in-out}.ag-filter-card-delete-icon:hover,.ag-filter-card-expand-icon:hover,.ag-filter-card-heading:hover .ag-filter-card-expand-icon{color:var(--ag-filter-panel-card-subtle-hover-color)}.ag-filter-add-button,.ag-filter-card-delete,.ag-filter-card-expand{border-radius:var(--ag-button-border-radius)}.ag-filter-card-summary,.ag-filter-type-select{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-filter-card-delete{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-delete{margin-left:var(--ag-widget-horizontal-spacing)}.ag-filter-card-summary{margin-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-type-select{padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-add{border:0;padding:0}.ag-filter-add-button{align-items:center;display:flex;flex-direction:row;line-height:1.5;width:100%}:where(.ag-ltr) .ag-filter-add-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-add-button-label{margin-right:var(--ag-spacing)}.ag-filter-add-select{border:0;.ag-rich-select-value{border:0;padding:calc(((1.5*var(--ag-font-size) + 2*var(--ag-button-vertical-padding)) - var(--ag-input-height))/2) var(--ag-spacing)}}:where(.ag-ltr) .ag-filter-add-select{.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)!important}}:where(.ag-rtl) .ag-filter-add-select{.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)!important}}.ag-filter-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel-buttons-button{line-height:1.5}.ag-filter-panel .ag-filter-panel-buttons-apply-button{background-color:var(--ag-filter-panel-apply-button-background-color);color:var(--ag-filter-panel-apply-button-color)}.ag-filter-panel-buttons:where(:last-child),.ag-filter-panel-container:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-panel .ag-set-filter-body-wrapper,.ag-filter-panel .ag-simple-filter-body-wrapper{padding-bottom:var(--ag-widget-container-vertical-padding)}",OC=class extends aR{constructor(){super();this.registerCSS(vC)}init(G){if(!this.gos.get("enableFilterHandlers")){eR(282);return}let D=this.beans.filterPanelSvc;D.isActive=!0,this.addDestroyFunc(()=>{D.isActive=!1}),this.updateParams(G,G.initialState);let z=this.createManagedBean(new bC);this.filterPanel=z;let B=(Q)=>{z.refresh(Q),G.onStateUpdated()};B(),this.addManagedListeners(D,{filterPanelStatesChanged:B,filterPanelStateChanged:B})}getGui(){return this.filterPanel?.getGui()}refresh(G){return this.updateParams(G,G.initialState),!0}updateParams(G,D){this.beans.filterPanelSvc?.updateParams(G,D)}getState(){return this.beans.filterPanelSvc?.getGridState()??{}}},z8={moduleName:"FiltersToolPanel",version:j,userComponents:{agFiltersToolPanel:TR},icons:{filtersToolPanel:"filter"},dependsOn:[jD,i,G8]},B8={moduleName:"NewFiltersToolPanel",version:j,userComponents:{agNewFiltersToolPanel:OC},beans:[cR,rR],icons:{filterAdd:"filter-add",filtersToolPanel:"filter",richSelectOpen:"small-down",richSelectRemove:"cancel",richSelectLoading:"loading",filterCardExpand:"chevron-down",filterCardCollapse:"chevron-up",filterCardEditing:"edit"},dependsOn:[jD,i,G8]},Q8=class extends xC{constructor(){super(...arguments);this.loadRowDataVersion=0}wireBeans(G){this.environment=G.environment}init(G,D){if(this.params=D,this.comp=G,D.pinned!=null)return;this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)})}onFullWidthRowFocused(G){let D=this.params,z={rowIndex:D.node.rowIndex,rowPinned:D.node.rowPinned},B={rowIndex:G.rowIndex,rowPinned:G.rowPinned};if(!iC(z,B))return;hC(this.comp.getGui(),G.fromBelow)}setAutoHeightClasses(){let G=this.gos.get("detailRowAutoHeight"),D=G?"ag-details-row-auto-height":"ag-details-row-fixed-height",z=G?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",B=this.comp;B.toggleCss(D,!0),B.toggleDetailGridCss(z,!0)}setupRefreshStrategy(){let G=this.params.refreshStrategy;if(G=="everything"||G=="nothing"||G=="rows"){this.refreshStrategy=G;return}if(G!=null)n0(170,{providedStrategy:G});this.refreshStrategy="rows"}createDetailGrid(){let{params:G,gos:D}=this;if(nC(G.detailGridOptions)){n0(171);return}let z=D.get("theme"),B=G.detailGridOptions.theme;if(B&&B!==z)n0(267);let Q={themeStyleContainer:this.environment.eStyleContainer,...G.detailGridOptions,theme:z};if(D.get("detailRowAutoHeight"))Q.domLayout="autoHeight";this.comp.setDetailGrid(Q)}registerDetailWithMaster(G){let{params:D,beans:{selectionSvc:z,findSvc:B,expansionSvc:Q}}=this,J=D.node.id,U=D.api,Z={id:J,api:G},S=D.node;if(U.isDestroyed())return;U.addDetailGridInfo(J,Z),S.detailGridInfo=Z;let X=S.parent;B?.registerDetailGrid(S,G);function Y(){if(X)z?.refreshMasterNodeState(X)}function W({source:H}){if(H==="expandAll")return G.expandAll();if(H==="collapseAll")return G.collapseAll()}function q({node:H,source:_}){if(H!==X||_==="masterDetail"||G.isDestroyed())return;z?.setDetailSelectionState(X,D.detailGridOptions,G)}G.addEventListener("firstDataRendered",()=>{if(G.isDestroyed()||U.isDestroyed())return;z?.setDetailSelectionState(X,D.detailGridOptions,G),G.addEventListener("selectionChanged",Y),U.addEventListener("rowSelected",q);let _=`${"CsrmSsrmSharedApi"}Module`;if(G.isModuleRegistered(_))U.addEventListener("expandOrCollapseAll",W),Q?.setDetailsExpansionState(G)}),this.addManagedListeners(X,{masterChanged:(H)=>{if(!H.node.master)this.onDestroy(Z)}}),this.addDestroyFunc(()=>this.onDestroy(Z))}onDestroy(G){let{params:D}=this,z=D.node,B=D.api;if(z.detailGridInfo!==G)return;if(!B.isDestroyed())B.removeDetailGridInfo(z.id);z.detailGridInfo=null}loadRowData(){this.loadRowDataVersion++;let G=this.loadRowDataVersion,D=this.params;if(D.detailGridOptions?.rowModelType==="serverSide"){D.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}let z=D.getDetailRowData;if(!z){n0(172);return}let B=(J)=>{if(this.loadRowDataVersion===G)this.comp.setRowData(J)},Q={node:D.node,data:D.node.data,successCallback:B,context:cC(this.gos,{}).context};z(Q)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},dC=class{constructor(G){this.parentWrapper=G}wrap(G,D,z,B){return this.parentWrapper.wrap(G,D,z,B)}},lC={tag:"div",cls:"ag-details-row"},pC={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},mC=class extends jC{constructor(){super(...arguments);this.eDetailGrid=PC}wireBeans(G){this.context=G.context}init(G){this.params=G,this.selectAndSetTemplate();let D={toggleCss:(z,B)=>this.toggleCss(z,B),toggleDetailGridCss:(z,B)=>this.eDetailGrid.classList.toggle(z,B),setDetailGrid:(z)=>this.setDetailGrid(z),setRowData:(z)=>this.setRowData(z),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new Q8),this.ctrl.init(D,G)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){let G=this.params;if(G.pinned){this.setTemplate(lC);return}let D=()=>{this.setTemplate(pC)};if(TC(G.template))D();else if(typeof G.template==="string")this.setTemplate(G.template,[]);else if(typeof G.template==="function"){let z=G.template,B=z(G);this.setTemplate(B,[])}else V2(168),D();if(this.eDetailGrid==null)V2(169)}setDetailGrid(G){if(!this.eDetailGrid)return;let D=this.context.getBean("frameworkCompWrapper"),z=new dC(D),{frameworkOverrides:B}=this.beans,Q=yC(this.eDetailGrid,G,{frameworkOverrides:B,providedBeanInstances:{frameworkCompWrapper:z},modules:gC(this.params.api.getGridId(),G.rowModelType??"clientSide")});this.detailApi=Q,this.ctrl?.registerDetailWithMaster(Q),this.addDestroyFunc(()=>{Q.destroy()})}setRowData(G){this.detailApi?.setGridOption("rowData",G)}};function dB(G,D){let z=G.masterDetailSvc?.store;return z?D(z):void 0}function tC(G,D,z){dB(G,(B)=>{B[D]=z})}function sC(G,D){dB(G,(z)=>{delete z[D]})}function oC(G,D){return dB(G,(z)=>z[D])}function rC(G,D){dB(G,(z)=>{let B=0;Object.values(z).forEach((Q)=>{if(Q)D(Q,B++)})})}var aC=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}",QV=class extends eC{constructor(){super(...arguments);this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){let G=this.gos;if(b2(G))this.enabled=this.isEnabled();if(v2(G))this.addEventListeners()}addEventListeners(){let G=(B)=>{this.setMaster(B.node,!1,!0)},D,z=()=>{if(D){for(let B of D)B();D=void 0}if(this.isEnabled())D=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:G})};z(),this.gos.addPropertyEventListener("masterDetail",z)}refreshModel(G){if(G.changedProps){let D=this.isEnabled();if(this.enabled!==D){this.setMasters(null);return}}if(G.rowDataUpdated)this.setMasters(G.changedRowNodes)}setMaster(G,D,z){let B=G.master,Q=this.isEnabled(),J=Q,U=this.gos,Z=U.get("isRowMaster"),S=U.get("treeData");if(Q)if(D||z){if(Z){let X=G.data;J=!!X&&!!Z(X)}}else J=B;if(!S){if(J&&D||!J&&B)G._expanded??(G._expanded=null)}if(J!==B)G.master=J,G.dispatchRowEvent("masterChanged")}setMasters(G){if(this.enabled=this.isEnabled(),G){for(let D of G.updates)this.setMaster(D,!1,!0);for(let D of G.adds)this.setMaster(D,!0,!1)}else{let D=zV(this.beans)?.rootNode?._leafs;if(D)for(let z=0,B=D.length;z{let U=D.clientHeight;if(U!=null&&U>0){let Z=()=>{let{rowModel:S}=this.beans,{rowNode:X}=G;if(X.setRowHeight(U),b2(z,S)||v2(z,S))S.onRowHeightChanged()};window.setTimeout(Z,0)}},J=BV(B,D,Q);G.addDestroyFunc(J),Q()}destroy(){this.store={},super.destroy()}},JV={moduleName:"SharedMasterDetail",version:j,beans:[QV],userComponents:{agDetailCellRenderer:mC},dynamicBeans:{detailCellRendererCtrl:Q8},apiFunctions:{addDetailGridInfo:tC,removeDetailGridInfo:sC,getDetailGridInfo:oC,forEachDetailGridInfo:rC},dependsOn:[i,p7,RJ],css:[aC]},lB={moduleName:"MasterDetail",version:j,dependsOn:[JV,_0,uC]},J8=class extends _V{constructor(){super(...arguments);this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:(G)=>{let D=!1;if(!this.dragging)D=!0,this.dragging=!0,u2(this.beans).classList?.add(this.getDraggingCssClass());if(this.updateValuesOnMove(G),D){this.changedCalculatedValues=!1;return}if(this.beans.rangeSvc.autoScrollService.check(G),this.changedCalculatedValues)this.onDrag(G),this.changedCalculatedValues=!1},onDragStop:(G)=>{this.dragging=!1,this.onDragEnd(G),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:j2,mousedown:j2})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(G){let D=wV(this.gos,G);if(!D||this.shouldSkipCell(D)||this.lastCellHovered&&kV(D,this.lastCellHovered))return;this.lastCellHovered=D,this.changedCalculatedValues=!0}clearDragProperties(){if(this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),u2(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging)this.destroy()}getType(){return this.type}refresh(G,D){let z=this.cellCtrl,B=this.getGui(),Q=D??NV(this.beans.rangeSvc.getCellRanges()),J=Q.startRow,U=Q.endRow;if(J&&U)if(KV(U,J))this.rangeStartRow=U,this.rangeEndRow=J;else this.rangeStartRow=J,this.rangeEndRow=U;if(z!==G||!fV(B)){this.cellCtrl=G;let Z=G.comp.getParentOfValue();if(Z)Z.appendChild(B)}this.cellRange=Q}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){FV(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(G){if(!this.cellRange)return;let{id:D,type:z}=this.cellRange;if(!D||D!==G.id)return;let B=this.beans.rangeSvc?.getCellRanges().find((Q)=>Q.id===D&&Q.type===z);if(B&&B!==this.cellRange)this.cellRange=B}},j2=(G)=>{G.stopPropagation()};function EV(G){let D=G.length,z=0;if(D<=1)return G;for(let W=0;W1){z=Math.max(z,parseInt(H[1],10));continue}if(Math.floor(q)===q)continue;z=Math.max(z,q.toString().split(".")[1].length)}let B=0,Q=0,J=0,U=0,Z=0;for(let W=0;WU?"x":"y";else S=Z;if(S!==this.dragAxis)this.dragAxis=S,this.changedCalculatedValues=!0}shouldSkipCell(G){return HV(G.column)}onDrag(G){if(!this.initialPosition){let z=this.cellCtrl;if(!z)return;this.initialPosition=z.cellPosition}let D=this.getLastCellHovered();if(D)this.markPathFrom(this.initialPosition,D)}onDragEnd(G){if(this.initialXY=null,!this.markedCells.length)return;let D=this.dragAxis==="x",{cellRange:z,rangeStartRow:B,rangeEndRow:Q,beans:{rangeSvc:J}}=this,U=z.columns.length,Z;if(!this.isUp&&!this.isLeft)Z=J.createCellRangeFromCellRangeParams({rowStartIndex:B.rowIndex,rowStartPinned:B.rowPinned,columnStart:z.columns[0],rowEndIndex:D?Q.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:D?Q.rowPinned:this.lastCellMarked.rowPinned,columnEnd:D?this.lastCellMarked.column:z.columns[U-1]});else{let S=D?B:this.lastCellMarked;Z=J.createCellRangeFromCellRangeParams({rowStartIndex:S.rowIndex,rowStartPinned:S.rowPinned,columnStart:D?this.lastCellMarked.column:z.columns[0],rowEndIndex:Q.rowIndex,rowEndPinned:Q.rowPinned,columnEnd:z.columns[U-1]})}if(Z)this.performFill({event:G,initialRange:z,finalRange:Z,shouldUpdateRange:!0})}onDragCancel(){if(this.initialXY=null,!this.markedCells.length)return;this.clearMarkedPath()}performFill({event:G,initialRange:D,finalRange:z,shouldUpdateRange:B}){let{eventSvc:Q,rangeSvc:J}=this.beans;if(Q.dispatchEvent({type:"fillStart"}),this.handleValueChanged(D,z,G),B)J.setCellRanges([z]);Q.dispatchEvent({type:"fillEnd",initialRange:D,finalRange:z})}getFillHandleDirection(){let G=$1(this.gos)?.direction;if(!G)return"xy";if(G!=="x"&&G!=="y"&&G!=="xy")return qV(177),"xy";return G}handleValueChanged(G,D,z){let{beans:B}=this,{rangeSvc:Q,gos:J,valueSvc:U}=B,Z=Q.getRangeEndRow(G),S=Q.getRangeStartRow(G),X=Q.getRangeEndRow(D),Y=Q.getRangeStartRow(D),W=this.dragAxis==="y";if(this.isReduce&&!$1(J)?.suppressClearOnFillReduction){let I=W?G.columns:G.columns.filter((A)=>D.columns.indexOf(A)<0),V=W?xz(B,X):Y;if(V)this.clearCellsInRange(V,Z,I);return}let q=[],H=[],_=[],k=[],w=!0,K=0,f=()=>{q.length=0,H.length=0,_.length=0,k.length=0,K=0},N=(I,V)=>{let A=this.isUp?Z:S,R=!1;if(W)w=!0,f();while(!R&&A){let O=SV(B,A);if(!O)break;if(W&&I)F(q,I,O,()=>!FG(A,this.isUp?S:Z));else if(V){w=!0,f();for(let u of V)F(q,u,O,()=>u!==(this.isLeft?G.columns[0]:tD(G.columns)))}R=FG(A,this.isUp?Y:X),A=this.isUp?L1(this.beans,A):xz(B,A)}},F=(I,V,A,R)=>{let O,u=!1;if(w)O=U.getValue(V,A,"edit"),H.push(O),_.push(U.getValue(V,A,"edit",!0)),k.push(U.getValueForDisplay({column:V,node:A,from:"edit"}).valueFormatted),w=R();else{let{value:v,fromUserFunction:h,sourceCol:P,sourceRowNode:b}=this.processValues({event:z,values:I,initialValues:H,initialNonAggregatedValues:_,initialFormattedValues:k,col:V,rowNode:A,idx:K++});if(O=v,V.isCellEditable(A)){let g=U.getValue(V,A,"edit");if(!h){if(P){let c=P.getColDef();if(c.useValueFormatterForExport!==!1&&c.valueFormatter){let s=U.getValueForDisplay({column:P,node:b,includeValueFormatted:!0,from:"edit"}).valueFormatted;if(s!=null)O=s}}if(V.getColDef().useValueParserForImport!==!1)O=U.parseValue(V,A,P?O:WV(O),g)}if(!h||g!==O)A.setDataValue(V,O,"rangeSvc");else u=!0}}if(!u)I.push({value:O,column:V,rowNode:A})},{changeDetectionSvc:E}=this.beans;E?.beginDeferred();try{if(W)G.columns.forEach((I)=>{N(I)});else{let I=this.isLeft?[...D.columns].reverse():D.columns;N(void 0,I)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{E?.endDeferred()}}clearCellsInRange(G,D,z){let B={startRow:G,endRow:D,columns:z,startColumn:z[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[B],restoreSourceInBatch:!0})}processValues(G){let{formula:D,valueSvc:z}=this.beans,{event:B,values:Q,initialValues:J,initialNonAggregatedValues:U,initialFormattedValues:Z,col:S,rowNode:X,idx:Y}=G,W=$1(this.gos)?.setFillValue,q=this.dragAxis==="y",H;if(q)H=this.isUp?"up":"down";else H=this.isLeft?"left":"right";if(W){let w=$V(this.gos,{event:B,values:Q.map(({value:f})=>f),initialValues:J,initialNonAggregatedValues:U,initialFormattedValues:Z,currentIndex:Y,currentCellValue:z.getValue(S,X,"edit"),direction:H,column:S,rowNode:X}),K=W(w);if(K!==!1)return{value:K,fromUserFunction:!0}}let _=(w)=>typeof w==="number"&&Number.isFinite(w)||typeof w==="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(w.trim()),k=Q.every(({value:w})=>_(w));if(B.altKey||!k){let w=String(tD(Q)?.value??"");if(k&&J.length===1){let I=this.isUp||this.isLeft?-1:1;return{value:parseFloat(w)+1*I,fromUserFunction:!1}}let{value:K,column:f,rowNode:N}=Q[Y%Q.length],F,E=f.isAllowFormula()&&D?.isFormula(w);if(E){let I=H==="up"?-1:H==="down"?1:0,V=H==="left"?-1:H==="right"?1:0;F=D.updateFormulaByOffset({value:w,rowDelta:I,columnDelta:V})}else F=K;return{value:F,fromUserFunction:!1,sourceCol:E?void 0:f,sourceRowNode:N}}return{value:tD(EV(Q.map(({value:w})=>Number(w)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(let G of this.markedCells){if(!G.isAlive())continue;let{comp:D}=G;D.toggleCss("ag-selection-fill-top",!1),D.toggleCss("ag-selection-fill-right",!1),D.toggleCss("ag-selection-fill-bottom",!1),D.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(G,D){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(FG(D,G))return;let z=XV(D,G),{rangeStartRow:B,rangeEndRow:Q}=this;if(z&&(D.rowPinned==B.rowPinned&&D.rowIndex>=B.rowIndex||B.rowPinned!=Q.rowPinned&&D.rowPinned==Q.rowPinned&&D.rowIndex<=Q.rowIndex))this.reduceVertical(G,D),this.isReduce=!0;else this.extendVertical(G,D,z),this.isReduce=!1}else{let z=G.column,B=D.column;if(z===B)return;let Q=this.beans.visibleCols.allCols,J=Q.indexOf(z),U=Q.indexOf(B);if(U<=J&&U>=Q.indexOf(this.cellRange.columns[0]))this.reduceHorizontal(G,D),this.isReduce=!0;else this.extendHorizontal(G,D,U=4),G.toggleCss(sV,J),tV(B,Q>0?!0:void 0),G.toggleCss(oV,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){let G=this.getRangeBorders(),D=this.isSingleCell(),z=!D&&G.top,B=!D&&G.right,Q=!D&&G.bottom,J=!D&&G.left,U=this.cellComp;U.toggleCss(aV,z),U.toggleCss(eV,B),U.toggleCss(Gb,Q),U.toggleCss(Db,J)}isSingleCell(){let{rangeSvc:G}=this;return this.rangeCount===1&&!!G&&!G.isMoreThanOneCell()}getHasChartRange(){let{rangeSvc:G}=this;if(!this.rangeCount||!G)return!1;let D=G.getCellRanges();return D.length>0&&D.every((z)=>[hz.DIMENSION,hz.VALUE].includes(z.type))}updateRangeBordersIfRangeCount(){if(this.rangeCount>0)this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}getRangeBorders(){let G=this.beans.gos.get("enableRtl"),D=!1,z=!1,B=!1,Q=!1,{rangeSvc:J,beans:{visibleCols:U},cellCtrl:{cellPosition:Z}}=this,S=Z.column,X=J.getCellRanges().filter((q)=>J.isCellInSpecificRange(Z,q));if(!X.length)return{top:D,right:z,bottom:B,left:Q};let Y,W;if(G)Y=U.getColAfter(S),W=U.getColBefore(S);else Y=U.getColBefore(S),W=U.getColAfter(S);if(!Y)Q=!0;if(!W)z=!0;for(let q=0;q=0;B--){let Q=z[B],J=Q.colorClass;if(!J)continue;if(G.isCellInSpecificRange(this.cellCtrl.cellPosition,Q))return J}return null}refreshHandleColor(G){let D=this.selectionHandle?.getGui?.(),z=G?.colorClass??null;if(!D){this.handleColorClass=null;return}if(this.handleColorClass&&this.handleColorClass!==z)D.classList.remove(this.handleColorClass);if(z)D.classList.add(z);else if(this.handleColorClass)D.classList.remove(this.handleColorClass);this.handleColorClass=z??null}getRangeForHandle(){let{gos:G,editSvc:D}=this.beans,z=this.rangeSvc,B=z.getCellRanges(),Q=B.length;if(this.rangeCount<1||Q<1)return null;let J=D?.isRangeSelectionEnabledWhileEditing(),U=J?B:[pV(B)];for(let Z of U){let{cellPosition:S,column:X}=this.cellCtrl,Y=n2(G)&&!X.isSuppressFillHandle(),W=zb(G),H=!D?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(J||Q===1&&(Y||W));if(this.hasChartRange)H=Z.type===hz.VALUE;if(H&&Z.endRow!=null&&z.isContiguousRange(Z)&&z.isBottomRightCell(Z,S))return Z}return null}addSelectionHandle(G){let{beans:D}=this,z=D.editSvc?.isRangeSelectionEnabledWhileEditing(),B=G.type,J=!z&&n2(D.gos)&&mV(B)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==J)this.selectionHandle=D.context.destroyBean(this.selectionHandle);if(!this.selectionHandle){let U=D.registry.createDynamicBean(J===0?"fillHandle":"rangeHandle",!1);if(U)this.selectionHandle=D.context.createBean(U)}this.selectionHandle?.refresh(this.cellCtrl,G)}destroy(){this.unsetComp()}},Jb=class extends Qb{constructor(G){super();this.eContainer=G}postConstruct(){let{beans:G,gos:D,eContainer:z}=this,B=G.rangeSvc,Q={eElement:z,onDragStart:B.onDragStart.bind(B),onDragStop:B.onDragStop.bind(B),onDragging:B.onDragging.bind(B)},J=G.dragSvc,U=J.addDragSource.bind(J,Q),Z=J.removeDragSource.bind(J,Q);if(this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(d2(D))U();else Z()}),this.addDestroyFunc(Z),d2(D))U()}},Zb=class extends Ub{constructor(G,D){super();this.column=G,this.eGui=D}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(G)=>G&&this.onClick(G)})}onClick(G){this.beans.rangeSvc?.handleColumnSelection(this.column,G)}},Lb=class extends $b{constructor(G,D){super();this.column=G,this.comp=D,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let G;if(this.column.isColumn)G=[this.column];else G=this.column.getDisplayedLeafColumns();for(let D of G)this.columnMap.set(D,!1)}refreshActive(){let{gos:G,rangeSvc:D}=this.beans,z=G.get("cellSelection");this.isActive=!!(z&&D&&typeof z==="object"&&z.enableHeaderHighlight)}setupRangeHeaderHighlight(){let G=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:G,columnPinned:G,columnMoved:G,columnGroupOpened:G}),G()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();let G=this.beans.rangeSvc.getCellRanges(),D=!1,z=!0;for(let B of G){if(D)break;for(let Q of B.columns)if(this.columnMap.has(Q))this.columnMap.set(Q,!0),D||(D=!0)}for(let B of Array.from(this.columnMap.values()))if(B===!1){z=!1;break}this.comp.toggleCss("ag-header-range-highlight",D&&z)}destroy(){super.destroy(),this.comp=null,this.column=null}},Sb=class extends OV{constructor(){super(...arguments);this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(G){this.rowModel=G.rowModel,this.dragSvc=G.dragSvc,this.colModel=G.colModel,this.visibleCols=G.visibleCols,this.cellNavigation=G.cellNavigation,this.ctrlsSvc=G.ctrlsSvc}postConstruct(){let G=this.onColumnsChanged.bind(this),D=()=>this.removeAllCellRanges(),z=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:G,columnVisible:G,columnValueChanged:G,columnPivotModeChanged:D,columnRowGroupChanged:D,columnPivotChanged:D,columnGroupOpened:z,columnMoved:z,columnPinned:z}),this.ctrlsSvc.whenReady(this,(B)=>{let Q=B.gridBodyCtrl;this.autoScrollService=new vV({scrollContainer:Q.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>Q.scrollFeature.getVScrollPosition().top,setVerticalPosition:(J)=>Q.scrollFeature.setVerticalScrollPosition(J),getHorizontalPosition:()=>Q.scrollFeature.getHScrollPosition().left,setHorizontalPosition:(J)=>Q.scrollFeature.setHorizontalScrollPosition(J),shouldSkipVerticalScroll:()=>!iV(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!Q.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(G){if(this.rangeSelectionExtensions.includes(G))return;this.rangeSelectionExtensions.push(G)}unregisterRangeSelectionExtension(G){p0(this.rangeSelectionExtensions,G)}shouldSuppressRangeSelection(G){return this.rangeSelectionExtensions.some((D)=>D.shouldSuppressRangeSelection?.(G))}shouldSkipColumn(G){return this.rangeSelectionExtensions.some((D)=>D.shouldSkipColumn?.(G))}isAllColumnsSelectionCell(G){return this.rangeSelectionExtensions.some((D)=>D.isAllColumnsSelectionCell?.(G))}isAllColumnsRange(G,D){return this.rangeSelectionExtensions.some((z)=>z.isAllColumnsRange?.(G,D))}updateSelectionModeForCell(G){this.setSelectionMode(this.isAllColumnsSelectionCell(G))}onDragStart(G){let D=this.gos,z=G.target;if(!l0(D)||yV(D,z)?.isSuppressMouseEvent(G))return;if(this.shouldSuppressRangeSelection(z))return;let{shiftKey:B}=G,Q=this.isMultiRange(G),J=B&&!!this.cellRanges?.length;if(!Q&&(!J||PV(DG(this.cellRanges).type)))this.removeAllCellRanges(!0);let U=this.dragSvc.startTarget;if(U)this.updateValuesOnMove(U);if(!this.lastCellHovered)return;if(this.dragging=!0,this.lastMouseEvent=G,this.intersectionRange=Q&&this.getCellRangeCount(this.lastCellHovered)>1,!J)this.setNewestRangeStartCell(this.lastCellHovered);if(this.cellRanges.length>0)this.draggingRange=DG(this.cellRanges);else{let Z={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},S=this.getColumnsFromModel([this.lastCellHovered.column]);if(!S?.length)return;this.draggingRange={startRow:Z,endRow:Z,columns:S,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}onDragging(G){let{dragging:D,lastCellHovered:z,newestRangeStartCell:B,autoScrollService:Q,cellHasChanged:J}=this;if(!D||!G)return;this.updateValuesOnMove(G.target),this.lastMouseEvent=G;let U=(H)=>z&&z.rowPinned===H&&B.rowPinned===H,Z=U("top")||U("bottom");if(Q.check(G,Z),!J||!z)return;let S=B?.column,X=z?.column,Y=this.calculateColumnsBetween(S,X);if(!Y)return;let{rowIndex:W,rowPinned:q}=z;this.draggingRange.endRow={rowIndex:W,rowPinned:q},this.draggingRange.columns=Y,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;let{id:G}=this.draggingRange;if(this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange)this.intersectionRange=!1,this.intersectLastRange();this.dispatchChangedEvent(!1,!0,G)}onColumnsChanged(){this.refreshLastRangeStart();let G=this.visibleCols.allCols;for(let z of this.cellRanges){let B=z.columns;if(z.columns=z.columns.filter((J)=>J.isVisible()&&G.indexOf(J)!==-1),!y2(B,z.columns))this.dispatchChangedEvent(!1,!0,z.id)}let D=this.cellRanges.length;if(this.cellRanges=this.cellRanges.filter((z)=>z.columns.length>0),D>this.cellRanges.length)this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){let G=DG(this.cellRanges);if(!G)return;this.refreshRangeStart(G)}isContiguousRange(G){let D=G.columns;if(!D.length)return!1;let z=this.visibleCols.allCols,B=D.map((Q)=>z.indexOf(Q)).sort((Q,J)=>Q-J);return DG(B)-B[0]+1===D.length}getRangeStartRow(G){if(G.startRow&&G.endRow)return XG(G.startRow,G.endRow)?G.startRow:G.endRow;return{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(G){if(G.startRow&&G.endRow)return XG(G.startRow,G.endRow)?G.endRow:G.startRow;let D=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;if(D>0)return{rowIndex:D-1,rowPinned:"bottom"};return{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(G){let D=this.beans,z=this.getRangeStartRow(G),B=this.getRangeEndRow(G),Q=x2(D,z);return x2(D,B)-Q+1}handleCellMouseDown(G,D){let z=G.ctrlKey||G.metaKey;this.handleCellSelectionInput(D,{target:G.target,shiftKey:G.shiftKey,isRightClick:hV(this.beans,G),isMultiRange:this.isMultiRange(G),isMultiKey:z,preventDefault:()=>G.preventDefault()})}handleCellKeyboardSelect(G,D){let z=G.ctrlKey||G.metaKey;this.handleCellSelectionInput(D,{target:G.target,shiftKey:G.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState(z),isMultiKey:z,preventDefault:()=>G.preventDefault()})}handleCellSelectionInput(G,D){let{target:z,shiftKey:B,isRightClick:Q,isMultiRange:J,isMultiKey:U,preventDefault:Z}=D;if(this.shouldSuppressRangeSelection(z))return;let S=this.isAllColumnsSelectionCell(G);if(S)Z();if(B)return this.extendLatestRangeToCell(G);if(S&&Q)return;this.updateSelectionModeForCell(G);let X=this.calculateColumnsBetween(G.column,G.column);if(!X)return;let Y=S?this.findContainingRange({columns:X,startRow:G,endRow:G}):void 0;if(S&&!!Y&&J&&U&&Y)this.removeRowFromAllColumnsRange(G,Y);else this.setRangeToCell(G,J)}isMultiRange(G){return this.isMultiRangeForKeyState(G.ctrlKey||G.metaKey)}isMultiRangeForKeyState(G){let{editingWithRanges:D,allowMulti:z}=this.getMultiRangeContext();return D||(z?G:!1)}getMultiRangeContext(){let{gos:G,editSvc:D}=this.beans,z=!!D?.isEditing()&&!!D?.isRangeSelectionEnabledWhileEditing(),B=cV(G)&&!z;return{editingWithRanges:z,suppressMultiRanges:B,allowMulti:!B}}removeRowFromAllColumnsRange(G,D){let{beans:z,cellRanges:B}=this,Q=S1(z),J=X1(z),U=this.getRangeStartRow(D),Z=this.getRangeEndRow(D);if(!U&&CG(Q,G))m0(D,sD(z,Q),"top");else if(!Z&&CG(J,G))m0(D,cz(z,J),"bottom");else if(CG(U,Z))p0(B,D);else if(CG(U,G))m0(D,sD(z,G),"top");else if(CG(Z,G))m0(D,cz(z,G),"bottom");else{let S=cz(z,G),X=sD(z,G);D.startRow=U,D.endRow=S??void 0,B.push({...D,startRow:X??void 0,endRow:Z})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(G,D=!1){let{gos:z}=this;if(!l0(z))return;this.updateSelectionModeForCell(G);let B=this.calculateColumnsBetween(G.column,G.column);if(!B)return;let{suppressMultiRanges:Q}=this.getMultiRangeContext();if(Q||!D||dV(this.cellRanges))this.removeAllCellRanges(!0);let J={rowIndex:G.rowIndex,rowPinned:G.rowPinned},U={startRow:J,endRow:J,columns:B,startColumn:G.column},Z=this.ensureRangeStartColumn(U);if(!Z)return;this.cellRanges.push(U),this.setNewestRangeStartCell({...G,column:Z}),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(G){let D=G.columns[0],z=DG(G.columns);return this.newestRangeStartCell?.column===D?z:D}extendRangeRowCountBy(G,D){let{beans:z}=this,{startRow:B,endRow:Q}=G;if(!B||!Q)return;let J=0,U,Z=XG(Q,B);if(Z)U=B;else U=Q;let S=D>0?sD:cz,X=Math.abs(D);while(JD.indexOf(B)).filter((B)=>B>-1).sort((B,Q)=>B-Q);return{left:D[z[0]],right:D[DG(z)]}}extendLatestRangeInDirection(G){if(this.isEmpty()||!this.newestRangeStartCell)return;let D=G.key,z=G.ctrlKey||G.metaKey,B=DG(this.cellRanges),Q=this.newestRangeStartCell,J=B.endRow.rowIndex,U=B.endRow.rowPinned,S={column:this.getRangeLastColumn(B),rowIndex:J,rowPinned:U},X=this.cellNavigation.getNextCellToFocus(D,S,z);if(!X)return;if(this.shouldSkipColumn(X.column))return;return this.setCellRange({rowStartIndex:Q.rowIndex,rowStartPinned:Q.rowPinned,rowEndIndex:X.rowIndex,rowEndPinned:X.rowPinned,columnStart:Q.column,columnEnd:X.column}),X}setCellRange(G){if(!l0(this.gos))return;this.removeAllCellRanges(!0),this.addCellRange(G)}setCellRanges(G){if(y2(this.cellRanges,G))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);let D=this.getColumnsFromModel(this.visibleCols.allCols)??[],z=!1;for(let B of G){if(B.columns&&B.startRow){let Q=this.getColumnsFromModel(B.columns);if(!Q||Q.length===0)continue;B.columns=Q;let{startRow:J}=B;this.setNewestRangeStartCell({rowIndex:J.rowIndex,rowPinned:J.rowPinned,column:B.columns[0]})}if(!z&&D.length>0&&this.isAllColumnsRange(B,D))z=!0;this.cellRanges.push(B)}this.setSelectionMode(z),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(G){let{beans:D,eventSvc:z}=this,{cellEventSource:B="rangeSvc",dispatchWrapperEvents:Q,wrapperEventSource:J="deleteKey",restoreSourceInBatch:U}=G,{cellRanges:Z}=G;if(Q)z.dispatchEvent({type:"cellSelectionDeleteStart",source:J}),z.dispatchEvent({type:"rangeDeleteStart",source:J});if(!Z)Z=this.cellRanges;let{valueSvc:S,editSvc:X}=D,Y=!!X?.isBatchEditing(),{changeDetectionSvc:W}=D;W?.beginDeferred();try{this.forEachEditableCellInRanges(Z,(q,H)=>{if(U&&Y){X?.batchResetToSourceValue({rowNode:q,column:H});return}let _=S.getDeleteValue(H,q);q.setDataValue(H,_,B)})}finally{W?.endDeferred()}if(Q)z.dispatchEvent({type:"cellSelectionDeleteEnd",source:J}),z.dispatchEvent({type:"rangeDeleteEnd",source:J})}createCellRangeFromCellRangeParams(G){return this.createPartialCellRangeFromRangeParams(G,!1)}createPartialCellRangeFromRangeParams(G,D){let{columns:z,columnStart:B,columnEnd:Q,rowStartIndex:J,rowStartPinned:U,rowEndIndex:Z,rowEndPinned:S}=G,X=this.getColumnsFromParams(z,B,Q);if(!X||!D&&X.columns.length===0)return;let{columns:Y,startsOnTheRight:W}=X,q=l2(J,U),H=l2(Z,S);return{startRow:q,endRow:H,columns:Y,startColumn:this.getColumnFromModel(B)??(W?DG(Y):Y[0])}}addCellRange(G){let D=this.gos;if(!l0(D)||!this.verifyCellRanges(D))return;this.setSelectionMode(!1);let z=this.createCellRangeFromCellRangeParams(G);if(z){if(z.startRow)this.setNewestRangeStartCell({rowIndex:z.startRow.rowIndex,rowPinned:z.startRow.rowPinned,column:z.startColumn});return this.cellRanges.push(z),this.dispatchChangedEvent(!1,!0,z.id),z}}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){let G=this.cellRanges.length;if(G===0)return!1;if(G>1)return!0;let D=this.cellRanges[0],z=this.getRangeStartRow(D),B=this.getRangeEndRow(D);return z.rowPinned!==B.rowPinned||z.rowIndex!==B.rowIndex||D.columns.length!==1}areAllRangesAbleToMerge(){let G=new Map;if(this.cellRanges.length<=1)return!0;for(let B of this.cellRanges)this.forEachRowInRange(B,(Q)=>{let J=`${Q.rowPinned||"normal"}_${Q.rowIndex}`,U=G.get(J),Z=B.columns.map((S)=>S.getId());if(U){let S=Z.filter((X)=>U.indexOf(X)===-1);U.push(...S)}else G.set(J,Z)});let z;for(let B of G.values()){let Q=B.sort().join();if(z===void 0){z=Q;continue}if(z!==Q)return!1}return!0}removeAllCellRanges(G){if(this.isEmpty())return;if(this.onDragStop(),this.cellRanges.length=0,!G)this.dispatchChangedEvent(!1,!0)}isCellInAnyRange(G){return this.getCellRangeCount(G)>0}isCellInSpecificRange(G,D){let z=D.columns?.includes(G.column),B=this.isRowInRange(G,D);return z&&B}isColumnInAnyRange(G){let{beans:D}=this,z=S1(D),B=X1(D);if(!z||!B)return!1;let Q=G.isColumn?[G]:G.getDisplayedLeafColumns();return this.findContainingRange({columns:Q,startRow:z,endRow:B},!0)!=null}findContainingRange({columns:G,startRow:D,endRow:z},B=!1){let Q=this.cellRanges;for(let J=Q.length-1;J>=0;J--){let U=Q[J],Z=G.every((X)=>U.columns.includes(X)),S=!1;if(B)S=CG(U.startRow,D)&&CG(U.endRow,z);else{let X=D&&this.isRowInRange(D,U),Y=z&&this.isRowInRange(z,U);S=!!X&&!!Y}if(Z&&S)return U}}isBottomRightCell(G,D){let z=this.visibleCols.allCols,B=G.columns.map((X)=>z.indexOf(X)).sort((X,Y)=>X-Y),{startRow:Q,endRow:J}=G,U=XG(Q,J)?J:Q,Z=z.indexOf(D.column)===DG(B),S=D.rowIndex===U.rowIndex&&c2(D.rowPinned)===c2(U.rowPinned);return Z&&S}getCellRangeCount(G){return this.cellRanges.filter((D)=>this.isCellInSpecificRange(G,D)).length}isRowInRange(G,D){let z=this.getRangeStartRow(D),B=this.getRangeEndRow(D),Q=CG(G,z),J=CG(G,B);if(Q||J)return!0;let U=!XG(G,z),Z=XG(G,B);return U&&Z}intersectLastRange(G){let{editingWithRanges:D,suppressMultiRanges:z}=this.getMultiRangeContext();if(D||z||G&&this.dragging||this.isEmpty())return;let B=DG(this.cellRanges),Q=this.getRangeStartRow(B),J=this.getRangeEndRow(B),U=[];for(let Z of this.cellRanges.slice(0,-1)){let S=this.getRangeStartRow(Z),X=this.getRangeEndRow(Z),Y=Z.columns,W=Y.filter((H)=>B.columns.indexOf(H)===-1);if(W.length===Y.length){U.push(Z);continue}if(XG(J,S)||XG(X,Q)){U.push(Z);continue}let q=U.length;if(XG(S,Q)){let H={columns:[...Y],startColumn:B.startColumn,startRow:{...S},endRow:cz(this.beans,Q)};U.push(H)}if(W.length>0){let H={columns:W,startColumn:W.includes(B.startColumn)?B.startColumn:W[0],startRow:Xb([{...Q},{...S}]),endRow:Yb([{...J},{...X}])};U.push(H)}if(XG(J,X))U.push({columns:[...Y],startColumn:B.startColumn,startRow:sD(this.beans,J),endRow:{...X}});if(U.length-q===1)U[U.length-1].id=Z.id}if(this.cellRanges=U,G)this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(G,D,z){G.createManagedBean(new Lb(D,z))}setSelectionMode(G){this.selectionMode=G?1:0}refreshRangeStart(G){let{columns:D}=G,z=this.ensureRangeStartColumn(G);if(!z)return;let B=(S,X)=>{let Y=G.columns.filter((W)=>W!==S);if(S)G.startColumn=S,G.columns=X?[S,...Y]:[...Y,S];else G.columns=Y},{left:Q,right:J}=this.getRangeEdgeColumns(G);if(z===D[0]&&z!==Q){B(Q,!0);return}if(z===DG(D)&&z===J)B(J,!1)}setNewestRangeStartCell(G){this.newestRangeStartCell=G}getColumnsFromParams(G,D,z){let B=!G&&!D&&!z,Q,J=!1;if(B||G)Q=this.getColumnsFromModel(B?void 0:G);else if(D&&z){if(Q=this.calculateColumnsBetween(D,z),Q?.length)J=Q[0]!==this.getColumnFromModel(D)}return Q?{columns:Q,startsOnTheRight:J}:void 0}verifyCellRanges(G){let{suppressMultiRanges:D}=this.getMultiRangeContext(),z=nV(G)&&D&&this.cellRanges.length>1;if(z)Y1(93);return!z}forEachRowInRange(G,D){let z=this.getRangeStartRow(G),B=this.getRangeEndRow(G),Q=z;while(Q){if(D(Q),CG(Q,B))break;Q=sD(this.beans,Q)}}forEachEditableCellInRanges(G,D){let{beans:z}=this;for(let B of G)this.forEachRowInRange(B,(Q)=>{let J=xV(z,Q);if(!J)return;for(let U=0;U0,X=D.ctrlKey||D.metaKey,Y=!Z||X,W=S1(B),q=X1(B);if(!W||!q)return;if(D.key===uV.ENTER)D.preventDefault();if(D.shiftKey){let _=Q.root;if(!_)return;let k=G.isColumn?G:DG(G.getLeafColumns()),w=this.findContainingRange({columns:[_],startRow:W,endRow:q},!0);if(!w){p0(J,Q.lastCellRange),this.selectColumns(this.calculateColumnsBetween(_,k),W,q);return}this.updateRangeRowBoundary({cellRange:w,boundary:"end",cellPosition:{column:k,...q}});return}if(S&&(U||!X&&!Z))this.removeAllCellRanges(!0);let H=(_,k)=>{let w=this.findContainingRange({columns:_,startRow:W,endRow:q},!0);if(w&&Y)this.deselectColumnsFromRange(w,_);else{let K=this.selectColumns(_,W,q);if(K)Q.lastCellRange=K}Q.root=k};if(G.isColumn)H([G],G);else{let _=G.getDisplayedLeafColumns();H(_,_[0])}}deselectColumnsFromRange(G,D){if(lV(G.columns,D),D.includes(G.startColumn))G.startColumn=G.columns[0];if(G.columns.length===0)p0(this.cellRanges,G);this.dispatchChangedEvent(!0,!0)}selectColumns(G,D,z){return this.addCellRange({columns:G,columnStart:G[0],columnEnd:DG(G),rowStartIndex:D.rowIndex,rowStartPinned:D.rowPinned,rowEndIndex:z.rowIndex,rowEndPinned:z.rowPinned})}};function l2(G,D){return G!=null?{rowIndex:G,rowPinned:D}:void 0}function Xb(G){let D;for(let z of G)if(D===void 0||XG(D,z))D=z;return D}function Yb(G){let D;for(let z of G)if(D===void 0||XG(z,D))D=z;return D}function Wb(G,D){let{startRow:z,endRow:B}=G,Q=XG(z,B)?B:z,J=D.rowIndex===Q.rowIndex&&D.rowPinned===Q.rowPinned,U=G.columns[0],Z=DG(G.columns),S=G.startColumn===U?Z:U;return D.column===S&&J}function m0(G,D,z){let B;if(z==="top")B=!G.startRow||!G.endRow||XG(G.startRow,G.endRow)?"startRow":"endRow";else B=!G.startRow||!G.endRow||XG(G.startRow,G.endRow)?"endRow":"startRow";G[B]=D??void 0}var Xz={moduleName:"CellSelection",version:j,beans:[Sb],dynamicBeans:{fillHandle:MV,rangeHandle:RV},apiFunctions:{getCellRanges:VV,addCellRange:bV,clearRangeSelection:T2,clearCellSelection:T2},dependsOn:[i,ZV,UV],css:[CV]},qb={moduleName:"RangeSelection",version:j,dependsOn:[Xz]},Ib={tag:"div",cls:"ag-loading",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},Mb=class extends Fb{constructor(){super(Ib);this.eLoadingIcon=p2,this.eLoadingText=p2}init(G){if(G.node.failedLoad)this.setupFailed();else this.setupLoading()}setupFailed(){this.eLoadingText.textContent=this.getLocaleTextFunc()("loadingError","ERR")}setupLoading(){let G=Eb("groupLoading",this.beans,null);if(G)this.eLoadingIcon.appendChild(G);this.eLoadingText.textContent=this.getLocaleTextFunc()("loadingOoo","Loading...")}refresh(G){return!1}},Ab={moduleName:"LoadingCellRenderer",version:j,userComponents:{agLoadingCellRenderer:Mb},icons:{groupLoading:"loading"},dependsOn:[i]};function Cb(G){return G.colModel.isPivotMode()}function Vb(G,D,z){return G.pivotResultCols?.lookupPivotResultCol(D,z)??null}function bb(G,D){G.valueColsSvc?.setColumns(D,"api")}function vb(G){return G.valueColsSvc?.columns??[]}function Ob(G,D){G.valueColsSvc?.removeColumns(D,"api")}function ub(G,D){G.valueColsSvc?.addColumns(D,"api")}function jb(G,D){G.pivotColsSvc?.setColumns(D,"api")}function Pb(G,D){G.pivotColsSvc?.removeColumns(D,"api")}function gb(G,D){G.pivotColsSvc?.addColumns(D,"api")}function Tb(G){return G.pivotColsSvc?.columns??[]}function yb(G,D){G.pivotResultCols?.setPivotResultCols(D,"api")}function xb(G){let D=G.pivotResultCols?.getPivotResultCols();return D?D.list:null}var m2="PivotRowTotal_",hb=({headerName:G},{headerName:D})=>{if(G&&!D)return 1;else if(!G&&D)return-1;else if(!G&&!D)return 0;if(GD)return 1;else return 0},ib=(G)=>(D,z)=>G(D.headerName,z.headerName),nb=class extends cb{constructor(){super(...arguments);this.beanName="pivotColDefSvc"}wireBeans(G){this.colModel=G.colModel,this.pivotColsSvc=G.pivotColsSvc,this.valueColsSvc=G.valueColsSvc,this.colNames=G.colNames}postConstruct(){let G=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=G(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=G()});let D=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=D(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=D()})}createPivotColumnDefs(G){let D=this.createPivotColumnsFromUniqueValues(G);function z(Q,J=[]){return Q.forEach((U)=>{if(U.children!==void 0)z(U.children,J);else J.push(U)}),J}let B=z(D);return this.addRowGroupTotals(D,B),this.addExpandablePivotGroups(D,B),this.addPivotTotalsToGroups(D,B),D}createPivotColumnsFromUniqueValues(G){let D=this.pivotColsSvc?.columns??[],z=D.length;return this.recursivelyBuildGroup(0,G,[],z,D)}recursivelyBuildGroup(G,D,z,B,Q){if(G>=B)return this.buildMeasureCols(z);let{pivotComparator:J}=Q[G].getColDef(),U=J?ib(J):hb,Z=this.valueColsSvc?.columns;if(Z?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&G===B-1){let X=[];for(let Y of D.keys()){let W=[...z,Y],q=this.createColDef(Z[0],Y,W);q.columnGroupShow="open",X.push(q)}return X.sort(U),X}let S=[];for(let X of D.keys()){let Y=this.pivotDefaultExpanded===-1||G{let B=this.colNames.getDisplayNameForColumn(z,"header"),Q=this.createColDef(z,B,G);return Q.columnGroupShow="open",Q})}addExpandablePivotGroups(G,D){let z=this.gos.get("suppressExpandablePivotGroups");if(z||this.gos.get("pivotColumnGroupTotals"))return;let B=(Q,J,U)=>{if("children"in Q){let{valueColsSvc:X}=this,{columns:Y=[]}=X??{},W=new Map;Q.children.forEach((_)=>{B(_,J,W)});let q=!Q.children.some((_)=>_.children),H=q&&Y.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let _ of Y){let k=this.colNames.getDisplayNameForColumn(_,"header"),w=this.createColDef(_,k,Q.pivotKeys);if(w.pivotTotalColumnIds=W.get(_.getColId()),w.columnGroupShow=!z?"closed":"open",w.aggFunc=_.getAggFunc(),!q||H)Q.children.push(w),J.push(w)}this.merge(U,W);return}if(!Q.pivotValueColumn)return;let Z=Q.pivotValueColumn.getColId();if(U.has(Z))U.get(Z).push(Q.colId);else U.set(Z,[Q.colId])};G.forEach((Q)=>{B(Q,D,new Map)})}addPivotTotalsToGroups(G,D){if(!this.gos.get("pivotColumnGroupTotals"))return;let z=this.gos.get("pivotColumnGroupTotals")==="after",B=this.valueColsSvc?.columns,Q=B?.map((J)=>J.getAggFunc());if(!Q||Q.length<1||!this.sameAggFuncs(Q))return;if(B){let J=B[0];G.forEach((U)=>{this.recursivelyAddPivotTotal(U,D,J,z)})}}recursivelyAddPivotTotal(G,D,z,B){let Q=G;if(!Q.children){let U=G;return U.colId?[U.colId]:null}let J=[];if(Q.children.forEach((U)=>{let Z=this.recursivelyAddPivotTotal(U,D,z,B);if(Z)J=J.concat(Z)}),Q.children.length>1){let Z=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),S=this.createColDef(z,Z,G.pivotKeys,!0);S.pivotTotalColumnIds=J,S.aggFunc=z.getAggFunc(),S.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;let X=G.children;if(B)X.push(S);else X.unshift(S);D.push(S)}return J}addRowGroupTotals(G,D){if(!this.gos.get("pivotRowTotals"))return;let z=this.gos.get("pivotRowTotals")==="after",Q=(this.valueColsSvc?.columns??[]).slice();if(!z)Q.reverse();let J=Q.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let U=0;UJ.data?.[J.colDef.field],Q.pivotKeys=z,Q.pivotValueColumn=G,Q.filter===!0)Q.filter="agNumberColumnFilter";return Q}sameAggFuncs(G){if(G.length==1)return!0;for(let D=1;D{let J=[...G.has(B)?G.get(B):[],...z];G.set(B,J)})}generateColumnGroupId(G){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map((z)=>z.getColId()).join("-")}_${G.join("-")}`}generateColumnId(G,D){return`pivot_${(this.pivotColsSvc?.columns??[]).map((B)=>B.getColId()).join("-")}_${G.join("-")}_${D}`}createColDefsFromFields(G){let D=new Map;for(let Q=0;Q{let S=[];for(let[W,q]of U){let H=z(`${Q}${this.fieldSeparator}${W}`,W,q,Z+1);S.push(H)}if(S.length===0){let W=this.colModel.getColDefCol(J);if(W){let H=this.colNames.getDisplayNameForColumn(W,"header")??J,_=this.createColDef(W,H,void 0,!1);return _.colId=Q,_.aggFunc=W.getAggFunc(),_.valueGetter=(k)=>k.data?.[Q],_}return{colId:Q,headerName:J,valueGetter:(H)=>H.data?.[Q]}}if(this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&S.length===1&&"colId"in S[0])return S[0].headerName=J,S[0];return{openByDefault:this.pivotDefaultExpanded===-1||Z{Q.forEach((J)=>{if(tb(J.children)){let Z=J;if(z)z(Z);B(Z.children)}else{let Z=J;if(D)D(Z)}})};if(G)B(G)}},s2="Exceeded maximum allowed pivot column count.",WB=(G)=>{let D={};return G.forEach((z,B)=>D[B]=z instanceof Map?WB(z):z),D},Dv=class extends rb{constructor(){super(...arguments);this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(G){this.valueSvc=G.valueSvc,this.colModel=G.colModel,this.pivotResultCols=G.pivotResultCols,this.rowGroupColsSvc=G.rowGroupColsSvc,this.valueColsSvc=G.valueColsSvc,this.pivotColsSvc=G.pivotColsSvc,this.pivotColDefSvc=G.pivotColDefSvc}execute(G){if(this.colModel.isPivotActive())return this.executePivotOn(G);else return this.executePivotOff()}executePivotOff(){if(this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent())return this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),!0;return!1}executePivotOn(G){let D=this.valueColsSvc?.columns.length??1,z=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=z===-1?-1:z/D;let B;try{B=this.bucketUpRowNodes(G)}catch(K){if(K.message===s2)return this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:K.message}),this.lastTimeFailed=!0,!1;throw K}let Q=this.setUniqueValues(B),J=this.valueColsSvc?.columns??[],U=J.map((K)=>`${K.getId()}-${K.getColDef().headerName}`).join("#"),Z=J.map((K)=>K.getAggFunc().toString()).join("#"),S=this.aggregationColumnsHashLastTime!==U,X=this.aggregationFuncsHashLastTime!==Z;this.aggregationColumnsHashLastTime=U,this.aggregationFuncsHashLastTime=Z;let Y=(this.rowGroupColsSvc?.columns??[]).map((K)=>K.getId()).join("#"),W=Y!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=Y;let q=this.gos.get("pivotRowTotals"),H=this.gos.get("pivotColumnGroupTotals"),_=this.gos.get("suppressExpandablePivotGroups"),k=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),w=q!==this.pivotRowTotalsLastTime||H!==this.pivotColumnGroupTotalsLastTime||_!==this.suppressExpandablePivotGroupsLastTime||k!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=q,this.pivotColumnGroupTotalsLastTime=H,this.suppressExpandablePivotGroupsLastTime=_,this.removePivotHeaderRowWhenSingleValueColumnLastTime=k,this.lastTimeFailed||Q||S||W||X||w){let K=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(K,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(G){if(!eb(WB(this.uniqueValues),WB(G)))return this.uniqueValues=G,!0;return!1}bucketUpRowNodes(G){this.currentUniqueCount=0;let D=new Map;ab(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,G,(B)=>{if(B.leafGroup)B.childrenMapped=null});let z=(B)=>{if(B.leafGroup)this.bucketRowNode(B,D);else{let Q=B.childrenAfterFilter;if(Q)for(let J=0,U=Q.length;Jthis.maxUniqueValues;if(U&&q)throw Error(s2)}if(!Q.has(W))Q.set(W,[]);Q.get(W).push(Y)}if(z===D.length-1)return Q;let Z=new Map;for(let S of Q.keys())Z.set(S,this.bucketChildren(Q.get(S),D,z+1,B.get(S)));return Z}},U8={moduleName:"SharedPivot",version:j,beans:[ob,nb,T7],apiFunctions:{isPivotMode:Cb,getPivotResultColumn:Vb,setValueColumns:bb,getValueColumns:vb,removeValueColumns:Ob,addValueColumns:ub,setPivotColumns:jb,removePivotColumns:Pb,addPivotColumns:gb,getPivotColumns:Tb,setPivotResultColumns:yb,getPivotResultColumns:xb},dependsOn:[CJ,Rb]},pB={moduleName:"Pivot",version:j,rowModels:["clientSide"],beans:[Dv],dependsOn:[U8,VJ,_0]},o2=(G)=>{let D=G.split(".");if(D.includes("__proto__"))return()=>{};let z=D.length;if(z<2)return(B)=>B?.[G];return(B)=>{let Q=0;do if(B=B?.[D[Q++]],Q===z)return B;while(typeof B==="object")}},HG=2147483648,wG=1073741824,s0=536870912,nz=268435455,W1=String.fromCodePoint(31,41150,8291),q1=3,Jv=class extends zv{constructor(){super(...arguments);this.nestedDataGetter=null,this.parentIdGetter=null,this.nonLeafsById=null,this.nodesToUnselect=null,this.fullReload=!1}postConstruct(){this.onPropChange(null)}onPropChange(G){let D=this.gos;if(!G||G.has("treeDataParentIdField")){let z=D.get("treeDataParentIdField"),B=z?o2(z):null;if(this.fullReload||(this.fullReload=this.parentIdGetter!==B),this.parentIdGetter=B,B)this.nestedDataGetter=null}if(!G||G.has("treeDataChildrenField")){let z=this.parentIdGetter?"":D.get("treeDataChildrenField"),B=z?o2(z):null;this.fullReload||(this.fullReload=this.nestedDataGetter!==B),this.nestedDataGetter=B}}destroy(){this.nodesToUnselect=null,this.reset(),super.destroy()}reset(){this.clearNonLeafs(),this.deselectHiddenNodes(!1),this.fullReload=!0}clearNonLeafs(){let G=this.nonLeafsById;if(G){for(let D of G.values())D._destroy(!1);G.clear(),this.nonLeafsById=null}}getNonLeaf(G){return this.nonLeafsById?.get(G)}loadGroupData(G){let D=G.key;if(D==null)return G._groupData=null,null;let z={};G._groupData=z;let B=this.beans.showRowGroupCols?.columns;if(B)for(let Q=0,J=B.length;Q0&&Z!==X)this.handleCycles(G),this.traverseRoot(G,B);return G.treeNodeFlags=0,this.deselectHiddenNodes(U||Q),S}flagUpdatedNodes(G){let{adds:D,updates:z,removals:B}=G,Q=B.length>0;if(D.size>0){Q=!0;for(let J of D)J.treeNodeFlags|=wG}if(z.size>0){Q=!0;for(let J of z)J.treeNodeFlags|=wG}return Q}initRowsParents(G){let D=G._leafs,z=D.length,B=!1;for(let Q=0;Q=0||B.treeNodeFlags&s0||B.treeParent===null){B.treeNodeFlags=Q;break}B.treeNodeFlags=Q|s0|G.treeNodeFlags&wG,G=B}return D}destroyFillerRows(G){let D=this.nonLeafsById;if(D){for(let z of D.values())if(z.treeParent===null||(z.treeNodeFlags&nz)===0)D.delete(z.id),z._destroy(G),this.hideRow(z);if(D.size===0)this.nonLeafsById=null}}initRowsChildrenSize(G){this.initRowChildrenSize(G);let D=G._leafs,z=D.length;for(let Q=0;Q=0){if(D!==null){G.childrenAfterGroup=null,G.childrenAfterFilter=null,G.childrenAfterAggFilter=null,G.childrenAfterSort=null;let U=G.sibling;if(U)U.childrenAfterGroup=null,U.childrenAfterFilter=null,U.childrenAfterAggFilter=null,U.childrenAfterSort=null}}else if(Q!==J||D===z)if(!D||D===z){G.childrenAfterGroup=D=Array(J);let U=G.sibling;if(U)U.childrenAfterGroup=D}else D.length=J}preprocessRows(G){let D=G._leafs,z=D.length,B=0,Q=!1;for(let J=0;J0)B?.addRow(G);G._leafs=void 0}return U+1}handleCycles(G){let D=new Set,z=(J)=>{if(D.has(J))return!1;D.add(J);for(let U of J.childrenAfterGroup??[])z(U);return!0};z(G);let B=G.childrenAfterGroup;B.length=0;let Q=G._leafs;for(let J=0,U=Q.length;J=0;--q){let H=D.get(S.slice(0,B[q]));if(H){W=H,Y=q+1;break}}if(Y0?D[Q-1]+q1:0,U=D[Q];B+="-"+Q+"-"+G.slice(J,U),++Q}return B+"-"+z+"-"}deselectHiddenNodes(G){let D=this.beans.selectionSvc,z=this.nodesToUnselect,B="rowDataChanged";if(z)this.nodesToUnselect=null,D?.setNodesSelected({newValue:!1,nodes:z,suppressFinishActions:!0,source:"rowDataChanged"});if(z||G)D?.updateGroupsFromChildrenSelections?.("rowDataChanged");if(z){let Q=D?.getSelectedNodes()??null;this.eventSvc.dispatchEvent({type:"selectionChanged",source:"rowDataChanged",selectedNodes:Q,serverSideState:null})}}hideRow(G){if(G.isSelected())(this.nodesToUnselect??(this.nodesToUnselect=[])).push(G);G.parent=null,G.group=!1,G.treeParent=null,G.treeNodeFlags=0,G.childrenAfterGroup=null,G.childrenAfterFilter=null,G.childrenAfterAggFilter=null,G.childrenAfterSort=null,G._leafs=void 0,G._groupData=null,G.aggData=null;let D=G.sibling;if(D)D.childrenAfterGroup=null,D.childrenAfterFilter=null,D.childrenAfterAggFilter=null,D.childrenAfterSort=null;if(G.updateHasChildren(),G.rowIndex!==null)G.clearRowTopAndRowIndex()}onShowRowGroupColsSetChanged(){let G=this.beans.rowModel.rootNode._leafs;if(!G)return;for(let z=0,B=G.length;zG.sourceRowIndex-D.sourceRowIndex,Zv=(G,D)=>{if(D._expanded!==void 0&&G._expanded===void 0&&G.treeParent!==null&&G.sourceRowIndex<0)G._expanded=D._expanded},o0=(G,D)=>{let z=G._groupData!==void 0;G.key=D,G.groupValue=D;let B=G.sibling;if(B)B.key=D;if(z)G._groupData=void 0,G.setData(G.data)},Z8={moduleName:"SharedTreeData",version:j,dependsOn:[i,IJ,m7,AJ,RJ]},$8={moduleName:"TreeData",version:j,dynamicBeans:{treeGroupStrategy:Jv},rowModels:["clientSide"],dependsOn:[Z8,MJ,_0,t7]},Wv="ag-Grid-MissingKey",qv=class extends $v{constructor(){super(...arguments);this.beanName="ssrmBlockUtils"}wireBeans(G){this.valueSvc=G.valueSvc,this.showRowGroupCols=G.showRowGroupCols,this.nodeManager=G.ssrmNodeManager,this.expansionSvc=G.expansionSvc,this.serverSideRowModel=G.rowModel,this.storeFactory=G.ssrmStoreFactory}createRowNode(G){let D=new Lv(this.beans),z=G.rowHeight!=null?G.rowHeight:Xv(this.beans);if(D.setRowHeight(z),D.group=G.group,D.leafGroup=G.leafGroup,D.level=G.level,D.uiLevel=G.level,D.parent=G.parent,D.stub=!0,D.__needsRefreshWhenVisible=!1,D.group)D.expanded=!1,D.field=G.field,D.rowGroupColumn=G.rowGroupColumn,D.rowGroupIndex=G.level;return D}destroyRowNode(G,D=!1){if(G.childStore&&!D)this.destroyBean(G.childStore),G.childStore=null;let z=G.sibling;if(z&&!G.footer)this.destroyRowNode(z,!1);if(G._destroy(!0),G.id!=null)this.nodeManager.removeNode(G)}setTreeGroupInfo(G){G.updateHasChildren();let D=this.gos.get("getServerSideGroupKey"),z=G.hasChildren();if(z&&D!=null)G.key=D(G.data);if(!z&&G.childStore!=null){if(this.destroyBean(G.childStore),G.childStore=null,!G.master)G.expanded=!1}}setRowGroupInfo(G){if(G.key=this.valueSvc.getValue(G.rowGroupColumn,G,"data"),G.key===null||G.key===void 0)Sv(()=>{Yv(190,{rowGroupId:G.rowGroupColumn?.getId(),data:G.data})},"SSBlock-BadKey");if(this.gos.get("groupAllowUnbalanced")&&G.key===""){let Q=this.serverSideRowModel.getParams();G.childStore=this.createBean(this.storeFactory.createStore(Q,G))}if(r2(this.beans.gos)({node:G})){if(pG(G,this.beans),G.sibling)G.sibling.uiLevel=G.uiLevel+1}}setMasterDetailInfo(G){let D=this.gos.get("isRowMaster");if(D!=null)G.master=D(G.data);else G.master=!0}updateDataIntoRowNode(G,D){if(G.updateData(D),this.gos.get("treeData"))this.setTreeGroupInfo(G),this.setChildCountIntoRowNode(G),this.updateRowFooter(G);else if(G.group)this.setChildCountIntoRowNode(G),this.updateRowFooter(G);else if(this.gos.get("masterDetail"));}updateRowFooter(G){if(G.footer)return;if(G.group){if(r2(this.beans.gos)({node:G})&&!G.sibling){pG(G,this.beans);return}}if(G.sibling)EJ(G)}setDataIntoRowNode(G,D,z,B){G.stub=!1;let Q=this.gos.get("treeData");G.setDataAndId(D,z);let J=G.group;if((Q||!J)&&this.gos.get("masterDetail"))this.setMasterDetailInfo(G);if(Q)this.setTreeGroupInfo(G);else if(J)this.setRowGroupInfo(G);if(Q||J)this.setGroupDataIntoRowNode(G),this.setChildCountIntoRowNode(G);if(H1(D))G.setRowHeight(a2(this.beans,G,!1,B).height),G.sibling?.setRowHeight(a2(this.beans,G.sibling,!1,B).height)}setChildCountIntoRowNode(G){let D=this.gos.get("getChildCount");if(D)G.setAllChildrenCount(D(G.data))}setGroupDataIntoRowNode(G){let D=G.key;if(G.groupValue=D,G.sibling)G.sibling.groupValue=D;let z=this.showRowGroupCols?.columns;if(!z)return;let B=this.gos.get("treeData");for(let Q of z){let J=G._groupData;if(!J)J={},G._groupData=J;if(B)J[Q.getColId()]=D;else if(Q.isRowGroupDisplayed(G.rowGroupColumn.getId())){let U=this.valueSvc.getValue(G.rowGroupColumn,G,"data");J[Q.getColId()]=U}}}clearDisplayIndex(G){if(G.clearRowTopAndRowIndex(),G.hasChildren()&&!!G.childStore)G.childStore?.clearDisplayIndexes();if(G.master&&G.detailNode)G.detailNode?.clearRowTopAndRowIndex()}setDisplayIndex(G,D,z,B){let Q=this.gos.get("groupAllowUnbalanced")&&G.group&&G.key==="";if(this.gos.get("groupHideOpenParents")&&G.group&&G.expanded||Q)G.setRowIndex(null),G.setRowTop(null);else G.setRowIndex(D.value++),G.setRowTop(z.value),z.value+=G.rowHeight;if(G.setUiLevel(B),G.footer)return;if(G.master){if(G.expanded&&G.detailNode)G.detailNode.setRowIndex(D.value++),G.detailNode.setRowTop(z.value),z.value+=G.detailNode.rowHeight;else if(G.detailNode)G.detailNode.clearRowTopAndRowIndex()}if(G.hasChildren()&&!!G.childStore){let S=G.childStore;if(G.expanded||Q)S.setDisplayIndexes(D,z,Q?B:B+1);else S.clearDisplayIndexes()}}extractRowBounds(G,D){let z=(B)=>({rowHeight:B.rowHeight,rowTop:B.rowTop});if(G.rowIndex===D)return z(G);if(G.hasChildren()&&G.expanded&&!!G.childStore){let B=G.childStore;if(B.isDisplayIndexInStore(D))return B.getRowBounds(D)}else if(G.master&&G.expanded&&G.detailNode){if(G.detailNode.rowIndex===D)return z(G.detailNode)}}isPixelInNodeRange(G,D){if(!H1(G.rowTop)||!H1(G.rowHeight))return!1;return D>=G.rowTop&&D=0){if(z.key==="")D.push(Wv);else D.push(z.key);z=z.parent}if(D.length>0)return D.reverse().join("-");return}checkOpenByDefault(G){let D=!!this.expansionSvc?.isNodeExpanded(G),z=G._expanded;if(!!z!==D)G.setExpanded(D);else if(z===void 0)G._expanded=D}},kv=class extends Hv{constructor(){super(...arguments);this.beanName="ssrmExpandListener"}postConstruct(){if(!_v(this.gos))return;this.addManagedEventListeners({rowExpansionStateChanged:this.onRowExpandStateChanged.bind(this)})}onRowExpandStateChanged(){let G=this.beans,D=G.expansionSvc;G.rowModel.forEachNode((z)=>{D.updateExpandedState(z)}),this.eventSvc.dispatchEvent({type:"storeUpdated"})}},Nv=class extends wv{constructor(){super(...arguments);this.beanName="ssrmFilterListener"}wireBeans(G){this.serverSideRowModel=G.rowModel,this.filterManager=G.filterManager,this.listenerUtils=G.ssrmListenerUtils}postConstruct(){if(!Kv(this.gos))return;this.addManagedEventListeners({advancedFilterEnabledChanged:()=>this.onFilterChanged(!0),filterChanged:()=>this.onFilterChanged()})}onFilterChanged(G){let D=this.serverSideRowModel.getParams();if(!D)return;let z=D.filterModel,B,Q;if(this.filterManager?.isAdvFilterEnabled()){B=this.filterManager.getAdvFilterModel();let S=G?Object.keys(z??{}):this.getAdvancedFilterColumns(z),X=this.getAdvancedFilterColumns(B);for(let Y of S)X.add(Y);Q=Array.from(X)}else if(B=this.filterManager?.getFilterModel()??{},G){let S=this.getAdvancedFilterColumns(z);for(let X of Object.keys(B))S.add(X);Q=Array.from(S)}else Q=this.findChangedColumns(z,B);let J=this.listenerUtils.isSortingWithValueColumn(Q),U=this.listenerUtils.isSortingWithSecondaryColumn(Q),Z={valueColChanged:J,secondaryColChanged:U,changedColumns:Q};this.serverSideRowModel.refreshAfterFilter(B,Z)}findChangedColumns(G,D){let z={};for(let Q of Object.keys(G))z[Q]=!0;for(let Q of Object.keys(D))z[Q]=!0;let B=[];for(let Q of Object.keys(z))if(!fv(G[Q],D[Q]))B.push(Q);return B}getAdvancedFilterColumns(G){let D=new Set;if(!G)return D;let z=(B)=>{if(B.filterType==="join")for(let Q of B.conditions)z(Q);else D.add(B.colId)};return z(G),D}},Ev=class extends Fv{constructor(){super(...arguments);this.beanName="ssrmListenerUtils"}wireBeans(G){this.pivotResultCols=G.pivotResultCols,this.valueColsSvc=G.valueColsSvc}isSortingWithValueColumn(G){let D=(this.valueColsSvc?.columns??[]).map((z)=>z.getColId());for(let z=0;z-1)return!0;return!1}isSortingWithSecondaryColumn(G){let D=this.pivotResultCols?.getPivotResultCols();if(!D)return!1;let z=D.list.map((B)=>B.getColId());for(let B=0;B-1)return!0;return!1}},Av=class extends Iv{constructor(){super(...arguments);this.beanName="ssrmSortSvc"}wireBeans(G){this.sortSvc=G.sortSvc,this.serverSideRowModel=G.rowModel,this.listenerUtils=G.ssrmListenerUtils}postConstruct(){if(!Mv(this.gos))return;this.addManagedEventListeners({sortChanged:this.onSortChanged.bind(this)})}onSortChanged(){let G=this.serverSideRowModel.getParams();if(!G)return;let D=this.sortSvc.getSortModel(),z=G.sortModel,B=this.findChangedColumnsInSort(D,z),Q=this.listenerUtils.isSortingWithValueColumn(B),J=this.listenerUtils.isSortingWithSecondaryColumn(B),U={valueColChanged:Q,secondaryColChanged:J,changedColumns:B};this.serverSideRowModel.refreshAfterSort(D,U)}findChangedColumnsInSort(G,D){let z=[];for(let J of[G,D])if(J){let U=J.map((Z)=>Z.colId);z=z.concat(U)}let B=(J,U)=>{let Z=J?J.sort:null,S=U?U.sort:null;return Z!==S},Q=(J,U)=>{let Z=J?D.indexOf(J):-1,S=U?G.indexOf(U):-1;return Z!==S};return z.filter((J)=>{let U=D.find((S)=>S.colId===J),Z=G.find((S)=>S.colId===J);return B(U,Z)||Q(U,Z)})}},Vv=class extends Rv{constructor(){super(...arguments);this.beanName="ssrmNodeManager",this.rowNodes=new Map}addRowNode(G){let D=G.id;if(this.rowNodes.has(D))Cv(187,{rowId:D,firstData:this.rowNodes.get(D).data,secondData:G.data});this.rowNodes.set(D,G)}removeNode(G){let D=G.id;this.rowNodes.delete(D)}destroy(){this.clear(),super.destroy()}clear(){this.rowNodes.clear(),super.destroy()}},yv=class extends bv{constructor(){super(...arguments);this.beanName="rowModel",this.hierarchical=!0,this.started=!1,this.managingPivotResultColumns=!1,this.onRowHeightChanged_debounced=Ov(this,this.onRowHeightChanged.bind(this),100)}wireBeans(G){this.colModel=G.colModel,this.colNames=G.colNames,this.pivotResultCols=G.pivotResultCols,this.rowGroupColsSvc=G.rowGroupColsSvc,this.pivotColsSvc=G.pivotColsSvc,this.valueColsSvc=G.valueColsSvc,this.filterManager=G.filterManager,this.sortSvc=G.sortSvc,this.rowRenderer=G.rowRenderer,this.nodeManager=G.ssrmNodeManager,this.storeFactory=G.ssrmStoreFactory,this.pivotColDefSvc=G.pivotColDefSvc}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){if(!this.datasource)return;if(this.datasource.destroy)this.datasource.destroy();this.rowRenderer.datasourceChanged(),this.datasource=void 0}postConstruct(){let G=this.resetRootStore.bind(this);this.addManagedEventListeners({newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onStoreUpdated.bind(this),columnValueChanged:G,columnPivotChanged:G,columnRowGroupChanged:G,columnPivotModeChanged:G}),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","cacheBlockSize"],G),this.addManagedPropertyListeners(["groupAllowUnbalanced","groupTotalRow"],()=>this.onStoreUpdated()),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){let G=this.gos.get("serverSideDatasource");if(G)this.setDatasource(G)}verifyProps(){if(Pv(this.gos)&&!this.gos.exists("getRowId"))Tv(188,{feature:"selection"})}setDatasource(G){if(!this.started)return;this.destroyDatasource(),this.datasource=G,this.resetRootStore()}applyRowData(G,D,z){let B=this.getRootStore();if(!B)return;let Q=B.getChildStore(z);if(!Q)return;Q.applyRowData(G,D,G.rowData.length)}isLastRowIndexKnown(){let G=this.getRootStore();if(!G)return!1;return G.isLastRowIndexKnown()}onColumnEverything(){if(!this.storeParams){this.resetRootStore();return}let G=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),D=this.columnsToValueObjects(this.valueColsSvc?.columns),z=this.columnsToValueObjects(this.pivotColsSvc?.columns),B=(X)=>{let Y={};for(let H of X.oldCols)Y[H.id]=H;let W=X.newCols.every((H)=>{let _=Y[H.id];if(_)delete Y[H.id];return _&&_.field===H.field&&_.aggFunc===H.aggFunc}),q=!X.allowRemovedColumns&&!!Object.values(Y).length;return W&&!q},Q=!gv(this.storeParams.sortModel,this.sortSvc?.getSortModel()??[]),J=!B({oldCols:this.storeParams.rowGroupCols,newCols:G}),U=!B({oldCols:this.storeParams.pivotCols,newCols:z}),Z=!!G?.length&&!B({oldCols:this.storeParams.valueCols,newCols:D,allowRemovedColumns:!0});if(Q||J||U||Z)this.resetRootStore();else{let X=this.createStoreParams();this.storeParams.rowGroupCols=X.rowGroupCols,this.storeParams.pivotCols=X.pivotCols,this.storeParams.valueCols=X.valueCols}}destroyRootStore(){if(!this.rootNode?.childStore)return;this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear()}refreshAfterSort(G,D){if(this.storeParams)this.storeParams.sortModel=G;let z=this.getRootStore();if(!z)return;z.refreshAfterSort(D),this.onStoreUpdated()}generateSecondaryColumns(G){if(!this.pivotColDefSvc){this.gos.assertModuleRegistered("SharedPivot",2);return}let D=this.pivotColDefSvc.createColDefsFromFields(G);this.managingPivotResultColumns=!0,this.pivotResultCols?.setPivotResultCols(D,"rowModelUpdated")}resetRowHeights(){let G=this.resetRowHeightsForAllRowNodes(),D=dz(this.beans,this.rootNode);if(this.rootNode.setRowHeight(D.height,D.estimated),this.rootNode.sibling){let z=dz(this.beans,this.rootNode.sibling);this.rootNode.sibling.setRowHeight(z.height,z.estimated)}if(G)this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let G=!1;return this.forEachNode((D)=>{let z=dz(this.beans,D);D.setRowHeight(z.height,z.estimated);let B=D.detailNode;if(B){let Q=dz(this.beans,B);B.setRowHeight(Q.height,Q.estimated)}if(D.sibling){let Q=dz(this.beans,D.sibling);B?.setRowHeight(Q.height,Q.estimated)}G=!0}),G}resetRootStore(){if(this.destroyRootStore(),this.rootNode=new vv(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource)this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds();if(this.managingPivotResultColumns)this.pivotResultCols?.setPivotResultCols(null,"api"),this.managingPivotResultColumns=!1;this.dispatchModelUpdated(!0)}columnsToValueObjects(G=[]){return G.map((D)=>({id:D.getId(),aggFunc:D.getAggFunc(),displayName:this.colNames.getDisplayNameForColumn(D,"model"),field:D.getColDef().field}))}createStoreParams(){let G=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),D=this.columnsToValueObjects(this.valueColsSvc?.columns),z=this.columnsToValueObjects(this.pivotColsSvc?.columns),B=jv(this.gos);return{valueCols:D,rowGroupCols:G,pivotCols:z,pivotMode:this.colModel.isPivotMode(),filterModel:this.filterManager?.isAdvFilterEnabled()?this.filterManager?.getAdvFilterModel():this.filterManager?.getFilterModel()??{},sortModel:this.sortSvc?.getSortModel()??[],datasource:this.datasource,lastAccessedSequence:{value:0},dynamicRowHeight:B}}getParams(){return this.storeParams}dispatchModelUpdated(G=!1){this.eventSvc.dispatchEvent({type:"modelUpdated",animate:!G,keepRenderedRows:!G,newPage:!1,newData:!1})}onStoreUpdated(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){let G=this.getRootStore();if(!G)return;G.setDisplayIndexes({value:0},{value:0},0)}retryLoads(){let G=this.getRootStore();if(!G)return;G.retryLoads(),this.onStoreUpdated()}getRow(G){let D=this.getRootStore();if(!D)return;return D.getRowUsingDisplayIndex(G)}refreshAfterFilter(G,D){if(this.storeParams)this.storeParams.filterModel=G;let z=this.getRootStore();if(!z)return;z.refreshAfterFilter(D),this.onStoreUpdated()}getRootStore(){return this.rootNode?.childStore}getRowCount(){let G=this.getRootStore();if(!G)return 0;return G.getDisplayIndexEnd()}getTopLevelRowCount(){let G=this.getRootStore();if(!G)return 1;return G.getRowCount()}getTopLevelRowDisplayedIndex(G){let D=this.getRootStore();if(!D)return G;return D.getTopLevelRowDisplayedIndex(G)}getRowBounds(G){let D=this.getRootStore();if(!D)return{rowTop:0,rowHeight:uv(this.beans)};return D.getRowBounds(G)}getBlockStates(){let G=this.getRootStore();if(!G)return;let D={};return G.forEachStoreDeep((z)=>{let B=z.getBlockStates();for(let Q of Object.keys(B))D[Q]=B[Q]}),D}getRowIndexAtPixel(G){let D=this.getRootStore();if(G<=0||!D)return 0;return D.getRowIndexAtPixel(G)}isEmpty(){return!1}getOverlayType(){if(this.getRootStore()?.getDisplayIndexEnd()===0)return this.filterManager?.isAnyFilterPresent()?"noMatchingRows":"noRows";return null}isRowsToRender(){return this.getRootStore()!=null&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(G){let D=this.getRootStore();if(!D)return;D.forEachNodeDeep(G)}forEachDisplayedNode(G){let D=(z,B)=>{if(z.stub||!z.displayed)return;G(z,B)};this.forEachNode(D)}forEachNodeAfterFilterAndSort(G,D=!1){let z=this.getRootStore();if(!z)return;z.forEachNodeDeepAfterFilterAndSort(G,void 0,D)}executeOnStore(G,D){if(!this.started)return!1;let z=this.getRootStore();if(!z)return!0;let B=z.getChildStore(G);if(B)D(B);return!0}refreshStore(G={}){let D=G.route?G.route:[];this.executeOnStore(D,(z)=>z.refreshStore(G.purge==!0))}getStoreState(){let G=[],D=this.getRootStore();if(D)D.addStoreStates(G);return G}getNodesInRangeForSelection(G,D){let z=G.rowIndex,B=D.rowIndex;if(z===null&&B===null)return[];if(B===null)return G?[G]:[];if(z===null)return[D];let Q=[],[J,U]=[z,B].sort((Z,S)=>Z-S);if(this.forEachNode((Z)=>{let S=Z.rowIndex;if(S==null||Z.stub)return;if(S>=J&&S<=U)Q.push(Z)}),Q.length!==U-J+1)return null;return Q}getRowNode(G){let D;return this.forEachNode((z)=>{if(z.id===G)D=z;if(z.detailNode&&z.detailNode.id===G)D=z.detailNode}),D}isRowPresent(G){return!!this.getRowNode(G.id)}setRowCount(G,D){let z=this.getRootStore();if(!z)return;z.setRowCount(G,D)}destroy(){this.destroyDatasource(),this.destroyRootStore(),super.destroy()}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}};function cv(G){return G.selectionSvc?.getSelectionState()??null}function hv(G,D){G.selectionSvc?.setSelectionState(D,"api")}function iv(G,D){return G.ssrmTxnManager?.applyTransaction(D)}function nv(G,D){let z=D.startRow??0,B=D.route??[];if(z<0){xv(189,{startRow:z});return}mB(G)?.applyRowData(D.successParams,z,B)}function dv(G,D,z){return G.ssrmTxnManager?.applyTransactionAsync(D,z)}function lv(G){mB(G)?.retryLoads()}function pv(G){return G.ssrmTxnManager?.flushAsyncTransactions()}function mv(G,D){mB(G)?.refreshStore(D)}function tv(G){return mB(G)?.getStoreState()??[]}var r0=class extends av{constructor(){super(...arguments);this.name="expand",this.expanded=new Set,this.collapsed=new Set,this.initialState=new Map}setExpandedState({expandedRowGroupIds:G,collapsedRowGroupIds:D}){this.expanded=new Set(G),this.collapsed=new Set(D);for(let z of this.expanded)this.initialState.set(z,!1);for(let z of this.collapsed)this.initialState.set(z,!0)}getExpandedState(){return{expandedRowGroupIds:Array.from(this.expanded),collapsedRowGroupIds:Array.from(this.collapsed)}}setRowExpanded(G,D){let z=G.id,B=this.initialState.get(z)===D;if(D){if(this.collapsed.delete(z),!B)this.expanded.add(z);return}if(this.expanded.delete(z),!B)this.collapsed.add(z)}isRowExpanded(G){let D=G.id;if(this.expanded.has(D))return!0;if(this.collapsed.has(D))return!1;let z=this.initialState.get(D);if(z!=null)return z;let B=this.getInitialRowState(G);return this.initialState.set(D,B),B}getInitialRowState(G){if(!G.isExpandable())return!1;let D=this.gos.getCallback("isServerSideGroupOpenByDefault");if(!D)return!1;let z={data:G.data,rowNode:G};return D(z)}isRowInitialised(G){return this.initialState.has(G)}expandAll(G){this.beans.rowModel.forEachNode((D)=>{this.setRowExpanded(D,G)})}},e2=class extends ev{constructor(){super(...arguments);this.name="expandAll",this.allExpanded=void 0,this.flipped=new Set}setExpandedState(G){this.allExpanded=G.expandAll,this.flipped=new Set(G.invertedRowGroupIds)}getExpandedState(){return{expandAll:this.allExpanded,invertedRowGroupIds:Array.from(this.flipped)}}setRowExpanded(G,D){let z=G.id;if(D===this.allExpanded){this.flipped.delete(z);return}this.flipped.add(z)}isRowExpanded(G){let D=G.id;return this.allExpanded!==this.flipped.has(D)}isRowInitialised(){return!0}expandAll(G){this.allExpanded=G,this.flipped.clear()}},GO=class extends x7{constructor(){super(...arguments);this.beanName="expansionSvc"}wireBeans(G){this.serverSideRowModel=G.rowModel,this.storeFactory=G.ssrmStoreFactory}setStrategy(G){this.destroyBean(this.strategy),this.strategy=this.createManagedBean(G)}postConstruct(){let G=()=>{this.setStrategy(new r0)};this.addManagedEventListeners({columnRowGroupChanged:G,columnPivotChanged:G,columnPivotModeChanged:G}),this.addManagedPropertyListener("ssrmExpandAllAffectsAllRows",(D)=>{if(!D.currentValue)this.setStrategy(new r0),this.updateAllNodes(),this.dispatchStateUpdatedEvent()}),G()}setExpansionState(G){let D="expandAll"in G,z=this.isExpandAllStrategy(this.strategy);if(D!==z)this.setStrategy(D?new e2:new r0);this.strategy.setExpandedState(G),this.dispatchStateUpdatedEvent(),this.updateAllNodes()}getExpansionState(){return this.strategy.getExpandedState()}updateAllNodes(){this.serverSideRowModel.forEachNode((G)=>{super.setExpanded(G,this.isNodeExpanded(G))})}isExpanded(G){let D=G._expanded;if(D===null)D=this.defaultExpanded(G),G._expanded=D;return D}isNodeExpanded(G){return this.strategy.isRowExpanded(G)}setExpanded(G,D,z,B){this.strategy.setRowExpanded(G,D),super.setExpanded(G,D,z),this.dispatchStateUpdatedEvent(),this.updateExpandedState(G)}resetExpansion(){this.setStrategy(new r0),this.updateAllNodes(),this.dispatchStateUpdatedEvent()}expandAll(G){let D=this.beans.gos.get("ssrmExpandAllAffectsAllRows");if(!this.isExpandAllStrategy(this.strategy)&&D)this.setStrategy(new e2);this.strategy.expandAll(G),this.updateAllNodes(),this.dispatchStateUpdatedEvent(),this.beans.eventSvc.dispatchEvent({type:"expandOrCollapseAll",source:G?"expandAll":"collapseAll"})}isExpandAllStrategy(G){return G.name==="expandAll"}onGroupExpandedOrCollapsed(){}setDetailsExpansionState(G){let{gos:D}=this.beans;if(!D.get("ssrmExpandAllAffectsAllRows"))return;let z=this.getExpansionState();if(z.expandAll===void 0)return;let Q=z.expandAll&&z.invertedRowGroupIds.length===0;if((!z.expandAll&&z.invertedRowGroupIds.length===0)===Q)return;return Q?G.expandAll():G.collapseAll()}dispatchExpandedEvent(G){this.eventSvc.dispatchEvent(G),this.beans.rowRenderer.refreshRowByNode(G.node)}updateExpandedState(G){let D=G.childStore;if(G.expanded){if(G.master&&!G.detailNode)G.detailNode=this.createDetailNode(G);if(!D&&G.hasChildren()){let z=this.serverSideRowModel.getParams();G.childStore=this.createBean(this.storeFactory.createStore(z,G))}}else if(D&&this.gos.get("purgeClosedRowNodes"))G.childStore=this.destroyBean(D)}createDetailNode(G){let D=new sv(this.beans);if(D.detail=!0,D.selectable=!1,D.parent=G,ov(G.id))D.id="detail_"+G.id;D.data=G.data,D.level=G.level+1;let z=200,B=rv(this.beans,D).height;return D.rowHeight=B?B:z,D}},_1=class extends JO{constructor(G){super();this.selectionCtx=G,this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectAllUsed=!1,this.selectedNodes={}}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(G){if(typeof G!=="object"){e0(116);return}if(!("selectAll"in G)){e0(116);return}if(typeof G.selectAll!=="boolean"){e0(117);return}if(!("toggledNodes"in G)||!Array.isArray(G.toggledNodes))return GB(197);let D={selectAll:G.selectAll,toggledNodes:new Set};G.toggledNodes.forEach((B)=>{if(typeof B==="string")D.toggledNodes.add(B);else GB(196,{key:B})});let z=D.selectAll||D.toggledNodes.size>1;if(UO(this.gos)&&!z5(this.gos)&&z){GB(130);return}this.selectedState=D}deleteSelectionStateFromParent(G,D){if(this.selectedState.toggledNodes.size===0)return!1;let z=!1;for(let B of D)if(this.selectedState.toggledNodes.delete(B))z=!0;return z}setNodesSelected(G){let{nodes:D,clearSelection:z,newValue:B,source:Q}=G;if(D.length===0)return 0;let J=z&&B;if(!z5(this.gos)||J){if(D.length>1)return e0(130),0;let Z=D[0],S=Z.footer?Z.sibling:Z;if(B&&S.selectable)this.selectedNodes={[S.id]:S},this.selectedState={selectAll:!1,toggledNodes:new Set([S.id])};else this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set};return 1}let U=(Z,S=B)=>{let X=Z.footer?Z.sibling:Z;if(S&&X.selectable)this.selectedNodes[X.id]=X;else delete this.selectedNodes[X.id];if(S===this.selectedState.selectAll||!X.selectable)this.selectedState.toggledNodes.delete(X.id);else this.selectedState.toggledNodes.add(X.id)};for(let Z of D)U(Z);if(D.length===1&&Q==="api")this.selectionCtx.setRoot(D[0].footer?D[0].sibling:D[0]);return 1}processNewRow(G){if(this.selectedNodes[G.id])this.selectedNodes[G.id]=G}isNodeSelected(G){let D=this.selectedState.toggledNodes.has(G.id);return this.selectedState.selectAll?!D:D}getSelectedNodes(G=!1,D=!0){let{selectedState:{selectAll:z},selectedNodes:B,selectAllUsed:Q}=this;if(D&&Q)GB(199);return G&&z?null:Object.values(B)}getSelectedRows(){return(this.getSelectedNodes()??[]).map((G)=>G.data)}getSelectionCount(){if(this.selectedState.selectAll)return-1;return this.selectedState.toggledNodes.size}isEmpty(){return!this.selectedState.selectAll&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(G){this.selectedState={selectAll:G,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed||(this.selectAllUsed=G)}getSelectAllState(){if(this.selectedState.selectAll){if(this.selectedState.toggledNodes.size>0)return null;return!0}if(this.selectedState.toggledNodes.size>0)return null;return!1}},DB=class extends ZO{constructor(G){super();this.selectionCtx=G,this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}wireBeans(G){this.rowModel=G.rowModel,this.rowGroupColsSvc=G.rowGroupColsSvc,this.filterManager=G.filterManager,this.selectionSvc=G.selectionSvc}postConstruct(){this.addManagedEventListeners({modelUpdated:()=>this.removeRedundantState(),columnRowGroupChanged:()=>this.selectionSvc.reset("rowGroupChanged")})}getSelectedState(){let{gos:G,rowGroupColsSvc:D,selectedState:z}=this,B=G.get("treeData"),Q=(J,U,Z)=>{let S={nodeId:Z};if(B||D&&U<=D.columns.length)S.selectAllChildren=J.selectAllChildren;if(J.toggledNodes.size){let X=[];J.toggledNodes.forEach((Y,W)=>{let q=Q(Y,U+1,W);X.push(q)}),S.toggledNodes=X}return S};return Q(z,0)}setSelectedState(G){if("selectAll"in G){KD(111);return}let D=(z,B)=>{if(typeof z!=="object")throw KD(243),Error();if("selectAllChildren"in z&&typeof z.selectAllChildren!=="boolean")throw KD(244),Error();if("toggledNodes"in z){if(!Array.isArray(z.toggledNodes))throw KD(245),Error();if(!z.toggledNodes.every((S)=>typeof S==="object"&&("nodeId"in S)&&typeof S.nodeId==="string"))throw KD(246),Error()}let Q=z.selectAllChildren??!B,J=z.toggledNodes?.map((Z)=>[Z.nodeId,D(Z,Q)]);if(J?.some(([,Z])=>Q===Z.selectAllChildren&&Z.toggledNodes.size===0))throw KD(247),Error();return{selectAllChildren:Q,toggledNodes:new Map(J)}};try{this.selectedState=D(G,!!G.selectAllChildren)}catch(z){}}deleteSelectionStateFromParent(G,D){let z=this.selectedState,B=[...G];while(z&&B.length)z=z.toggledNodes.get(B.pop());if(!z)return!1;let Q=!1;for(let J of D)if(z?.toggledNodes.delete(J))Q=!0;if(Q)this.removeRedundantState();return Q}setNodesSelected({nodes:G,newValue:D,clearSelection:z,source:B}){if(G.length===0)return 0;let Q=z&&D;if(!$O(this.gos)||Q){if(G.length>1)return KD(130),0;this.deselectAllRowNodes()}for(let J of G){let U=J.footer?J.sibling:J,Z=this.getRouteToNode(U);this.recursivelySelectNode(Z,this.selectedState,D)}if(this.removeRedundantState(),G.length===1&&B==="api")this.selectionCtx.setRoot(G[0].footer?G[0].sibling:G[0]);return 1}isNodeSelected(G){let D=this.getRouteToNode(G);return this.isNodePathSelected(D,this.selectedState)}isNodePathSelected([G,...D],z){if(D.length===0){let B=z.toggledNodes.has(G.id);if(G.hasChildren()){if(z.toggledNodes.get(G.id)?.toggledNodes.size)return}return z.selectAllChildren?!B:B}if(z.toggledNodes.has(G.id)){let B=z.toggledNodes.get(G.id);if(B)return this.isNodePathSelected(D,B)}return z.selectAllChildren}getRouteToNode(G){let D=[],z=G;while(z.parent)D.push(z),z=z.parent;return D.reverse()}removeRedundantState(){if(this.filterManager?.isAnyFilterPresent())return;let G=(D=this.selectedState,z,B)=>{if(D.toggledNodes.forEach((U,Z)=>{G(U,Z,D)}),z){let Z=this.rowModel.getRowNode(z)?.childStore;if(Z?.isLastRowIndexKnown()){if(D.toggledNodes.size>=Z.getRowCount()){for(let Y of D.toggledNodes.entries()){let[W,q]=Y;if(q.toggledNodes.size>0)return;if(!this.rowModel.getRowNode(W))return}D.selectAllChildren=!D.selectAllChildren,D.toggledNodes.clear()}}}let Q=D.toggledNodes.size===0,J=B?.selectAllChildren===D.selectAllChildren;if(Q&&J)B?.toggledNodes.delete(z)};G()}recursivelySelectNode([G,...D],z,B){if(!G)return;if(!D.length){let Z=G.selectable;if(z.selectAllChildren===B||!Z){z.toggledNodes.delete(G.id);return}let X={selectAllChildren:B,toggledNodes:new Map};z.toggledNodes.set(G.id,X);return}let J=z.toggledNodes.has(G.id),U=z.toggledNodes.get(G.id)??{selectAllChildren:z.selectAllChildren,toggledNodes:new Map};if(!J)z.toggledNodes.set(G.id,U);if(this.recursivelySelectNode(D,U,B),z.selectAllChildren===U.selectAllChildren&&U.toggledNodes.size===0)z.toggledNodes.delete(G.id)}getSelectedNodes(G=!1){if(LO(202),this.selectedState.selectAllChildren&&G)return null;let D=[];return this.rowModel.forEachNode((z)=>{if(z.isSelected())D.push(z)}),D}processNewRow(){}getSelectedRows(){return this.getSelectedNodes()?.map((G)=>G.data)??[]}getSelectionCount(){return-1}isEmpty(){return!this.selectedState.selectAllChildren&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(G){this.selectedState={selectAllChildren:G,toggledNodes:new Map}}getSelectAllState(){if(this.selectedState.selectAllChildren){if(this.selectedState.toggledNodes.size>0)return null;return!0}if(this.selectedState.toggledNodes.size>0)return null;return!1}},SO=class extends DO{constructor(){super(...arguments);this.beanName="selectionSvc"}postConstruct(){super.postConstruct(),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{let z=G5(this.gos),B=z&&this.selectionStrategy instanceof _1?DB:!z&&this.selectionStrategy instanceof DB?_1:void 0;if(B)this.destroyBean(this.selectionStrategy),this.selectionStrategy=this.createManagedBean(new B(this.selectionCtx)),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api")}),this.addManagedPropertyListeners(["rowSelection"],()=>{let z=D5(this.gos);if(z!==this.selectionMode)this.selectionMode=z,this.deselectAllRowNodes({source:"api"})}),this.selectionMode=D5(this.gos);let D=!G5(this.gos)?_1:DB;this.selectionStrategy=this.createManagedBean(new D(this.selectionCtx))}handleSelectionEvent(G,D,z){if(this.isRowSelectionBlocked(D))return 0;let B=0,Q=this.inferNodeSelections(D,G.shiftKey,G.metaKey||G.ctrlKey,z);if(Q==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in Q){if(Q.reset)this.selectionStrategy.deselectAllRowNodes({source:"api"});else this.selectionStrategy.setNodesSelected({nodes:Q.deselect,newValue:!1,source:z});B=this.selectionStrategy.setNodesSelected({nodes:Q.select,newValue:!0,source:z})}else B=this.selectionStrategy.setNodesSelected({nodes:[Q.node],newValue:Q.newValue,clearSelection:Q.clearSelection,event:G,source:z});return this.shotgunResetNodeSelectionState(z),this.dispatchSelectionChanged(z),B}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(G,D){if(!a0(this.gos)){if(G)ED(132);return}if(Array.isArray(G))return;if(G)this.selectionStrategy.setSelectedState(G),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(D);else this.deselectAllRowNodes({source:D})}setNodesSelected(G){if(!a0(this.gos)&&G.newValue)return ED(132),0;let{nodes:D,...z}=G;if(D.length>1&&this.selectionMode!=="multiRow")return ED(130),0;let B={nodes:D.filter((J)=>J.selectable),...z};if(!B.nodes.length)return 0;let Q=this.selectionStrategy.setNodesSelected(B);return this.shotgunResetNodeSelectionState(B.source),this.dispatchSelectionChanged(B.source),Q}deleteSelectionStateFromParent(G,D){if(!this.selectionStrategy.deleteSelectionStateFromParent(G,D))return;this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api")}shotgunResetNodeSelectionState(G){this.beans.rowModel.forEachNode((D)=>{if(D.stub)return;let z=this.selectionStrategy.isNodeSelected(D);if(z!==D.isSelected())this.selectRowNode(D,z,void 0,G)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()??[]}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(G){this.selectionStrategy.processNewRow(G);let D=this.selectionStrategy.isNodeSelected(G);if(D!=!1&&!G.selectable){this.selectionStrategy.setNodesSelected({nodes:[G],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api");return}G.__selected=D}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"}),this.selectionCtx.reset()}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(){return!0}selectAllRowNodes(G){if(!a0(this.gos)){ED(132);return}if(B5(G),QO(this.gos)&&!BO(this.gos))return ED(130);this.selectionStrategy.selectAllRowNodes(G),this.selectionCtx.selectAll=!0,this.beans.rowModel.forEachNode((D)=>{if(D.stub)return;this.selectRowNode(D,!0,void 0,G.source)}),this.dispatchSelectionChanged(G.source)}deselectAllRowNodes(G){B5(G),this.selectionStrategy.deselectAllRowNodes(G),this.selectionCtx.selectAll=!1,this.beans.rowModel.forEachNode((D)=>{if(D.stub)return;this.selectRowNode(D,!1,void 0,G.source)}),this.dispatchSelectionChanged(G.source)}getSelectAllState(G){return this.selectionStrategy.getSelectAllState(G)}getBestCostNodeSelection(){return ED(194,{method:"getBestCostNodeSelection"})}updateSelectable(){if(!a0(this.gos))return;let G=[];if(this.beans.rowModel.forEachNode((D)=>{if(!this.updateRowSelectable(D,!0)&&D.isSelected())G.push(D)}),G.length)this.setNodesSelected({nodes:G,newValue:!1,source:"selectableChanged"})}dispatchSelectionChanged(G){this.eventSvc.dispatchEvent({type:"selectionChanged",source:G,selectedNodes:this.selectionStrategy instanceof DB?null:this.selectionStrategy.getSelectedNodes(!0,!1),serverSideState:this.getSelectionState()})}updateSelectableAfterGrouping(){return zO(194,{method:"updateSelectableAfterGrouping"})}refreshMasterNodeState(){}setDetailSelectionState(){return}};function B5({selectAll:G}){if(G==="filtered"||G==="currentPage")ED(195,{justCurrentPage:G==="currentPage"})}var YO=class extends XO{constructor(){super(...arguments);this.beanName="rowChildrenSvc"}getHasChildrenValue(G){let D=this.gos.get("treeData"),z=this.gos.get("isServerSideGroup");return!G.stub&&!G.footer&&(D?!!z&&z(G.data):!!G.group)}},_O=class extends WO{constructor(){super(...arguments);this.beanName="lazyBlockLoadingSvc",this.outboundRequests=0,this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}wireBeans(G){this.rowRenderer=G.rowRenderer,this.rowModel=G.rowModel}postConstruct(){this.maxOutboundRequests=HO(this.gos)}subscribe(G){this.cacheLoadingNodesMap.set(G,new Set)}unsubscribe(G){this.cacheLoadingNodesMap.delete(G)}queueLoadCheck(){if(this.isCheckQueued)return;this.isCheckQueued=!0,setTimeout(()=>{this.queueLoadAction(),this.isCheckQueued=!1})}onLoadComplete(){this.outboundRequests-=1,this.queueLoadCheck()}hasAvailableLoadBandwidth(){if(this.maxOutboundRequests===void 0)return!0;return this.outboundRequests{if(!B.isAlive())return;this.loaderTimeout=void 0,this.attemptLoad(B,z,Q),this.nextBlockToLoad=void 0},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(G,D,z){if(!this.hasAvailableLoadBandwidth())return;this.executeLoad(G,D,z),this.queueLoadCheck()}executeLoad(G,D,z){let B=G.getSsrmParams(),Q={startRow:D,endRow:z,rowGroupCols:B.rowGroupCols,valueCols:B.valueCols,pivotCols:B.pivotCols,pivotMode:B.pivotMode,groupKeys:G.store.getParentNode().getRoute()??[],filterModel:B.filterModel,sortModel:B.sortModel},J=this.cacheLoadingNodesMap.get(G),U=()=>{for(let W=0;W{for(let W=0;W{this.onLoadComplete(),G.onLoadSuccess(D,z-D,W),U()},X=()=>{this.onLoadComplete(),G.onLoadFailed(D,z-D),U()},Y=qO(this.gos,{request:Q,success:S,fail:X,parentNode:G.store.getParentNode()});Z(),this.outboundRequests+=1,G.getSsrmParams().datasource?.getRows(Y)}getBlockToLoad(){let G=this.rowRenderer.firstRenderedRow,D=this.rowRenderer.lastRenderedRow;for(let Z=G;Z<=D;Z++){let S=this.rowModel.getRow(Z);if(!S)continue;let X=S.parent?.childStore;if(!X)continue;let Y=X.getCache(),W=Y.getNodes().getBy("node",S);if(!W)continue;if(this.cacheLoadingNodesMap.get(Y)?.has(W.index))continue;if(S.__needsRefreshWhenVisible||S.stub&&!S.failedLoad)return{cache:Y,index:Y.getBlockStartIndex(W.index)}}let z=null,B=null,Q=Number.MAX_SAFE_INTEGER;for(let Z of this.cacheLoadingNodesMap.keys())Z.getNodesToRefresh().forEach((X)=>{if(X.rowIndex==null){B=X,z=Z;return}let Y=Z.getNodes().getBy("node",X);if(!Y)return;if(this.cacheLoadingNodesMap.get(Z)?.has(Y.index))return;let q=Math.abs(G-X.rowIndex),H=Math.abs(X.rowIndex-D);if(q[D,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(G,D){return this.maps.get(G).get(D)}set(G){for(let D of this.indexes)this.maps.get(D).set(G[D],G)}delete(G){for(let D of this.indexes)this.maps.get(D).delete(G[D])}clear(){this.maps.forEach((G)=>G.clear())}getIterator(G){return this.maps.get(G).values()}forEach(G){let D=this.getIterator(this.indexes[0]),z;while(z=D.next()){if(z.done)break;G(z.value)}}find(G){let D=this.getIterator(this.indexes[0]),z;while(z=D.next()){if(z.done)break;if(G(z.value))return z.value}}filter(G){let D=this.getIterator(this.indexes[0]),z,B=[];while(z=D.next()){if(z.done)break;if(G(z.value))B.push(z.value)}return B}},AO=100,w1=class extends NO{constructor(G,D,z,B){super();this.live=!0,this.removedNodeCache=new Map,this.store=G,this.numberOfRows=D,this.isLastRowKnown=z,this.storeParams=B}wireBeans(G){this.rowRenderer=G.rowRenderer,this.blockUtils=G.ssrmBlockUtils,this.focusSvc=G.focusSvc,this.nodeManager=G.ssrmNodeManager,this.serverSideRowModel=G.rowModel,this.rowNodeSorter=G.rowNodeSorter,this.sortSvc=G.sortSvc,this.lazyBlockLoadingSvc=G.lazyBlockLoadingSvc,this.colModel=G.colModel}postConstruct(){this.lazyBlockLoadingSvc.subscribe(this),this.nodeMap=new MO("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set;let{blockUtils:G,gos:D,store:z}=this;this.defaultNodeIdPrefix=G.createNodeIdPrefix(z.getParentNode()),this.getRowIdFunc=EO(D),this.isMasterDetail=D.get("masterDetail")}destroy(){this.lazyBlockLoadingSvc.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach((G)=>this.blockUtils.destroyRowNode(G.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1,super.destroy()}getRowByDisplayIndex(G){if(!this.store.isDisplayIndexInStore(G))return;let D=this.nodeDisplayIndexMap.get(G);if(D){if(D.stub||D.__needsRefreshWhenVisible)this.lazyBlockLoadingSvc.queueLoadCheck();return D}if(this.gos.get("groupHideOpenParents")||this.gos.get("groupAllowUnbalanced")){let S=this.nodeMap.find((X)=>!!X.node.childStore?.isDisplayIndexInStore(G));if(S)return S.node.childStore?.getRowUsingDisplayIndex(G)}if(G===this.store.getDisplayIndexStart())return this.createStubNode(0,G);let B=this.nodeDisplayIndexMap.get(G-1);if(B){if(this.isMasterDetail&&B.master&&B.expanded)return B.detailNode;if(B.expanded&&B.childStore?.isDisplayIndexInStore(G))return B.childStore?.getRowUsingDisplayIndex(G);let S=this.nodeMap.getBy("node",B);return this.createStubNode(S.index+1,G)}let Q=this.getSurroundingNodesByDisplayIndex(G);if(Q==null){let S=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-G);return this.createStubNode(S,G)}let{previousNode:J,nextNode:U}=Q;if(J?.node.expanded&&J.node.childStore?.isDisplayIndexInStore(G))return J.node.childStore?.getRowUsingDisplayIndex(G);if(U){let S=U.node.rowIndex-G,X=U.index-S;return this.createStubNode(X,G)}let Z=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-G);return this.createStubNode(Z,G)}createStubNode(G,D){let z=this.store.getRowBounds(D),B=this.createRowAtIndex(G,null,(Q)=>{Q.setRowIndex(D),Q.setRowTop(z.rowTop),this.nodeDisplayIndexMap.set(D,Q)});if(G===0&&this.gos.get("groupHideOpenParents")){let Q=this.store.getParentNode().groupData;if(Q)for(let J of Object.keys(Q))UZ(B,this.colModel,J,Q[J])}return this.lazyBlockLoadingSvc.queueLoadCheck(),B}getRowByStoreIndex(G){return this.nodeMap.getBy("index",G)?.node}skipDisplayIndexes(G,D,z){if(G===0)return;let B=FO(this.beans);D.value+=G,z.value+=G*B}setDisplayIndexes(G,D,z){this.nodeDisplayIndexMap.clear();let B={};this.nodeMap.forEach((U)=>{B[U.index]=U.node});let Q=-1;for(let U of Object.keys(B)){let Z=B[U],S=Number(U),X=S-1-Q;this.skipDisplayIndexes(X,G,D);let Y=S===0;if(Z.firstChild!==Y)Z.firstChild=Y,Z.dispatchRowEvent("firstChildChanged");if(Y&&this.gos.get("groupHideOpenParents")){let W=this.store.getParentNode().groupData;if(W)for(let q of Object.keys(W))UZ(Z,this.colModel,q,Y?W[q]:void 0)}if(this.blockUtils.setDisplayIndex(Z,G,D,z),Z.rowIndex!=null)this.nodeDisplayIndexMap.set(Z.rowIndex,Z);Q=S}let J=this.numberOfRows-1-Q;this.skipDisplayIndexes(J,G,D),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(G,D){if(this.numberOfRows=G,D!=null){if(this.isLastRowKnown=D,D===!1)this.numberOfRows+=1}this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(G){return this.nodeDisplayIndexMap.get(G)??null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(G){let D,z;if(this.nodeMap.forEach((B)=>{if(G>B.node.rowIndex){if(z==null||z.node.rowIndexB.node.rowIndex)D=B}),!z&&!D)return null;return{previousNode:z,nextNode:D}}getDisplayIndexFromStoreIndex(G){let D=this.nodeMap.getBy("index",G);if(D)return D.node.rowIndex;let z,B;if(this.nodeMap.forEach((U)=>{if(G>U.index){if(B==null||B.indexU.index)z=U}),!z)return this.store.getDisplayIndexEnd()-(this.numberOfRows-G);if(!B)return this.store.getDisplayIndexStart()+G;let Q=G-B.index;return(B.node.childStore?.getDisplayIndexEnd()??B.node.rowIndex)+Q}createRowAtIndex(G,D,z){let B=this.nodeMap.getBy("index",G);if(B){let{node:J}=B;if(J.__needsRefreshWhenVisible=!1,this.doesNodeMatch(D,J))return this.blockUtils.updateDataIntoRowNode(J,D),this.nodesToRefresh.delete(J),J;if(this.getRowIdFunc==null&&J.hasChildren()&&J.expanded)return this.nodesToRefresh.delete(J),J;this.destroyRowAtIndex(G)}if(D&&this.getRowIdFunc!=null){let J=this.getRowId(D),U=J&&this.removedNodeCache?.get(J);if(U)return this.removedNodeCache?.delete(J),this.blockUtils.updateDataIntoRowNode(U,D),this.nodeMap.set({id:U.id,node:U,index:G}),this.nodesToRefresh.delete(U),U.__needsRefreshWhenVisible=!1,U;let Z=this.nodeMap.getBy("id",J);if(Z){this.nodeMap.delete(Z);let{node:S,index:X}=Z;if(this.blockUtils.updateDataIntoRowNode(S,D),this.nodeMap.set({id:S.id,node:S,index:G}),this.nodesToRefresh.delete(S),S.__needsRefreshWhenVisible=!1,this.getBlockStartIndex(X)===this.getBlockStartIndex(G))return S;return this.markBlockForVerify(X),S}}let Q=this.blockUtils.createRowNode(this.store.getRowDetails());if(D!=null){let J=this.getPrefixedId(this.store.getIdSequence().value++);this.blockUtils.setDataIntoRowNode(Q,D,J,void 0),this.blockUtils.checkOpenByDefault(Q),this.nodeManager.addRowNode(Q)}if(this.nodeMap.set({id:Q.id,node:Q,index:G}),z)z(Q);return Q}getBlockStates(){let G={},D={};this.nodeMap.forEach(({node:J,index:U})=>{let Z=this.getBlockStartIndex(U);if(!J.stub&&!J.failedLoad)G[Z]=(G[Z]??0)+1;let S="loaded";if(J.failedLoad)S="failed";else if(this.lazyBlockLoadingSvc.isRowLoading(this,Z))S="loading";else if(this.nodesToRefresh.has(J)||J.stub)S="needsLoading";if(!D[Z])D[Z]=new Set;D[Z].add(S)});let z={loading:4,failed:3,needsLoading:2,loaded:1},B=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),Q={};for(let J of Object.keys(D)){let Z=[...D[J]].sort((Y,W)=>(z[Y]??0)-(z[W]??0))[0],S=Number(J)/this.getBlockSize(),X=B?`${B}-${S}`:String(S);Q[X]={blockNumber:S,startRow:Number(J),endRow:Number(J)+this.getBlockSize(),pageStatus:Z,loadedRowCount:G[J]??0}}return Q}destroyRowAtIndex(G){let D=this.nodeMap.getBy("index",G);if(!D)return;if(this.nodeMap.delete(D),this.nodeDisplayIndexMap.delete(D.node.rowIndex),this.nodesToRefresh.size>0)this.removedNodeCache.set(D.node.id,D.node);else this.blockUtils.destroyRowNode(D.node);this.nodesToRefresh.delete(D.node)}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(G){if(this.defaultNodeIdPrefix)return this.defaultNodeIdPrefix+"-"+G;else return G.toString()}markBlockForVerify(G){let[D,z]=this.getBlockBounds(G);this.nodeMap.filter((Q)=>Q.index>=D&&Q.index{Q.__needsRefreshWhenVisible=!0})}doesNodeMatch(G,D){if(D.stub)return!1;let z=this.getRowId(G);return z===null?D.data===G:D.id===z}purgeStubsOutsideOfViewport(){let{firstRenderedRow:G,lastRenderedRow:D}=this.rowRenderer,z=this.getBlockStartIndex(G),[,B]=this.getBlockBounds(D);this.nodeMap.forEach((Q)=>{if(this.lazyBlockLoadingSvc.isRowLoading(this,Q.index)||Q.node.failedLoad)return;if(Q.node.stub&&(Q.indexB))this.destroyRowAtIndex(Q.index)})}getBlocksDistanceFromRow(G,D){let z={};return G.forEach(({node:B,index:Q})=>{let[J,U]=this.getBlockBounds(Q);if(J in z)return;let Z=Math.abs(B.rowIndex-D),S,X=this.nodeMap.getBy("index",[U-1]);if(X)S=Math.abs(X.node.rowIndex-D);let Y=S==null||Z{let k=this.getBlockStartIndex(H);if(z.add(k),_.rowIndex>=G&&_.rowIndex<=D)B.add(k)});let Q=Math.max(B.size,this.storeParams.maxBlocksInCache??0),U=z.size-Q;if(U<=0)return;let{MAX_SAFE_INTEGER:Z,MIN_SAFE_INTEGER:S}=Number;B.forEach((H)=>{if(Z>H)Z=H;if(S{let k=this.getBlockStartIndex(_);return!(k>=Z&&k<=S)&&!this.isNodeCached(H)});if(X.length===0)return;let Y=G+(D-G)/2,W=this.getBlocksDistanceFromRow(X,Y),q=this.getBlockSize();W.sort((H,_)=>Math.sign(_[1]-H[1]));for(let H=0;H{let Q=this.getRowId(B);if(D.has(Q)){z.add(Q);return}D.add(Q)}),[...z]}onLoadSuccess(G,D,z){if(!this.live)return;let B=z.groupLevelInfo;if(this.store.setStoreInfo(B),this.getRowIdFunc!=null){let U=this.extractDuplicateIds(z.rowData);if(U.length>0){let Z=U.join(", ");IO(205,{duplicateIdText:Z}),this.onLoadFailed(G,D);return}}if(z.pivotResultFields)this.serverSideRowModel.generateSecondaryColumns(z.pivotResultFields);let Q=this.nodesToRefresh.size>0;if(z.rowData.forEach((U,Z)=>{let S=G+Z,X=this.nodeMap.getBy("index",S);if(X?.node?.stub){this.createRowAtIndex(S,U);return}if(X&&this.doesNodeMatch(U,X.node)){this.blockUtils.updateDataIntoRowNode(X.node,U),this.nodesToRefresh.delete(X.node),X.node.__needsRefreshWhenVisible=!1;return}this.createRowAtIndex(S,U)}),z.rowCount!=null&&z.rowCount!==-1)this.numberOfRows=z.rowCount,this.isLastRowKnown=!0;else if(D>z.rowData.length)this.numberOfRows=G+z.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){let U=G+z.rowData.length+1;if(U>this.numberOfRows)this.numberOfRows=U}if(this.isLastRowKnown)this.nodeMap.filter((Z)=>Z.index>=this.numberOfRows).forEach((Z)=>this.destroyRowAtIndex(Z.index));this.fireStoreUpdatedEvent();let J=this.nodesToRefresh.size===0;if(Q&&J)this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){if(this.nodesToRefresh.size!==0)return;this.removedNodeCache.forEach((D)=>{this.blockUtils.destroyRowNode(D)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent()}isStoreFullyLoaded(){let G=this.isLastRowKnown,D=this.nodeMap.getSize()===this.numberOfRows;if(!G||!D)return;if(this.nodesToRefresh.size>0)return;let z=-1;return this.nodeMap.find((Q)=>{if(z+=1,Q.index!==z)return!0;if(Q.node.__needsRefreshWhenVisible)return!0;if(Q.node.stub)return!0;return!1})==null}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(G,D){if(!this.live)return;let z=this.nodesToRefresh.size>0;for(let Q=G;Q{if(G.node.stub&&!G.node.failedLoad)return;this.nodesToRefresh.add(G.node)}),this.lazyBlockLoadingSvc.queueLoadCheck(),this.isLastRowKnown&&this.numberOfRows===0)this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent()}isNodeInCache(G){return!!this.nodeMap.getBy("id",G)}fireStoreUpdatedEvent(){if(!this.live)return;this.store.fireStoreUpdatedEvent()}getRowId(G){if(this.getRowIdFunc==null)return null;let{level:D}=this.store.getRowDetails(),z=this.store.getParentNode().getRoute()??[];return this.getRowIdFunc({data:G,parentKeys:z.length>0?z:void 0,level:D})}getOrderedNodeMap(){let G={};return this.nodeMap.forEach((D)=>G[D.index]=D),G}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){let G=this.sortSvc?.getSortOptions()??[],D=G.some((U)=>U.sort!=null),z=this.rowNodeSorter;if(!D||!z)return;let B=Array(this.nodeMap.getSize()),Q=this.nodeMap;Q.forEach((U)=>B[U.index]=U.node),Q.clear();let J=z.doFullSortInPlace(B,G);for(let U=0,Z=J.length;U{let B=this.getRowId(z),Q=this.nodeMap.getBy("id",B);if(Q)this.blockUtils.updateDataIntoRowNode(Q.node,z),D.push(Q.node)}),D}insertRowNodes(G,D){let z=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),B=D==null&&this.isLastRowKnown?z:D;if(B==null||z{let X=this.getRowId(S);if(X&&this.isNodeInCache(X))return;Q[X]=S});let J=Object.values(Q),U=J.length;if(U===0)return[];let Z=this.nodeMap.filter((S)=>S.index>=B);return Z.forEach((S)=>this.nodeMap.delete(S)),Z.forEach((S)=>{this.nodeMap.set({node:S.node,index:S.index+U,id:S.id})}),this.numberOfRows+=U,J.map((S,X)=>this.createRowAtIndex(B+X,S))}removeRowNodes(G,D){let z=[],B=[],Q=0,J=[...G],U=this.getOrderedNodeMap(),Z=-1;for(let X of Object.keys(U)){Z+=1;let Y=U[X],W=J.findIndex((H)=>H===Y.id);if(W!==-1){J.splice(W,1),this.destroyRowAtIndex(Number(X)),z.push(Y.node),Q+=1;continue}if(Q===0)continue;let q=Number(X);if(Z!==q)B.push(Y.node);this.nodeMap.delete(Y),this.nodeMap.set({id:Y.id,node:Y.node,index:q-Q})}if(D!=null&&D>=0)this.numberOfRows=D,this.isLastRowKnown=!0;else this.numberOfRows-=Q;if(J.length>0&&B.length>0)B.forEach((X)=>X.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingSvc.queueLoadCheck();return z}getBlockSize(){return this.storeParams.cacheBlockSize||AO}getBlockStartIndex(G){let D=this.getBlockSize();return G-G%D}getBlockBounds(G){let D=this.getBlockStartIndex(G),z=this.getBlockSize();return[D,D+z]}},RO=class extends wO{constructor(G,D,z){super();this.idSequence={value:0},this.ssrmParams=G,this.parentRowNode=z,this.storeParams=D,this.level=z.level+1,this.group=G.rowGroupCols?this.levelD({level:this.level,parentKeys:this.parentRowNode.getRoute()??[],data:q})),W=[...new Set(Y)];U=this.cache.removeRowNodes(W,G.rowCount)}let Z=this.gos.get("serverSideEnableClientSideSort"),S=Q?.length||J?.length;if(B&&Z&&S)this.cache.clientSideSortRows();return this.updateSelectionAfterTransaction(Q,U),{status:k1.Applied,update:Q,add:J,remove:U}}updateSelectionAfterTransaction(G,D){if(!this.selectionSvc)return;let z=[];for(let B of G??[])if(B.isSelected()&&!B.selectable)z.push(B);for(let B of D??[])if(B.isSelected())z.push(B);if(z.length)this.selectionSvc.setNodesSelected({newValue:!1,clearSelection:!1,nodes:z,source:"rowDataChanged"})}clearDisplayIndexes(){if(this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach((G)=>this.blockUtils.clearDisplayIndex(G.node)),this.parentRowNode.sibling)this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling);this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){if(this.parentRowNode.sibling)return this.cache.getRowCount()+1;return this.cache.getRowCount()}setRowCount(G,D){this.cache.setRowCount(G,D)}isDisplayIndexInStore(G){if(this.cache.getRowCount()===0)return!1;return this.displayIndexStart<=G&&G-1&&J5(this.gos)({node:this.parentRowNode});if(!B)EJ(this.parentRowNode);if(B==="top")pG(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,G,D,z);if(this.cache.setDisplayIndexes(G,D,z),B==="bottom")pG(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,G,D,z);this.displayIndexEnd=G.value,this.heightPx=D.value-this.topPx}forEachStoreDeep(G,D={value:0}){G(this,D.value++),this.cache.getNodes().forEach((z)=>{let B=z.node.childStore;if(B)B.forEachStoreDeep(G,D)})}forEachNodeDeep(G,D={value:0}){this.cache.getNodes().forEach((z)=>{G(z.node,D.value++);let B=z.node.childStore;if(B)B.forEachNodeDeep(G,D)})}forEachNodeDeepAfterFilterAndSort(G,D={value:0},z=!1){let B=this.parentRowNode.level>-1&&J5(this.gos)({node:this.parentRowNode});if(B==="top")G(this.parentRowNode.sibling,D.value++);let Q=this.cache.getOrderedNodeMap();for(let J of Object.values(Q)){G(J.node,D.value++);let U=J.node.childStore;if(U)U.forEachNodeDeepAfterFilterAndSort(G,D,z)}if(B==="bottom")G(this.parentRowNode.sibling,D.value++)}retryLoads(){this.cache.getNodes().forEach(({node:G})=>{if(G.failedLoad)G.failedLoad=!1,G.__needsRefreshWhenVisible=!0,G.stub=!0}),this.forEachChildStoreShallow((G)=>G.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(G){if(this.parentRowNode.sibling&&G===this.parentRowNode.sibling.rowIndex)return this.parentRowNode.sibling;return this.cache.getRowByDisplayIndex(G)}getRowBounds(G){if(!this.isDisplayIndexInStore(G))return null;let D=this.cache.getNodeCachedByDisplayIndex(G);if(D){let Z=this.blockUtils.extractRowBounds(D,G);if(Z)return Z}let{previousNode:z,nextNode:B}=this.cache.getSurroundingNodesByDisplayIndex(G)??{};if(z){let Z=this.blockUtils.extractRowBounds(z.node,G);if(Z!=null)return Z}let Q=U5(this.beans);if(B){let Z=(B.node.rowIndex-G)*Q;return{rowTop:B.node.rowTop-Z,rowHeight:Q}}let J=this.topPx+this.heightPx,U=(this.getDisplayIndexEnd()-G)*Q;return{rowTop:J-U,rowHeight:Q}}isPixelInRange(G){return G>=this.topPx&&G=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&G>this.parentRowNode.sibling.rowTop&&G{let X=Math.abs(G-S.rowTop);if(S.rowTop{let z=this.cache.getNodes().find((B)=>B.node.key==D);if(!z)return null;return z.node})}forEachChildStoreShallow(G){this.cache.getNodes().forEach(({node:D})=>{if(D.childStore)G(D.childStore)})}refreshAfterSort(G){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,G)){let z=this.cache.isStoreFullyLoaded(),B=this.gos.get("serverSideEnableClientSideSort");if(!(z&&B)){let J=this.cache.getRowCount(),U=this.cache.isLastRowIndexKnown();this.destroyBean(this.cache),this.cache=this.createManagedBean(new w1(this,J,U,this.storeParams));return}this.cache.clientSideSortRows()}this.forEachChildStoreShallow((z)=>z.refreshAfterSort(G))}refreshAfterFilter(G){if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,G)){this.refreshStore(!0);return}this.forEachChildStoreShallow((z)=>z.refreshAfterFilter(G))}refreshStore(G){if(G){this.destroyBean(this.cache),this.cache=this.createManagedBean(new w1(this,1,!1,this.storeParams)),this.fireStoreUpdatedEvent();return}this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(G){return this.cache.getDisplayIndexFromStoreIndex(G)??G}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(G,D){return this.cache.getNodes().filter(({node:z})=>{return z.rowIndex>=G.rowIndex&&z.rowIndex<=D.rowIndex}).map(({node:z})=>z)}addStoreStates(G){G.push({route:this.parentRowNode.getRoute()??[],rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow((D)=>D.addStoreStates(G))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(G){if(G)Object.assign(this.info,G)}fireStoreUpdatedEvent(){this.eventSvc.dispatchEvent({type:"storeUpdated"})}fireRefreshFinishedEvent(){this.eventSvc.dispatchEvent({type:"storeRefreshed",route:this.parentRowNode.getRoute()})}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}getFirstNode(){return this.cache.getNodes().getBy("index",0)?.node??null}},CO=class extends kO{constructor(){super(...arguments);this.beanName="ssrmStoreFactory"}wireBeans(G){this.colModel=G.colModel,this.rowGroupColsSvc=G.rowGroupColsSvc,this.pivotColsSvc=G.pivotColsSvc,this.rowAutoHeight=G.rowAutoHeight}createStore(G,D){let z=this.getStoreParams(G,D);return new RO(G,z,D)}getStoreParams(G,D){let z=this.getLevelSpecificParams(D),B=this.getBlockSize(z),Q=this.getMaxBlocksInCache(G,z);return{cacheBlockSize:B,maxBlocksInCache:Q}}getMaxBlocksInCache(G,D){let z=D?.maxBlocksInCache!=null?D.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(!(z!=null&&z>=0))return;if(G.dynamicRowHeight){Q5(203);return}if(this.rowAutoHeight?.active){Q5(204);return}return z}getBlockSize(G){let D=G?.cacheBlockSize!=null?G.cacheBlockSize:this.gos.get("cacheBlockSize");if(D!=null&&D>0)return D;else return 100}getLevelSpecificParams(G){let D=this.gos.getCallback("getServerSideGroupLevelParams");if(!D)return;let z={level:G.level+1,parentRowNode:G.level>=0?G:void 0,rowGroupColumns:this.rowGroupColsSvc?.columns??[],pivotColumns:this.pivotColsSvc?.columns??[],pivotMode:this.colModel.isPivotMode()};return D(z)}},bO=class extends VO{constructor(){super(...arguments);this.beanName="ssrmStoreUtils"}wireBeans(G){this.colModel=G.colModel,this.serverSideRowModel=G.rowModel,this.storeFactory=G.ssrmStoreFactory}getChildStore(G,D,z){if(!G?.length)return D;let B=G[0],Q=z(B);if(Q){if(G.length===1&&!Q.childStore){let Z=this.serverSideRowModel.getParams();Q.childStore=this.createBean(this.storeFactory.createStore(Z,Q))}let J=G.slice(1,G.length),U=Q.childStore;return U?U.getChildStore(J):null}return null}isServerRefreshNeeded(G,D,z){if(z.valueColChanged||z.secondaryColChanged)return!0;let B=G.level+1;if(!(B-1)return!0;return this.colModel.getCols().filter((Y)=>Y.getColDef().showRowGroup&&z.changedColumns.includes(Y.getId())).map((Y)=>Y.getColDef().showRowGroup).some((Y)=>Y===!0||Y===U)}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&Z5(this.gos)}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&Z5(this.gos)}},OO=class extends vO{constructor(){super(...arguments);this.beanName="ssrmTxnManager",this.asyncTransactions=[]}wireBeans(G){this.valueCache=G.valueCache,this.serverSideRowModel=G.rowModel,this.selectionSvc=G.selectionSvc}applyTransactionAsync(G,D){if(this.asyncTransactionsTimeout==null)this.scheduleExecuteAsync();this.asyncTransactions.push({transaction:G,callback:D})}scheduleExecuteAsync(){let G=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},G)}executeAsyncTransactions(){if(!this.asyncTransactions)return;let G=[],D=[],z=[],B=!1;for(let Q of this.asyncTransactions){let J;if(!this.serverSideRowModel.executeOnStore(Q.transaction.route,(S)=>{J=S.applyTransaction(Q.transaction)}))J={status:fD.StoreNotStarted};else if(J==null)J={status:fD.StoreNotFound};if(D.push(J),J.status==fD.StoreLoading){z.push(Q);continue}if(Q.callback)G.push(()=>Q.callback(J));if(J.status===fD.Applied)B=!0}if(G.length>0)window.setTimeout(()=>{for(let Q of G)Q()},0);if(this.asyncTransactionsTimeout=void 0,this.asyncTransactions=z,B)this.valueCache?.onDataChanged(),this.eventSvc.dispatchEvent({type:"storeUpdated"});if(D.length>0)this.eventSvc.dispatchEvent({type:"asyncTransactionsFlushed",results:D})}flushAsyncTransactions(){if(this.asyncTransactionsTimeout!=null)clearTimeout(this.asyncTransactionsTimeout);this.executeAsyncTransactions()}applyTransaction(G){let D;if(!this.serverSideRowModel.executeOnStore(G.route,(B)=>{D=B.applyTransaction(G)}))return{status:fD.StoreNotStarted};else if(D){if(this.valueCache?.onDataChanged(),D.remove&&this.selectionSvc){let B=D.remove.map((Q)=>Q.id);this.selectionSvc.deleteSelectionStateFromParent(G.route||[],B)}return this.eventSvc.dispatchEvent({type:"storeUpdated"}),D}else return{status:fD.StoreNotFound}}},L8={moduleName:"ServerSideRowModel",version:j,rowModels:["serverSide"],beans:[yv,kv,bO,qv,Vv,OO,Nv,CO,Ev,SO,_O,YO,GO,Av],dependsOn:[i,wb,kb,U8,Z8,Ab]},S8={moduleName:"ServerSideRowModelApi",version:j,apiFunctions:{getServerSideSelectionState:cv,setServerSideSelectionState:hv,applyServerSideTransaction:iv,applyServerSideTransactionAsync:dv,applyServerSideRowData:nv,retryServerSideLoads:lv,flushServerSideAsyncTransactions:pv,refreshServerSide:mv,getServerSideGroupLevelState:tv,resetRowHeights:Nb,onRowHeightChanged:fb},dependsOn:[i,_b,Hb,Kb]},$5=/\$?[A-Za-z]+\$?[0-9]+(?::\$?[A-Za-z]+\$?[0-9]+)?/g,cO=/^(\$?)([A-Za-z]+)(\$?)([0-9]+)(?::(\$?)([A-Za-z]+)(\$?)([0-9]+))?$/,hO=/[A-Za-z0-9]/,L0=(G)=>{return!!G&&hO.test(G)},tB=(G)=>{return!!G&&/[A-Za-z]/.test(G)},L5=(G)=>{return L0(G??void 0)},Y8=(G,D,z)=>{let B=D>0?G[D-1]:null;if(L5(B))return!1;if(z.endsWith(":"))return!0;let Q=D+z.length,J=Q{let B=(D.allowTrailingColon??!1)&&G.endsWith(":")?G.slice(0,-1):G,Q=cO.exec(B);if(!Q)return null;let[,J,U,Z,S,X,Y,W,q]=Q;return{startCol:U,startRow:S,startColAbsolute:J==="$",startRowAbsolute:Z==="$",...!!(Y&&q)?{endCol:Y,endRow:q,endColAbsolute:X==="$",endRowAbsolute:W==="$"}:null}},W8=(G)=>{let D=[],z,B=0;$5.lastIndex=0;while((z=$5.exec(G))!=null){let Q=z[0],J=z.index??0,U=J+Q.length;if(U","&"]),H8=(G,D)=>{for(let z=D-1;z>=0;z--){let B=G[z];if(B!=null&&B.trim()!=="")return B}return null},pO="ag-formula-token-color",mO="ag-formula-range-color",uJ=(G,D)=>{let z=D??0;return{tokenClass:`${pO}-${z+1}`,rangeClass:`${mO}-${z+1}`,colorIndex:z}},f1=(G)=>{if(!G)return null;let D=/ag-formula-range-color-(\d+)/.exec(G);if(!D)return null;let z=parseInt(D[1],10);return Number.isFinite(z)?z-1:null},tO=(G,D,z)=>{if(!G)return;let{rangeClass:B}=uJ(D,z);G.colorClass=B},_8=(G,D)=>{let z=OJ(D,{allowTrailingColon:!0});if(!z)return null;let{formula:B}=G,{startCol:Q,startRow:J,endCol:U,endRow:Z}=z,S=Q,X=U??Q,Y=B?.getColByRef(S),W=B?.getColByRef(X);if(!Y||!W)return null;let q=parseInt(J,10)-1,H=Z?parseInt(Z,10)-1:q;if(q<0||H<0)return null;let _=G.rowModel;if(!_?.getFormulaRow(q)||!_.getFormulaRow(H))return null;return{rowStartIndex:q,rowEndIndex:H,columnStart:Y,columnEnd:W}},sO=(G)=>{let D=G.rangeSvc?.getCellRanges(),z=D?.length?D[D.length-1]:null;if(!z)return null;return QD(G,z)},QD=(G,D)=>{let{rangeSvc:z,formula:B}=G;if(!z||!B)return null;let Q=z.getRangeStartRow(D),J=z.getRangeEndRow(D);if(!Q||!J||Q.rowPinned||J.rowPinned)return null;let U=Math.min(Q.rowIndex,J.rowIndex)+1,Z=Math.max(Q.rowIndex,J.rowIndex)+1,S=D.columns?.filter((w)=>!lO(w)&&!!B.getColRef(w));if(!S?.length)return null;let X=[...S],Y=X[0],W=X[X.length-1],q=B.getColRef(Y),H=B.getColRef(W);if(!q||!H)return null;if(q===H&&U===Z)return`${q}${U}`;return`${q}${U}:${H}${Z}`},Yz=(G,D)=>{let z=W8(D),{formula:B}=G;if(!B)return z;let Q=[],J=0;for(let U of z){if(!_8(G,U.ref))continue;Q.push({...U,index:J}),J+=1}return Q},S5=(G,D)=>{return Yz(G,D).map(({ref:B,index:Q})=>({ref:B,index:Q}))},oO=class extends nO{constructor(G){super();this.field=G,this.functionAutocompleteList=null,this.functionAutocompleteToken=null,this.functionAutocompleteEntries=null,this.functionAutocompleteSearch=null}postConstruct(){this.addManagedElementListeners(this.field.getContentElement(),{keydown:this.onContentKeyDown.bind(this),mouseup:this.updateFunctionAutocomplete.bind(this),focusin:this.updateFunctionAutocomplete.bind(this),focusout:this.closeFunctionAutocomplete.bind(this)}),this.addDestroyFunc(()=>this.closeFunctionAutocomplete())}onPlainValueUpdated(){this.closeFunctionAutocomplete()}onFormulaValueUpdated(){this.updateFunctionAutocomplete()}onContentKeyDown(G){if(this.functionAutocompleteList)switch(G.key){case iG.ENTER:case iG.TAB:G.preventDefault(),G.stopPropagation(),this.confirmFunctionAutocomplete();return;case iG.ESCAPE:G.preventDefault(),G.stopPropagation(),this.closeFunctionAutocomplete();return;case iG.UP:case iG.DOWN:this.functionAutocompleteList.onNavigationKeyDown(G,G.key);return}switch(G.key){case iG.LEFT:case iG.RIGHT:case iG.PAGE_HOME:case iG.PAGE_END:this.scheduleFunctionAutocompleteUpdate();break}}scheduleFunctionAutocompleteUpdate(){setTimeout(()=>{if(!this.isAlive())return;this.updateFunctionAutocomplete()})}updateFunctionAutocomplete(){if(!this.isContentFocused()){this.closeFunctionAutocomplete();return}let{field:G,beans:D}=this,z=G.getCurrentValue();if(!z.trimStart().startsWith("=")){this.closeFunctionAutocomplete();return}let Q=G.getCaretOffsetsForAutocomplete(z);if(!Q){this.closeFunctionAutocomplete();return}if(aO(D,z,Q.valueOffset)){this.closeFunctionAutocomplete();return}let J=rO(z,Q.valueOffset,D.formula??null);if(!J){this.closeFunctionAutocomplete();return}let{prefix:U}=J;if(!U.length){this.closeFunctionAutocomplete();return}let Z=this.getFunctionAutocompleteEntries();if(!Z.length){this.closeFunctionAutocomplete();return}let S=U.toLocaleLowerCase();if(!Z.some(({key:Y})=>Y.toLocaleLowerCase().startsWith(S))){this.closeFunctionAutocomplete();return}if(this.functionAutocompleteToken=J,this.openFunctionAutocomplete(Z),this.functionAutocompleteList&&this.functionAutocompleteSearch!==U)this.functionAutocompleteList.setSearch(U),this.functionAutocompleteSearch=U}getFunctionAutocompleteEntries(){let G=this.beans.formula,D=G?.active?G.getFunctionNames?.()??[]:[];if(!this.functionAutocompleteEntries||this.functionAutocompleteEntries.length!==D.length)this.functionAutocompleteEntries=D.map((z)=>({key:z}));return this.functionAutocompleteEntries}openFunctionAutocomplete(G){if(this.functionAutocompleteList||!G.length)return;let D=this.beans.popupSvc;if(!D)return;let z=null,B=()=>{if(this.functionAutocompleteList&&z)D.positionPopupByComponent(z)};this.functionAutocompleteList=this.createManagedBean(new y6({autocompleteEntries:G,onConfirmed:()=>this.confirmFunctionAutocomplete(),useStartsWithSearch:!0,autoSizeList:!0,maxVisibleItems:10,onListHeightChanged:B}));let Q=this.functionAutocompleteList.getGui();z={ePopup:Q,type:"autocomplete",eventSource:this.field.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0};let J=D.addPopup({eChild:Q,anchorToElement:this.field.getGui(),positionCallback:B,ariaLabel:"Formula functions"});this.functionAutocompleteHidePopup=J.hideFunc,this.functionAutocompleteList.afterGuiAttached()}closeFunctionAutocomplete(){if(this.functionAutocompleteToken=null,this.functionAutocompleteSearch=null,!this.functionAutocompleteList)return;this.functionAutocompleteHidePopup?.(),this.functionAutocompleteHidePopup=void 0,this.destroyBean(this.functionAutocompleteList),this.functionAutocompleteList=null}confirmFunctionAutocomplete(){let G=this.functionAutocompleteToken,D=this.functionAutocompleteList?.getSelectedValue();if(!G||!D){this.closeFunctionAutocomplete();return}let{field:z}=this,B=z.getCurrentValue(),Q=D.key,J=B.slice(0,G.start)+Q+B.slice(G.end),U=G.start+Q.length,Z=J[U]==="("?J:J.slice(0,U)+"("+J.slice(U);z.getContentElement().focus({preventScroll:!0}),z.applyFormulaValueChange({currentValue:B,nextValue:Z,caret:U+1}),this.closeFunctionAutocomplete()}isContentFocused(){return dO(this.beans).activeElement===this.field.getContentElement()}},rO=(G,D,z)=>{if(D<0||D>G.length||eO(G,D))return null;let B=D;while(B>0&&L0(G[B-1]))B--;let Q=D;while(Q{for(let B of Yz(G,D))if(z>=B.start&&z<=B.end)return!0;return!1},eO=(G,D)=>{let z=!1;for(let B=0;B{this.rangeSelectionEnabled=!1,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.clearTrackedRanges(!0)}}postConstruct(){this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this)}),this.addDestroyFunc(()=>this.disableRangeSelectionWhileEditing()),this.addDestroyFunc(()=>this.unregisterActiveEditor())}onValueUpdated(G,D){if(this.skipNextValueUpdate){this.skipNextValueUpdate=!1;return}if(!this.isActiveEditor())return;if(D){if(this.enableRangeSelectionWhileEditing())this.skipNextValueUpdate=!0,this.field.setValue(G,!0);this.syncRangesFromFormula(G);return}this.disableRangeSelectionWhileEditing()}setEditingCellRef(G,D,z){this.editingColumn=G,this.editingRowIndex=D??void 0,this.editingCellRef=z}setEditorActive(G){if(G){this.registerActiveEditor();return}this.unregisterActiveEditor()}withSelectionChangeHandlingSuppressed(G){let D=this.suppressSelectionChangeHandling;this.suppressSelectionChangeHandling=!0;try{G()}finally{this.suppressSelectionChangeHandling=D}}deactivateForFocusLoss(){if(!this.isActiveEditor())return;this.handleEditorDeactivated(),this.beans.editSvc?.disableRangeSelectionWhileEditing?.(),this.unregisterActiveEditor()}registerActiveEditor(){let G=this.field.getCompId(),{formulaInputManager:D}=this.beans;if(!D)return;if(!D.registerActiveEditor(G,this.handleEditorDeactivated))return;this.rangeSelectionEnabled=!1,this.suppressRangeEvents=!1,this.ignoreNextRangeEvent=!1,this.skipNextValueUpdate=!1,this.clearTrackedRanges(!1);let B=this.field.getCurrentValue(),Q=B.trimStart().startsWith("=");this.onValueUpdated(B,Q)}unregisterActiveEditor(){let G=this.field.getCompId(),{formulaInputManager:D}=this.beans;if(!D)return;D.unregisterActiveEditor(G,this.handleEditorDeactivated)}isActiveEditor(){let G=this.field.getCompId(),{formulaInputManager:D}=this.beans;return!!D&&D.isActiveEditor(G)}getTrackedRefCount(G){return this.trackedRangeRefs.get(G)??0}hasTrackedRef(G){return this.getTrackedRefCount(G)>0}addTrackedRef(G){this.trackedRangeRefs.set(G,this.getTrackedRefCount(G)+1)}removeTrackedRef(G){let D=this.getTrackedRefCount(G)-1;if(D<=0){this.trackedRangeRefs.delete(G);return}this.trackedRangeRefs.set(G,D)}enableRangeSelectionWhileEditing(){if(this.rangeSelectionEnabled)return!1;return this.rangeSelectionEnabled=!0,this.beans.editSvc?.enableRangeSelectionWhileEditing?.(),!0}disableRangeSelectionWhileEditing(){if(!this.rangeSelectionEnabled&&!this.trackedRangeRefs.size)return;this.rangeSelectionEnabled=!1,this.beans.editSvc?.disableRangeSelectionWhileEditing?.(),this.clearTrackedRanges(this.isActiveEditor())}clearTrackedRanges(G=!0){if(G)Array.from(this.trackedRangeRefs.keys()).forEach((z)=>this.removeRangeForRef(z));this.trackedRangeRefs.clear(),this.trackedRanges.clear()}getLiveRanges(){return this.beans.rangeSvc?.getCellRanges()??[]}withSuppressedRangeEvents(G){this.suppressRangeEvents=!0,G(),this.suppressRangeEvents=!1}setCellRangesSilently(G){let D=this.beans.rangeSvc;if(!D)return;this.withSuppressedRangeEvents(()=>D.setCellRanges(G))}getColorIndexForTokenOrRef(G,D){return this.field.getColorIndexForToken(D??null)??this.field.getColorIndexForRef(G)}normaliseRefForComparison(G){if(!G)return null;return(G.endsWith(":")?G.slice(0,-1):G).replace(/\$/g,"").toUpperCase()}tagRangeColor(G,D,z){let{rangeClass:B}=uJ(D,z);if(G.colorClass===B)return!1;return tO(G,D,z),!0}trackRange(G,D,z){let B=this.trackedRanges.get(G),Q=z!==void 0?z:B?.tokenIndex??null;if(!B)this.addTrackedRef(D);else if(B.ref!==D)this.removeTrackedRef(B.ref),this.addTrackedRef(D);this.trackedRanges.set(G,{ref:D,tokenIndex:Q})}getUntrackedFormulaRangesByRef(){let G=new Map,D=this.getLiveRanges();for(let z of D){if(this.trackedRanges.has(z))continue;if(f1(z.colorClass)==null)continue;let B=QD(this.beans,z);if(!B||B===this.editingCellRef)continue;let Q=G.get(B);if(Q)Q.push(z);else G.set(B,[z])}return G}syncRangesFromFormula(G){let D=G??this.field.getCurrentValue()??"";if(!this.rangeSelectionEnabled){this.clearTrackedRanges();return}let z=S5(this.beans,D),B=new Map;for(let X of z){let{ref:Y,index:W}=X;if(Y===this.editingCellRef)continue;let q=B.get(Y)??[];q.push(W),B.set(Y,q)}for(let X of Array.from(this.trackedRangeRefs.keys()))if(!B.has(X))this.removeRangeForRef(X);if(!this.beans.rangeSvc)return;let J=new Set(this.getLiveRanges());for(let[X,Y]of this.trackedRanges.entries())if(!J.has(X))this.trackedRanges.delete(X),this.removeTrackedRef(Y.ref);let U=this.getUntrackedFormulaRangesByRef(),Z=!1;for(let[X,Y]of B.entries()){let W=[];for(let[H,_]of this.trackedRanges.entries())if(_.ref===X)W.push(H);let q=U.get(X);while(W.lengthY.length){let H=W.pop();if(H)this.removeTrackedRange(H)}while(W.length!S.includes(W));if(Y.length!==X.length)this.setCellRangesSilently(Y),Z=!0}if(Z)this.refreshRangeStyling()}onCellSelectionChanged(G){if(!this.isActiveEditor()||!this.rangeSelectionEnabled||!this.beans.editSvc?.isRangeSelectionEnabledWhileEditing?.())return;if(this.ignoreNextRangeEvent){this.ignoreNextRangeEvent=!1;return}if(this.suppressSelectionChangeHandling)return;let{finished:D,started:z}=G,B=this.getLiveRanges(),Q=B.filter((W)=>!this.isSpecialOnlyRange(W));if(Q.length!==B.length){this.setCellRangesSilently(Q),this.refocusEditingCell();return}let J=B.length?N1(B):null,U=J?QD(this.beans,J):null,Z=!!J&&!this.trackedRanges.has(J)&&!!U&&U!==this.editingCellRef,S=D&&(z||Z),X=this.ensureTrackedRangeColors();if(this.suppressRangeEvents){if(X)this.refreshRangeStyling();return}if(z||Z)this.field.rememberCaret();if(!Z&&this.handleRemovedRangeTokens()){this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}if(this.updateTrackedRangeTokens())return;let Y=sO(this.beans);if(!Y||Y===this.editingCellRef){this.refocusEditingCell();return}if(S){let{action:W,previousRef:q,tokenIndex:H}=this.field.applyRangeInsert(Y);if(W==="none"){this.keepLatestSelectionOnly(J),this.beans.editSvc?.stopEditing(void 0,{source:"edit"});return}if(W==="replace"&&q===Y){this.discardLatestRangeForRef(Y),this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}this.tagLatestRangeForRef(Y,H),this.handleRangeTokenUpdate(q,Y,!0,W==="insert",H),this.syncRangesFromFormula(this.field.getCurrentValue()),this.field.restoreCaretAfterToken(),this.refocusEditingCell();return}if(!z&&!D){let{previousRef:W,tokenIndex:q}=this.field.insertOrReplaceToken(Y,!1);this.tagLatestRangeForRef(Y,q),this.handleRangeTokenUpdate(W,Y,!1,!1),this.refocusEditingCell();return}if(this.tagLatestRangeForRef(Y),D)this.field.restoreCaretAfterToken(),this.refocusEditingCell()}keepLatestSelectionOnly(G){if(!G||this.getLiveRanges().length<=1)return;this.setCellRangesSilently([G])}isSpecialOnlyRange(G){let D=G.columns;return!!D?.length&&D.every((z)=>Du(z))}handleRangeTokenUpdate(G,D,z,B,Q){if(z){if(!B&&G&&G!==D)this.removeRangeForRef(G,Q);this.addRangeForRef(D,!0,Q);return}if(B||!G){this.addTrackedRef(D);return}if(G!==D)this.removeTrackedRef(G),this.addTrackedRef(D)}addRangeForRef(G,D,z){let B=this.beans.rangeSvc;if(!B)return;let Q;if(!D){let J=_8(this.beans,G);if(!J)return;this.withSuppressedRangeEvents(()=>{Q=B.addCellRange(J)})}else Q=this.findLatestRangeForRef(G,!0)??this.findLatestRangeForRef(G,!1);if(Q){let J=this.getColorIndexForTokenOrRef(G,z);this.tagRangeColor(Q,G,J),this.trackRange(Q,G,z),this.refreshRangeStyling()}return Q}findLatestRangeForRef(G,D){let z=this.getLiveRanges();for(let B=z.length-1;B>=0;B--){let Q=z[B];if(QD(this.beans,Q)!==G)continue;if(D&&this.trackedRanges.has(Q))continue;return Q}return}tagLatestRangeForRef(G,D){let{trackedRanges:z}=this,B=this.getLiveRanges(),Q=B.length?N1(B):null;if(!Q)return;let J=z.get(Q)?.tokenIndex??null,U=this.getColorIndexForTokenOrRef(G,D??J);this.tagRangeColor(Q,G,U),this.refreshRangeStyling()}discardLatestRangeForRef(G){let D=this.getLiveRanges();if(!D.length)return;let z=N1(D);if(QD(this.beans,z)!==G)return;if(this.trackedRanges.has(z)){this.removeTrackedRange(z);return}this.setCellRangesSilently(D.slice(0,-1))}ensureTrackedRangeColors(){let G=this.getLiveRanges();if(!G.length)return!1;let D=!1;for(let z of G){let B=this.trackedRanges.get(z),Q=B?.ref??QD(this.beans,z);if(!Q||!this.hasTrackedRef(Q))continue;let J=B?.tokenIndex??null,U=this.field.getColorIndexForToken(J),Z=f1(z.colorClass),S=U??(this.field.hasColorForRef(Q)?this.field.getColorIndexForRef(Q):this.field.moveColorToRef(void 0,Q,Z??void 0));if(S==null)continue;if(this.tagRangeColor(z,Q,S))D=!0;if(!this.trackedRanges.has(z))this.trackRange(z,Q,J)}return D}handleRemovedRangeTokens(){if(!this.beans.rangeSvc||this.trackedRanges.size===0)return!1;let G=this.field.getCurrentValue(),D=S5(this.beans,G).filter(({ref:S})=>S!==this.editingCellRef);if(!D.length)return!1;let z=this.getLiveRanges(),B=new Set(z),Q=new Map;for(let S of z){let X=QD(this.beans,S);if(!X||X===this.editingCellRef)continue;Q.set(X,(Q.get(X)??0)+1)}let J=new Map;for(let S of D){let{ref:X}=S;J.set(X,(J.get(X)??0)+1)}for(let[S,X]of Array.from(J.entries())){let Y=Q.get(S)??0,W=X-Y;if(W>0)J.set(S,W);else J.delete(S)}if(!J.size)return!1;let U=[];for(let[S,X]of Array.from(this.trackedRanges.entries())){if(B.has(S))continue;let{ref:Y}=X,W=J.get(Y)??0;if(W<=0)continue;J.set(Y,W-1),U.push({range:S,tracked:X})}if(!U.length)return!1;U.sort((S,X)=>(X.tracked.tokenIndex??-1)-(S.tracked.tokenIndex??-1));let Z=!1;for(let{range:S,tracked:X}of U){let{ref:Y,tokenIndex:W}=X;Z=this.field.removeTokenRef(Y,W??null)||Z,this.trackedRanges.delete(S),this.removeTrackedRef(Y)}if(Z)this.syncRangesFromFormula(this.field.getCurrentValue());return Z}refreshRangeStyling(){let{eventSvc:G}=this.beans;if(!G)return;this.ensureTrackedRangeColors(),this.ignoreNextRangeEvent=!0,G.dispatchEvent({type:"cellSelectionChanged",started:!1,finished:!1})}refocusEditingCell(){let{focusSvc:G}=this.beans,{editingColumn:D,editingRowIndex:z}=this;if(!G||D==null||z==null)return;G.setFocusedCell({column:D,rowIndex:z,rowPinned:null,preventScrollOnBrowserFocus:!0})}removeTrackedRange(G){let D=this.trackedRanges.get(G);if(!D)return;let z=this.getLiveRanges(),B=z.filter((Q)=>Q!==G);if(B.length!==z.length)this.setCellRangesSilently(B);this.trackedRanges.delete(G),this.removeTrackedRef(D.ref)}removeRangeForRef(G,D){if(!G||!this.hasTrackedRef(G))return;if(D!=null){let z=!1;for(let[B,Q]of Array.from(this.trackedRanges.entries())){let{ref:J,tokenIndex:U}=Q;if(J!==G||U!==D)continue;this.removeTrackedRange(B),z=!0;break}if(!z){for(let[B,Q]of Array.from(this.trackedRanges.entries()))if(Q.ref===G){this.removeTrackedRange(B);break}}return}for(let[z,B]of Array.from(this.trackedRanges.entries()))if(B.ref===G)this.removeTrackedRange(z)}updateTrackedRangeTokens(){if(!this.beans.rangeSvc)return!1;let G=this.getLiveRanges(),D=this.normaliseRefForComparison(this.editingCellRef),z=!1;for(let B of G){let Q=this.trackedRanges.get(B);if(!Q)continue;let{ref:J,tokenIndex:U}=Q,Z=QD(this.beans,B),S=this.normaliseRefForComparison(J),X=this.normaliseRefForComparison(Z);if(!Z||!X||X===S||X===D)continue;let{colorClass:Y}=B,q=this.field.getColorIndexForToken(U??null)??this.field.moveColorToRef(J,Z,f1(Y)??void 0),H=this.field.replaceTokenRef(J,Z,q,U);if(H==null)continue;this.tagRangeColor(B,Z,q),this.trackRange(B,Z,H??U??null),z=!0}if(z)this.refreshRangeStyling();return z}},F1=7,Bu={"/":"÷","*":"×"},Qu={"÷":"/","×":"*"},Ju=class extends TO{constructor(){super({renderValueToElement:!1,className:"ag-formula-input-field"});this.currentValue="",this.selectionCaretOffset=null,this.lastTokenValueOffset=null,this.lastTokenValueLength=null,this.lastTokenCaretOffset=null,this.focusFromMouseTime=null,this.suppressNextFocusCaretPlacement=!1,this.formulaColorByRef=new Map,this.registerCSS(iO),this.registerCSS(T6)}postConstruct(){super.postConstruct(),this.rangeSyncFeature=this.createManagedBean(new zu(this)),this.autocompleteFeature=this.createManagedBean(new oO(this)),this.addManagedElementListeners(this.getContentElement(),{input:this.onContentInput.bind(this),focus:this.onContentFocus.bind(this),blur:this.onContentBlur.bind(this),mousedown:this.onContentMouseDown.bind(this)})}setValue(G,D){let z=G==null?"":String(G),{isFormula:B,hasFormulaPrefix:Q}=this.getFormulaState(z);if(!B)return this.applyPlainValue(z,{silent:D,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(z,Q),this;return this.applyFormulaValue(z,{currentValue:this.getCurrentValue(),silent:D}),this.rangeSyncFeature?.onValueUpdated(z,Q),this}getCurrentValue(){let G=Y5(this.getContentElement());if(G!==this.currentValue)this.setEditorValue(G,!0);return this.currentValue}setEditingCellRef(G,D){let z=G?this.beans.formula?.getColRef(G):void 0,B=z&&D!=null&&D!==void 0?`${z}${D+1}`:void 0;if(!B){this.rangeSyncFeature?.setEditingCellRef(void 0,void 0,void 0);return}this.rangeSyncFeature?.setEditingCellRef(G,D,B)}rememberCaret(){let G=ID(this.beans,this.getContentElement(),this.getCurrentValue());this.selectionCaretOffset=G??this.currentValue.length}setEditorValue(G,D=!1){return this.currentValue=G,super.setValue(G,D),this}renderFormula(G){Xu({beans:this.beans,contentElement:this.getContentElement(),getColorIndexForToken:this.getColorIndexForToken.bind(this),...G})}renderPlainValue(G,D){let z=this.getContentElement(),B=D??ID(this.beans,z,this.currentValue);z.textContent=G??"";let Q=B!=null?Math.min(B,G.length):null;s1(this.beans,z,Q)}withSelectionChangeHandlingSuppressed(G){if(!this.rangeSyncFeature){G();return}this.rangeSyncFeature.withSelectionChangeHandlingSuppressed(G)}getColorIndexForRef(G){if(!E1(this.beans))return null;let D=this.formulaColorByRef.get(G);if(D!=null)return D;let z=this.formulaColorByRef.size%F1;return this.formulaColorByRef.set(G,z),z}getColorIndexForToken(G){if(!E1(this.beans)||G==null)return null;return G%F1}hasColorForRef(G){return this.formulaColorByRef.has(G)}moveColorToRef(G,D,z){let B=G&&this.formulaColorByRef.has(G)?this.getColorIndexForRef(G):z??this.formulaColorByRef.get(D)??this.getColorIndexForRef(D);if(G&&G!==D)this.formulaColorByRef.delete(G);if(B==null)return null;return this.formulaColorByRef.set(D,B),B}updateFormulaColorsFromValue(G){if(G=G==null?"":String(G),!E1(this.beans)){this.formulaColorByRef.clear();return}let D=Uu(this.beans,G),z=D.length!==this.formulaColorByRef.size,B=new Map;if(D.forEach((Q,J)=>{let U=J%F1;if(B.set(Q,U),this.formulaColorByRef.get(Q)!==U)z=!0}),!z)return;this.formulaColorByRef.clear(),B.forEach((Q,J)=>this.formulaColorByRef.set(J,Q))}onContentInput(){let G=this.getContentElement(),D=this.getCurrentValue(),z=ID(this.beans,G,D),B=Y5(G),{isFormula:Q,hasFormulaPrefix:J}=this.getFormulaState(B);if(!Q){this.applyPlainValue(B,{caret:z,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(B,J);return}this.applyFormulaValue(B,{currentValue:D,caret:z??void 0,dispatch:!0}),this.rangeSyncFeature?.onValueUpdated(B,J)}onContentFocus(){if(this.rangeSyncFeature?.setEditorActive(!0),this.suppressNextFocusCaretPlacement){this.suppressNextFocusCaretPlacement=!1;return}let{focusFromMouseTime:G}=this,D=G!=null;if(this.focusFromMouseTime=null,D)return;xO(this.beans,this.getContentElement())}onContentBlur(G){this.focusFromMouseTime=null;let D=G.relatedTarget,z=D?.closest(".ag-cell-editor"),B=D?.closest(".ag-cell");if(!D||this.getGui().contains(D)||!z||!B)return;this.rangeSyncFeature?.deactivateForFocusLoss()}onContentMouseDown(){this.focusFromMouseTime=Date.now()}insertOrReplaceToken(G,D){let z=this.getTokenInsertOffsets(D);if(!z)return{};let{caretOffset:B,valueOffset:Q}=z,J=D||this.lastTokenValueLength==null?0:this.lastTokenValueLength,U=this.getCurrentValue(),Z=U.slice(0,Q)+G+U.slice(Q+J),S=I1(this.beans,Z,Q)?.index??null,X;return this.applyFormulaValueChange({currentValue:U,nextValue:Z,caret:B+G.length,updateTracking:()=>{X=this.updateLastTokenTracking(G,B,Q)}}),{previousRef:X,tokenIndex:S}}removeTokenRef(G,D){let z=this.getCurrentValue(),B=Yz(this.beans,z),Q;if(D!=null){if(Q=B.find((S)=>S.index===D),Q&&Q.ref!==G)Q=void 0}if(!Q)Q=B.find((S)=>S.ref===G);if(!Q)return!1;let J=z.slice(0,Q.start)+z.slice(Q.end),U=this.selectionCaretOffset??Q.start,Z=Math.min(U,J.length);return this.applyFormulaValueChange({currentValue:z,nextValue:J,caret:Z,updateTracking:()=>{this.lastTokenValueOffset=null,this.lastTokenValueLength=null,this.lastTokenCaretOffset=Z,this.lastTokenRef=void 0}}),!0}applyRangeInsert(G){let D=this.getCurrentValue(),z=this.getCaretOffsets(D);if(!z){let{previousRef:S,tokenIndex:X}=this.insertOrReplaceToken(G,!0);return{action:"insert",previousRef:S,tokenIndex:X}}let{valueOffset:B}=z,Q=I1(this.beans,D,B);if(Q){let{end:S,ref:X}=Q;if(X.endsWith(":")&&B===S){let{previousRef:q,tokenIndex:H}=this.insertOrReplaceToken(G,!0);return{action:"insert",previousRef:q,tokenIndex:H}}let{previousRef:Y,tokenIndex:W}=this.replaceTokenAtMatch(Q,G);return{action:"replace",previousRef:Y,tokenIndex:W}}let J=Zu(D,B);if(J){let S=D.slice(0,J.start)+G+D.slice(J.end),X=I1(this.beans,S,J.start)?.index??null,{previousRef:Y}=this.replaceTokenAtMatch(J,G,X);return{action:"replace",previousRef:Y,tokenIndex:X}}if(!$u(D,B))return{action:"none"};let{previousRef:U,tokenIndex:Z}=this.insertOrReplaceToken(G,!0);return{action:"insert",previousRef:U,tokenIndex:Z}}restoreCaretAfterToken(){let D=(this.lastTokenCaretOffset??ID(this.beans,this.getContentElement(),this.getCurrentValue())??this.currentValue.length)+(this.lastTokenValueLength??0);this.selectionCaretOffset=null,this.suppressNextFocusCaretPlacement=!0,setTimeout(()=>{if(!this.isAlive())return;if(this.getContentElement().focus({preventScroll:!0}),vJ(this.beans).activeElement===this.getContentElement())this.suppressNextFocusCaretPlacement=!1;s1(this.beans,this.getContentElement(),D)})}replaceTokenAtMatch(G,D,z){let B=this.getCurrentValue(),Q=B.slice(0,G.start)+D+B.slice(G.end);return this.applyFormulaValueChange({currentValue:B,nextValue:Q,caret:G.start+D.length,updateTracking:()=>{this.updateLastTokenTracking(D,G.start,G.start)}}),{previousRef:G.ref,tokenIndex:z??G.index}}getValueOffsetFromCaret(G){let D=this.getContentElement(),z=G,B=0;for(let Q of Array.from(D.childNodes)){let J=Uz(Q),U=sB(Q).length;if(z<=J)return B+(J===U?z:0);z-=J,B+=U}return this.currentValue.length}getTokenInsertOffsets(G){return this.getCaretOffsets(this.getCurrentValue(),{useCachedCaret:!0,useCachedValueOffset:!G})}getCaretOffsetsForAutocomplete(G){return this.getCaretOffsets(G)}getCaretOffsets(G,D={useCachedCaret:!1,useCachedValueOffset:!1}){let{beans:z}=this,{useCachedCaret:B,useCachedValueOffset:Q}=D,J=this.getContentElement(),U=B?this.selectionCaretOffset??ID(z,J,G)??this.currentValue.length:ID(z,J,G);if(U==null)return null;let Z=Q&&this.lastTokenValueOffset!=null?this.lastTokenValueOffset:this.getValueOffsetFromCaret(U);if(Z==null)return null;return{caretOffset:U,valueOffset:Z}}updateLastTokenTracking(G,D,z){let B=this.lastTokenRef;return this.lastTokenValueOffset=z,this.lastTokenValueLength=G.length,this.lastTokenCaretOffset=D,this.lastTokenRef=G,B}getFormulaState(G){let D=G.trimStart().startsWith("=");return{isFormula:this.beans.formula?.isFormula(G)??D,hasFormulaPrefix:D}}dispatchValueChanged(){this.dispatchLocalEvent({type:"fieldValueChanged"})}applyPlainValue(G,D){if(this.formulaColorByRef.clear(),this.renderPlainValue(G,D.caret),this.setEditorValue(G,D.silent),D.dispatch)this.dispatchValueChanged();this.autocompleteFeature?.onPlainValueUpdated()}applyFormulaValue(G,D){if(this.updateFormulaColorsFromValue(G),this.renderFormula({value:G,currentValue:D.currentValue??this.getCurrentValue(),caret:D.caret??void 0}),this.setEditorValue(G,D.silent),D.dispatch)this.dispatchValueChanged();this.autocompleteFeature?.onFormulaValueUpdated()}applyFormulaValueChange(G){let{currentValue:D,nextValue:z,caret:B}=G;this.updateFormulaColorsFromValue(z),G.updateTracking?.(),this.setEditorValue(z),this.renderFormula({currentValue:D,value:z,caret:B}),this.dispatchValueChanged(),this.autocompleteFeature?.onFormulaValueUpdated()}replaceTokenRef(G,D,z,B){let Q=this.getContentElement(),J;if(B!=null){if(J=Q.querySelector(`.ag-formula-token[data-formula-token-index="${B}"]`)??void 0,J&&W5(J)!==G)J=void 0}if(!J)J=Array.from(Q.querySelectorAll(".ag-formula-token")).find((W)=>W5(W)===G);if(!J)return null;let U=X5(Q,J),Z=X5(Q,J,!0);if(U==null||Z==null)return null;let S=this.getCurrentValue();if(z!=null)this.formulaColorByRef.set(D,z);let X=S.slice(0,Z)+D+S.slice(Z+G.length),Y=Yu(J);return this.applyFormulaValueChange({currentValue:S,nextValue:X,caret:U+D.length,updateTracking:()=>{this.updateLastTokenTracking(D,U,Z)}}),Y??B??null}},E1=(G)=>{let{gos:D,rangeSvc:z}=G;return!!z&&!!D.get("cellSelection")},Uu=(G,D)=>{let z=[],B=new Set;for(let Q of Yz(G,D)){let J=Q.ref;if(B.has(J))continue;B.add(J),z.push(J)}return z},I1=(G,D,z)=>{for(let B of Yz(G,D))if(z>=B.start&&z<=B.end)return{ref:B.ref,start:B.start,end:B.end,index:B.index};return null},Zu=(G,D)=>{for(let z of W8(G))if(D>=z.start&&D<=z.end)return{ref:z.ref,start:z.start,end:z.end,index:z.index};return null},$u=(G,D)=>{let z=H8(G,D);return z==null||q8.has(z)},Lu=(G,D,z)=>{let B=[],Q=0,J=Yz(G,D),U=vJ(G);for(let Z of J){if(Z.start>Q)B.push(U.createTextNode(q5(D.slice(Q,Z.start))));let S=z(Z.index);B.push(Su(Z.ref,S,S!=null,Z.index)),Q=Z.end}if(Q{let Q={"aria-label":G,"data-formula-ref":G,"data-formula-token-index":B.toString()},J;if(z&&D!=null){let Z=uJ(G,D);J=Z.tokenClass,Q["data-formula-range-class"]=Z.rangeClass}let U=yO({tag:"span",cls:"ag-formula-token",attrs:Q,children:G});if(J)U.classList.add(J);return U},Xu=(G)=>{let{beans:D,contentElement:z,currentValue:B,value:Q,getColorIndexForToken:J,caret:U}=G,Z=U??ID(D,z,B),S=Q.length;z.textContent="";for(let Y of Lu(D,Q,J))z.append(Y);let X=Z!=null?Math.min(Z,S):null;s1(D,z,X)},X5=(G,D,z=!1)=>{if(!G.contains(D))return null;let B=0;for(let Q of Array.from(G.childNodes)){if(Q===D)return B;B+=z?sB(Q).length:Uz(Q)}return null},Y5=(G)=>{let D="";return G.childNodes.forEach((z)=>{D+=sB(z)}),D},sB=(G)=>{if(G.nodeType===Node.TEXT_NODE)return w8(G.textContent??"");if(G.nodeType===Node.ELEMENT_NODE)return Array.from(G.childNodes).map((D)=>sB(D)).join("");return""},Uz=(G)=>{if(G.nodeType===Node.TEXT_NODE)return G.textContent?.length??0;if(G.nodeType===Node.ELEMENT_NODE)return Array.from(G.childNodes).reduce((D,z)=>D+Uz(z),0);return 0},k8=(G,D)=>{let z=D;for(let B=0;BJ){z-=J;continue}if(Q.nodeType===Node.TEXT_NODE)return{node:Q,localOffset:z};return k8(Q,z)}return{node:G,localOffset:G.childNodes.length}},s1=(G,D,z)=>{if(z==null)return;let B=X8(G),Q=vJ(G),J=B.getSelection(),U=Q.createRange(),{node:Z,localOffset:S}=k8(D,z);if(!Z||!J||!D.isConnected||!Z.isConnected)return;U.setStart(Z,S),U.collapse(!0),J.removeAllRanges();try{J.addRange(U)}catch{}},ID=(G,D,z)=>{let Q=X8(G).getSelection();if(!Q||Q.rangeCount===0)return z?.length??null;let J=Q.getRangeAt(0);if(!D.contains(J.startContainer))return z?.length??null;if(J.startContainer===D){let S=0;for(let X=0;Xw8(G.textContent??G.dataset.formulaRef??""),Yu=(G)=>{let D=G.dataset.formulaTokenIndex;if(!D)return null;let z=parseInt(D,10);return Number.isFinite(z)?z:null},q5=(G)=>G.replace(/[/*]/g,(D)=>Bu[D]??D),w8=(G)=>G.replace(/[÷×]/g,(D)=>Qu[D]??D),Wu={1:["invalidFormulaValidation","Invalid formula."],2:["formulaParseInvalidCellReference","Invalid cell reference: ${variable}."],3:["formulaParseInvalidRangeEndReference","Invalid range end reference."],4:["formulaParseUnterminatedString","Unterminated string."],5:["formulaParseUnexpectedCharacter","Unexpected character: ${variable}."],6:["formulaParseOperatorStackUnderflow","Operator stack underflow."],7:["formulaParseMissingOperand","Missing operand for '${variable}'."],8:["formulaParseInternalUnexpectedFrameDuringReduction","Internal error: unexpected frame during reduction."],9:["formulaParseInternalUnexpectedFrameBeforeOpenParen","Internal error: unexpected frame before '('."],10:["formulaParseMisplacedComma","Misplaced comma."],11:["formulaParseCommaOutsideFunctionCall","Comma outside of a function call."],12:["formulaParseInternalUnexpectedFrameBeforeCloseParen","Internal error: unexpected frame before ')'."],13:["formulaParseMismatchedParentheses","Mismatched parentheses."],14:["formulaParseUnsupportedOperand","Unsupported operand: ${variable}."],15:["formulaParseMismatchedParenthesesOrUnfinishedFunctionCall","Mismatched parentheses or unfinished function call."],16:["formulaParseInvalidExpression","Invalid expression."],17:["formulaParseFormulasMustBeginWithEquals","Formulas must begin with =."],18:["formulaSerializeStringContainsQuote",'String contains a quote (") which the tokenizer does not support.',"#PARSE!"],19:["formulaSerializeCannotProduceAbsoluteColumnLabelFromId","Cannot produce absolute COLUMN label from id '${variable}'."],20:["formulaSerializeCannotProduceAbsoluteRowIndexFromId","Cannot produce absolute ROW index from id '${variable}'."],21:["formulaSerializeCannotProduceRowIndexFromId","Cannot produce ROW index from id '${variable}'."],22:["formulaSerializeCannotMapColumnIdToA1Label","Cannot map column id '${variable}' to A1 label."],23:["formulaSerializeCannotParseAbsoluteRowIndex","Cannot parse absolute row index '${variable}'."],24:["formulaSerializeCannotMapRowIdToA1Index","Cannot map row id '${variable}' to A1 index."],25:["formulaEvalRangeNotAllowedInScalarContext","Range is not allowed in scalar context."],26:["formulaEvalUnknownReferenceToCell","Unknown reference to cell.","#REF!"],27:["formulaEvalUnsupportedOperation","Unsupported operation ${variable}.","#NAME?"],28:["formulaEvalInvalidAbsoluteRow","Invalid absolute row.","#REF!"],29:["formulaEvalUnrecognisedRowId","Unrecognised row id.","#REF!"],30:["formulaEvalInvalidAbsoluteColumn","Invalid absolute column.","#REF!"],31:["formulaEvalUnrecognisedColumnId","Unrecognised column id.","#REF!"],32:["formulaEvalUnrecognisedRowInRange","Unrecognised row in range.","#REF!"],33:["formulaEvalUnrecognisedReferenceToCell","Unrecognised reference to cell.","#REF!"],34:["formulaEvalIncompleteRangeReference","Incomplete range reference.","#REF!"],35:["formulaFunctionExpectedExactlyArguments","${variable}: expected exactly ${variable} arguments."],36:["formulaFunctionExpectedAtMostArguments","${variable}: expected at most ${variable} arguments."],37:["formulaFunctionExpectedAtLeastArguments","${variable}: expected at least ${variable} arguments."],38:["formulaFunctionInvalidCriteriaWildcardsWithComparator","Invalid criteria: wildcards with comparator.","#VALUE!"],39:["formulaFunctionNonNumericArgument","${variable}: non-numeric argument.","#VALUE!"],40:["formulaFunctionDivisionByZero","${variable}: division by zero.","#DIV/0!"],41:["formulaFunctionCannotCombineDatesWithBigInt","${variable}: cannot combine dates with BigInt.","#VALUE!"],42:["formulaFunctionRequiresAtLeastOneNumericValue","${variable}: requires at least one numeric value.","#PARSE!"],43:["formulaFunctionRequiresAtLeastOneValue","${variable}: requires at least one value."],44:["formulaFunctionAllValuesMustBeNumbers","${variable}: all values must be numbers.","#VALUE!"],45:["formulaFunctionArgumentMustBeRange","${variable}: ${variable} argument must be a range.","#VALUE!"],46:["formulaFunctionArgumentMustBeValue","${variable}: ${variable} argument must be a value.","#VALUE!"],47:["formulaFunctionRangesHaveDifferentSizes","${variable}: ranges have different sizes.","#VALUE!"],48:["formulaFunctionValuesMustBeNumeric","${variable}: values must be numeric.","#VALUE!"],49:["formulaFunctionValuesMustBeIntegers","${variable}: values must be integers.","#VALUE!"],50:["formulaFunctionUnsupportedValueType","${variable}: unsupported value type.","#VALUE!"],51:["formulaServiceCircularReference","Circular reference.","#CIRCREF!"],52:["formulaServiceExpectedParsableFormula","Expected parsable formula.","#PARSE!"],53:["formulaServiceInternalSchedulingError","Internal scheduling error."],54:["formulaFunctionDivNonNumericArgument","DIV: non-numeric argument.","#VALUE!"],55:["formulaFunctionDivDivisionByZero","DIV: division by zero.","#DIV/0!"],56:["formulaFunctionSumCannotCombineDatesWithBigInt","SUM: cannot combine dates with BigInt.","#VALUE!"],57:["formulaFunctionSumRequiresAtLeastOneNumericValue","SUM: requires at least one numeric value.","#PARSE!"],58:["formulaFunctionAvgRequiresAtLeastOneValue","AVG: requires at least one value."],59:["formulaFunctionMedianAllValuesMustBeNumbers","MEDIAN: all values must be numbers.","#VALUE!"],60:["formulaFunctionMedianRequiresAtLeastOneValue","MEDIAN: requires at least one value."],61:["formulaFunctionSumifFirstArgumentMustBeRange","SUMIF: first argument must be a range.","#VALUE!"],62:["formulaFunctionSumifSecondArgumentMustBeValue","SUMIF: second argument must be a value (criteria).","#VALUE!"],63:["formulaFunctionSumifThirdArgumentMustBeRange","SUMIF: third argument must be a range (sum_range).","#VALUE!"],64:["formulaFunctionSumifRangesHaveDifferentSizes","SUMIF: ranges have different sizes.","#VALUE!"],65:["formulaFunctionCountifFirstArgumentMustBeRange","COUNTIF: first argument must be a range.","#VALUE!"],66:["formulaFunctionCountifSecondArgumentMustBeValue","COUNTIF: second argument must be a value (criteria).","#VALUE!"],67:["formulaFunctionConcatUnsupportedValueType","CONCAT: unsupported value type.","#VALUE!"],68:["formulaFunctionMinRequiresAtLeastOneValue","MIN: requires at least one value."],69:["formulaFunctionMaxRequiresAtLeastOneValue","MAX: requires at least one value."],70:["formulaFunctionPercentNonNumericArgument","PERCENT: non-numeric argument.","#VALUE!"],71:["formulaFunctionPowerNonNumericArgument","POWER: non-numeric argument.","#VALUE!"]},qu=(G,D)=>{if(!D?.length)return G;let z=G,B=0;while(B{if(!G?.length)return;return G.map((D)=>String(D))},jJ=(G)=>{return Wu[G]},Hu=(G,D)=>{let[,z]=jJ(G);return qu(z,K8(D))},_u=(G,D,z)=>{let[B,Q]=jJ(D),J=K8(z);return G(B,Q,J)},ku=class extends uO{constructor(){super({tag:"div",cls:"ag-cell-edit-wrapper"});this.eEditor=jO,this.focusAfterAttached=!1}initialiseEditor(G){let D=this.createManagedBean(new Ju);this.eEditor=D,D.addCss("ag-cell-editor"),this.appendChild(D),this.addManagedElementListeners(D.getContentElement(),{keydown:(U)=>this.onFormulaInputKeyDown(U,G.onKeyDown)});let{eventKey:z,cellStartedEdit:B}=G,Q;if(B)if(this.focusAfterAttached=!0,z===K1.BACKSPACE||z===K1.DELETE)Q="";else if(z&&z.length===1)Q=z;else Q=this.getStartValue(G);else Q=this.getStartValue(G);let J=Q==null?"":String(Q);this.eEditor.setEditingCellRef(G.column,G.rowIndex),this.eEditor.setValue(J,!0)}onFormulaInputKeyDown(G,D){let{key:z}=G;if(z!==K1.TAB||G.defaultPrevented)return;let{focusSvc:B}=this.beans,Q=B?.getFocusedCell();this.eEditor.withSelectionChangeHandlingSuppressed(()=>{D?.(G)});let J=B?.getFocusedCell(),U=!1;if(Q&&J){let{rowIndex:S,rowPinned:X,column:Y}=Q,{rowIndex:W,rowPinned:q,column:H}=J;U=S!==W||X!==q||Y!==H}let{defaultPrevented:Z}=G;if(Z||U)G.preventDefault();G.stopPropagation()}getStartValue(G){let{value:D}=G;return D?.toString()??D}agSetEditValue(G){this.params.value=G;let D=this.getStartValue(this.params);this.eEditor.setValue(D??"",!0)}isPopup(){return!1}afterGuiAttached(){if(!this.focusAfterAttached)return;let{beans:G,eEditor:D}=this;if(!PO())this.focusIn();gO(G,D.getContentElement())}focusIn(){this.eEditor.getContentElement().focus({preventScroll:!0})}getValue(){let G=this.eEditor.getCurrentValue(),{value:D,parseValue:z}=this.params;if(typeof G==="string"&&this.isFormulaText(G))return G;if(G==null&&D==null)return D;return z(String(G))}getValidationElement(){return this.eEditor.getContentElement()}getValidationErrors(){let{params:G}=this,D=this.eEditor.getCurrentValue(),z=this.getLocaleTextFunc(),{getValidationErrors:B,validateFormulas:Q}=G,J=null;if((Q===!0||!!B)&&typeof D==="string"&&this.isFormulaText(D)){if(!this.beans.formula?.normaliseFormula(D,!0))J=[_u(z,1)]}if(B)return B({value:this.getValue(),internalErrors:J,cellEditorParams:G});return J}isFormulaText(G){let D=G==null?"":String(G);return this.beans.formula?.isFormula(D)??D.trimStart().startsWith("=")}},wu='.formula-error:after{background-color:var(--ag-invalid-color);content:"";height:12px;position:absolute;top:-6px;width:12px}:where(.ag-ltr) .formula-error:after{right:-6px;transform:rotate(45deg)}:where(.ag-rtl) .formula-error:after{left:-6px;transform:rotate(-45deg)}',Fu=class extends Ku{constructor(){super(...arguments);this.beanName="formulaDataSvc",this.hasSource=!1}postConstruct(){let G=this.gos.get("formulaDataSource");if(G)this.setDataSource(G)}hasDataSource(){return this.hasSource}getFormula(G){let D=this.dataSource?.getFormula(G);return Nu(D)?D:void 0}setFormula(G){this.dataSource?.setFormula(G)}setDataSource(G){this.dataSource=G,this.hasSource=!0,G.init?.(this.createInitParams())}createInitParams(){return fu(this.gos,{})}destroy(){this.dataSource?.destroy?.(),super.destroy()}},Iu=class extends Eu{constructor(){super(...arguments);this.beanName="formulaInputManager",this.activeEditor=null,this.activeEditorDeactivate=null}postConstruct(){this.registerRangeSelectionExtension()}registerActiveEditor(G,D){if(this.activeEditor===G&&this.activeEditorDeactivate===D)return!1;let z=this.activeEditorDeactivate;if(z&&z!==D)z();return this.activeEditor=G,this.activeEditorDeactivate=D,!0}unregisterActiveEditor(G,D){if(this.activeEditor===G&&this.activeEditorDeactivate===D)this.activeEditor=null,this.activeEditorDeactivate=null}isActiveEditor(G){return this.activeEditor===G}shouldSuppressRangeSelection(G){let D=G;if(!D?.closest)return!1;if(this.activeEditor!=null)return!!D.closest(".ag-cell-editor");return!!D.closest(".ag-formula-input-field")}registerRangeSelectionExtension(){let G=this.beans.rangeSvc;if(!G)return;G.registerRangeSelectionExtension(this),this.addDestroyFunc(()=>G.unregisterRangeSelectionExtension?.(this))}},f8=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],AB=new Map;for(let G of f8){let D=AB.get(G.symbol)??[];D.push(G),AB.set(G.symbol,D)}function Bz(G,D){let z=AB.get(G)??[];return D?z.find((B)=>B.fixity===D):z[0]}var bu=[...new Set(f8.map((G)=>G.symbol))].sort((G,D)=>D.length-G.length),o1=AB,vu=(G)=>{if(!G?.length)return;return G.map((D)=>String(D))},T=class extends Error{constructor(G,D,z){let B=typeof G==="string",Q=!B&&Array.isArray(D)?vu(D):void 0,J=B?G:Hu(G,Q);super(J);if(this.name="FormulaError",B)this.type=typeof D==="string"?D:"#ERROR!",this.errorId=null,this.localeKey=null,this.defaultMessage=G,this.variableValues=void 0;else{let[U,Z,S]=jJ(G);this.type=z??S??"#ERROR!",this.errorId=G,this.localeKey=U,this.defaultMessage=Z,this.variableValues=Q}}getTranslatedMessage(G){if(!this.localeKey)return this.message;return G(this.localeKey,this.defaultMessage,this.variableValues)}},JG=class extends T{constructor(G,D,z,B){super(G,B,"#PARSE!");this.errorStart=D,this.errorEnd=z}},Ou=(G,D,z)=>{let B=D.trim();if(B.startsWith('"')&&B.endsWith('"')&&B.length>2)return B.slice(1,-1);if(B.toLowerCase()==="true")return!0;if(B.toLowerCase()==="false")return!1;let Q=Number(B);if(!isNaN(Q))return Q;let J=OJ(B);if(J){let{startCol:U,startRow:Z,startColAbsolute:S,startRowAbsolute:X,endCol:Y,endRow:W,endColAbsolute:q,endRowAbsolute:H}=J,_=(w,K,f,N,F)=>{let E=w||F?K.toUpperCase():G.formula?.getColByRef(K)?.colId,I=f||F?N:Cu(G)?.getFormulaRow(Number(N)-1)?.id;if(E==null||I==null)throw new JG(2,0,0,[B]);return{column:{id:E,absolute:w},row:{id:I,absolute:f}}},k=_(S,U,X,Z,z);if(Y&&W){let w=_(q??!1,Y,H??!1,W,z);k.endColumn=w.column,k.endRow=w.row}return k}return null};function uu(G){let D=[],z=0,B=(Q,J)=>{let U=J,Z=()=>Q[U]==="$"?(U++,!0):!1,S=()=>{let q=U;while(Uq},X=()=>{let q=U;while(Uq},Y=()=>{let q=U;if(Z(),!S())return U=q,!1;if(Z(),!X())return U=q,!1;return!0};if(!Y())return 0;if(Q[U]===":"){let q=U;if(U++,!Y())throw new JG(3,q,U)}let W=Q.slice(J,U);if(!Y8(Q,J,W))return 0;return U-J};while(z=G.length)throw new JG(4,z,G.length);D.push(G.slice(z,U+1)),z=U+1;continue}if(/[0-9]/.test(Q)||Q==="."&&/[0-9]/.test(G[z+1])){let U=z+1;while(U0){D.push(G.slice(z,z+U)),z+=U;continue}let Z=z+1;while(ZG.startsWith(U,z));if(!J)throw new JG(5,z,z+1,[Q]);D.push(J),z+=J.length}return D}function ju(G,D){if(G.fixity!=="infix"||D.fixity!=="infix")return!0;if(G.associativity==="right"&&G.precedence===D.precedence)return!1;return G.precedence>=D.precedence}function Pu(G,D){let z=o1.get(G);if(!z)return null;let B=D!==void 0&&o1.has(D);if(D!==void 0&&!B&&!(D==="("||D===",")&&D!=="("||D===")")return z.find((U)=>U.fixity==="postfix")??z.find((U)=>U.fixity==="infix")??null;return z.find((U)=>U.fixity==="prefix")??z.find((U)=>U.fixity==="infix")??null}function gu(G,D,z){let B=uu(D),Q=[],J=[],U=()=>{let S=J.pop();if(!S)throw new JG(6,0,0);if(S.kind==="op"){let X=S.def;if(X.fixity!=="infix"){let q=Q.pop();if(!q)throw new JG(7,0,0,[X.symbol]);if(X.symbol==="+"&&X.fixity==="prefix"){Q.push(q);return}if(X.fixity==="postfix"&&X.symbol==="%"){Q.push({type:"operation",operation:X.symbol,operands:[q]});return}if(X.symbol==="-"&&X.fixity==="prefix")Q.push({type:"operation",operation:"-",operands:[{type:"operand",value:0},q]});else Q.push({type:"operation",operation:X.symbol,operands:[q]});return}let Y=Q.pop(),W=Q.pop();if(!W||!Y)throw new JG(7,0,0,[X.symbol]);Q.push({type:"operation",operation:X.symbol,operands:[W,Y]});return}throw new JG(8,0,0)},Z=0;while(ZW.outLen)q.args.push(Q.pop());Z++;continue}if(S===")"){while(!0){let H=J[J.length-1];if(!H||H.kind==="parenthesis")break;if(H.kind==="op")U();else throw new JG(12,Z,Z+1)}let W=J[J.length-1];if(!W||W.kind!=="parenthesis")throw new JG(13,Z,Z+1);let q=W.outLen;if(J.pop(),J[J.length-1]?.kind==="function"){let H=J.pop();if(Q.length>q)H.args.push(Q.pop());Q.push({type:"operation",operation:H.name,operands:H.args})}Z++;continue}let X=o1.has(S)?Pu(S,B[Z-1]):null;if(X){while(!0){let W=J[J.length-1];if(!W||W.kind!=="op")break;if(ju(W.def,X))U();else break}J.push({kind:"op",def:X}),Z++;continue}let Y=Ou(G,S,z);if(Y==null)throw new JG(14,0,S.length,[S]);Q.push({type:"operand",value:Y}),Z++}while(J.length)if(J[J.length-1].kind==="op")U();else throw new JG(15,0,0);if(Q.length!==1)throw new JG(16,0,0);return Q[0]}var r1=(G,D,z=!1)=>{if(!Vu(D))throw new JG(17,0,1);let B=D.slice(1).trim();return E8(gu(G,B,z))};function PJ(G,D){return G.type==="operation"&&G.operation.toUpperCase()===D.toUpperCase()}function N8(G,D=!1){if(!G)return D;if(G.type!=="operand")return D;return!!G.value}function F8(G){if(!G||G.type!=="operand")return null;let D=G.value;if(typeof D==="string")return D;if(typeof D==="number"||typeof D==="boolean")return String(D);return null}function H5(G){if(!PJ(G,"COLUMN"))return null;let D=F8(G.operands[0]);if(D==null)return null;let z=N8(G.operands[1],!1);return{id:D,absolute:z}}function _5(G){if(!PJ(G,"ROW"))return null;let D=F8(G.operands[0]);if(D==null)return null;let z=N8(G.operands[1],!1);return{id:D,absolute:z}}function Tu(G){if(!PJ(G,"REF"))return null;let D=G.operands;if(D.length!==2&&D.length!==4)return null;let z=H5(D[0]),B=_5(D[1]);if(!z||!B)return null;let Q={column:z,row:B};if(D.length===4){let J=H5(D[2]),U=_5(D[3]);if(!J||!U)return null;Q.endColumn=J,Q.endRow=U}return{type:"operand",value:Q}}function E8(G){if(G.type==="operation"){let D=G.operands.map(E8),z={type:"operation",operation:G.operation,operands:D};return Tu(z)??z}return G}var oB=(G)=>G.type==="operation";function I8(G,D){let z=G.colModel.getColById(D);if(z)return G.formula?.getColRef(z)??null;return null}function xu(G,D){return G.formula?.getColByRef?.(D)?.colId??null}function cu(G,D,z){let B=G.getColById(z);if(!B)return null;let Q=D.indexOf(B);return Q>=0?Q:null}function hu(G,D){let z=G[D];return z?z.getId()??null:null}function gJ(G,D){let z=G.rowModel?.getRowNode?.(D);if(z?.formulaRowIndex!=null)return z.formulaRowIndex+1;return null}function M8(G,D){return yu(G)?.getFormulaRow?.(D-1)?.id??null}function a1(G){if(G.includes('"'))throw new T(18);return`"${G}"`}function iu(G,D){let z=/^[A-Za-z]+$/.test(D.id);if(D.absolute){if(z)return D.id.toUpperCase();let B=I8(G,D.id);if(B)return B.toUpperCase();throw new T(19,[D.id])}else{if(z){let B=xu(G,D.id);if(B)return B}return D.id}}function nu(G,D){let{id:z,absolute:B}=D;if(B){if(M8(G,Number(z))==null)throw new T(20,[z])}else if(gJ(G,z)==null)throw new T(21,[z]);return z}function k5(G,D){if(D.absolute)return D.id;let z=I8(G,D.id);if(z)return z.toUpperCase();throw new T(22,[D.id])}function w5(G,D){if(D.absolute){let B=Number(D.id);if(Number.isFinite(B)&&B>=1)return B;throw new T(23,[D.id])}let z=gJ(G,D.id);if(z!=null)return z;throw new T(24,[D.id])}function du(G,D,z){let B=(Z,S)=>(Z?"$":"")+String(S),Q=z?D.column.id:k5(G,D.column),J=z?D.row.id:w5(G,D.row),U=B(D.column.absolute,Q)+B(D.row.absolute,J);if(D.endColumn&&D.endRow){let Z=z?D.endColumn.id:k5(G,D.endColumn),S=z?D.endRow.id:w5(G,D.endRow);return`${U}:${B(D.endColumn.absolute,Z)}${B(D.endRow.absolute,S)}`}return U}function lu(G,D){let z=(J)=>`COLUMN(${a1(iu(G,J))}${J.absolute?",true":""})`,B=(J)=>`ROW(${a1(nu(G,J))}${J.absolute?",true":""})`,Q=`REF(${z(D.column)},${B(D.row)}`;if(D.endColumn&&D.endRow)return`${Q},${z(D.endColumn)},${B(D.endRow)})`;return`${Q})`}function A8(G){if(!oB(G)||G.operation!=="-"||G.operands.length!==2)return null;let[D,z]=G.operands;if(D.type==="operand"&&D.value===0)return z;return null}function pu(G){if(!oB(G))return!1;return!!Bz(G.operation,"infix")}function K5(G,D,z){if(!oB(D))return!1;if(A8(D))return!1;let B=Bz(D.operation,"infix");if(!B||B.fixity!=="infix")return!1;let Q=G.precedence,J=B.precedence;if(JQ)return!1;if(G.associativity==="right"){let Z=B.symbol===G.symbol;return z==="left"&&Z}if(G.isAssociative!==!0)return z==="right";return!1}function mu(G){if(!oB(G))return!1;let D=Bz(G.operation,"infix");if(!D)return!1;return D.symbol!=="^"}function f5(G,D,z,B){let Q=(U)=>z?lu(G,U):du(G,U,B);function J(U){if(U.type==="operand"){let X=U.value;if(typeof X==="string")return a1(X);if(typeof X==="number")return String(X);if(typeof X==="boolean")return X?"TRUE":"FALSE";return Q(X)}let Z=A8(U);if(Z){let X=J(Z);return mu(Z)?`-(${X})`:`-${X}`}let S=U.operation.toUpperCase();if(U.operands.length===1){let X=U.operands[0],Y=Bz(S,"postfix");if(Y)return`${J(X)}${Y.symbol}`;let W=Bz(S,"prefix");if(W){let q=J(X);return pu(X)?`${W.symbol}(${q})`:`${W.symbol}${q}`}return`${S}(${J(X)})`}if(U.operands.length===2){let X=Bz(S,"infix");if(X){let[Y,W]=U.operands,q=K5(X,Y,"left")?`(${J(Y)})`:J(Y),H=K5(X,W,"right")?`(${J(W)})`:J(W);return`${q}${X.symbol}${H}`}}return`${S}(${U.operands.map(J).join(",")})`}return"="+J(D)}function R8(G){return!!(G.endColumn&&G.endRow)}function yJ(G,D){let{row:z,column:B}=D,Q=z.absolute?TJ(G)?.getFormulaRow(Number(z.id)-1):G.rowModel.getRowNode(z.id),J=B.absolute?G.formula.getColByRef(B.id):G.colModel.getColById(B.id);if(!Q||!J)return null;return{row:Q,column:J}}function C8(G,D,z,B){if(D.type==="operand"){let Z=D.value;if(typeof Z!=="object")return Z;if(R8(Z))throw new T(25);let S=yJ(G,Z);if(!S)throw new T(26);return z(S)}let Q=G.formula?.getFunction(D.operation);if(!Q)throw new T(27,[D.operation]);let{args:J,values:U}=ou(G,D.operands,z,B);return Q({row:B.row,column:B.column,args:J,values:U})}function V8(G,D,z,B){if(D.type==="operand"){let J=D.value;if(typeof J!=="object")return{kind:"value",value:J};if(R8(J))return au(G,J,z);let U=yJ(G,J);if(!U)throw new T(26);return{kind:"value",value:z(U)}}return{kind:"value",value:C8(G,D,z,B)}}var tu=class{constructor(G,D,z,B){this.beans=G,this.operandNodes=D,this.getCellValue=z,this.caller=B,this.i=0,this.res={done:!1,value:void 0}}next(){if(this.i>=this.operandNodes.length)return this.res.done=!0,this.res.value=void 0,this.res;return this.res.done=!1,this.res.value=V8(this.beans,this.operandNodes[this.i++],this.getCellValue,this.caller),this.res}[Symbol.iterator](){return this}},su=class{constructor(G,D,z,B){this.beans=G,this.operandNodes=D,this.getCellValue=z,this.caller=B,this.i=0,this.inner=null,this.res={done:!1,value:void 0}}next(){while(!0){if(this.inner){let D=this.inner.next();if(!D.done)return this.res.done=!1,this.res.value=D.value,this.res;this.inner=null;continue}if(this.i>=this.operandNodes.length)return this.res.done=!0,this.res.value=void 0,this.res;let G=V8(this.beans,this.operandNodes[this.i++],this.getCellValue,this.caller);if(G.kind==="value")return this.res.done=!1,this.res.value=G.value,this.res;this.inner=G[Symbol.iterator]()}}[Symbol.iterator](){return this}};function ou(G,D,z,B){let Q={[Symbol.iterator](){return new tu(G,D,z,B)}},J={[Symbol.iterator](){return new su(G,D,z,B)}};return{args:Q,values:J}}function RB(G,D){if(D.absolute){let B=Number(D.id)-1;if(!Number.isFinite(B)||B<0)throw new T(28);return B}let z=G.rowModel?.getRowNode?.(D.id);if(z?.formulaRowIndex==null)throw new T(29);return z.formulaRowIndex}function CB(G,D){if(D.absolute){let B=G.formula?.getColByRef(D.id);if(!B)throw new T(30);return B}let z=G.colModel.getColById(D.id);if(!z)throw new T(31);return z}var ru=class{constructor(G,D,z,B,Q,J){this.beans=G,this.rowStartIndex=D,this.rowEndIndex=z,this.colStart=B,this.colEnd=Q,this.getCellValue=J,this.cols=null,this.currentRowIndex=this.rowStartIndex,this.currentColIdx=-1,this.colStartIdx=-1,this.colEndIdx=-1,this.res={done:!1,value:void 0}}initColsOnce(){if(this.cols)return;this.cols=this.beans.colModel.getCols()??[];let G=b8(this.beans,this.colStart,this.colEnd);if(!G){this.colStartIdx=-1,this.colEndIdx=-1;return}[this.colStartIdx,this.colEndIdx]=G,this.currentColIdx=this.colStartIdx}next(){if(!this.cols){if(this.initColsOnce(),this.colStartIdx<0)return this.res.done=!0,this.res}if(this.currentRowIndex<=this.rowEndIndex){let G=TJ(this.beans)?.getFormulaRow(this.currentRowIndex);if(!G)throw new T(32);let D=this.cols[this.currentColIdx];if(this.currentColIdxB)throw new T(36,[D,B]);if(Q.length{return G.kind==="range"},v8=(G)=>{return G.kind==="value"},zj=["<=",">=","<>","<",">","="];function Bj(G){for(let D of zj)if(G.startsWith(D))return D;return null}function GJ(G){if(typeof G==="number"&&Number.isFinite(G))return G;if(G instanceof Date)return+G;if(typeof G==="string"){let D=Number(G);if(!Number.isNaN(D))return D}return null}function O8(G){if(G==null)return"";switch(typeof G){case"string":return G;case"number":return String(G);case"boolean":return G?"TRUE":"FALSE"}if(G instanceof Date)return String(+G);return String(G)}function Qj(G){let D="^";for(let z=0;z{let B=GJ(D),Q=GJ(z);if(B==null||Q==null)B=D,Q=O8(z).toUpperCase();switch(G){case"<":return Q":return Q>B;case"<=":return Q<=B;case">=":return Q>=B;case"=":return Q===B;case"<>":return Q!==B}return!1},Uj=(G,D,z)=>{let B=O8(z),Q=D.test(B);return G==="="?Q:!Q},Zj=(G)=>G==null||G==="";function u8(G){if(typeof G==="number")return(U)=>GJ(U)===G;if(typeof G!=="string")return(U)=>G===U;let D=G.trim();if(D==="")return Zj;let z=Bj(D),B=z?D.substring(z.length):D;if(!/[*?]/.test(B))return Jj.bind(null,z??"=",B.toUpperCase());if(z&&z!=="="&&z!=="<>")throw new T(38);let J=Qj(B);return Uj.bind(null,z??"=",J)}var N5=(G,D,z)=>{if(!z||D===0||z.absolute)return;let{visibleCols:B,colModel:Q}=G,J=B.allCols,U=cu(Q,J,z.id);if(U==null)return;let Z=U+D;if(Z<0)return;let S=hu(J,Z);if(S)z.id=S},F5=(G,D,z,B)=>{if(!z||D===0||z.absolute)return;if(B){let Z=Number(z.id);if(!Number.isFinite(Z))return;z.id=String(Z+D);return}let Q=gJ(G,z.id);if(Q==null)return;let J=Q+D;if(J<1)return;let U=M8(G,J);if(U)z.id=U},$j=(G)=>{return!!G&&typeof G==="object"&&G!==null&&"row"in G&&"column"in G},j8=(G,D,z,B,Q)=>{if(D.type==="operand"){let{value:J}=D;if(!$j(J))return;let{row:U,column:Z,endRow:S,endColumn:X}=J;F5(G,z,U,Q),N5(G,B,Z),F5(G,z,S,Q),N5(G,B,X);return}if(D.type==="operation")for(let J of D.operands)j8(G,J,z,B,Q)},Lj=({values:G})=>{let D=0;for(let z of G)if(z!=null&&z!==""&&!isNaN(z))D++;return D},Sj=({values:G})=>{let D=0;for(let z of G)if(z!=null&&z!=="")D++;return D},Xj=({values:G})=>{let D=0;for(let z of G)if(z==null||z==="")D++;return D},Yj=({args:G})=>{let[D,z]=IG(G,"COUNTIF",2);if(!e1(D))throw new T(65);if(!v8(z))throw new T(66);let B=u8(z.value),Q=0;for(let J of D)if(B(J))Q++;return Q},Wj=()=>new Date,qj=()=>{let G=new Date;return new Date(G.getFullYear(),G.getMonth(),G.getDate())},Hj=({values:G})=>{let[D,z]=IG(G,"EQUALS",2);return D===z},_j=({values:G})=>{let[D,z]=IG(G,"NOT_EQUALS",2);return D!==z},kj=({values:G})=>{let[D,z]=IG(G,"GT",2);return D>z},wj=({values:G})=>{let[D,z]=IG(G,"GTE",2);return D>=z},Kj=({values:G})=>{let[D,z]=IG(G,"LT",2);return D{let[D,z]=IG(G,"LTE",2);return D<=z},Nj=({values:G})=>{let[D,z,B]=IG(G,"IF",3);return D?z:B},Fj=({values:G})=>{let D=null;for(let z of G){if(z==null)continue;if(D===null||z{let D=null;for(let z of G){if(z==null)continue;if(D===null||z>D)D=z}if(D===null)throw new T(69);return D},Ij=(G)=>typeof G==="number"&&Number.isFinite(G),P8=86400000;function Mj(G){return G.getTime()/P8}function rB(G){return new Date(G*P8)}function Zz(G){return G instanceof Date}function PG(G,D){if(typeof D==="bigint"){let z=Number(D);if(Number.isFinite(z))return z;throw new T(48,[G])}if(Ij(D))return D;if(Zz(D))return Mj(D);if(typeof D==="boolean")return D?1:0;if(typeof D==="string"){let z=Number(D.trim());if(Number.isFinite(z))return z}throw new T(48,[G])}function $z(G,D){if(typeof D==="bigint")return D;return PG(G,D)}function OG(G,D){if(typeof D==="bigint")return D;if(!Number.isFinite(D)||!Number.isInteger(D))throw new T(49,[G]);return BigInt(D)}var E5=({values:G})=>{let D=1,z=null;for(let B of Wz(G)){let Q=$z("PRODUCT",B);if(typeof Q==="bigint"){if(z??(z=OG("PRODUCT",D)),Q===0n)return 0n;z*=Q;continue}if(z!=null){z*=OG("PRODUCT",Q);continue}if(Q===0)return 0;D*=Q}return z??D},Aj=({values:G})=>{let[D,z]=IG(Wz(G),"DIVIDE",2),B=PG("DIV",D),Q=PG("DIV",z);if(B==null||Q==null)throw new T(54);if(Q===0)throw new T(55);return B/Q},M1=({values:G})=>{let D=!1,z=0,B=null,Q=!1;for(let J of Wz(G)){D||(D=Zz(J));let U=$z("SUM",J);if(typeof U==="bigint"){if(D)throw new T(56);B??(B=OG("SUM",z)),B+=U,Q=!0;continue}if(typeof B==="bigint"){if(D)throw new T(56);B+=OG("SUM",U),Q=!0;continue}z+=U,Q=!0}if(!Q)throw new T(57);if(typeof B==="bigint")return B;return D?rB(z):z},Rj=({values:G})=>{let[D,z]=IG(Wz(G),"MINUS",2),B=Zz(D),Q=Zz(z);if(B||Q){let Z=PG("MINUS",D),S=PG("MINUS",z);if(B&&!Q)return rB(Z-S);if(B&&Q)return Z-S;return Z-S}let J=$z("MINUS",D),U=$z("MINUS",z);if(typeof J==="bigint"||typeof U==="bigint")return OG("MINUS",J)-OG("MINUS",U);return J-U},Cj=({values:G})=>{let[D]=IG(G,"PERCENT",1),z=PG("PERCENT",D);if(z==null)throw new T(70);return z/100},I5=({values:G})=>{let[D,z]=IG(G,"POWER",2),B=PG("POWER",D),Q=PG("POWER",z);if(B==null||Q==null)throw new T(71);return Math.pow(B,Q)},Vj=({values:G})=>{let D=0,z=0,B=!0;for(let J of Wz(G)){let U=PG("AVG",J);if(U==null)continue;D+=U,z++,B&&(B=Zz(J))}if(z===0)throw new T(58);let Q=D/z;return B?rB(Q):Q},bj=({values:G})=>{let D=!0,z=[];for(let J of Wz(G)){let U=PG("MEDIAN",J);if(U==null)throw new T(59);z.push(U),D&&(D=Zz(J))}if(z.length===0)throw new T(60);z.sort((J,U)=>J-U);let B=Math.floor(z.length/2),Q=z.length%2===1?z[B]:(z[B-1]+z[B])/2;return D?rB(Q):Q},vj=()=>Math.random(),Oj=({args:G})=>{let[D,z,B]=Dj(G,"SUMIF",2,3);if(!e1(D))throw new T(61);if(!v8(z))throw new T(62);if(B&&!e1(B))throw new T(63);let Q=u8(z.value);if(!B){let W=0,q=null;for(let H of D)if(Q(H)){let _=$z("SUMIF",H);if(typeof _==="bigint")q??(q=OG("SUMIF",W)),q+=_;else if(q!=null)q+=OG("SUMIF",_);else W+=_}return q??W}let J=D.rowEnd-D.rowStart,U=B.rowEnd-B.rowStart;if(J!==U)throw new T(64);let Z=D[Symbol.iterator](),S=B[Symbol.iterator](),X=0,Y=null;while(!0){let W=Z.next(),q=S.next();if(W.done||q.done){if(W.done!==q.done)throw new T(64);break}if(Q(W.value)){let H=$z("SUMIF",q.value);if(typeof H==="bigint")Y??(Y=OG("SUMIF",X)),Y+=H;else if(Y!=null)Y+=OG("SUMIF",H);else X+=H}}return Y??X},A1=({values:G})=>{let D="";for(let z of G){if(z==null)continue;switch(typeof z){case"string":{D+=z;break}case"number":{D+=String(z);break}case"boolean":{D+=z?"TRUE":"FALSE";break}case"object":{D+=z.toString();break}default:throw new T(67)}}return D},M5={IF:Nj,NOW:Wj,TODAY:qj,PRODUCT:E5,SUM:M1,ADD:M1,SUMIF:Oj,POWER:I5,MIN:Fj,MAX:Ej,AVERAGE:Vj,MEDIAN:bj,COUNT:Lj,COUNTA:Sj,COUNTBLANK:Xj,COUNTIF:Yj,RAND:vj,CONCAT:A1,CONCATENATE:A1,"+":M1,"-":Rj,"*":E5,"/":Aj,"^":I5,"%":Cj,"=":Hj,"&":A1,"<>":_j,">":kj,">=":wj,"<":Kj,"<=":fj},uj=class{constructor(G,D,z,B){this.rowNode=G,this.column=D,this.formulaString=z,this.beans=B,this.error=null,this.ast=null,this.astStale=!0,this._value=void 0,this._valueStale=!0}setFormulaString(G){if(this.formulaString===G)return;this.formulaString=G,this.astStale=!0,this._valueStale=!0}setComputedValue(G){this._value=G,this._valueStale=!1,this.error=null}setError(G){this.error=G,this._valueStale=!1}isValueReady(){return!this._valueStale}getValue(){return this.error?.type??this._value}getError(){return this.error}getAst(){if(!this.astStale)return this.ast;let G=r1(this.beans,this.formulaString);return this.ast=G??null,this.astStale=!1,this.ast}},jj=class extends Mu{constructor(){super(...arguments);this.beanName="formula",this.cachedResult=new WeakMap,this.colRefMap=new Map,this.functionNames=null,this.active=!1}setFormulasActive(G){let z=G.list.some((B)=>B.isAllowFormula())&&this.checkForIncompatibleServices(G);if(z!==this.active)this.active=z,this.refreshFormulas(!0)}checkForIncompatibleServices(G){if(this.gos.get("masterDetail"))return oD(295,{blockedService:"Master Detail"}),!1;if(this.gos.get("treeData"))return oD(295,{blockedService:"Tree Data"}),!1;if(this.gos.get("enableCellExpressions"))return oD(295,{blockedService:"Cell Expressions"}),!1;return G.list.every((D)=>{if(D.isAllowPivot()||D.isPivotActive())return oD(295,{blockedService:"Column Pivoting"}),!1;if(D.isAllowRowGroup()||D.isRowGroupActive())return oD(295,{blockedService:"Row Groups"}),!1;if(D.isAllowValue()||D.isValueActive()||D.getAggFunc())return oD(295,{blockedService:"Value Aggregation"}),!1;return!0})}postConstruct(){this.setupFunctions();let G=()=>{if(this.active)this.refreshFormulas(!0)},D=()=>{if(this.active)this.setupColRefMap()};this.addManagedPropertyListeners(["masterDetail","enableCellExpressions"],(z)=>{let{colModel:B}=this.beans;if(B.cols?.list.some((J)=>J.isAllowFormula()))B.refreshAll(Au(z.source))}),this.addManagedListeners(this.beans.eventSvc,{modelUpdated:G,cellValueChanged:G,rowDataUpdated:G,newColumnsLoaded:D,columnMoved:D})}updateFormulaByOffset(G){let{value:D,rowDelta:z=0,columnDelta:B=0,useRefFormat:Q=!0}=G,{beans:J}=this;try{let U=!Q,Z=r1(J,D,U);return j8(J,Z,z,B,U),f5(J,Z,Q,U)}catch{return D}}setupFunctions(){this.supportedOperations=new Map,Object.keys(M5).forEach((D)=>{this.supportedOperations.set(D,M5[D])}),this.functionNames=null;let G=this.gos.get("formulaFuncs");if(G)Object.keys(G).forEach((D)=>{this.supportedOperations.set(D.toUpperCase(),G[D].func)})}getFunctionNames(){if(this.functionNames)return this.functionNames;let G=[];for(let D of this.supportedOperations.keys()){if(!tB(D[0]))continue;if(![...D].every((z)=>L0(z)))continue;G.push(D)}return G.sort((D,z)=>D.localeCompare(z)),this.functionNames=G,G}setupColRefMap(){if(!this.active){this.colRefMap=new Map;return}let G="abcdefghijklmnopqrstuvwxyz",D=G.length,z=this.beans.colModel.getCols(),B=new Map,Q=0;z?.forEach((J)=>{if(!J.isPrimary())return;let U="",Z=Q++;while(!0){if(U=G[Z%D]+U,Z{let U=G.get(Q);if(U?.has(J))throw new T(51);if(!U)U=new Set,G.set(Q,U);U.add(J)},z=(Q,J)=>{let U=G.get(Q);if(U){if(U.delete(J),U.size===0)G.delete(Q)}},B=(Q)=>{for(let[J,U]of G)for(let Z of U)this.ensureCellFormula(J,Z)?.setError(Q)};return this.activeCtx={setVisited:z,setVisiting:D,errorAllVisitors:B}}makeFormulaFrame(G){let z=this.ensureCellFormula(G.row,G.column).getAst();if(!z)throw new T(52);let B=Gj(this.beans,z,this.ensureCellFormula.bind(this));return{address:G,ast:z,unresolvedDepIterator:B}}resolveValue(G,D){let z=this.ensureCellFormula(D,G);if(!z)return this.fetchRawValue(G,D);if(z.isValueReady())return z.getValue();let B=!!this.activeCtx,{setVisited:Q,setVisiting:J,errorAllVisitors:U}=this.getVisitorContext(),Z=[];try{J(D,G),Z.push(this.makeFormulaFrame({row:D,column:G}));while(Z.length){let{address:S,ast:X,unresolvedDepIterator:Y}=Z[Z.length-1],{row:W,column:q}=S,H=this.ensureCellFormula(W,q);if(H.isValueReady()){if(Z.pop(),Q(W,q),H.error)throw H.error;continue}let _=Y.next();if(!_.done){let f=_.value,N=this.ensureCellFormula(f.row,f.column);if(!N||N.isValueReady())continue;J(f.row,f.column),Z.push(this.makeFormulaFrame(f));continue}let k=C8(this.beans,X,(f)=>{let N=this.ensureCellFormula(f.row,f.column);if(N){if(!N.isValueReady())throw new T(53);let F=N.getError();if(F)throw F;return N.getValue()}return this.fetchRawValue(f.column,f.row)},{row:W,column:q}),w=this.coerceFormulaValue(q,k),K=H.getError();if(K)throw Q(W,q),K;H.setComputedValue(w),Q(W,q),Z.pop()}if(!z.isValueReady())throw new T(53);return z.getValue()}catch(S){let X=S instanceof T?S:new T(String(S?.message??S));return U(X),X.type}finally{if(!B)this.activeCtx=null}}},g8={moduleName:"Formula",version:j,userComponents:{agFormulaCellEditor:ku},beans:[jj,Fu,Iu],dependsOn:[bJ],css:[wu]},gj=".ag-sparkline-wrapper{height:100%;line-height:normal;position:absolute;top:0;width:100%}",R1=Symbol("WrappedFunctionMarker"),R5=(G,D)=>{if(G[R1])return G;let z=(...B)=>D(G,...B);return z[R1]=R1,z},ij="Sparkline - ${chartType} displaying ${count} values between ${min} and ${max}. Starts at ${start} and ends at ${end}.",nj="Sparkline - ${chartType} displaying 1 value, ${value}.",dj="Sparkline - ${chartType} displaying no values.",lj=(G,D)=>{let z=D?.type??"line";switch(z){case"line":return G("lineChart","Line");case"area":return G("areaChart","Area");case"bar":return G("barChart","Bar");default:return z}},pj=(G,D)=>{let z=0,B=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,J,U;for(let Z of G){let S=oj(Z,D);if(S==null)continue;if(J==null)J=S;U=S,z++,B=Math.min(B,S),Q=Math.max(Q,S)}return z===0?{count:z}:{count:z,min:B,max:Q,start:J,end:U}};function mj(G){let{translate:D,chartType:z,summary:B,formatNumber:Q}=G,J,U,Z,S;if(!tj(B))J="ariaSparklineChartDescriptionEmpty",U=dj,Z=[z],S={chartType:z};else if(B.count===1){let X=Q(B.start);J="ariaSparklineChartDescriptionSingleValue",U=nj,Z=[z,X],S={chartType:z,value:X}}else{let[X,Y,W,q,H]=[B.count,B.min,B.max,B.start,B.end].map(Q);J="ariaSparklineChartDescription",U=ij,Z=[z,X,Y,W,q,H],S={chartType:z,count:X,min:Y,max:W,start:q,end:H}}return{template:D(J,U,Z),values:S}}var tj=(G)=>G.count>0&&G.min!=null&&G.max!=null&&G.start!=null&&G.end!=null,sj=(G,D)=>G.replace(/\$\{([^}]+)\}/g,(z,B)=>D[B]??z),oj=(G,D)=>{if(typeof G==="number")return Number.isFinite(G)?G:null;if(G&&typeof G==="object"){let z=Array.isArray(G)?G[1]:G[D];return typeof z==="number"&&Number.isFinite(z)?z:null}return null};function rj(G){return{content:`${G.xValue} ${G.yValue}`}}function aj(G){return{content:`${G.yValue}`}}var C5="ag-sparkline",ej=class extends Tj{constructor(){super({tag:"div",cls:`${C5}-wrapper`,children:[{tag:"span",ref:"eSparkline"}]});this.eSparkline=yj,this.cachedWidth=0,this.cachedHeight=0,this.dataRef=[],this.processedData=[]}postConstruct(){this.env=this.beans.environment,this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes","styleNonce"],()=>this.refresh(this.params))}createListener(G=!0){return()=>this.updateSize(this.params?.column?.getActualWidth()??0,(this.params?.node.rowHeight??0)-2,G)}initGridObserver(){let G=this.createListener(),D=this.createListener(!1),z=this.params?.column,B=this.params?.node;z.__addEventListener("columnStateUpdated",G),B.__addEventListener("heightChanged",G),this.addDestroyFunc(()=>{z.__removeEventListener("columnStateUpdated",G),B.__removeEventListener("heightChanged",G)}),D()}updateSize(G,D,z=!0){if(G-=this.env.getCellPadding(),G!==this.cachedWidth||D!==this.cachedHeight){this.cachedWidth=G,this.cachedHeight=D;let B=this.refresh.bind(this);if(z)xj(()=>this.isAlive()&&B());else B()}}init(G){this.params=G;let{eParentOfValue:D}=G,z=`${C5}-cell-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",z),A5(D,z),this.addDestroyFunc(()=>A5(D)),this.initGridObserver()}refresh(G=this.params){var D;this.params=G;let z=this.processData(G?.value);this.refreshAriaLabel(z);let B=this.cachedWidth,Q=this.cachedHeight,J=this.gos.get("styleNonce");if(!this.sparklineInstance&&G&&B>0&&Q>0){if(this.sparklineOptions={container:this.eSparkline,width:B,height:Q,...G.sparklineOptions,...J?{styleNonce:J}:{},data:z},(D=this.sparklineOptions).type??(D.type="line"),this.sparklineOptions.tooltip?.renderer)this.wrapTooltipRenderer();else{let Z=this.getDefaultTooltipRenderer();this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:Z}}let U=this.sparklineOptions?.theme;if(this.sparklineOptions.type==="bar"&&this.sparklineOptions.itemStyler)this.wrapItemStyler(this.sparklineOptions);else if(U?.overrides?.bar?.series?.itemStyler)this.wrapItemStyler(U.overrides.bar.series);return this.sparklineInstance=G.createSparkline(this.sparklineOptions),!0}else if(this.sparklineInstance)return this.sparklineInstance.update({...this.sparklineOptions,data:z,width:B,height:Q,...J?{styleNonce:J}:{}}),!0;return!1}refreshAriaLabel(G){let D=this.getLocaleTextFunc(),z=this.getLocaleTextFunc.bind(this),B=this.params?.sparklineOptions?.yKey??this.sparklineOptions?.yKey??"y",Q=pj(G,B),J=this.params?.sparklineOptions??this.sparklineOptions,{template:U,values:Z}=mj({translate:D,chartType:lj(D,J),summary:Q,formatNumber:(S)=>cj(S,z)});hj(this.getGui(),sj(U,Z))}processData(G){if(!G?.length)return G??[];if(this.dataRef!==G)this.dataRef=G,this.processedData=Array.isArray(G[0])?G.filter((D)=>D!=null):G;return this.processedData}createContext(){return{data:this.params?.data,cellData:this.params?.value}}getDefaultTooltipRenderer(G){let D=G?.title,z=this.sparklineOptions.xKey,B=Array.isArray(this.sparklineOptions.data?.[0]);return!D&&(z||B)?rj:aj}wrapItemStyler(G){G.itemStyler=R5(G.itemStyler,(D,z)=>{return D({...z,context:this.createContext()})})}wrapTooltipRenderer(){this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:R5(this.sparklineOptions.tooltip.renderer,(G,D)=>{let z=G({...D,context:this.createContext()});if(typeof z==="string")return z;return{...this.getDefaultTooltipRenderer(z)(D),...z}})}}destroy(){super.destroy(),this.sparklineInstance?.destroy()}},V5="Sparklines",T8={moduleName:V5,version:j,dependsOn:[i],validate:()=>{return{isValid:!1,message:Pj(258)}},with:(G)=>{return G.setup(),{moduleName:V5,version:j,dependsOn:[i],css:[gj],userComponents:{agSparklineCellRenderer:{classImp:ej,params:{createSparkline:G.createSparkline}}},validate:()=>{return{isValid:!0}}}}},GP=".ag-find-cell{display:block;overflow:hidden;text-overflow:ellipsis}.ag-find-match{background-color:var(--ag-find-match-background-color);color:var(--ag-find-match-color)}.ag-find-active-match{background-color:var(--ag-find-active-match-background-color);color:var(--ag-find-active-match-color)}";function DP(G){G.findSvc?.next()}function zP(G){G.findSvc?.previous()}function BP(G){return G.findSvc?.totalMatches??0}function QP(G,D,z){G.findSvc?.goTo(D,z)}function JP(G){G.findSvc?.clearActive()}function UP(G){return G.findSvc?.activeMatch}function ZP(G,D){let{node:z,column:B}=D;return G.findSvc?.getNumMatches(z,B)??0}function $P(G,D){return G.findSvc?.getParts(D)??[]}function LP(G){return G.findSvc?.refresh(!0)}var WP={tag:"span",cls:"ag-find-cell"},qP=class extends SP{constructor(){super(WP)}init(G){this.refresh(G)}refresh(G){let{node:D,column:z}=G,{findSvc:B,valueSvc:Q}=this.beans,{value:J,valueFormatted:U}=Q.getValueForDisplay({column:z,node:D,includeValueFormatted:!0,from:"edit"}),Z=U??J??"",S=this.getGui();XP(S);let X=B?.getParts({value:Z,node:D,column:z??null});if(!X)S.textContent=b5(Z)??"",S.classList.remove("ag-find-cell-active-match");else{let Y=!1;for(let{value:W,match:q,activeMatch:H}of X){let _=b5(W)??"";if(q){let k=YP({tag:"mark",cls:"ag-find-match"});if(k.textContent=_,H)k.classList.add("ag-find-active-match"),Y=!0;S.appendChild(k)}else S.appendChild(document.createTextNode(_))}S.classList.toggle("ag-find-cell-active-match",Y)}return!0}};function u5(G){return G?.toLocaleLowerCase()}function lz(G,D,z){let B=D(y8(z)),Q=0;if(B?.length){let J=-1;while(!0)if(J=B.indexOf(G,J+1),J!=-1)Q++;else break}return Q}var fP=class extends HP{constructor(){super(...arguments);this.beanName="findSvc",this.active=!1,this.topMatches=new Map,this.topNodes=[],this.topNumMatches=0,this.centerMatches=new Map,this.centerNodes=[],this.centerNumMatches=0,this.bottomMatches=new Map,this.bottomNodes=[],this.caseFormat=u5,this.scrollOnRefresh=!1,this.totalMatches=0}postConstruct(){if(!O5(this.gos))return;let G=this.refresh.bind(this,!1),D=this.refresh.bind(this,!0),z=_P(this,()=>{if(this.isAlive())D()},0);this.refreshDebounced=z,this.addManagedPropertyListener("findSearchValue",G),this.addManagedPropertyListener("findOptions",({currentValue:Q,previousValue:J})=>{if(!wP(Q,J))G()}),this.addManagedPropertyListeners(["groupSuppressBlankHeader","showOpenedGroup"],D),this.addManagedEventListeners({modelUpdated:D,displayedColumnsChanged:D,pinnedRowDataChanged:D,cellValueChanged:z,rowNodeDataChanged:z,cellEditingStopped:z,cellEditValuesChanged:z,batchEditingStopped:z});let B=this.beans.rowSpanSvc;if(B)this.addManagedListeners(B,{spannedCellsUpdated:z});G()}next(){this.findAcrossContainers(!1,["top",null,"bottom"],1,1)}previous(){this.findAcrossContainers(!0,["bottom",null,"top"],this.totalMatches,-1)}goTo(G,D){if(!D&&G===this.activeMatch?.numOverall)return;let{topMatches:z,topNumMatches:B,centerMatches:Q,centerNumMatches:J,bottomMatches:U}=this;if(G<=B){this.goToInContainer(z,G,0);return}if(G<=J){this.goToInContainer(Q,G,B);return}this.goToInContainer(U,G,B+J)}clearActive(){if(this.activeMatch)this.setActive(void 0)}isMatch(G,D){return this.active&&!!this.getMatches(G.rowPinned).get(G)?.some(([z])=>z===D)}getNumMatches(G,D){return this.getMatches(G.rowPinned).get(G)?.find(([z])=>z===D)?.[1]??0}getParts(G){let{value:D,node:z,column:B,precedingNumMatches:Q}=G,J=this.findSearchValue,U=y8(D)??"";if(C1(J))return[{value:U}];let Z=this.caseFormat(U)??"",S=this.getActiveMatchNum(z,B)-(Q??0),X=0,Y=0,W=J.length,q=[];while(!0){let H=Z.indexOf(J,X);if(H!=-1){if(Y++,H>X)q.push({value:U.slice(X,H)});let _=H+W;q.push({value:U.slice(H,_),match:!0,activeMatch:Y===S}),X=_}else{if(Xz.get("findOptions")?.searchDetail,Q=(J)=>{let Z=this.centerMatches.get(G)?.[0]?.[1]??0;if(J!==Z)this.refreshDebounced()};if(D.addEventListener("findChanged",(J)=>{if(D.isDestroyed()||!this.isAlive()||!this.active||!B())return;Q(J.totalMatches)}),D.addEventListener("gridPreDestroyed",()=>{if(!this.isAlive()||!this.active||!B())return;let J=G.parent,U=this.findSearchValue;if(!J||!U)return;let Z=z.get("detailCellRendererParams")?.getFindMatches?.({node:J,data:J.data,findSearchValue:z.get("findSearchValue"),updateMatches:this.refreshDebounced,getMatchesForValue:(S)=>lz(U,this.caseFormat,S)})??0;Q(Z)}),B())D.setGridOption("findSearchValue",z.get("findSearchValue"))}refresh(G){let D=new Set([...this.topNodes,...this.centerNodes,...this.bottomNodes]);this.topNodes=[],this.centerNodes=[],this.bottomNodes=[];let{topNodes:z,topMatches:B,centerMatches:Q,centerNodes:J,bottomNodes:U,bottomMatches:Z,beans:{gos:S,visibleCols:X,rowModel:Y,valueSvc:W,pinnedRowModel:q,pagination:H,rowSpanSvc:_,masterDetailSvc:k,colModel:w},findSearchValue:K}=this,f=S.get("findOptions"),N=f?.caseSensitive?(y)=>y??void 0:u5;this.caseFormat=N;let F=S.get("findSearchValue"),E=N(F?.trim());this.findSearchValue=E,B.clear(),Q.clear(),Z.clear();let I=G?this.activeMatch:void 0;this.activeMatch=void 0;let V=S.get("masterDetail")&&f?.searchDetail&&k;if(C1(E)){if(this.active=!1,this.topNumMatches=0,this.centerNumMatches=0,this.totalMatches=0,this.refreshRows(D),V){let y=k.store;for(let _D of Object.keys(y))y[_D]?.api?.findClearActive()}if(!C1(K))this.dispatchFindChanged();return}let A=X.allCols,R=S.getCallback("isFullWidthRow"),O=S.get("detailCellRendererParams"),u=S.get("fullWidthCellRendererParams"),v=S.get("groupRowRendererParams"),h=c7(S),P=w.isPivotMode(),b=0,g,c,s=!1,m=(y,_D,sG,GQ)=>{if(!sG)return;let n=g.get(y);if(!n){if(n=[],g.set(y,n),c.push(y),!GQ)D.add(y)}n.push([_D,sG]),b+=sG},zG=(y)=>{if(s){let{rowIndex:n,parent:GG}=y;while(n==null&&GG)n=GG.rowIndex,GG=GG.parent;if(n==null||!H.isRowInPage(n))return}let _D=y.hasChildren();if(!n7(h,y,_D,P,h7(h,y,_D),i7(h,y,_D)))return;let sG=y.data;if(R?.({rowNode:y})){if(u){let n=u.getFindMatches?.({node:y,data:sG,findSearchValue:F,updateMatches:this.refreshDebounced,getMatchesForValue:(GG)=>lz(E,N,GG)})??0;m(y,null,n)}return}if(kP(S,y,P)){let n,GG=v?.getFindText;if(GG){let gD=W.getValueForDisplay({node:y,from:"batch"}).value;n=GG(v5(S,{value:gD,node:y,data:sG,column:null,colDef:null,getValueFormatted:()=>{let{valueFormatted:TD}=W.getValueForDisplay({node:y,includeValueFormatted:!0,from:"batch"});return TD}}))}else{let{value:gD,valueFormatted:TD}=W.getValueForDisplay({node:y,includeValueFormatted:!0,from:"batch"});n=TD??gD}let yG=lz(E,N,n);m(y,null,yG);return}let GQ=y.level>0&&S.get("groupHideOpenParents")&&y.parent?.getFirstChild()===y&&!y.parent?.expanded;for(let n of A){if(KP(n))continue;let GG=_?.getCellSpan(n,y);if(GG&&GG.firstNode!==y)continue;if(n.colDef.showRowGroup&&GQ)continue;let yG,gD=n.colDef,TD=gD.getFindText;if(TD){let DQ=W.getValueForDisplay({column:n,node:y,from:"batch"}).value;yG=TD(v5(S,{value:DQ,node:y,data:sG,column:n,colDef:gD,getValueFormatted:()=>{let{valueFormatted:zQ}=W.getValueForDisplay({column:n,node:y,includeValueFormatted:!0,from:"batch"});return zQ}}))}else{let{value:DQ,valueFormatted:zQ}=W.getValueForDisplay({column:n,node:y,includeValueFormatted:!0,from:"batch"});yG=zQ??DQ}let P9=lz(E,N,yG);m(y,n,P9)}if(y.master&&V){let n=y.detailNode;if(n){let GG=n.detailGridInfo?.api;if(GG){GG.setGridOption("findSearchValue",F);let yG=GG.findGetTotalMatches();m(n,null,yG);return}}if(O){let GG=O.getFindMatches?.({node:y,data:sG,findSearchValue:F,updateMatches:this.refreshDebounced,getMatchesForValue:(yG)=>lz(E,N,yG)})??0;m(n??{parent:y,dummy:!0},null,GG,!n)}}};g=B,c=z,q?.forEachPinnedRow("top",zG),this.topNumMatches=b;let fG=b;if(g=Q,c=J,b=0,s=!!H&&!!f?.currentPageOnly,Y.forEachNodeAfterFilterAndSort(zG,!0),this.centerNumMatches=b,fG+=b,g=Z,c=U,b=0,s=!1,q?.forEachPinnedRow("bottom",zG),fG+=b,this.totalMatches=fG,this.active=!0,this.refreshRows(D),I)this.resetActiveMatch(I);this.dispatchFindChanged()}resetActiveMatch(G){let{column:D,numInMatch:z}=G,B=G.node;if(B.dummy){let X=B.parent?.detailNode;if(!X)return;B=X}let Q=B.rowPinned??null;if(!this.getMatches(Q)?.get(B)?.some(([X,Y])=>X===D&&Y>=z))return;let U=0;if(Q==null)U=this.topNumMatches;else if(Q==="bottom")U=this.topNumMatches+this.centerNumMatches;(()=>{let X=this.getMatches(Q);for(let Y of X.keys()){let W=Y===B,q=X.get(Y);for(let[H,_]of q){if(W&&H===D){U+=z;return}U+=_}}})();let S={...G,node:B,numOverall:U};if(this.activeMatch=S,this.refreshRows(new Set([B]),D==null?void 0:new Set([D])),this.scrollOnRefresh)this.scrollOnRefresh=!1,this.scrollToActive(S);this.setDetailActive(S)}refreshRows(G,D){if(!G.size)return;this.beans.rowRenderer.refreshCells({rowNodes:[...G],columns:D?[...D]:void 0,force:!0,suppressFlash:!0})}findAcrossContainers(G,D,z,B){if(!this.totalMatches){this.setActive();return}let Q=this.activeMatch,J=D;if(Q){let{column:U,node:Z,numInMatch:S,numOverall:X}=Q,Y=Z.rowPinned??null,W=X+B;if(this.findInContainer(Y,G,W,Z,U,S))return;let H=D.indexOf(Y),_=D.length;if(D.slice(H+1,_).some((w)=>this.findInContainer(w,G,W)))return;J=D.slice(0,H+1)}J.some((U)=>this.findInContainer(U,G,z))}findInContainer(G,D,z,B,Q,J){let U=this.getMatches(G),Z=this.getRowNodes(G),S=D?-1:1;if(B!=null){let q=U.get(B),H=q?.findIndex(([k])=>k===Q);if(H!=null&&H!=-1){let[k,w]=q[H];if(D?J>1:JH===B);X=Z[q+S]}if(X==null)return!1;let Y=U.get(X),W=Y?.[D?Y.length-1:0];if(W){let[q,H]=W;return this.setActive({column:q,node:X,numInMatch:D?H:1,numOverall:z}),!0}return!1}dispatchFindChanged(){let{eventSvc:G,activeMatch:D,totalMatches:z,findSearchValue:B}=this;G.dispatchEvent({type:"findChanged",activeMatch:D,totalMatches:z,findSearchValue:B})}setActive(G){if(G&&G.node.rowIndex==null){let z=G.node,B=z.footer?z.sibling:z.parent;while(B&&B.level!==-1)B.expanded=!0,B=B.parent;this.activeMatch=G,this.scrollOnRefresh=!0,this.beans.expansionSvc?.onGroupExpandedOrCollapsed();return}let D=this.activeMatch;if(this.activeMatch=G,this.refreshAndScrollToActive(G,D),G)this.setDetailActive(G);this.dispatchFindChanged()}setDetailActive({node:G,numInMatch:D}){if(G.detail)G.detailGridInfo?.api?.findGoTo(D)}refreshAndScrollToActive(G,D){if(G||D){let z=new Set,B=new Set,Q=!1,J=(U)=>{if(!U)return;let{node:Z,column:S}=U;if(z.add(Z),S==null)Q=!0;else B.add(S)};J(G),J(D),this.refreshRows(z,Q?void 0:B)}if(G)this.scrollToActive(G)}scrollToActive({node:{rowPinned:G,rowIndex:D},column:z}){let{ctrlsSvc:B,pagination:Q,gos:J}=this.beans,U=B.getScrollFeature();if(G==null&&D!=null){if(Q&&!J.get("findOptions")?.currentPageOnly&&!Q.isRowInPage(D))Q.goToPageWithIndex(D);U.ensureIndexVisible(D)}U.ensureColumnVisible(z)}goToInContainer(G,D,z){let B=z;for(let Q of G.keys()){let J=G.get(Q);for(let[U,Z]of J){if(D<=B+Z){this.setActive({column:U,node:Q,numInMatch:D-B,numOverall:D});return}B+=Z}}}getMatches(G){if(G==="top")return this.topMatches;else if(G==="bottom")return this.bottomMatches;else return this.centerMatches}getRowNodes(G){if(G==="top")return this.topNodes;else if(G==="bottom")return this.bottomNodes;else return this.centerNodes}getActiveMatchNum(G,D){let z=this.activeMatch;return z!=null&&z.node===G&&z.column===D?z.numInMatch:0}destroy(){this.topMatches.clear(),this.topNodes.length=0,this.centerMatches.clear(),this.centerNodes.length=0,this.bottomMatches.clear(),this.bottomNodes.length=0,this.activeMatch=void 0,super.destroy()}},NP={moduleName:"FindCore",version:j,rowModels:["clientSide"],beans:[fP],userComponents:{agFindCellRenderer:qP},css:[GP]},x8={moduleName:"Find",version:j,apiFunctions:{findGetTotalMatches:BP,findGoTo:QP,findNext:DP,findPrevious:zP,findGetActiveMatch:UP,findGetNumMatches:ZP,findGetParts:$P,findClearActive:JP,findRefresh:LP},dependsOn:[i,NP]};function MP({editSvc:G,gos:D,rowModel:z}){if(!EP(D,z)){IP(289,{rowModelType:D.get("rowModelType")});return}G?.startBatchEditing()}function AP({editSvc:G}){G?.stopBatchEditing({cancel:!0,source:"api",forceCancel:!0})}function RP({editSvc:G}){G?.stopBatchEditing({source:"api",forceStop:!0,commit:!0})}function CP(G){return G.editSvc?.isBatchEditing()??!1}var c8={moduleName:"BatchEdit",version:j,beans:[],apiFunctions:{isBatchEditing:CP,startBatchEdit:MP,cancelBatchEdit:AP,commitBatchEdit:RP},dependsOn:[FP,i],css:[]},VB=(G,D)=>{if(D===!1||D===null)return!1;if(h8(G))return D==="overwrite"?"overwrite":!1;if(typeof D==="string")return D;if(G==="sum")return"uniform";if(G==="avg"||G==null)return"overwrite";return D===!0?"overwrite":!1},h8=(G)=>G==="count"||G==="min"||G==="max"||G==="first"||G==="last",bP=(G)=>G==="sum"||G==="avg",VG=(G)=>{if(typeof G==="number")return G;if(typeof G==="bigint"||typeof G==="string"){let D=Number(G);return Number.isFinite(D)?D:0}if(typeof G==="boolean")return G?1:0;if(G!=null&&typeof G==="object"){if(typeof G.toNumber==="function")return VG(G.toNumber());if("value"in G)return VG(G.value)}return 0},j5=(G)=>Number.isFinite(G)?BigInt(Math.round(G)):0n,eD=(G)=>{if(typeof G==="bigint")return G;if(typeof G==="number")return j5(G);if(typeof G==="boolean")return G?1n:0n;if(typeof G==="string")try{return BigInt(G)}catch{return j5(Number(G))}if(G!=null&&typeof G==="object"){if(typeof G.toNumber==="function")return eD(G.toNumber());if("value"in G)return eD(G.value)}return 0n},xJ=(G)=>{let D=typeof G;if(D==="number"||D==="bigint"||D==="boolean")return!0;if(D==="string")return Number.isFinite(Number(G));if(G!=null&&D==="object"){if(typeof G.toNumber==="function")return!0;if("value"in G)return xJ(G.value)}return!1},vP=(G)=>{if(G.cellDataType==="bigint")return 0;let D=G.cellEditorParams;if(D==null||typeof D!=="object")return;let z=D.precision;if(typeof z==="number"&&Number.isInteger(z)&&z>=0)return z;let B=D.step;if(typeof B==="number"&&Number.isInteger(B))return 0;return},OP=class{constructor(G,D,z){this.params=G;let{aggregatedChildren:B,column:Q,newValue:J}=G,U=eD(J),Z=eD(G.oldValue),S=B.length,X=BigInt(S);if(this.children=B,this.column=Q,this.count=S,this.bigCount=X,this.newValue=J,this.strategy=VB(z,D?.distribution),z==="avg")this.target=U*X,this.oldTarget=Z*X;else this.target=U,this.oldTarget=Z;this.getVal=D?.getValue,this.setVal=D?.setValue}run(){let{strategy:G,newValue:D}=this;if(G===!1)return!1;if(G==="overwrite")return this.writeAll(D);let{target:z,oldTarget:B}=this;if(z===0n&&!xJ(D))return this.writeAll(D);if(G==="increment"&&z===B)return!1;if(G==="uniform")return this.writeUniformDirect(z);if(G==="increment")return this.writeIncrementDirect(z-B);return this.writePercentage()}readOne(G){let{children:D,column:z,getVal:B}=this,Q=D[G];if(B){let{colDef:J,api:U,context:Z}=this.params;return eD(B({node:Q,data:Q.data,column:z,colDef:J,api:U,context:Z,groupParams:this.params}))}return eD(Q.getDataValue(z,"value"))}writeOne(G,D){let{children:z,column:B,setVal:Q}=this,J=z[G];if(Q){let{colDef:U,api:Z,context:S}=this.params;return Q({node:J,data:J.data,column:B,colDef:U,api:Z,context:S,groupParams:this.params,value:D})}return J.setDataValue(B,D,"data")}writeAll(G){let{count:D}=this,z=!1;for(let B=0;B=0n?1n:-1n,Z=!1;for(let S=0;S=0n?1n:-1n,Z=!1;for(let S=0;S0n&&Z=0?Y:void 0;else this.precision=vP(J);this.getVal=D?.getValue,this.setVal=D?.setValue}run(){let{strategy:G,newValue:D}=this;if(G===!1)return!1;if(G==="overwrite")return this.writeAll(D);if(this.target===0&&!xJ(D))return this.writeAll(D);if(G==="increment"&&this.target===this.oldTarget)return!1;switch(G){case"uniform":return this.distributeUniform();case"increment":return this.distributeIncrement();default:return this.isAvg?this.distributePercentageAvg():this.distributePercentage()}}readOne(G){let{column:D,getVal:z}=this;if(z){let{colDef:B,api:Q,context:J}=this.params;return VG(z({node:G,data:G.data,column:D,colDef:B,api:Q,context:J,groupParams:this.params}))}return VG(G.getDataValue(D,"value"))}readValueAndCount(G){let{column:D,getVal:z}=this,B;if(z){let{colDef:Q,api:J,context:U}=this.params;B=z({node:G,data:G.data,column:D,colDef:Q,api:J,context:U,groupParams:this.params})}else B=G.getDataValue(D);if(G.group){if(B!=null&&typeof B==="object"){let{value:Q,count:J}=B;if(Q!=null&&typeof J==="number"&&J>0)return typeof Q==="number"?B:{value:VG(Q),count:J}}return{value:VG(B),count:G.allLeafChildren?.length||1}}return{value:VG(B),count:1}}writeOne(G,D){let{column:z,setVal:B}=this;if(B){let{colDef:Q,api:J,context:U}=this.params;return B({node:G,data:G.data,column:z,colDef:Q,api:J,context:U,groupParams:this.params,value:D})}return G.setDataValue(z,D,"data")}writeAll(G){let{children:D,count:z}=this,B=!1;for(let Q=0;Q=0?1:-1,Y=!1;for(let W=0;W=0?1:-1,W=!1;for(let q=0;q=0?1:-1,q=!1;for(let H=0;H=0?1:-1,k=!1;for(let w=0;w{let{aggregatedChildren:z,colDef:B}=G;if(z.length===0)return!1;let Q=B.aggFunc??null,J=n8(D,Q);if(J===!1)return!1;if(typeof J==="function")return J(G)??!0;if(B.cellDataType==="bigint")return new OP(G,J,Q).run();return new uP(G,J,Q).run()};function n8(G,D){if(!G)return;let z=G.distribution;if(z===!1||z===null)return!1;let B=h8(D),Q=G.default;if(typeof z==="object"){let J=typeof D==="string"?z[D]:void 0;if(J!==void 0)return V1(J,B,G);if(B)return!1;return V1(Q,!1,G)??DJ(G)}if(B)return z==="overwrite"?DJ(G,"overwrite"):!1;if(z===void 0&&!bP(D)){let J=V1(Q,!1,G);if(J!==void 0)return J}return G}function V1(G,D,z){if(G===!1||G===null)return!1;if(G===void 0)return;if(typeof G==="function")return G;if(typeof G==="object"){let B=G.distribution;if(D&&B!=="overwrite"&&B!==!0)return!1;let{precision:Q,getValue:J,setValue:U}=z;return{distribution:D?"overwrite":B,precision:G.precision??Q,getValue:G.getValue??J,setValue:G.setValue??U}}if(D&&G!=="overwrite"&&G!==!0)return!1;return DJ(z,D?"overwrite":G)}function DJ(G,D){return{distribution:D,precision:G.precision,getValue:G.getValue,setValue:G.setValue}}var jP=class extends VP{constructor(){super(...arguments);this.beanName="rowGroupingEditValueSvc"}isGroupCellEditable(G,D){let z=D.getColDef();if(!D.isColumnFunc(G,z.groupRowEditable))return!1;let B=z.groupRowValueSetter;if(typeof B==="function")return!0;let Q=z.aggFunc??null;if(typeof B==="object"){let J=n8(B,Q);return typeof J==="function"||J!==!1&&VB(Q,J?.distribution)!==!1}return VB(Q,B??void 0)!==!1}setGroupDataValue(G,D,z,B,Q,J){let U=D.getColDef(),Z=U.groupRowValueSetter;if(Z==null){let Y=U.groupRowEditable;Z=Y&&D.isColumnFunc(G,Y)?!0:void 0}if(!Z)return;let S=this.gos.addCommon({node:G,data:G.data,oldValue:B,newValue:z,colDef:U,column:D,eventSource:Q,valueChanged:J,aggregatedChildren:this.beans.aggChildrenSvc?.getAggregatedChildren(G,D)??[]});return(typeof Z==="function"?Z(S):i8(S,Z===!0?void 0:Z))??!0}},d8={moduleName:"RowGroupingEdit",version:j,beans:[jP],dependsOn:[i,CJ]},yP=class extends TP{constructor(G){super();this.beanName="agChartsExports",this.isEnterprise=!1,this.create=G.create,this._Theme=G._Theme,this._Scene=G._Scene,this.isEnterprise=G.isEnterprise,this._Util=G._Util}};function P5(G){if(G.chart!=null)return G.chart;return G}var hP=new Set(["__proto__","constructor","prototype"]);function $D(G,D,z){if(G==null)return z;let B=D.split("."),Q=G;while(B.length>1)if(Q=Q[B.shift()],Q==null)return z;let J=Q[B[0]];return J!=null?J:z}function iP(G,D,z){if(G==null)return;let B=D.split("."),Q=G;B.filter((J)=>!hP.has(J)).forEach((J,U)=>{if(!Q[J])Q[J]={};if(U{let N=(F)=>{if(!F)return!1;return Object.keys(F).some((E)=>$D(F[E],"title.enabled",!1))};return N(q)||N(H)})()):void 0,Zg(),B,k,q,H,{...J??{}},Q].filter((N)=>!!N).reduce((N,F)=>({baseTheme:N,overrides:F}),W);if(U&&X===Z){let N=G.agChartsExports._Theme.getChartTheme(W).palette;if(!Bg(U,N))f.palette=U}return f}function Bg(G,D){let z=(B,Q)=>{if(B===Q)return!0;if(B?.length!==Q?.length)return!1;return B?.every((J,U)=>J===Q?.[U])??!1};return z(G.fills,D.fills)&&z(G.strokes,D.strokes)}function iJ(G,D){return Object.keys(D.themes).includes(G)}function Qg(G,D,z){let Q={tooltip:{delay:500},legend:{listeners:{legendItemClick:(U)=>{let Z=G.getChart(),S=[U.seriesId,`${U.seriesId}-filtered-out`];for(let X of Z.series.filter((Y)=>S.includes(Y.id)))X.toggleSeriesItem(void 0,"category",U.itemId,void 0)}}},listeners:{click:(U)=>D.crossFilterCallback(U,!0)}};if(z==="pie"||z==="donut")return{[z]:{series:{fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$if:[{$eq:[{$value:"$parentIndex"},0]},{$mix:[{$value:"$1"},{$ref:"backgroundColor"},0.7]},{$value:"$1"}]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"},{$if:[{$eq:[{$value:"$parentIndex"},0]},{$mix:[{$value:"$1"},{$ref:"backgroundColor"},0.7]},{$value:"$1"}]}]}},...Q}};let J={};if(z!=="line")J.fill={$if:[{$isEven:[{$value:"$index"}]},{$palette:"fill"},{$mix:[{$path:["../$prevIndex/fill",{$palette:"fill"}]},{$ref:"backgroundColor"},0.7]}]};return{[z]:{series:{stroke:{$if:[{$isEven:[{$value:"$index"}]},{$palette:"stroke"},{$mix:[{$path:["../$prevIndex/fill",{$palette:"stroke"}]},{$ref:"backgroundColor"},0.7]}]},...J},...Q}}}var Jg=o8.reduce((G,D)=>({...G,[D]:{title:{_enabledFromTheme:!0}}}),{});function Ug(G,D,z){let B=G.getExtraPaddingDirections();return{common:{...D?{animation:{duration:500}}:void 0,axes:Jg,padding:{top:!z&&B.includes("top")?40:20,right:B.includes("right")?30:20,bottom:B.includes("bottom")?40:20,left:B.includes("left")?30:20}}}}function Zg(){return{pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function $g(G){let D=G.getChartThemeName(),z=G.getChartThemes();if(!z.includes(D))D=z[0];return D}function r8(G,D){let{customChartThemes:z}=G,B=z?.[D];if(!B)Gg(140,{name:D});return B}function nJ(G,D){let z={highlightedItem:{strokeWidth:2}};if(!D)z.unhighlightedSeries={opacity:1};if(!G)z.unhighlightedItem={opacity:1};return z}var qz=class{constructor(G){if(this.chartProxyParams=G,this.clearThemeOverrides=!1,this.agChartsExports=G.agChartsExports,this.chart=G.chartInstance,this.chartType=G.chartType,this.crossFiltering=G.crossFiltering,this.crossFilterCallback=G.crossFilterCallback,this.standaloneChartType=l(this.chartType),this.chart==null)this.chart=G.agChartsExports.create(this.getCommonChartOptions());else this.clearThemeOverrides=!0}crossFilteringReset(){}update(G){this.getChartRef().update(this.getUpdateOptions(G,this.getCommonChartOptions(G.updatedOverrides)))}updateThemeOverrides(G){this.getChartRef().updateDelta({theme:{overrides:G}})}getChart(){return P5(this.chart)}getChartRef(){return this.chart}downloadChart(G,D,z){let{chart:B}=this,Q=P5(B),J=D||Q.title.node.getPlainText(),{width:U,height:Z}=G||{};B.download({width:U,height:Z,fileName:J,fileFormat:z})}getChartImageDataURL(G){return this.getChart().getCanvasDataURL(G)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){return this.getChartOptions().theme.overrides??{}}getChartPalette(){return this.agChartsExports._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(G){let D=l(this.chartProxyParams.chartType);this.chart.updateDelta({theme:{overrides:{[D]:{paired:G}}}})}isPaired(){let G=l(this.chartProxyParams.chartType);return $D(this.getChartThemeOverrides(),`${G}.paired`,!0)}lookupCustomChartTheme(G){return r8(this.chartProxyParams,G)}getSeriesGroupType(){return}transformCategoryData(G,D){return G.map((z,B)=>{let Q=z[D],J=Q?.toString?Q.toString():"",U={...z};return U[D]={id:B,value:Q,toString:()=>J},U})}getCommonChartOptions(G){let D=this.clearThemeOverrides?{}:this.chart?.getOptions()??{},z=this.chart!=null?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;let B=this.chartProxyParams.styleNonce,Q=zg(this.chartProxyParams,this,this.agChartsExports.isEnterprise,this.getChartThemeDefaults(),G??z);return{...D,mode:"integrated",...B?{styleNonce:B}:{},suppressFieldDotNotation:!0,theme:Q,container:this.chartProxyParams.parentElement}}getChartThemeDefaults(){let G={enabled:!0,snap:!0,label:{enabled:!1}},D=this.agChartsExports.isEnterprise?{zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:G},category:{crosshair:G},log:{crosshair:G},time:{crosshair:G}}}:{};D.minHeight=0,D.minWidth=0,D.navigator={enabled:!1,height:18},D.context=this.chartProxyParams.context;let z={common:D};return this.setSeriesChartThemeDefaults(z),z}setSeriesChartThemeDefaults(G){let D=this.getSeriesChartThemeDefaults();if(!D)return;G[this.standaloneChartType]=D}getSeriesChartThemeDefaults(){return}getActiveFormattingPanelOverrides(){if(this.clearThemeOverrides)return{};return this.chart?.getOptions().theme?.overrides??{}}destroy({keepChartInstance:G=!1}={}){if(G)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){if(this.chart)this.chart.destroy(),this.chart=void 0}},HD=class extends qz{constructor(){super(...arguments);this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[],this.isSingleSeries=!1}getUpdateOptions(G,D){let z=this.getAxes(G,D);return{...D,data:this.getData(G,z),axes:z,series:this.getSeries(G)}}getData(G,D){let z=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&z?this.getCrossFilterData(G):this.getDataTransformedData(G,D)}getDataTransformedData(G,D){let z=D.x.type,{categories:B,data:Q}=G,[J]=B;switch(z){case"category":return this.transformCategoryData(Q,J.id);case"time":return this.transformTimeData(Q,J.id,J.convertTime);default:return Q}}getXAxisType(G){if(G.grouping)return"grouped-category";else if(this.isXAxisOfType(G,"time",(D)=>D instanceof Date))return"time";else if(this.isXAxisOfType(G,"number"))return"number";return"category"}isXAxisOfType(G,D,z){let[B]=G.categories;if(B?.chartDataType)return B.chartDataType===D;if(!z)return!1;let Q=G.data[0];if(!Q)return!1;return z(Q[B.id])}transformTimeData(G,D,z){if(G[0]?.[D]instanceof Date)return G;return G.map((Q)=>{let J=Q[D];return typeof J==="string"?{...Q,[D]:z?z(J):cP(J)}:Q})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(G){return this.crossFilteringSelectedPoints.length==0||this.crossFilteringSelectedPoints.includes(G)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(G,D){let[z]=D.categories,B=(Q)=>{if(this.standaloneChartType==="area")return D.getCrossFilteringContext().lastSelectedChartId===D.chartId?Q+"-total":Q;return Q+"-total"};return G.map((Q)=>{if(Q.yKey=B(Q.yKey),Q.listeners={seriesNodeClick:(J)=>{let U=J.datum[Q.xKey],Z=J.event.metaKey||J.event.ctrlKey;this.crossFilteringAddSelectedPoint(Z,U),this.crossFilterCallback(J)}},Q.marker={itemStyler:(J)=>{let U=J.datum[z.id],Z=J.highlightState==="highlighted-item";return{fill:Z?"yellow":J.fill,size:Z?14:this.crossFilteringPointSelected(U)?8:0}}},this.standaloneChartType==="area")Q.fillOpacity=this.crossFilteringDeselectedPoints()?0.3:1;if(this.standaloneChartType==="line")Q.strokeOpacity=this.crossFilteringDeselectedPoints()?0.3:1;return Q})}getCrossFilterData(G){this.crossFilteringAllPoints.clear();let[D]=G.categories,z=G.fields[0].colId,B=`${z}-filtered-out`,Q=G.getCrossFilteringContext().lastSelectedChartId;return G.data.map((J)=>{let U=J[D.id];this.crossFilteringAllPoints.add(U);let Z=this.crossFilteringPointSelected(U);if(this.standaloneChartType==="area"&&Q===G.chartId)J[`${z}-total`]=Z?J[z]:J[z]+J[B];if(this.standaloneChartType==="line")J[`${z}-total`]=Z?J[z]:J[z]+J[B];return J})}crossFilteringAddSelectedPoint(G,D){if(G)this.crossFilteringSelectedPoints.push(D);else this.crossFilteringSelectedPoints=[D]}isHorizontal(G){let D=this.standaloneChartType;if(D!=="waterfall"&&D!=="box-plot"&&D!=="range-bar")return!1;let z=G.theme,B=(Q)=>{let J=Q?.overrides?.[D]?.series?.direction;if(J!=null)return J==="horizontal";if(typeof Q?.baseTheme==="object")return B(Q.baseTheme);return!1};return B(z)}getSeriesChartThemeDefaults(){return{series:{highlight:nJ(this.crossFiltering,this.isSingleSeries)}}}},Lg=class extends HD{getSeries(G){let D=G.fields[0];return[{type:this.standaloneChartType,xKey:D.colId,xName:D.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(G){return{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}}}},Sg=class extends HD{constructor(){super(...arguments);this.isSingleSeries=!0}getAxes(G,D){let z=this.isHorizontal(D),B=z?"y":"x",Q=z?"x":"y";return{[B]:{type:this.getXAxisType(G),position:z?"left":"bottom"},[Q]:{type:"number",position:z?"bottom":"left"}}}getSeries(G){let[D]=G.categories,[z]=G.fields;return[{type:this.standaloneChartType,xKey:D.id,xName:D.name,yKey:z.colId,yName:z.displayName??void 0}]}},Xg=class extends qz{getUpdateOptions(G,D){return{...D,data:this.transformFunnelCategories(G),series:this.getSeries(G)}}transformFunnelCategories(G){let{data:D}=G,[{id:z}]=G.categories;return D.map((B,Q)=>({...B,[z]:{name:B[z],id:Q,toString:()=>String(B[z])}}))}getSeriesChartThemeDefaults(){let G={crosshair:{enabled:!1}};return{zoom:{enabled:!1},...this.chartType!=="pyramid"&&{axes:{category:G,number:G}}}}getSeries(G){let[{id:D}]=G.categories,[{colId:z}]=G.fields;return[{type:this.standaloneChartType,stageKey:D,valueKey:z}]}},qB="AG-GRID-DEFAULT-LABEL-KEY";function Wg(G,D){let z=a8(G,B,Q);return dJ(z);function B(U){return D.length}function Q(U,Z){let S=D[Z],X=U[S];return J(X)}function J(U){if(U==null)return null;return String(U)}}function qg(G,D){let z=a8(G,B,Q);return dJ(z);function B(J){return D(J)?.length??0}function Q(J,U){let Z=D(J);return Z?Z[U]:Z}}function dJ(G,D=null,z){let{depth:B,rootValues:Q,value:J,children:U}=G;if(Q)return Q.map((S)=>({[qB]:D,...S}));else if(B===0)return[{[qB]:D,...J}];let Z=[];for(let[S,X]of U.entries())Z.push(...dJ(X,S,!0));return z?[{[qB]:D,children:Z,...J??{}}]:Z}function a8(G,D,z){let B={depth:0,children:new Map};for(let J of G){let U=D(J);Q(J,U,z,0,B)}return B;function Q(J,U,Z,S,X){if(S===U){if(S===0){if(!X.rootValues)X.rootValues=[];X.rootValues.push(J)}else X.value=J;return X}else{let Y=Z(J,S),W=X.children.get(Y),q=Q(J,U,Z,S+1,W||{depth:0,children:new Map});return X.children.set(Y,q),X.depth=Math.max(1+q.depth,X.depth),X}}}var Hg=class extends qz{getUpdateOptions(G,D){let{fields:z}=G,[B,Q]=z;return{...D,series:this.getSeries(B,Q),data:this.getData(G,B,Q)}}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:"right"}}}getSeries(G,D){return[{type:this.standaloneChartType,labelKey:qB,sizeKey:G?.colId,sizeName:G?.displayName??void 0,colorKey:D?.colId,colorName:D?.displayName??void 0}]}getData(G,D,z){let{categories:B,data:Q,groupData:J,grouping:U}=G;if(U){let Z=z?Q.concat(J?.map((S)=>{let X={...S};return delete X[D.colId],X})??[]):Q;return qg(Z,(S)=>S[Yg]?.value??null)}else{let Z=B.map(({id:S})=>S);return Wg(Q,Z)}}},_g=class extends qz{getAxes(G){let D=this.standaloneChartType==="radial-bar";return{angle:{type:D?"angle-number":"angle-category"},radius:{type:D?"radius-category":"radius-number"}}}getSeries(G){let{fields:D,categories:z,seriesGroupType:B}=G,[Q]=z,J=this.standaloneChartType==="radial-bar",U=this.getSeriesGroupTypeOptions(B);return D.map((Z)=>{return{type:this.standaloneChartType,angleKey:J?Z.colId:Q.id,angleName:J?Z.displayName??void 0:Q.name,radiusKey:J?Q.id:Z.colId,radiusName:J?Q.name:Z.displayName??void 0,...U}})}getSeriesGroupType(){let G=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(G))return;let D=this.getChart().series?.[0]?.properties.toJson(),z=()=>D.normalizedTo?"normalized":"stacked";if(G==="nightingale")return D.grouped?"grouped":z();else return D.stacked?z():"grouped"}getUpdateOptions(G,D){let z=this.getAxes(G);return{...D,data:this.getData(G,z),axes:z,series:this.getSeries(G)}}getData(G,D){if(D.angle.type==="angle-category"||D.radius.type==="radius-category"){let[B]=G.categories;return this.transformCategoryData(G.data,B.id)}else return G.data}getSeriesGroupTypeOptions(G){if(!G)return{};return{grouped:G==="grouped"||void 0,stacked:G!=="grouped"||void 0,normalizedTo:G==="normalized"?100:void 0}}getSeriesChartThemeDefaults(){return{series:{highlight:nJ(this.crossFiltering)}}}},kg="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY",wg="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",Kg="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY";function fg(G,D){return G.reduce((z,B,Q,J)=>z.concat(D(B,Q,J)),[])}var Ng=class extends qz{getUpdateOptions(G,D){let z=wg,B=Kg,Q=kg;return{...D,series:this.getSeries(G,z,B,Q),data:this.getData(G,z,B,Q)}}getSeries(G,D,z,B){let[Q]=G.categories;return[{type:this.standaloneChartType,yKey:B,xKey:D,colorKey:z,yName:Q.name,xName:void 0,colorName:void 0}]}getData(G,D,z,B){let[Q]=G.categories;return fg(G.data,(J,U)=>{let Z=J[Q.id],S=Z==null?"":String(Z),X={id:U,value:Z,toString:()=>S};return G.fields.map(({colId:Y,displayName:W})=>({...J,[D]:W,[z]:J[Y],[B]:X}))})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:"right"},series:{tooltip:{renderer:Fg}}}}};function Fg(G){let{xKey:D,yKey:z,colorKey:B,yName:Q,datum:J}=G;return{title:"",data:[{label:Q,value:J[z]},{label:J[D],value:B&&J[B]}].map(({label:Z,value:S})=>({label:String(Z),value:String(S)}))}}var vg=class extends Ag{wireBeans(G){this.sortSvc=G.sortSvc,this.gridRowModel=G.rowModel,this.colModel=G.colModel,this.valueSvc=G.valueSvc,this.pivotResultCols=G.pivotResultCols,this.rowNodeSorter=G.rowNodeSorter}getData(G){if(G.crossFiltering){if(G.grouping)return b1(141),{chartData:[],colNames:{}};if(!Cg(this.gos))return b1(142),{chartData:[],colNames:{}}}if(Vg(this.gos)&&G.pivoting)this.updatePivotKeysForSSRM();let z=this.extractRowsFromGridRowModel(G);return z.chartData=this.aggregateRowsByDimension(G,z.chartData),z}extractRowsFromGridRowModel(G){let{crossFiltering:D,startRow:z,endRow:B,valueCols:Q,dimensionCols:J,grouping:U,crossFilteringSort:Z,combineGroupValues:S}=G,X=[],Y={},W={},q={},H={},_=[],k;if(D)H=this.getFilteredRowNodes(),_=this.getAllRowNodes(Z),k=_.length;else{let F=this.gridRowModel.getRowCount()-1;if(z===B&&z===0&&J.length===0&&Q.length===0)k=0;else k=(B>=0?Math.min(B,F):F)-z+1}if(k>0)for(let F of Q){let E=[],I=F.getColDef().pivotKeys;if(I)E=I.slice();let V=F.getColDef().headerName;if(V)E.push(V);if(E.length>0)Y[F.getId()]=E}let w=0,K=0,f={};for(let F=0;Fh.filter(Boolean).join(" - ")};if(S){let g=P.toString(),c=f[g];if(c)P=c;else f[g]=P}if(I[A]=P,E.group)W[v.toString()]=F-w;let b=v.slice(1,v.length).toString();if(b)q[b]=W[b]}else I[A]=O}else I[gG]=F+1}for(let V of Q){let A=V.getColId();if(D){let R=A+"-filtered-out",O=this.valueSvc.getValue(V,E,"data"),u=O;if(O!=null){if(typeof O.toNumber==="function")u=O.toNumber();else if(typeof O.value==="number")u=O.value}if(H[E.id])I[A]=u,I[R]=G.aggFunc||G.isScatter?void 0:0;else I[A]=G.aggFunc||G.isScatter?void 0:0,I[R]=u}else{let R=this.valueSvc.getValue(V,E,"data");if(R&&typeof R.value==="number")R=R.value;if(R&&Object.prototype.hasOwnProperty.call(R,"toString"))R=parseFloat(R.toString());I[A]=R!=null&&typeof R.toNumber==="function"?R.toNumber():R}}X.push(I)}let N;if(U){let F=Object.values(q),E=X;X=[],N=[];for(let I=0;Itypeof N[H]<"u").map((N)=>N[H]),k=S({values:_,column:q,colDef:q.colDef,pivotResultColumn:void 0,rowNode:void 0,data:void 0,aggregatedChildren:[],api:X,context:Y});W[H]=k&&typeof k.value<"u"?k.value:k;let w=`${H}-filtered-out`,K=W.__children.filter((N)=>typeof N[w]<"u").map((N)=>N[w]),f=S({values:K,column:q,colDef:q.colDef,pivotResultColumn:void 0,rowNode:void 0,data:void 0,aggregatedChildren:[],api:X,context:Y});W[w]=f&&typeof f.value<"u"?f.value:f}else{let _=W.__children.map((w)=>w[H]),k=S({values:_,column:q,colDef:q.colDef,pivotResultColumn:void 0,rowNode:void 0,data:void 0,aggregatedChildren:[],api:X,context:Y});W[H]=k&&typeof k.value<"u"?k.value:k}}}return U}updatePivotKeysForSSRM(){let G=this.pivotResultCols?.getPivotResultCols()?.list;if(!G)return;let D=this.extractPivotKeySeparator(G);for(let z of G)if(D==="")z.getColDef().pivotKeys=[];else{let B=z.getColId().split(D);z.getColDef().pivotKeys=B.slice(0,B.length-1)}}extractPivotKeySeparator(G){if(G.length===0)return"";let D=(B,Q)=>{let J=B.getGroupId();if(!B.getParent())return Q.split(J)[1][0];return D(B.getParent(),J)},z=G[0];if(z.getParent()==null)return"";return D(z.getParent(),z.getColId())}getGroupLabels(G,D){let z=[D];while(G&&G.level!==0)if(G=G.parent,G)if(G.group){let B=this.colModel.getCol(Rg);if(B){let Q=this.valueSvc.getValue(B,G,"data"),J=Q?.toString?String(Q.toString()):" ";z.push(J)}}else z.push(G.key);return z}getFilteredRowNodes(){let G={};return this.gridRowModel.forEachNodeAfterFilterAndSort((D)=>{G[D.id]=D}),G}getAllRowNodes(G){let D=[];this.gridRowModel.forEachNode((Q)=>{D.push(Q)});let z=this.rowNodeSorter;if(!z)return D;let B=G===!0?this.sortSvc?.getSortOptions():G;if(!B||B.length==0)return D;return z.doFullSortInPlace(D,B)}},jg=class extends Og{constructor(){super(...arguments);this.valueColsWithoutSeriesType=new Set}wireBeans(G){this.colModel=G.colModel,this.colNames=G.colNames,this.valueSvc=G.valueSvc}postConstruct(){let G=()=>this.valueColsWithoutSeriesType.clear();this.addManagedEventListeners({newColumnsLoaded:G,rowDataUpdated:G})}getColumn(G){return this.colModel.getColDefCol(G)}getAllDisplayedColumns(){return this.beans.visibleCols.allCols}getColDisplayName(G){return this.colNames.getDisplayNameForColumn(G,"chart")}getColGroupDisplayName(G){return this.colNames.getDisplayNameForColumnGroup(G,"chart")}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getGroupDisplayColumns(){return this.beans.showRowGroupCols?.columns??[]}isPivotMode(){return this.colModel.isPivotMode()}isPivotActive(){return this.colModel.isPivotActive()}getChartColumns(){let G=this.colModel.getCols(),D=new Set,z=new Set;for(let B of G){let Q=B.getColDef(),J=Q.chartDataType;if(J)switch(J){case"category":case"time":D.add(B);continue;case"series":z.add(B);continue;case"excluded":continue;default:g5(153,{chartDataType:J});break}if(Q.colId==="ag-Grid-AutoColumn"){D.add(B);continue}if(!B.isPrimary()){z.add(B);continue}(this.isInferredValueCol(B)?z:D).add(B)}return{dimensionCols:D,valueCols:z}}isInferredValueCol(G){let D=G.getColId();if(D==="ag-Grid-AutoColumn")return!1;let z=ug(this.beans,{rowIndex:0,rowPinned:null});if(!z)return this.valueColsWithoutSeriesType.has(D);let B=this.valueSvc.getValue(G,z,"data");if(B==null)B=this.extractLeafData(z,G);if(B!=null){if(typeof B.toNumber==="function")B=B.toNumber();else if(typeof B.value==="number")B=B.value}let Q=typeof B==="number"||G.colDef.cellDataType==="number"||["series","time"].includes(G.colDef.chartDataType);if(Q)this.valueColsWithoutSeriesType.add(D);else if(B==null&&G.colDef.cellDataType!=="number")g5(265,{colId:D});return Q}extractLeafData(G,D){let z=G.data&&this.valueSvc.getValue(D,G,"data");if(z!=null)return z;let B=G.childrenAfterGroup;if(B)for(let Q=0,J=B.length;Q0;if(this.chartDataModel.chartType==="customCombo"||G)this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[]}updateSeriesChartTypes(){if(!this.chartDataModel.isComboChart())return;if(this.seriesChartTypes=this.seriesChartTypes.map((G)=>{let D=["groupedColumn","stackedColumn","stackedArea"].includes(G.chartType);return G.secondaryAxis=D?!1:G.secondaryAxis,G}),this.chartDataModel.chartType==="customCombo"){this.updateSeriesChartTypesForCustomCombo();return}this.updateChartSeriesTypesForBuiltInCombos()}updateSeriesChartTypesForCustomCombo(){if(!(this.seriesChartTypes&&this.seriesChartTypes.length>0)&&!this.suppressComboChartWarnings)v1(150);this.seriesChartTypes=this.seriesChartTypes.map((B)=>{if(!gg.has(B.chartType))v1(151,{chartType:B.chartType}),B.chartType="line";return B});let D=(B)=>{if(!this.savedCustomSeriesChartTypes||this.savedCustomSeriesChartTypes.length===0)this.savedCustomSeriesChartTypes=this.seriesChartTypes;let Q=this.savedCustomSeriesChartTypes.find((J)=>J.colId===B.colId);if(!Q){if(B.selected&&!this.suppressComboChartWarnings)v1(152,{colId:B.colId});return{colId:B.colId,chartType:"line",secondaryAxis:!1}}return Q},z=this.chartDataModel.valueColState.map(D);this.seriesChartTypes=z,this.savedCustomSeriesChartTypes=z,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){let{chartType:G,valueColState:D}=this.chartDataModel,z=G==="columnLineCombo"?"groupedColumn":"stackedArea",B=G==="columnLineCombo"?"line":"groupedColumn",Q=D.filter((U)=>U.selected),J=Math.ceil(Q.length/2);this.seriesChartTypes=Q.map((U,Z)=>{let S=Z>=J?B:z;return{colId:U.colId,chartType:S,secondaryAxis:!1}})}},gG="AG-GRID-DEFAULT-CATEGORY",yg=class extends Eg{constructor(G){super();this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.colNames={},this.crossFiltering=!1,this.crossFilteringSort=!0,this.grouping=!1,this.useGroupColumnAsCategory=!1,this.params=G,this.chartId=G.chartId,this.setParams(G)}wireBeans(G){this.rangeSvc=G.rangeSvc,this.chartTranslation=G.chartTranslation}setParams(G){let{chartType:D,pivotChart:z,chartThemeName:B,switchCategorySeries:Q,aggFunc:J,cellRange:U,suppressChartRanges:Z,unlinkChart:S,crossFiltering:X,crossFilteringSort:Y,seriesGroupType:W,useGroupColumnAsCategory:q}=G;this.chartType=D,this.pivotChart=z??!1,this.chartThemeName=B,this.switchCategorySeries=!!Q,this.aggFunc=J,this.referenceCellRange=U,this.suppliedCellRange=U,this.suppressChartRanges=Z??!1,this.unlinked=!!S,this.crossFiltering=!!X,this.crossFilteringSort=Y??!0,this.seriesGroupType=W,this.useGroupColumnAsCategory=!!q}postConstruct(){this.datasource=this.createManagedBean(new vg),this.chartColSvc=this.createManagedBean(new jg),this.comboChartModel=this.createManagedBean(new Tg(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(G){let{cellRange:D,seriesChartTypes:z}=G;if(D!==this.suppliedCellRange)this.dimensionCellRange=void 0,this.valueCellRange=void 0;if(this.setParams(G),this.updateSelectedDimensions(D?.columns),this.updateCellRanges({setColsFromRange:!0}),this.isComboChart()||z)this.comboChartModel.update(z);if(!this.unlinked)this.updateData()}updateCellRanges(G){let{updatedColState:D,resetOrder:z,maintainColState:B,setColsFromRange:Q}=G??{};if(this.valueCellRange)this.referenceCellRange=this.valueCellRange;let{dimensionCols:J,valueCols:U}=this.chartColSvc.getChartColumns(),Z=this.getAllColumnsFromRanges();if(D)this.updateColumnState(D,z);if(this.setDimensionCellRange(J,Z,D),this.setValueCellRange(U,Z,Q),!D&&!B)this.resetColumnState(),this.syncDimensionCellRange();this.comboChartModel.updateSeriesChartTypes()}updateData(){let{startRow:G,endRow:D}=this.getRowIndexes();if(this.pivotChart)this.resetColumnState();this.grouping=this.isGrouping();let z={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,crossFilteringSort:this.getCrossFilteringSort(),valueCols:this.getSelectedValueCols(),startRow:G,endRow:D,isScatter:["scatter","bubble"].includes(this.chartType),combineGroupValues:rP(l(this.chartType))},{chartData:B,colNames:Q,groupChartData:J}=this.datasource.getData(z);this.chartData=B,this.groupChartData=J,this.colNames=Q,this.categoryAxisType=void 0}isGrouping(){let G=this.gos.get("treeData"),D=G?null:this.chartColSvc.getRowGroupColumns(),z=G||D&&D.length>0,B=this.getSelectedDimensions().map(({colId:U})=>U),J=this.chartColSvc.getGroupDisplayColumns().map((U)=>U.getColId()).some((U)=>B.includes(U));return!!z&&J}getSelectedValueCols(){return this.valueColState.filter((G)=>G.selected).map((G)=>G.column)}getSelectedDimensions(){return this.dimensionColState.filter((G)=>G.selected)}getValueColState(){return this.valueColState.map(this.displayNameMapper.bind(this))}displayNameMapper(G){let{column:D}=G;if(D){let z=this.getColDisplayName(D);G.displayName=this.isPivotMode()?this.getPivotDisplayName(D,z):z}else{let z=this.colNames[G.colId];G.displayName=z?z.join(" - "):this.getColDisplayName(D)}return G}getPivotDisplayName(G,D){let z=!1,B=[D],Q=(J)=>{if(!J)return;let U=this.chartColSvc.getColGroupDisplayName(J);if(U?.length)B.unshift(U),Q(J.getParent());else z=!0};if(Q(G.getParent()),z){let J=this.colNames[G.getColId()];if(J)B=J}return B.join(" - ")}getColDisplayName(G){return this.chartColSvc.getColDisplayName(G)}isPivotMode(){return this.chartColSvc.isPivotMode()}getChartDataType(G){let D=this.chartColSvc.getColumn(G);return D?D.getColDef().chartDataType:void 0}getConvertTime(G){let D=this.chartColSvc.getColumn(G);if(D?.colDef.cellDataType==="dateString")return this.beans.dataTypeSvc?.getDateParserFunction(D);return}isPivotActive(){return this.chartColSvc.isPivotActive()}createCellRange(G,...D){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:D,startColumn:G===pz.DIMENSION||this.referenceCellRange.startColumn==null?D[0]:this.referenceCellRange.startColumn,type:G}}getAllColumnsFromRanges(){if(this.pivotChart)return new Set(this.chartColSvc.getAllDisplayedColumns());let G=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;if(this.dimensionCellRange)G.push(...this.dimensionCellRange.columns);if(this.valueCellRange)G.push(...this.valueCellRange.columns);return new Set(G)}getRowIndexes(){let G=0,D=0,{rangeSvc:z,valueCellRange:B,dimensionCellRange:Q}=this,J=B||Q;if(z&&J){G=z.getRangeStartRow(J).rowIndex;let U=z.getRangeEndRow(J);D=U.rowPinned==="bottom"?-1:U.rowIndex}return{startRow:G,endRow:D}}resetColumnState(){let{dimensionCols:G,valueCols:D}=this.chartColSvc.getChartColumns(),z=this.getAllColumnsFromRanges(),B=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];let Q=VD(l(this.chartType)),J=!1,U=1,Z=this.suppliedCellRange.columns[0],S=this.gos.get("treeData"),X=S?null:this.chartColSvc.getRowGroupColumns(),Y=S||X&&X.length>0;G.forEach((H)=>{let _=Mg(H),k=this.crossFiltering&&this.aggFunc?Z.getColId()===H.getColId():this.useGroupColumnAsCategory&&Y&&_||(!J||Q)&&z.has(H);if(this.dimensionColState.push({column:H,colId:H.getColId(),displayName:this.getColDisplayName(H),selected:k,order:U++}),k)J=!0});let W={colId:gG,displayName:this.chartTranslation.translate("defaultCategory"),selected:!J,order:0};this.dimensionColState.unshift(W);let q=this.referenceCellRange.columns.filter((H)=>D.has(H));D.forEach((H)=>{if(B&&this.referenceCellRange.columns.includes(H))H=q.shift();this.valueColState.push({column:H,colId:H.getColId(),displayName:this.getColDisplayName(H),selected:z.has(H),order:U++})})}updateColumnState(G,D){let z=(X)=>X.colId===G.colId,{dimensionColState:B,valueColState:Q}=this,J=B.find(z),U=Q.find(z);if(J)if(!VD(l(this.chartType))){let Y=G.selected?J:B.filter((W)=>W!==J).find(({selected:W})=>W);B.forEach((W)=>W.selected=W===Y)}else J.selected=G.selected;else if(U)U.selected=G.selected;let Z=[...B,...Q],S=[];if(!D)Z.forEach((X,Y)=>{if(Y===G.order)S.push(G.colId);if(X.colId!==G.colId)S.push(X.colId)}),Z.forEach((X)=>{let Y=S.indexOf(X.colId);X.order=Y>=0?S.indexOf(X.colId):Z.length-1});this.reorderColState()}reorderColState(){let G=(D,z)=>D.order-z.order;this.dimensionColState.sort(G),this.valueColState.sort(G)}setDimensionCellRange(G,D,z){this.dimensionCellRange=void 0;let B=VD(l(this.chartType));if(!z&&!this.dimensionColState.length){let Z=[];if(G.forEach((S)=>{if(Z.length>0&&!B||!D.has(S))return;Z.push(S)}),Z.length>0)this.dimensionCellRange=this.createCellRange(pz.DIMENSION,...Z);return}let Q=z?[z]:[];if(this.crossFiltering&&this.aggFunc){let Z=this.suppliedCellRange.columns[0];Q=this.dimensionColState.filter((S)=>S.colId===Z.getColId())}else if(B||Q.length===0||Q.some(({column:Z})=>!Z||!G.has(Z)))Q=this.dimensionColState.filter((Z)=>Z.selected);let J=Q.length===1?Q[0].colId===gG:!1,U=Q.map(({column:Z})=>Z).filter((Z)=>Z!=null);if(U.length>0&&!J)this.dimensionCellRange=this.createCellRange(pz.DIMENSION,...U)}setValueCellRange(G,D,z){this.valueCellRange=void 0;let B=[],Q=bB(this.chartType),J=0;if(G.forEach((U)=>{if(z){if((Q==null||JZ.selected&&Z.colId===U.getColId()))B.push(U)}),B.length>0){let U=[];if(this.valueColState.length>0)U=this.valueColState.map((Z)=>Z.colId);else D.forEach((Z)=>U.push(Z.getColId()));B.sort((Z,S)=>U.indexOf(Z.getColId())-U.indexOf(S.getColId())),this.valueCellRange=this.createCellRange(pz.VALUE,...B)}}resetCellRanges(G,D){if(!G&&!D)return;let{dimensionCols:z,valueCols:B}=this.chartColSvc.getChartColumns(),Q=this.getAllColumnsFromRanges();if(G)this.setDimensionCellRange(z,Q);if(D)this.setValueCellRange(B,Q)}updateSelectedDimensions(G){let D=new Set(G.map((B)=>B.getColId()));if(!VD(l(this.chartType))){let Q=(this.dimensionColState.find((J)=>D.has(J.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map((J)=>({...J,selected:J.colId===Q}))}else{let B=this.dimensionColState.filter((J)=>D.has(J.colId)),Q=new Set(B.map((J)=>J.colId));this.dimensionColState=this.dimensionColState.map((J)=>({...J,selected:Q.has(J.colId)}))}}syncDimensionCellRange(){let G=this.getSelectedDimensions();if(G.length===0)return;let D=G.map(({column:z})=>z).filter((z)=>z!=null);if(D.length>0)this.dimensionCellRange=this.createCellRange(pz.DIMENSION,...D)}isComboChart(G){return cJ(G??this.chartType)}getCrossFilteringSort(){let G=this.crossFilteringSort;if(typeof G==="boolean")return G;let D=[];return G.forEach(({sort:z,colId:B})=>{let Q=this.chartColSvc.getColumn(B);if(Q)D.push({sort:z,column:Q,type:Ig(Q.getSortDef()?.type)})}),D}},e8=class extends HD{getAxes(G,D){return{x:{type:this.getXAxisType(G),position:this.isHorizontal(D)?"left":"bottom"},y:{type:"number",position:this.isHorizontal(D)?"bottom":"left"}}}computeSeriesStatistics(G,D){let{data:z,fields:B}=G,[Q]=G.categories,J=Q.id||gG,U=this.groupDataByCategory(J,z);return Array.from(U).map(([Z,S])=>{let X={[Q.id]:Z};return B.forEach((Y,W)=>{let q=S.map((_)=>_[Y.colId]).filter((_)=>typeof _==="number"&&!isNaN(_)),H=D(q);for(let _ of Object.keys(H)){let k=`${_}:${W}`;X[k]=q.length>0?H[_]:null}}),X})}groupDataByCategory(G,D){let z=(B)=>{if(G===gG)return 1;let Q=B[G];if(Q===null||Q===void 0)return"";return Q instanceof Date?Q.getTime():Q};return D.reduce((B,Q)=>{let J=z(Q),U=B.get(J);if(U)U.push(Q);else B.set(J,[Q]);return B},new Map)}},xg=class extends e8{getSeries(G){let[D]=G.categories;return G.fields.map((z,B)=>({type:this.standaloneChartType,xKey:D.id,xName:D.name,yName:z.displayName??void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${B}`,q1Key:`q1:${B}`,medianKey:`median:${B}`,q3Key:`q3:${B}`,maxKey:`max:${B}`}))}getData(G){return this.computeSeriesStatistics(G,(D)=>{let z=D.sort((B,Q)=>B-Q);return{min:z[0],q1:this.quantile(z,0.25),median:this.quantile(z,0.5),q3:this.quantile(z,0.75),max:z[z.length-1]}})}quantile(G,D){let z=(G.length-1)*D,B=Math.floor(z),Q=z-B;if(G[B+1]!==void 0)return G[B]+Q*(G[B+1]-G[B]);return G[B]}},cg=class extends e8{getSeries(G){let[D]=G.categories;return G.fields.map((z,B)=>({type:this.standaloneChartType,xKey:D.id,xName:D.name,yName:z.displayName??void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${B}`,yHighKey:`max:${B}`}))}getData(G){return this.computeSeriesStatistics(G,(D)=>{return{min:Math.min(...D),max:Math.max(...D)}})}},hg=class extends xP{constructor(){super(...arguments);this.beanName="enterpriseChartProxyFactory"}createChartProxy(G){switch(G.chartType){case"histogram":return new Lg(G);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new _g(G);case"rangeBar":case"rangeArea":return new cg(G);case"boxPlot":return new xg(G);case"treemap":case"sunburst":return new Hg(G);case"heatmap":return new Ng(G);case"waterfall":return new Sg(G);case"funnel":case"coneFunnel":case"pyramid":return new Xg(G)}return}},D9=class extends pg{constructor(G,D,z,B){super();this.chartController=G,this.eGui=D,this.cssClass=z,this.createPanels=B,this.panels=[]}postConstruct(){this.addManagedListeners(this.chartController,{chartUpdated:()=>this.refreshPanels(!0),chartApiUpdate:()=>this.refreshPanels(!1)})}addComponent(G){this.createBean(G),this.panels.push(G),G.addCss(this.cssClass),this.eGui.appendChild(G.getGui())}refreshPanels(G){let D=this.chartController.getChartType(),z=this.chartController.isGrouping(),B=l(D);if(G&&D===this.chartType&&z===this.isGrouping)return;this.destroyPanels(),this.createPanels(D,B),this.chartType=D,this.isGrouping=z}destroyPanels(){for(let G of this.panels)mg(G.getGui()),this.destroyBean(G);this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}},og=class extends sg{constructor(G){super();this.chartMenuParamsFactory=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),D=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(`
+ + + +
`,[p,tg],{animationGroup:G,animationHeightInput:D})}},z9=class extends XJ{constructor(G){super({...G,dialogCallbacks:g6})}},TG={selector:"AG-COLOR-PICKER",component:z9},eg=class extends ag{constructor(G){super();this.chartMenuParamsFactory=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),D=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),z=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),B=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(`
+ + + + + +
`,[p,rg,TG],{crosshairGroup:G,crosshairLabelCheckbox:D,crosshairSnapCheckbox:z,crosshairStrokeColorPicker:B})}},zT=class extends DT{constructor(G){super();this.chartMenuParamsFactory=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),D=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);D.minValue=10;let z=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(`
+ + + + +
`,[p,WG,GT],{navigatorGroup:G,navigatorHeightSlider:D,navigatorMiniChartCheckbox:z})}},UT=class extends QT{constructor(G){super();this.chartMenuParamsFactory=G,this.zoomScrollingStepInput=JT}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),D=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),z=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);z.step=0.01,z.minValue=z.step;let B=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");D.onValueChange=((Q)=>(J)=>{if(!Q)return;Q(J),this.zoomScrollingStepInput.setDisabled(!J)})(D.onValueChange),this.setTemplate(`
+ + + + + +
`,[p,BT,WG],{zoomGroup:G,zoomScrollingCheckbox:D,zoomScrollingStepInput:z,zoomSelectingCheckbox:B}),this.zoomScrollingStepInput.setDisabled(!D.value)}},ZT=["navigator","zoom","animation","crosshair"],$T=class extends lg{constructor(G){super('
');this.chartMenuContext=G}postConstruct(){this.chartPanelFeature=this.createManagedBean(new D9(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(G,D)=>this.createPanels(G,D))),this.chartPanelFeature.refreshPanels()}createPanels(G,D){for(let z of ZT){if(!this.isGroupPanelShownForSeries(z,D))continue;let B=this.createPanel(z);this.chartPanelFeature.addComponent(B)}}isGroupPanelShownForSeries(G,D){return G==="animation"||SD(D)&&!zJ(D)}createPanel(G){let{chartMenuParamsFactory:D,chartAxisMenuParamsFactory:z}=this.chartMenuContext;switch(G){case"navigator":return new zT(D);case"zoom":return new UT(D);case"animation":return new og(D);case"crosshair":return new eg(z)}}},LT=class extends ig{constructor(){super(...arguments);this.beanName="advSettingsMenuFactory"}showMenu(G,D){this.hideMenu();let z=this.createBean(new ST(G));this.activeDialog=this.createBean(new PB({title:this.beans.chartTranslation.translate("advancedSettings"),component:z,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{G9(z.getGui())[0]?.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,D?.focus({preventScroll:!0})}})),this.activeMenu=z}hideMenu(){if(this.activeDialog)this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}},ST=class extends ng{constructor(G){super('
');this.chartMenuContext=G}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new $T(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(G){if(G.defaultPrevented)return;G.preventDefault();let D=G.shiftKey,z=this.advancedSettingsPanel.getGui(),B=dg(this.beans,z,!1,D);if(B)B.focus();else{let Q=G9(z);if(Q.length)Q[D?Q.length-1:0].focus()}}},wT=class extends XT{constructor(){super(...arguments);this.beanName="chartMenuListFactory"}wireBeans(G){this.popupSvc=G.popupSvc,this.chartMenuSvc=G.chartMenuSvc,this.chartTranslation=G.chartTranslation}showMenuList(G){let{eventSource:D,showMenu:z,chartMenuContext:B,closeOnElementClick:Q}=G,J=this.chartMenuSvc.doChartToolPanelsExist(B.chartController),U=this.mapWithStockItems(this.getMenuItems(B.chartController,J),B,z,D,J);if(!U.length)return;let Z=this.createBean(new KT(U));this.activeChartMenuList=Z;let S=-1,X="left";if(this.gos.get("enableRtl"))S=1,X="right";let Y=Z.getGui();this.popupSvc.addPopup({modal:!0,eChild:Y,closeOnEsc:!0,alwaysOnTop:!0,closedCallback:()=>{if(this.destroyBean(Z),this.activeChartMenuList=void 0,kT(this.beans))D.focus({preventScroll:!0})},afterGuiAttached:(W)=>{Z.afterGuiAttached(W,Q)},positionCallback:()=>{this.popupSvc.positionPopupByComponent({type:"chartMenu",eventSource:D,ePopup:Y,alignSide:X,nudgeX:4*S,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(G,D){let z=[...D?["chartEdit"]:[],...G.isEnterprise()?["chartAdvancedSettings"]:[],G.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],B=this.gos.get("chartMenuItems");if(!B)return z;else if(Array.isArray(B))return B;else return B(qT(this.gos,{defaultItems:z,chartId:G.getChartId()}))}mapWithStockItems(G,D,z,B,Q){if(!G)return[];let J=[];for(let U of G){let Z;if(typeof U==="string")Z=this.getStockMenuItem(U,D,z,B,Q);else Z={...U};if(!Z)continue;let{subMenu:S}=Z;if(Array.isArray(S))Z.subMenu=this.mapWithStockItems(S,D,z,B,Q);J.push(Z)}return J}getStockMenuItem(G,D,z,B,Q){switch(G){case"chartEdit":return Q?this.createMenuItem(this.chartTranslation.translate("chartEdit"),"chartsMenuEdit",z):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslation.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuSvc.openAdvancedSettings(D,B));case"chartUnlink":return D.chartController.isChartLinked()?this.createMenuItem(this.chartTranslation.translate("chartUnlink"),"unlinked",()=>this.chartMenuSvc.toggleLinked(D)):null;case"chartLink":return!D.chartController.isChartLinked()?this.createMenuItem(this.chartTranslation.translate("chartLink"),"linked",()=>this.chartMenuSvc.toggleLinked(D)):null;case"chartDownload":return this.createMenuItem(this.chartTranslation.translate("chartDownload"),"chartsDownload",()=>this.chartMenuSvc.downloadChart(D))}return null}createMenuItem(G,D,z){return{name:G,icon:HT(D,this.beans,null),action:z}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}},KT=class extends YT{constructor(G){super(` + + `);this.menuItems=G,this.eChartsMenu=WT}postConstruct(){this.mainMenuList=this.createManagedBean(new KJ(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){this.hidePopupFunc?.()}afterGuiAttached({hidePopup:G},D){let z=Date.now();if(G){if(this.hidePopupFunc=G,this.addDestroyFunc(G),D){let B=()=>{if(Date.now()-z<500)return;this.hidePopupFunc()};D.addEventListener("click",B),this.addDestroyFunc(()=>{D?.removeEventListener("click",B)})}}_T(this.mainMenuList.getGui())}},FT=class extends fT{constructor(){super(...arguments);this.beanName="chartCrossFilterSvc"}filter(G,D=!1){let z=this.beans.filterManager,B=z?.getFilterModel()??{};if(D){if(Object.keys(B).length>0)z?.setFilterModel(null);return}let Q=T5(G);if(Q.indexOf("-filtered-out"))Q=Q.replace("-filtered-out","");this.updateFilters(B,G,Q)}updateFilters(G,D,z){let B=T5(D),Q=this.convertRawValue(z,D.datum[B]);if(Q===void 0)return;let J=this.beans.filterManager;J?.getColumnFilterInstance(z).then((U)=>{let Z=U?.filterType,S,X=(_)=>_;if(Z==="multi"){let _=IT(U);S=_.setFilter,X=_.processModel??X}else if(Z==="set")S=U;if(!S){NT(154,{colId:z});return}let Y=D.event.metaKey||D.event.ctrlKey,W=S.getFilterHandler().getCrossFilterModel((_,k,w)=>MT(Y,_(Q),k,w)),q=X(W),H=Y?{...G}:{};H[z]=q,J?.setFilterModel(H)})}convertRawValue(G,D){let{colModel:z,dataTypeSvc:B}=this.beans,Q=z.getColById(G),J=Q?.colDef;if(J&&B&&J.chartDataType==="time"&&J.cellDataType==="dateString")return B.getDateFormatterFunction(Q)(D);return D}};function ET(G,D,z){let B=Array(z);for(let Q=0;QET(Q,z,D)}}return{}}function T5(G){return G.xKey||G.calloutLabelKey}function MT(G,D,z,B){let Q;if(G)if(z.has(D)&&(B==null||B.includes(D))){if(Q=[],B==null){for(let J of z)if(J!==D)Q.push(J)}else for(let J of B)if(J!==D&&z.has(J))Q.push(J)}else{if(B==null)Q=Array.from(z);else{Q=[];for(let J of B)if(z.has(J))Q.push(J)}Q.push(D)}else Q=[D];return{filterType:"set",values:Q}}var RT=["chartUnlink","chartLink","chartDownload","chartMenu"],HB={settings:"chartSettings",data:"chartData",format:"chartFormat"},CT=class extends AT{constructor(){super(...arguments);this.beanName="chartMenuSvc"}wireBeans(G){this.advSettingsMenuFactory=G.advSettingsMenuFactory}downloadChart(G,D,z,B){G.chartController.getChartProxy().downloadChart(D,z,B)}toggleLinked(G){G.chartController.detachChartRange()}openAdvancedSettings(G,D){this.advSettingsMenuFactory?.showMenu(G,D)}hideAdvancedSettings(){this.advSettingsMenuFactory?.hideMenu()}getChartToolbarOptions(){let G=["chartMenu"],D=this.gos.getCallback("getChartToolbarItems");return D?D({defaultItems:G}).filter((B)=>{if(!RT.includes(B))return y5(155,{option:B}),!1;return!0}):G}getChartToolPanels(G){let D=this.gos.get("chartToolPanelsDef"),B=D?.panels?.map((U)=>{let Z=HB[U];if(!Z)y5(156,{panel:U});return Z}).filter((U)=>Boolean(U))??Object.values(HB);if(G.isPivotChart())B=B.filter((U)=>U!=="chartData");let Q=D?.defaultToolPanel,J=Q&&HB[Q]||B[0];return{panels:B,defaultPanel:J}}doesChartToolbarExist(){return this.getChartToolbarOptions().length>0}doChartToolPanelsExist(G){let{panels:D}=this.getChartToolPanels(G);return D.length>0}},bT={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",stackedLineTooltip:"Stacked",normalizedLineTooltip:"100% Stacked",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",stackedLineFull:"Stacked Line",normalizedLineFull:"100% Stacked Line",customCombo:"Custom Combination",funnel:"Funnel",coneFunnel:"Cone Funnel",pyramid:"Pyramid",funnelGroup:"Funnel",funnelTooltip:"Funnel",coneFunnelTooltip:"Cone Funnel",pyramidTooltip:"Pyramid",dropOff:"Drop-Off",stageLabels:"Stage Labels",reverse:"Reverse",tooltipMode:"Tooltip Mode",tooltipModeSingle:"Single",tooltipModeShared:"Multiple",tooltipModeCompact:"Compact",groupedColumn:"Grouped",stackedColumn:"Stacked",pie:"Pie",donut:"Donut",line:"Line",scatter:"Scatter",bubble:"Bubble",area:"Area",stackedArea:"Stacked",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",heatmap:"Heatmap",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",group:"Group",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},vT=class extends VT{constructor(){super(...arguments);this.beanName="chartTranslation"}translate(G){let D=this.getLocaleTextFunc(),z=bT[G];return D(G,z)}},Hz=(G)=>{return(D)=>{if(D==null)return!0;return G(D)}},n5=(G)=>typeof G==="string",lJ=(G)=>typeof G==="boolean",dT=(G)=>typeof G==="object",bG=(G,D)=>(z)=>`AG Grid - unable to update chart as invalid params supplied: \`${G}: ${z}\`, expected ${D}.`,B9=(G)=>{return`${G} is not supported in AG Charts Community ('ag-charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`},lT=["doughnut"],pJ=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"];function pT(G){return!!m8(G)||cJ(G)}function mT(G){return lT.includes(G)}var tT=Hz((G)=>{if(pT(G))return!0;if(mT(G)){let D=S0(G);return U0(`The chart type '${G}' has been deprecated. Please use '${D}' instead.`),D}return!1}),sT=Hz((G)=>{return typeof G==="object"}),oT=Hz((G)=>{return typeof G==="object"}),rT=Hz((G)=>{return typeof G==="string"||typeof G==="function"}),Q9=(G)=>({property:"chartType",validationFn:Hz((D)=>G||!D||!mP(D)),warnMessage:(D)=>B9(`The '${D}' chart type`)}),J9=(G)=>({property:"switchCategorySeries",validationFn:Hz((D)=>{if(!D||G)return!0;return}),warnMessage:()=>B9("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0}),mJ=()=>[{property:"chartId",validationFn:n5,warnMessage:bG("chartId","string")},{property:"chartType",validationFn:tT,warnMessage:bG("chartType","ChartType")},{property:"chartThemeName",validationFn:n5,warnMessage:bG("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:sT,warnMessage:bG("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:lJ,warnMessage:bG("unlinkChart","boolean")}],U9=(G)=>[{property:"cellRange",validationFn:oT,warnMessage:bG("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:lJ,warnMessage:bG("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:rT,warnMessage:bG("aggFunc","string or IAggFunc")},J9(G)];function aT(G,D){switch(G.type){case"rangeChartUpdate":return Gy(G,D);case"pivotChartUpdate":return Dy(G);case"crossFilterChartUpdate":return zy(G,D);default:return U0(`Invalid value supplied for 'type': ${G.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}function eT(G,D){return aB(G,[Q9(D),J9(D)])}function Gy(G,D){let z=[...mJ(),Q9(D),...U9(D),{property:"seriesChartTypes",validationFn:(B)=>B===void 0||Array.isArray(B)&&B.every(dT),warnMessage:bG("seriesChartTypes","Array of SeriesChartType")},{property:"useGroupColumnAsCategory",validationFn:lJ,warnMessage:bG("useGroupColumnAsCategory","boolean")}];return aB(G,z,[...pJ,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType","useGroupColumnAsCategory"],"UpdateRangeChartParams")}function Dy(G){let D=[...mJ()];return aB(G,D,[...pJ],"UpdatePivotChartParams")}function zy(G,D){let z=[...mJ(),...U9(D)];return aB(G,z,[...pJ,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}function aB(G,D,z,B){let Q=void 0;for(let J of D){let{property:U,validationFn:Z,warnMessage:S,warnIfFixed:X}=J;if(U in G){let Y=G[U],W=Z(Y);if(W===!0)continue;if(W===!1)return U0(S(Y)),!1;if(Q=Q||{...G},Q[U]=W,X)U0(S(Y))}}if(z){for(let J of Object.keys(G))if(!z.includes(J))return U0(`Unexpected property supplied. ${B} does not contain: \`${J}\`.`),!1}if(Q)return Q;return!0}var Z9=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],By=class extends nT{constructor(G){super();this.model=G,this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(G){this.rangeSvc=G.rangeSvc,this.agChartsExports=G.agChartsExports}postConstruct(){if(this.setChartRange(),this.model.unlinked){if(this.rangeSvc)this.rangeSvc.setCellRanges([])}let G=this.updateForGridChange.bind(this,{});this.addManagedEventListeners({cellSelectionChanged:(D)=>{if(D.id&&D.id===this.model.chartId)this.updateForRangeChange()},columnMoved:G,columnPinned:G,columnVisible:G,columnRowGroupChanged:G,modelUpdated:G,cellValueChanged:this.updateForDataChange.bind(this),cellEditValuesChanged:this.updateForDataChange.bind(this)})}update(G){if(!this.validUpdateType(G))return!1;let D=aT(G,this.agChartsExports.isEnterprise);if(!D)return!1;let z=D===!0?G:D;return this.applyValidatedChartParams(z),!0}applyValidatedChartParams(G){let{chartId:D,chartType:z,chartThemeName:B,unlinkChart:Q}=G,U={...{chartId:D,pivotChart:this.model.pivotChart,chartType:z??this.model.chartType,chartThemeName:B??this.model.chartThemeName,unlinkChart:Q??this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1}};switch(G.type){case"rangeChartUpdate":U.cellRange=this.createCellRange(G)??this.model.suppliedCellRange,U.switchCategorySeries=G.switchCategorySeries??this.model.switchCategorySeries,U.aggFunc=G.aggFunc??this.model.aggFunc,U.seriesChartTypes=G.seriesChartTypes,U.suppressChartRanges=G.suppressChartRanges??this.model.suppressChartRanges,U.seriesGroupType=G.seriesGroupType??this.model.seriesGroupType,U.useGroupColumnAsCategory=G.useGroupColumnAsCategory??this.model.useGroupColumnAsCategory;break;case"crossFilterChartUpdate":U.cellRange=this.createCellRange(G)??this.model.suppliedCellRange,U.switchCategorySeries=!1,U.aggFunc=G.aggFunc??this.model.aggFunc,U.crossFiltering=!0,U.crossFilteringSort=this.model.crossFilteringSort,U.suppressChartRanges=G.suppressChartRanges??this.model.suppressChartRanges;break;case"pivotChartUpdate":U.switchCategorySeries=!1;break}if(this.model.updateModel(U),U.unlinkChart||U.suppressChartRanges)this.rangeSvc?.setCellRanges([]);else this.setChartRange()}updateForGridChange(G){if(this.model.unlinked)return;let{maintainColState:D,setColsFromRange:z}=G??{};this.model.updateCellRanges({maintainColState:D,setColsFromRange:z}),this.model.updateData(),this.setChartRange()}updateForDataChange(){if(this.model.unlinked)return;this.model.updateData(),this.raiseChartModelUpdateEvent()}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(G){if(this.model.updateCellRanges(G),this.model.updateData(),G.skipAnimation)this.getChartProxy().getChartRef().skipAnimations();this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(G){this.chartProxy.updateThemeOverrides(G)}getChartUpdateParams(G){let z=this.getSelectedValueColState().map((Z)=>({colId:Z.colId,displayName:Z.displayName})),B=this.getChartData(),Q=this.getSelectedDimensions(),J=this.model,U={data:B,groupData:J.groupChartData,grouping:this.isGrouping(),categories:Q.map(({colId:Z,displayName:S})=>{let X=J.categoryAxisType??J.getChartDataType(Z);return{id:Z,name:S,chartDataType:X,convertTime:X==="time"?J.getConvertTime(Z):void 0}}),fields:z,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:G,seriesGroupType:J.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(U):U}invertCategorySeriesParams(G){let[D]=G.categories,z=[{id:gG,name:""}],B=G.data.map((J,U)=>{let Z=`${D.id}:${U}`,S=J[D.id],X=S==null?"":String(S);return{colId:Z,displayName:X}}),Q=G.fields.map((J)=>{let U={[gG]:J.displayName};for(let[Z,S]of G.data.entries()){let X=`${D.id}:${Z}`,Y=S[J.colId];U[X]=Y}return U});return{...G,categories:z,fields:B,data:Q}}getChartModel(){let G=this.model.pivotChart?"pivot":"range",D=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:G,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides(),chartPalette:this.chartProxy?.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:D,seriesGroupType:this.model.seriesGroupType,useGroupColumnAsCategory:this.model.useGroupColumnAsCategory}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(G){this.updateMultiSeriesAndCategory(this.model.chartType,G),this.model.chartType=G,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(G){if(!s8(this.getChartType()))return;this.model.switchCategorySeries=G,this.raiseChartModelUpdateEvent()}getAggFunc(){return this.model.aggFunc}setAggFunc(G,D){if(this.model.aggFunc===G)return;if(this.model.aggFunc=G,D)return;this.model.updateData(),this.raiseChartModelUpdateEvent()}updateMultiSeriesAndCategory(G,D){let z=(Z,S)=>{let X=0;for(let Y of Z){if(!Y.selected)continue;if(X>=S)Y.selected=!1;else X++}if(X===0)Z[0].selected=!0},B=QJ(D),Q=bB(D),J=B!=null&&(QJ(G)??100)>(B??100),U=Q!=null&&(bB(G)??100)>(Q??100);if(J)z(this.model.dimensionColState,B);if(U)z(this.model.valueColState,Q);if(J||U)this.model.resetCellRanges(J,U),this.setChartRange(!0)}setChartThemeName(G,D){if(this.model.chartThemeName=G,!D)this.raiseChartModelUpdateEvent()}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||Z9}getThemes(){return this.getThemeNames().map((D)=>{let B=iJ(D,this.agChartsExports._Theme)?D:this.chartProxy.lookupCustomChartTheme(D);return this.agChartsExports._Theme.getChartTheme(B)})}getPalettes(){return this.getThemes().map((D)=>{return D.palette})}getSelectedValueColState(){return this.model.getValueColState().filter((G)=>G.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.model.getValueColState()}}setChartRange(G=!1){if(this.rangeSvc&&!this.model.suppressChartRanges&&!this.model.unlinked)this.rangeSvc.setCellRanges(this.getCellRanges());if(!G)this.raiseChartModelUpdateEvent()}detachChartRange(){if(this.model.unlinked=!this.model.unlinked,this.model.unlinked){if(this.rangeSvc)this.rangeSvc.setCellRanges([])}else this.updateForGridChange();this.dispatchLocalEvent({type:"chartLinkedChanged"})}setChartProxy(G){this.chartProxy=G}getChartProxy(){return this.chartProxy}isActiveXYChart(){return["scatter","bubble"].includes(this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){let G=this.model.comboChartModel.savedCustomSeriesChartTypes;return G&&G.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(G){return this.model.isComboChart(G)}updateSeriesChartType(G,D,z){let B=this.model.comboChartModel.seriesChartTypes.find((Q)=>Q.colId===G);if(B){let Q=this.model.chartType!=="customCombo";if(Q)this.model.chartType="customCombo";let J=B.chartType;if(D!=null)B.chartType=D;if(z!=null)B.secondaryAxis=z;if(this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),Q)this.dispatchLocalEvent({type:"chartTypeChanged"});if(J!==D)this.dispatchLocalEvent({type:"chartSeriesChartTypeChanged"});this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){let G=this.getSelectedValueColState().map((D)=>D.colId);return this.getSeriesChartTypes().filter((D)=>G.includes(D.colId))}getChartSeriesTypes(G){let D=G??this.getChartType();return this.isComboChart(D)?["line","bar","area"]:[l(D)]}getChartSeriesType(){let G=this.getSeriesChartTypes();if(G.length===0)return"bar";let D=G[0].chartType;if(D==="columnLineCombo")return"bar";if(D==="areaColumnCombo")return"area";return l(D)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter((G)=>G)}createCellRange(G){return G.cellRange&&this.rangeSvc?.createPartialCellRangeFromRangeParams(G.cellRange,!0)}validUpdateType(G){if(!G.type)return i5(136),!1;let D={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},z=Object.keys(D).find((Q)=>D[Q]())??"Range Chart",B=G.type===`${z[0].toLowerCase()}${z.slice(1).replace(/ /g,"")}Update`;if(!B)i5(137,{currentChartType:z,type:G.type});return B}getCellRangeParams(){let G=this.getCellRanges(),D=G[0],z=D?.startRow||null,B=D?.endRow||null;return{rowStartIndex:z?.rowIndex??null,rowStartPinned:z?.rowPinned,rowEndIndex:B?.rowIndex??null,rowEndPinned:B?.rowPinned,columns:G.reduce((Q,J)=>Q.concat(J.columns.map((U)=>U.getId())),[])}}setCategoryAxisType(G){this.model.categoryAxisType=G,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){return this.model.seriesGroupType??this.chartProxy.getSeriesGroupType()}setSeriesGroupType(G){this.model.seriesGroupType=G,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){this.dispatchLocalEvent({type:"chartModelUpdate"}),this.raiseChartOptionsChangedEvent()}raiseChartUpdatedEvent(){this.dispatchLocalEvent({type:"chartUpdated"})}raiseChartApiUpdateEvent(){this.dispatchLocalEvent({type:"chartApiUpdate"})}raiseChartOptionsChangedEvent(){let{chartId:G,chartType:D}=this.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:G,chartType:D,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides()})}raiseChartRangeSelectionChangedEvent(){this.eventSvc.dispatchEvent({type:"chartRangeSelectionChanged",id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()})}destroy(){if(super.destroy(),this.rangeSvc)this.rangeSvc.setCellRanges([])}},Qy=class extends HD{getAxes(G){let D={x:{type:this.getXAxisType(G),position:"bottom"},y:{type:"number",position:"left"}};if(this.isNormalised())D.y.label={...D.y.label,formatter:(z)=>Math.round(z.value)+"%"};return D}getSeries(G){let[D]=G.categories,z=G.fields.map((B)=>({type:this.standaloneChartType,xKey:D.id,xName:D.name,yKey:B.colId,yName:B.displayName,normalizedTo:this.chartType==="normalizedArea"?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(z,G):z}isNormalised(){return!this.crossFiltering&&this.chartType==="normalizedArea"}},Jy=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),Uy=class extends HD{getAxes(G){let D={x:{type:this.getXAxisType(G),position:this.isHorizontal()?"left":"bottom"},y:{type:"number",position:this.isHorizontal()?"bottom":"left"}};if(this.isNormalised())D.y.label={...D.y.label,formatter:(z)=>Math.round(z.value)+"%"};return D}getSeries(G){let[D]=G.categories,z=G.fields.map((B)=>({type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||sP(this.chartType),normalizedTo:this.isNormalised()?100:void 0,xKey:D.id,xName:D.name,yKey:B.colId,yName:B.displayName}));return this.crossFiltering?this.extractCrossFilterSeries(z):z}extractCrossFilterSeries(G){let D=[];for(let z=0;zMath.round(z.value)+"%"};return D}getSeries(G){let[D]=G.categories,z=["normalizedLine","stackedLine"].includes(this.chartType),B=G.fields.map((Q)=>({type:this.standaloneChartType,xKey:D.id,xName:D.name,yKey:Q.colId,yName:Q.displayName,normalizedTo:z&&this.isNormalised()?100:void 0,stacked:z}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(B,G):B}isNormalised(){let G=["normalizedLine"];return!this.crossFiltering&&G.includes(this.chartType)}},$y=class extends HD{getAxes(G){return{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}}}getSeries(G){let[D]=G.categories,z=this.isPaired(),B=this.getSeriesDefinitions(G.fields,z),Q=D.id===gG?void 0:D,J=B.map((U)=>{if(U?.sizeField)return{type:"bubble",xKey:U.xField.colId,xName:U.xField.displayName??void 0,yKey:U.yField.colId,yName:U.yField.displayName??void 0,title:`${U.yField.displayName} vs ${U.xField.displayName}`,sizeKey:U.sizeField.colId,sizeName:U.sizeField.displayName??"",labelKey:Q?Q.id:U.yField.colId,labelName:Q?Q.name:void 0};return{type:"scatter",xKey:U.xField.colId,xName:U.xField.displayName??void 0,yKey:U.yField.colId,yName:U.yField.displayName??void 0,title:`${U.yField.displayName} vs ${U.xField.displayName}`,labelKey:Q?Q.id:U.yField.colId,labelName:Q?Q.name:void 0}});return this.crossFiltering?this.extractCrossFilterSeries(J,G):J}extractCrossFilterSeries(G,D){let{data:z}=D,B=(S)=>`${S}-filtered-out`,Q=(S,X)=>{let Y=[1/0,-1/0];if(X!=null)for(let W of S){let q=W[X]??W[B(X)];if(qY[1])Y[1]=q}if(Y[0]<=Y[1])return Y;return},J=(S)=>{let X=void 0;if(S.type==="bubble"){let{sizeKey:Y}=S;X=Q(z,Y)}return{...S,domain:X,highlight:{highlightedItem:{fill:"yellow"}},listeners:{...S.listeners,seriesNodeClick:this.crossFilterCallback}}},U=(S)=>{let{yKey:X,xKey:Y}=S,W={};if(S.type==="bubble")W={sizeKey:B(S.sizeKey)};return{...S,...W,yKey:B(X),xKey:B(Y),showInLegend:!1,listeners:{...S.listeners,seriesNodeClick:(q)=>{let H=q.datum[B(Y)],_={...q,xKey:Y,datum:{...q.datum,[Y]:H}};this.crossFilterCallback(_)}}}},Z=G.map(J);return[...Z,...Z.map(U)]}getSeriesDefinitions(G,D){if(G.length<2)return[];let z=this.chartType==="bubble";if(D){if(z)return G.map((Q,J)=>J%3===0?{xField:Q,yField:G[J+1],sizeField:G[J+2]}:null).filter((Q)=>Q?.yField&&Q.sizeField);return G.map((Q,J)=>J%2===0?{xField:Q,yField:G[J+1]}:null).filter((Q)=>Q?.yField)}let B=G[0];if(z)return G.map((Q,J)=>J%2===1?{xField:B,yField:Q,sizeField:G[J+1]}:null).filter((Q)=>Q?.sizeField);return G.filter((Q,J)=>J>0).map((Q)=>({xField:B,yField:Q}))}},Ly=class extends HD{getAxes(G){let D=G?G.fields:[],z=new Map(D.map((U)=>[U.colId,U])),{primaryYKeys:B,secondaryYKeys:Q}=this.getYKeys(D,G.seriesChartTypes),J={x:{type:this.getXAxisType(G),position:"bottom"}};if(B.length>0)J.y={type:"number",position:"left"};if(Q.length>0)Q.forEach((U)=>{let Z=z.get(U);if(!(Z&&Z.colId===U))return;let X={type:"number",position:"right"};J[`y_${U}`]=X});return J}getSeries(G){let{fields:D,seriesChartTypes:z}=G,[B]=G.categories;return D.map((Q)=>{let J=z.find((U)=>U.colId===Q.colId);if(J){let U=J.chartType,S=["groupedColumn","groupedBar"].includes(U)?{grouped:!0}:{},X=J.secondaryAxis?`y_${Q.colId}`:"y";return{type:l(U),xKey:B.id,yKey:Q.colId,yName:Q.displayName,yKeyAxis:X,stacked:["stackedArea","stackedColumn"].includes(U),...S}}})}getYKeys(G,D){let z=[],B=[];for(let Q of G){let J=Q.colId,U=D.find((Z)=>Z.colId===J);if(U)if(U.secondaryAxis)B.push(J);else z.push(J)}return{primaryYKeys:z,secondaryYKeys:B}}setSeriesChartThemeDefaults(G){let D=this.getSeriesChartThemeDefaults();if(!D)return;let z=new Set;for(let B of this.chartProxyParams.seriesChartTypes)z.add(B.chartType);for(let B of z)G[l(B)]=D}};function Sy(G){let D=G.currentOffset;G.currentOffset-=G.offsetAmount;let z=G.currentOffset;return G.currentOffset-=G.offsetAmount,{outerRadiusOffset:D,innerRadiusOffset:z}}var Xy=class extends qz{getUpdateOptions(G,D){return{...D,data:this.crossFiltering?this.getCrossFilterData(G):G.data,series:this.getSeries(G)}}getSeries(G){let[D]=G.categories,z=G.fields.length,B={currentOffset:0,offsetAmount:z>1?20:40},Q=this.getFields(G).map((J)=>{let U={type:this.standaloneChartType,angleKey:J.colId,angleName:J.displayName,sectorLabelKey:J.colId,calloutLabelName:D.name,calloutLabelKey:D.id};if(this.chartType==="donut"||this.chartType==="doughnut"){let{outerRadiusOffset:Z,innerRadiusOffset:S}=Sy(B),X=J.displayName?{title:{text:J.displayName,showInLegend:z>1}}:void 0;return{...U,type:"donut",outerRadiusOffset:Z,innerRadiusOffset:S,...X}}return U});return this.crossFiltering?this.extractCrossFilterSeries(Q):Q}getCrossFilterData(G){let D=G.fields[0].colId,z=`${D}-filtered-out`;return G.data.map((B)=>{let Q=B[D]+B[z];return B[`${D}-total`]=Q,B[z]=1,B[D]=B[D]/Q,B})}extractCrossFilterSeries(G){let D=G[0],z=D.angleKey,B={...D,radiusMin:0,radiusMax:1,listeners:{seriesNodeClick:this.crossFilterCallback},legendItemKey:D.calloutLabelKey,angleKey:`${z}-total`},Q={...B,radiusKey:z,sectorLabelKey:`${z}-total`};return[{...B,radiusKey:`${z}-filtered-out`,showInLegend:!1},Q]}getFields(G){return this.chartType==="pie"?G.fields.slice(0,1):G.fields}getSeriesChartThemeDefaults(){return{series:{highlight:nJ(this.crossFiltering)}}}},fy=class extends Hy{constructor(){super('
');this.eMenu=_y,this.buttonListenersDestroyFuncs=[]}wireBeans(G){this.chartTranslation=G.chartTranslation}updateParams(G){let{buttons:D}=G;this.createButtons(D)}createButtons(G){for(let z of this.buttonListenersDestroyFuncs)z?.();this.buttonListenersDestroyFuncs=[];let D=this.eMenu;ky(D);for(let z of G){let{buttonName:B,iconName:Q,callback:J}=z,U=this.createButton(Q),Z=this.chartTranslation.translate(B+"ToolbarTooltip");if(Z&&U instanceof HTMLElement)U.title=Z;this.buttonListenersDestroyFuncs.push(...this.addManagedElementListeners(U,{click:(S)=>J(S.currentTarget)})),D.appendChild(U)}}createButton(G){let D=Ky(G,this.beans);D.classList.add("ag-chart-menu-icon");let z=wy({tag:"button",attrs:{type:"button"},cls:"ag-chart-menu-toolbar-button"});return z.appendChild(D),z}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}},Ty=".ag-pill-select{display:flex;flex-direction:column}.ag-pill-select .ag-column-drop-list{padding:0}:where(.ag-pill-select){.ag-select{padding-top:var(--ag-spacing)}.ag-picker-field-wrapper{background-color:transparent;border:0}.ag-picker-field-display{cursor:pointer;font-weight:500}.ag-picker-field-display,.ag-picker-field-icon{color:var(--ag-chart-menu-label-color)}}",yy=class extends uy{constructor(G){super('');this.config=G??{};let{selectedValueList:D,valueFormatter:z,valueList:B}=this.config;this.selectedValues=D??[],this.valueList=B??[],this.valueFormatter=z??((Q)=>jy(Q)),this.registerCSS(Ty)}postConstruct(){let{ariaLabel:G,onValuesChange:D,dragSourceId:z}=this.config;if(this.dropZonePanel=this.createManagedBean(new cy({getValues:()=>this.selectedValues,setValues:(Q)=>this.updateValues(Q),isDraggable:()=>this.selectedValues.length>1},(Q)=>this.valueFormatter(Q),G,z)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),D!=null)this.onValuesChange=D}setValues(G,D){let{added:z,removed:B,updated:Q}=this.getChanges(this.valueList,G),J=!1;if(z.length||B.length||Q.length)J=!0;return this.valueList=G,this.updateValues(D,J,!0),this}setValueFormatter(G){return this.valueFormatter=G,this}initSelect(){let G=this.createSelectOptions();if(!G.length)return!1;let{selectPlaceholder:D}=this.config;return this.eSelect=this.createBean(new Oy({options:G,placeholder:D,onValueChange:(z)=>this.addValue(z),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){let G=[],{maxSelection:D}=this.config;if(D&&this.selectedValues.length>=D)return G;for(let z of this.valueList)if(!this.selectedValues.includes(z))G.push({value:z,text:this.valueFormatter(z)});return G}addValue(G){this.dropZonePanel.addItem(G)}updateValues(G,D,z){let B=this.selectedValues;this.selectedValues=G;let Q=this.getChanges(B,G),J=D||Q.added.length||Q.removed.length,U=Py(this.beans),Z=this.eSelect?.getGui().contains(U),S=this.dropZonePanel?.getGui().contains(U);if(!z)this.onValuesChange?.(Q);let X=J?!this.refreshSelect():!1;if(this.dropZonePanel.refreshGui(),J&&Z)if(X)this.dropZonePanel.focusList(!0);else this.eSelect?.getFocusableElement().focus();if(S&&!G.length)this.eSelect?.getFocusableElement().focus()}getChanges(G,D){let z=D.filter((J)=>!G.includes(J)),B=G.filter((J)=>!D.includes(J)),Q=D.filter((J,U)=>G[U]!==J);return{added:z,removed:B,updated:Q,selected:D}}refreshSelect(){if(!this.eSelect)return this.initSelect();let G=this.createSelectOptions();if(!G.length)return gy(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1;return this.eSelect.clearOptions().addOptions(G).setValue(void 0,!0),!0}destroy(){this.destroyBean(this.eSelect),super.destroy()}},xy=class extends H7{constructor(G,D,z,B,Q,J){super(D,z,!1);this.value=G,this.valueFormatter=B,this.draggable=Q,this.sourceId=J}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){return}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return $9.ChartPanel}getDragSourceId(){return this.sourceId}isMovable(){return this.isDraggable()}isDraggable(){return this.draggable}},cy=class extends q7{constructor(G,D,z,B){super(!1);this.model=G,this.valueFormatter=D,this.ariaLabel=z,this.sourceId=B}postConstruct(){super.init()}isItemDroppable(G,D){return this.isSourceEventFromTarget(D)||this.sourceId!=null&&this.sourceId===D.dragSource.sourceId}updateItems(G){this.model.setValues(G)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?"move":"notAllowed"}getAriaLabel(){return this.ariaLabel}createPillComponent(G,D,z){return new xy(G,D,z,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(G){return[G.value]}isInterestedIn(G){return G===$9.ChartPanel}},L9=class extends vy{constructor(G,D,z,B){super(B);this.chartController=G,this.allowMultipleSelection=D,this.maxSelection=z}wireBeans(G){this.chartTranslation=G.chartTranslation}addItem(G){this.groupComp.addItem(G)}createGroup(G,D,z,B,Q){if(this.allowMultipleSelection){let J=G.filter((U)=>U.selected);this.valuePillSelect=this.groupComp.createManagedBean(new yy({valueList:G,selectedValueList:J,valueFormatter:D,selectPlaceholder:this.chartTranslation.translate(z),dragSourceId:B,onValuesChange:(U)=>this.onValueChange(U),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{let J=this.createValueSelectParams(G);J.onValueChange=(U)=>{for(let Z of G)Z.selected=!1;if(U.selected=!0,U.colId===gG)this.chartController.setAggFunc(void 0,!0);this.chartController.updateForPanelChange({updatedColState:U,skipAnimation:Q?.()})},this.valueSelect=this.groupComp.createManagedBean(new by(J)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(G){if(!this.valueSelect)return;let{options:D,value:z}=this.createValueSelectParams(G);this.valueSelect.clearOptions().addOptions(D).setValue(z,!0)}createValueSelectParams(G){let D;return{options:G.map((B)=>{let Q=B.displayName??"";if(B.selected)D=B;return{value:B,text:Q}}),value:D}}onValueChange({added:G,updated:D,removed:z,selected:B}){let Q,J,U=()=>{B.forEach((Z,S)=>{Z.order=S}),J=!0};if(G.length)Q=G[0],Q.selected=!0,U();else if(z.length)Q=z[0],Q.selected=!1;else if(D.length)U(),Q=D[0];if(Q)this.chartController.updateForPanelChange({updatedColState:Q,resetOrder:J})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}},hy="sum",iy=class extends L9{constructor(G,D,z,B,Q){super(G,z,void 0,'
');this.title=D,this.dimensionCols=B,this.isOpen=Q}postConstruct(){this.groupComp=this.createBean(new jG({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.createGroup(this.dimensionCols,(G)=>G.displayName??"","categoryAdd","categorySelect",()=>!this.chartController.getAggFunc()),this.createAggFuncControls(this.dimensionCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(G){this.valuePillSelect?.setValues(G,G.filter((D)=>D.selected)),this.refreshValueSelect(G),this.refreshAggFuncControls(G,this.chartController.getAggFunc())}createAggFuncControls(G){let D=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new Vy({label:this.chartTranslation.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:D!=null,onValueChange:(z)=>{let B=z?hy:void 0;this.chartController.setAggFunc(B),this.aggFuncSelect?.setValue(B,!0),this.aggFuncSelect?.setDisplayed(B!=null)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new Cy({options:[{value:"sum",text:this.chartTranslation.translate("sum")},{value:"first",text:this.chartTranslation.translate("first")},{value:"last",text:this.chartTranslation.translate("last")},{value:"min",text:this.chartTranslation.translate("min")},{value:"max",text:this.chartTranslation.translate("max")},{value:"count",text:this.chartTranslation.translate("count")},{value:"avg",text:this.chartTranslation.translate("avg")}],value:typeof D==="string"?D:void 0,onValueChange:(z)=>{this.chartController.setAggFunc(z)}}))),this.refreshAggFuncControls(G,D)}refreshAggFuncControls(G,D){let B=G.filter((Q)=>Q.selected).some((Q)=>Q.colId!==gG);this.aggFuncToggle?.setValue(D!=null),this.aggFuncSelect?.setValue(typeof D==="string"?D:void 0,!0),this.aggFuncToggle?.setDisplayed(B),this.aggFuncSelect?.setDisplayed(B&&D!=null)}clearAggFuncControls(){this.aggFuncToggle=this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},uD=class extends py{constructor(G){super();this.chartOptionsProxy=G}wireBeans(G){this.chartTranslation=G.chartTranslation}getDefaultColorPickerParams(G,D,z){return this.addValueParams(G,{label:this.chartTranslation.translate(D??"color"),labelWidth:"flex",inputWidth:"flex",labelAlignment:"top",pickerGap:6},z)}getDefaultNumberInputParams(G,D,z){return this.addValueParams(G,{label:this.chartTranslation.translate(D),labelAlignment:"top",labelWidth:"flex",inputWidth:"flex",precision:z?.precision,step:z?.step,min:z?.min,max:z?.max},{parseInputValue:(B)=>{let Q=Number(B);return isNaN(Q)?void 0:Q},formatInputValue:(B)=>{return B==null?"":`${B}`}})}getDefaultSliderParams(G,D,z,B){let Q=this.chartOptionsProxy.getValue(G)??0;if(B&&Array.isArray(Q))Q=Q[0];let J=this.getDefaultSliderParamsWithoutValueParams(Q,D,z);return J.onValueChange=(U)=>this.chartOptionsProxy.setValue(G,B?[U]:U),J}getDefaultSliderParamsWithoutValueParams(G,D,z){return{label:this.chartTranslation.translate(D),minValue:0,maxValue:Math.max(G,z),textFieldWidth:45,value:`${G}`}}getDefaultCheckboxParams(G,D,z){let B=this.chartOptionsProxy.getValue(G),Q={label:this.chartTranslation.translate(D),value:B,readOnly:z?.readOnly,passive:z?.passive};return Q.onValueChange=(J)=>{this.chartOptionsProxy.setValue(G,typeof J==="boolean"?J:void 0)},Q}getDefaultToggleParams(G,D,z){let B=this.chartOptionsProxy.getValue(G),Q={label:this.chartTranslation.translate(D),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:B,readOnly:z?.readOnly,passive:z?.passive};return Q.onValueChange=(J)=>{this.chartOptionsProxy.setValue(G,typeof J==="boolean"?J:void 0)},Q}getDefaultSelectParams(G,D,z){return this.getDefaultSelectParamsWithoutValueParams(D,z,this.chartOptionsProxy.getValue(G),(B)=>{this.chartOptionsProxy.setValue(G,B)})}getDefaultSelectParamsWithoutValueParams(G,D,z,B){return{label:this.chartTranslation.translate(G),labelAlignment:"top",options:D,pickerGap:6,value:z,onValueChange:B}}getDefaultFontPanelParams(G,D){let z=(B)=>`${G}.${B}`;return this.addEnableParams(z("enabled"),{name:this.chartTranslation.translate(D),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this,keyMapper:z})}addValueParams(G,D,z){let B=this.chartOptionsProxy.getValue(G);return D.value=z?.formatInputValue?z.formatInputValue(B):B,D.onValueChange=(Q)=>{let J=z?.parseInputValue?z.parseInputValue(Q):Q;this.chartOptionsProxy.setValue(G,J)},D}addEnableParams(G,D){return D.enabled=this.chartOptionsProxy.getValue(G)??!1,D.onEnableChange=(z)=>this.chartOptionsProxy.setValue(G,z),D}getChartOptions(){return this.chartOptionsProxy}},my=class extends dy{constructor(G,D){super();this.chartMenuContext=G,this.isOpen=D,this.chartSpecificGroup=ly,this.hasContent=!1}wireBeans(G){this.chartTranslation=G.chartTranslation,this.chartSvc=G.chartSvc}postConstruct(){let D={title:this.getTitle(),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen,items:[...this.createDirectionSelect(),this.createReverseSelect(),this.createGroupTypeSelect()]};this.setTemplate(` +
+ +
`,[p],{chartSpecificGroup:D}),this.setDisplayed(this.hasContent)}refresh(){this.hasContent=!1,this.chartSpecificGroup.setTitle(this.getTitle()),this.updateDirectionSelect(),this.updateReverseSelect(),this.updateGroupTypeSelect(),this.setDisplayed(this.hasContent)}getTitle(){let G=this.chartMenuContext.chartController.getChartType();return this.chartTranslation.translate(hJ(G))}createDirectionSelect(){if(!this.chartSvc.isEnterprise())return[];let{chartOptionsService:G,chartController:D}=this.chartMenuContext,z=G.getSeriesOptionsProxy(()=>l(D.getChartType())),B=this.createManagedBean(new uD(z)),Q=["horizontal","vertical"].map((Z)=>({value:Z,text:this.chartTranslation.translate(Z)})),J=B.getDefaultSelectParams("direction","direction",Q),U=J.onValueChange;return J.onValueChange=(Z)=>{U(Z),D.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new l5(J)),this.updateDirectionSelect(),[this.directionSelect]}createReverseSelect(){let{chartMenuParamsFactory:G}=this.chartMenuContext,D=G.getDefaultToggleParams("series.reverse","reverse");return this.reverseToggle=this.createManagedBean(new ny(D)),this.updateReverseSelect(),this.reverseToggle}updateReverseSelect(){let G=this.chartMenuContext.chartController.getChartType()==="pyramid";this.updateDisplayed(this.reverseToggle,G)}updateDirectionSelect(){let G=eP(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.directionSelect,G)}createGroupTypeSelect(){let{chartController:G,chartMenuParamsFactory:D}=this.chartMenuContext;return this.groupTypeSelect=this.createManagedBean(new l5(D.getDefaultSelectParamsWithoutValueParams("seriesGroupType",lP.map((z)=>({value:z,text:this.chartTranslation.translate(`${z}SeriesGroupType`)})),G.getSeriesGroupType(),(z)=>G.setSeriesGroupType(z)))),this.updateGroupTypeSelect(),this.groupTypeSelect}updateGroupTypeSelect(){let G=["radialColumn","radialBar","nightingale"].includes(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.groupTypeSelect,G)}updateDisplayed(G,D){if(G?.setDisplayed(D),G)this.hasContent=this.hasContent||D}},ey=class extends oy{constructor(G,D,z){super('
');this.chartController=G,this.columns=D,this.isOpen=z,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){this.createSeriesChartTypeGroup(this.columns)}refresh(G){if(!ry(this.getValidColIds(G),this.selectedColIds))this.recreate(G);else this.refreshComps()}recreate(G){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),ay(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=G,this.selectedColIds=[],this.clearComps(),this.postConstruct()}getValidColIds(G){let D=this.chartController.getSeriesChartTypes();return G.filter((z)=>z.selected&&!!D.filter((B)=>B.colId===z.colId)[0]).map(({colId:z})=>z)}createSeriesChartTypeGroup(G){this.seriesChartTypeGroupComp=this.createBean(new jG({title:this.chartTranslation.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));let D=this.chartController.getSeriesChartTypes();for(let z of G){if(!z.selected)continue;let B=D.filter((X)=>X.colId===z.colId)[0];if(!B)continue;this.selectedColIds.push(z.colId);let Q=this.seriesChartTypeGroupComp.createManagedBean(new jG({title:z.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),J=(X)=>["groupedColumn","stackedColumn","stackedArea"].includes(X),U=this.seriesChartTypeGroupComp.createManagedBean(new ty({label:this.chartTranslation.translate("secondaryAxis"),labelWidth:"flex",disabled:J(B.chartType),value:!!B.secondaryAxis,onValueChange:(X)=>this.chartController.updateSeriesChartType(z.colId,void 0,X)}));Q.addItem(U);let Z=["line","area","stackedArea","groupedColumn","stackedColumn"].map((X)=>({value:X,text:this.chartTranslation.translate(hJ(X))})),S=Q.createManagedBean(new sy({options:Z,value:B.chartType,onValueChange:(X)=>this.chartController.updateSeriesChartType(z.colId,X)}));Q.addItem(S),this.seriesChartTypeGroupComp.addItem(Q),this.chartTypeComps.set(z.colId,S),this.secondaryAxisComps.set(z.colId,U)}this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){let G=this.chartController.getSeriesChartTypes();for(let D of this.selectedColIds){let z=G.find((J)=>J.colId===D);if(!z)continue;let B=this.chartTypeComps.get(D),Q=this.secondaryAxisComps.get(D);B?.setValue(z.chartType),Q?.setValue(!!z.secondaryAxis),Q?.setDisabled(this.isSecondaryAxisDisabled(z.chartType))}}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(G){return["groupedColumn","stackedColumn","stackedArea"].includes(G)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}},Dx=class extends L9{constructor(G,D,z,B,Q,J,U){super(G,B,Q,'
');this.chartOptionsService=D,this.title=z,this.valueCols=J,this.isOpen=U}postConstruct(){if(this.groupComp=this.createBean(new jG({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){let G=this.groupComp.createManagedBean(new Gx({label:this.chartTranslation.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:(D)=>{this.chartOptionsService.setPairedMode(!!D),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(G)}this.createGroup(this.valueCols,this.generateGetSeriesLabel(this.valueCols),"seriesAdd","seriesSelect"),this.getGui().appendChild(this.groupComp.getGui())}refresh(G){this.valuePillSelect?.setValueFormatter(this.generateGetSeriesLabel(G)),this.valuePillSelect?.setValues(G,G.filter((D)=>D.selected)),this.refreshValueSelect(G)}generateGetSeriesLabel(G){if(!this.chartController.isActiveXYChart())return(J)=>J.displayName??"";let D=G.filter((J)=>J.selected),z=this.chartController.getChartType()==="bubble",B=this.chartOptionsService.getPairedMode(),Q=new Map;return Q.set(0,"X"),Q.set(1,"Y"),Q.set(2,"size"),(J)=>{let U=J.displayName??"";if(!J.selected)return U;let Z=D.indexOf(J);if(Z===-1)return U;let S;if(B)S=Q.get(Z%(z?3:2));else if(Z===0)S="X";else S=z&&Z%2===0?"size":"Y";return`${U} (${S})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},zx={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0},{type:"chartSpecific",isOpen:!0}]},Bx=class extends Iy{constructor(G){super('
');this.chartMenuContext=G,this.isSwitchCategorySeriesToggled=!1,this.restoreSwitchCategorySeriesToggleFocus=!1,this.panels=[],this.chartController=G.chartController}wireBeans(G){this.chartTranslation=G.chartTranslation,this.chartSvc=G.chartSvc}postConstruct(){this.createSwitchCategorySeriesToggle(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.updatePanels();let G=this.updatePanels.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:G,chartApiUpdate:G})}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){let G=this.chartType,D=this.isSwitchCategorySeriesToggled,{dimensionCols:z,valueCols:B}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();let Q=this.isSwitchCategorySeriesToggled!==D;if(this.canRefresh(G,this.chartType)&&!Q)this.categoriesDataPanel?.refresh(z),this.seriesDataPanel?.refresh(B),this.seriesChartTypePanel?.refresh(B),this.chartSpecificPanel?.refresh();else this.recreatePanels(z,B);let J=s8(this.chartType)&&this.chartSvc.isEnterprise()&&!this.chartController.isGrouping();if(Ay(this.switchCategorySeriesToggle.getGui(),J),Q)this.switchCategorySeriesToggle?.setValue(this.chartController.isCategorySeriesSwitched());if(this.restoreSwitchCategorySeriesToggleFocus){if(this.restoreSwitchCategorySeriesToggleFocus=!1,J)this.switchCategorySeriesToggle.getFocusableElement().focus()}}canRefresh(G,D){if(G===void 0)return!1;if(G===D)return!0;let z=(B)=>["columnLineCombo","areaColumnCombo","customCombo"].includes(B);if(z(G)&&z(D))return!0;return!1}recreatePanels(G,D){this.clearPanelComponents();let{chartType:z}=this;if(!z)return;let B=this.chartController.isCategorySeriesSwitched();this.getDataPanelDef().groups?.forEach(({type:Q,isOpen:J})=>{if(Q===(B?"series":"categories"))this.categoriesDataPanel=this.createBean(new iy(this.chartController,this.getCategoryGroupTitle(B),this.getCategoryGroupMultipleSelect(z,B),G,J)),this.panels.push(this.categoriesDataPanel);else if(Q===(B?"categories":"series"))this.seriesDataPanel=this.createBean(new Dx(this.chartController,this.chartMenuContext.chartOptionsService,this.getSeriesGroupTitle(B),this.getSeriesGroupMultipleSelect(z,B),this.getSeriesGroupMaxSelection(z,B),D,J)),this.panels.push(this.seriesDataPanel);else if(Q==="seriesChartType"){if(this.chartController.isComboChart())this.seriesChartTypePanel=this.createBean(new ey(this.chartController,D,J)),this.panels.push(this.seriesChartTypePanel)}else if(Q==="chartSpecific")this.chartSpecificPanel=this.createBean(new my(this.chartMenuContext,J)),this.panels.push(this.chartSpecificPanel);else Ry(144,{type:Q})}),(B?this.categoriesDataPanel:this.seriesDataPanel)?.addItem(this.switchCategorySeriesToggle.getGui()),this.addPanelComponents()}addPanelComponents(){if(!this.panels.length)return;let D=My(this.beans).createDocumentFragment();for(let z of this.panels)z.addCss("ag-chart-data-section"),D.appendChild(z.getGui());this.getGui().appendChild(D)}clearPanelComponents(){for(let G of this.panels)G.getGui().remove(),this.destroyBean(G);this.panels=[]}getDataPanelDef(){return this.gos.get("chartToolPanelsDef")?.dataPanel??zx}getCategoryGroupTitle(G){if(G)return this.chartTranslation.translate("seriesLabels");return this.chartTranslation.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(G,D){if(D)return!1;return QJ(G)!==1}getSeriesGroupTitle(G){if(G)return this.chartTranslation.translate("categoryValues");return this.chartTranslation.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(G,D){return this.getSeriesGroupMaxSelection(G,D)!==1}getSeriesGroupMaxSelection(G,D){if(D)return;return bB(G)}createSwitchCategorySeriesToggle(){this.switchCategorySeriesToggle=this.createManagedBean(new Ey({label:this.chartTranslation.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartController.isCategorySeriesSwitched(),onValueChange:(G)=>{this.restoreSwitchCategorySeriesToggleFocus=!0,this.chartController.switchCategorySeries(G)}}))}},qx=class extends Lx{constructor(G){super(G,`
+
+
+
+
+
+
+
+ +
+
`,[Sx]);this.eLabel=QB,this.eParentCircle=QB,this.eChildCircle=QB,this.eAngleValue=QB,this.radius=0,this.offsetX=0,this.offsetY=0}wireBeans(G){this.dragSvc=G.dragSvc}postConstruct(){super.postConstruct();let{value:G,onValueChange:D}=this.config;if(G!=null)this.setValue(G,void 0,!0);if(D!=null)this.onValueChange(D);if(this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:()=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:(z)=>this.calculateAngleDrag(z),onDragStop:()=>{}},this.dragSvc?.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange((z)=>{if(z==null||z==="")z="0";z=this.eAngleValue.normalizeValue(z);let B=parseFloat(z);if(B>180)B=B-360;this.setValue(B)}),this.updateNumberInput(),Xx(this.getValue()))this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString());this.addManagedListeners(this,{fieldValueChanged:()=>{if(this.eAngleValue.getInputElement().contains(Yx(this.beans)))return;this.updateNumberInput()}})}updateNumberInput(){let G=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(G.toString())}positionChildCircle(G){let D=this.parentCircleRect||{width:24,height:24},z=this.eChildCircle,B=D.width/2,Q=D.height/2;z.style.left=`${B+Math.cos(G)*8}px`,z.style.top=`${Q+Math.sin(G)*8}px`}calculatePolar(){let G=this.offsetX,D=this.offsetY,z=Math.atan2(D,G);this.degrees=this.toDegrees(z),this.radius=Math.sqrt(G*G+D*D),this.positionChildCircle(z)}calculateCartesian(){let G=this.toRadians(this.getValue()),D=this.getRadius();this.setOffsetX(Math.cos(G)*D).setOffsetY(Math.sin(G)*D)}setOffsetX(G){if(this.offsetX!==G)this.offsetX=G,this.calculatePolar();return this}setOffsetY(G){if(this.offsetY!==G)this.offsetY=G,this.calculatePolar();return this}calculateAngleDrag(G){let D=this.parentCircleRect,z=D.width/2,B=D.height/2,Q=G.clientX-D.left,J=G.clientY-D.top,U=Q-z,Z=J-B,S=Math.atan2(Z,U);this.setValue(S,!0)}toDegrees(G){return G/Math.PI*180}toRadians(G){return G/180*Math.PI}normalizeNegativeValue(G){return G<0?360+G:G}normalizeAngle180(G){if(G%=Math.PI*2,G<-Math.PI)G+=Math.PI*2;else if(G>=Math.PI)G-=Math.PI*2;return G}getRadius(){return this.radius}setRadius(G){if(this.radius===G)return this;return this.radius=G,this.calculateCartesian(),this}onValueChange(G){return this.addManagedListeners(this,{fieldValueChanged:()=>{G(this.degrees)}}),this}getValue(G){return G?this.toRadians(this.degrees):this.degrees}setValue(G,D,z){let B;if(!D)B=this.normalizeAngle180(this.toRadians(G));else B=G;if(G=this.toDegrees(B),this.degrees!==G){if(this.degrees=Math.floor(G),this.calculateCartesian(),this.positionChildCircle(B),!z)this.dispatchLocalEvent({type:"fieldValueChanged"})}return this}setWidth(G){return Wx(this.getGui(),G),this}setDisabled(G){return super.setDisabled(G),this.eAngleValue.setDisabled(G),this}destroy(){this.dragSvc?.removeDragSource(this.dragListener),super.destroy()}};function Kx(G){return G[0].toUpperCase()+G.substring(1).toLowerCase()}var YD=class extends _x{constructor(G){super();this.params=G,this.fontGroup=kx,this.activeComps=[],this.chartOptions=G.chartMenuParamsFactory.getChartOptions()}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{cssIdentifier:G="charts-format-sub-level",name:D,enabled:z,onEnableChange:B,suppressEnabledCheckbox:Q,chartMenuParamsFactory:J,keyMapper:U}=this.params,Z={cssIdentifier:G,direction:"vertical",suppressOpenCloseIcons:!0,title:D,enabled:z,suppressEnabledCheckbox:!0,onEnableChange:(S)=>{if(B)B(S)},useToggle:!Q};this.setTemplate(`
+ + + +
+ + +
+
+
`,[p,Hx,TG],{fontGroup:Z,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:J.getDefaultColorPickerParams(U("color"))}),this.toggleCss("ag-font-panel-no-header",!D)}addItem(G,D){if(D)this.fontGroup.prependItem(G);else this.fontGroup.addItem(G);this.activeComps.push(G)}setEnabled(G){this.fontGroup.setEnabled(G)}getFamilySelectParams(){let G=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua, serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode, sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],D=this.getInitialFontValue("fontFamily"),z=G[0];if(D){let J=G.map((U)=>U.toLowerCase()).indexOf(D.toLowerCase());if(J>=0)z=G[J];else{let U=Kx(D);G.push(U),z=U}}let B=G.sort().map((Q)=>({value:Q,text:Q}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("font",B,`${z}`,(Q)=>this.setFont({fontFamily:Q}))}getSizeSelectParams(){let G=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],D=this.getInitialFontValue("fontSize");if(!G.includes(D))G.push(D);let z=G.sort((B,Q)=>B-Q).map((B)=>({value:`${B}`,text:`${B}`}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("size",z,`${D}`,(B)=>this.setFont({fontSize:parseInt(B,10)}))}getWeightStyleSelectParams(){let G=this.getInitialFontValue("fontWeight")??"normal",D=this.getInitialFontValue("fontStyle")??"normal",z=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}],B=z.find((J)=>J.weight===G&&J.style===D);if(!B)B={name:"predefined",weight:G,style:D},z.unshift(B);let Q=z.map((J)=>({value:J.name,text:this.chartTranslation.translate(J.name)}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("weight",Q,B.name,(J)=>{let U=z.find((Z)=>Z.name===J);this.setFont({fontWeight:U.weight,fontStyle:U.style})})}destroyActiveComps(){for(let G of this.activeComps)wx(G.getGui()),this.destroyBean(G)}destroy(){this.destroyActiveComps(),super.destroy()}setFont(G){let{keyMapper:D}=this.params;for(let z of Object.keys(G)){let B=G[z];if(B)this.chartOptions.setValue(D(z),B)}}getInitialFontValue(G){let{keyMapper:D}=this.params;return this.chartOptions.getValue(D(G))}},Fx=class extends fx{constructor(G){super();this.chartMenuUtils=G,this.axisTicksSizeSlider=Nx}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{chartMenuUtils:G}=this,D=G.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("ticks"),suppressEnabledCheckbox:!0,useToggle:!0}),z=G.getDefaultColorPickerParams("tick.stroke"),B=G.getDefaultSliderParams("tick.width","width",10),Q=G.getDefaultSliderParams("tick.size","length",30);this.setTemplate(`
+ + + + + +
`,[p,TG,WG],{axisTicksGroup:D,axisTicksColorPicker:z,axisTicksWidthSlider:B,axisTicksSizeSlider:Q})}setTickSizeSliderDisplayed(G){this.axisTicksSizeSlider.setDisplayed(G)}},Ix=class extends Ex{constructor(G){super();this.chartMenuUtils=G,this.chartOptions=G.getChartOptions()}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("gridLines"),suppressEnabledCheckbox:!0,useToggle:!0}),D=this.getGridLineColorPickerParams("color"),z=this.getGridLineWidthSliderParams("thickness"),B=this.getGridLineDashSliderParams("lineDash");this.setTemplate(`
+ + + + + +
`,[p,TG,WG],{gridLineGroup:G,gridLineColorPicker:D,gridLineWidthSlider:z,gridLineLineDashSlider:B})}getGridLineColorPickerParams(G){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",G,{formatInputValue:(D)=>{return D?.[0]?.stroke},parseInputValue:(D)=>{let z=this.chartOptions.getValue("gridLine.style")??[];if(z.length===0)return[{stroke:D,lineDash:[]}];return[{...z[0],stroke:D}]}})}getGridLineWidthSliderParams(G){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",G,10)}getGridLineDashSliderParams(G){let z=this.chartOptions.getValue("gridLine.style")?.[0]?.lineDash?.[0],B=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(z??0,G,30);return B.onValueChange=(Q)=>{let J=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[Q],stroke:J}])},B}},Mx="%d %B %Y",JB=class extends Zx{constructor(G,D){super();this.axisType=G,this.options=D,this.axisGroup=BB,this.axisTypeSelect=BB,this.axisPositionSelect=BB,this.axisTimeFormatSelect=BB,this.activePanels=[],this.updateFuncs=[];let{chartOptionsService:z,seriesType:B,chartController:Q}=D;this.chartOptionsService=z,this.chartController=Q,this.chartOptionsSeriesProxy=z.getSeriesOptionsProxy(()=>B)}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{isExpandedOnInit:G,chartOptionsService:D,registerGroupComponent:z}=this.options,B=this.axisType,Q={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(B),expanded:G,suppressEnabledCheckbox:!0},J=D.getCartesianAxisOptionsProxy(this.axisType),U=this.createManagedBean(new uD(J)),Z=this.createManagedBean(new uD(D.getCartesianAxisThemeOverridesProxy(this.axisType))),S=this.getAxisTypeSelectParams(U,D.getCartesianAxisAppliedThemeOverridesProxy(this.axisType)),X=this.getAxisPositionSelectParams(U),Y=this.getAxisTimeFormatSelectParams(U),W=this.getAxisColorInputParams(Z),q=this.getAxisLineWidthSliderParams(Z);if(this.setTemplate(`
+ + + + + + + +
`,[p,Ux,TG,WG],{axisGroup:Q,axisTypeSelect:S??void 0,axisPositionSelect:X??void 0,axisTimeFormatSelect:Y??void 0,axisColorInput:W,axisLineWidthSlider:q}),z(this.axisGroup),this.axisTypeSelect.setDisplayed(!!S.options?.length),!X)this.removeTemplateComponent(this.axisPositionSelect);let H=()=>{let k=J.getValue("type")==="time";$x(this.axisTimeFormatSelect.getGui(),k)};if(!Y)this.removeTemplateComponent(this.axisTimeFormatSelect);else H(),this.addManagedEventListeners({chartOptionsChanged:()=>{H()}});this.initGridLines(Z),this.initAxisTicks(Z),this.initAxisLabels(Z);let _=()=>{for(let k of this.updateFuncs)k()};this.addManagedListeners(this.chartController,{chartUpdated:_,chartModelUpdate:()=>setTimeout(()=>{if(!this.isAlive())return;this.refreshAxisTypeSelect(U),H()})})}getAxisTypeSelectParams(G,D){let z=G.getChartOptions(),B=this.getAxisTypeSelectOptions(),Q=G.getDefaultSelectParams("type","axisType",B);return Q.onValueChange=(J)=>{let U=z.getValue("type");if(J===U)return;let Z=D.getValue("*"),S=U==="time",X=J==="time",Y=S!==X?X?Mx:void 0:null;if(Y===void 0)z.clearValue?.("label","format");if(this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,J),Y!=null)z.setValue("label.format",Y);D.setValue("*",Z)},Q}refreshAxisTypeSelect(G){let D=this.getAxisTypeSelectOptions(),z=!!D.length;if(this.axisTypeSelect.setDisplayed(z),!z)return;this.axisTypeSelect.clearOptions().addOptions(D).setValue(G.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){let G=this.chartController,D=G.getChartType(),z=()=>{let B=G.getChartData()[0];if(!B)return!1;return G.getSelectedDimensions().every((Q)=>!isNaN(parseFloat(B[Q.colId])))};if(["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(D)||G.isGrouping()||!this.isCategoryAxis()||G.isCategorySeriesSwitched()||!z())return[];return["category","number","time"].map((B)=>({value:B,text:this.translate(B)}))}isCategoryAxis(){let G=this.chartOptionsSeriesProxy.getValue("direction")==="horizontal";return G&&this.axisType==="yAxis"||!G&&this.axisType==="xAxis"}getAxisPositionSelectParams(G){let D=((z,B)=>{if(z==="heatmap")return null;if(B==="xAxis")return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];if(B==="yAxis")return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]})(this.chartController.getChartType(),this.axisType);if(!D)return null;return G.getDefaultSelectParams("position","position",D)}getAxisTimeFormatSelectParams(G){if(!this.isCategoryAxis())return null;let D=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return G.getDefaultSelectParams("label.format","timeFormat",D)}getAxisColorInputParams(G){return G.getDefaultColorPickerParams("line.stroke")}getAxisLineWidthSliderParams(G){let D=G.getChartOptions(),z=()=>{if(!D.getValue("line.enabled"))return null;return D.getValue("line.width")},B=(J)=>{D.setValues([{expression:"line.enabled",value:J!=null},{expression:"line.width",value:J??0}])},Q=G.getDefaultSliderParamsWithoutValueParams(z()??0,"thickness",10);return Q.onValueChange=(J)=>{B(J===0?null:J)},Q}initGridLines(G){if(this.chartController.getChartType()==="heatmap")return;let z=this.createBean(new Ix(G));this.axisGroup.addItem(z),this.activePanels.push(z)}initAxisTicks(G){if(!this.hasConfigurableAxisTicks())return;let D=this.createBean(new Fx(G));this.axisGroup.addItem(D),this.activePanels.push(D);let z=()=>D.setTickSizeSliderDisplayed(this.isGroupedCategoryAxis());this.updateFuncs.push(z),z()}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(G){let D={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:G,keyMapper:(B)=>`label.${B}`},z=this.createBean(new YD(D));this.axisGroup.addItem(z),this.activePanels.push(z),this.addAdditionalLabelComps(z,G)}addAdditionalLabelComps(G,D){this.addLabelPadding(G,D);let z=this.createRotationWidget("labelRotation",D),B=this.initLabelRotation(z,D);G.addItem(B),G.addItem(z)}initLabelRotation(G,D){let z=D.getChartOptions(),B=()=>{return z.getValue("label.rotation")},Q=()=>{return z.getValue("label.autoRotate")},J=(Y)=>{if(Y)this.prevRotation=B();z.setValues([{expression:"label.autoRotate",value:Y},{expression:"label.rotation",value:Y?void 0:this.prevRotation}]),G.setDisplayed(!Y)},Z=typeof B()==="number"?!1:Q(),S=this.createBean(new Jx({label:this.translate("autoRotate"),value:Z,onValueChange:J}));G.setDisplayed(!Z);let X=()=>S.setDisplayed(this.isGroupedCategoryAxis());return this.updateFuncs.push(X),X(),S}createRotationWidget(G,D){let z=D.getChartOptions(),B=()=>{return z.getValue("label.rotation")},Q=(S)=>{return z.setValue("label.rotation",S)},J=String.fromCharCode(176),U=`${this.chartTranslation.translate(G)} ${J}`,Z=new qx({label:U,labelWidth:"flex",value:B()??0,onValueChange:Q});return this.updateFuncs.push(()=>{Z.setValue(B()??0)}),this.createBean(Z)}isGroupedCategoryAxis(){if(this.chartOptionsService.getCartesianAxisOptionsProxy(this.axisType).getValue("type")==="grouped-category")return!this.isCategoryAxis();return!0}addLabelPadding(G,D){let z=this.createBean(new kG(D.getDefaultSliderParams("label.spacing","padding",30)));G.addItem(z)}translate(G){return this.chartTranslation.translate(G)}removeTemplateComponent(G){m5(G.getGui()),this.destroyBean(G)}destroyActivePanels(){for(let G of this.activePanels)m5(G.getGui()),this.destroyBean(G)}destroy(){this.destroyActivePanels(),super.destroy()}},Vx=class extends Rx{constructor(G){super();this.options=G,this.axisGroup=Cx}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{isExpandedOnInit:G,chartAxisMenuParamsFactory:D,registerGroupComponent:z}=this.options,B={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:G,suppressEnabledCheckbox:!0},Q=D.getDefaultColorPickerParams("line.stroke"),J=D.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(`
+ + + + +
`,[p,TG,WG],{axisGroup:B,axisColorInput:Q,axisLineWidthSlider:J}),z(this.axisGroup),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){let G=this.options.chartController.getChartType();if(["radarLine","radarArea"].includes(G)){let z=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:z,property:"shape"}))}if(G!=="pie")this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){let G={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:this.options.chartAxisMenuParamsFactory,keyMapper:(B)=>`label.${B}`},D=this.createManagedBean(new YD(G)),z=this.createOrientationWidget();D.addItem(z),this.axisGroup.addItem(D)}createOrientationWidget(){let G=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:G,property:"label.orientation"})}initRadiusAxis(){let G=l(this.options.chartController.getChartType());if(!oP(G))return;let D=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],z=this.createManagedBean(new jG({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:D})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(z)}createSlider(G){let{labelKey:D,defaultMaxValue:z,step:B=0.05,property:Q}=G,J=this.options.chartAxisMenuParamsFactory.getDefaultSliderParams(Q,D,z);return J.step=B,this.createManagedBean(new kG(J))}createSelect(G){let{labelKey:D,options:z,property:B}=G;return this.createManagedBean(new Ax(this.options.chartAxisMenuParamsFactory.getDefaultSelectParams(B,D,z)))}translate(G){return this.chartTranslation.translate(G)}},ux=class extends Ox{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("background"),suppressEnabledCheckbox:!0,useToggle:!0}),D=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(`
+ + + +
`,[p,TG],{chartBackgroundGroup:G,colorPicker:D})}},gx=class extends jx{constructor(G,D){super();this.chartMenuUtils=G,this.chartController=D,this.paddingTopSlider=Px}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("padding"),suppressEnabledCheckbox:!0},D=(z)=>this.chartMenuUtils.getDefaultSliderParams("padding."+z,z,200);this.setTemplate(`
+ + + + + + +
`,[p,WG],{chartPaddingGroup:G,paddingTopSlider:D("top"),paddingRightSlider:D("right"),paddingBottomSlider:D("bottom"),paddingLeftSlider:D("left")}),this.addManagedEventListeners({chartOptionsChanged:(z)=>{this.updateTopPadding(z.chartOptions)}})}updateTopPadding(G){let D=[...this.chartController.getChartSeriesTypes(),"common"].map((z)=>G?.[z]?.padding?.top).find((z)=>z!=null);if(D!=null)this.paddingTopSlider.setValue(`${D}`)}},Tx=class extends bx{constructor(G){super();this.options=G,this.chartGroup=vx}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{chartController:G,chartMenuParamsFactory:D,isExpandedOnInit:z,registerGroupComponent:B}=this.options,Q={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartStyle"),expanded:z,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new gx(D,G)),this.createManagedBean(new ux(D))]};this.setTemplate(`
+ +
`,[p],{chartGroup:Q}),B(this.chartGroup)}},xx=class extends yx{constructor(G){super();this.groupContainer=G,this.id=0,this.groupComponents=new Map}addGroupComponent(G){let D=this.id++;if(this.groupComponents.set(D,G),G.isExpanded())this.expandedGroupComponent=D;G.onExpandedChange((z)=>{if(z){let B=this.expandedGroupComponent;if(this.expandedGroupComponent=D,B!=null){let Q=G.getGui(),J=Q.offsetTop-this.groupContainer.parentElement.scrollTop;this.groupComponents.get(B)?.toggleGroupExpand(!1,!0);let U=Q.offsetTop-J;if(U<0)U=0;if(U!==this.groupContainer.parentElement.scrollTop)this.groupContainer.parentElement.scrollTop=U}}else this.expandedGroupComponent=void 0})}destroy(){this.groupComponents.clear(),super.destroy()}},nx=class extends ix{constructor(G,D){super();this.options=G,this.legendGroup=t5,this.enabledGroup=t5,this.isGradient=["treemap","sunburst","heatmap"].includes(G.seriesType),this.key=this.isGradient?"gradientLegend":"legend",this.chartController=D.chartController}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{chartMenuParamsFactory:G,isExpandedOnInit:D,registerGroupComponent:z}=this.options,B=this.createManagedBean(new hx(G.getDefaultSelectParams(`${this.key}.position`,"position",["top","right","bottom","left"].map((U)=>({value:U,text:this.chartTranslation.translate(U)})))));this.enabledGroup=this.createManagedBean(new jG(G.addEnableParams(`${this.key}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("legendEnabled"),suppressEnabledCheckbox:!0,useToggle:!0,items:[this.createLabelPanel(G),B,...this.getItems(G)]})));let Q={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("legend"),suppressEnabledCheckbox:!0,expanded:D,items:[this.enabledGroup]};this.setTemplate(`
+ + +
`,[p],{legendGroup:Q}),z(this.legendGroup);let J=this.updateLegendEnabledState.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:J,chartApiUpdate:J})}updateLegendEnabledState(){let{valueCols:G}=this.chartController.getColStateForMenu();this.enabledGroup.setEnabled(G.filter((D)=>D.selected).length>1)}getItems(G){let D=(z,B,Q)=>this.createManagedBean(new kG(G.getDefaultSliderParams(`${this.key}.${z}`,B,Q)));if(this.isGradient)return[this.createManagedBean(new cx(G.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslation.translate("reverseDirection"),labelWidth:"flex"}))),D("gradient.thickness","thickness",40),D("gradient.preferredLength","preferredLength",300),D("spacing","spacing",200)];return[D("spacing","spacing",200),D("item.marker.size","markerSize",40),D("item.marker.strokeWidth","markerStroke",10),D("item.marker.padding","itemSpacing",20),D("item.paddingX","layoutHorizontalSpacing",50),D("item.paddingY","layoutVerticalSpacing",50)]}createLabelPanel(G){let D=this.isGradient?"gradientLegend.scale.label":"legend.item.label",z={enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:G,keyMapper:(B)=>`${D}.${B}`,cssIdentifier:"charts-format-sub-level-no-header"};return this.createManagedBean(new YD(z))}},rx=class extends tx{constructor(G){super();this.params=G,this.toggleableGroup=sx,this.activeComps=[],this.chartOptions=G.chartMenuParamsFactory.getChartOptions()}postConstruct(){let{tag:G,cssIdentifier:D="charts-format-sub-level",title:z,suppressEnabledCheckbox:B}=this.params,Q=this.params.chartMenuParamsFactory.addEnableParams(`${G}.enabled`,{cssIdentifier:D,direction:"vertical",suppressOpenCloseIcons:!0,title:z,suppressEnabledCheckbox:!0,useToggle:!B});this.setTemplate(`
+ + +
`,[p],{toggleableGroup:Q}),this.toggleCss("ag-toggleable-group-panel-no-header",!z)}addItem(G,D){if(D)this.toggleableGroup.prependItem(G);else this.toggleableGroup.addItem(G);this.activeComps.push(G)}setEnabled(G){this.toggleableGroup.setEnabled(G)}destroyActiveComps(){for(let G of this.activeComps)ox(G.getGui()),this.destroyBean(G)}destroy(){this.destroyActiveComps(),super.destroy()}},ex=class extends ax{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
+ + + + + +
`,[p,WG],{calloutGroup:G,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}},Dc=class extends Gc{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},D=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);D.step=0.05,this.setTemplate(`
+ + + +
`,[p,WG],{capsGroup:G,capLengthRatioSlider:D})}},Bc=class extends zc{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
+ + + + + + +
`,[p,TG,WG],{lineGroup:G,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",0.05)})}getSliderParams(G,D,z,B=1,Q=!1){let J=this.chartMenuUtils.getDefaultSliderParams(z,G,D,Q);return J.step=B,J}};function S9(G){return["square","circle","cross","diamond","plus","triangle","heart"].map((D)=>({value:D,text:G.translate(D)}))}var Uc=class extends Jc{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("markers"),suppressEnabledCheckbox:!0,useToggle:!0,suppressOpenCloseIcons:!0});this.setTemplate(`
+ + + + + +
`,[p,Qc,WG],{seriesMarkersGroup:G,seriesMarkerShapeSelect:this.chartMenuUtils.getDefaultSelectParams("marker.shape","shape",S9(this.chartTranslation)),seriesMarkerSizeSlider:this.chartMenuUtils.getDefaultSliderParams("marker.size","size",60),seriesMarkerStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("marker.strokeWidth","strokeWidth",10)})}},Xc=class extends $c{constructor(G){super();this.chartMenuUtils=G,this.seriesItemsGroup=Lc,this.activePanels=[]}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
+ + + +
`,[p,Zc],{seriesItemsGroup:G,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){let G=[{value:"positive",text:this.chartTranslation.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslation.translate("seriesItemNegative")}],D=(z)=>{this.destroyActivePanels(),this.initSeriesControls(z)};return this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesItemType",G,"positive",D)}initSeriesControls(G="positive"){this.initSlider("strokeWidth",10,`item.${G}.strokeWidth`),this.initSlider("lineDash",30,`item.${G}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${G}.strokeOpacity`,0.05,!1),this.initSlider("fillOpacity",1,`item.${G}.fillOpacity`,0.05,!1),this.initItemLabels(G)}initSlider(G,D,z,B=1,Q=!1){let J=this.chartMenuUtils.getDefaultSliderParams(z,G,D,Q);J.step=B;let U=this.seriesItemsGroup.createManagedBean(new kG(J));this.seriesItemsGroup.addItem(U),this.activePanels.push(U)}initItemLabels(G){let D=this.chartMenuUtils.getDefaultFontPanelParams(`item.${G}.label`,"seriesItemLabels"),z=this.createBean(new YD(D));this.seriesItemsGroup.addItem(z),this.activePanels.push(z)}destroyActivePanels(){for(let G of this.activePanels)Sc(G.getGui()),this.destroyBean(G)}destroy(){this.destroyActivePanels(),super.destroy()}},Wc=class extends Yc{constructor(G,D="shadow"){super();this.chartMenuUtils=G,this.propertyKey=D}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G=this.propertyKey,D=this.chartMenuUtils.addEnableParams(`${G}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("shadow"),suppressEnabledCheckbox:!0,useToggle:!0}),z=this.chartMenuUtils.getDefaultColorPickerParams(`${G}.color`);this.setTemplate(`
+ + + + + + +
`,[p,TG,WG],{shadowGroup:D,shadowColorPicker:z,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(G,D,z){let B=`${this.propertyKey}.${G}`,Q=this.chartMenuUtils.getDefaultSliderParams(B,G,z);return Q.minValue=D,Q}},Hc=class extends qc{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
+ + + + + + + + +
`,[p,WG],{groupSpacing:{...G,title:this.chartTranslation.translate("group")},tileSpacing:{...G,title:this.chartTranslation.translate("tile")},groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(G,D){return this.chartMenuUtils.getDefaultSliderParams(D,G,10)}};function Kc(G){return G[0].toUpperCase()+G.substring(1)}var fc=class extends kc{constructor(G){super();this.chartMenuUtils=G,this.tooltipMode=wc}postConstruct(){let{chartMenuUtils:G,beans:D}=this,z="tooltip",B=D.chartTranslation,Q=G.addEnableParams("tooltip.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:B.translate("tooltips"),suppressEnabledCheckbox:!0,useToggle:!0}),J="tooltipMode",U=["single","shared","compact"].map((X)=>({value:X,text:B.translate(`tooltipMode${Kc(X)}`)})),Z="tooltip.mode",S=G.getDefaultSelectParams("tooltip.mode","tooltipMode",U);this.setTemplate(`
+ + + +
`,[p,_c],{tooltipGroup:Q,tooltipMode:S}),this.addManagedEventListeners({chartOptionsChanged:()=>{let X=G.getChartOptions().getValue("tooltip.mode");this.tooltipMode.setValue(X,!0)}})}},Fc=class extends Nc{constructor(G){super();this.chartMenuUtils=G}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let G={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
+ + + + + + + +
`,[p,TG,WG],{whiskersGroup:G,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}},t="tooltips",BG="strokeWidth",tz="lineWidth",ZG="lineDash",e="lineOpacity",$G="fillOpacity",r="labels",nG="shadow",UB="stageLabels",sz="markers",Ec=class extends dx{constructor(G){super();this.options=G,this.seriesGroup=lx,this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth(tz),[BG]:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),[ZG]:()=>this.initLineDash(),[e]:()=>this.initOpacity("strokeOpacity"),[$G]:()=>this.initOpacity("fillOpacity"),markers:()=>new Uc(this.chartMenuUtils),[r]:()=>this.initLabels(),sectorLabels:()=>this.initSectorLabels(),[nG]:()=>new Wc(this.chartMenuUtils),[t]:()=>new fc(this.options.chartMenuParamsFactory),bins:()=>this.initBins(),whiskers:()=>new Fc(this.chartMenuUtils),caps:()=>new Dc(this.chartMenuUtils),connectorLine:()=>new Bc(this.chartMenuUtils),seriesItems:()=>new Xc(this.chartMenuUtils),tileSpacing:()=>new Hc(this.chartMenuUtils),shape:()=>this.initShape(),size:()=>this.initSize("size","size"),minSize:()=>this.initSize("size","minSize"),maxSize:()=>this.initSize("maxSize","maxSize"),dropoff:()=>this.initDropOff(),stageLabels:()=>this.initStageLabels()},this.seriesWidgetMappings={bar:[t,BG,ZG,e,$G,r,nG],pie:[t,BG,e,$G,r,"sectorLabels",nG],donut:[t,BG,e,$G,r,"sectorLabels",nG],line:[t,tz,ZG,e,sz,r],scatter:[t,"shape","size",BG,r],bubble:[t,"shape","minSize","maxSize",BG,r],area:[t,tz,ZG,e,$G,sz,r,nG],histogram:[t,"bins",BG,ZG,e,$G,r,nG],"radial-column":[t,BG,ZG,e,$G,r],"radial-bar":[t,BG,ZG,e,$G,r],"radar-line":[t,BG,ZG,e,sz,r],"radar-area":[t,BG,ZG,e,$G,sz,r],nightingale:[t,BG,ZG,e,$G,r],"box-plot":[t,BG,ZG,e,$G,"whiskers","caps"],"range-bar":[t,BG,ZG,e,$G,r],"range-area":[t,tz,ZG,e,$G,sz,r,nG],treemap:[t,"tileSpacing"],sunburst:[t],heatmap:[t,r,"lineColor",tz,e],waterfall:[t,"connectorLine","seriesItems"],funnel:[t,BG,ZG,e,$G,r,"dropoff",UB,nG],"cone-funnel":[t,BG,ZG,e,$G,r,UB],pyramid:[t,BG,ZG,e,$G,r,UB,nG]},this.seriesType=G.seriesType}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{isExpandedOnInit:G,chartOptionsService:D,chartController:z,registerGroupComponent:B}=this.options,Q={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:G,suppressEnabledCheckbox:!0};this.setTemplate(`
+ + +
`,[p],{seriesGroup:Q}),B(this.seriesGroup),this.chartMenuUtils=this.createManagedBean(new uD(D.getSeriesOptionsProxy(()=>this.seriesType))),this.addManagedListeners(z,{chartSeriesChartTypeChanged:this.refreshWidgets.bind(this)}),this.refreshWidgets()}refreshWidgets(){let{chartController:G}=this.options;this.destroyActivePanels(),G.getChartProxy().getChart().waitForUpdate().then(()=>{if(!this.isAlive())return;if(G.isComboChart())this.updateSeriesType(),this.initSeriesSelect();for(let B of this.seriesWidgetMappings[this.seriesType]??[]){let Q=this.widgetFuncs[B](),J;if(Array.isArray(Q)){let U=this.createBean(Q[0]);J=U,Q[1](U)}else J=this.createBean(Q);this.seriesGroup.addItem(J),this.activePanels.push(J)}}).catch((z)=>px(105,{e:z}))}initSeriesSelect(){let G=this.createBean(new O1(this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesType",this.getSeriesSelectOptions(),`${this.seriesType}`,(D)=>{this.seriesType=D,this.refreshWidgets()})));this.seriesGroup.addItem(G),this.activePanels.push(G)}initLineColor(){return new z9(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor"))}initStrokeWidth(G,D){return new kG(this.chartMenuUtils.getDefaultSliderParams(D?`${D}.${G}`:"strokeWidth",G,10))}initLineDash(G){return new kG(this.chartMenuUtils.getDefaultSliderParams(G?`${G}.lineDash`:"lineDash","lineDash",30,!0))}initOpacity(G,D){let z=this.chartMenuUtils.getDefaultSliderParams(D?`${D}.${G}`:G,G,1);return z.step=0.05,new kG(z)}initDropOff(){return[new rx({tag:"dropOff",cssIdentifier:"charts-format-sub-level",title:this.translate("dropOff"),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils}),(z)=>{for(let B of[this.initStrokeWidth("strokeWidth","dropOff"),this.initLineDash("dropOff"),this.initOpacity("strokeOpacity","dropOff"),this.initOpacity("fillOpacity","dropOff")]){let Q=z.createManagedBean(B);z.addItem(Q),this.activePanels.push(Q)}}]}initLabels(){let G=t8(this.seriesType),D=G?"calloutLabel":"label",z=G?"calloutLabels":"labels",B=this.chartMenuUtils.getDefaultFontPanelParams(D,z);return[new YD(B),(U)=>{if(G){let Z=U.createManagedBean(new ex(this.chartMenuUtils));U.addItem(Z),this.activePanels.push(Z)}if(this.seriesType==="range-bar"){let Z=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],S=U.createManagedBean(new O1(this.chartMenuUtils.getDefaultSelectParams("label.placement","labelPlacement",Z)));U.addItem(S),this.activePanels.push(S);let X=U.createManagedBean(new kG(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));U.addItem(X),this.activePanels.push(X)}}]}initSectorLabels(){let G=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels");return[new YD(G),(B)=>{let Q=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);Q.step=0.05;let J=B.createManagedBean(new kG(Q));B.addItem(J)}]}initStageLabels(){return new YD(this.chartMenuUtils.getDefaultFontPanelParams("stageLabel",UB))}initBins(){let G=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),D=this.chartMenuUtils.getChartOptions(),z=(D.getValue("bins")??D.getValue("calculatedBins",!0)).length;return G.value=`${z}`,G.maxValue=Math.max(z,20),new kG(G)}initShape(){return new O1(this.chartMenuUtils.getDefaultSelectParams("shape","shape",S9(this.chartTranslation)))}initSize(G,D){return new kG(this.chartMenuUtils.getDefaultSliderParams(G,D,60))}getSeriesSelectOptions(){let G=this.getActiveSeriesTypes();return["area","bar","line"].filter((D)=>G.includes(D)).map((D)=>({value:D,text:this.translate(D)}))}updateSeriesType(){let G=this.getActiveSeriesTypes();if(!G.includes(this.seriesType)&&G.length>0)this.seriesType=G[0]}getActiveSeriesTypes(){return this.options.chartController.getActiveSeriesChartTypes().map((G)=>l(G.chartType))}translate(G){return this.chartTranslation.translate(G)}destroyActivePanels(){for(let G of this.activePanels)mx(G.getGui()),this.destroyBean(G)}destroy(){this.destroyActivePanels(),super.destroy()}},ez=class extends Rc{constructor(G,D,z){super("
");this.chartMenuUtils=G,this.name=D,this.key=z,this.chartOptions=G.getChartOptions()}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){this.initFontPanel()}hasTitle(){let G=this.chartOptions.getValue(this.key);return G?.enabled&&G.text&&G.text.length>0}initFontPanel(){let G=this.hasTitle(),D={name:this.chartTranslation.translate(this.name),enabled:G,suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils,keyMapper:(z)=>`${this.key}.${z}`,onEnableChange:(z)=>this.onEnableChange(z)};this.fontPanel=this.createManagedBean(new YD(D)),this.fontPanel.addItem(this.createBean(new Ac(this.getTextInputParams())),!0),this.fontPanel.addItem(this.createBean(new kG(this.getSpacingSliderParams()))),this.getGui().appendChild(this.fontPanel.getGui())}getTextInputParams(){return this.chartMenuUtils.addValueParams(`${this.key}.text`,{label:this.chartTranslation.translate("title"),labelAlignment:"top"})}getSpacingSliderParams(){return this.chartMenuUtils.getDefaultSliderParams(`${this.key}.spacing`,"spacing",100)}onEnableChange(G){this.chartOptions.setValue(`${this.key}.enabled`,G)}},Cc=class extends ez{wireBeans(G){super.wireBeans(G),this.chartMenuSvc=G.chartMenuSvc}postConstruct(){this.titlePlaceholder=this.chartTranslation.translate("titlePlaceholder"),super.postConstruct(),this.addManagedEventListeners({chartTitleEdit:()=>{this.fontPanel.setEnabled(this.hasTitle())}})}getTextInputParams(){let G=super.getTextInputParams();if(this.shouldOverrideTextWithPlaceholder(G.value))G.value=this.titlePlaceholder;return G}getSpacingSliderParams(){let G=super.getSpacingSliderParams();return G.value="10",G}onEnableChange(G){if(this.chartMenuSvc.doesChartToolbarExist()){let z=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",G?z-20:z+20)}this.chartOptions.setValue(`${this.key}.enabled`,G);let D=this.chartOptions.getValue(`${this.key}.text`);if(G&&this.shouldOverrideTextWithPlaceholder(D))this.chartOptions.setValue(`${this.key}.text`,this.titlePlaceholder)}shouldOverrideTextWithPlaceholder(G){return G==="Title"||G?.trim().length===0}},Vc=class extends Ic{constructor(G){super();this.options=G,this.titleGroup=Mc}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){let{chartMenuParamsFactory:G,chartAxisMenuParamsFactory:D,chartOptionsService:z,seriesType:B,isExpandedOnInit:Q=!1,registerGroupComponent:J}=this.options,U=[];if(SD(B)&&B!=="pyramid"){let S=(X)=>this.createManagedBean(new uD(z.getCartesianAxisThemeOverridesProxy(X)));U.push(this.createManagedBean(new ez(S("xAxis"),"horizontalAxisTitle","title"))),U.push(this.createManagedBean(new ez(S("yAxis"),"verticalAxisTitle","title")))}else if(BJ(B))U.push(this.createManagedBean(new ez(D,"polarAxisTitle","title")));let Z={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartTitles"),expanded:Q,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new Cc(G,"chartTitle","title")),this.createManagedBean(new ez(G,"chartSubtitle","subtitle")),...U]};this.setTemplate(`
+ +
`,[p],{titleGroup:Z}),J(this.titleGroup)}},bc={groups:[{type:"chart"},{type:"titles"},{type:"legend"},{type:"series"},{type:"axis"}]},s5=["axis","horizontalAxis","verticalAxis"],vc=class extends Qx{constructor(G){super('
');this.chartMenuContext=G}postConstruct(){this.groupExpansionFeature=this.createManagedBean(new xx(this.getGui())),this.chartPanelFeature=this.createManagedBean(new D9(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(G,D)=>this.createPanels(D))),this.chartPanelFeature.refreshPanels()}createPanels(G){let D=!1;this.getFormatPanelDef().groups?.forEach(({type:z,isOpen:B=!1})=>{if(!this.isGroupPanelShownInSeries(z,G))return;if(B){if(D)p5(145,{group:z});D=!0}let Q=(U)=>this.groupExpansionFeature.addGroupComponent(U),J={...this.chartMenuContext,isExpandedOnInit:B,seriesType:G,registerGroupComponent:Q};switch(z){case"chart":this.chartPanelFeature.addComponent(new Tx(J));break;case"titles":this.chartPanelFeature.addComponent(new Vc(J));break;case"legend":this.chartPanelFeature.addComponent(new nx(J,this.chartMenuContext));break;case"axis":if(BJ(G))this.chartPanelFeature.addComponent(new Vx(J));else if(SD(G))this.chartPanelFeature.addComponent(new JB("xAxis",J)),this.chartPanelFeature.addComponent(new JB("yAxis",J));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new JB("xAxis",J));break;case"verticalAxis":this.chartPanelFeature.addComponent(new JB("yAxis",J));break;case"series":this.chartPanelFeature.addComponent(new Ec(J));break;default:p5(147,{group:z})}})}getFormatPanelDef(){let G=this.gos.get("chartToolPanelsDef")?.formatPanel;return G?G:bc}isGroupPanelShownInSeries(G,D){let z=["chart","titles","legend","series"].includes(G)||SD(D)&&s5.includes(G)||BJ(D)&&G==="axis",B=zJ(D)&&G==="legend"||zJ(D)&&s5.includes(G);return z&&!B}},cc="ag-chart-mini-thumbnail-canvas",PD=class extends yc{constructor(G,D,z){super();this.agChartsExports=D,this.tooltipName=z,this.size=58,this.padding=5;let{_Scene:B}=D;this.root=new B.Group;let Q=G.ownerDocument.createElement("canvas"),J=new B.Scene({canvasElement:Q,pixelRatio:G.ownerDocument.defaultView?.devicePixelRatio??1,width:this.size,height:this.size,willReadFrequently:!1});J.canvas.element.classList.add(cc),J.setRoot(this.root),J.setContainer(G),this.scene=J}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){this.scene.canvas.element.title=this.chartTranslation.translate(this.tooltipName);try{this.scene.render()}catch(G){xc(108,{e:G})}}};function k0(G){let{stacked:D,size:z,padding:B,xScalePadding:Q,xScaleDomain:J,yScaleDomain:U,agChartsExports:{_Scene:Z}}=G,S=new Z.CategoryScale;S.domain=J,S.range=[B,z-B],S.paddingInner=Q,S.paddingOuter=Q;let X=new Z.LinearScale;X.domain=U,X.range=[z-B,B];let Y=(W,q,H)=>{return W.map((_,k)=>{let w=H.convert(_),K=new Z.Rect;return K.x=q.convert(k),K.y=w,K.width=q.bandwidth,K.height=H.convert(0)-w,K.strokeWidth=0,K.crisp=!0,K})};if(D)return G.data.map((W)=>Y(W,S,X));return Y(G.data,S,X)}function hc(G,D,z,B){let Q=[],J=[];for(let S of D)for(let[X,Y]of S)Q.push(X),J.push(Y);let U=new G.LinearScale;U.domain=[Math.min(...Q),Math.max(...Q)],U.range=[B,z-B];let Z=new G.LinearScale;return Z.domain=[Math.min(...J),Math.max(...J)],Z.range=[z-B,B],{xScale:U,yScale:Z}}function Y9(G,D,z,B){let Q=[0,D[0].length-1],J=D.reduce((S,X)=>{for(let Y of X){if(YS[1])S[1]=Y}return S},[1/0,-1/0]);J[0]--,J[J.length-1]++;let U=new G.LinearScale;U.domain=Q,U.range=[B,z-B];let Z=new G.LinearScale;return Z.domain=J,Z.range=[z-B,B],{xScale:U,yScale:Z}}function W9(G,D,z){return G.map((B)=>B.map((Q,J)=>[J>0?"lineTo":"moveTo",D.convert(J),z.convert(Q)]))}function ic(G,D,z){return G.map(([B,Q],J)=>[J>0?"lineTo":"moveTo",D.convert(B),z.convert(Q)])}function nc(G){let D=G[0],z=G[1],B=X9(G);if(z[1]!==B[1]||z[2]!==B[2])G.push([D[0],z[1],z[2]]);return G}function q9(G,D){let z=new G.Path;return D.forEach(([B,Q,J])=>z.path[B](Q,J)),z}function dc(G,D,z){return G.map((B,Q,J)=>{let Z=[...z?lc(J,Q,D):H9(B,D)].reverse().map(([Y,W,q])=>["lineTo",W,q]),S=B[0],X=X9(Z);if(S[1]!==X[1]||S[2]!==X[2])Z.push(["lineTo",S[1],S[2]]);return[...B,...Z]})}function lc(G,D,z){if(D===0)return H9(G[D],z);return[...G[D-1]]}function H9(G,D){return G.map(([z,B])=>[z,B,D.convert(0)])}function _9(G,D){let z=q9(G,D);return z.fill=void 0,z.lineCap="round",z.strokeWidth=3,z}function pc({_Scene:G},D,z,B,Q){let{xScale:J,yScale:U}=hc(G,z,B,Q),Y=z.map((q)=>ic(q,J,U)).map((q)=>nc(q)).map((q)=>_9(G,q)).reduce((q,H)=>q.concat(H),[]),W=new G.Group;return W.setClipRect(new G.BBox(Q,Q,B-Q*2,B-Q*2)),W.append(Y),D.append(W),Y}function tJ({_Scene:G},D,z,B,Q){let{xScale:J,yScale:U}=Y9(G,z,B,Q),S=W9(z,J,U).map((Y)=>_9(G,Y)),X=new G.Group;return X.setClipRect(new G.BBox(Q,Q,B-Q*2,B-Q*2)),X.append(S),D.append(X),S}function mc(G,D,z,B,Q,J=!1){let{xScale:U,yScale:Z}=Y9(G,z,B,Q),S=dc(W9(z,U,Z),Z,J),X=new G.Group;X.setClipRect(new G.BBox(Q,Q,B-Q*2,B-Q*2));let Y=S.map((W)=>q9(G,W));return X.append(Y),D.append(X),Y}function k9(G){return G.map((D,z,B)=>D.map((Q,J)=>B.slice(0,z+1).reduce((U,Z)=>U+Z[J],0)))}function w9(G){let D=G.map((z,B)=>G.reduce((Q,J)=>Math.max(Q,J[B]),0));return G.map((z)=>z.map((B,Q)=>B/D[Q]*19))}function K9(G,D,z,B,Q,J,U=0){let{_Scene:Z}=G,S=new Z.LinearScale;S.domain=[0,7],S.range=[-Math.PI,Math.PI].map((_)=>_+Math.PI/2);let X=new Z.LinearScale;X.domain=[0,10],X.range=[Q,J];let Y=[],W=B/2,q=z.map((_)=>{let k=new Z.Path;return k.strokeWidth=1,k.strokeOpacity=0.5,k.lineCap="round",k.fill=void 0,k.fillOpacity=0.8,_.forEach((w,K)=>{let f=S.convert(K),N=Q+J-X.convert(w),F=N*Math.cos(f)+W,E=N*Math.sin(f)+W;if(k.path[K>0?"lineTo":"moveTo"](F,E),U>0){let I=new Z.Marker({shape:"circle"});I.x=F,I.y=E,I.size=U,Y.push(I)}}),k.path.closePath(),k}),H=new Z.Group;return H.append([...q,...Y]),D.append(H),{paths:q,markers:Y}}function eB(G){let[D,z]=[1/0,-1/0];return{processedData:G.reduce((Q,J,U)=>{let Z=U>0?Q[U-1]:void 0;Q[U]??(Q[U]=[]);let S=Q[U];return J.forEach((X,Y)=>{if(Z)X+=Z[Y];if(S[Y]=X,S[Y]z)z=S[Y]}),Q},[]),min:D,max:z}}var tc=[[[13,16],[13,12],[3,12],[3,16]],[[12,11],[12,7],[4,7],[4,11]],[[10.125,6],[10.125,1.5],[5.875,1.5],[5.875,6]]],sJ=class extends PD{constructor(G,D,z,B,Q,J="funnelTooltip",U=tc){super(G,D,J);this.shapes=pc(D,this.root,U,this.size,this.padding),this.updateColors(z,B)}updateColors(G,D){for(let z of this.shapes)z.fill=G[0],z.stroke=D[0],z.strokeWidth=0}},sc={chartType:"funnel",miniChart:sJ},oc=[[[13,16],[10.75,11.5],[5.25,11.5],[3,16]],[[10.75,11.5],[8.875,6],[7.125,6],[5.25,11.5]],[[8.875,6],[8.875,1.5],[7.125,1.5],[7.125,6]]],rc=class extends sJ{constructor(G,D,z,B,Q,J="coneFunnelTooltip"){super(G,D,z,B,Q,J,oc)}updateColors(G,D){this.shapes.forEach((z,B)=>{z.fill=G[0],z.fillOpacity=1-B*0.2,z.stroke=D[0],z.strokeWidth=0})}},ac={chartType:"coneFunnel",miniChart:rc},ec=[[[8,16],[10,12],[6,12]],[[10.5,11],[12.5,7],[3.5,7],[5.5,11]],[[13,6],[15.5,1.5],[0.5,1.5],[3,6]]],Gh=class extends sJ{constructor(G,D,z,B,Q,J="pyramidTooltip"){super(G,D,z,B,Q,J,ec)}updateColors(G,D){this.shapes.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B],z.strokeWidth=0})}},Dh={chartType:"pyramid",miniChart:Gh},qG=class extends PD{constructor(G,D,z){super(G,D,z);this.stroke="gray",this.axisOvershoot=3}postConstruct(){let{_Scene:G}=this.agChartsExports,D=this.size,z=this.padding,B=new G.Line;B.x1=z,B.y1=z,B.x2=z,B.y2=D-z+this.axisOvershoot,B.stroke=this.stroke;let Q=new G.Line;Q.x1=z-this.axisOvershoot+1,Q.y1=D-z,Q.x2=D-z+1,Q.y2=D-z,Q.stroke=this.stroke;let J=this.root;J.append(B),J.append(Q),super.postConstruct()}},zh=class extends qG{constructor(G,D,z,B){super(G,D,"groupedColumnTooltip");this.columnData=[2,3,4];let{root:Q,columnData:J,size:U,padding:Z}=this;this.columns=k0({stacked:!1,root:Q,data:J,size:U,padding:Z,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:0.3,agChartsExports:D}),Q.append(this.columns),this.updateColors(z,B)}updateColors(G,D){this.columns.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]})}},Bh={chartType:"groupedColumn",miniChart:zh},Jh=[[8,12,16],[6,9,12],[2,3,4]],f9=class extends qG{constructor(G,D,z,B,Q,J=Jh,U=[0,16],Z="stackedColumnTooltip"){super(G,D,Z);let{root:S,size:X,padding:Y}=this;this.stackedColumns=k0({stacked:!0,root:S,data:J,size:X,padding:Y,xScaleDomain:[0,1,2],yScaleDomain:U,xScalePadding:0.3,agChartsExports:D}),S.append(Qh(this.stackedColumns)),this.updateColors(z,B)}updateColors(G,D){this.stackedColumns.forEach((z,B)=>{for(let Q of z)Q.fill=G[B],Q.stroke=D[B]})}},Uh={chartType:"stackedColumn",miniChart:f9},Zh=[[10,10,10],[6,7,8],[2,4,6]],$h=class extends f9{constructor(G,D,z,B,Q){super(G,D,z,B,Q,Zh,[0,10],"normalizedColumnTooltip")}},Lh={chartType:"normalizedColumn",miniChart:$h},Sh=class extends qG{constructor(G,D,z,B){super(G,D,"groupedBarTooltip");let{_Scene:Q}=D,J=this.padding,U=this.size,Z=[2,3,4],S=new Q.CategoryScale;S.domain=[0,1,2],S.range=[J,U-J],S.paddingInner=0.3,S.paddingOuter=0.3;let X=new Q.LinearScale;X.domain=[0,4],X.range=[U-J,J];let Y=X.convert(0),W=S.bandwidth;this.bars=Z.map((q,H)=>{let _=new Q.Rect;return _.x=J,_.y=S.convert(H),_.width=Y-X.convert(q),_.height=W,_.strokeWidth=0,_.crisp=!0,_}),this.updateColors(z,B),this.root.append(this.bars)}updateColors(G,D){this.bars.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]})}},Xh={chartType:"groupedBar",miniChart:Sh},Wh=[[8,12,16],[6,9,12],[2,3,4]],N9=class extends qG{constructor(G,D,z,B,Q,J=Wh,U=[0,16],Z="stackedBarTooltip"){super(G,D,Z);let{_Scene:S}=D,X=this.size,Y=this.padding,W=new S.CategoryScale;W.domain=[0,1,2],W.range=[Y,X-Y],W.paddingInner=0.3,W.paddingOuter=0.3;let q=new S.LinearScale;q.domain=U,q.range=[X-Y,Y];let H=q.convert(0),_=W.bandwidth;this.bars=J.map((k)=>k.map((w,K)=>{let f=new S.Rect;return f.x=Y,f.y=W.convert(K),f.width=H-q.convert(w),f.height=_,f.strokeWidth=0,f.crisp=!0,f})),this.updateColors(z,B),this.root.append(Yh(this.bars))}updateColors(G,D){this.bars.forEach((z,B)=>z.forEach((Q)=>{Q.fill=G[B],Q.stroke=D[B]}))}},qh={chartType:"stackedBar",miniChart:N9},Hh=[[10,10,10],[6,7,8],[2,4,6]],_h=class extends N9{constructor(G,D,z,B,Q){super(G,D,z,B,Q,Hh,[0,10],"normalizedBarTooltip")}},kh={chartType:"normalizedBar",miniChart:_h},F9=class extends PD{constructor(G,D,z,B,Q,J=0.6,U="donutTooltip"){super(G,D,U);let{size:Z,padding:S,agChartsExports:{_Scene:X}}=this,Y=(Z-S*2)/2,W=Y+S,q=X.toRadians,H=[[q(-90),q(30)],[q(30),q(120)],[q(120),q(180)],[q(180),q(210)],[q(210),q(240)],[q(240),q(270)]];this.sectors=H.map(([_,k])=>{let w=new X.Sector;return w.centerX=W,w.centerY=W,w.innerRadius=Y*J,w.outerRadius=Y,w.startAngle=_,w.endAngle=k,w.stroke=void 0,w.strokeWidth=0,w.inset=0.75,w}),this.updateColors(z,B),this.root.append(this.sectors)}updateColors(G,D){this.sectors.forEach((z,B)=>{z.fill=G[B%G.length],z.stroke=D[B%D.length]})}},D6={chartType:"donut",miniChart:F9},wh=class extends F9{constructor(G,D,z,B,Q){super(G,D,z,B,Q,0,"pieTooltip")}},Kh={chartType:"pie",miniChart:wh},oJ=[[1,3,5],[2,6,4],[5,3,1]],rJ=class extends qG{constructor(G,D,z,B,Q,J=oJ,U="lineTooltip"){super(G,D,U);let{size:Z,padding:S,root:X}=this;this.lines=tJ(D,X,J,Z,S),this.updateColors(z,B)}updateColors(G,D){this.lines.forEach((z,B)=>{z.stroke=G[B]})}},fh={chartType:"line",miniChart:rJ},E9=k9(oJ),Nh=class extends rJ{constructor(G,D,z,B,Q,J=E9,U="stackedLineTooltip"){super(G,D,z,B,Q,J,U)}},Fh={chartType:"stackedLine",miniChart:Nh},Eh=w9(E9),Ih=class extends rJ{constructor(G,D,z,B,Q,J=Eh,U="normalizedLineTooltip"){super(G,D,z,B,Q,J,U)}},Mh={chartType:"normalizedLine",miniChart:Ih},Ah=class extends qG{constructor(G,D,z,B){super(G,D,"scatterTooltip");let{size:Q,padding:J,agChartsExports:{_Scene:U}}=this,Z=[[[0.3,3],[1.1,0.9],[2,0.4],[3.4,2.4]],[[0,0.3],[1,2],[2.4,1.4],[3,0]]],S=new U.LinearScale;S.domain=[-0.5,4],S.range=[J*2,Q-J];let X=new U.LinearScale;X.domain=[-0.5,3.5],X.range=[Q-J,J];let Y=[];Z.forEach((q)=>{q.forEach(([H,_])=>{let k=new U.Arc;k.strokeWidth=0,k.centerX=S.convert(H),k.centerY=X.convert(_),k.radius=2.5,Y.push(k)})}),this.points=Y,this.updateColors(z,B);let W=new U.Group;W.setClipRect(new U.BBox(J,J,Q-J*2,Q-J*2)),W.append(this.points),this.root.append(W)}updateColors(G,D){this.points.forEach((z,B)=>{z.stroke=D[B%D.length],z.fill=G[B%G.length]})}},Rh={chartType:"scatter",miniChart:Ah},Ch=class extends qG{constructor(G,D,z,B){super(G,D,"bubbleTooltip");let{size:Q,padding:J,agChartsExports:{_Scene:U}}=this,Z=[[[0.1,0.3,5],[0.5,0.4,7],[0.2,0.8,7]],[[0.8,0.7,5],[0.7,0.3,9]]],S=new U.LinearScale;S.domain=[0,1],S.range=[J*2,Q-J];let X=new U.LinearScale;X.domain=[0,1],X.range=[Q-J,J];let Y=[];Z.forEach((q)=>{q.forEach(([H,_,k])=>{let w=new U.Arc;w.strokeWidth=0,w.centerX=S.convert(H),w.centerY=X.convert(_),w.radius=k,w.fillOpacity=0.7,Y.push(w)})}),this.points=Y,this.updateColors(z,B);let W=new U.Group;W.setClipRect(new U.BBox(J,J,Q-J*2,Q-J*2)),W.append(this.points),this.root.append(W)}updateColors(G,D){this.points.forEach((z,B)=>{z.stroke=D[B%D.length],z.fill=G[B%G.length]})}},Vh={chartType:"bubble",miniChart:Ch},I9=oJ,M9=class extends qG{constructor(G,D,z,B,Q,J=I9,U="groupedAreaTooltip",Z=!1){super(G,D,U);this.areas=mc(D._Scene,this.root,J,this.size,this.padding,Z),this.updateColors(z,B)}updateColors(G,D){this.areas.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B],z.strokeWidth=1,z.strokeOpacity=0.75,z.fillOpacity=0.7})}},bh={chartType:"area",miniChart:M9},A9=k9(I9),R9=class extends M9{constructor(G,D,z,B,Q,J=A9,U="stackedAreaTooltip"){super(G,D,z,B,Q,J,U,!0)}updateColors(G,D){this.areas.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]})}},vh={chartType:"stackedArea",miniChart:R9},Oh=w9(A9),uh=class extends R9{constructor(G,D,z,B,Q,J=Oh,U="normalizedAreaTooltip"){super(G,D,z,B,Q,J,U)}},jh={chartType:"normalizedArea",miniChart:uh},Ph=class extends qG{constructor(G,D,z,B){super(G,D,"histogramTooltip");let{padding:Q,size:J,agChartsExports:{_Scene:U}}=this,Z=[2,5,11,13,10,6,1],S=new U.LinearScale;S.domain=[0,Z.length],S.range=[Q,J-Q];let X=new U.LinearScale;X.domain=[0,Z.reduce((W,q)=>Math.max(W,q),0)],X.range=[J-Q,Q];let Y=X.convert(0);this.bars=Z.map((W,q)=>{let H=X.convert(W),_=S.convert(q),k=S.convert(q+1),w=new U.Rect;return w.x=_,w.y=H,w.width=k-_,w.height=Y-H,w.strokeWidth=1,w.strokeOpacity=0.75,w.crisp=!0,w}),this.updateColors(z,B),this.root.append(this.bars)}updateColors([G],[D]){for(let z of this.bars)z.fill=G,z.stroke=D}},gh={chartType:"histogram",miniChart:Ph},_z=class extends PD{constructor(G,D,z){super(G,D,z);this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}postConstruct(){let{_Scene:G}=this.agChartsExports,D=this.size,z=this.padding,B=z*2,Q=(D-B)/2,J=this.showAngleAxisLines?[Q,Q*0.8,Q*0.6,Q*0.4]:[],U=new G.Line;U.x1=D/2,U.y1=z,U.x2=D/2,U.y2=D-z-Q-J[J.length-1],U.stroke=this.stroke,U.strokeOpacity=0.5,U.fill=void 0,U.visible=this.showRadiusAxisLine;let Z=z+Q;this.gridLines=J.map((X,Y)=>{let W=new G.Path;return W.path.arc(Z,Z,X,0,2*Math.PI),W.strokeWidth=1,W.stroke=this.stroke,W.strokeOpacity=Y===0?0.5:0.2,W.fill=void 0,W});let S=this.root;if(S.append(U),this.gridLines.length>0)S.append(this.gridLines);super.postConstruct()}},Th=class extends _z{constructor(G,D,z,B){super(G,D,"radialColumnTooltip");this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;let{padding:Q,size:J,data:U,agChartsExports:{_Scene:Z}}=this,S=(J-Q*2)/2,Y=S*0.4,W=new Z.CategoryScale;W.domain=U[0].map((K,f)=>f),W.range=[0,2*Math.PI],W.paddingInner=0,W.paddingOuter=0;let q=W.bandwidth*0.7,{processedData:H,max:_}=eB(U),k=new Z.LinearScale;k.domain=[0,_],k.range=[Y,S];let w=this.size/2;this.series=H.map((K,f)=>{let F=f===0?void 0:H[f-1],E=new Z.TranslatableGroup({zIndex:1e6}),I=K.map((V,A)=>{let R=F?.[A],O=k.convert(V),u=k.convert(R??0),v=W.convert(A),h=v+q,P=Z.getRadialColumnWidth(v,h,S,0.5,0.5),b=new Z.RadialColumnShape;return b.columnWidth=P,b.innerRadius=u,b.outerRadius=O,b.startAngle=v,b.endAngle=h,b.isBeveled=!0,b.axisInnerRadius=Y,b.axisOuterRadius=S,b.stroke=void 0,b.strokeWidth=0,b});return E.append(I),E.translationX=w,E.translationY=w,E}),this.root.append(this.series),this.updateColors(z,B)}updateColors(G,D){this.series.forEach((z,B)=>{for(let Q of z.children())Q.fill=G[B%G.length],Q.stroke=D[B%D.length]})}},yh={chartType:"radialColumn",miniChart:Th},xh=class extends _z{constructor(G,D,z,B){super(G,D,"radialBarTooltip");this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;let{size:Q,padding:J,data:U,agChartsExports:{_Scene:Z}}=this,S=(Q-J)/2,Y=S*0.4,W=new Z.CategoryScale;W.domain=U[0].map((N,F)=>F),W.range=[Y,S],W.paddingInner=0.5,W.paddingOuter=0;let q=W.bandwidth,{processedData:H,max:_}=eB(U),k=new Z.LinearScale;k.domain=[0,Math.ceil(_*1.5)];let w=1.5*Math.PI,K=w+2*Math.PI;k.range=[w,K];let f=Q/2;this.series=H.map((N,F)=>{let E=F<0?void 0:H[F-1],I=new Z.Group({zIndex:1e6}),V=N.map((A,R)=>{let O=E?.[R]??0,u=W.convert(R),v=u-q,h=k.convert(O),P=k.convert(A),b=new Z.Sector;return b.centerX=f,b.centerY=f,b.innerRadius=v,b.outerRadius=u,b.startAngle=h,b.endAngle=P,b.stroke=void 0,b.strokeWidth=0,b});return I.append(V),I}),this.root.append(this.series),this.updateColors(z,B)}updateColors(G,D){this.series.forEach((z,B)=>{for(let Q of z.children())Q.fill=G[B%G.length],Q.stroke=D[B%D.length]})}},ch={chartType:"radialBar",miniChart:xh},hh=class extends _z{constructor(G,D,z,B){super(G,D,"radarLineTooltip");this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;let{size:Q,padding:J,root:U,data:Z}=this,S=(Q-J*2)/2,X=0,{paths:Y,markers:W}=K9(D,U,Z,Q,S,X,this.markerSize);this.lines=Y,this.markers=W,this.updateColors(z,B)}updateColors(G,D){this.lines.forEach((z,B)=>{let Q=this.data[B].length;z.stroke=G[B];let J=B*Q,U=J+Q,Z=this.markers.slice(J,U);for(let S of Z)S.stroke=D[B],S.fill=G[B]})}},ih={chartType:"radarLine",miniChart:hh},nh=class extends _z{constructor(G,D,z,B){super(G,D,"radarAreaTooltip");this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]];let{size:Q,padding:J,root:U,data:Z}=this;this.showRadiusAxisLine=!1;let S=(Q-J*2)/2,X=S-Q*0.3;this.areas=K9(D,U,Z,Q,S,X).paths,this.updateColors(z,B)}updateColors(G,D){this.areas.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]})}},dh={chartType:"radarArea",miniChart:nh},lh=class extends _z{constructor(G,D,z,B){super(G,D,"nightingaleTooltip");this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;let{size:Q,padding:J,data:U,agChartsExports:{_Scene:Z}}=this,S=(Q-J*2)/2,X=new Z.CategoryScale;X.domain=U[0].map((k,w)=>w),X.range=[-Math.PI,Math.PI],X.paddingInner=0,X.paddingOuter=0;let Y=X.bandwidth*0.7,{processedData:W,max:q}=eB(U),H=new Z.LinearScale;H.domain=[0,q],H.range=[0,S];let _=Q/2;this.series=W.map((k,w)=>{let K=w<0?void 0:W[w-1],f=new Z.Group({zIndex:1e6}),N=k.map((F,E)=>{let I=K?.[E],V=H.convert(F),A=H.convert(I??0),R=X.convert(E),O=R+Y,u=new Z.Sector;return u.centerX=_,u.centerY=_,u.innerRadius=A,u.outerRadius=V,u.startAngle=R,u.endAngle=O,u.stroke=void 0,u.strokeWidth=0,u});return f.append(N),f}),this.root.append(this.series),this.updateColors(z,B)}updateColors(G,D){this.series.forEach((z,B)=>{for(let Q of z.children())Q.fill=G[B%G.length],Q.stroke=D[B%D.length]})}},ph={chartType:"nightingale",miniChart:lh},mh=class extends qG{constructor(G,D,z,B){super(G,D,"rangeBarTooltip");let Q=[3,3.5,3];this.bars=this.createRangeBar(this.root,Q,this.size,this.padding,"vertical"),this.updateColors(z,B)}updateColors(G,D){this.bars.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]})}createRangeBar(G,D,z,B,Q){let J=Q==="horizontal",U=2*B,{_Scene:Z}=this.agChartsExports,S=new Z.CategoryScale;S.domain=D.map((_,k)=>k),S.range=[B,z-B],S.paddingInner=0.3,S.paddingOuter=0.3;let X=0.7,Y=1.3,W=new Z.LinearScale;W.domain=[D.reduce((_,k)=>Math.min(_,k),1/0)*X,D.reduce((_,k)=>Math.max(_,k),0)*Y],W.range=[U,z-U];let q=S.bandwidth,H=D.map((_,k)=>{let[w,K]=[_*X,_*Y],f=S.convert(k),N=W.convert(w),F=W.convert(K)-N,E=new Z.Rect;return E.x=J?N:f,E.y=J?f:N,E.width=J?F:q,E.height=J?q:F,E.strokeWidth=0,E.crisp=!0,E});return G.append(H),H}},th={chartType:"rangeBar",miniChart:mh},sh=class extends qG{constructor(G,D,z,B){super(G,D,"rangeAreaTooltip");let Q=4,J=[u1({offset:0.375*Q,length:Q,pattern:{low:3,high:5,period:Q}}),u1({offset:0.375*Q,length:Q,pattern:{low:2.25,high:4.25,period:Q}}),u1({offset:0.75*Q,length:Q,pattern:{low:2.5,high:4.5,period:Q}})],U=1.75,Z=J.map((Y)=>Y.map(([W,q])=>({x:W,low:q-0.5*U,high:q+0.5*U}))),{lines:S,areas:X}=this.createRangeArea(this.root,Z,this.size,this.padding);this.lines=S,this.areas=X,this.updateColors(z,B)}updateColors(G,D){G=B6(G,1,2),D=B6(D,1,2),this.lines.forEach(([z,B],Q)=>{z.fill=void 0,z.stroke=D[Q],B.fill=void 0,B.stroke=D[Q]}),this.areas.forEach((z,B)=>{z.fill=G[B]})}createRangeArea(G,D,z,B){let Q=D.reduce((k,w)=>w.reduce((K,{x:f})=>Math.min(K,f),k),1/0),J=D.reduce((k,w)=>w.reduce((K,{x:f})=>Math.max(K,f),k),-1/0),U=D.reduce((k,w)=>w.reduce((K,{low:f})=>Math.min(K,f),k),1/0),Z=D.reduce((k,w)=>w.reduce((K,{high:f})=>Math.max(K,f),k),-1/0),{_Scene:S}=this.agChartsExports,X=new S.LinearScale;X.domain=[Q,J],X.range=[B,z-B];let Y=2*B,W=new S.LinearScale;W.domain=[U,Z],W.range=[z-Y,Y];let q=[],H=[];return D.map((k)=>{let w=new S.Path,K=new S.Path,f=new S.Path;return q.push([w,K]),H.push(f),w.strokeWidth=0,K.strokeWidth=0,f.strokeWidth=0,f.fillOpacity=0.8,w.path.clear(),K.path.clear(),f.path.clear(),k.map((N,F)=>{let{x:E,low:I,high:V}=N,A=X.convert(E),R=W.convert(I),O=W.convert(V),u=F>0?"lineTo":"moveTo";return w.path[u](A,O),K.path[u](A,R),f.path[u](A,O),[A,R]})}).forEach((k,w)=>{let K=k.length-1,f=H[w];for(let N=K;N>=0;N--){let[F,E]=k[N];f.path.lineTo(F,E)}}),G.append(H.concat(...q)),{lines:q,areas:H}}};function u1(G){let{offset:D,length:z,pattern:B}=G,Q=Z(D,z,B),J=0,U=z;if(Q.length===0||Q[0][0]!==0)Q.unshift(S(0,D,B));if(Q[Q.length-1][0]!==U)Q.push(S(U,D,B));return Q;function Z(Y,W,q){let{period:H}=q,_=Y/H,w=[0,0.5].map((f)=>f-_).map(z6).sort((f,N)=>f-N);return Array.from({length:Math.floor(w.length*(H/W))},(f,N)=>w[N%w.length]+Math.floor(N/w.length)).map((f)=>f*H).map((f)=>S(f,Y,q))}function S(Y,W,q){return[Y,X(W+Y,q)]}function X(Y,W){let{low:q,high:H,period:_}=W,k=z6(Y/_),w=k>0.5?1-2*(k-0.5):2*k;return q+(H-q)*w}}function z6(G){let D=G%1;return D<0?D+1:D}function B6(G,D,z){let B=[...G],Q=B[D];return B[D]=B[z],B[z]=Q,B}var oh={chartType:"rangeArea",miniChart:sh},rh=class extends qG{constructor(G,D,z,B,Q){super(G,D,"boxPlotTooltip");let{size:J,padding:U,agChartsExports:{_Scene:Z}}=this,S=[11,11.5,10.5],X=1.2,Y=1.1,W=0.9,q=0.8,H=new Z.LinearScale;H.domain=[S.reduce((K,f)=>Math.min(K,f),1/0)*q,S.reduce((K,f)=>Math.max(K,f),0)*X],H.range=[J-1.5*U,U];let _=new Z.CategoryScale;_.domain=S.map((K,f)=>f),_.range=[U,J-U],_.paddingInner=0.4,_.paddingOuter=0.2;let k=Math.round(_.bandwidth),w=Math.round(_.bandwidth/2);this.boxPlotGroups=S.map((K,f)=>{let[N,F,E,I]=[K*q,K*W,K*Y,K*X],V=Math.round(H.convert(E)),A=Math.round(_.convert(f)),R=Math.round(A+k),O=Math.round(H.convert(F)),u=Math.round(H.convert(N)),v=Math.round(H.convert(K)),h=Math.round(H.convert(I)),P=A+w,b=new Z.Group,g=new Z.Rect,c=new Z.Line,s=new Z.Line,m=new Z.Line,zG=new Z.Line,fG=new Z.Line;return g.x=A,g.y=V,g.width=k,g.height=O-V,g.strokeWidth=1,g.strokeOpacity=0.75,g.crisp=!0,this.setLineProperties(c,A,R,v,v),this.setLineProperties(s,P,P,h,V),this.setLineProperties(m,P,P,u,O),this.setLineProperties(zG,A,R,h,h),this.setLineProperties(fG,A,R,u,u),b.append([g,c,s,m,zG,fG]),b}),this.updateColors(z,B,Q),this.root.append(this.boxPlotGroups)}updateColors(G,D,z){let{_Theme:B}=this.agChartsExports;this.boxPlotGroups.forEach((Q,J)=>{for(let U of Q.children()){let Z=G[J%G.length];U.fill=z?Z:B.resolveOperation({$mix:[Z,{$ref:"backgroundColor"},0.7]}),U.stroke=D[J%D.length]}})}setLineProperties(G,D,z,B,Q){G.x1=D,G.x2=z,G.y1=B,G.y2=Q,G.strokeOpacity=0.75}},ah={chartType:"boxPlot",miniChart:rh},eh=class extends PD{constructor(G,D,z,B,Q){super(G,D,"treemapTooltip");let{size:J,padding:U,agChartsExports:{_Scene:Z}}=this,S=[[1,1],[3,2,1]],Y=S.length%2===0?0.3:0.2,W=[U,J-U],q=S.length,H=q*(q+1)/2,_=Y/(q-1),k=W[1]-W[0],w=k-Y,K=W[0];this.rects=S.reduce((N,F,E)=>{N??(N=[]);let I=(q-E)/H,V=w*I,A=F.length,R=F.reduce((P,b)=>P+b,0),O=Y/(A-1||1),u=A>1?k-Y:k,v=W[0],h=F.map((P)=>{let b=new Z.Rect,g=u*P/R;return b.x=K,b.y=v,b.width=V,b.height=g,b.strokeWidth=0.75,b.crisp=!0,v+=g+O,b});return K+=V+_,N.push(...h),N},[]),this.updateColors(z,B,Q);let f=new Z.Group;f.setClipRect(new Z.BBox(U,U,J-U,J-U)),f.append(this.rects),this.root.append(f)}updateColors(G,D,z){let{_Theme:B}=this.agChartsExports;this.rects.forEach((Q,J)=>{Q.fill=G[J%D.length],Q.stroke=z?D[J%D.length]:B.resolveOperation({$ref:"backgroundColor"})})}},Gi={chartType:"treemap",miniChart:eh},Di=class extends _z{constructor(G,D,z,B){super(G,D,"sunburstTooltip");this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;let{data:Q,size:J,padding:U,angleOffset:Z,innerRadiusRatio:S,agChartsExports:{_Scene:X}}=this,Y=(J-U*2)/2,W=[Z+0,Z+2*Math.PI],q=Math.abs(W[1]-W[0]),H=[Y*S,Y],_=Math.abs(H[1]-H[0]),k=0,w=(E,I)=>{for(let V of E){let A=I+1;k=Math.max(k,A),w(V,A)}};w(Q,0);let K=_/k,f=this.size/2,N=W[0];this.series=[];let F=(E,I,V,A,R)=>{if(!Array.isArray(E))return;let u=I+1,v=V;E.forEach((h,P,b)=>{let g=R;if(!g)g=new X.Group,this.series.push(g);let c=H[0]+I*K,s=H[0]+u*K,m=1/b.length,zG=v,fG=zG+A*m,y=new X.Sector;y.centerX=f,y.centerY=f,y.innerRadius=c,y.outerRadius=s,y.startAngle=zG,y.endAngle=fG,y.stroke=void 0,y.strokeWidth=0,y.inset=0.75,v=fG,g.append(y),F(h,u,zG,Math.abs(fG-zG),g)})};F(Q,0,N,q),this.root.append(this.series),this.updateColors(z,B)}updateColors(G,D){this.series.forEach((z,B)=>{for(let Q of z.children())Q.fill=G[B%G.length],Q.stroke=D[B%D.length]})}},zi={chartType:"sunburst",miniChart:Di},Bi=class extends PD{constructor(G,D,z,B,Q){super(G,D,"heatmapTooltip");let{size:J,padding:U,agChartsExports:{_Scene:Z}}=this,S=3,X=Array.from({length:S},(w,K)=>Array.from({length:S},(f,N)=>N)),Y=X.map((w,K)=>K),W=new Z.CategoryScale;W.domain=Y,W.range=[U,J-U],W.paddingInner=0.01,W.paddingOuter=0.1;let q=new Z.CategoryScale;q.domain=Y,q.range=[U,J-U],q.paddingInner=0.01,q.paddingOuter=0.1;let H=W.bandwidth??0,_=q.bandwidth??0;this.rects=X.reduce((w,K,f)=>{w??(w=[]);let N=K.map((F,E)=>{let I=new Z.Rect;return I.x=W.convert(f),I.y=q.convert(E),I.width=H,I.height=_,I.strokeWidth=0,I.crisp=!0,I});return w.push(...N),w},[]),this.updateColors(z,B,Q);let k=new Z.Group;k.setClipRect(new Z.BBox(U,U,J-U,J-U)),k.append(this.rects),this.root.append(k)}updateColors(G,D,z){let{_Theme:B,_Util:Q}=this.agChartsExports,J=z?[G[0],G[1]]:B.resolveOperation({$palette:"divergingColors"}),U=z?D[0]:B.resolveOperation({$ref:"backgroundColor"}),Z=Q.interpolateColor(J[0],J[1]);this.rects.forEach((S,X)=>{S.fill=Z(X*0.2),S.stroke=U})}},Qi={chartType:"heatmap",miniChart:Bi},Ji=class extends qG{constructor(G,D,z,B,Q){super(G,D,"waterfallTooltip");this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(z,B,Q)}updateColors(G,D,z){let{data:B,agChartsExports:{_Theme:Q}}=this,J={fill:z?G[0]:Q.resolveOperation({$palette:"altUp.fill"}),stroke:z?D[0]:Q.resolveOperation({$palette:"altUp.stroke"})},U={fill:z?G[1]:Q.resolveOperation({$palette:"altDown.fill"}),stroke:z?D[1]:Q.resolveOperation({$palette:"altDown.stroke"})};this.bars.forEach((Z,S)=>{let X=B[S]>=0;Z.fill=X?J.fill:U.fill,Z.stroke=X?J.stroke:U.stroke})}createWaterfall(G,D,z,B,Q){let J=2*B,{processedData:U,min:Z,max:S}=eB(D.map((N)=>[N])),X=U.reduce((N,F)=>N.concat(F),[]),{_Scene:Y}=this.agChartsExports,W=new Y.LinearScale;W.domain=[Math.min(Z,0),S],W.range=[z-J,J];let q=new Y.CategoryScale;q.domain=D.map((N,F)=>F),q.range=[B,z-B],q.paddingInner=0.2,q.paddingOuter=0.3;let H=q.bandwidth,_=new Y.Path;_.stroke="#575757",_.strokeWidth=0;let k=Math.floor(_.strokeWidth)%2/2,w=_.path;w.clear();let K=Q==="horizontal",f=X.map((N,F)=>{let E=F>0?X[F-1]:0,V=D[F]>0,A=Math.round(W.convert(N)),R=Math.round(W.convert(E)),O=(V?A:R)-k,u=(V?R:A)+k,v=Math.abs(u-O),h=q.convert(F),P=new Y.Rect;P.x=K?O:h,P.y=K?h:O,P.width=K?v:H,P.height=K?H:v,P.strokeWidth=0,P.crisp=!0;let b=A+k,g=R+k;if(F>0){let m=K?g:P.x,zG=K?P.y:g;w.lineTo(m,zG)}let c=K?b:P.x,s=K?P.y:b;return w.moveTo(c,s),P});return G.append([_,...f]),{bars:f}}},Ui={chartType:"waterfall",miniChart:Ji},Zi=class extends qG{constructor(G,D,z,B){super(G,D,"columnLineComboTooltip");this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];let{root:Q,columnData:J,lineData:U,size:Z,padding:S}=this;this.columns=k0({stacked:!1,root:Q,data:J,size:Z,padding:S,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:0.5,agChartsExports:D}),Q.append(this.columns),this.lines=tJ(D,Q,U,Z,S),this.updateColors(z,B)}updateColors(G,D){this.columns.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]}),this.lines.forEach((z,B)=>{z.stroke=G[B+2]})}},$i={chartType:"columnLineCombo",miniChart:Zi},Li=class extends qG{constructor(G,D,z,B){super(G,D,"areaColumnComboTooltip");this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];let{root:Q,columnData:J,areaData:U,size:Z,padding:S,agChartsExports:{_Scene:X}}=this;this.columns=k0({stacked:!1,root:Q,data:J,size:Z,padding:S,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:0.5,agChartsExports:D});let Y=new X.CategoryScale;Y.range=[S,Z-S],Y.domain=[0,1,2,3,4],Y.paddingInner=1,Y.paddingOuter=0;let W=new X.LinearScale;W.range=[Z-S,S],W.domain=[0,6];let q=[],H=W.convert(0),_=Y.convert(0);U.forEach((K,f)=>{let N=q[f]||(q[f]=[]);K.forEach((E,I)=>{let V=E,A=I,R=Y.convert(A),O=W.convert(V);N[I]={x:R,y:O}});let F=Y.convert(K.length-1);q[f].push({x:F,y:H},{x:_,y:H})}),this.areas=q.map((K)=>{let f=new X.Path;f.strokeWidth=0,f.fillOpacity=0.8;let N=f.path;return K.forEach((F,E)=>N[E>0?"lineTo":"moveTo"](F.x,F.y)),f});let k=new X.Group;k.setClipRect(new X.BBox(S,S,Z-S*2,Z-S*2));let w=new X.Group;w.setClipRect(new X.BBox(S,S,Z-S*2,Z-S*2)),k.append(this.areas),w.append(this.columns),Q.append(k),Q.append(w),this.updateColors(z,B)}updateColors(G,D){this.areas.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]}),this.columns.forEach((z,B)=>{z.fill=G[B+1],z.stroke=D[B+1]})}},Si={chartType:"areaColumnCombo",miniChart:Li},Xi=class extends PD{constructor(G,D,z,B){super(G,D,"customComboTooltip");this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];let{root:Q,columnData:J,lineData:U,size:Z,padding:S,agChartsExports:{_Scene:X}}=this;this.columns=k0({stacked:!1,root:Q,data:J,size:Z,padding:S,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:0.5,agChartsExports:D}),Q.append(this.columns),this.lines=tJ(this.agChartsExports,Q,U,Z,S);let Y="grey",W=3,q=new X.Line;q.x1=S,q.y1=S,q.x2=S,q.y2=Z-S+W,q.stroke=Y;let H=new X.Line;H.x1=S-W+1,H.y1=Z-S,H.x2=Z-S+1,H.y2=Z-S,H.stroke=Y;let _=new X.Path;this.buildPenIconPath(_),_.fill="whitesmoke",_.stroke="darkslategrey",_.strokeWidth=1,Q.append([H,q,_]),this.updateColors(z,B)}updateColors(G,D){this.columns.forEach((z,B)=>{z.fill=G[B],z.stroke=D[B]}),this.lines.forEach((z,B)=>{z.stroke=G[B+2]})}buildPenIconPath(G){let{path:D}=G;D.moveTo(25.76,43.46),D.lineTo(31.27,48.53),D.moveTo(49.86,22),D.lineTo(49.86,22),D.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),D.lineTo(46.86,21.41),D.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),D.lineTo(25.51,43.8),D.lineTo(25.43,43.89),D.lineTo(23.01,51.89),D.lineTo(22.83,52.46),D.lineTo(31.02,48.86),D.lineTo(49.02,28.52),D.lineTo(49.02,28.52),D.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),D.lineTo(50.75,24.93),D.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),D.closePath(),D.moveTo(41.76,25.5),D.lineTo(47.34,30.5),D.moveTo(40.74,26.65),D.lineTo(46.25,31.71)}},Yi={chartType:"customCombo",miniChart:Xi},Q6={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:Bh},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Uh},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Lh}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:Xh},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:qh},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:kh}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:Kh},donut:{range:!0,pivot:!0,enterprise:!1,icon:D6},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:D6}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:fh},stackedLine:{range:!0,pivot:!0,enterprise:!1,icon:Fh},normalizedLine:{range:!0,pivot:!0,enterprise:!1,icon:Mh}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:Rh},bubble:{range:!0,pivot:!0,enterprise:!1,icon:Vh}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:bh},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:vh},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:jh}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:ih},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:dh},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:ph},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:yh},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:ch}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:ah},histogram:{range:!0,pivot:!1,enterprise:!1,icon:gh},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:th},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:oh}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:Gi},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:zi}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:Qi},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:Ui}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:$i},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:Si},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:Yi}},funnelGroup:{funnel:{range:!0,pivot:!1,enterprise:!0,icon:sc},coneFunnel:{range:!0,pivot:!1,enterprise:!0,icon:ac},pyramid:{range:!0,pivot:!1,enterprise:!0,icon:Dh}}},Wi={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line","stackedLine","normalizedLine"],areaGroup:["area","stackedArea","normalizedArea"],scatterGroup:["scatter","bubble"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],funnelGroup:["funnel","coneFunnel","pyramid"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},qi=class extends gc{constructor(G,D,z,B,Q=Wi){super('
');this.wrappers=new Map,this.chartController=G,this.fills=D,this.strokes=z,this.isCustomTheme=B,this.chartGroups={...Q}}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){if(!this.chartController.customComboExists()&&this.chartGroups.combinationGroup)this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter((J)=>J!=="customCombo");let G=this.getGui(),D=this.chartController.isEnterprise(),z=this.chartController.isPivotChart(),B=!z,Q=Object.keys(this.chartGroups).map((J)=>{let U=J in Q6?Q6[J]:void 0;if(!U)return G6(148,{group:J}),null;let S=(this.chartGroups[J]??[]).map((X)=>{let Y=X in U?U[X]:void 0;if(!Y)return G6(149,{group:J,chartType:X}),null;if(!D&&Y.enterprise)return null;if(B&&Y.range)return Y;if(z&&Y.pivot)return Y;return null}).filter((X)=>X!=null);if(S.length===0)return null;return{label:this.chartTranslation.translate(J),items:S}}).filter((J)=>J!=null);for(let{label:J,items:U}of Q){let Z=this.createBean(new jG({title:J,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal",suppressKeyboardNavigation:!0}));for(let S of U){let{miniChart:X,chartType:Y}=S.icon,W=document.createElement("div");W.classList.add("ag-chart-mini-thumbnail"),W.setAttribute("tabindex","0"),W.setAttribute("role","button");let q=Y,H=()=>{this.chartController.setChartType(q),this.updateSelectedMiniChart()};this.addManagedListeners(W,{click:H,keydown:(_)=>{if(_.key==e5.ENTER||_.key===e5.SPACE)_.preventDefault(),H()}}),this.wrappers.set(q,W),this.createBean(new X(W,this.beans.agChartsExports,this.fills,this.strokes,this.isCustomTheme)),Z.addItem(W)}G.appendChild(Z.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){let G=this.chartController.getChartType();this.wrappers.forEach((D,z)=>{let B=z===G;D.classList.toggle("ag-selected",B);let Q=this.chartTranslation.translate(hJ(z)),J=B?`${Q}. ${this.chartTranslation.translate("ariaChartSelected")}`:Q;Tc(D,J)})}destroy(){this.wrappers.clear(),super.destroy()}},Hi=class extends Oc{constructor(G){super(`
+
+
+
+ +
+
+
+ +
+
+
`);this.chartController=G,this.eMiniChartsContainer=oz,this.eNavBar=oz,this.eCardSelector=oz,this.ePrevBtn=oz,this.eNextBtn=oz,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes();let G=this.gos.get("enableRtl");this.ePrevBtn.insertAdjacentElement("afterbegin",r5(G?"chartsThemeNext":"chartsThemePrevious",this.beans)),this.eNextBtn.insertAdjacentElement("afterbegin",r5(G?"chartsThemePrevious":"chartsThemeNext",this.beans)),this.addManagedElementListeners(this.ePrevBtn,{click:()=>this.setActivePalette(this.getPrev(),"left")}),this.addManagedElementListeners(this.eNextBtn,{click:()=>this.setActivePalette(this.getNext(),"right")});let D=()=>this.resetPalettes(!0);this.addManagedListeners(this.chartController,{chartTypeChanged:D,chartApiUpdate:D}),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{let G=(B)=>{return!B.getGui().classList.contains("ag-hidden")},z=this.miniChartsContainers.find(G).getGui().querySelector(".ag-selected");if(z){let B=z.offsetParent;if(B)this.eMiniChartsContainer.scrollTo(0,B.offsetTop)}},250)}resetPalettes(G){let D=this.chartController.getPalettes(),z=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(uc(D,this.palettes)&&!G||this.isAnimating)return;this.palettes=D,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex((Q)=>Q===this.chartController.getChartThemeName()),this.cardItems=[],o5(this.eCardSelector),this.destroyMiniCharts();let{themes:B}=this;this.palettes.forEach((Q,J)=>{let U=this.activePaletteIndex===J,{fills:Z=[],strokes:S=[]}=Q,X=B[J],Y=!iJ(X,this.beans.agChartsExports._Theme),W=this.createBean(new qi(this.chartController,Z,S,Y,z));if(this.miniChartsContainers.push(W),this.eMiniChartsContainer.appendChild(W.getGui()),this.addCardLink(J),U)W.updateSelectedMiniChart();else W.setDisplayed(!1)}),Pc(this.eNavBar,this.palettes.length>1),a5(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(G){let D=document.createElement("div");D.classList.add("ag-chart-settings-card-item"),this.addManagedElementListeners(D,{click:()=>{this.setActivePalette(G,G=this.palettes.length)G=0;return G}setActivePalette(G,D){if(this.isAnimating||this.activePaletteIndex===G)return;a5(this.cardItems[G],"ag-selected","ag-not-selected");let z=this.miniChartsContainers[this.activePaletteIndex],B=z.getGui(),Q=this.miniChartsContainers[G],J=Q.getGui();z.updateSelectedMiniChart(),Q.updateSelectedMiniChart();let U=D==="left"?-1:1,Z=J.style.left=`${jc(this.getGui())*U}px`;this.activePaletteIndex=G,this.isAnimating=!0;let S="ag-animating";Q.setDisplayed(!0),z.addCss(S),Q.addCss(S),this.chartController.setChartThemeName(this.themes[G]),window.setTimeout(()=>{B.style.left=`${-parseFloat(Z)}px`,J.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,z.removeCss(S),Q.removeCss(S),z.setDisplayed(!1)},300)}destroyMiniCharts(){o5(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}},_i="data",ki="format",wi=class extends Fy{constructor(G,D){super();this.panels=G,this.chartMenuContext=D,this.tabs=[]}wireBeans(G){this.chartTranslation=G.chartTranslation}postConstruct(){for(let G of this.panels){let D=G.replace("chart","").toLowerCase(),z=this.createPanel(D),B=this.createTab(G,D,z);this.tabs.push(B),this.addDestroyFunc(()=>this.destroyBean(z))}this.tabbedLayout=new YJ({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!0,closeButtonAriaLabel:this.chartTranslation.translate("ariaChartMenuClose"),onCloseClicked:()=>{this.eventSource?.focus({preventScroll:!0}),this.dispatchLocalEvent({type:"closed"})}}),this.createBean(this.tabbedLayout)}createTab(G,D,z){let B=d5({tag:"div",cls:`ag-chart-tab ag-chart-${D}`});this.createBean(z),B.appendChild(z.getGui());let Q=this.chartTranslation.translate(D);return{title:d5({tag:"div",children:Q}),titleLabel:Q,bodyPromise:Ny.resolve(B),getScrollableContainer:()=>{return B.querySelector(".ag-scrollable-container")||B},name:G}}showTab(G){let D=this.tabs[G];this.tabbedLayout.showItem(D)}getGui(){return this.tabbedLayout?.getGui()}showMenu(G,D){if(this.eventSource=G,!D)this.tabbedLayout?.focusHeader(!0)}destroy(){if(this.parentComponent?.isAlive())this.destroyBean(this.parentComponent);super.destroy()}createPanel(G){switch(G){case _i:return new Bx(this.chartMenuContext);case ki:return new vc(this.chartMenuContext);default:return new Hi(this.chartMenuContext.chartController)}}},Ki=class extends Wy{constructor(G,D,z){super('
');this.eChartContainer=G,this.eMenuPanelContainer=D,this.chartMenuContext=z,this.buttons={chartLink:{iconName:"linked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"chartsDownload",callback:()=>this.chartMenuSvc.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"chartsMenu",callback:(B)=>this.showMenuList(B)}},this.panels=[],this.menuVisible=!1,this.chartController=z.chartController}wireBeans(G){this.chartMenuSvc=G.chartMenuSvc,this.chartMenuListFactory=G.chartMenuListFactory}postConstruct(){this.chartToolbar=this.createManagedBean(new fy),this.getGui().appendChild(this.chartToolbar.getGui()),this.refreshToolbarAndPanels(),this.addManagedEventListeners({chartCreated:(G)=>{if(G.chartId===this.chartController.getChartId()){if(Boolean(this.gos.get("chartToolPanelsDef")?.defaultToolPanel))this.showMenu({panel:this.defaultPanel,suppressFocus:!0})}}}),this.addManagedListeners(this.chartController,{chartLinkedChanged:this.refreshToolbarAndPanels.bind(this)}),this.refreshMenuClasses(),this.addManagedListeners(this.chartController,{chartApiUpdate:this.refreshToolbarAndPanels.bind(this)})}isVisible(){return this.menuVisible}getExtraPaddingDirections(){return["chartMenu","chartLink","chartUnlink","chartDownload"].some((G)=>this.chartToolbarOptions.includes(G))?["top"]:[]}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){let{panels:G,defaultPanel:D}=this.chartMenuSvc.getChartToolPanels(this.chartController);this.panels=G,this.defaultPanel=D,this.chartToolbarOptions=this.chartMenuSvc.getChartToolbarOptions()}updateToolbar(){let G=this.chartToolbarOptions.map((D)=>{let{iconName:z,callback:B}=this.buttons[D];return{buttonName:D,iconName:z,callback:B}});this.chartToolbar.updateParams({buttons:G})}createMenuPanel(G){let D=this.menuPanel=this.createBean(new LJ({height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return D.setParentComponent(this),this.eMenuPanelContainer.appendChild(D.getGui()),this.tabbedMenu=this.createBean(new wi(this.panels,this.chartMenuContext)),this.addManagedListeners(this.tabbedMenu,{closed:()=>{this.hideMenu()}}),this.addManagedListeners(D,{destroyed:()=>this.destroyBean(this.tabbedMenu)}),new Yy((z)=>{window.setTimeout(()=>{D.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(G),z(D)},100)})}showContainer(G,D){if(!this.menuPanel)return;this.menuVisible=!0,this.refreshMenuClasses(),this.tabbedMenu.showMenu(G,D)}showMenu(G){let{panel:D,eventSource:z,suppressFocus:B}=G??{};if(this.menuPanel&&!D)this.showContainer(z,B);else{let Q=D||this.defaultPanel,J=this.panels.indexOf(Q);if(J<0)qy(143,{panel:D}),J=this.panels.indexOf(this.defaultPanel);if(this.menuPanel)this.tabbedMenu.showTab(J),this.showContainer(z,B);else this.createMenuPanel(J).then(()=>this.showContainer(z,B))}}hideMenu(){this.menuVisible=!1,this.refreshMenuClasses()}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible)}showMenuList(G){this.chartMenuListFactory.showMenuList({eventSource:G,showMenu:()=>this.showMenu({eventSource:G}),chartMenuContext:this.chartMenuContext,closeOnElementClick:this.eChartContainer})}destroy(){if(super.destroy(),this.menuPanel?.isAlive())this.destroyBean(this.menuPanel);if(this.tabbedMenu?.isAlive())this.destroyBean(this.tabbedMenu)}},C9=["number","category","time","grouped-category"],Fi=["angle-category","angle-number","radius-category","radius-number"],Ei=[...C9,...Fi],Ii=class extends fi{constructor(G){super();this.chartController=G}getChartThemeOverridesProxy(){return{getValue:(G)=>this.getChartOption(G),setValue:(G,D)=>this.setChartThemeOverrides([{expression:G,value:D}]),setValues:(G)=>this.setChartThemeOverrides(G)}}getAxisThemeOverridesProxy(){return{getValue:(G)=>this.getAxisProperty(G),setValue:(G,D)=>this.setAxisThemeOverrides([{expression:G,value:D}]),setValues:(G)=>this.setAxisThemeOverrides(G)}}getCartesianAxisOptionsProxy(G){return{getValue:(D)=>this.getCartesianAxisProperty(G,D),setValue:(D,z)=>this.setCartesianAxisOptions(G,[{expression:D,value:z}]),setValues:(D)=>this.setCartesianAxisOptions(G,D),clearValue:(D,z)=>this.clearCartesianAxisOptions(G,D,z)}}getCartesianAxisThemeOverridesProxy(G){return{getValue:(D)=>this.getCartesianAxisProperty(G,D),setValue:(D,z)=>this.setCartesianAxisThemeOverrides(G,[{expression:D,value:z}]),setValues:(D)=>this.setCartesianAxisThemeOverrides(G,D)}}getCartesianAxisAppliedThemeOverridesProxy(G){return{getValue:(D)=>this.getCartesianAxisThemeOverride(G,D==="*"?null:D),setValue:(D,z)=>this.setCartesianAxisThemeOverrides(G,[{expression:D==="*"?null:D,value:z}]),setValues:(D)=>this.setCartesianAxisThemeOverrides(G,D)}}getSeriesOptionsProxy(G){return{getValue:(D,z)=>this.getSeriesOption(G(),D,z),setValue:(D,z)=>this.setSeriesOptions(G(),[{expression:D,value:z}]),setValues:(D)=>this.setSeriesOptions(G(),D)}}getPersistedChartThemeOverrides(G,D,z,B){let Q=this.getRetainedChartThemeOverrideKeys(z,B),J=this.getRetainedChartAxisThemeOverrideKeys(null,z,B),U=this.createChartOptions();for(let Z of Q){let S=this.retrieveChartOptionsThemeOverride(G,z,Z);if(S!==void 0)this.assignChartOptionsThemeOverride(U,B,Z,S)}if(D)this.assignPersistedAxisOverrides({existingAxes:D,retainedChartAxisThemeOverrideKeys:J,existingChartOptions:G,targetChartOptions:U,existingChartType:z,targetChartType:B});return U.theme.overrides}assignPersistedAxisOverrides(G){let{existingAxes:D,retainedChartAxisThemeOverrideKeys:z,existingChartOptions:B,targetChartOptions:Q,existingChartType:J,targetChartType:U}=G;for(let{expression:Z,targetAxisTypes:S}of z)for(let X of D.map((Y)=>Y.type)){let Y=this.retrieveChartOptionsThemeOverride(B,J,["axes",X,Z].join("."));if(Y!==void 0)for(let W of S)this.assignChartOptionsThemeOverride(Q,U,["axes",W,Z].join("."),Y)}}getRetainedChartThemeOverrideKeys(G,D){let z=["animation"],B=["zoom","navigator"],Q=((J,U)=>{let Z=[];if(SD(l(J))&&SD(l(U)))Z.push(...B);return Z})(G,D);return[...z,...Q]}getRetainedChartAxisThemeOverrideKeys(G,D,z){if(SD(l(D))&&SD(l(z)))return this.getRetainedCartesianAxisThemeOverrideKeys(G).map((Q)=>({expression:Q,targetAxisTypes:C9}));return[]}getRetainedCartesianAxisThemeOverrideKeys(G){let D=G==="xAxis"?["",".top",".bottom"]:G==="yAxis"?["",".left",".right"]:["",".left",".right",".top",".bottom"],z=["crosshair"],B=[];for(let Q of z)for(let J of D)B.push(`${Q}${J}`);return B}getChartOption(G){return $D(this.getChart(),G,void 0)}setChartThemeOverrides(G){let D=this.getChartType(),z=this.createChartOptions();for(let{expression:B,value:Q}of G)this.assignChartOptionsThemeOverride(z,D,B,Q);this.applyChartOptions(z)}applyChartOptions(G,D){if(Object.keys(G).length===0)return;if(this.updateChart(G),!D?.silent)this.raiseChartOptionsChangedEvent()}awaitChartOptionUpdate(G){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>G()).catch((z)=>Ni(108,{e:z}))}getAxisProperty(G){return $D(this.getChart().axes?.x,G,void 0)}setAxisThemeOverrides(G){let D=this.getChart(),z=this.getChartType(),B=this.createChartOptions();for(let{expression:Q,value:J}of G){let U=Object.values(D.axes??{}).filter((Z)=>{let S=Q.split("."),X=Z;for(let Y of S){if(!(Y in X))return!1;X=X[Y]}return!0});if(!U)continue;for(let Z of U){if(!this.isValidAxisType(Z))continue;this.assignChartAxisThemeOverride(B,z,Z.type,null,Q,J)}}this.applyChartOptions(B)}getCartesianAxisProperty(G,D){let z=this.getChartAxes(),B=this.getCartesianAxis(z,G);return $D(B,D,void 0)}getCartesianAxisThemeOverride(G,D){let z=this.getChartAxes(),B=this.getCartesianAxis(z,G);if(!B||!this.isValidAxisType(B))return;let Q=this.getChartType(),J=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(J,Q,B.type,G==="yAxis"?["left","right"]:["bottom","top"],D)}setCartesianAxisThemeOverrides(G,D){let z=this.getChartAxes(),B=this.getCartesianAxis(z,G);if(!B||!this.isValidAxisType(B))return;let Q=this.getChartType(),J=this.createChartOptions();for(let{expression:U,value:Z}of D)this.assignChartAxisThemeOverride(J,Q,B.type,G==="yAxis"?["left","right"]:["bottom","top"],U,Z);this.applyChartOptions(J)}setCartesianAxisOptions(G,D){this.updateCartesianAxisOptions(G,(z)=>{let B=G==="yAxis"?"y":"x";for(let{expression:Q,value:J}of D)this.assignChartOption(z,`axes.${B}.${Q}`,J)})}clearCartesianAxisOptions(G,D,z){this.updateCartesianAxisOptions(G,(B)=>{let Q=G==="yAxis"?"y":"x";this.clearChartOption(B,`axes.${Q}.${D}`,z)})}updateCartesianAxisOptions(G,D){let z=this.getChart().getOptions(),B="axes"in z?z.axes:void 0;if(!z||!B)return;let Q=this.getChartAxes(),J=this.getCartesianAxis(Q,G);if(!J)return;let U=this.createChartOptions();U.axes=B,D(U,J,z),this.applyChartOptions(U)}setCartesianCategoryAxisType(G,D){this.updateCartesianAxisOptions(G,(z,B,Q)=>{let J=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[B],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(G,J,J),existingChartOptions:Q,targetChartOptions:z,existingChartType:J,targetChartType:J}),this.assignChartOption(z,"axes.x.type",D),this.chartController.setCategoryAxisType(D)})}getCartesianAxis(G,D){if(G.length<2)return;switch(D){case"xAxis":return G[0].direction==="x"?G[0]:G[1];case"yAxis":return G[1].direction==="y"?G[1]:G[0]}}getSeriesOption(G,D,z){let B=this.getChart().series.find((Q)=>Mi(G,Q));return $D(z?B:B?.properties.toJson(),D,void 0)}setSeriesOptions(G,D){let z=this.createChartOptions();for(let{expression:B,value:Q}of D)this.assignChartOptionsSeriesThemeOverride(z,G,`series.${B}`,Q);this.applyChartOptions(z)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(G){this.chartController.getChartProxy().setPaired(G)}getChartAxes(){let G=this.getChart();return Object.values(G.axes??{})}retrieveChartAxisThemeOverride(G,D,z,B,Q){if(B)for(let J of B){let U=this.retrieveChartOptionsThemeOverride(G,D,["axes",z,J,...Q?[Q]:[]].join("."));if(U===void 0)continue;return U}else return this.retrieveChartOptionsThemeOverride(G,D,["axes",z,...Q?[Q]:[]].join("."))}assignChartAxisThemeOverride(G,D,z,B,Q,J){if(B)for(let U of B)this.assignChartOptionsThemeOverride(G,D,["axes",z,U,...Q?[Q]:[]].join("."),J);else this.assignChartOptionsThemeOverride(G,D,["axes",z,...Q?[Q]:[]].join("."),J)}isValidAxisType(G){return Ei.includes(G.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(G){let D=this.chartController.getChartProxy().getChartRef();D.skipAnimations(),D.updateDelta(G)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(G,D,z){let B=this.getChartThemeOverridesSeriesTypeKeys(D);for(let Q of B){let J=this.retrieveChartOptionsSeriesThemeOverride(G,Q,z);if(J===void 0)continue;return J}return}assignChartOptionsThemeOverride(G,D,z,B){let Q=this.getChartThemeOverridesSeriesTypeKeys(D);for(let J of Q)this.assignChartOptionsSeriesThemeOverride(G,J,z,B)}retrieveChartOptionsSeriesThemeOverride(G,D,z){return this.retrieveChartOption(G,["theme","overrides",D,...z?[z]:[]].join("."))}assignChartOptionsSeriesThemeOverride(G,D,z,B){this.assignChartOption(G,["theme","overrides",D,...z?[z]:[]].join("."),B)}getChartThemeOverridesSeriesTypeKeys(G){let D=this.chartController.getChartSeriesTypes(G);if(this.chartController.isComboChart())D.push("common");return D}retrieveChartOption(G,D){return $D(G,D,void 0)}assignChartOption(G,D,z){iP(G,D,z)}clearChartOption(G,D,z){let B=$D(G,D,void 0);if(B)delete B[z]}raiseChartOptionsChangedEvent(){let G=this.chartController.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:G.chartId,chartType:G.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:G.chartOptions})}};function Mi(G,D){return pP(G)&&D.type===G}var Ai=class extends jT{constructor(G){super(` +
+
+
+
+
+
+
+
+
+ `);this.eChart=mz,this.eWrapper=mz,this.eChartContainer=mz,this.eMenuContainer=mz,this.eEmpty=mz,this.params=G}wireBeans(G){this.crossFilterService=G.chartCrossFilterSvc,this.chartTranslation=G.chartTranslation,this.chartMenuSvc=G.chartMenuSvc,this.focusSvc=G.focusSvc,this.popupSvc=G.popupSvc,this.enterpriseChartProxyFactory=G.enterpriseChartProxyFactory,this.environment=G.environment}postConstruct(){let G={...this.params,chartType:S0(this.params.chartType),chartThemeName:this.getThemeName()},D=this.gos.get("enableRtl");this.eWrapper.classList.add(D?"ag-rtl":"ag-ltr");let z=this.createBean(new yg(G));if(this.chartController=this.createManagedBean(new By(z)),this.chartOptionsService=this.createManagedBean(new Ii(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog)this.addDialog();else this.addManagedEventListeners({stylesChanged:this.updateTheme.bind(this)}),this.updateTheme();this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let G=void 0;if(this.chartProxy)G=this.chartProxy.destroy({keepChartInstance:!0});let D=(Q,J)=>{let U=this.params.crossFilteringContext;if(U.lastSelectedChartId=J?"":this.chartController.getChartId(),J)this.params.crossFilteringResetCallback();this.crossFilterService.filter(Q,J)},z=this.chartController.getChartType(),B={agChartsExports:this.beans.agChartsExports,chartType:z,chartInstance:G,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),styleNonce:this.gos.get("styleNonce"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>this.chartMenu?.getExtraPaddingDirections()??[],apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback:D,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:(Q)=>this.chartTranslation.translate(Q),context:PT(this.gos,{})};if(this.params.chartOptionsToRestore=void 0,this.chartType=z,this.chartProxy=this.createChartProxy(B),!this.chartProxy){h5(138,{chartType:B.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;let G=this.createManagedBean(new uD(this.chartOptionsService.getChartThemeOverridesProxy())),D=this.createManagedBean(new uD(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:G,chartAxisMenuParamsFactory:D}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}createChartProxy(G){let{chartType:D}=G;switch(D){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new Uy(G);case"pie":case"donut":case"doughnut":return new Xy(G);case"area":case"stackedArea":case"normalizedArea":return new Qy(G);case"line":case"stackedLine":case"normalizedLine":return new Zy(G);case"scatter":case"bubble":return new $y(G);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new Ly(G)}let z=this.enterpriseChartProxyFactory?.createChartProxy(G);if(!z)throw x5(251,{chartType:D});return z}addDialog(){let G=this.chartTranslation.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:D,height:z}=this.getBestDialogSize(),B=this.params.focusDialogOnOpen?()=>setTimeout(()=>yT(this.getGui())):void 0;this.chartDialog=new PB({resizable:!0,movable:!0,maximizable:!0,title:G,width:D,height:z,component:this,centered:!0,closable:!0,afterGuiAttached:B,postProcessPopupParams:{type:"chart"}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener("destroyed",()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();let Q=this.focusSvc.getFocusedCell();setTimeout(()=>{if(this.focusSvc.isAlive())if(Q)this.focusSvc.setFocusedCell({...Q,forceBrowserFocus:!0});else TT(this.beans)})})}getBestDialogSize(){let G=this.popupSvc.getPopupParent(),D=cT(G)*0.75,z=xT(G)*0.75,B=0.553,Q=this.chartProxy.getChart(),J=this.params.insideDialog?850:Q.width,U=this.params.insideDialog?470:Q.height;if(J>D||U>z){if(J=Math.min(J,D),U=Math.round(J*0.553),U>z)U=z,J=Math.min(J,Math.round(U/0.553))}return{width:J,height:U}}addMenu(){if(!this.params.crossFiltering)this.chartMenu=this.createBean(new Ki(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui())}update(G){if(G?.chartId){if(!this.chartController.update(G))return}let D=this.chartTypeChanged(G),z=D||this.chartEmpty?((Q)=>{let J=this.chartType,U=Q,Z=this.chartProxy.getChart(),S=Z?.getOptions(),X=Object.values(Z?.axes??{});return this.chartOptionsService.getPersistedChartThemeOverrides(S,X,J,U??J)})(D):void 0;if(D)this.createChart();if(z&&G?.chartThemeOverrides)hT(z,G.chartThemeOverrides);let B=z??G?.chartThemeOverrides;if(this.updateChart(B),G?.chartId)this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(G){let{chartProxy:D}=this,z=this.chartController.getSelectedValueColState(),B=this.chartController.getChartData(),Q=this.handleEmptyChart(B,z.length);if(this.chartEmpty=Q,Q){if(G)this.chartController.updateThemeOverrides(G);return}let J=this.chartController.getChartUpdateParams(G);D.update(J),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(G){let[D,z]=[this.chartController.getChartType(),G?.chartType],B=z?S0(z):void 0;if(this.chartType!==D)return B??D;if(B&&D!==B)return B;return null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(G){return this.chartProxy.getChartImageDataURL(G)}handleEmptyChart(G,D){let z=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),B=this.chartController.getChartType(),Q=1;if(this.chartController.isActiveXYChart())Q=B==="bubble"?3:2;else if(VD(l(B)))Q=0;let J=DB!=null))for(let B of Object.keys(z))D[B]=null;return Object.keys(D)}validateCustomThemes(){let G=this.getChartThemes(),D=this.gos.get("customChartThemes");if(D){for(let z of this.getAllKeysInObjects([D]))if(!G.includes(z))h5(139,{customThemeName:z})}}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);let G=this.getChartId(),D=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,z=this.gos.get("chartThemeOverrides")||{};this.update({type:`${D}ChartUpdate`,chartId:G,chartThemeOverrides:z})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:"chartCreated",chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:"chartDestroyed",chartId:this.chartController.getChartId()})}destroy(){if(super.destroy(),this.chartProxy)this.chartProxy.destroy();if(this.destroyBean(this.chartMenu),this.chartDialog?.isAlive())this.destroyBean(this.chartDialog);this.onDestroyColorSchemeChangeListener?.();let G=this.getGui();gT(G),iT(G),this.raiseChartDestroyedEvent()}},X0=!1;function Ci(G){let D=G.version;if(G.version==null)G.version=di(G);if(G=QG("23.0.0",G,Vi),G=QG("24.0.0",G,bi),G=QG("25.1.0",G,vi),G=QG("26.0.0",G,Oi),G=QG("26.1.0",G,ui),G=QG("26.2.0",G,ji),G=QG("28.0.0",G,Pi),G=QG("28.2.0",G,gi),G=QG("29.0.0",G,Ti),G=QG("29.1.0",G,V9),G=QG("29.2.0",G,b9),G=QG("30.0.0",G,yi),G=QG("31.0.0",G,xi),G=QG("32.0.0",G,ci),G=QG("33.0.0",G,hi),G=QG("34.0.0",G,ii),G=ni(G),G=QG(j,G,(z)=>z),X0&&D!==G.version)console.log("AG Grid: ChartModel migration complete",{model:G});return G}function Vi(G){return G=UG("chartOptions.legend.item.marker.type","shape",G),G=UG("chartOptions.seriesDefaults.marker.type","shape",G),G=UG("chartOptions.legend.padding","spacing",G),G}function bi(G){G=d("chartOptions.seriesDefaults.marker.minSize",G);let{chartType:D,chartPalette:z,chartOptions:{xAxis:B,yAxis:Q,...J},...U}=G,S=Dg(D)?.map((Y,W)=>({type:Y,...W===0?B:Q}));return{chartType:D,chartThemeName:{borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[z]??"ag-default",chartOptions:{...J,axes:S,xAxis:B,yAxis:Q},...U}}function vi(G){return G=UG("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",G),G}function Oi(G){return G=lG("chartOptions.seriesDefaults.highlightStyle",G,({dimOpacity:z,...B})=>({...B,...z!=null?{series:{dimOpacity:z}}:{}})),G=d("chart",G),G=d("chartOptions.seriesDefaults.tooltipClass",G),G=d("chartOptions.seriesDefaults.tooltipTracking",G),G=U6("chartOptions.axes[].label.rotation",0,G),G=U6("chartOptions.axes[].label.rotation",335,G),G}function ui(G){let D=({item:z,series:B,...Q})=>({item:{...Q,...z},...B?{series:B}:{}});return G=lG("chartOptions.seriesDefaults.highlightStyle",G,D),G=lG("chartOptions.series[].highlightStyle",G,D),G}function ji(G){G=_B("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",G),G=_B("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",G),G=_B("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",G),G=d("chartOptions.seriesDefaults.fill",G),G=d("chartOptions.seriesDefaults.stroke",G),G=d("chartOptions.seriesDefaults.callout.colors",G),G=d("chartOptions.xAxis",G),G=d("chartOptions.yAxis",G);let{chartType:D,chartOptions:{axes:z,series:B,seriesDefaults:Q,...J},...U}=G,Z=S0(D),S=l(Z),X=[S],Y={};if(!t8(S)){let q={top:{},bottom:{},left:{},right:{}},H=z.map(({type:_,...k})=>({[_]:{...q,...k}})).reduce($6,{});for(let _ of o8.filter((k)=>H[k]==null))H[_]={...q};Y.axes=H}let W=X.map((q)=>({[q]:{...Y,series:Q,...J}})).reduce($6,{});return G={...U,chartType:Z,chartOptions:W},G}function Pi(G){return G=d("chartOptions.*.title.padding",G),G=d("chartOptions.*.subtitle.padding",G),G=d("chartOptions.*.axes.*.title.padding",G),G=aJ("chartOptions.*.axes.*.title.enabled",!1,G),G}function gi(G){return G=UG("chartOptions.pie.series.callout","calloutLine",G),G=UG("chartOptions.pie.series.label","calloutLabel",G),G=UG("chartOptions.pie.series.labelKey","sectorLabelKey",G),G=UG("chartOptions.pie.series.labelName","sectorLabelName",G),G=UG("chartOptions.donut.series.callout","calloutLine",G),G=UG("chartOptions.donut.series.label","calloutLabel",G),G=UG("chartOptions.donut.series.labelKey","sectorLabelKey",G),G=UG("chartOptions.donut.series.labelName","sectorLabelName",G),G}function Ti(G){return G=rz("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",G),G=rz("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",G),G=rz("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",G),G=rz("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",G),G=rz("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",G),G=_B("chartOptions.scatter.series.paired","chartOptions.scatter.paired",G),G}function V9(G){return G=d("chartOptions.axes[].tick.count",G),G}function b9(G){return G=lG("chartOptions.*.tooltip",G,({tracking:z,...B})=>{let Q={...B};if(z===!1)Q.position??(Q.position={type:"pointer"}),Q.range??(Q.range="nearest");else if(z===!0)Q.position??(Q.position={type:"node"}),Q.range??(Q.range="nearest");return Q}),G}function yi(G){return G=UG("chartOptions.pie.series.labelKey","sectorLabelKey",G),G=UG("chartOptions.pie.series.labelName","sectorLabelName",G),G=V9(G),G=b9(G),G=d("chartOptions.*.series.flipXY",G),G=v9("chartOptions.common.legend.enabled",!0,G),G=aJ("chartOptions.common.legend.position","right",G),G}function xi(G){let D={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"},z=UG("chartOptions.column","bar",G),B=D[z.chartThemeName]||z.chartThemeName;return{...z,chartThemeName:B}}function ci(G){return G=EG("chartOptions.*.autoSize",!0,G,(D,z)=>{if(D[z]===!0);else if(D[z]===!1)D.minHeight=600,D.minWidth=300;delete D[z]}),G}function hi(G){return G=d("chartOptions.*.axes.category.label.format",G),G=d("chartOptions.*.axes.category.crosshair.label.format",G),G=d("chartOptions.*.axes.angle-category.label.format",G),G=d("chartOptions.*.axes.radius-category.label.format",G),G=UG("chartOptions.*.axes.*.label.padding","spacing",G),G=UG("chartOptions.*.navigator.miniChart.label.padding","spacing",G),G=d("chartOptions.*.axes.*.crossLines.label.className",G),G=EG("chartOptions.*.axes.*.crossLines.label.position",!0,G,(D,z)=>{if(typeof D[z]==="string")D[z]=D[z].replace(/([A-Z])/,"-$1").toLowerCase()}),G=d("chartOptions.bullet",G),G=Z6("chartOptions.bar.series.label.placement",G,{inside:"inside-center",outside:"inside-end"}),G=Z6("chartOptions.waterfall.series.item.*.label.placement",G,{inside:"inside-center",start:"outside-start",end:"outside-end"}),G=d("chartOptions.*.navigator.min",G),G=d("chartOptions.*.navigator.max",G),G=d("chartOptions.*.zoom.ratioX",G),G=d("chartOptions.*.zoom.ratioY",G),G=d("chartOptions.*.zoom.rangeX",G),G=d("chartOptions.*.zoom.rangeY",G),G}function ii(G){return EG("chartOptions.series[].highlightStyle",!0,G,(z,B)=>{let Q=z[B];if(Q==null)return;let J={};if(Q.item)J.highlightedItem=Q.item;if(Q.series){let{dimOpacity:U,...Z}=Q.series;if(U!=null)J.unhighlightedSeries={opacity:U};if(Object.keys(Z).length>0)J.highlightedSeries=Z}delete z[B],z.highlight=J}),G}function ni(G){return G=d("chartOptions.*.width",G),G=d("chartOptions.*.height",G),G=aJ("chartOptions.*.axes.category.label.autoRotate",!0,G),G}function di(G){let D=G;if(G.version!=null)return G.version;let z=(X,...Y)=>{return Object.keys(X||{}).some((W)=>Y.includes(W))},B=D.chartOptions,Q=z(B,"seriesDefaults")?B?.seriesDefaults:B?.[Object.keys(B)[0]],J={"27.0.0":z(D,"seriesChartTypes"),"26.2.0":!z(B,"seriesDefaults"),"26.1.0":z(Q?.highlightStyle,"item"),"26.0.0":z(Q?.highlightStyle,"series"),"25.1.0":z(Q?.label,"minAngle"),"25.0.0":z(D,"modelType","aggFunc","unlinkChart","suppressChartRanges")||z(Q,"lineDash","lineDashOffset"),"24.0.0":z(D,"chartThemeName","chart")||z(B,"series"),"23.2.0":z(B,"navigator"),"23.0.0":z(B?.legend?.item?.marker,"shape"),"22.1.0":z(D,"chartPalette","chartType")},U="27.1.0",Z=Object.entries(J).filter(([X,Y])=>Y);if(X0)console.log("AG Grid: ChartModel migration",{heuristicVersionCandidates:Z});let[S=U]=Z[0];if(X0)console.log("AG Grid: ChartModel migration",{heuristicVersion:S});return S}function QG(G,D,z){if(J6(G)>J6(D.version)){if(X0)console.log("AG Grid: ChartModel migration",{migratingTo:G});let B=z(D);if(B.version=G,X0)console.log("AG Grid: ChartModel migration",{migratedTo:G,result:B});return B}return D}function li(G){let D=G.includes("-beta")?G.replace(/-beta.*/,""):G,z=typeof D==="string"?D.split(".").map((B)=>Number(B)):[];if(z.length!==3||z.some((B)=>isNaN(B)))throw Error(Ri(253,{version:D}));return{major:z[0],minor:z[1],patch:z[2]}}function J6(G){let{major:D,minor:z,patch:B}=li(G);return D*1e4+z*100+B}function U6(G,D,z){return EG(G,!0,z,(B,Q)=>{if(B[Q]===D)delete B[Q]})}function aJ(G,D,z){return EG(G,!1,z,(B,Q)=>{if(B[Q]==null)B[Q]=D})}function v9(G,D,z){if(typeof G==="string")G=G.split(".");let B=G[0];if(G.length>1)z[B]=v9(G.slice(1),D,z[B]??{});if(!Object.keys(z).includes(B))z[B]=D;return z}function _B(G,D,z){let B=void 0,Q=!1;if(z=EG(G,!0,z,(J,U)=>{Q=!0,B=J[U],delete J[U]}),!Q)return z;return EG(D,!1,z,(J,U)=>{J[U]=B})}function rz(G,D,z){let B=void 0,Q=!1;if(z=EG(G,!0,z,(J,U)=>{Q=!0,B=J[U],delete J[U]}),!Q)return z;return EG(D,!1,z,(J,U)=>{if(J[U]===void 0)J[U]=B})}function UG(G,D,z){return EG(G,!0,z,(B,Q)=>{B[D]=B[Q],delete B[Q]})}function d(G,D){return EG(G,!0,D,(z,B)=>delete z[B])}function EG(G,D,z,B){let Q=G instanceof Array?G:G.split("."),J=Q.slice(0,Q.length-1),U=Q[Q.length-1];return lG(J,z,(Z)=>{let S=Object.keys(Z).includes(U);if(D&&!S)return Z;let X={...Z};return B(X,U),X})}function lG(G,D,z){let B=G instanceof Array?G:G.split(".");if(D={...D},B.length===0)return z(D);else if(B[0].startsWith("{")){let Q=B[0].substring(1,B[0].lastIndexOf("}")).split(",");for(let J of Q)if(D[J]!=null)D[J]=lG(B.slice(1),D[J],z)}else if(B[0].endsWith("[]")){let Q=B[0].substring(0,G[0].indexOf("["));if(D[Q]instanceof Array)D[Q]=D[Q].map((J)=>lG(B.slice(1),J,z))}else if(B[0]==="*")for(let Q of Object.keys(D))D[Q]=lG(B.slice(1),D[Q],z);else if(D[B[0]]!=null)D[B[0]]=lG(B.slice(1),D[B[0]],z);return D}function Z6(G,D,z){return EG(G,!0,D,(B,Q)=>{if(typeof B[Q]==="string")B[Q]=z[Q]??Q})}var $6=(G,D)=>({...G,...D}),pi=class extends OT{constructor(){super(...arguments);this.beanName="chartSvc",this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(G){this.visibleCols=G.visibleCols,this.rangeSvc=G.rangeSvc,this.agChartsExports=G.agChartsExports}updateChart(G){if(this.activeChartComps.size===0){zB(124);return}let D=[...this.activeChartComps].find((z)=>z.getChartId()===G.chartId);if(!D){zB(125,{chartId:G.chartId});return}D.update(G)}getChartModels(){let G=[],D=(z)=>{return{...z,version:j}};for(let z of this.activeChartComps)G.push(D(z.getChartModel()));return G}getChartRef(G){let D;for(let z of this.activeCharts)if(z.chartId===G)D=z;return D}getChartComp(G){let D;for(let z of this.activeChartComps)if(z.getChartId()===G)D=z;return D}getChartImageDataURL(G){let D;for(let z of this.activeChartComps)if(z.getChartId()===G.chartId)D=z.getChartImageDataURL(G.fileFormat);return D}downloadChart(G){Array.from(this.activeChartComps).find((z)=>z.getChartId()===G.chartId)?.downloadChart(G.dimensions,G.fileName,G.fileFormat)}openChartToolPanel(G){Array.from(this.activeChartComps).find((z)=>z.getChartId()===G.chartId)?.openChartToolPanel(G.panel)}closeChartToolPanel(G){Array.from(this.activeChartComps).find((z)=>z.getChartId()===G)?.closeChartToolPanel()}createChartFromCurrentRange(G="groupedColumn",D){let z=this.getSelectedRange();return this.createChart({cellRange:z,chartType:G,focusDialogOnOpen:!D})}restoreChart(G,D){if(!G){zB(126);return}if(G.version!==j)G=Ci(G);let z,B,Q,J;if(G.modelType==="pivot")this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),z=this.createCellRange(void 0,!0),B=!0,Q=!0;else z=this.createCellRange(G.cellRange),J=G.chartPalette,Q=G.suppressChartRanges;if(!z)return;return this.createChart({...G,cellRange:z,pivotChart:B,suppressChartRanges:Q,chartContainer:D,chartOptionsToRestore:G.chartOptions,chartPaletteToRestore:J})}createRangeChart(G,D){let z=this.createCellRange(G.cellRange);if(!z)return;return this.createChart({...G,cellRange:z,focusDialogOnOpen:!D})}createPivotChart(G,D){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});let z=this.createCellRange(void 0,!0);if(!z)return;return this.createChart({...G,cellRange:z,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!D})}createCrossFilterChart(G,D){let z=this.createCellRange(G.cellRange);if(!z)return;let Q=typeof G.suppressChartRanges<"u"&&G.suppressChartRanges!==null?G.suppressChartRanges:!0;return this.createChart({...G,cellRange:z,suppressChartRanges:Q,crossFiltering:!0,crossFilteringSort:G.sort,focusDialogOnOpen:!D})}createChart(G){let D=eT(G,this.agChartsExports.isEnterprise);if(!D)return;G=D===!0?G:D;let{chartType:z,chartContainer:B}=G,Q=this.gos.getCallback("createChartContainer"),J={...G,chartId:this.generateId(),chartType:S0(z),insideDialog:!(B||Q),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>{for(let S of this.activeChartComps)S.crossFilteringReset()}},U=new Ai(J);this.createBean(U);let Z=this.createChartRef(U);if(B)B.appendChild(Z.chartElement);else if(Q)Q(Z);else U.addEventListener("destroyed",()=>{this.activeChartComps.delete(U),this.activeCharts.delete(Z)});return Z}createChartRef(G){let D={destroyChart:()=>{if(this.activeCharts.has(D))this.destroyBean(G),this.activeChartComps.delete(G),this.activeCharts.delete(D)},focusChart:()=>{uT(G.getGui())},chartElement:G.getGui(),chart:G.getUnderlyingChart(),chartId:G.getChartModel().chartId,setMaximized:G.setMaximized.bind(G)};return this.activeCharts.add(D),this.activeChartComps.add(G),D}getSelectedRange(){let G=this.rangeSvc?.getCellRanges();if(!G||G.length===0)return{columns:[]};let D=new Set,z=Number.MAX_VALUE,B=-Number.MAX_VALUE;for(let{startRow:J,endRow:U,columns:Z}of G){if(!(J&&U))continue;for(let q of Z)D.add(q);let{rowIndex:S,rowPinned:X}=J,{rowIndex:Y,rowPinned:W}=U;if(X==="top"){if(W==="top")continue;S=0}if(W==="bottom"){if(X==="bottom")continue;Y=this.beans.pageBounds.getLastRow()}if(S!==void 0)z=Math.min(z,S);if(Y!==void 0)B=Math.max(B,Y)}if(z===Number.MAX_VALUE||B===-Number.MAX_VALUE)return{columns:[]};let Q=Array.from(D);return{columns:Q,startColumn:Q[0],startRow:{rowIndex:z,rowPinned:void 0},endRow:{rowIndex:B,rowPinned:void 0}}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(G,D){let z=D?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map((Q)=>Q.getColId())}:G,B=z&&this.rangeSvc?.createPartialCellRangeFromRangeParams(z,!0);if(!B)zB(127,{allRange:D});return B}destroy(){for(let G of this.activeCharts)G.destroyChart();super.destroy()}};function mi(G){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.getChartModels())}function ti(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.getChartRef(D))}function si(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.getChartImageDataURL(D))}function oi(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.downloadChart(D))}function ri(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.openChartToolPanel(D))}function ai(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.closeChartToolPanel(D.chartId))}function ei(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.createRangeChart(D,!0))}function Gn(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.createPivotChart(D,!0))}function Dn(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.createCrossFilterChart(D,!0))}function zn(G,D){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.updateChart(D))}function Bn(G,D,z){return G.frameworkOverrides.wrapIncoming(()=>G.chartSvc?.restoreChart(D,z))}var Qn=".ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative}.ag-chart-tabbed-menu-body:after{background:linear-gradient(var(--ag-background-color),transparent);content:\"\";display:block;height:16px;left:0;position:absolute;right:0;top:0}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:solid var(--ag-border-width) var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-card-item:before{background-color:transparent;content:\" \";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative}.ag-chart-settings-next:focus-within,.ag-chart-settings-prev:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:solid var(--ag-border-width) var(--ag-border-color);border-radius:5px;cursor:pointer;padding:1px;&.ag-selected{border-color:var(--ag-accent-color);border-width:calc(var(--ag-border-width) + 1px);padding:unset}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:solid var(--ag-border-width) var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8}.ag-chart-menu-icon:hover{opacity:1}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}.ag-label{display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:solid var(--ag-border-width) var(--ag-border-color)}.ag-chart-data-wrapper,.ag-chart-format-wrapper{margin:0;padding:0}.ag-group{.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{border-top:none;display:grid;font-weight:500;grid-template-columns:60px 1fr 60px 1fr 60px;row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;margin:0;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}&.ag-charts-data-group,&.ag-charts-format-top-level-group{border-top:solid var(--ag-border-width) var(--ag-border-color)}.ag-charts-data-group-container,.ag-charts-format-top-level-group-container,.ag-charts-settings-group-container{margin:0;padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-item,.ag-charts-format-sub-level-no-header-group-item,.ag-charts-format-top-level-group-item{margin-bottom:var(--ag-widget-vertical-spacing)}&.ag-charts-format-sub-level-group,&.ag-charts-format-top-level-group,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group-item{margin:0;padding:0}.ag-charts-advanced-settings-top-level-group-container{margin:0}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-color,.ag-spectrum-fill{border-radius:var(--ag-border-radius)}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:var(--ag-color-picker-thumb-border-width) solid #fff;border-radius:var(--ag-color-picker-thumb-size);box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:var(--ag-color-picker-thumb-size);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{cursor:pointer;height:var(--ag-color-picker-track-size);margin-bottom:10px;position:relative}.ag-spectrum-slider,.ag-spectrum-tool{border-radius:var(--ag-color-picker-thumb-size)}.ag-spectrum-slider{border:var(--ag-color-picker-thumb-border-width) solid #fff;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:var(--ag-color-picker-thumb-size);margin-top:calc(var(--ag-color-picker-track-size)/2*-1 + var(--ag-color-picker-thumb-size)/2*-1);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin:10px var(--ag-spacing) 2px}.ag-recent-color{border:solid var(--ag-border-width) var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding:10px 0 0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:var(--ag-color-picker-track-border-radius)}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:var(--ag-color-picker-color-border-radius)}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:solid var(--ag-border-width) var(--ag-border-color);height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-ltr) .ag-color-input .ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-rtl) .ag-color-input .ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-color-input) .ag-color-input-color{position:absolute}:where(.ag-ltr) :where(.ag-color-input) .ag-color-input-color{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-color-input) .ag-color-input-color{margin-right:var(--ag-spacing)}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}",O9=28,u9=6;function JJ(G){return G?.match(/\d+\.\d+\.\d+/)}function Jn({gridMajorVersion:G,chartsMajorVersion:D}){let z=parseInt(G,10),B=parseInt(D,10),Q=z-O9,J=B-u9,U=Q>=0;return Q===J&&U}function Un(G){if(!G||!JJ(G))return;let[D,z]=G.split(".")||[],B=`${D}.${z}.x`,J=parseInt(D,10)-O9+u9;if(J<0)return;let Z=`${J}.${z}.x`;return{gridMajorMinor:B,chartsMajorMinor:Z}}function ZB({type:G,gridVersion:D,chartsVersion:z}){if(!D)return"AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";let Q=Un(D);if(!Q)return"AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";let{gridMajorMinor:J,chartsMajorMinor:U}=Q;if(G==="incompatible")return`AG Grid version ${D} and AG Charts version ${z} is not supported. AG Grid version ${J} should be used with AG Chart ${U}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`;else if(G==="invalidCharts")return`AG Grid version ${J} should be used with AG Chart ${U} not ${z}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`;return"AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information."}function Zn({gridVersion:G,chartsVersion:D}){if(!JJ(D))return{isValid:!1,message:ZB({type:"invalidCharts",gridVersion:G,chartsVersion:D})};if(!JJ(G))return{isValid:!1,message:ZB({type:"invalidGrid",gridVersion:G,chartsVersion:D})};let[z,B]=G.split(".")||[],[Q,J,U]=D.split(".")||[],Z=Jn({gridMajorVersion:z,chartsMajorVersion:Q});if(Z&&B===J||U.includes("beta"))return{isValid:!0};else if(!Z||B!==J)return{isValid:!1,message:ZB({type:"incompatible",gridVersion:G,chartsVersion:D})};return{isValid:!1,message:ZB({type:"invalid",gridVersion:G,chartsVersion:D})}}var $n={linked:"linked",unlinked:"unlinked",chartsMenu:"menu-alt",chartsDownload:"save",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",chartsColorPicker:"small-down",chartsThemePrevious:"previous",chartsThemeNext:"next"},Ln={getChartModels:mi,getChartRef:ti,getChartImageDataURL:si,downloadChart:oi,openChartToolPanel:ri,closeChartToolPanel:ai,createRangeChart:ei,createPivotChart:Gn,createCrossFilterChart:Dn,updateChart:zn,restoreChart:Bn},UJ=[Xz,i,gP,PP,TB],L6="IntegratedCharts",Sn={moduleName:"GridCharts",version:j,dependsOn:UJ,validate:()=>{return{isValid:!1,message:`AG Grid: As of v33, the "GridChartsModule" has been deprecated. Please use "IntegratedChartsModule.with(...)" instead. + ${l8(257)}`}}},j9={moduleName:L6,version:j,dependsOn:UJ,validate:()=>{return{isValid:!1,message:l8(257)}},with:(G)=>{if(G.setup(),G.setGridContext?.(!0),G.isEnterprise&&G.setLicenseKey){let D={setLicenseKey:G.setLicenseKey};az.setChartsLicenseManager(D)}return{moduleName:L6,version:j,icons:$n,apiFunctions:Ln,dependsOn:UJ,css:[Qn],validate:()=>{return Zn({gridVersion:j,chartsVersion:G.VERSION})},beans:[yP.bind(null,G),pi,vT,FT,wT,CT,hg,LT]}}},S6=[Xn,nB,yB,cB,z8,B8,lB,W0,FJ,Xz,I7,bJ,VJ,o7,r7,L8,S8,g8,R7,iB,l6,jD,xB,a7,pB,$8,x8,c8,d8,o6],X6="AllEnterprise",Yn={with:(G)=>({moduleName:X6,version:j,dependsOn:[...S6,j9.with(G),T8.with(G)]}),moduleName:X6,version:j,dependsOn:S6};var{h:Wn,watch:eJ,onUnmount:qn}=window;Hn.registerModules([_n,kn,wn,Kn,fn,Nn,Fn,iB,Xz,pB,lB,jD,yB,W0,xB,cB,nB]);var In=(G)=>{let{data:D,options:z,api:B,on:Q,class:J,style:U="height: 100%; width: 100%",dark:Z}=G,S=null,X=null,Y=()=>Z!==void 0?typeof Z==="function"?Z():Z:document.documentElement.getAttribute("data-theme")==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches,W=()=>Y()?"ag-theme-balham-dark":"ag-theme-balham";return Wn("div",{class:J,style:U,ref:(H)=>{if(X)X(),X=null;if(S&&!S.isDestroyed()){if(S.destroy(),B)B.current=null;S=null}if(!H)return;let _=typeof D==="function"?D():D,k=typeof z==="function"?z():z,w=["onFilterChanged","onModelUpdated","onGridSizeChanged","onFirstDataRendered","onRowValueChanged","onSelectionChanged","onCellClicked","onCellDoubleClicked","onCellValueChanged","onRowClicked","onSortChanged","onContextMenu","onColumnResized","onColumnMoved","onRowDataUpdated","onCellEditingStarted","onCellEditingStopped","onPaginationChanged","onBodyScroll"],K={};w.forEach((I)=>{if(Q?.[I])K[I]=(V)=>Q[I](V)});let f={...k,theme:W(),rowData:_||[],onGridReady:(I)=>{if(S=I.api,B)B.current=S;if(Q?.onGridReady)Q.onGridReady(I);if(k?.autoSizeColumns)I.api.autoSizeAllColumns()},...K};S=En(H,f);let N=eJ(()=>{if(!S||S.isDestroyed())return;let I=typeof D==="function"?D():D;if(Array.isArray(I)){let V=S.getGridOption("rowData");if(I!==V)S.setGridOption("rowData",I)}}),F=eJ(()=>{if(!S||S.isDestroyed())return;Y();let I=W();if(I!==S.getGridOption("theme"))S.setGridOption("theme",I)}),E=eJ(()=>{if(!S||S.isDestroyed()||!z)return;let I=typeof z==="function"?z():z;if(I)Object.entries(I).forEach(([V,A])=>{try{S.setGridOption(V,A)}catch(R){}})});X=()=>{if(N(),F(),E(),S&&!S.isDestroyed()){if(S.destroy(),B)B.current=null;S=null}},qn(()=>{if(X)X(),X=null})}})};if(typeof window<"u")window.Grid=In;export{WzG as themeQuartz,qzG as iconSetQuartzLight,En as createGrid,Hn as ModuleRegistry,In as Grid}; diff --git a/dist/sigpro-grid.min.js b/dist/sigpro-grid.min.js index f1e4dfe..7a4ec6f 100644 --- a/dist/sigpro-grid.min.js +++ b/dist/sigpro-grid.min.js @@ -1,70 +1,70 @@ -(()=>{var{defineProperty:hQ,getOwnPropertyNames:oZ,getOwnPropertyDescriptor:eZ}=Object,_4=Object.prototype.hasOwnProperty;function f4(_){return this[_]}var $4=(_)=>{var f=(y2??=new WeakMap).get(_),$;if(f)return f;if(f=hQ({},"__esModule",{value:!0}),_&&typeof _==="object"||typeof _==="function"){for(var z of oZ(_))if(!_4.call(f,z))hQ(f,z,{get:f4.bind(_,z),enumerable:!($=eZ(_,z))||$.enumerable})}return y2.set(_,f),f},y2;var z4=(_)=>_;function Q4(_,f){this[_]=z4.bind(null,f)}var J4=(_,f)=>{for(var $ in f)hQ(_,$,{get:f[$],enumerable:!0,configurable:!0,set:Q4.bind(f,$)})};var QP={};J4(QP,{themeQuartz:()=>pJ,iconSetQuartzLight:()=>E5,createGrid:()=>b$,ModuleRegistry:()=>qJ,Grid:()=>zP});var r_=(_)=>typeof _==="function",l$=(_)=>_&&typeof _==="object",If=Array.isArray,R0=typeof document<"u"?document:null,b2=(_)=>_?._isRuntime?_.container:_ instanceof Node?_:R0.createTextNode(_==null?"":String(_)),k_=null,U0=null,c1=!1,r$=0,s$=new Set,C2=new WeakMap,uQ=Symbol("iter"),iQ=new WeakMap,q4="http://www.w3.org/2000/svg",w2="http://www.w3.org/1999/xlink",X4=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),yf=(_)=>{if(!_||_._disposed)return;_._disposed=!0;let f=[_];while(f.length){let $=f.pop();if($._cleanups)$._cleanups.forEach((z)=>z()),$._cleanups.clear();if($._children)$._children.forEach((z)=>f.push(z)),$._children.clear();if($._deps)$._deps.forEach((z)=>z.delete($)),$._deps.clear()}},o0=(_)=>{if(U0)(U0._cleanups||=new Set).add(_)},Y4=(_)=>{let f=k_;k_=null;try{return _()}finally{k_=f}},p1=(_,f=!1)=>{let $=()=>{if($._disposed)return;if($._deps)$._deps.forEach((J)=>J.delete($));if($._cleanups)$._cleanups.forEach((J)=>J()),$._cleanups.clear();let z=k_,Q=U0;k_=U0=$;try{return $._result=_()}catch(J){console.error("[SigPro]",J)}finally{k_=z,U0=Q}};if($._deps=$._cleanups=$._children=null,$._disposed=!1,$._isComputed=f,$._depth=k_?k_._depth+1:0,$._mounts=[],$._parent=U0,U0)(U0._children||=new Set).add($);return $},x2=()=>{if(c1)return;c1=!0;let _=Array.from(s$).sort((f,$)=>f._depth-$._depth);s$.clear();for(let f of _)if(!f._disposed)f();c1=!1},Z4=(_)=>{r$++;try{return _()}finally{if(r$--,r$===0&&s$.size>0&&!c1)x2()}},H0=(_,f=!1)=>{if(!f&&k_&&!k_._disposed)_.add(k_),(k_._deps||=new Set).add(_);else if(f&&_.size>0){let $=!1;for(let z of _){if(z===k_||z._disposed)continue;if(z._isComputed){if(z._dirty=!0,z._subs)H0(z._subs,!0)}else s$.add(z),$=!0}if($&&!c1&&r$===0)queueMicrotask(x2)}},cQ=(_,f=null)=>{let $=new Set;if(r_(_)){let z,Q=()=>{if(Q._dirty){let J=k_;k_=Q;try{let q=_();if(!Object.is(z,q))z=q,H0($,!0)}finally{k_=J}Q._dirty=!1}return H0($),z};return Q._isComputed=!0,Q._subs=$,Q._dirty=!0,Q._deps=null,Q._disposed=!1,Q}if(f)try{_=JSON.parse(localStorage.getItem(f))??_}catch(z){}return(...z)=>{if(z.length){let Q=r_(z[0])?z[0](_):z[0];if(!Object.is(_,Q)){if(_=Q,f)localStorage.setItem(f,JSON.stringify(_));H0($,!0)}}return H0($),_}},N2=(_)=>{if(!l$(_))return _;let f=C2.get(_);if(f)return f;let $=new Map,z=(J)=>{let q=$.get(J);if(!q)$.set(J,q=new Set);return q},Q=new Proxy(_,{get(J,q,X){if(typeof q!=="symbol")H0(z(q));return N2(Reflect.get(J,q,X))},set(J,q,X,Y){let Z=Reflect.has(J,q),G=Reflect.get(J,q,Y),E=Reflect.set(J,q,X,Y);if(E&&!Object.is(G,X)){if(H0(z(q),!0),!Z)H0(z(uQ),!0)}return E},deleteProperty(J,q){let X=Reflect.deleteProperty(J,q);if(X)H0(z(q),!0),H0(z(uQ),!0);return X},ownKeys(J){return H0(z(uQ)),Reflect.ownKeys(J)}});return C2.set(_,Q),Q},e0=(_,f)=>{if(f===void 0){let z=p1(_);return z(),()=>yf(z)}let $=p1(()=>{let z=Array.isArray(_)?_.map((Q)=>Q()):_();Y4(()=>f(z))});return $(),()=>yf($)},pQ=(_)=>{if(!_)return;if(_._cleanups)_._cleanups.forEach((f)=>f()),_._cleanups.clear();if(_._ownerEffect)yf(_._ownerEffect);if(_.childNodes)_.childNodes.forEach((f)=>pQ(f))},G4=/^\s*(javascript|data|vbscript):/i,E4=new Set(["src","href","formaction","action","background","code","archive"]),U4=(_)=>E4.has(_)||_.startsWith("on"),mQ=(_,f)=>{if(f==null||f===!1)return null;if(U4(_)){let $=String(f);if(G4.test($))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${_}`),"#"}return f},bf=(_,f={},$=[])=>{if(f instanceof Node||If(f)||!l$(f))$=f,f={};if(r_(_)){let q=p1(()=>{let G=_(f,{children:$,emit:(E,...U)=>f[`on${E[0].toUpperCase()}${E.slice(1)}`]?.(...U)});return q._result=G,G});q();let X=q._result;if(X==null)return null;let Y=X instanceof Node||If(X)&&X.every((G)=>G instanceof Node)?X:R0.createTextNode(String(X)),Z=(G)=>{if(l$(G)&&!G._isRuntime)G._mounts=q._mounts||[],G._cleanups=q._cleanups||new Set,G._ownerEffect=q};return If(Y)?Y.forEach(Z):Z(Y),Y}let z=X4.has(_),Q=z?R0.createElementNS(q4,_):R0.createElement(_);Q._cleanups=new Set;for(let q of Object.keys(f)){let X=f[q];if(q==="ref"){r_(X)?X(Q):X.current=Q;continue}if(z&&q.startsWith("xlink:")){let Y=mQ(q.slice(6),X);Y==null?Q.removeAttributeNS(w2,q.slice(6)):Q.setAttributeNS(w2,q.slice(6),Y);continue}if(q.startsWith("on")){let Y=q.slice(2).toLowerCase();Q.addEventListener(Y,X);let Z=()=>Q.removeEventListener(Y,X);Q._cleanups.add(Z),o0(Z)}else if(r_(X)){let Y=p1(()=>{let Z=mQ(q,X());if(q==="class")Q.className=Z||"";else if(Z==null)Q.removeAttribute(q);else if(q==="style"&&typeof Z==="string")Q.setAttribute("style",Z);else if(q in Q&&!z)Q[q]=Z;else Q.setAttribute(q,Z===!0?"":Z)});if(Y(),Q._cleanups.add(()=>yf(Y)),o0(()=>yf(Y)),/^(INPUT|TEXTAREA|SELECT)$/.test(Q.tagName)&&(q==="value"||q==="checked")){let Z=q==="checked"?"change":"input";Q.addEventListener(Z,(G)=>X(G.target[q]))}}else{let Y=mQ(q,X);if(Y!=null)if(q==="style"&&typeof Y==="string")Q.setAttribute("style",Y);else if(q in Q&&!z)Q[q]=Y;else Q.setAttribute(q,Y===!0?"":Y)}}let J=(q)=>{if(If(q))return q.forEach(J);if(r_(q)){let X=R0.createTextNode("");Q.appendChild(X);let Y=[],Z=p1(()=>{let G=q(),E=(If(G)?G:[G]).map(b2);Y.forEach((H)=>{if(H._isRuntime)H.destroy();else pQ(H);if(H.parentNode)H.remove()});let U=X;for(let H=E.length-1;H>=0;H--){let W=E[H];if(W.parentNode!==U.parentNode)U.parentNode?.insertBefore(W,U);if(W._mounts)W._mounts.forEach((B)=>B());U=W}Y=E});Z(),Q._cleanups.add(()=>yf(Z)),o0(()=>yf(Z))}else{let X=b2(q);if(Q.appendChild(X),X._mounts)X._mounts.forEach((Y)=>Y())}};return J($),Q},a$=(_)=>{let f=new Set,$=U0,z=k_,Q=R0.createElement("div");Q.style.display="contents",Q.setAttribute("role","presentation"),U0={_cleanups:f},k_=null;let J=(q)=>{if(!q)return;if(q._isRuntime)f.add(q.destroy),Q.appendChild(q.container);else if(If(q))q.forEach(J);else Q.appendChild(q instanceof Node?q:R0.createTextNode(String(q==null?"":q)))};try{J(_({onCleanup:(q)=>f.add(q)}))}finally{U0=$,k_=z}return{_isRuntime:!0,container:Q,destroy:()=>{f.forEach((q)=>q()),pQ(Q),Q.remove()}}},H4=(_,f,$=null)=>{let z=R0.createTextNode(""),Q=bf("div",{style:"display:contents"},[z]),J=null;return e0(()=>!!(r_(_)?_():_),(q)=>{if(J)J.destroy(),J=null;let X=q?f:$;if(X)J=a$(()=>r_(X)?X():X),Q.insertBefore(J.container,z)}),o0(()=>J?.destroy()),Q},W4=(_,f,$)=>{let z=R0.createTextNode(""),Q=bf("div",{style:"display:contents"},[z]),J=new Map;return e0(()=>(r_(_)?_():_)||[],(q)=>{let X=new Map,Y=[],Z=q||[];for(let E=0;Ef(U,E));else J.delete(H);X.set(H,W),Y.push(W)}J.forEach((E)=>E.destroy());let G=z;for(let E=Y.length-1;E>=0;E--){let U=Y[E].container;if(U.nextSibling!==G)Q.insertBefore(U,G);G=U}J=X}),Q},G1=(_)=>{let f=()=>window.location.hash.slice(1)||"/",$=cQ(f()),z=()=>$(f());window.addEventListener("hashchange",z),o0(()=>window.removeEventListener("hashchange",z));let Q=bf("div",{class:"router-hook"}),J=null;return e0([$],()=>{let q=$(),X=_.find((Y)=>{let Z=Y.path.split("/").filter(Boolean),G=q.split("/").filter(Boolean);return Z.length===G.length&&Z.every((E,U)=>E[0]===":"||E===G[U])})||_.find((Y)=>Y.path==="*");if(X){J?.destroy();let Y={};X.path.split("/").filter(Boolean).forEach((Z,G)=>{if(Z[0]===":")Y[Z.slice(1)]=q.split("/").filter(Boolean)[G]}),G1.params(Y),J=a$(()=>r_(X.component)?X.component(Y):X.component),Q.replaceChildren(J.container)}}),Q};G1.params=cQ({});G1.to=(_)=>window.location.hash=_.replace(/^#?\/?/,"#/");G1.back=()=>window.history.back();G1.path=()=>window.location.hash.replace(/^#/,"")||"/";var B4=(_,f)=>{let $=typeof f==="string"?R0.querySelector(f):f;if(!$)return;if(iQ.has($))iQ.get($).destroy();let z=a$(r_(_)?_:()=>_);return $.replaceChildren(z.container),iQ.set($,z),z};if(typeof window<"u")Object.assign(window,{$:cQ,$$:N2,watch:e0,h:bf,when:H4,each:W4,router:G1,mount:B4,batch:Z4,onUnmount:o0,isArr:If,isFunc:r_,isObj:l$}),"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video".split(" ").forEach((_)=>{window[_]=(f,$)=>bf(_,f,$)});function b(_){if(!_?.length)return;return _[_.length-1]}function J_(_,f,$){if(_===f)return!0;if(!_||!f)return _==null&&f==null;let z=_.length;if(z!==f.length)return!1;for(let Q=0;Q=0)_.splice($,1)}function K$(_,f){let $=0,z=0;for(;$<_.length;$++)if(!f.includes(_[$]))_[z]=_[$],z++;while(z<_.length)_.pop()}function g2(_,f,$){for(let z=0;z=0;z--)_.splice($,0,f[z])}var T0=(_)=>{if(_==null||_==="")return null;return _};function v(_){return _!=null&&_!==""}function n(_){return!v(_)}var $$=(_)=>{return _!=null&&typeof _.toString==="function"?_.toString():null},xz=(_,f)=>{let $=_?JSON.stringify(_):null,z=f?JSON.stringify(f):null;return $===z},K4=(_,f,$=!1)=>{if(_==null)return f==null?0:-1;if(f==null)return 1;if(typeof _==="object"&&_.toNumber)_=_.toNumber();if(typeof f==="object"&&f.toNumber)f=f.toNumber();if(!$||typeof _!=="string"){if(_>f)return 1;if(_{let Y=z?()=>z.wrapIncoming(X):X;if(f)this.dispatchAsync(Y);else Y()},J=this.getListeners($,f,!1);if((J?.size??0)>0){let X=new Set(J);for(let Y of X){if(!J?.has(Y))continue;Q(()=>Y(_))}}let q=this.getGlobalListeners(f);if(q.size>0){let X=new Set(q);for(let Y of X)Q(()=>Y($,_))}}getGlobalListeners(_){return _?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(_){if(this.asyncFunctionsQueue.push(_),!this.scheduled){let f=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},$=this.frameworkOverrides;if($)$.wrapIncoming(f);else f();this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;let _=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(let f of _)f()}},L4=/[&<>"']/g,F4={"&":"&","<":"<",">":">",'"':""","'":"'"};function L$(_){return _?.toString().toString()??null}function U_(_){return L$(_)?.replace(L4,(f)=>F4[f])??null}function Kz(_){return typeof _==="string"&&_.startsWith("=")&&_.length>1}function D4(_){if(!_||_==null)return null;let f=/([a-z])([A-Z])/g,$=/([A-Z]+)([A-Z])([a-z])/g;return _.replace(f,"$1 $2").replace($,"$1 $2$3").replace(/\./g," ").split(" ").map((Q)=>Q.substring(0,1).toUpperCase()+(Q.length>1?Q.substring(1,Q.length):"")).join(" ")}function a_(_){return _.eRootDiv.getRootNode()}function d(_){return a_(_).activeElement}function q_(_){let{gos:f,eRootDiv:$}=_,z=null,Q=f.get("getDocument");if(Q&&v(Q))z=Q();else if($)z=$.ownerDocument;if(z&&v(z))return z;return document}function sf(_){let f=d(_);return f===null||f===q_(_).body}function t6(_){return q_(_).defaultView||window}function T1(_){let f=null,$=null;try{f=q_(_).fullscreenElement}catch(z){}finally{if(!f)f=a_(_);let z=f.querySelector("body");if(z)$=z;else if(f instanceof ShadowRoot)$=f;else if(f instanceof Document)$=f?.documentElement;else $=f}return $}function M4(_){return T1(_)?.clientWidth??(window.innerWidth||-1)}function k4(_){return T1(_)?.clientHeight??(window.innerHeight||-1)}function c_(_,f,$){if($==null||typeof $==="string"&&$=="")r6(_,f);else X0(_,f,$)}function X0(_,f,$){_.setAttribute(s9(f),$.toString())}function r6(_,f){_.removeAttribute(s9(f))}function s9(_){return`aria-${_}`}function Z_(_,f){if(f)_.setAttribute("role",f);else _.removeAttribute("role")}function S4(_){let f=_?.direction;if(f==="asc")return"ascending";else if(f==="desc")return"descending";else if(f==="mixed")return"other";return"none"}function a9(_){return Number.parseInt(_.getAttribute("aria-posinset"),10)}function A4(_){return _.getAttribute("aria-label")}function W_(_,f){c_(_,"label",f)}function z$(_,f){c_(_,"labelledby",f)}function Nz(_,f){c_(_,"describedby",f)}function o9(_,f){c_(_,"live",f)}function R4(_,f){c_(_,"atomic",f)}function j4(_,f){c_(_,"relevant",f)}function e9(_,f){c_(_,"invalid",f)}function _q(_,f){c_(_,"level",f)}function fq(_,f){c_(_,"disabled",f)}function gz(_,f){c_(_,"hidden",f)}function N_(_,f){X0(_,"expanded",f)}function $q(_){r6(_,"expanded")}function hz(_,f){X0(_,"setsize",f)}function uz(_,f){X0(_,"posinset",f)}function V4(_,f){X0(_,"multiselectable",f)}function O4(_,f){X0(_,"rowcount",f)}function Lz(_,f){X0(_,"rowindex",f)}function P4(_,f){X0(_,"colcount",f)}function zq(_,f){X0(_,"colindex",f)}function v4(_,f){X0(_,"colspan",f)}function T4(_,f){X0(_,"sort",f)}function I4(_){r6(_,"sort")}function l6(_,f){c_(_,"selected",f)}function Qq(_,f){X0(_,"checked",f===void 0?"mixed":f)}function y4(_,f){c_(_,"controls",f)}function Jq(_,f){y4(_,f.id),z$(f,_.id)}function h2(_,f){c_(_,"owns",f)}function qq(_,f){c_(_,"haspopup",f===!1?null:f)}function s6(_,f){return f===void 0?_("ariaIndeterminate","indeterminate"):f===!0?_("ariaChecked","checked"):_("ariaUnchecked","unchecked")}function a6(_,f,$){let z=_.parentElement,Q=z&&z.firstChild;while(Q){if(f)Q.classList.toggle(f,Q===_);if($)Q.classList.toggle($,Q!==_);Q=Q.nextSibling}}var b4="[tabindex], input, select, button, textarea, [href]",Xq="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function s1(_){if(!_)return!1;if(!_.matches("input, select, button, textarea"))return!1;if(!_.matches(Xq))return!1;return A_(_)}function N(_,f,$={}){let{skipAriaHidden:z}=$;if(_.classList.toggle("ag-hidden",!f),!z)gz(_,!f)}function C4(_,f,$={}){let{skipAriaHidden:z}=$;if(_.classList.toggle("ag-invisible",!f),!z)gz(_,!f)}function o6(_,f){let z=f?(J)=>J.setAttribute("disabled",""):(J)=>J.removeAttribute("disabled");z(_);let Q=_.querySelectorAll("input")??[];for(let J of Q)z(J)}function uf(_,f,$){let z=0;while(_){if(_.classList.contains(f))return!0;if(_=_.parentElement,typeof $=="number"){if(++z>$)break}else if(_===$)break}return!1}function I1(_){let{height:f,width:$,borderTopWidth:z,borderRightWidth:Q,borderBottomWidth:J,borderLeftWidth:q,paddingTop:X,paddingRight:Y,paddingBottom:Z,paddingLeft:G,marginTop:E,marginRight:U,marginBottom:H,marginLeft:W,boxSizing:B}=window.getComputedStyle(_),K=Number.parseFloat;return{height:K(f||"0"),width:K($||"0"),borderTopWidth:K(z||"0"),borderRightWidth:K(Q||"0"),borderBottomWidth:K(J||"0"),borderLeftWidth:K(q||"0"),paddingTop:K(X||"0"),paddingRight:K(Y||"0"),paddingBottom:K(Z||"0"),paddingLeft:K(G||"0"),marginTop:K(E||"0"),marginRight:K(U||"0"),marginBottom:K(H||"0"),marginLeft:K(W||"0"),boxSizing:B}}function iz(_){let f=I1(_);if(f.boxSizing==="border-box")return f.height-f.paddingTop-f.paddingBottom-f.borderTopWidth-f.borderBottomWidth;return f.height}function df(_){let f=I1(_);if(f.boxSizing==="border-box")return f.width-f.paddingLeft-f.paddingRight-f.borderLeftWidth-f.borderRightWidth;return f.width}function Yq(_){let{height:f,marginBottom:$,marginTop:z}=I1(_);return Math.floor(f+$+z)}function Zq(_){let{width:f,marginLeft:$,marginRight:z}=I1(_);return Math.floor(f+$+z)}function Gq(_){let f=_.getBoundingClientRect(),{borderTopWidth:$,borderLeftWidth:z,borderRightWidth:Q,borderBottomWidth:J}=I1(_);return{top:f.top+($||0),left:f.left+(z||0),right:f.right+(Q||0),bottom:f.bottom+(J||0)}}function Fz(_,f){let $=_.scrollLeft;if(f)$=Math.abs($);return $}function Dz(_,f,$){if($)f*=-1;_.scrollLeft=f}function f_(_){while(_?.firstChild)_.firstChild.remove()}function T_(_){if(_?.parentNode)_.remove()}function Eq(_){return!!_.offsetParent}function A_(_){if(_.checkVisibility)return _.checkVisibility({checkVisibilityCSS:!0});return!(!Eq(_)||window.getComputedStyle(_).visibility!=="visible")}function e6(_){let f=document.createElement("div");return f.innerHTML=(_||"").trim(),f.firstChild}function Uq(_,f,$){if($&&$.nextSibling===f)return;if(!_.firstChild)_.appendChild(f);else if($)if($.nextSibling)_.insertBefore(f,$.nextSibling);else _.appendChild(f);else if(_.firstChild&&_.firstChild!==f)_.prepend(f)}function Hq(_,f){for(let $=0;$`-${f.toLocaleLowerCase()}`)}function F$(_,f){if(!f)return;for(let $ of Object.keys(f)){let z=f[$];if(!$?.length||z==null)continue;let Q=w4($),J=z.toString(),q=J.replace(/\s*!important/g,""),X=q.length!=J.length?"important":void 0;_.style.setProperty(Q,q,X)}}function Q$(_){return()=>{let f=_();if(!f)return!0;return x4(f)||N4(f)}}function x4(_){return _.clientWidth<_.scrollWidth}function N4(_){return _.clientHeight<_.scrollHeight}function Wq(_,f){if(f==="flex")_.style.removeProperty("width"),_.style.removeProperty("minWidth"),_.style.removeProperty("maxWidth"),_.style.flex="1 1 auto";else I0(_,f)}function I0(_,f){f=Bq(f),_.style.width=f,_.style.maxWidth=f,_.style.minWidth=f}function a1(_,f){f=Bq(f),_.style.height=f,_.style.maxHeight=f,_.style.minHeight=f}function Bq(_){return typeof _==="number"?`${_}px`:_}function D$(_){return _ instanceof Node||_ instanceof HTMLElement}function gf(_,f,$){if($==null||$==="")_.removeAttribute(f);else _.setAttribute(f,$.toString())}function g4(_,f){if(!f.isContentEditable)return;let $=t6(_).getSelection();if(!$)return;let z=q_(_).createRange();z.selectNodeContents(f),z.collapse(!1),$.removeAllRanges(),$.addRange(z)}function S0(_,f,$){let Q=t6(_).ResizeObserver,J=Q?new Q($):null;return J?.observe(f),()=>J?.disconnect()}function Y0(_,f){let $=t6(_);if($.requestAnimationFrame)$.requestAnimationFrame(f);else if($.webkitRequestAnimationFrame)$.webkitRequestAnimationFrame(f);else $.setTimeout(f,0)}var Kq="data-ref",nQ;function u2(){return nQ??(nQ=document.createTextNode(" ")),nQ.cloneNode()}function B_(_){let{attrs:f,children:$,cls:z,ref:Q,role:J,tag:q}=_,X=document.createElement(q);if(z)X.className=z;if(Q)X.setAttribute(Kq,Q);if(J)X.setAttribute("role",J);if(f)for(let Y of Object.keys(f))X.setAttribute(Y,f[Y]);if($)if(typeof $==="string")X.textContent=$;else{let Y=!0;for(let Z of $)if(Z)if(typeof Z==="string")X.appendChild(document.createTextNode(Z)),Y=!1;else if(typeof Z==="function")X.appendChild(Z());else{if(Y)X.appendChild(u2()),Y=!1;X.append(B_(Z)),X.appendChild(u2())}}return X}var h4=["touchstart","touchend","touchmove","touchcancel","scroll"],u4=["wheel"],dQ={},M6=(()=>{let _={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return($)=>{if(typeof dQ[$]==="boolean")return dQ[$];let z=document.createElement(_[$]||"div");return $="on"+$,dQ[$]=$ in z}})();function mz(_,f){if(!f||!_)return!1;return m4(f).indexOf(_)>=0}function i4(_){let f=[],$=_.target;while($)f.push($),$=$.parentElement;return f}function m4(_){let f=_;if(f.path)return f.path;if(f.composedPath)return f.composedPath();return i4(f)}function c4(_,f,$){let z=p4(f),Q;if(z!=null)Q={passive:z};_.addEventListener(f,$,Q)}var p4=(_)=>{let f=h4.includes(_),$=u4.includes(_);if(f)return!0;if($)return!1};function Lq(_,f,$){if($===0)return!1;let z=Math.abs(_.clientX-f.clientX),Q=Math.abs(_.clientY-f.clientY);return Math.max(z,Q)<=$}var D1=(_,f)=>{let $=_.identifier;for(let z=0,Q=f.length;z0&&U+_.clientWidth>J+K)U=J+K-_.clientWidth;if(U<0)U=0;if(q>0&&E+_.clientHeight>q+B)E=q+B-_.clientHeight;if(E<0)E=0;_.style.left=`${U}px`,_.style.top=`${E}px`}var Xz=(_,...f)=>{for(let $ of f){let[z,Q,J,q]=$;z.addEventListener(Q,J,q),_.push($)}},_J=(_)=>{if(_){for(let[f,$,z,Q]of _)f.removeEventListener($,z,Q);_.length=0}},W1=(_)=>{if(_.cancelable)_.preventDefault()};function d4(_,f){return f}function Fq(_){return _?.getLocaleTextFunc()??d4}function t4(_,f,$,z){let Q=f[$];return _.getLocaleTextFunc()($,typeof Q==="function"?Q(z):Q,z)}var j_=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(_){this.beans=_,this.stubContext=_.context,this.eventSvc=_.eventSvc,this.gos=_.gos}destroy(){let{destroyFunctions:_}=this;for(let f=0;f<_.length;f++)_[f]();_.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(_,f,$){if(!this.localEventService)this.localEventService=new D0;this.localEventService.addEventListener(_,f,$)}removeEventListener(_,f,$){this.localEventService?.removeEventListener(_,f,$)}dispatchLocalEvent(_){this.localEventService?.dispatchEvent(_)}addManagedElementListeners(_,f){return this._setupListeners(_,f)}addManagedEventListeners(_){return this._setupListeners(this.eventSvc,_)}addManagedListeners(_,f){return this._setupListeners(_,f)}_setupListeners(_,f){let $=[];for(let z of Object.keys(f)){let Q=f[z];if(Q)$.push(this._setupListener(_,z,Q))}return $}_setupListener(_,f,$){if(this.destroyed)return()=>null;let z;if(r4(_))_.__addEventListener(f,$),z=()=>{return _.__removeEventListener(f,$),null};else{let Q=l4(_);if(_ instanceof HTMLElement)c4(_,f,$);else if(Q)_.addListener(f,$);else _.addEventListener(f,$);z=Q?()=>{return _.removeListener(f,$),null}:()=>{return _.removeEventListener(f,$),null}}return this.destroyFunctions.push(z),()=>{return z(),this.destroyFunctions=this.destroyFunctions.filter((Q)=>Q!==z),null}}setupPropertyListener(_,f){let{gos:$}=this;$.addPropertyEventListener(_,f);let z=()=>{return $.removePropertyEventListener(_,f),null};return this.destroyFunctions.push(z),()=>{return z(),this.destroyFunctions=this.destroyFunctions.filter((Q)=>Q!==z),null}}addManagedPropertyListener(_,f){if(this.destroyed)return()=>null;return this.setupPropertyListener(_,f)}addManagedPropertyListeners(_,f){if(this.destroyed)return;let $=_.join("-")+this.propertyListenerId++,z=(Q)=>{if(Q.changeSet){if(Q.changeSet&&Q.changeSet.id===this.lastChangeSetIdLookup[$])return;this.lastChangeSetIdLookup[$]=Q.changeSet.id}let J={type:"propertyChanged",changeSet:Q.changeSet,source:Q.source};f(J)};for(let Q of _)this.setupPropertyListener(Q,z)}getLocaleTextFunc(){return Fq(this.beans.localeSvc)}addDestroyFunc(_){if(this.isAlive())this.destroyFunctions.push(_);else _()}createOptionalManagedBean(_,f){return _?this.createManagedBean(_,f):void 0}createManagedBean(_,f){let $=this.createBean(_,f);return this.addDestroyFunc(this.destroyBean.bind(this,_,f)),$}createBean(_,f,$){return(f||this.stubContext).createBean(_,$)}destroyBean(_,f){return(f||this.stubContext).destroyBean(_)}destroyBeans(_,f){return(f||this.stubContext).destroyBeans(_)}};function r4(_){return _.__addEventListener!==void 0}function l4(_){return _.eventServiceType==="global"}var A=class extends j_{},k6=new Set,cz=(_,f)=>{if(!k6.has(f))k6.add(f),_()};cz._set=k6;var s4={pending:!1,funcs:[]},a4={pending:!1,funcs:[]};function S6(_,f="setTimeout",$){let z=f==="raf"?a4:s4;if(z.funcs.push(_),z.pending)return;z.pending=!0;let Q=()=>{let J=z.funcs.slice();z.funcs.length=0,z.pending=!1;for(let q of J)q()};if(f==="raf")Y0($,Q);else window.setTimeout(Q,0)}function c0(_,f,$){let z;return function(...Q){let J=this;return window.clearTimeout(z),z=window.setTimeout(function(){if(_.isAlive())f.apply(J,Q)},$),z}}function i2(_,f){let $=0;return function(...z){let Q=this,J=Date.now();if(J-${if(J!=null)window.clearInterval(J),J=null};_.addDestroyFunc(X);let Y=()=>{let Z=Date.now()-Q>z;if(f()||Z)$(),q=!0,X()};if(Y(),!q)J=window.setInterval(Y,10)}var o4=new Set(["__proto__","constructor","prototype"]);function e4(_,f){if(_==null)return;if(Array.isArray(_)){for(let $=0;$<_.length;$++)f($.toString(),_[$]);return}for(let $ of Object.keys(_).filter((z)=>!o4.has(z)))f($,_[$])}function H_(_,f,$=!0,z=!1){if(!v(f))return;e4(f,(Q,J)=>{let q=_[Q];if(q===J)return;if(z){if(q==null&&J!=null){if(typeof J==="object"&&J.constructor===Object)q={},_[Q]=q}}if(m2(J)&&m2(q)&&!Array.isArray(q))H_(q,J,$,z);else if($||J!==void 0)_[Q]=J})}function m2(_){return typeof _==="object"&&_!==null}var $J=class _{static applyGlobalGridOptions(f){if(!_.gridOptions)return{...f};let $={};if(H_($,_.gridOptions,!0,!0),_.mergeStrategy==="deep")H_($,f,!0,!0);else $={...$,...f};if(_.gridOptions.context)$.context=_.gridOptions.context;if(f.context){if(_.mergeStrategy==="deep"&&$.context)H_(f.context,$.context,!0,!0);$.context=f.context}return $}static applyGlobalGridOption(f,$){if(_.mergeStrategy==="deep"){let z=_7(f);if(z&&typeof z==="object"&&typeof $==="object")return _.applyGlobalGridOptions({[f]:$})[f]}return $}};$J.gridOptions=void 0;$J.mergeStrategy="shallow";var zJ=$J;function _7(_){return zJ.gridOptions?.[_]}var f7={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2000,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1000,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},Dq="https://www.ag-grid.com";function q$(_,f,...$){if(_.get("debug"))console.log("AG Grid: "+f,...$)}function Yf(_,...f){cz(()=>Mq(_,...f),_+f?.join(""))}function M1(_,...f){cz(()=>$7(_,...f),_+f?.join(""))}function $7(_,...f){console.error("AG Grid: "+_,...f)}function Mq(_,...f){console.warn("AG Grid: "+_,...f)}var kq=new Set,Mz={},mf={},Yz,Sq=!1,Aq=!1,z7=!1;function Q7(_){let[f,$]=_.version.split(".")||[],[z,Q]=Yz.split(".")||[];return f===z&&$===Q}function J7(_){if(!Yz)Yz=_.version;let f=(z)=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${z} Please update all modules to the same version.`;if(!_.version)M1(f(`'${_.moduleName}' is incompatible.`));else if(!Q7(_))M1(f(`'${_.moduleName}' is version ${_.version} but the other modules are version ${Yz}.`));let $=_.validate?.();if($&&!$.isValid)M1(`${$.message}`)}function X$(_,f,$=!1){if(!$)Sq=!0;J7(_);let z=_.rowModels??["all"];kq.add(_);let Q;if(f!==void 0){if(Aq=!0,mf[f]===void 0)mf[f]={};Q=mf[f]}else Q=Mz;for(let J of z){if(Q[J]===void 0)Q[J]={};Q[J][_.moduleName]=_}if(_.dependsOn)for(let J of _.dependsOn)X$(J,f,$)}function q7(_){delete mf[_]}function A6(_,f,$){let z=(Q)=>!!Mz[Q]?.[_]||!!mf[f]?.[Q]?.[_];return z($)||z("all")}function QJ(){return Aq}function X7(_,f){let $=mf[_]??{};return[...Object.values(Mz.all??{}),...Object.values($.all??{}),...Object.values(Mz[f]??{}),...Object.values($[f]??{})]}function Y7(){return new Set(kq)}function Rq(_,f){let $=mf[_]??{};return[...Object.values($.all??{}),...Object.values($[f]??{})]}function Z7(){return Sq}function JJ(){return z7}var qJ=class{static register(_){X$(_,void 0)}static registerModules(_){for(let f of _)X$(f,void 0)}};var c="35.2.1",c2=2000,p2=100,jq="_version_",Vq=null,k1=`${Dq}/javascript-data-grid`;function G7(_){Vq=_}function E7(_){k1=_}function Oq(_,f,$){return Vq?.(_,f)??[B7(_,f,$)]}function pz(_,f,$,z,Q){_(`${z?"warning":"error"} #${f}`,...Oq(f,$,Q))}function U7(_){if(!_)return String(_);let f={};for(let $ of Object.keys(_))if(typeof _[$]!=="object"&&typeof _[$]!=="function")f[$]=_[$];return JSON.stringify(f)}function H7(_){let f=_;if(_ instanceof Error)f=_.toString();else if(typeof _==="object")f=U7(_);return f}function Zz(_){return _===void 0?"undefined":_===null?"null":_}function R6(_,f){return`${_}?${f.toString()}`}function W7(_,f,$){let z=Array.from(f.entries()).sort((J,q)=>q[1].length-J[1].length),Q=R6(_,f);for(let[J,q]of z){if(J===jq)continue;let X=Q.length-$;if(X<=0)break;let Y="...",Z=X+Y.length,G=q.length-Z>p2?q.slice(0,q.length-Z)+Y:q.slice(0,p2)+Y;f.set(J,G),Q=R6(_,f)}return Q}function Pq(_,f){let $=new URLSearchParams;if($.append(jq,c),f)for(let J of Object.keys(f))$.append(J,H7(f[J]));let z=`${k1}/errors/${_}`,Q=R6(z,$);return Q.length<=c2?Q:W7(z,$,c2)}var B7=(_,f,$)=>{let z=Pq(_,f),Q=`${$?$+` -`:""}Visit ${z}`;if(JJ())return Q;return`${Q}${$?"":` - Alternatively register the ValidationModule to see the full message in the console.`}`};function j(..._){pz(Yf,_[0],_[1],!0)}function e(..._){pz(M1,_[0],_[1],!1)}function r1(_,f,$){pz(M1,_,f,!1,$)}function vq(_,f,$){pz(Yf,_,f,!0,$)}function K7(_,f){let $=f[0];return`error #${$} `+Oq($,f[1],_).join(" ")}function $0(..._){return K7(void 0,_)}function Tq(_,f){return _.get("rowModelType")===f}function o(_,f){return Tq(_,"clientSide")}function Kf(_,f){return Tq(_,"serverSide")}function S_(_,f){return _.get("domLayout")===f}function p0(_){return kz(_)!==void 0}function Iq(_){return typeof _.get("getRowHeight")==="function"}function L7(_,f){if(f)return!_.get("enableStrictPivotColumnOrder");return _.get("maintainColumnOrder")}function F7({gos:_,formula:f}){let $=_.get("rowNumbers");return $||!!f?.active&&$!==!1}function Y$(_,f,$=!1,z){let{gos:Q,environment:J}=_;if(z==null)z=J.getDefaultRowHeight();if(Iq(Q)){if($)return{height:z,estimated:!0};let Y={node:f,data:f.data},Z=Q.getCallback("getRowHeight")(Y);if(j6(Z)){if(Z===0)j(23);return{height:Math.max(1,Z),estimated:!1}}}if(f.detail&&Q.get("masterDetail"))return D7(Q);let q=Q.get("rowHeight");return{height:q&&j6(q)?q:z,estimated:!1}}function D7(_){if(_.get("detailRowAutoHeight"))return{height:1,estimated:!1};let f=_.get("detailRowHeight");if(j6(f))return{height:f,estimated:!1};return{height:300,estimated:!1}}function yq(_){let{environment:f,gos:$}=_,z=$.get("rowHeight");if(!z||n(z))return f.getDefaultRowHeight();let Q=f.refreshRowHeightVariable();if(Q!==-1)return Q;return j(24),f.getDefaultRowHeight()}function j6(_){return!isNaN(_)&&typeof _==="number"&&isFinite(_)}function bq(_,f,$){let z=f[_.getDomDataKey()];return z?z[$]:void 0}function tf(_,f,$,z){let Q=_.getDomDataKey(),J=f[Q];if(n(J))J={},f[Q]=J;J[$]=z}function S1(_){if(_.get("ensureDomOrder"))return!1;return _.get("animateRows")}function y1(_){return!(_.get("paginateChildRows")||_.get("groupHideOpenParents")||S_(_,"print"))}function K0(_){return!_.get("autoGroupColumnDef")?.comparator&&!_.get("treeData")}function C0(_){let f=_.get("groupAggFiltering");if(typeof f==="function")return _.getCallback("groupAggFiltering");if(f===!0)return()=>!0;return}function Lf(_){return _.get("grandTotalRow")}function nz(_){let f=_.get("groupTotalRow");if(typeof f==="function")return _.getCallback("groupTotalRow");return()=>f??void 0}function M$(_){if(!!_.get("groupHideOpenParents"))return!0;return _.get("groupDisplayType")==="multipleColumns"}function XJ(_){return M$(_)&&_.get("groupHideColumnsUntilExpanded")&&o(_)}function dz(_,f){if(f)return!1;return _.get("groupDisplayType")==="groupRows"}function Cq(_,f,$){return!!f.group&&!f.footer&&dz(_,$)}function V6(_){let f=_.getCallback("getRowId");if(f===void 0)return f;return($)=>{let z=f($);if(typeof z!=="string")cz(()=>j(25,{id:z}),"getRowIdString"),z=String(z);return z}}function M7(_,f){let $=_.get("groupHideParentOfSingleChild");if($===!0)return!0;if($==="leafGroupsOnly"&&f.leafGroup)return!0;if(_.get("groupRemoveSingleChildren"))return!0;if(_.get("groupRemoveLowestSingleChildren")&&f.leafGroup)return!0;return!1}function tz(_,f){let $=_.get("suppressGroupChangesColumnVisibility");if($===!0)return!1;if(f&&$==="suppressHideOnGroup")return!1;if(!f&&$==="suppressShowOnUngroup")return!1;let z=_.get("suppressRowGroupHidesColumns");if(f&&z===!0)return!1;let Q=_.get("suppressMakeColumnVisibleAfterUnGroup");if(!f&&Q===!0)return!1;return!0}function Zf(_){return _?.checkboxes??!0}function Gz(_){return _?.mode==="multiRow"&&(_.headerCheckbox??!0)}function V1(_){if(typeof _!=="object")return;return _.checkboxLocation??"selectionColumn"}function tQ(_){return _?.hideDisabledCheckboxes??!1}function k7(_){return typeof _.get("rowSelection")!=="string"}function wq(_){return _.get("cellSelection")!==void 0}function xq(_){let f=_.get("cellSelection");if(f===void 0)return _.get("suppressMultiRangeSelection");return typeof f!=="boolean"?f?.suppressMultiRanges??!1:!1}function i_(_){let f=_.get("cellSelection");return f!==void 0?!!f:_.get("enableRangeSelection")}function rz(_){let f=_.get("cellSelection");if(f===void 0)return{mode:"fill",setFillValue:_.get("fillOperation"),direction:_.get("fillHandleDirection"),suppressClearOnFillReduction:_.get("suppressClearOnFillReduction")};return typeof f!=="boolean"&&f.handle?.mode==="fill"?f.handle:void 0}function Gf(_){let f=_.get("cellSelection")??!1;return(typeof f==="object"&&f.enableColumnSelection)??!1}function Nq(_){let f=_.get("rowSelection")??"single";if(typeof f==="string"){let $=_.get("suppressRowClickSelection"),z=_.get("suppressRowDeselection");if($&&z)return!1;else if($)return"enableDeselection";else if(z)return"enableSelection";else return!0}return f.mode==="singleRow"||f.mode==="multiRow"?f.enableClickSelection??!1:!1}function S7(_){let f=Nq(_);return f===!0||f==="enableSelection"}function A7(_){let f=Nq(_);return f===!0||f==="enableDeselection"}function O6(_){let f=_.get("rowSelection");if(typeof f==="string")return _.get("isRowSelectable");return f?.isRowSelectable}function kz(_){let f="beanName"in _&&_.beanName==="gos"?_.get("rowSelection"):_.rowSelection;if(typeof f==="string")switch(f){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(f?.mode){case"multiRow":case"singleRow":return f.mode;default:return}}function Z$(_){return kz(_)==="multiRow"}function R7(_){let f=_.get("rowSelection");if(typeof f==="string")return _.get("rowMultiSelectWithClick");return f?.enableSelectionWithoutKeys??!1}function Sz(_){let f=_.get("rowSelection");if(typeof f==="string"){let $=_.get("groupSelectsChildren"),z=_.get("groupSelectsFiltered");if($&&z)return"filteredDescendants";else if($)return"descendants";else return"self"}return f?.mode==="multiRow"?f.groupSelects:void 0}function gq(_,f=!0){let $=_.get("rowSelection");if(typeof $!=="object")return f?"all":void 0;return $.mode==="multiRow"?$.selectAll:"all"}function j7(_){let f=_.get("rowSelection");if(typeof f==="string")return!1;return f?.mode==="multiRow"?f.ctrlASelectsRows??!1:!1}function G$(_){let f=Sz(_);return f==="descendants"||f==="filteredDescendants"}function n2(_){let f=_.get("rowSelection");return typeof f==="object"&&f.masterSelects||"self"}function V7(_){return _.isModuleRegistered("SetFilter")&&!_.get("suppressSetFilterByDefault")}function E_(_){return _.get("columnMenu")==="legacy"}function YJ(_){return!E_(_)}function O7(_){if(!_||_.length<2)return _;return"on"+_[0].toUpperCase()+_.substring(1)}function C(_,f){return _.addCommon(f)}function ZJ({gos:_},f){return f.button===2||f.ctrlKey&&_.get("allowContextMenuWithControlKey")}var P7={resizable:!0,sortable:!0},v7=0;function hq(){return v7++}function Q0(_){return _ instanceof Z0}var T7=["asc","desc",null],I7=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],Z0=class extends A{constructor(_,f,$,z){super();this.colDef=_,this.userProvidedColDef=f,this.colId=$,this.primary=z,this.isColumn=!0,this.instanceId=hq(),this.autoHeaderHeight=null,this.sortDef=e_(),this._wasSortExplicitlyRemoved=!1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new D0,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=U_($)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){let{colDef:_,beans:{sortSvc:f,pinnedCols:$,colFlex:z}}=this;f?.initCol(this);let Q=_.hide;if(Q!==void 0)this.visible=!Q;else this.visible=!_.initialHide;$?.initCol(this),z?.initCol(this)}setColDef(_,f,$){let z=_.spanRows!==this.colDef.spanRows;if(this.colDef=_,this.userProvidedColDef=f,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),z)this.beans.rowSpanSvc?.deregister(this),this.initRowSpan();this.dispatchColEvent("colDefChanged",$)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){let{gos:_,colDef:{field:f,tooltipField:$}}=this,z=_.get("suppressFieldDotNotation");this.fieldContainsDots=v(f)&&f.includes(".")&&!z,this.tooltipFieldContainsDots=v($)&&$.includes(".")&&!z}initMinAndMaxWidths(){let _=this.colDef;this.minWidth=_.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=_.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){if(this.colDef.spanRows)this.beans.rowSpanSvc?.register(this)}addPivotListener(){let _=this.beans.pivotColDefSvc,f=this.colDef.pivotValueColumn;if(!_||!f)return;this.addManagedListeners(f,{colDefChanged:($)=>{let z=_.recreateColDef(this.colDef);this.setColDef(z,z,$.source)}})}resetActualWidth(_){let f=this.calculateColInitialWidth(this.colDef);this.setActualWidth(f,_,!0)}calculateColInitialWidth(_){let f=_.width??_.initialWidth??200;return Math.max(Math.min(f,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(_){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,_)??!1}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(_,f){this.colEventSvc.addEventListener(_,f)}__removeEventListener(_,f){this.colEventSvc.removeEventListener(_,f)}addEventListener(_,f){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);let $=this.frameworkEventListenerService?.wrap(_,f)??f;this.colEventSvc.addEventListener(_,$)}removeEventListener(_,f){let $=this.frameworkEventListenerService?.unwrap(_,f)??f;this.colEventSvc.removeEventListener(_,$)}createColumnFunctionCallbackParams(_){return C(this.gos,{node:_,data:_.data,column:this,colDef:this.colDef})}isSuppressNavigable(_){return this.beans.cellNavigation?.isSuppressNavigable(this,_)??!1}isCellEditable(_){return this.beans.editSvc?.isCellEditable({rowNode:_,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(_){return this.isColumnFunc(_,this.colDef.rowDrag)}isDndSource(_){return this.isColumnFunc(_,this.colDef.dndSource)}isCellCheckboxSelection(_){return this.beans.selectionSvc?.isCellCheckboxSelection(this,_)??!1}isSuppressPaste(_){return this.isColumnFunc(_,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(_){return this.colDef[_]??P7[_]}isColumnFunc(_,f){if(typeof f==="boolean")return f;if(typeof f==="function"){let $=this.createColumnFunctionCallbackParams(_);return f($)}return!1}createColumnEvent(_,f){return C(this.gos,{type:_,column:this,columns:[this],source:f})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){if(!this.sortDef.direction)return null;return this.sortDef}getColDefAllowedSortTypes(){let _=[],{sort:f,initialSort:$}=this.colDef,z=f===null?f:M0(f?.type),Q=$===null?$:M0($?.type);if(z)_.push(z);if(Q)_.push(Q);return _}getSortingOrder(){let _=this.getColDefAllowedSortTypes().includes("absolute")?I7:T7;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??_).map((f)=>e_(f))}getAvailableSortTypes(){let _=this.getSortingOrder().reduce((f,$)=>{if($.direction)f.push($.type);return f},this.getColDefAllowedSortTypes());return new Set(_)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(_,f=!1){if(!f)this._wasSortExplicitlyRemoved=!_.direction;this.sortDef=_}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return n(this.getSort())}isSorting(){return v(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(_,f){if(this.oldLeft=this.left,this.left!==_)this.left=_,this.dispatchColEvent("leftChanged",f)}isFilterActive(){return this.filterActive}isHovered(){return j(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(_,f){if(this.firstRightPinned!==_)this.firstRightPinned=_,this.dispatchColEvent("firstRightPinnedChanged",f)}setLastLeftPinned(_,f){if(this.lastLeftPinned!==_)this.lastLeftPinned=_,this.dispatchColEvent("lastLeftPinnedChanged",f)}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(_,f){let $=_===!0;if(this.visible!==$)this.visible=$,this.dispatchColEvent("visibleChanged",f);this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let _=this.getOriginalParent();while(_?.isPadding())_=_.getOriginalParent();return _}getColumnGroupPaddingInfo(){let _=this.getParent();if(!_?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};let f=_.getPaddingLevel()+1,$=!0;while(_){if(!_.isPadding()){$=!1;break}_=_.getParent()}return{numberOfParents:f,isSpanningTotal:$}}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(_){let f=_!==this.autoHeaderHeight;return this.autoHeaderHeight=_,f}createBaseColDefParams(_){return C(this.gos,{node:_,data:_.data,colDef:this.colDef,column:this})}getColSpan(_){if(n(this.colDef.colSpan))return 1;let f=this.createBaseColDefParams(_),$=this.colDef.colSpan(f);return Math.max($,1)}getRowSpan(_){if(n(this.colDef.rowSpan))return 1;let f=this.createBaseColDefParams(_),$=this.colDef.rowSpan(f);return Math.max($,1)}setActualWidth(_,f,$=!1){if(_=Math.max(_,this.minWidth),_=Math.min(_,this.maxWidth),this.actualWidth!==_){if(this.actualWidth=_,this.flex!=null&&f!=="flex"&&f!=="gridInitializing")this.flex=null;if(!$)this.fireColumnWidthChangedEvent(f)}this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(_){this.dispatchColEvent("widthChanged",_)}isGreaterThanMax(_){return _>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.colDef.allowFormula===!0}dispatchColEvent(_,f,$){let z=this.createColumnEvent(_,f);if($)H_(z,$);this.colEventSvc.dispatchEvent(z)}dispatchStateUpdatedEvent(_){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:_})}};function e_(_){if(A1(_))return{direction:_.direction,type:_.type};return{direction:lz(_),type:M0(_)}}function Ef(_){return _==="asc"||_==="desc"||_===null}function GJ(_){return _==="default"||_==="absolute"}function A1(_){if(!_||typeof _!=="object")return!1;let f=_;return GJ(f.type)&&Ef(f.direction)}function Ez(_,f){if(!_)return f?f.direction===null:!0;if(!f)return _?_.direction===null:!0;return _.type===f.type&&_.direction===f.direction}function lz(_){return Ef(_)?_:null}function M0(_){return GJ(_)?_:"default"}function EJ(_,f,$){let Q=$?.()??f.sortSvc.getDisplaySortForColumn(_),J=M0(Q?.type),q=lz(Q?.direction),X=_.getAvailableSortTypes(),Y=X.has("default"),Z=X.has("absolute");return{isDefaultSortAllowed:Y,isAbsoluteSortAllowed:Z,isAbsoluteSort:J==="absolute",isDefaultSort:J==="default",isAscending:q==="asc",isDescending:q==="desc",direction:q}}function X_(_){return _ instanceof cf}var cf=class extends A{constructor(_,f,$,z){super();this.colGroupDef=_,this.groupId=f,this.padding=$,this.level=z,this.isColumn=!1,this.expandable=!1,this.instanceId=hq(),this.expandableListenerRemoveCallback=null,this.expanded=!!_?.openByDefault}destroy(){if(this.expandableListenerRemoveCallback)this.reset(null,void 0);super.destroy()}reset(_,f){if(this.colGroupDef=_,this.level=f,this.originalParent=null,this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){if(this.children)return this.children.some((_)=>_.isVisible());return!1}isPadding(){return this.padding}setExpanded(_){this.expanded=_===void 0?!1:_,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(_){this.children=_}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){let _=[];return this.addLeafColumns(_),_}forEachLeafColumn(_){if(!this.children)return;for(let f of this.children)if(Q0(f))_(f);else if(X_(f))f.forEachLeafColumn(_)}addLeafColumns(_){if(!this.children)return;for(let f of this.children)if(Q0(f))_.push(f);else if(X_(f))f.addLeafColumns(_)}getColumnGroupShow(){let _=this.colGroupDef;if(!_)return;return _.columnGroupShow}setupExpandable(){if(this.setExpandable(),this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();let _=this.onColumnVisibilityChanged.bind(this);for(let f of this.getLeafColumns())f.__addEventListener("visibleChanged",_);this.expandableListenerRemoveCallback=()=>{for(let f of this.getLeafColumns())f.__removeEventListener("visibleChanged",_);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let _=!1,f=!1,$=!1,z=this.findChildrenRemovingPadding();for(let J=0,q=z.length;J{for(let z of $)if(X_(z)&&z.isPadding())f(z.children);else _.push(z)};return f(this.children),_}onColumnVisibilityChanged(){this.setExpandable()}},y7={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function P6(_,f,$){let z={},Q=_.gos;return Object.assign(z,Q.get("defaultColGroupDef")),Object.assign(z,f),Q.validateColDef(z,$),z}var b7=class{constructor(){this.existingKeys={}}addExistingKeys(_){for(let f=0;f<_.length;f++)this.existingKeys[_[f]]=!0}getUniqueKey(_,f){_=$$(_);let $=0;while(!0){let z=_??f;if(z){if($!==0)z+="_"+$}else z=$;if(!this.existingKeys[z]){let Q=String(z);if(_&&$>0)j(273,{providedId:_,usedId:Q});return this.existingKeys[Q]=!0,Q}$++}}},uq=(_,f)=>{if(X_(_))_.setupExpandable();_.originalParent=f};function iq(_,f=null,$,z,Q){let{existingCols:J,existingGroups:q}=mq(z),X=new Map(J.map((B)=>[B.getId(),B])),Y=new Map(q.map((B)=>[B.getId(),B])),Z=0,G=(B,K)=>{if(Z=Math.max(Z,K),dq(B)){if(!_.colGroupSvc)return null;let M=B.groupId,k=Y.get(M),R=P6(_,B,M),O=new cf(R,M,!1,K);if(_.context.createBean(O),k)O.setExpanded(k.isExpanded());return O.setChildren(B.children.map((I)=>G(I,K+1))),O}let L=B.colId,F=X.get(L),D=n0(_,B,F?.getColId()??L);if(!F)F=new Z0(D,B,L,$),_.context.createBean(F);else F.setColDef(D,B,Q),nq(_,F,D,Q);return _.dataTypeSvc?.addColumnListeners(F),F},E=f?.map((B)=>G(B,0))??[],U=0,H={getUniqueKey:(B,K)=>String(++U)},W=_.colGroupSvc?_.colGroupSvc.balanceColumnTree(E,0,Z,H):E;return y0(null,W,uq),{columnTree:W,treeDepth:Z}}function UJ(_,f=null,$,z,Q){let J=new b7,{existingCols:q,existingGroups:X,existingColKeys:Y}=mq(z);J.addExistingKeys(Y);let Z=cq(_,f,0,$,q,J,X,Q),{colGroupSvc:G}=_,E=G?.findMaxDepth(Z,0)??0,U=G?G.balanceColumnTree(Z,0,E,J):Z;return y0(null,U,uq),{columnTree:U,treeDepth:E}}function mq(_){let f=[],$=[],z=[];if(_)y0(null,_,(Q)=>{if(X_(Q)){let J=Q;$.push(J)}else{let J=Q;z.push(J.getId()),f.push(J)}});return{existingCols:f,existingGroups:$,existingColKeys:z}}function cq(_,f,$,z,Q,J,q,X){if(!f)return[];let{colGroupSvc:Y}=_,Z=Array(f.length);for(let G=0;G0)return;if($.width!=null)f.setActualWidth($.width,z);else{let J=f.getActualWidth();f.setActualWidth(J,z)}}function w7(_,f){if(!f)return;for(let $=0;${for(let Q=0;Qf+$.getActualWidth(),0)}function J0(_,f,$){let z={};if(!f)return;if(y0(null,f,(J)=>{z[J.getInstanceId()]=J}),$)y0(null,$,(J)=>{z[J.getInstanceId()]=null});let Q=Object.values(z).filter((J)=>J!=null);_.context.destroyBeans(Q)}function of(_){return _.getId().startsWith(af)}function x0(_){return(typeof _==="string"?_:("getColId"in _)?_.getColId():_.colId)?.startsWith(tq)??!1}function I_(_){return(typeof _==="string"?_:("getColId"in _)?_.getColId():_.colId)?.startsWith(rq)??!1}function k$(_){return x0(_)||I_(_)}function Az(_){let f=[];if(_ instanceof Array)f=_;else if(typeof _==="string")f=_.split(",");return f}function S$(_,f){return J_(_,f,($,z)=>$.getColId()===z.getColId())}function A$(_){_.map={};for(let f of _.list)_.map[f.getId()]=f}function Uf(_){return _==="optionsUpdated"?"gridOptionsChanged":_}function b0(_,f){return _===f||_.colId==f||_.getColDef()===f}var g7=(_,f)=>($,z)=>{let Q={value1:void 0,value2:void 0},J=!1;if(_){if(_[$]!==void 0)Q.value1=_[$],J=!0;if(v(z)&&_[z]!==void 0)Q.value2=_[z],J=!0}if(!J&&f){if(f[$]!==void 0)Q.value1=f[$];if(v(z)&&f[z]!==void 0)Q.value2=f[z]}return Q};function HJ(_,f){let $={..._,sort:void 0,colId:f},z=sq(_);if(z)$.sort=z.direction,$.sortType=z.type;return $}function sq(_){let{sort:f,initialSort:$}=_,z=A1(f)||Ef(f),Q=A1($)||Ef($);if(z)return e_(f);if(Q)return e_($);return null}function aq(_,f){return _+"_"+f}function G_(_){return _ instanceof E$}var E$=class extends A{constructor(_,f,$,z){super();this.providedColumnGroup=_,this.groupId=f,this.partId=$,this.pinned=z,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=U_(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return aq(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){let _=this.getProvidedColumnGroup().getLeafColumns();if(!_||_.length===0)return!1;return _.every((f)=>f.isMoving())}checkLeft(){for(let _ of this.displayedChildren)if(G_(_))_.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){let f=b(this.displayedChildren).getLeft();this.setLeft(f)}else{let _=this.displayedChildren[0].getLeft();this.setLeft(_)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(_){if(this.oldLeft=this.left,this.left!==_)this.left=_,this.dispatchLocalEvent({type:"leftChanged"})}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let _=0;for(let f of this.displayedChildren??[])_+=f.getActualWidth();return _}isResizable(){if(!this.displayedChildren)return!1;let _=!1;for(let f of this.displayedChildren)if(f.isResizable())_=!0;return _}getMinWidth(){let _=0;for(let f of this.displayedChildren)_+=f.getMinWidth();return _}addChild(_){if(!this.children)this.children=[];this.children.push(_)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){let _=[];return this.addLeafColumns(_),_}getDisplayedLeafColumns(){let _=[];return this.addDisplayedLeafColumns(_),_}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(_){this.providedColumnGroup.setExpanded(_)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(_){let f=_!==this.autoHeaderHeight;return this.autoHeaderHeight=_,f}addDisplayedLeafColumns(_){for(let f of this.displayedChildren??[])if(Q0(f))_.push(f);else if(G_(f))f.addDisplayedLeafColumns(_)}addLeafColumns(_){for(let f of this.children??[])if(Q0(f))_.push(f);else if(G_(f))f.addLeafColumns(_)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let _=this.getParent();if(!this.isPadding()||!_?.isPadding())return 0;return 1+_.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let _=this;while(_?.isPadding())_=_.getParent();if(!(_?_.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(let $ of this.children??[]){if(G_($)&&!$.displayedChildren?.length)continue;switch($.getColumnGroupShow()){case"open":if(_.getProvidedColumnGroup().isExpanded())this.displayedChildren.push($);break;case"closed":if(!_.getProvidedColumnGroup().isExpanded())this.displayedChildren.push($);break;default:this.displayedChildren.push($);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},S={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},h7=65,u7=67,i7=86,m7=68,c7=90,p7=89;function oq(_){let{keyCode:f}=_,$;switch(f){case h7:$=S.A;break;case u7:$=S.C;break;case i7:$=S.V;break;case m7:$=S.D;break;case c7:$=S.Z;break;case p7:$=S.Y;break;default:$=_.code}return $}function n7(_,f){return new g(($)=>{$(window.setInterval(_,f))})}var g=class _{constructor(f){this.status=0,this.resolution=null,this.waiters=[],f(($)=>this.onDone($),($)=>this.onReject($))}static all(f){return f.length?new _(($)=>{let z=f.length,Q=Array(z);f.forEach((J,q)=>{J.then((X)=>{if(Q[q]=X,z--,z===0)$(Q)})})}):_.resolve()}static resolve(f=null){return new _(($)=>$(f))}then(f){return new _(($)=>{if(this.status===1)$(f(this.resolution));else this.waiters.push((z)=>$(f(z)))})}onDone(f){this.status=1,this.resolution=f;for(let $ of this.waiters)$(f)}onReject(f){}},d7=class extends j_{constructor(){super(...arguments);this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(_,f=!1){let $={capturePointer:!0,dragSource:_,eElement:_.eElement,dragStartPixels:_.dragStartPixels,onDragStart:(z)=>this.onDragStart(_,z),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:f};this.dragSourceAndParamsList.push($),this.beans.dragSvc.addDragSource($)}setDragImageCompIcon(_,f=!1){let $=this.dragImageComp;if($&&(f||this.dragImageLastIcon!==_))this.dragImageLastIcon=_,$.setIcon(_,f)}removeDragSource(_){let{dragSourceAndParamsList:f,beans:$}=this;for(let z=0,Q=f.length;z{for(let Z of Y){let{width:G,height:E,left:U,right:H,top:W,bottom:B}=Z.getBoundingClientRect();if(G===0||E===0)return!1;let K=X.clientX>=U&&X.clientX=W&&X.clientY0}findExternalZone(_){let f=this.dropTargets;for(let $=0,z=f.length;$0?"down":W<0?"up":null,hDirection:H<0?"left":H>0?"right":null,initialSourcePointerOffsetX:X,initialSourcePointerOffsetY:Y,dragSource:z,fromNudge:$,dragItem:Q,dropZoneTarget:Z,dropTarget:J?.dropTarget??null,changed:!!J?.changed});return this.lastDraggingEvent=B,B}positionDragImageComp(_){let f=this.dragImageComp?.getGui();if(f)n4(f,_,this.beans)}removeDragImageComp(_){if(this.dragImageComp===_)this.dragImageComp=null;if(_)_.getGui()?.remove(),this.destroyBean(_)}createAndUpdateDragImageComp(_){let f=this.createDragImageComp(_)??null;this.dragImageCompPromise=f,f?.then(($)=>{let z=this.lastMouseEvent;if(f!==this.dragImageCompPromise||!z||!this.isAlive()){this.destroyBean($);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;let Q=this.dragImageComp;if(Q!==$)this.dragImageComp=$,this.removeDragImageComp(Q);if($)this.appendDragImageComp($),this.updateDragImageComp(),this.positionDragImageComp(z)})}appendDragImageComp(_){let f=_.getGui(),$=f.style;if($.position="absolute",$.zIndex="9999",this.beans.dragSvc?.hasPointerCapture())$.pointerEvents="none";this.gos.setInstanceDomData(f),this.beans.environment.applyThemeClasses(f),$.top="20px",$.left="20px";let z=T1(this.beans);if(!z)this.warnNoBody();else z.appendChild(f)}updateDragImageComp(){let{dragImageComp:_,dragSource:f,lastDropTarget:$,lastDraggingEvent:z,dragImageLastLabel:Q}=this;if(!_)return;this.setDragImageCompIcon($?.getIconName?.(z)??null);let J=f?.dragItemName;if(typeof J==="function")J=J(z);if(J||(J=""),Q!==J)this.dragImageLastLabel=J,_.setLabel(J)}};function eq(_){return typeof _==="object"&&!!_.component}function t7(_){if(!_)return!1;return _.prototype&&"getGui"in _.prototype}function _X(_,f,$,z){let{name:Q}=$,J,q,X,Y,Z,G;if(f){let E=f,U=E[Q+"Selector"],H=U?U(z):null,W=(B)=>{if(typeof B==="string")J=B;else if(B!=null&&B!==!0)if(_.isFrameworkComponent(B))X=B;else q=B};if(H)W(H.component),Y=H.params,Z=H.popup,G=H.popupPosition;else W(E[Q])}return{compName:J,jsComp:q,fwComp:X,paramsFromSelector:Y,popupFromSelector:Z,popupPositionFromSelector:G}}var r7=class extends A{constructor(){super(...arguments);this.beanName="userCompFactory"}wireBeans(_){this.agCompUtils=_.agCompUtils,this.registry=_.registry,this.frameworkCompWrapper=_.frameworkCompWrapper,this.gridOptions=_.gridOptions}getCompDetailsFromGridOptions(_,f,$,z=!1){return this.getCompDetails(this.gridOptions,_,f,$,z)}getCompDetails(_,f,$,z,Q=!1){let{name:J,cellRenderer:q}=f,{compName:X,jsComp:Y,fwComp:Z,paramsFromSelector:G,popupFromSelector:E,popupPositionFromSelector:U}=_X(this.beans.frameworkOverrides,_,f,z),H,W,B=(D)=>{let M=this.registry.getUserComponent(J,D);if(M)Y=!M.componentFromFramework?M.component:void 0,Z=M.componentFromFramework?M.component:void 0,H=M.params,W=M.processParams};if(X!=null)B(X);if(Y==null&&Z==null&&$!=null)B($);if(Y&&q&&!t7(Y))Y=this.agCompUtils?.adaptFunction(f,Y);if(!Y&&!Z){let{validation:D}=this.beans;if(Q&&(X!==$||!$))if(X){if(!D?.isProvidedUserComp(X))e(50,{compName:X})}else if($){if(!D)e(260,{...this.gos.getModuleErrorParams(),propName:J,compName:$})}else e(216,{name:J});else if($&&!D)e(146,{comp:$});return}let K=this.mergeParams(_,f,z,G,H,W),L=Y==null,F=Y??Z;return{componentFromFramework:L,componentClass:F,params:K,type:f,popupFromSelector:E,popupPositionFromSelector:U,newAgStackInstance:()=>this.newAgStackInstance(F,L,K,f)}}newAgStackInstance(_,f,$,z){let Q=!f,J;if(Q)J=new _;else J=this.frameworkCompWrapper.wrap(_,z.mandatoryMethods,z.optionalMethods,z);this.createBean(J);let q=J.init?.($);if(q==null)return g.resolve(J);return q.then(()=>J)}mergeParams(_,f,$,z=null,Q,J){let q={...$,...Q},Y=_?.[f.name+"Params"];if(typeof Y==="function"){let Z=Y($);H_(q,Z)}else if(typeof Y==="object")H_(q,Y);return H_(q,z),J?J(q):q}};var l7={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},s7={name:"headerComponent",optionalMethods:["refresh"]},a7={name:"innerHeaderComponent"},o7={name:"innerHeaderGroupComponent"},e7={name:"headerGroupComponent"},_8={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},f8={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0};var $8={name:"loadingCellRenderer",cellRenderer:!0},z8={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},Q8={name:"tooltipComponent"},WJ={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},J8={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},q8={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},X8={name:"loadingCellRenderer",cellRenderer:!0},Y8={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},Z8={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function G8(_,f){return _.getCompDetailsFromGridOptions(l7,"agDragAndDropImage",f,!0)}function R$(_,f,$){return _.getCompDetails(f,_8,void 0,$)}function E8(_,f,$){return _.getCompDetails(f,s7,"agColumnHeader",$)}function U8(_,f,$){return _.getCompDetails(f,a7,void 0,$)}function H8(_,f){let $=f.columnGroup.getColGroupDef();return _.getCompDetails($,e7,"agColumnGroupHeader",f)}function W8(_,f,$){return _.getCompDetails(f,o7,void 0,$)}function B8(_,f){return _.getCompDetailsFromGridOptions(q8,void 0,f,!0)}function K8(_,f){return _.getCompDetailsFromGridOptions(X8,"agLoadingCellRenderer",f,!0)}function L8(_,f){return _.getCompDetailsFromGridOptions(Y8,"agGroupRowRenderer",f,!0)}function F8(_,f){return _.getCompDetailsFromGridOptions(Z8,"agDetailCellRenderer",f,!0)}function U$(_,f,$){return _.getCompDetails(f,f8,void 0,$)}function d2(_,f,$){return _.getCompDetails(f,$8,"agSkeletonCellRenderer",$,!0)}function fX(_,f,$){return _.getCompDetails(f,z8,"agCellEditor",$,!0)}function BJ(_,f,$,z){let Q=f.filter;if(eq(Q))f={filter:Q.component,filterParams:f.filterParams};return _.getCompDetails(f,WJ,z,$,!0)}function D8(_,f){return _.getCompDetails(f.colDef,Q8,"agTooltipComponent",f,!0)}function KJ(_,f,$,z){return _.getCompDetails(f,J8,z,$)}function $X(_,f){return _X(_,f,WJ)}function rQ(_,f,$){return _.mergeParams(f,WJ,$)}var G0=((_)=>{return _[_.ToolPanel=0]="ToolPanel",_[_.HeaderCell=1]="HeaderCell",_[_.RowDrag=2]="RowDrag",_[_.ChartPanel=3]="ChartPanel",_[_.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",_})(G0||{}),M8=class extends d7{createEvent(_){return C(this.gos,_)}createDragImageComp(_){let{gos:f,beans:$}=this;return G8($.userCompFactory,C(f,{dragSource:_}))?.newAgStackInstance()}handleEnter(_,f){_?.onGridEnter?.(f)}handleExit(_,f){_?.onGridExit?.(f)}warnNoBody(){j(54)}isDropZoneWithinThisGrid(_){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(_.dropZoneTarget)}registerGridDropTarget(_,f){let $={getContainer:_,isInterestedIn:(z)=>z===1||z===0,getIconName:()=>"notAllowed"};this.addDropTarget($),f.addDestroyFunc(()=>this.removeDropTarget($))}};var zX="ag-resizer-wrapper",_f=(_,f)=>({tag:"div",ref:`${_}Resizer`,cls:`ag-resizer ag-resizer-${f}`}),k8={tag:"div",cls:zX,children:[_f("eTopLeft","topLeft"),_f("eTop","top"),_f("eTopRight","topRight"),_f("eRight","right"),_f("eBottomRight","bottomRight"),_f("eBottom","bottom"),_f("eBottomLeft","bottomLeft"),_f("eLeft","left")]},LJ=class extends j_{constructor(_,f){super();this.element=_,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...f}}wireBeans(_){this.popupSvc=_.popupSvc,this.dragSvc=_.dragSvc}center(_){let{clientHeight:f,clientWidth:$}=this.offsetParent,z=$/2-this.getWidth()/2,Q=f/2-this.getHeight()/2;this.offsetElement(z,Q,_)}initialisePosition(_){if(this.positioned)return;let{centered:f,forcePopupParentAsOffsetParent:$,minWidth:z,width:Q,minHeight:J,height:q,x:X,y:Y}=this.config;if(!this.offsetParent)this.setOffsetParent();let Z=0,G=0,E=A_(this.element);if(E){let U=this.findBoundaryElement(),H=window.getComputedStyle(U);if(H.minWidth!=null){let W=U.offsetWidth-this.element.offsetWidth;G=Number.parseInt(H.minWidth,10)-W}if(H.minHeight!=null){let W=U.offsetHeight-this.element.offsetHeight;Z=Number.parseInt(H.minHeight,10)-W}}if(this.minHeight=J||Z,this.minWidth=z||G,Q)this.setWidth(Q);if(q)this.setHeight(q);if(!Q||!q)this.refreshSize();if(f)this.center(_);else if(X||Y)this.offsetElement(X,Y,_);else if(E&&$){let U=this.boundaryEl,H=!0;if(!U)U=this.findBoundaryElement(),H=!1;if(U){let W=Number.parseFloat(U.style.top),B=Number.parseFloat(U.style.left);if(H)this.offsetElement(Number.isNaN(B)?0:B,Number.isNaN(W)?0:W,_);else this.setPosition(B,W)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(_,f){if(!this.config.popup||_===this.movable)return;this.movable=_;let $=this.moveElementDragListener||{eElement:f,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};if(_)this.dragSvc?.addDragSource($),this.moveElementDragListener=$;else this.dragSvc?.removeDragSource($),this.moveElementDragListener=void 0}setResizable(_){if(this.clearResizeListeners(),_)this.addResizers();else this.removeResizers();if(typeof _==="boolean"){if(_===!1)return;_={topLeft:_,top:_,topRight:_,right:_,bottomRight:_,bottom:_,bottomLeft:_,left:_}}for(let f of Object.keys(_)){let $=!!_[f],z=this.getResizerElement(f),Q={dragStartPixels:0,eElement:z,onDragStart:(J)=>this.onResizeStart(J,f),onDragging:this.onResize.bind(this),onDragStop:(J)=>this.onResizeEnd(J,f)};if($||!this.isAlive()&&!$){if($)this.dragSvc?.addDragSource(Q),this.resizeListeners.push(Q),z.style.pointerEvents="all";else z.style.pointerEvents="none";this.resizable[f]=$}}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";let{height:_,width:f}=this.lastSize;if(f!==-1)this.element.style.width=`${f}px`;if(_!==-1)this.element.style.height=`${_}px`}getHeight(){return this.element.offsetHeight}setHeight(_){let{popup:f}=this.config,$=this.element,z=!1;if(typeof _==="string"&&_.includes("%"))a1($,_),_=Yq($),z=!0;else if(_=Math.max(this.minHeight,_),this.positioned){let Q=this.getAvailableHeight();if(Q&&_>Q)_=Q}if(this.getHeight()===_)return;if(z)$.style.maxHeight="unset",$.style.minHeight="unset";else if(f)a1($,_);else $.style.height=`${_}px`,$.style.flex="0 0 auto",this.lastSize.height=typeof _==="number"?_:Number.parseFloat(_)}getAvailableHeight(){let{popup:_,forcePopupParentAsOffsetParent:f}=this.config;if(!this.positioned)this.initialisePosition();let{clientHeight:$}=this.offsetParent;if(!$)return null;let z=this.element.getBoundingClientRect(),Q=this.offsetParent.getBoundingClientRect(),J=_?this.position.y:z.top,q=_?0:Q.top,X=0;if(f){let Z=this.element.parentElement;if(Z){let{bottom:G}=Z.getBoundingClientRect();X=G-z.bottom}}return $+q-J-X}getWidth(){return this.element.offsetWidth}setWidth(_){let f=this.element,{popup:$}=this.config,z=!1;if(typeof _==="string"&&_.includes("%"))I0(f,_),_=Zq(f),z=!0;else if(this.positioned){_=Math.max(this.minWidth,_);let{clientWidth:Q}=this.offsetParent,J=$?this.position.x:this.element.getBoundingClientRect().left;if(Q&&_+J>Q)_=Q-J}if(this.getWidth()===_)return;if(z)f.style.maxWidth="unset",f.style.minWidth="unset";else if(this.config.popup)I0(f,_);else f.style.width=`${_}px`,f.style.flex=" unset",this.lastSize.width=typeof _==="number"?_:Number.parseFloat(_)}offsetElement(_=0,f=0,$){let{forcePopupParentAsOffsetParent:z}=this.config,Q=z?this.boundaryEl:this.element;if(!Q)return;this.popupSvc?.positionPopup({ePopup:Q,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:_,y:f}),postProcessCallback:$}),this.setPosition(Number.parseFloat(Q.style.left),Number.parseFloat(Q.style.top))}constrainSizeToAvailableHeight(_){if(!this.config.forcePopupParentAsOffsetParent)return;let f=()=>{let $=this.getAvailableHeight();this.element.style.setProperty("max-height",`${$}px`)};if(_&&this.popupSvc)this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=S0(this.beans,this.popupSvc?.getPopupParent(),f);else if(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber)this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0}setPosition(_,f){this.position.x=_,this.position.y=f}updateDragStartPosition(_,f){this.dragStartPosition={x:_,y:f}}calculateMouseMovement(_){let{e:f,isLeft:$,isTop:z,anywhereWithin:Q,topBuffer:J}=_,q=f.clientX-this.dragStartPosition.x,X=f.clientY-this.dragStartPosition.y,Y=this.shouldSkipX(f,!!$,!!Q,q)?0:q,Z=this.shouldSkipY(f,!!z,J,X)?0:X;return{movementX:Y,movementY:Z}}shouldSkipX(_,f,$,z){let Q=this.element.getBoundingClientRect(),J=this.offsetParent.getBoundingClientRect(),q=this.boundaryEl.getBoundingClientRect(),X=this.config.popup?this.position.x:Q.left,Y=X<=0&&J.left>=_.clientX||J.right<=_.clientX&&J.right<=q.right;if(Y)return!0;if(f)Y=z<0&&_.clientX>X+J.left||z>0&&_.clientXq.right||z>0&&_.clientXq.right||z>0&&_.clientX=_.clientY||J.bottom<=_.clientY&&J.bottom<=q.bottom;if(Y)return!0;if(f)Y=z<0&&_.clientY>X+J.top+$||z>0&&_.clientYq.bottom||z>0&&_.clientY({element:this.element.querySelector(`[data-ref=${f}Resizer]`)});this.resizerMap={topLeft:_("eTopLeft"),top:_("eTop"),topRight:_("eTopRight"),right:_("eRight"),bottomRight:_("eBottomRight"),bottom:_("eBottom"),bottomLeft:_("eBottomLeft"),left:_("eLeft")}}addResizers(){if(this.resizersAdded)return;let _=this.element;if(!_)return;_.appendChild(B_(k8)),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${zX}`)?.remove(),this.resizersAdded=!1}getResizerElement(_){return this.resizerMap[_].element}onResizeStart(_,f){if(this.boundaryEl=this.findBoundaryElement(),!this.positioned)this.initialisePosition();this.currentResizer={isTop:!!f.match(/top/i),isRight:!!f.match(/right/i),isBottom:!!f.match(/bottom/i),isLeft:!!f.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[f].element.classList.add("ag-active");let{popup:$,forcePopupParentAsOffsetParent:z}=this.config;if(!$&&!z)this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop);this.isResizing=!0,this.updateDragStartPosition(_.clientX,_.clientY)}getSiblings(){let f=this.element.parentElement;if(!f)return null;return Array.prototype.slice.call(f.children).filter(($)=>!$.classList.contains("ag-hidden"))}getMinSizeOfSiblings(){let _=this.getSiblings()||[],f=0,$=0;for(let z of _){let Q=!!z.style.flex&&z.style.flex!=="0 0 auto";if(z===this.element)continue;let J=this.minHeight||0,q=this.minWidth||0;if(Q){let X=window.getComputedStyle(z);if(X.minHeight)J=Number.parseInt(X.minHeight,10);if(X.minWidth)q=Number.parseInt(X.minWidth,10)}else J=z.offsetHeight,q=z.offsetWidth;f+=J,$+=q}return{height:f,width:$}}applySizeToSiblings(_){let f=null,$=this.getSiblings();if(!$)return;for(let z=0;z<$.length;z++){let Q=$[z];if(Q===f)continue;if(_)Q.style.height=`${Q.offsetHeight}px`;else Q.style.width=`${Q.offsetWidth}px`;if(Q.style.flex="0 0 auto",Q===this.element)f=$[z+1]}if(f)f.style.removeProperty("height"),f.style.removeProperty("min-height"),f.style.removeProperty("max-height"),f.style.flex="1 1 auto"}isResizable(){return Object.values(this.resizable).some((_)=>_)}onResize(_){if(!this.isResizing||!this.currentResizer)return;let{popup:f,forcePopupParentAsOffsetParent:$}=this.config,{isTop:z,isRight:Q,isBottom:J,isLeft:q}=this.currentResizer,X=Q||q,Y=J||z,{movementX:Z,movementY:G}=this.calculateMouseMovement({e:_,isLeft:q,isTop:z}),E=this.position.x,U=this.position.y,H=0,W=0;if(X&&Z){let B=q?-1:1,K=this.getWidth(),L=K+Z*B,F=!1;if(q){if(H=K-L,E+H<=0||L<=this.minWidth)F=!0,H=0}if(!F)this.setWidth(L)}if(Y&&G){let B=z?-1:1,K=this.getHeight(),L=K+G*B,F=!1;if(z){if(W=K-L,U+W<=0||L<=this.minHeight)F=!0,W=0}else if(!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&Kthis.element.parentElement.offsetHeight)F=!0;if(!F)this.setHeight(L)}if(this.updateDragStartPosition(_.clientX,_.clientY),(f||$)&&H||W)this.offsetElement(E+H,U+W)}onResizeEnd(_,f){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[f].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){let _=this.element;if(this.config.popup){if(!this.config.width)this.setWidth(_.offsetWidth);if(!this.config.height)this.setHeight(_.offsetHeight)}}onMoveStart(_){if(this.boundaryEl=this.findBoundaryElement(),!this.positioned)this.initialisePosition();this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(_.clientX,_.clientY)}onMove(_){if(!this.isMoving)return;let{x:f,y:$}=this.position,z;if(this.config.calculateTopBuffer)z=this.config.calculateTopBuffer();let{movementX:Q,movementY:J}=this.calculateMouseMovement({e:_,isTop:!0,anywhereWithin:!0,topBuffer:z});this.offsetElement(f+Q,$+J),this.updateDragStartPosition(_.clientX,_.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){if(this.config.forcePopupParentAsOffsetParent&&this.popupSvc)this.offsetParent=this.popupSvc.getPopupParent();else this.offsetParent=this.element.offsetParent}findBoundaryElement(){let _=this.element;while(_){if(window.getComputedStyle(_).position!=="static")return _;_=_.parentElement}return this.element}clearResizeListeners(){while(this.resizeListeners.length){let _=this.resizeListeners.pop();this.dragSvc?.removeDragSource(_)}}destroy(){if(super.destroy(),this.moveElementDragListener)this.dragSvc?.removeDragSource(this.moveElementDragListener);this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},j$=class extends LJ{},V=null;function az(_){return typeof _?.getGui==="function"}var QX=class{constructor(_){this.cssClassStates={},this.getGui=_}toggleCss(_,f){if(!_)return;if(_.includes(" ")){let z=(_||"").split(" ");if(z.length>1){for(let Q of z)this.toggleCss(Q,f);return}}if(this.cssClassStates[_]!==f&&_.length)this.getGui()?.classList.toggle(_,f),this.cssClassStates[_]=f}},S8=0,p_=class extends j_{constructor(_,f){super();if(this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=S8++,this.cssManager=new QX(()=>this.eGui),this.componentSelectors=new Map((f??[]).map(($)=>[$.selector,$])),_)this.setTemplate(_)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(_,f){if(_&&this.gos)this.applyElementsToComponent(_),this.createChildComponentsFromTags(_,f)}getCompId(){return this.compId}getDataRefAttribute(_){if(_.getAttribute)return _.getAttribute(Kq);return null}applyElementsToComponent(_,f,$,z=null){if(f===void 0)f=this.getDataRefAttribute(_);if(f){let Q=this[f];if(Q===V)this[f]=z??_;else{let J=$?.[f];if(!this.suppressDataRefValidation&&!J)throw Error(`data-ref: ${f} on ${this.constructor.name} with ${Q}`)}}}createChildComponentsFromTags(_,f){let $=[];for(let z of _.childNodes??[])$.push(z);for(let z of $){if(!(z instanceof HTMLElement))continue;let Q=this.createComponentFromElement(z,(J)=>{let q=J.getGui();if(q)for(let X of z.attributes??[])q.setAttribute(X.name,X.value)},f);if(Q){if(Q.addItems&&z.children.length){this.createChildComponentsFromTags(z,f);let J=Array.prototype.slice.call(z.children);Q.addItems(J)}this.swapComponentForNode(Q,_,z)}else if(z.childNodes)this.createChildComponentsFromTags(z,f)}}createComponentFromElement(_,f,$){let z=_.nodeName,Q=this.getDataRefAttribute(_),J=z.indexOf("AG-")===0,q=J?this.componentSelectors.get(z):null,X=null;if(q){let Y=$&&Q?$[Q]:void 0;X=new q.component(Y),X.setParentComponent(this),this.createBean(X,null,f)}else if(J)throw Error(`selector: ${z}`);return this.applyElementsToComponent(_,Q,$,X),X}swapComponentForNode(_,f,$){let z=_.getGui();f.replaceChild(z,$),f.insertBefore(document.createComment($.nodeName),z),this.addDestroyFunc(this.destroyBean.bind(this,_))}activateTabIndex(_,f){let $=f??this.gos.get("tabIndex");if(!_)_=[];if(!_.length)_.push(this.getGui());for(let z of _)z.setAttribute("tabindex",$.toString())}setTemplate(_,f,$){let z;if(typeof _==="string"||_==null)z=e6(_);else z=B_(_);this.setTemplateFromElement(z,f,$)}setTemplateFromElement(_,f,$,z=!1){if(this.eGui=_,this.suppressDataRefValidation=z,f)for(let Q=0;Qthis.eGui.removeEventListener(_,f))}addCss(_){this.cssManager.toggleCss(_,!0)}removeCss(_){this.cssManager.toggleCss(_,!1)}toggleCss(_,f){this.cssManager.toggleCss(_,f)}registerCSS(_){if(this.css===t2)this.css=[_],this.addGlobalCss();else this.css||(this.css=[]),this.css.push(_)}addGlobalCss(){if(Array.isArray(this.css)){let _="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(let f of this.css??[])this.beans.environment.addGlobalCSS(f,_)}this.css=t2}},t2=Symbol(),w=class extends p_{},lQ,sQ,aQ,oQ,v6,T6,eQ;function ef(){if(lQ===void 0)lQ=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return lQ}function oz(){if(sQ===void 0)sQ=/(firefox)/i.test(navigator.userAgent);return sQ}function JX(){if(aQ===void 0)aQ=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);return aQ}function pf(){if(oQ===void 0)oQ=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return oQ}function I6(_){if(!_)return null;let f=_.tabIndex,$=_.getAttribute("tabIndex");if(f===-1&&($===null||$===""&&!oz()))return null;return f.toString()}function A8(){if(eQ!==void 0)return eQ;if(!document.body)return-1;let _=1e6,f=oz()?6000000:1e9,$=document.createElement("div");document.body.appendChild($);while(!0){let z=_*2;if($.style.height=z+"px",z>f||$.clientHeight!==z)break;else _=z}return $.remove(),eQ=_,_}function FJ(){if(T6==null)qX();return T6}function qX(){let _=document.body,f=document.createElement("div");f.style.width=f.style.height="100px",f.style.opacity="0",f.style.overflow="scroll",f.style.msOverflowStyle="scrollbar",f.style.position="absolute",_.appendChild(f);let $=f.offsetWidth-f.clientWidth;if($===0&&f.clientWidth===0)$=null;if(f.parentNode)f.remove();if($!=null)T6=$,v6=$===0}function XX(){if(v6==null)qX();return v6}var y6=!1,Rz=0;function R8(_){if(Rz>0)return;_.addEventListener("keydown",jz),_.addEventListener("mousedown",jz)}function j8(_){if(Rz>0)return;_.removeEventListener("keydown",jz),_.removeEventListener("mousedown",jz)}function jz(_){let f=y6,$=_.type==="keydown";if($){if(_.ctrlKey||_.metaKey||_.altKey)return}if(f===$)return;y6=$}function V8(_){let f=q_(_);return R8(f),Rz++,()=>{Rz--,j8(f)}}function b1(){return y6}function F0(_,f,$=!1){let z=b4,Q=Xq;if(f)Q+=", "+f;if($)Q+=', [tabindex="-1"]';let J=Array.prototype.slice.apply(_.querySelectorAll(z)).filter((Y)=>{return A_(Y)}),q=Array.prototype.slice.apply(_.querySelectorAll(Q));if(!q.length)return J;return((Y,Z)=>Y.filter((G)=>Z.indexOf(G)===-1))(J,q)}function F_(_,f=!1,$=!1,z=!1){let Q=F0(_,z?".ag-tab-guard":null,$),J=f?b(Q):Q[0];if(J)return J.focus({preventScroll:!0}),!0;return!1}function V_(_,f,$,z){let Q=F0(f,$?':not([tabindex="-1"])':null),J=d(_),q;if($)q=Q.findIndex((Y)=>Y.contains(J));else q=Q.indexOf(J);let X=q+(z?-1:1);if(X<0||X>=Q.length)return null;return Q[X]}function ez(_,f=5){let $=0;while(_&&I6(_)===null&&++$<=f)_=_.parentElement;if(I6(_)===null)return null;return _}var DJ="ag-focus-managed",YX=class extends j_{constructor(_,f={isStopPropagation:()=>!1,stopPropagation:()=>{}},$={}){super();this.eFocusable=_,this.stopPropagationCallbacks=f,this.callbacks=$,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:(z)=>{if(z.defaultPrevented)return;let Q=V_(this.beans,this.eFocusable,!1,z.shiftKey);if(!Q)return;Q.focus(),z.preventDefault()},...$}}postConstruct(){let{eFocusable:_,callbacks:{onFocusIn:f,onFocusOut:$}}=this;if(_.classList.add(DJ),this.addKeyDownListeners(_),f)this.addManagedElementListeners(_,{focusin:f});if($)this.addManagedElementListeners(_,{focusout:$})}addKeyDownListeners(_){this.addManagedElementListeners(_,{keydown:(f)=>{if(f.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(f))return;let{callbacks:$}=this;if($.shouldStopEventPropagation(f)){this.stopPropagationCallbacks.stopPropagation(f);return}if(f.key===S.TAB)$.onTabKeyDown(f);else if($.handleKeyDown)$.handleKeyDown(f)}})}},ZX="__ag_Grid_Stop_Propagation";function n_(_){_[ZX]=!0}function z0(_){return _[ZX]===!0}var Ff={isStopPropagation:z0,stopPropagation:n_},t0=class extends YX{constructor(_,f){super(_,Ff,f)}},O8={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:(_)=>`(${_[0]}, ${_[1]})`,filterSummaryTextQuote:(_)=>`"${_[0]}"`,minDateValidation:(_)=>`Date must be after ${_[0]}`,maxDateValidation:(_)=>`Date must be before ${_[0]}`,strictMinValueValidation:(_)=>`Must be greater than ${_[0]}`,strictMaxValueValidation:(_)=>`Must be less than ${_[0]}`};function GX(_,f,$){return t4(_,O8,f,$)}function P8(_,f){let{debounceMs:$}=_;if(V$(_)){if($!=null)j(71);return 0}return $??f}function V$(_){return(_.buttons?.indexOf("apply")??-1)>=0}var _Q=class extends w{constructor(_,f){super();this.filterNameKey=_,this.cssIdentifier=f,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){let _={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(_,this.getAgComponents()),this.createManagedBean(new t0(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new j$(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(_){}init(_){let f=_;this.setParams(f),this.setModelIntoUi(f.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(_,f){return _===f}refresh(_){let f=_,$=this.params;this.params=f;let{source:z,state:Q,additionalEventAttributes:J}=f;if(z==="colDef")this.updateParams(f,$);let q=this.state;this.state=Q;let X=J?.fromAction;if(X&&X!=="apply"||Q.model!==q.model||!this.areStatesEqual(Q.state,q.state))this.setModelIntoUi(Q.model);return!0}setParams(_){this.params=_,this.state=_.state,this.commonUpdateParams(_)}updateParams(_,f){this.commonUpdateParams(_,f)}commonUpdateParams(_,f){this.applyActive=V$(_),this.setupApplyDebounced()}doesFilterPass(_){j(283);let{getHandler:f,model:$,column:z}=this.params;return f().doesFilterPass({..._,model:$,handlerParams:this.beans.colFilter.getHandlerParams(z)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return j(284),this.params.model!=null}setupApplyDebounced(){let _=P8(this.params,this.defaultDebounceMs),f=c0(this,this.checkApplyDebounce.bind(this),_);this.applyDebounced=()=>{this.debouncePending=!0,f()}}checkApplyDebounce(){if(this.debouncePending)this.debouncePending=!1,this.doApplyModel()}getModel(){return j(285),this.params.model}setModel(_){j(286);let{beans:f,params:$}=this;return f.colFilter.setModelForColumnLegacy($.column,_)}applyModel(_="api"){return this.doApplyModel()}canApply(_){return!0}doApplyModel(_){let{params:f,state:{valid:$=!0,model:z}}=this;if(!$)return!1;let Q=!this.areModelsEqual(f.model,z);if(Q)f.onAction("apply",_);return Q}onNewRowsLoaded(){}onUiChanged(_,f=!1){this.updateUiVisibility();let $=this.getModelFromUi(),z={model:$,state:this.getState(),valid:this.canApply($)};this.state=z;let{params:Q,gos:J,eventSvc:q,applyActive:X}=this;if(Q.onStateChange(z),Q.onUiChange(this.getUiChangeEventParams()),!J.get("enableFilterHandlers"))q.dispatchEvent({type:"filterModified",column:Q.column,filterInstance:this});if(!z.valid)return;if(_??(_=X?void 0:"debounce"),_==="immediately")this.doApplyModel({afterFloatingFilter:f,afterDataChange:!1});else if(_==="debounce")this.applyDebounced()}getState(){return}getUiChangeEventParams(){return}afterGuiAttached(_){this.lastContainerType=_?.container,this.refreshFilterResizer(_?.container)}refreshFilterResizer(_){let{positionableFeature:f,gos:$}=this;if(!f)return;let z=_==="floatingFilter"||_==="columnFilter";if(z)f.restoreLastSize(),f.setResizable($.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0});else f.removeSizeFromEl(),f.setResizable(!1);f.constrainSizeToAvailableHeight(z)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(_,f){return GX(this,_,f)}getPositionableElement(){return this.getGui()}areModelsEqual(_,f){if(_===f||_==null&&f==null)return!0;if(_==null||f==null)return!1;return this.areNonNullModelsEqual(_,f)}};var MJ=class extends p_{isPopup(){return!0}setParentComponent(_){_.addCss("ag-has-popup"),super.setParentComponent(_)}destroy(){let _=this.parentComponent;if(_?.isAlive())_.getGui().classList.remove("ag-has-popup");super.destroy()}},v8=class extends MJ{constructor(){super(...arguments);this.errorMessages=null}init(_){this.params=_,this.initialiseEditor(_),this.eEditor.onValueChange(()=>_.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function kJ(_){let f=_.rowModel;return f.getType()==="clientSide"?f:void 0}var r2="row-group-",T8="t-",I8="b-",y8=0,Df=class{constructor(_){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=y8++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=_}get groupData(){let _=this._groupData;if(_!==void 0)return _;if(this.footer)return this.sibling?.groupData;return this.beans.groupStage?.loadGroupData(this)??null}set groupData(_){this._groupData=_}get primaryRow(){let _=this.footer&&this.sibling?this.sibling:this,{pinnedSibling:f}=_;if(f&&_.rowPinned){if(_=f,_.footer&&_.sibling)_=_.sibling}return _}get allLeafChildren(){let _=this._leafs;return _===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:_}set allLeafChildren(_){this._leafs=_}get expanded(){let _=this.beans.expansionSvc;return _?_.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(_){this._expanded=_}setData(_){this.setDataCommon(_,!1)}updateData(_){this.setDataCommon(_,!0)}setDataCommon(_,f){let{valueCache:$,eventSvc:z}=this.beans,Q=this.data;this.data=_,$?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();let J=this.createDataChangedEvent(_,Q,f);if(this.__localEventService?.dispatchEvent(J),this.sibling){this.sibling.data=_;let X=this.sibling.createDataChangedEvent(_,Q,f);this.sibling.__localEventService?.dispatchEvent(X)}z.dispatchEvent({type:"rowNodeDataChanged",node:this});let q=this.pinnedSibling;if(q)q.data=_,q.__localEventService?.dispatchEvent(q.createDataChangedEvent(_,Q,f)),z.dispatchEvent({type:"rowNodeDataChanged",node:q})}updateDataOnDetailNode(){let _=this.detailNode;if(_)_.data=this.data}createDataChangedEvent(_,f,$){return{type:"dataChanged",node:this,oldData:f,newData:_,update:$}}getRowIndexString(){if(this.rowIndex==null)return e(13),null;if(this.rowPinned==="top")return T8+this.rowIndex;if(this.rowPinned==="bottom")return I8+this.rowIndex;return this.rowIndex.toString()}setDataAndId(_,f){let{selectionSvc:$}=this.beans,z=$?.createDaemonNode?.(this),Q=this.data;if(this.data=_,this.updateDataOnDetailNode(),this.setId(f),$)$.updateRowSelectable(this),$.syncInRowNode(this,z);let J=this.createDataChangedEvent(_,Q,!1);this.__localEventService?.dispatchEvent(J)}setId(_){let f=V6(this.beans.gos);if(f)if(this.data){let $=this.parent?.getRoute()??[];if(this.id=f({data:this.data,parentKeys:$.length>0?$:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(r2))e(14,{groupPrefix:r2})}else this.id=void 0;else this.id=_}setRowTop(_){if(this.oldRowTop=this.rowTop,this.rowTop===_)return;this.rowTop=_,this.dispatchRowEvent("topChanged");let f=_!==null;if(this.displayed!==f)this.displayed=f,this.dispatchRowEvent("displayedChanged")}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(_){this.hovered=_}isHovered(){return this.hovered}setRowHeight(_,f=!1){this.rowHeight=_,this.rowHeightEstimated=f,this.dispatchRowEvent("heightChanged")}setExpanded(_,f,$){this.beans.expansionSvc?.setExpanded(this,_,f,$)}setDataValue(_,f,$){let{colModel:z,valueSvc:Q,gos:J,editSvc:q}=this.beans;if(_==null)return!1;let X=z.getCol(_)??z.getColDefCol(_);if(!X)return!1;if(!this.group){let G=X.getColDef();if(G.pivotValueColumn)X=G.pivotValueColumn}let Y=Q.getValueForDisplay({column:X,node:this,from:"data"}).value;if(J.get("readOnlyEdit")){let{beans:{eventSvc:G},data:E,rowIndex:U,rowPinned:H}=this;return G.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:U,rowPinned:H,column:X,colDef:X.colDef,data:E,node:this,oldValue:Y,newValue:f,value:f,source:$}),!1}if($!=="data"&&q&&!q.committing){let G=q.setDataValue({rowNode:this,column:X},f,$);if(G!=null)return G}let Z=Q.setValue(this,X,f,$);if(this.dispatchCellChangedEvent(X,f,Y),Z)this.pinnedSibling?.dispatchCellChangedEvent(X,f,Y);return Z}getDataValue(_,f="data"){let{colModel:$,valueSvc:z,formula:Q}=this.beans;if(_==null)return;let J=$.getCol(_)??$.getColDefCol(_);if(!J)return;let q=f==="data-raw",X=q||f==="value"?"data":f,Y=z.getValue(J,this,X,q);if(!q){if(Q&&J.isAllowFormula()&&Q.isFormula(Y))Y=Q.resolveValue(J,this);if(f!=="data"&&J.getAggFunc()&&typeof Y==="object"&&Y!=null){if(typeof Y.toNumber==="function")return Y.toNumber();if("value"in Y)return Y.value}}return Y}updateHasChildren(){let _=this.group&&!this.footer||!!this.childrenAfterGroup?.length,{rowChildrenSvc:f}=this.beans;if(f)_=f.getHasChildrenValue(this);if(_!==this.__hasChildren)this.__hasChildren=!!_,this.dispatchRowEvent("hasChildrenChanged")}hasChildren(){if(this.__hasChildren==null)this.updateHasChildren();return this.__hasChildren}dispatchCellChangedEvent(_,f,$){let z={type:"cellChanged",node:this,column:_,newValue:f,oldValue:$};this.__localEventService?.dispatchEvent(z)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();let _=this.rowPinned&&this.pinnedSibling;if(_)return _.isSelected();return this.__selected}depthFirstSearch(_){let f=this.childrenAfterGroup;if(f)for(let $=0,z=f.length;${let $=new Df(f);for(let z of Object.keys(_)){if(b8.has(z))continue;$[z]=_[z]}return $.oldRowTop=null,$},UX=(_,f,$)=>{if(!$)return;let z=$.rowIndex;if(z==null)return;z+=f;let Q=_.getRowCount();while(z>=0&&z{if(!o$)o$=new WeakSet;else if(o$.has(_))return!1;return o$.add(_),!0},u_=class{constructor(_,f=!1){this.eElement=_,this.preventClick=f,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(_,f){let $=this.eventSvc;if(!$){if($===null)return;this.eventSvc=$=new D0;let z=this.onTouchStart.bind(this);this.startListener=z,this.eElement.addEventListener("touchstart",z,{passive:!0})}$.addEventListener(_,f)}removeEventListener(_,f){this.eventSvc?.removeEventListener(_,f)}onTouchStart(_){if(this.touchStart||!x8(_))return;let f=_.touches[0];this.touchStart=f;let $=this.handlers;if(!$.length){let z=this.eElement,Q=z.ownerDocument,J=this.onTouchMove.bind(this),q=this.onTouchEnd.bind(this),X=this.onTouchCancel.bind(this),Y={passive:!0},Z={passive:!1};Xz($,[z,"touchmove",J,Y],[Q,"touchcancel",X,Y],[Q,"touchend",q,Z],[Q,"contextmenu",W1,Z])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{if(this.longPressTimer=0,this.touchStart===f&&!this.moved)this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:f,touchEvent:_})},w8)}onTouchMove(_){let{moved:f,touchStart:$}=this;if(!f&&$){let z=D1($,_.touches);if(z&&!Lq(z,$,4))this.clearLongPress(),this.moved=!0}}onTouchEnd(_){let f=this.touchStart;if(!f||!D1(f,_.changedTouches))return;if(!this.moved)this.eventSvc?.dispatchEvent({type:"tap",touchStart:f}),this.checkDoubleTap(f);if(this.preventClick)W1(_);this.cancel()}onTouchCancel(_){let f=this.touchStart;if(!f||!D1(f,_.changedTouches))return;this.lastTapTime=null,this.cancel()}checkDoubleTap(_){let f=Date.now(),$=this.lastTapTime;if($){if(f-$>C8)this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:_}),f=null}this.lastTapTime=f}cancel(){this.clearLongPress(),_J(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){let _=this.startListener;if(_)this.startListener=null,this.eElement.removeEventListener("touchstart",_);this.cancel(),this.eElement=null,this.eventSvc=null}},N0=((_)=>{return _[_.VALUE=0]="VALUE",_[_.DIMENSION=1]="DIMENSION",_})(N0||{}),N8=1,g8=class{constructor(_){if(this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=N8++,!_?.beanClasses)return;this.beanDestroyComparator=_.beanDestroyComparator,this.init(_)}init(_){this.id=_.id,this.beans.context=this,this.destroyCallback=_.destroyCallback;for(let f of Object.keys(_.providedBeanInstances))this.beans[f]=_.providedBeanInstances[f];for(let f of _.beanClasses){let $=new f;if($.beanName)this.beans[$.beanName]=$;else console.error(`Bean ${f.name} is missing beanName`);this.createdBeans.push($)}for(let f of _.derivedBeans??[]){let{beanName:$,bean:z}=f(this);this.beans[$]=z,this.createdBeans.push(z)}if(_.beanInitComparator)this.createdBeans.sort(_.beanInitComparator);this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(_,f){return this.initBeans([_],f),_}initBeans(_,f){let $=this.beans;for(let z of _)z.preWireBeans?.($),z.wireBeans?.($);for(let z of _)z.preConstruct?.();if(f)_.forEach(f);for(let z of _)z.postConstruct?.()}getBeans(){return this.beans}getBean(_){return this.beans[_]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;let _=this.getBeanInstances();if(this.beanDestroyComparator)_.sort(this.beanDestroyComparator);this.destroyBeans(_),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(_){_?.destroy?.()}destroyBeans(_){if(_)for(let f=0;f<_.length;f++)this.destroyBean(_[f]);return[]}isDestroyed(){return this.destroyed}};function h8(_){return{beanName:"gridApi",bean:_.getBean("apiFunctionSvc").api}}var u8=["licenseManager","environment","eventSvc","gos","paginationAutoPageSizeSvc","apiFunctionSvc","gridApi","registry","agCompUtils","userCompFactory","rowContainerHeight","horizontalResizeSvc","localeSvc","pinnedRowModel","dragSvc","colGroupSvc","visibleCols","popupSvc","selectionSvc","colFilter","quickFilter","filterManager","colModel","headerNavigation","pageBounds","pagination","pageBoundsListener","rowSpanSvc","stickyRowSvc","rowRenderer","expressionSvc","alignedGridsSvc","navigation","valueCache","valueSvc","autoWidthCalc","filterMenuFactory","dragAndDrop","focusSvc","cellNavigation","cellStyles","scrollVisibleSvc","sortSvc","colHover","colAnimation","autoColSvc","selectionColSvc","changeDetectionSvc","animationFrameSvc","undoRedo","colDefFactory","rowStyleSvc","rowNodeBlockLoader","rowNodeSorter","ctrlsSvc","pinnedCols","dataTypeSvc","syncSvc","overlays","stateSvc","expansionSvc","apiEventSvc","ariaAnnounce","menuSvc","colMoves","colAutosize","colFlex","colResize","pivotColsSvc","valueColsSvc","rowGroupColsSvc","colNames","colViewport","pivotResultCols","showRowGroupCols","validation"],l2=Object.fromEntries(u8.map((_,f)=>[_,f]));function i8(_,f){let $=(_.beanName?l2[_.beanName]:void 0)??Number.MAX_SAFE_INTEGER,z=(f.beanName?l2[f.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return $-z}function m8(_,f){if(_?.beanName==="gridDestroySvc")return-1;if(f?.beanName==="gridDestroySvc")return 1;return 0}function g0(_){let{rowIndex:f,rowPinned:$,column:z}=_;return`${f}.${$==null?"null":$}.${z.getId()}`}function C1(_,f){let $=_.column===f.column,z=_.rowPinned===f.rowPinned,Q=_.rowIndex===f.rowIndex;return $&&z&&Q}function Y_(_,f){switch(_.rowPinned){case"top":if(f.rowPinned!=="top")return!0;break;case"bottom":if(f.rowPinned!=="bottom")return!1;break;default:if(v(f.rowPinned))return f.rowPinned!=="top";break}return _.rowIndexE.rowNode.rowIndex===f.rowIndex),Y=X?J:q,Z=($?-1:1)*(X?-1:1),G;for(let E=0;E{if(!z.defaultPrevented&&!t8(z)&&z.key===S.TAB){let Q=z.shiftKey;if(!V_(_,$,!1,Q)){if(q0(_,Q))z.preventDefault()}}}})}function W0(_){return _.gos.get("suppressHeaderFocus")||!!_.overlays?.exclusive}function Vz(_){return _.gos.get("suppressCellFocus")||!!_.overlays?.exclusive}function q0(_,f,$=!1){let z=_.ctrlsSvc.get("gridCtrl"),Q=z.focusNextInnerContainer(f);if(Q===!0)return!0;if(Q===!1)return Q;if($||!f&&!z.isDetailGrid()&&z.isFocusInsideGridBody())z.forceFocusOutOfContainer(f);return!1}function n8(_,f){let $=_.focusSvc,z=$.getFocusedCell();if(z&&f&&C1(z,f)){let{rowIndex:Q,rowPinned:J,column:q}=f;if(sf(_))$.setFocusedCell({rowIndex:Q,column:q,rowPinned:J,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!b1()})}}function d8(_,f){let $=_.getFocusableContainerName();if($==="gridBody")return f();return WX(_,()=>F0(_.getGui(),".ag-tab-guard").length>0)?$:null}function WX(_,f){_.setAllowFocus?.(!0);try{return f()}finally{_.setAllowFocus?.(!1)}}var BX="__ag_Grid_Skip_Focusable_Container";function KX(_){_[BX]=!0}function t8(_){return _[BX]===!0}function LX(_){if(!_.cols)return-1;return _.cols.treeDepth+1}function o_(_){return _.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function RJ(_){let f=[],$=_.ctrlsSvc.getHeaderRowContainerCtrls();for(let z of $){if(!z)continue;let Q=z.getGroupRowCount()||0;for(let J=0;JX)f[J]=Y}}}return f}function r8(_,f){let z=_.colModel.isPivotMode()?s8(_):DX(_),Q=f.getHeaderCellCtrls();for(let J of Q){let{column:q}=J,X=q.getAutoHeaderHeight();if(X!=null&&X>z&&q.isAutoHeaderHeight())z=X}return z}function jJ(_){let $=_.colModel.isPivotMode()?l8(_):fQ(_);return _.colModel.forAllCols((z)=>{let Q=z.getAutoHeaderHeight();if(Q!=null&&Q>$&&z.isAutoHeaderHeight())$=Q}),$}function fQ(_){return _.gos.get("headerHeight")??_.environment.getDefaultHeaderHeight()}function FX(_){return _.gos.get("floatingFiltersHeight")??fQ(_)}function DX(_){return _.gos.get("groupHeaderHeight")??fQ(_)}function l8(_){return _.gos.get("pivotHeaderHeight")??fQ(_)}function s8(_){return _.gos.get("pivotGroupHeaderHeight")??DX(_)}function a8(_,f){return _.headerRowIndex===f.headerRowIndex&&_.column===f.column}function o8(_){return _?.headerRowIndex!=null}var e8=class extends A{setComp(_,f,$){this.comp=_,this.eGui=f;let{beans:z}=this,{headerNavigation:Q,touchSvc:J,ctrlsSvc:q}=z;if(Q)this.createManagedBean(new t0($,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)}));this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,z),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,z)}),this.onPivotModeChanged(z),this.setupHeaderHeight();let X=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:X}),J?.mockHeaderContextMenu(this,X),q.register("gridHeaderCtrl",this)}setupHeaderHeight(){let _=this.setHeaderHeight.bind(this);_(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],_),this.addManagedEventListeners({headerRowsChanged:_,columnHeaderHeightChanged:_,columnGroupHeaderHeightChanged:()=>Y0(this.beans,()=>_()),stylesChanged:_,advancedFilterEnabledChanged:_})}setHeaderHeight(){let{beans:_}=this,f=0,$=RJ(_).reduce((q,X)=>q+X,0),z=jJ(_);if(_.filterManager?.hasFloatingFilters())f+=FX(_);f+=$,f+=z;let Q=_.environment.getHeaderRowBorderWidth(),J=f+Q;if(this.headerHeightWithBorder!==J){this.headerHeightWithBorder=J;let q=`${J}px`;this.comp.setHeightAndMinHeight(q)}if(this.headerHeight!==f)this.headerHeight=f,this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(_){let f=_.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",f),this.comp.toggleCss("ag-pivot-off",!f)}onDisplayedColumnsChanged(_){let $=_.visibleCols.allCols.some((z)=>z.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",$)}onTabKeyDown(_){let f=this.gos.get("enableRtl"),$=_.shiftKey,z=$!==f?"LEFT":"RIGHT",{beans:Q}=this,{headerNavigation:J,focusSvc:q}=Q;if(J.navigateHorizontally(z,!0,_)||!$&&q.focusOverlay(!1)||q0(Q,$,!0))_.preventDefault()}handleKeyDown(_){let f=null,{headerNavigation:$}=this.beans;switch(_.key){case S.LEFT:f="LEFT";case S.RIGHT:{if(!v(f))f="RIGHT";if($.navigateHorizontally(f,!1,_))_.preventDefault();break}case S.UP:f="UP";case S.DOWN:{if(!v(f))f="DOWN";if($.navigateVertically(f,_))_.preventDefault();break}default:return}}onFocusOut(_){let{relatedTarget:f}=_,{eGui:$,beans:z}=this;if(!f&&$.contains(d(z)))return;if(!$.contains(f))z.focusSvc.focusedHeader=null}onHeaderContextMenu(_,f,$){let{menuSvc:z,ctrlsSvc:Q}=this.beans;if(!_&&!$||!z?.isHeaderContextMenuEnabled())return;let{target:J}=_??f;if(J===this.eGui||J===Q.getHeaderRowContainerCtrl()?.eViewport)z.showHeaderContextMenu(void 0,_,$)}},VJ=class extends w{constructor(_,f){super(_);this.ctrl=f}getCtrl(){return this.ctrl}},_G={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},fG=class extends VJ{constructor(_){super(_G,_);this.eResize=V,this.eHeaderCompWrapper=V,this.headerCompVersion=0}postConstruct(){let _=this.getGui(),f=()=>{let z=this.ctrl.getSelectAllGui();if(z)this.eResize.insertAdjacentElement("afterend",z),this.addDestroyFunc(()=>z.remove())},$={setWidth:(z)=>_.style.width=z,toggleCss:(z,Q)=>this.toggleCss(z,Q),setUserStyles:(z)=>F$(_,z),setAriaSort:(z)=>z?T4(_,z):I4(_),setUserCompDetails:(z)=>this.setUserCompDetails(z),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:f,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp($,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),f()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){if(this.headerComp)this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0}setUserCompDetails(_){this.headerCompVersion++;let f=this.headerCompVersion;_.newAgStackInstance().then(($)=>this.afterCompCreated(f,$))}afterCompCreated(_,f){if(_!=this.headerCompVersion||!this.isAlive()){this.destroyBean(f);return}this.destroyHeaderComp(),this.headerComp=f,this.headerCompGui=f.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},$G={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},zG=class extends VJ{constructor(_){super($G,_);this.eResize=V,this.eHeaderCompWrapper=V}postConstruct(){let _=this.getGui(),f=(z,Q)=>Q!=null?_.setAttribute(z,Q):_.removeAttribute(z),$={toggleCss:(z,Q)=>this.toggleCss(z,Q),setUserStyles:(z)=>F$(_,z),setHeaderWrapperHidden:(z)=>{if(z)this.eHeaderCompWrapper.style.setProperty("display","none");else this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:(z)=>{if(z!=null)this.eHeaderCompWrapper.style.setProperty("max-height",`${z}px`);else this.eHeaderCompWrapper.style.removeProperty("max-height");this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",z!=null)},setResizableDisplayed:(z)=>N(this.eResize,z),setWidth:(z)=>_.style.width=z,setAriaExpanded:(z)=>f("aria-expanded",z),setUserCompDetails:(z)=>this.setUserCompDetails(z),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp($,_,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(_){_.newAgStackInstance().then((f)=>this.afterHeaderCompCreated(f))}afterHeaderCompCreated(_){let f=()=>this.destroyBean(_);if(!this.isAlive()){f();return}let $=this.getGui(),z=_.getGui();this.eHeaderCompWrapper.appendChild(z),this.addDestroyFunc(f),this.headerGroupComp=_,this.ctrl.setDragSource($)}},QG={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},JG=class extends VJ{constructor(_){super(QG,_);this.eFloatingFilterBody=V,this.eButtonWrapper=V,this.eButtonShowMainFilter=V}postConstruct(){let _=this.getGui(),f={toggleCss:($,z)=>this.toggleCss($,z),setUserStyles:($)=>F$(_,$),addOrRemoveBodyCssClass:($,z)=>this.eFloatingFilterBody.classList.toggle($,z),setButtonWrapperDisplayed:($)=>N(this.eButtonWrapper,$),setCompDetails:($)=>this.setCompDetails($),getFloatingFilterComp:()=>this.compPromise,setWidth:($)=>_.style.width=$,setMenuIcon:($)=>this.eButtonShowMainFilter.appendChild($)};this.ctrl.setComp(f,_,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(_){if(!_){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=_.newAgStackInstance(),this.compPromise.then((f)=>this.afterCompCreated(f))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(_){if(!_)return;if(!this.isAlive()){this.destroyBean(_);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=_,this.eFloatingFilterBody.appendChild(_.getGui()),_.afterGuiAttached?.()}},qG=class extends w{constructor(_){super({tag:"div",cls:_.headerRowClass,role:"row"});this.ctrl=_,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),Lz(this.getGui(),this.ctrl.getAriaRowIndex());let f={setHeight:($)=>this.getGui().style.height=$,setTop:($)=>this.getGui().style.top=$,setHeaderCtrls:($,z)=>this.setHeaderCtrls($,z),setWidth:($)=>this.getGui().style.width=$,setRowIndex:($)=>Lz(this.getGui(),$)};this.ctrl.setComp(f,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(_,f){if(!this.isAlive())return;let $=this.headerComps;this.headerComps={};for(let z of _){let Q=z.instanceId,J=$[Q];if(delete $[Q],J==null)J=this.createHeaderComp(z),this.getGui().appendChild(J.getGui());this.headerComps[Q]=J}if(Object.values($).forEach((z)=>{z.getGui().remove(),this.destroyBean(z)}),f){let z=Object.values(this.headerComps);z.sort((J,q)=>{let X=J.getCtrl().column.getLeft(),Y=q.getCtrl().column.getLeft();return X-Y});let Q=z.map((J)=>J.getGui());Hq(this.getGui(),Q)}}createHeaderComp(_){let f;switch(this.ctrl.type){case"group":f=new zG(_);break;case"filter":f=new JG(_);break;default:f=new fG(_);break}return this.createBean(f),f.setParentComponent(this),f}},OJ=class extends A{constructor(_,f=!1){super();this.callback=_,this.addSpacer=f}postConstruct(){let _=this.setWidth.bind(this);if(this.addManagedPropertyListener("domLayout",_),this.addManagedEventListeners({columnContainerWidthChanged:_,displayedColumnsChanged:_,leftPinnedWidthChanged:_}),this.addSpacer)this.addManagedEventListeners({rightPinnedWidthChanged:_,scrollVisibilityChanged:_,scrollbarWidthChanged:_});this.setWidth()}setWidth(){let _=S_(this.gos,"print"),{visibleCols:f,scrollVisibleSvc:$}=this.beans,z=f.bodyWidth,Q=f.getColsLeftWidth(),J=f.getDisplayedColumnsRightWidth(),q;if(_)q=z+Q+J;else if(q=z,this.addSpacer){if((this.gos.get("enableRtl")?Q:J)===0&&$.verticalScrollShowing)q+=$.getScrollbarWidth()}this.callback(q)}};function O$(_,f,$){if($)_.addDestroyFunc(()=>f.destroyBean($));return $??_}var PJ=class extends A{constructor(_,f,$,z){super();this.columnOrGroup=_,this.eCell=f,this.colsSpanning=z,this.columnOrGroup=_,this.ariaEl=f.querySelector("[role=columnheader]")||f,this.beans=$}setColsSpanning(_){this.colsSpanning=_,this.onLeftChanged()}getColumnOrGroup(){let{beans:_,colsSpanning:f}=this;if(_.gos.get("enableRtl")&&f)return b(f);return this.columnOrGroup}postConstruct(){let _=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:_}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:_}),this.addManagedPropertyListener("domLayout",_)}setLeftFirstTime(){let{gos:_,colAnimation:f}=this.beans,$=_.get("suppressColumnMoveAnimation"),z=v(this.columnOrGroup.getOldLeft());if(f?.isActive()&&z&&!$)this.animateInLeft();else this.onLeftChanged()}animateInLeft(){let _=this.getColumnOrGroup(),f=this.modifyLeftForPrintLayout(_,_.getOldLeft()),$=this.modifyLeftForPrintLayout(_,_.getLeft());this.setLeft(f),this.actualLeft=$,this.beans.colAnimation.executeNextVMTurn(()=>{if(this.actualLeft===$)this.setLeft($)})}onLeftChanged(){let _=this.getColumnOrGroup(),f=_.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(_,f),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(_,f){let{gos:$,visibleCols:z}=this.beans;if(!S_($,"print"))return f;if(_.getPinned()==="left")return f;let J=z.getColsLeftWidth();if(_.getPinned()==="right"){let q=z.bodyWidth;return J+q+f}return J+f}setLeft(_){if(v(_))this.eCell.style.left=`${_}px`;if(G_(this.columnOrGroup)){let f=this.columnOrGroup.getLeafColumns();if(!f.length)return;if(f.length>1)v4(this.ariaEl,f.length)}}},XG="ag-column-first",YG="ag-column-last";function $Q(_,f,$,z){if(n(_))return[];return kX(_.headerClass,_,f,$,z)}function zQ(_,f,$,z){if(n(_))return[];return kX(_.toolPanelClass,_,f,$,z)}function MX(_,f,$){_.toggleCss(XG,$.isColAtEdge(f,"first")),_.toggleCss(YG,$.isColAtEdge(f,"last"))}function ZG(_,f,$,z){return C(f,{colDef:_,column:$,columnGroup:z})}function kX(_,f,$,z,Q){if(n(_))return[];let J;if(typeof _==="function"){let q=ZG(f,$,z,Q);J=_(q)}else J=_;if(typeof J==="string")return[J];if(Array.isArray(J))return[...J];return[]}var GG=0,SX="headerCtrl",vJ=class extends A{constructor(_,f){super();this.column=_,this.rowCtrl=f,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=_.getUniqueId()+"-"+GG++}postConstruct(){let _=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],_),this.addManagedEventListeners({overlayExclusiveChanged:_})}setComp(_,f,$,z,Q){if(f.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(_,f,$,z,Q),this.reAttemptToFocus)this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0)}shouldStopEventPropagation(_){let{headerRowIndex:f,column:$}=this.beans.focusSvc.focusedHeader,z=$.getDefinition(),Q=z?.suppressHeaderKeyboardEvent;if(!v(Q))return!1;let J=C(this.gos,{colDef:z,column:$,headerRowIndex:f,event:_});return!!Q(J)}getWrapperHasFocus(){return d(this.beans)===this.eGui}setGui(_,f){this.eGui=_,this.addDomData(f),f.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),f.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){let _=this.column.getDefinition();if(!_)return;let{headerStyle:f}=_,$;if(typeof f==="function"){let z=this.getHeaderClassParams();$=f(z)}else $=f;if($)this.comp.setUserStyles($)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(_){let{wrapperElement:f,checkMeasuringCallback:$,compBean:z}=_,{beans:Q}=this,J=(E)=>{if(!this.isAlive()||!z.isAlive())return;let{paddingTop:U,paddingBottom:H,borderBottomWidth:W,borderTopWidth:B}=I1(this.eGui),K=U+H+W+B,F=f.offsetHeight+K;if(E<5){let M=!q_(Q)?.contains(f),k=F==0;if(M||k){S6(()=>J(E+1),"raf",Q);return}}this.setColHeaderHeight(this.column,F)},q=!1,X,Y=()=>{let E=this.column.isAutoHeaderHeight();if(E&&!q)Z();if(!E&&q)G()},Z=()=>{q=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),J(0),X=S0(this.beans,f,()=>J(0))},G=()=>{if(q=!1,X)X();this.comp.toggleCss("ag-header-cell-auto-height",!1),X=void 0};if(Y(),z.addDestroyFunc(()=>G()),z.addManagedListeners(this.column,{widthChanged:()=>q&&J(0)}),z.addManagedEventListeners({sortChanged:()=>{if(q)window.setTimeout(()=>J(0))}}),$)$(Y)}onDisplayedColumnsChanged(){let{comp:_,column:f,beans:$,eGui:z}=this;if(!_||!f||!z)return;MX(_,f,$.visibleCols),zq(z,$.visibleCols.getAriaColIndex(f))}addResizeAndMoveKeyboardListeners(_){_.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){let _=W0(this.beans);if(this.eGui)gf(this.eGui,"tabindex",_?null:"-1")}onGuiKeyDown(_){let f=d(this.beans),$=_.key===S.LEFT||_.key===S.RIGHT;if(this.isResizing)_.preventDefault(),_.stopImmediatePropagation();if(f!==this.eGui||!_.shiftKey&&!_.altKey&&!_.ctrlKey&&!_.metaKey)return;if(this.isResizing||$)_.preventDefault(),_.stopImmediatePropagation();if((_.ctrlKey||_.metaKey)&&oq(_)===S.C)return this.beans.clipboardSvc?.copyToClipboard();if(!$)return;let J=_.key===S.LEFT!==this.gos.get("enableRtl")?"left":"right";if(_.altKey){this.isResizing=!0,this.resizeMultiplier+=1;let q=this.getViewportAdjustedResizeDiff(_);this.resizeHeader(q,_.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(J)}moveHeader(_){this.beans.colMoves?.moveHeader(_,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(_){let f=this.getResizeDiff(_),{pinnedCols:$}=this.beans;return $?$.getHeaderResizeDiff(f,this.column):f}getResizeDiff(_){let{gos:f,column:$}=this,z=_.key===S.LEFT!==f.get("enableRtl"),Q=$.getPinned(),J=f.get("enableRtl");if(Q){if(J!==(Q==="right"))z=!z}return(z?-1:1)*this.resizeMultiplier}onGuiKeyUp(){if(!this.isResizing)return;if(this.resizeToggleTimeout)window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0;this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150)}handleKeyDown(_){let f=this.getWrapperHasFocus();switch(_.key){case S.PAGE_DOWN:case S.PAGE_UP:case S.PAGE_HOME:case S.PAGE_END:if(f)_.preventDefault()}}addDomData(_){let f=SX,{eGui:$,gos:z}=this;tf(z,$,f,this),_.addDestroyFunc(()=>tf(z,$,f,null))}focus(_){if(!this.isAlive())return!1;let{eGui:f}=this;if(!f)this.reAttemptToFocus=!0;else this.lastFocusEvent=_||null,f.focus();return!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){if(this.dragSource)this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null}handleContextMenuMouseEvent(_,f,$){let z=_??f,{menuSvc:Q,gos:J}=this.beans;if(J.get("preventDefaultOnContextMenu"))z.preventDefault();if(Q?.isHeaderContextMenuEnabled($))Q.showHeaderContextMenu($,_,f);this.dispatchColumnMouseEvent("columnHeaderContextMenu",$)}dispatchColumnMouseEvent(_,f){this.eventSvc.dispatchEvent({type:_,column:f})}setColHeaderHeight(_,f){if(!_.setAutoHeaderHeight(f))return;let{eventSvc:$}=this;if(_.isColumn)$.dispatchEvent({type:"columnHeaderHeightChanged",column:_,columns:[_],source:"autosizeColumnHeaderHeight"});else $.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:_,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},EG=class extends vJ{constructor(){super(...arguments);this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(_,f,$,z,Q){this.comp=_;let{rowCtrl:J,column:q,beans:X}=this,{colResize:Y,context:Z,colHover:G,rangeSvc:E}=X,U=O$(this,Z,Q);if(this.setGui(f,U),this.updateState(),this.setupWidth(U),this.setupMovingCss(U),this.setupMenuClass(U),this.setupSortableClass(U),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:z,checkMeasuringCallback:(W)=>this.setRefreshFunction("measuring",W),compBean:U}),this.addColumnHoverListener(U),this.setupFilterClass(U),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(U),this.setupSelectAll(U),this.setupUserComp(),this.refreshAria(),Y)this.resizeFeature=U.createManagedBean(Y.createResizeFeature(J.pinned,q,$,_,this));else N($,!1);G?.createHoverFeature(U,[q],f),E?.createRangeHighlightFeature(U,q,_),U.createManagedBean(new PJ(q,f,X)),U.createManagedBean(new t0(f,{shouldStopEventPropagation:(W)=>this.shouldStopEventPropagation(W),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(U),U.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),U.addManagedListeners(q,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});let H=()=>this.checkDisplayName();U.addManagedEventListeners({columnValueChanged:H,columnRowGroupChanged:H,columnPivotChanged:H,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),U.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(_,f){this.beans.colResize?.resizeHeader(this.column,_,f)}getHeaderClassParams(){let{column:_,beans:f}=this,$=_.colDef;return C(f.gos,{colDef:$,column:_,floatingFilter:!1})}setupUserComp(){let _=this.lookupUserCompDetails();if(_)this.setCompDetails(_)}setCompDetails(_){this.userCompDetails=_,this.comp.setUserCompDetails(_)}lookupUserCompDetails(){let _=this.createParams(),f=this.column.getColDef();return E8(this.beans.userCompFactory,f,_)}createParams(){let{menuSvc:_,sortSvc:f,colFilter:$,gos:z}=this.beans;return C(z,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!_?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!$&&(!this.openFilterEnabled||E_(this.gos)),showColumnMenu:(J,q)=>{_?.showColumnMenu({column:this.column,buttonElement:J,positionBy:"button",onClosedCallback:q})},showColumnMenuAfterMouseClick:(J,q)=>{_?.showColumnMenu({column:this.column,mouseEvent:J,positionBy:"mouse",onClosedCallback:q})},showFilter:(J)=>{_?.showFilterMenu({column:this.column,buttonElement:J,containerType:"columnFilter",positionBy:"button"})},progressSort:(J)=>{f?.progressSort(this.column,!!J,"uiColumnSorted")},setSort:(J,q)=>{f?.setSortForColumn(this.column,e_(J),!!q,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(J,q)=>{z.assertModuleRegistered("Tooltip",3),this.setupTooltip(J,q)}})}setupSelectAll(_){let{selectionSvc:f}=this.beans;if(!f)return;this.selectAllFeature=_.createOptionalManagedBean(f.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),_.addManagedPropertyListener("rowSelection",()=>{let $=f.createSelectAllFeature(this.column);if($&&!this.selectAllFeature)this.selectAllFeature=_.createManagedBean($),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui();else if(this.selectAllFeature&&!$)this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature)})}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(_){if(super.handleKeyDown(_),_.key===S.SPACE)this.selectAllFeature?.onSpaceKeyDown(_);else if(_.key===S.ENTER)this.onEnterKeyDown(_);else if(_.key===S.DOWN&&_.altKey)this.showMenuOnKeyPress(_,!1)}onEnterKeyDown(_){let{column:f,gos:$,sortable:z,beans:Q}=this,J=!1;if(_.ctrlKey||_.metaKey)J=this.showMenuOnKeyPress(_,!0);if(!J){if(!_.altKey&&Gf($))Q.rangeSvc?.handleColumnSelection(f,_);else if(z)Q.sortSvc?.progressSort(f,_.shiftKey,"uiColumnSorted")}}showMenuOnKeyPress(_,f){let $=this.comp.getUserCompInstance();if(!s2($))return!1;if($.onMenuKeyboardShortcut(f))return _.preventDefault(),!0;return!1}onFocusIn(_){if(!this.eGui.contains(_.relatedTarget))this.focusThis(),this.announceAriaDescription();if(b1())this.setActiveHeader(!0)}onFocusOut(_){if(this.eGui.contains(_.relatedTarget))return;this.setActiveHeader(!1)}setupTooltip(_,f){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,_,f)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){let _=()=>{let f=this.column.getColDef(),$=$Q(f,this.gos,this.column,null),z=this.userHeaderClasses;this.userHeaderClasses=new Set($);for(let Q of $)if(z.has(Q))z.delete(Q);else this.comp.toggleCss(Q,!0);for(let Q of z)this.comp.toggleCss(Q,!1)};this.setRefreshFunction("headerClasses",_),_()}setDragSource(_){if(this.dragSourceElement=_,this.removeDragSource(),!_||!this.draggable)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(_,this.column,this.displayName)??null}updateState(){let{menuSvc:_}=this.beans;this.menuEnabled=!!_?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!_?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(_,f){this.refreshFunctions[_]=f}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(let _ of Object.values(this.refreshFunctions))_()}refreshHeaderComp(){let _=this.lookupUserCompDetails();if(!_)return;if(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==_.componentClass?this.attemptHeaderCompRefresh(_.params):!1)this.setDragSource(this.dragSourceElement);else this.setCompDetails(_)}attemptHeaderCompRefresh(_){let f=this.comp.getUserCompInstance();if(!f)return!1;if(!f.refresh)return!1;return f.refresh(_)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){if(this.displayName!==this.calculateDisplayName())this.refresh()}workOutDraggable(){let _=this.column.getColDef();return!this.gos.get("suppressMovableColumns")&&!_.suppressMovable&&!_.lockPosition||!!_.enableRowGroup||!!_.enablePivot}setupWidth(_){let f=()=>{let $=this.column.getActualWidth();this.comp.setWidth(`${$}px`)};_.addManagedListeners(this.column,{widthChanged:f}),f()}setupMovingCss(_){let f=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};_.addManagedListeners(this.column,{movingChanged:f}),f()}setupMenuClass(_){let f=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};_.addManagedListeners(this.column,{menuVisibleChanged:f}),f()}setupSortableClass(_){let f=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};f(),this.setRefreshFunction("updateSortable",f),_.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(_){let f=()=>{let $=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",$),this.refreshAria()};_.addManagedListeners(this.column,{filterActiveChanged:f}),f()}setupWrapTextClass(){let _=()=>{let f=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",f)};_(),this.setRefreshFunction("wrapText",_)}onHeaderHighlightChanged(){let _=this.column.getHighlighted(),f=_===0,$=_===1;this.comp.toggleCss("ag-header-highlight-before",f),this.comp.toggleCss("ag-header-highlight-after",$)}onDisplayedColumnsChanged(){if(super.onDisplayedColumnsChanged(),!this.isAlive())return;this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){let{eGui:_,column:f,comp:$,beans:z}=this,Q=RJ(this.beans),J=Q.reduce((U,H)=>U+H,0)===0;if($.toggleCss("ag-header-parent-hidden",J),!f.isSpanHeaderHeight()){_.style.removeProperty("top"),_.style.removeProperty("height"),$.toggleCss("ag-header-span-height",!1),$.toggleCss("ag-header-span-total",!1);return}let{numberOfParents:q,isSpanningTotal:X}=this.column.getColumnGroupPaddingInfo();$.toggleCss("ag-header-span-height",q>0);let Y=jJ(z);if(q===0){$.toggleCss("ag-header-span-total",!1),_.style.setProperty("top","0px"),_.style.setProperty("height",`${Y}px`);return}$.toggleCss("ag-header-span-total",X);let Z=(this.column.getFirstRealParent()?.getLevel()??-1)+1,G=Q.length-Z,E=0;for(let U=0;UQ==="filter"?-1:J.charCodeAt(0)-Q.charCodeAt(0)).map((Q)=>$.get(Q)).join(". ");_.ariaAnnounce?.announceValue(z,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(_){this.beans.colHover?.addHeaderColumnHoverListener(_,this.comp,this.column)}addActiveHeaderMouseListeners(_){let f=(Q)=>this.handleMouseOverChange(Q.type==="mouseenter"),$=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},z=(Q)=>this.handleContextMenuMouseEvent(Q,void 0,this.column);_.addManagedListeners(this.eGui,{mouseenter:f,mouseleave:f,click:$,contextmenu:z})}handleMouseOverChange(_){this.setActiveHeader(_),this.eventSvc.dispatchEvent({type:_?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(_){this.comp.toggleCss("ag-header-active",_)}getAnchorElementForMenu(_){let f=this.comp.getUserCompInstance();if(s2(f))return f.getAnchorElementForMenu(_);return this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function s2(_){return typeof _?.getAnchorElementForMenu==="function"&&typeof _.onMenuKeyboardShortcut==="function"}var UG=0,_6=class extends A{constructor(_,f,$){super();this.rowIndex=_,this.pinned=f,this.type=$,this.instanceId=UG++,this.comp=null,this.allCtrls=[];let z="ag-header-row-column";if($==="group")z="ag-header-row-group";else if($==="filter")z="ag-header-row-filter";this.headerRowClass=`ag-header-row ${z}`}setRowIndex(_){this.rowIndex=_,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=S_(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){if(!this.comp)return!1;return this.allCtrls.every((_)=>_.eGui!=null)}setComp(_,f,$=!0){if(this.comp=_,f=O$(this,this.beans.context,f),$)this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged();this.setWidth(),this.addEventListeners(f)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(_){let f=this.onRowHeightChanged.bind(this),$=this.onDisplayedColumnsChanged.bind(this);_.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:$,virtualColumnsChanged:(z)=>this.onVirtualColumnsChanged(z.afterScroll),columnGroupHeaderHeightChanged:f,columnHeaderHeightChanged:f,stylesChanged:f,advancedFilterEnabledChanged:f}),_.addManagedPropertyListener("domLayout",$),_.addManagedPropertyListener("ensureDomOrder",(z)=>this.isEnsureDomOrder=z.currentValue),_.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],f)}onDisplayedColumnsChanged(){this.isPrintLayout=S_(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;let _=this.getWidthForRow();this.comp.setWidth(`${_}px`)}getWidthForRow(){let{visibleCols:_}=this.beans;if(this.isPrintLayout){if(this.pinned!=null)return 0;return _.getContainerWidth("right")+_.getContainerWidth("left")+_.getContainerWidth(null)}return _.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;let{topOffset:_,rowHeight:f}=this.getTopAndHeight();this.comp.setTop(_+"px"),this.comp.setHeight(f+"px")}getTopAndHeight(){let _=0,f=RJ(this.beans);for(let Q=0;Q{let{focusSvc:Q,visibleCols:J}=this.beans;if(!Q.isHeaderWrapperFocused(z))return!1;return J.isVisible(z.column)};if(_)for(let[z,Q]of _)if($(Q))this.ctrlsById.set(z,Q);else this.destroyBean(Q);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(_,f,$){if(_.isEmptyGroup())return;let z=_.getUniqueId(),Q;if($)Q=$.get(z),$.delete(z);if(Q&&Q.column!=_)this.destroyBean(Q),Q=void 0;if(Q==null)switch(this.type){case"filter":{Q=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,_,this));break}case"group":Q=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,_,this));break;default:Q=this.createBean(new EG(_,this));break}f.set(z,Q)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];let _=[];for(let f of["left",null,"right"])_.push(...this.getComponentsToRender(f));return _}getComponentsToRender(_=this.pinned){if(this.type==="group")return this.beans.colViewport.getHeadersToRender(_,this.rowIndex);return this.beans.colViewport.getColumnHeadersToRender(_)}focusHeader(_,f){let $=this.allCtrls.find((Q)=>Q.column==_);if(!$)return!1;return $.focus(f)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},HG=class extends A{constructor(_){super();this.pinned=_,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(_,f){this.comp=_,this.eViewport=f;let{pinnedCols:$,ctrlsSvc:z,colModel:Q,colMoves:J}=this.beans;this.setupCenterWidth(),$?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(J,this.eViewport);let q=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:q,advancedFilterEnabledChanged:q});let X=`${typeof this.pinned==="string"?this.pinned:"center"}Header`;if(z.register(X,this),Q.ready)this.refresh()}getAllCtrls(){let _=[...this.groupsRowCtrls];if(this.columnsRowCtrl)_.push(this.columnsRowCtrl);if(this.filtersRowCtrl)_.push(this.filtersRowCtrl);return _}refresh(_=!1){let{focusSvc:f,filterManager:$,visibleCols:z}=this.beans,Q=0,J=f.getFocusHeaderToUseAfterRefresh(),q=()=>{let E=z.headerGroupRowCount;if(Q=E,!_)this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);let U=this.groupsRowCtrls.length;if(U===E)return;if(U>E){for(let H=E;H{let E=Q++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}if(this.columnsRowCtrl==null||!_)this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new _6(E,this.pinned,"column"));else if(this.columnsRowCtrl.rowIndex!==E)this.columnsRowCtrl.setRowIndex(E)},Y=()=>{this.includeFloatingFilter=!!$?.hasFloatingFilters()&&!this.hidden;let E=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){E();return}if(!_)E();let U=Q++;if(this.filtersRowCtrl){if(this.filtersRowCtrl.rowIndex!==U)this.filtersRowCtrl.setRowIndex(U)}else this.filtersRowCtrl=this.createBean(new _6(U,this.pinned,"filter"))},Z=this.getAllCtrls();q(),X(),Y();let G=this.getAllCtrls();if(this.comp.setCtrls(G),this.restoreFocusOnHeader(f,J),Z.length!==G.length)this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(_){let f=($)=>$?.getHeaderCellCtrls().find((z)=>z.column===_);if(Q0(_))return f(this.columnsRowCtrl);if(this.groupsRowCtrls.length===0)return;for(let $=0;$this.comp.setCenterWidth(`${_}px`),!0))}},WG={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},BG={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},KG={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},f6=class extends w{constructor(_){super();this.eCenterContainer=V,this.headerRowComps={},this.rowCompsList=[],this.pinned=_}postConstruct(){this.selectAndSetTemplate();let _={setDisplayed:($)=>this.setDisplayed($),setCtrls:($)=>this.setCtrls($),setCenterWidth:($)=>this.eCenterContainer.style.width=$,setViewportScrollLeft:($)=>this.getGui().scrollLeft=$,setPinnedContainerWidth:($)=>{let z=this.getGui();z.style.width=$,z.style.maxWidth=$,z.style.minWidth=$}};this.createManagedBean(new HG(this.pinned)).setComp(_,this.getGui())}selectAndSetTemplate(){let _=this.pinned=="left",f=this.pinned=="right",$=_?WG:f?BG:KG;this.setTemplate($),this.eRowContainer=this.eCenterContainer!==V?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(_){this.destroyBean(_),_.getGui().remove()}setCtrls(_){let f=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let $,z=(Q)=>{let J=Q.getGui();if(J.parentElement!=this.eRowContainer)this.eRowContainer.appendChild(J);if($)Uq(this.eRowContainer,J,$);$=J};for(let Q of _){let J=Q.instanceId,q=f[J];delete f[J];let X=q?q:this.createBean(new qG(Q));this.headerRowComps[J]=X,this.rowCompsList.push(X),z(X)}for(let Q of Object.values(f))this.destroyRowComp(Q)}},LG={tag:"div",cls:"ag-header",role:"presentation"},FG=class extends w{constructor(){super(LG)}postConstruct(){let _={toggleCss:(z,Q)=>this.toggleCss(z,Q),setHeightAndMinHeight:(z)=>{this.getGui().style.height=z,this.getGui().style.minHeight=z}};this.createManagedBean(new e8).setComp(_,this.getGui(),this.getFocusableElement());let $=(z)=>{this.createManagedBean(z),this.appendChild(z)};$(new f6("left")),$(new f6(null)),$(new f6("right"))}},DG={selector:"AG-HEADER-ROOT",component:FG},B0={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},TJ=class extends A{constructor(_){super();this.view=_}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){let _=this.gos.get("domLayout"),f={autoHeight:_==="autoHeight",normal:_==="normal",print:_==="print"},$=f.autoHeight?B0.AUTO_HEIGHT:f.print?B0.PRINT:B0.NORMAL;this.view.updateLayoutClasses($,f)}},AX=class extends w{constructor(_,f){super();this.direction=f,this.eViewport=V,this.eContainer=V,this.hideTimeout=0,this.setTemplate(_)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",JX()||pf())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.invisibleScrollbar=XX(),this.invisibleScrollbar)this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()}addActiveListenerToggles(){let _=this.getGui(),f=()=>this.toggleCss("ag-scrollbar-active",!0),$=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(_,{mouseenter:f,mousedown:f,touchstart:f,mouseleave:$,touchend:$})}onScrollVisibilityChanged(){if(this.invisibleScrollbar===void 0)this.initialiseInvisibleScrollbar();Y0(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:(_)=>{if(_.direction===this.direction){if(this.hideTimeout)window.clearTimeout(this.hideTimeout),this.hideTimeout=0;this.toggleCss("ag-scrollbar-scrolling",!0)}},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(_){let f=this.eViewport;fJ(this,()=>A_(f),()=>this.setScrollPosition(_),100)}onScrollCallback(_){this.addManagedElementListeners(this.eViewport,{scroll:_})}},MG={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},kG=class extends AX{constructor(){super(MG,"horizontal");this.eLeftSpacer=V,this.eRightSpacer=V,this.setScrollVisibleDebounce=0}wireBeans(_){this.visibleCols=_.visibleCols,this.scrollVisibleSvc=_.scrollVisibleSvc}postConstruct(){super.postConstruct();let _=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:_,displayedColumnsWidthChanged:_,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",_),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new OJ((f)=>this.eContainer.style.width=`${f}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar)this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;let _=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${_}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){let _=this.scrollVisibleSvc.verticalScrollShowing,f=this.visibleCols.getDisplayedColumnsRightWidth(),$=!this.enableRtl&&_,z=this.scrollVisibleSvc.getScrollbarWidth();if($)f+=z;I0(this.eRightSpacer,f),this.eRightSpacer.classList.toggle("ag-scroller-corner",f<=z);let Q=this.visibleCols.getColsLeftWidth();if(this.enableRtl&&_)Q+=z;I0(this.eLeftSpacer,Q),this.eLeftSpacer.classList.toggle("ag-scroller-corner",Q<=z)}setScrollVisible(){let _=this.scrollVisibleSvc.horizontalScrollShowing,f=this.invisibleScrollbar,$=this.gos.get("suppressHorizontalScroll"),z=_?this.scrollVisibleSvc.getScrollbarWidth()||0:0,J=!$?z===0&&f?16:z:0,q=()=>{if(this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",f),a1(this.getGui(),J),a1(this.eViewport,J),a1(this.eContainer,J),!J)this.eContainer.style.setProperty("min-height","1px");this.setVisible(_,{skipAriaHidden:!0})};if(window.clearTimeout(this.setScrollVisibleDebounce),!_)q();else this.setScrollVisibleDebounce=window.setTimeout(q,100)}getScrollPosition(){return Fz(this.eViewport,this.enableRtl)}setScrollPosition(_){if(!A_(this.eViewport))this.attemptSettingScrollPosition(_);Dz(this.eViewport,_,this.enableRtl)}},SG={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:kG},RX=class extends A{constructor(_,f){super();this.eContainer=_,this.eViewport=f}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(_){let f=_.uiContainerHeight,$=f!=null?`${f}px`:"";if(this.eContainer.style.height=$,this.eViewport)this.eViewport.style.height=$}},AG={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},RG=class extends AX{constructor(){super(AG,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new RX(this.eContainer));let{ctrlsSvc:_}=this.beans;_.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,_)})}setScrollVisible(){let{scrollVisibleSvc:_}=this.beans,f=_.verticalScrollShowing,$=this.invisibleScrollbar,z=f?_.getScrollbarWidth()||0:0,Q=z===0&&$?16:z;this.toggleCss("ag-scrollbar-invisible",$),I0(this.getGui(),Q),I0(this.eViewport,Q),I0(this.eContainer,Q),this.setDisplayed(f,{skipAriaHidden:!0})}onRowContainerHeightChanged(_){let $=_.getGridBodyCtrl().eBodyViewport,z=this.getScrollPosition(),Q=$.scrollTop;if(z!=Q)this.setScrollPosition(Q,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(_,f){if(!f&&!A_(this.eViewport))this.attemptSettingScrollPosition(_);this.eViewport.scrollTop=_}},jG={selector:"AG-FAKE-VERTICAL-SCROLL",component:RG};var ff="Viewport",a2="fakeVScrollComp",$6=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],o2=100,z6=150,VG=class extends A{constructor(_){super();this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=_,this.resetLastHScrollDebounced=c0(this,()=>this.lastScrollSource[1]=null,z6),this.resetLastVScrollDebounced=c0(this,()=>this.lastScrollSource[0]=null,z6)}wireBeans(_){this.ctrlsSvc=_.ctrlsSvc,this.animationFrameSvc=_.animationFrameSvc,this.visibleCols=_.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");let _=this.invalidateVerticalScroll.bind(this),f=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:_,scrollGapChanged:f}),this.addManagedElementListeners(this.eBodyViewport,{scroll:_}),this.ctrlsSvc.whenReady(this,($)=>{this.centerRowsCtrl=$.center,this.fakeVScrollComp=$.fakeVScrollComp,this.fakeHScrollComp=$.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,ff)});for(let _ of $6){let f=this.ctrlsSvc.get(_);this.registerScrollPartner(f,this.onHScroll.bind(this,_))}}addVerticalScrollListeners(){let _=this.gos.get("debounceVerticalScrollbar"),f=_?c0(this,this.onVScroll.bind(this,ff),o2):this.onVScroll.bind(this,ff),$=_?c0(this,this.onVScroll.bind(this,a2),o2):this.onVScroll.bind(this,a2);this.addManagedElementListeners(this.eBodyViewport,{scroll:f}),this.registerScrollPartner(this.fakeVScrollComp,$)}registerScrollPartner(_,f){_.onScrollCallback(f)}onDisplayedColumnsWidthChanged(){if(this.enableRtl)this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(_){if(this.centerRowsCtrl==null)return;if(_===void 0)_=this.centerRowsCtrl.getCenterViewportScrollLeft();this.setScrollLeftForAllContainersExceptCurrent(Math.abs(_))}setScrollLeftForAllContainersExceptCurrent(_){for(let f of[...$6,ff]){if(this.lastScrollSource[1]===f)continue;let $=this.getViewportForSource(f);Dz($,_,this.enableRtl)}}getViewportForSource(_){if(_===ff)return this.centerRowsCtrl.eViewport;return this.ctrlsSvc.get(_).eViewport}isControllingScroll(_,f){if(this.lastScrollSource[f]==null){if(f===0)this.lastScrollSource[0]=_;else this.lastScrollSource[1]=_;return!0}return this.lastScrollSource[f]===_}onHScroll(_){if(!this.isControllingScroll(_,1))return;let f=this.centerRowsCtrl.eViewport,{scrollLeft:$}=f;if(this.shouldBlockScrollUpdate(1,$,!0))return;let z=Fz(this.getViewportForSource(_),this.enableRtl);this.doHorizontalScroll(z),this.resetLastHScrollDebounced()}onVScroll(_){if(!this.isControllingScroll(_,0))return;let f=_===ff?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition(),$=f;if(this.shouldBlockScrollUpdate(0,$,!0))return;if(_===ff)this.fakeVScrollComp.setScrollPosition($);else if(this.eBodyViewport.scrollTop=f,$=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),$!==f)this.fakeVScrollComp.setScrollPosition($,!0);let{animationFrameSvc:z}=this;if(z?.setScrollTop($),this.nextScrollTop=$,z?.active)z.schedule();else this.scrollGridIfNeeded(!0);this.resetLastVScrollDebounced()}doHorizontalScroll(_){let f=this.fakeHScrollComp.getScrollPosition();if(this.scrollLeft===_&&_===f)return;this.scrollLeft=_,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(_),this.centerRowsCtrl.onHorizontalViewportChanged(!0)}isScrolling(){return this.isScrollActive}fireScrollEvent(_){let f={type:"bodyScroll",direction:_===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(f),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...f,type:"bodyScrollEnd"})},z6)}shouldBlockScrollUpdate(_,f,$=!1){if($&&!pf())return!1;if(_===0)return this.shouldBlockVerticalScroll(f);return this.shouldBlockHorizontalScroll(f)}shouldBlockVerticalScroll(_){let f=iz(this.eBodyViewport),{scrollHeight:$}=this.eBodyViewport;return _<0||_+f>$}shouldBlockHorizontalScroll(_){let f=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:$}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(_>0)return!0}else if(_<0)return!0;return Math.abs(_)+f>$}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){let _=this.scrollLeft,f=!1;for(let $ of $6)if(this.getViewportForSource($).scrollLeft!==_){f=!0;break}if(f)this.onHScroll(ff)}scrollGridIfNeeded(_=!1){let f=this.scrollTop!=this.nextScrollTop;if(f){if(this.scrollTop=this.nextScrollTop,_)this.invalidateVerticalScroll();this.redrawRowsAfterScroll()}return f}setHorizontalScrollPosition(_,f=!1){let z=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();if(!f&&this.shouldBlockScrollUpdate(1,_))if(this.enableRtl)_=_>0?0:z;else _=Math.min(Math.max(_,0),z);Dz(this.centerRowsCtrl.eViewport,Math.abs(_),this.enableRtl),this.doHorizontalScroll(_)}setVerticalScrollPosition(_){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=_}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){let{lastOffsetHeight:$,lastScrollTop:z}=this;return{top:z,bottom:z+$}}this.isVerticalPositionInvalidated=!1;let{scrollTop:_,offsetHeight:f}=this.eBodyViewport;return this.lastScrollTop=_,this.lastOffsetHeight=f,{top:_,bottom:_+f}}getApproximateVScollPosition(){if(this.lastScrollTop>=0&&this.lastOffsetHeight>=0)return{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight};return this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){if(this.isHorizontalPositionInvalidated)this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1;return this.lastIsHorizontalScrollShowing}scrollHorizontally(_){let f=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(f+_),this.centerRowsCtrl.eViewport.scrollLeft-f}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(_,f=null){let{rowModel:$}=this.beans,z=$.getRowCount(),Q=-1;for(let J=0;J=0)this.ensureIndexVisible(Q,f)}ensureIndexVisible(_,f,$=0){if(S_(this.gos,"print"))return;let{rowModel:z}=this.beans,Q=z.getRowCount();if(typeof _!=="number"||_<0||_>=Q){j(88,{index:_});return}this.clearRetryListeners();let{frameworkOverrides:J,pageBounds:q,rowContainerHeight:X,rowRenderer:Y}=this.beans;J.wrapIncoming(()=>{let Z=this.ctrlsSvc.getGridBodyCtrl(),G=z.getRow(_),E,U,H=0;this.invalidateVerticalScroll();do{let{stickyTopHeight:W,stickyBottomHeight:B}=Z,K=G.rowTop,L=G.rowHeight,F=q.getPixelOffset(),D=G.rowTop-F,M=D+G.rowHeight,k=this.getVScrollPosition(),R=X.divStretchOffset,O=k.top+R,I=k.bottom+R,T=I-O,y=X.getScrollPositionForPixel(D),i=X.getScrollPositionForPixel(M-T),x=Math.min((y+i)/2,D),a=O+W>D,t=I-BT)u=y-W;else u=i+B;if(u!==null)this.setVerticalScrollPosition(u),Y.redraw({afterScroll:!0});E=K!==G.rowTop||L!==G.rowHeight,U=W!==Z.stickyTopHeight||B!==Z.stickyBottomHeight,H++}while((E||U)&&H<10);if(this.animationFrameSvc?.flushAllFrames(),$<10&&(G?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){let W=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{let B=this.getVScrollPosition().top;if(W===B)return;this.clearRetryListeners()},modelUpdated:()=>{if(this.clearRetryListeners(),_>=z.getRowCount())return;this.ensureIndexVisible(_,f,$+1)}})}})}clearRetryListeners(){for(let _ of this.clearRetryListenerFncs)_();this.clearRetryListenerFncs=[]}ensureColumnVisible(_,f="auto"){let{colModel:$,frameworkOverrides:z}=this.beans,Q=$.getCol(_);if(!Q)return;if(Q.isPinned())return;if(!this.visibleCols.isColDisplayed(Q))return;let J=this.getPositionedHorizontalScroll(Q,f);z.wrapIncoming(()=>{if(J!==null)this.centerRowsCtrl.setCenterViewportScrollLeft(J);this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(_,f){let{columnBeforeStart:$,columnAfterEnd:z}=this.isColumnOutsideViewport(_),Q=this.centerRowsCtrl.getCenterWidth()<_.getActualWidth(),J=this.centerRowsCtrl.getCenterWidth(),q=this.enableRtl,X=(q?$:z)||Q,Y=q?z:$;if(f!=="auto")X=f==="start",Y=f==="end";let Z=f==="middle";if(X||Y||Z){let{colLeft:G,colMiddle:E,colRight:U}=this.getColumnBounds(_);if(Z)return E-J/2;if(X)return q?U:G;return q?G-J:U-J}return null}isColumnOutsideViewport(_){let{start:f,end:$}=this.getViewportBounds(),{colLeft:z,colRight:Q}=this.getColumnBounds(_),J=this.enableRtl,q=J?f>Q:$z;return{columnBeforeStart:q,columnAfterEnd:X}}getColumnBounds(_){let f=this.enableRtl,$=this.visibleCols.bodyWidth,z=_.getActualWidth(),Q=_.getLeft(),J=f?-1:1,q=f?$-Q:Q,X=q+z*J,Y=q+z/2*J;return{colLeft:q,colMiddle:Y,colRight:X}}getViewportBounds(){let _=this.centerRowsCtrl.getCenterWidth(),f=this.centerRowsCtrl.getCenterViewportScrollLeft(),$=f,z=_+f;return{start:$,end:z,width:_}}},e2={horizontal:{overflow:(_)=>_.scrollWidth-_.clientWidth,scrollSize:(_)=>_.scrollWidth,clientSize:(_)=>_.clientWidth,opposite:"vertical"},vertical:{overflow:(_)=>_.scrollHeight-_.clientHeight,scrollSize:(_)=>_.scrollHeight,clientSize:(_)=>_.clientHeight,opposite:"horizontal"}};function OG(_,f,$=FJ()||0,z,Q){return jX(_,f,"horizontal",$,z,Q)}function PG(_,f,$=FJ()||0,z,Q){return jX(_,f,"vertical",$,z,Q)}function jX(_,f,$,z,Q,J){let q=e2[$],X=e2[q.opposite],Y=Q?A_(Q):!0,Z=J?A_(J):!0,G=q.overflow(_);if(G<=0)return!1;if(!f||z===0)return!0;let E=X.overflow(f);if(E<=0)return!0;if(G<=z){if(Y&&Z&&vG({candidateOverflow:E,candidateScrollSize:X.scrollSize(f),candidateClientSize:X.clientSize(f),scrollbarWidth:z}))return!1;let U=q.clientSize(_)+z;return q.scrollSize(_)<=U}return!0}function vG({candidateOverflow:_,candidateScrollSize:f,candidateClientSize:$,scrollbarWidth:z}){if(_<=0||_>z)return!1;let Q=$+z;return f>$&&f<=Q}var TG=class extends A{constructor(_){super();this.centerContainerCtrl=_}wireBeans(_){this.scrollVisibleSvc=_.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCtrl=_.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){let{beans:_,centerContainerCtrl:f,gridBodyCtrl:$}=this,z=()=>{Y0(_,()=>{this.onCenterViewportResized()})};f.registerViewportResizeListener(z),$.registerBodyViewportResizeListener(z)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){let{pinnedCols:_,colFlex:f}=this.beans;_?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();let $=this.centerContainerCtrl.getCenterWidth();if($!==this.centerWidth)this.centerWidth=$,f?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0})}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){let _=this.gridBodyCtrl.eBodyViewport,f=iz(_);if(this.bodyHeight!==f)this.bodyHeight=f,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"})}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;let _={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(_)}onHorizontalViewportChanged(){let{centerContainerCtrl:_,beans:f}=this,$=_.getCenterWidth(),z=_.getViewportScrollLeft();f.colViewport.setScrollPosition($,z)}};function VX(_){if(_.altKey||_.ctrlKey||_.metaKey)return!1;return _.key?.length===1}function Uz(_,f,$,z){let Q=f.getColDef().cellRendererParams?.suppressMouseEventHandling;return OX(_,f,$,z,Q)}function IG(_,f,$,z){let Q=f?.suppressMouseEventHandling;return OX(_,void 0,$,z,Q)}function OX(_,f,$,z,Q){if(!Q)return!1;return Q(C(_,{column:f,node:$,event:z}))}function PX(_,f,$){let z=f;while(z){let Q=bq(_,z,$);if(Q)return Q;z=z.parentElement}return null}var Oz="cellCtrl";function P$(_,f){return PX(_,f,Oz)}var Pz="renderedRow";function IJ(_,f){return PX(_,f,Pz)}function b6(_,f,$,z,Q){let J=z?z.getColDef().suppressKeyboardEvent:void 0;if(!J)return!1;let q=C(_,{event:f,editing:Q,column:z,node:$,data:$.data,colDef:z.getColDef()});if(J){if(J(q))return!0}return!1}function yG(_){let{pinnedRowModel:f,rowModel:$,rangeSvc:z,visibleCols:Q}=_;if(!z||Q.allCols.length===0)return;let J=f?.isEmpty("top")??!0,q=f?.isEmpty("bottom")??!0,X=J?null:"top",Y,Z;if(q)Y=null,Z=$.getRowCount()-1;else Y="bottom",Z=f?.getPinnedBottomRowCount()??-1;z.setCellRange({rowStartIndex:0,rowStartPinned:X,rowEndIndex:Z,rowEndPinned:Y})}var bG=class extends A{constructor(_){super();this.element=_}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){let f=this.processKeyboardEvent.bind(this,"keydown");this.addManagedElementListeners(this.element,{["keydown"]:f})}addMouseListeners(){let _="mousedown";if(M6("pointerdown"))_="pointerdown";else if(M6("touchstart"))_="touchstart";let f=["dblclick","contextmenu","mouseover","mouseout","click",_];for(let $ of f){let z=this.processMouseEvent.bind(this,$);this.addManagedElementListeners(this.element,{[$]:z})}}processMouseEvent(_,f){if(!J$(this.beans,f)||z0(f))return;let{cellCtrl:$,rowCtrl:z}=this.getControlsForEventTarget(f.target);if(_==="contextmenu"){if($?.column)$.dispatchCellContextMenuEvent(f);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(f,void 0,z,$)}else{if($)$.onMouseEvent(_,f);if(z)z.onMouseEvent(_,f)}}getControlsForEventTarget(_){let{gos:f}=this;return{cellCtrl:P$(f,_),rowCtrl:IJ(f,_)}}processKeyboardEvent(_,f){let{cellCtrl:$,rowCtrl:z}=this.getControlsForEventTarget(f.target);if(f.defaultPrevented)return;if($)this.processCellKeyboardEvent($,_,f);else if(z?.isFullWidth())this.processFullWidthRowKeyboardEvent(z,_,f)}processCellKeyboardEvent(_,f,$){let z=this.editSvc?.isEditing(_,{withOpenEditor:!0})??!1;if(!b6(this.gos,$,_.rowNode,_.column,z)){if(f==="keydown"){if(!(!z&&this.beans.navigation?.handlePageScrollingKey($)))_.onKeyDown($);if(this.doGridOperations($,z),VX($))_.processCharacter($)}}if(f==="keydown")this.eventSvc.dispatchEvent(_.createEvent($,"cellKeyDown"))}processFullWidthRowKeyboardEvent(_,f,$){let{rowNode:z}=_,{focusSvc:Q,navigation:J}=this.beans,X=Q.getFocusedCell()?.column;if(!b6(this.gos,$,z,X,!1)){let Z=$.key;if(f==="keydown")switch(Z){case S.PAGE_HOME:case S.PAGE_END:case S.PAGE_UP:case S.PAGE_DOWN:J?.handlePageScrollingKey($,!0);break;case S.LEFT:case S.RIGHT:if(!this.gos.get("embedFullWidthRows"))break;case S.UP:case S.DOWN:_.onKeyboardNavigate($);break;case S.TAB:_.onTabKeyDown($);break;default:}}if(f==="keydown")this.eventSvc.dispatchEvent(_.createRowEvent("cellKeyDown",$))}doGridOperations(_,f){if(!_.ctrlKey&&!_.metaKey)return;if(f)return;if(!J$(this.beans,_))return;let $=oq(_),{clipboardSvc:z,undoRedo:Q}=this.beans;if($===S.A)return this.onCtrlAndA(_);if($===S.C)return this.onCtrlAndC(z,_);if($===S.D)return this.onCtrlAndD(z,_);if($===S.V)return this.onCtrlAndV(z,_);if($===S.X)return this.onCtrlAndX(z,_);if($===S.Y)return this.onCtrlAndY(Q);if($===S.Z)return this.onCtrlAndZ(Q,_)}onCtrlAndA(_){let{beans:{rowModel:f,rangeSvc:$,selectionSvc:z},gos:Q}=this;if($&&i_(Q)&&!j7(Q)&&f.isRowsToRender())yG(this.beans);else if(z)z.selectAllRowNodes({source:"keyboardSelectAll",selectAll:gq(Q)});_.preventDefault()}onCtrlAndC(_,f){if(!_||this.gos.get("enableCellTextSelection"))return;let{cellCtrl:$}=this.getControlsForEventTarget(f.target);if(this.editSvc?.isEditing($,{withOpenEditor:!0}))return;f.preventDefault(),_.copyToClipboard()}onCtrlAndX(_,f){if(!_||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;let{cellCtrl:$}=this.getControlsForEventTarget(f.target);if(this.editSvc?.isEditing($,{withOpenEditor:!0}))return;f.preventDefault(),_.cutToClipboard(void 0,"ui")}onCtrlAndV(_,f){let{cellCtrl:$}=this.getControlsForEventTarget(f.target);if(this.editSvc?.isEditing($,{withOpenEditor:!0}))return;if(_&&!this.gos.get("suppressClipboardPaste"))_.pasteFromClipboard()}onCtrlAndD(_,f){if(_&&!this.gos.get("suppressClipboardPaste"))_.copyRangeDown();f.preventDefault()}onCtrlAndZ(_,f){if(!this.gos.get("undoRedoCellEditing")||!_)return;if(f.preventDefault(),f.shiftKey)_.redo("ui");else _.undo("ui")}onCtrlAndY(_){_?.redo("ui")}},e$=(_)=>_.topRowCtrls,_z=(_)=>_.getStickyTopRowCtrls(),fz=(_)=>_.getStickyBottomRowCtrls(),$z=(_)=>_.bottomRowCtrls,zz=(_)=>_.allRowCtrls,Q6=(_)=>_.getCtrls("top"),J6=(_)=>_.getCtrls("center"),q6=(_)=>_.getCtrls("bottom"),CG={center:{type:"center",name:"center-cols",getRowCtrls:zz,getSpannedRowCtrls:J6},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:zz,getSpannedRowCtrls:J6},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:zz,getSpannedRowCtrls:J6},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:zz},topCenter:{type:"center",name:"floating-top",getRowCtrls:e$,getSpannedRowCtrls:Q6},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:e$,getSpannedRowCtrls:Q6},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:e$,getSpannedRowCtrls:Q6},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:e$},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:_z},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:_z},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:_z},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:_z},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:fz},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:fz},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:fz},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:fz},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:$z,getSpannedRowCtrls:q6},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:$z,getSpannedRowCtrls:q6},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:$z,getSpannedRowCtrls:q6},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:$z}};function vX(_){return`ag-${v$(_).name}-viewport`}function TX(_){let f=v$(_);return f.container??`ag-${f.name}-container`}function wG(_){return`ag-${v$(_).name}-spanned-cells-container`}function v$(_){return CG[_]}var xG=["topCenter","topLeft","topRight"],NG=["bottomCenter","bottomLeft","bottomRight"],gG=["center","left","right"],hG=["center","left","right","fullWidth"],uG=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],iG=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],mG=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],IX=["stickyTopCenter","stickyTopLeft","stickyTopRight"],yX=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],cG=[...IX,"stickyTopFullWidth",...yX,"stickyBottomFullWidth"],pG=[...xG,...NG,...gG,...IX,...yX],nG=class extends A{constructor(_){super();this.name=_,this.visible=!0,this.EMPTY_CTRLS=[],this.options=v$(_)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new TG(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(_){this.comp.setOffsetTop(`${_.offset}px`)}registerWithCtrlsService(){if(this.options.fullWidth)return;this.beans.ctrlsSvc.register(this.name,this)}forContainers(_,f){if(_.indexOf(this.name)>=0)f()}setComp(_,f,$,z){this.comp=_,this.eContainer=f,this.eSpannedContainer=$,this.eViewport=z,this.createManagedBean(new bG(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();let{pinnedCols:Q,rangeSvc:J}=this.beans,q=()=>this.onPinnedWidthChanged();if(this.forContainers(iG,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(Q?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:q})}),this.forContainers(mG,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(Q?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:q})}),this.forContainers(hG,()=>this.createManagedBean(new RX(this.eContainer,this.name==="center"?z:void 0))),J)this.forContainers(pG,()=>this.createManagedBean(J.createDragListenerFeature(this.eContainer)));this.forContainers(uG,()=>this.createManagedBean(new OJ((X)=>this.comp.setContainerWidth(`${X}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(_){this.addManagedElementListeners(this.eViewport,{scroll:_})}addListeners(){let{spannedRowRenderer:_,gos:f}=this.beans,$=this.onDisplayedColumnsChanged.bind(this);if(this.addManagedEventListeners({displayedColumnsChanged:$,displayedColumnsWidthChanged:$,displayedRowsChanged:(z)=>this.onDisplayedRowsChanged(z.afterScroll)}),$(),this.onDisplayedRowsChanged(),_&&this.options.getSpannedRowCtrls&&f.get("enableCellSpan"))this.addManagedListeners(_,{spannedRowsUpdated:()=>{let z=this.options.getSpannedRowCtrls(_);if(!z)return;this.comp.setSpannedRowCtrls(z,!1)}})}listenOnDomOrder(){if(cG.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}let f=()=>{let $=this.gos.get("ensureDomOrder"),z=S_(this.gos,"print");this.comp.setDomOrder($||z)};this.addManagedPropertyListener("domLayout",f),f()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){let{dragSvc:_}=this.beans;if(!_)return;let f=($)=>{if(_.dragging){if($.cancelable)$.preventDefault()}};this.eContainer.addEventListener("touchmove",f,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",f))}onHorizontalViewportChanged(_=!1){let f=this.getCenterWidth(),$=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(f,$,_)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return df(this.eViewport)}getCenterViewportScrollLeft(){return Fz(this.eViewport,this.enableRtl)}registerViewportResizeListener(_){let f=S0(this.beans,this.eViewport,_);this.addDestroyFunc(()=>f())}isViewportInTheDOMTree(){return Eq(this.eViewport)}getViewportScrollLeft(){return Fz(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){let{beans:_,gos:f,eViewport:$}=this,z=f.get("alwaysShowHorizontalScroll"),{ctrlsSvc:Q}=_,J=Q.getGridBodyCtrl()?.eBodyViewport,q=Q.get("fakeHScrollComp")?.getGui(),X=Q.get("fakeVScrollComp")?.getGui();return z||OG($,J,void 0,q,X)}setHorizontalScroll(_){this.comp.setHorizontalScroll(_)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(_){Dz(this.eViewport,_,this.enableRtl)}isContainerVisible(){return this.options.pinnedType==null||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){let _=this.isContainerVisible();if(this.visible!=_)this.visible=_,this.onDisplayedRowsChanged()}onDisplayedRowsChanged(_=!1){let f=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||f.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}let $=S_(this.gos,"print"),Q=this.gos.get("embedFullWidthRows")||$,J=f.filter((q)=>{let X=q.isFullWidth();return this.options.fullWidth?!Q&&X:Q||!X});this.comp.setRowCtrls({rowCtrls:J,useFlushSync:_})}},bX="ag-force-vertical-scroll",dG="ag-selectable",tG="ag-column-moving",rG=class extends A{constructor(){super(...arguments);this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(_){this.ctrlsSvc=_.ctrlsSvc,this.colModel=_.colModel,this.scrollVisibleSvc=_.scrollVisibleSvc,this.pinnedRowModel=_.pinnedRowModel,this.filterManager=_.filterManager,this.rowGroupColsSvc=_.rowGroupColsSvc}setComp(_,f,$,z,Q,J,q){this.comp=_,this.eGridBody=f,this.eBodyViewport=$,this.eTop=z,this.eBottom=Q,this.eStickyTop=J,this.eStickyBottom=q,this.eCenterColsViewport=$.querySelector(`.${vX("center")}`),this.eFullWidthContainer=$.querySelector(`.${TX("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(X)=>this.setCellTextSelection(X.currentValue)),this.createManagedBean(new TJ(this.comp)),this.scrollFeature=this.createManagedBean(new VG($)),this.beans.rowDragSvc?.setupRowDrag($,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([z,$,Q,J,q]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(z),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){let _=this.setFloatingHeights.bind(this),f=this.setGridRootRole.bind(this),$=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:_,pinnedHeightChanged:_,pinnedRowsChanged:_,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:f,columnPivotChanged:f,rowResizeStarted:$,rowResizeEnded:$}),this.addManagedPropertyListener("treeData",f)}toggleRowResizeStyles(_){let f=_.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",f)}onGridColumnsChanged(){let _=this.beans.colModel.getCols();this.comp.setColumnCount(_.length)}onScrollVisibilityChanged(){let{scrollVisibleSvc:_}=this,f=_.verticalScrollShowing;this.setVerticalScrollPaddingVisible(f),this.setStickyWidth(f),this.setStickyBottomOffsetBottom();let $=f?_.getScrollbarWidth()||0:0,z=XX()?16:0,Q=`calc(100% + ${$+z}px)`;Y0(this.beans,()=>this.comp.setBodyViewportWidth(Q)),this.updateScrollingClasses()}setGridRootRole(){let{rowGroupColsSvc:_,colModel:f,gos:$}=this,z=$.get("treeData");if(!z){let Q=f.isPivotMode();z=(!_?0:_.columns.length)>=(Q?2:1)}this.comp.setGridRootRole(z?"treegrid":"grid")}addFocusListeners(_){for(let f of _)this.addManagedElementListeners(f,{focusin:($)=>{let{target:z}=$,Q=uf(z,"ag-root",f);f.classList.toggle("ag-has-focus",!Q)},focusout:($)=>{let{target:z,relatedTarget:Q}=$,J=f.contains(Q),q=uf(Q,"ag-root",f);if(uf(z,"ag-root",f))return;if(!J||q)f.classList.remove("ag-has-focus")}})}setColumnMovingCss(_){this.comp.setColumnMovingCss(tG,_)}setCellTextSelection(_=!1){this.comp.setCellSelectableCss(dG,_)}updateScrollingClasses(){let{eGridBody:{classList:_},scrollVisibleSvc:f}=this;_.toggle("ag-body-vertical-content-no-gap",!f.verticalScrollGap),_.toggle("ag-body-horizontal-content-no-gap",!f.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:(_)=>{if(_.target instanceof HTMLImageElement)return _.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){let _=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:f}=this.beans,$=f.isLastRowIndexKnown()?f.getRowCount():-1,z=$===-1?-1:_+$;this.comp.setRowCount(z)}registerBodyViewportResizeListener(_){this.comp.registerBodyViewportResizeListener(_)}setVerticalScrollPaddingVisible(_){let f=_?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(f)}isVerticalScrollShowing(){let{gos:_,comp:f,ctrlsSvc:$}=this,z=_.get("alwaysShowVerticalScroll"),Q=z?bX:null,J=S_(_,"normal");f.setAlwaysVerticalScrollClass(Q,z);let q=$.get("center")?.eViewport,X=$.get("fakeHScrollComp")?.getGui(),Y=$.get("fakeVScrollComp")?.getGui();return z||J&&PG(this.eBodyViewport,q,void 0,Y,X)}setupRowAnimationCssClass(){let{rowContainerHeight:_,environment:f}=this.beans,$=f.sizesMeasured,z=()=>{let Q=$&&S1(this.gos)&&!_.stretching,J=Q?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(J,Q)};z(),this.addManagedEventListeners({heightScaleChanged:z}),this.addManagedPropertyListener("animateRows",z),this.addManagedEventListeners({stylesChanged:()=>{if(!$&&f.sizesMeasured)$=!0,z()}})}addBodyViewportListener(){let{eBodyViewport:_,eStickyTop:f,eStickyBottom:$,eTop:z,eBottom:Q,beans:{popupSvc:J,touchSvc:q}}=this,X=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(_,{contextmenu:X}),q?.mockBodyContextMenu(this,X),this.addManagedElementListeners(_,{wheel:this.onBodyViewportWheel.bind(this,J)});let Y=this.onStickyWheel.bind(this);for(let G of[f,$,z,Q])this.addManagedElementListeners(G,{wheel:Y});let Z=this.onHorizontalWheel.bind(this);for(let G of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(G).eContainer,{wheel:Z});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:(_)=>this.onFullWidthContainerWheel(_)})}onFullWidthContainerWheel(_){let{deltaX:f,deltaY:$,shiftKey:z}=_;if((z||Math.abs(f)>Math.abs($))&&J$(this.beans,_))this.scrollGridBodyToMatchEvent(_)}onStickyWheel(_){let{deltaY:f}=_;if(this.scrollVertically(f)>0)_.preventDefault()}onHorizontalWheel(_){let{deltaX:f,deltaY:$,shiftKey:z}=_;if(!(z||Math.abs(f)>Math.abs($)))return;this.scrollGridBodyToMatchEvent(_)}scrollGridBodyToMatchEvent(_){let{deltaX:f,deltaY:$}=_;_.preventDefault(),this.eCenterColsViewport.scrollBy({left:f||$})}onBodyViewportContextMenu(_,f,$){if(!_&&!$)return;if(this.gos.get("preventDefaultOnContextMenu"))(_||$).preventDefault();let{target:z}=_||f;if(z===this.eBodyViewport||z===this.ctrlsSvc.get("center").eViewport)this.beans.contextMenuSvc?.showContextMenu({mouseEvent:_,touchEvent:$,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(_,f){if(!this.gos.get("suppressScrollWhenPopupsAreOpen"))return;if(_?.hasAnchoredPopup())f.preventDefault()}scrollVertically(_){let f=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(f+_),this.eBodyViewport.scrollTop-f}setFloatingHeights(){let{pinnedRowModel:_,beans:{environment:f}}=this,$=_?.getPinnedTopTotalHeight(),z=_?.getPinnedBottomTotalHeight(),Q=f.getPinnedRowBorderWidth(),J=f.getRowBorderWidth(),q=Q-J,X=!$?0:q+$,Y=!z?0:q+z;this.comp.setTopHeight(X),this.comp.setBottomHeight(Y),this.comp.setTopInvisible(X<=0),this.comp.setBottomInvisible(Y<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(_=0){this.comp.setStickyTopHeight(`${_}px`),this.stickyTopHeight=_}setStickyBottomHeight(_=0){this.comp.setStickyBottomHeight(`${_}px`),this.stickyBottomHeight=_}setStickyWidth(_){if(!_)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{let f=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${f}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${f}px)`)}}setStickyTopOffsetTop(){let f=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),$=this.pinnedRowModel?.getPinnedTopTotalHeight()??0,z=0;if(f>0)z+=f;if($>0)z+=$;if(z>0)z+=1;this.comp.setStickyTopTop(`${z}px`)}setStickyBottomOffsetBottom(){let{pinnedRowModel:_,scrollVisibleSvc:f,comp:$}=this,z=_?.getPinnedBottomTotalHeight()??0,J=f.horizontalScrollShowing?f.getScrollbarWidth()||0:0,q=z+J;$.setStickyBottomBottom(`${q}px`)}};function z_(_){return B_(_)}var lG=class extends w{constructor(_,f,$,z,Q){super();this.cellCtrl=f,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=_,this.gos=_.gos,this.column=f.column,this.rowNode=f.rowNode,this.eRow=z;let J=z_({tag:"div",role:f.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":f.column.colIdSanitised}});this.eCell=J;let q;if(f.isCellSpanning())q=z_({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),q.appendChild(J),this.setTemplateFromElement(q);else this.setTemplateFromElement(J);this.cellCssManager=new QX(()=>J),this.forceWrapper=f.isForceWrapper(),this.refreshWrapper(!1);let X={toggleCss:(Y,Z)=>this.cellCssManager.toggleCss(Y,Z),setUserStyles:(Y)=>F$(J,Y),getFocusableElement:()=>J,setIncludeSelection:(Y)=>this.includeSelection=Y,setIncludeRowDrag:(Y)=>this.includeRowDrag=Y,setIncludeDndSource:(Y)=>this.includeDndSource=Y,setRowResizerElement:(Y)=>this.setRowResizerElement(Y),setRenderDetails:(Y,Z,G)=>this.setRenderDetails(Y,Z,G),setEditDetails:(Y,Z,G)=>this.setEditDetails(Y,Z,G),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(Y,Z)=>this.refreshEditStyles(Y,Z)};f.setComp(X,J,q,this.eCellWrapper,$,Q,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(_){if(this.rowResizerElement)T_(this.rowResizerElement);if(this.rowResizerElement=_,_)this.eCell.appendChild(_)}setRenderDetails(_,f,$){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;let Q=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),_){if(!($||Q?!1:this.refreshCellRenderer(_)))this.destroyRenderer(),this.createCellRendererInstance(_)}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(f);if(this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement)this.eCell.appendChild(this.rowResizerElement)}setEditDetails(_,f,$){if(_)this.createCellEditorInstance(_,f,$);else this.destroyEditor()}removeControls(){let _=this.beans.context;this.checkboxSelectionComp=_.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=_.destroyBean(this.dndSourceComp),this.rowDraggingComp=_.destroyBean(this.rowDraggingComp)}refreshWrapper(_){let f=this.includeRowDrag||this.includeDndSource||this.includeSelection,$=f||this.forceWrapper,z=$&&this.eCellWrapper==null;if(z)this.eCellWrapper=z_({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper);let Q=!$&&this.eCellWrapper!=null;if(Q)T_(this.eCellWrapper),this.eCellWrapper=void 0;this.cellCssManager.toggleCss("ag-cell-value",!$);let J=!_&&$,q=J&&this.eCellValue==null;if(q){let Z=this.cellCtrl.getCellValueClass();this.eCellValue=z_({tag:"span",cls:Z,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}let X=!J&&this.eCellValue!=null;if(X)T_(this.eCellValue),this.eCellValue=void 0;let Y=z||Q||q||X;if(Y)this.removeControls();if(!_&&f)this.addControls();return Y}addControls(){let{cellCtrl:_,eCellWrapper:f,eCellValue:$,includeRowDrag:z,includeDndSource:Q,includeSelection:J}=this,q=(X)=>{if(X)f.insertBefore(X.getGui(),$)};if(z&&this.rowDraggingComp==null)this.rowDraggingComp=_.createRowDragComp(),q(this.rowDraggingComp);if(Q&&this.dndSourceComp==null)this.dndSourceComp=_.createDndSource(),q(this.dndSourceComp);if(J&&this.checkboxSelectionComp==null)this.checkboxSelectionComp=_.createSelectionCheckbox(),q(this.checkboxSelectionComp)}createCellEditorInstance(_,f,$){let z=this.editorVersion,Q=_.newAgStackInstance(),{params:J}=_;if(Q.then((X)=>this.afterCellEditorCreated(z,X,J,f,$)),n(this.cellEditor)&&J.cellStartedEdit)this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(_){let f=this.getParentOfValue();f_(f);let $=L$(_);if($!=null)f.textContent=$}destroyRenderer(){let{context:_}=this.beans;this.cellRenderer=_.destroyBean(this.cellRenderer),T_(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){let{context:_}=this.beans;if(this.cellEditorPopupWrapper?.getGui().contains(d(this.beans))||this.cellCtrl.hasBrowserFocus())this.eCell.focus({preventScroll:!0});this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=_.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=_.destroyBean(this.cellEditorPopupWrapper),T_(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(_){if(this.cellRenderer?.refresh==null)return!1;if(this.cellRendererClass!==_.componentClass)return!1;let f=this.cellRenderer.refresh(_.params);return f===!0||f===void 0}createCellRendererInstance(_){let f=this.rendererVersion,$=(J)=>(q)=>{if(this.rendererVersion!==f||!this.isAlive())return;let Y=J.newAgStackInstance(),Z=this.afterCellRendererCreated.bind(this,f,J.componentClass);Y?.then(Z)},{animationFrameSvc:z}=this.beans,Q;if(z?.active&&this.firstRender)Q=(J,q=!1)=>{z.createTask($(J),this.rowNode.rowIndex,"p2",J.componentFromFramework,q)};else Q=(J)=>$(J)();if(_.params?.deferRender&&!this.cellCtrl.rowNode.group){let{loadingComp:J,onReady:q}=this.cellCtrl.getDeferLoadingCellRenderer();if(J)Q(J),q.then(()=>Q(_,!0))}else Q(_)}afterCellRendererCreated(_,f,$){if(!this.isAlive()||_!==this.rendererVersion){this.beans.context.destroyBean($);return}this.cellRenderer=$,this.cellRendererClass=f;let Q=$.getGui();if(this.cellRendererGui=Q,Q!=null){let J=this.getParentOfValue();f_(J),J.appendChild(Q)}}afterCellEditorCreated(_,f,$,z,Q){let J=_!==this.editorVersion,{context:q}=this.beans;if(J){q.destroyBean(f);return}if(f.isCancelBeforeStart?.()){q.destroyBean(f),this.cellCtrl.stopEditing(!0);return}if(!f.getGui){j(97,{colId:this.column.getId()}),q.destroyBean(f);return}this.cellEditor=f,this.cellEditorGui=f.getGui();let Y=z||f.isPopup?.();if(Y)this.addPopupCellEditor($,Q);else this.addInCellEditor();this.refreshEditStyles(!0,Y),f.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(f),this.cellCtrl.cellEditorAttached()}refreshEditStyles(_,f){let{cellCssManager:$}=this;$.toggleCss("ag-cell-inline-editing",_&&!f),$.toggleCss("ag-cell-popup-editing",_&&!!f),$.toggleCss("ag-cell-not-inline-editing",!_||!!f)}addInCellEditor(){let{eCell:_}=this;if(_.contains(d(this.beans)))_.focus();if(this.destroyRenderer(),this.refreshWrapper(!0),f_(this.getParentOfValue()),this.cellEditorGui)this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(_,f){let{gos:$,context:z,popupSvc:Q,editSvc:J}=this.beans;if($.get("editType")==="fullRow")j(98);let q=this.cellEditorPopupWrapper=z.createBean(J.createPopupEditorWrapper(_)),{cellEditor:X,cellEditorGui:Y,eCell:Z,rowNode:G,column:E,cellCtrl:U}=this,H=q.getGui();if(Y)H.appendChild(Y);let W=$.get("stopEditingWhenCellsLoseFocus"),B=f!=null?f:X.getPopupPosition?.()??"over",K=$.get("enableRtl"),L={ePopup:H,additionalParams:{column:E,rowNode:G},type:"popupCellEditor",eventSource:Z,position:B,alignSide:K?"right":"left",keepWithinBounds:!0},F=Q.positionPopupByComponent.bind(Q,L),D=Q.addPopup({modal:W,eChild:H,closeOnEsc:!0,closedCallback:(M)=>{U.onPopupEditorClosed(M)},anchorToElement:Z,positionCallback:F,ariaOwns:Z});if(D)this.hideEditorPopup=D.hideFunc}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},sG=class extends w{constructor(_,f,$){super();this.cellComps=new Map,this.beans=f,this.rowCtrl=_;let z=z_({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(z,$),this.setTemplateFromElement(z);let Q=z.style;this.domOrder=this.rowCtrl.getDomOrder();let J={setDomOrder:(q)=>this.domOrder=q,setCellCtrls:(q)=>this.setCellCtrls(q),showFullWidth:(q)=>this.showFullWidth(q),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(q,X)=>this.toggleCss(q,X),setUserStyles:(q)=>F$(z,q),setTop:(q)=>Q.top=q,setTransform:(q)=>Q.transform=q,setRowIndex:(q)=>z.setAttribute("row-index",q),setRowId:(q)=>z.setAttribute("row-id",q),setRowBusinessKey:(q)=>z.setAttribute("row-business-key",q),refreshFullWidth:(q)=>{let X=q();return this.fullWidthCellRendererParams=X,this.fullWidthCellRenderer?.refresh?.(X)??!1}};_.setComp(J,this.getGui(),$,void 0),this.addDestroyFunc(()=>{_.unsetComp($)})}setInitialStyle(_,f){let $=this.rowCtrl.getInitialTransform(f);if($)_.style.setProperty("transform",$);else{let z=this.rowCtrl.getInitialRowTop(f);if(z)_.style.setProperty("top",z)}}showFullWidth(_){let f=(z)=>{if(this.isAlive()){let Q=z.getGui();this.getGui().appendChild(Q),this.rowCtrl.setupDetailRowAutoHeight(Q),this.setFullWidthRowComp(z,_.params)}else this.beans.context.destroyBean(z)};_.newAgStackInstance().then(f)}setCellCtrls(_){let f=new Map(this.cellComps);for(let $ of _){let z=$.instanceId;if(!this.cellComps.has(z))this.newCellComp($);else f.delete(z)}this.destroyCells(f),this.ensureDomOrder(_)}ensureDomOrder(_){if(!this.domOrder)return;let f=[];for(let $ of _){let z=this.cellComps.get($.instanceId);if(z)f.push(z.getGui())}Hq(this.getGui(),f)}newCellComp(_){let f=this.beans.editSvc?.isEditing(_,{withOpenEditor:!0})??!1,$=new lG(this.beans,_,this.rowCtrl.printLayout,this.getGui(),f);this.cellComps.set(_.instanceId,$),this.getGui().appendChild($.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(_,f){this.fullWidthCellRenderer=_,this.fullWidthCellRendererParams=f,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(_){for(let f of _.values()){if(!f)continue;let $=f.cellCtrl.instanceId;if(this.cellComps.get($)!==f)continue;f.detach(),f.destroy(),this.cellComps.delete($)}}};function aG(_,f,$){let z=!!$.gos.get("enableCellSpan")&&!!f.getSpannedRowCtrls,Q={tag:"div",ref:"eContainer",cls:TX(_),role:"rowgroup"};if(f.type==="center"||z){let J={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${wG(_)}`,role:"presentation"};return Q.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${vX(_)}`,role:"rowgroup",children:[Q,z?J:null]}}return Q}var oG=class extends w{constructor(_){super();this.eViewport=V,this.eContainer=V,this.eSpannedContainer=V,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=_?.name,this.options=v$(this.name)}postConstruct(){this.setTemplate(aG(this.name,this.options,this.beans));let _={setHorizontalScroll:($)=>this.eViewport.scrollLeft=$,setViewportHeight:($)=>this.eViewport.style.height=$,setRowCtrls:({rowCtrls:$})=>this.setRowCtrls($),setSpannedRowCtrls:($)=>this.setRowCtrls($,!0),setDomOrder:($)=>{this.domOrder=$},setContainerWidth:($)=>{if(this.eContainer.style.width=$,this.eSpannedContainer)this.eSpannedContainer.style.width=$},setOffsetTop:($)=>{let z=`translateY(${$})`;if(this.eContainer.style.transform=z,this.eSpannedContainer)this.eSpannedContainer.style.transform=z}};this.createManagedBean(new nG(this.name)).setComp(_,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(_,f){let{beans:$,options:z}=this,Q=f?this.eSpannedContainer:this.eContainer,J=f?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},q={};if(f)this.rowCompsWithSpan=q;else this.rowCompsNoSpan=q;this.lastPlacedElement=null;let X=[];for(let Y of _){let Z=Y.instanceId,G=J[Z],E;if(G)E=G,delete J[Z];else{if(!Y.rowNode.displayed)continue;E=new sG(Y,$,z.type)}q[Z]=E,X.push([E,!G])}this.removeOldRows(Object.values(J)),this.addRowNodes(X,Q)}addRowNodes(_,f){let{domOrder:$}=this;for(let[z,Q]of _){let J=z.getGui();if(!$){if(Q)f.appendChild(J)}else this.ensureDomOrder(J,f)}}removeOldRows(_){for(let f of _)f.getGui().remove(),f.destroy()}ensureDomOrder(_,f){Uq(f,_,this.lastPlacedElement),this.lastPlacedElement=_}},eG={selector:"AG-ROW-CONTAINER",component:oG};function d1(_,f){return f.map(($)=>{let z=`e${$[0].toUpperCase()+$.substring(1)}RowContainer`;return _[z]={name:$},{tag:"ag-row-container",ref:z,attrs:{name:$}}})}function _E(_){let f={},$={tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:d1(f,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:d1(f,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:d1(f,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:d1(f,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:d1(f,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},_?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:f,elementParams:$}}var fE=class extends w{constructor(){super(...arguments);this.eGridRoot=V,this.eBodyViewport=V,this.eStickyTop=V,this.eStickyBottom=V,this.eTop=V,this.eBottom=V,this.eBody=V}postConstruct(){let{overlays:_,rangeSvc:f}=this.beans,$=_?.getOverlayWrapperSelector(),{paramsMap:z,elementParams:Q}=_E(!!$);this.setTemplate(Q,[...$?[$]:[],SG,jG,DG,eG],z);let J=(X,Y)=>{let Z=`${X}px`;Y.style.minHeight=Z,Y.style.height=Z},q={setRowAnimationCssOnBodyViewport:(X,Y)=>this.setRowAnimationCssOnBodyViewport(X,Y),setColumnCount:(X)=>P4(this.getGui(),X),setRowCount:(X)=>O4(this.getGui(),X),setTopHeight:(X)=>J(X,this.eTop),setBottomHeight:(X)=>J(X,this.eBottom),setTopInvisible:(X)=>this.eTop.classList.toggle("ag-invisible",X),setBottomInvisible:(X)=>this.eBottom.classList.toggle("ag-invisible",X),setStickyTopHeight:(X)=>this.eStickyTop.style.height=X,setStickyTopTop:(X)=>this.eStickyTop.style.top=X,setStickyTopWidth:(X)=>this.eStickyTop.style.width=X,setStickyBottomHeight:(X)=>{this.eStickyBottom.style.height=X,this.eStickyBottom.classList.toggle("ag-invisible",X==="0px")},setStickyBottomBottom:(X)=>this.eStickyBottom.style.bottom=X,setStickyBottomWidth:(X)=>this.eStickyBottom.style.width=X,setColumnMovingCss:(X,Y)=>this.toggleCss(X,Y),updateLayoutClasses:(X,Y)=>{let Z=[this.eBodyViewport.classList,this.eBody.classList];for(let G of Z)G.toggle(B0.AUTO_HEIGHT,Y.autoHeight),G.toggle(B0.NORMAL,Y.normal),G.toggle(B0.PRINT,Y.print);this.toggleCss(B0.AUTO_HEIGHT,Y.autoHeight),this.toggleCss(B0.NORMAL,Y.normal),this.toggleCss(B0.PRINT,Y.print)},setAlwaysVerticalScrollClass:(X,Y)=>this.eBodyViewport.classList.toggle(bX,Y),registerBodyViewportResizeListener:(X)=>{let Y=S0(this.beans,this.eBodyViewport,X);this.addDestroyFunc(()=>Y())},setPinnedTopBottomOverflowY:(X)=>this.eTop.style.overflowY=this.eBottom.style.overflowY=X,setCellSelectableCss:(X,Y)=>{for(let Z of[this.eTop,this.eBodyViewport,this.eBottom])Z.classList.toggle(X,Y)},setBodyViewportWidth:(X)=>this.eBodyViewport.style.width=X,setGridRootRole:(X)=>Z_(this.eGridRoot,X)};if(this.ctrl=this.createManagedBean(new rG),this.ctrl.setComp(q,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),f&&i_(this.gos)||Z$(this.gos))V4(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(_,f){let $=this.eBodyViewport.classList;$.toggle("ag-row-animation",f),$.toggle("ag-row-no-animation",!f)}getFocusableContainerName(){return"gridBody"}},$E={selector:"AG-GRID-BODY",component:fE},o1={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},zE=class extends j_{constructor(_,f){super();this.stopPropagationCallbacks=f,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;let{comp:$,eTopGuard:z,eBottomGuard:Q,focusTrapActive:J,forceFocusOutWhenTabGuardsAreEmpty:q,isFocusableContainer:X,focusInnerElement:Y,onFocusIn:Z,onFocusOut:G,shouldStopEventPropagation:E,onTabKeyDown:U,handleKeyDown:H,isEmpty:W,eFocusableElement:B}=_;this.comp=$,this.eTopGuard=z,this.eBottomGuard=Q,this.providedFocusInnerElement=Y,this.eFocusableElement=B,this.focusTrapActive=!!J,this.forceFocusOutWhenTabGuardsAreEmpty=!!q,this.isFocusableContainer=!!X,this.providedFocusIn=Z,this.providedFocusOut=G,this.providedShouldStopEventPropagation=E,this.providedOnTabKeyDown=U,this.providedHandleKeyDown=H,this.providedIsEmpty=W}postConstruct(){this.createManagedBean(new YX(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.handleKeyDown(_),onFocusIn:(_)=>this.onFocusIn(_),onFocusOut:(_)=>this.onFocusOut(_)})),this.activateTabGuards();for(let _ of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(_,{focus:this.onFocus.bind(this)})}handleKeyDown(_){if(this.providedHandleKeyDown)this.providedHandleKeyDown(_)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){if(this.providedShouldStopEventPropagation)return this.providedShouldStopEventPropagation();return!1}activateTabGuards(){if(this.forcingFocusOut)return;let _=this.gos.get("tabIndex");this.comp.setTabIndex(_.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(_){if(this.isFocusableContainer&&!this.eFocusableElement.contains(_.relatedTarget)){if(!this.allowFocus){this.findNextElementOutsideAndFocus(_.target===this.eBottomGuard);return}}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty){if(this.providedIsEmpty?this.providedIsEmpty():F0(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(_.target===this.eBottomGuard);return}}if(this.isFocusableContainer&&this.eFocusableElement.contains(_.relatedTarget))return;let f=_.target===this.eBottomGuard;if(!(this.providedFocusInnerElement?this.providedFocusInnerElement(f):this.focusInnerElement(f))&&this.forceFocusOutWhenTabGuardsAreEmpty)this.findNextElementOutsideAndFocus(_.target===this.eBottomGuard)}findNextElementOutsideAndFocus(_){let f=q_(this.beans),$=F0(f.body,null,!0),z=$.indexOf(_?this.eTopGuard:this.eBottomGuard);if(z===-1)return;let Q,J;if(_)Q=0,J=z;else Q=z+1,J=$.length;let q=$.slice(Q,J),X=this.gos.get("tabIndex");q.sort((Y,Z)=>{let G=Number.parseInt(Y.getAttribute("tabindex")||"0"),E=Number.parseInt(Z.getAttribute("tabindex")||"0");if(E===X)return 1;if(G===X)return-1;if(G===0)return 1;if(E===0)return-1;return G-E}),q[_?q.length-1:0]?.focus()}onFocusIn(_){if(this.focusTrapActive||this.forcingFocusOut)return;if(this.providedFocusIn)this.providedFocusIn(_);if(!this.isFocusableContainer)this.deactivateTabGuards()}onFocusOut(_){if(this.focusTrapActive)return;if(this.providedFocusOut)this.providedFocusOut(_);if(!this.eFocusableElement.contains(_.relatedTarget))this.activateTabGuards()}onTabKeyDown(_){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(_);return}if(this.focusTrapActive)return;if(_.defaultPrevented)return;let f=this.tabGuardsAreActive();if(f)this.deactivateTabGuards();let $=this.getNextFocusableElement(_.shiftKey);if(f)setTimeout(()=>this.activateTabGuards(),0);if(!$)return;$.focus(),_.preventDefault()}focusInnerElement(_=!1){let f=F0(this.eFocusableElement);if(this.tabGuardsAreActive())f.splice(0,1),f.splice(-1,1);if(!f.length)return!1;return f[_?f.length-1:0].focus({preventScroll:!0}),!0}getNextFocusableElement(_){return V_(this.beans,this.eFocusableElement,!1,_)}forceFocusOutOfContainer(_=!1){if(this.forcingFocusOut)return;let f=_?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,f.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(_,f){return _===this.eTopGuard&&!f||_===this.eBottomGuard&&(f??!0)}setAllowFocus(_){this.allowFocus=_}},yJ=class extends j_{constructor(_,f){super();this.comp=_,this.stopPropagationCallbacks=f}initialiseTabGuard(_){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();let{eTopGuard:f,eBottomGuard:$,eFocusableElement:z,stopPropagationCallbacks:Q}=this,J=[f,$],q={setTabIndex:(L)=>{for(let F of J)if(L==null)F.removeAttribute("tabindex");else F.setAttribute("tabindex",L)}};this.addTabGuards(f,$);let{focusTrapActive:X=!1,onFocusIn:Y,onFocusOut:Z,focusInnerElement:G,handleKeyDown:E,onTabKeyDown:U,shouldStopEventPropagation:H,isEmpty:W,forceFocusOutWhenTabGuardsAreEmpty:B,isFocusableContainer:K}=_;this.tabGuardCtrl=this.createManagedBean(new zE({comp:q,focusTrapActive:X,eTopGuard:f,eBottomGuard:$,eFocusableElement:z,onFocusIn:Y,onFocusOut:Z,focusInnerElement:G,handleKeyDown:E,onTabKeyDown:U,shouldStopEventPropagation:H,isEmpty:W,forceFocusOutWhenTabGuardsAreEmpty:B,isFocusableContainer:K},Q))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(_){let f=q_(this.beans).createElement("div"),$=_==="top"?o1.TAB_GUARD_TOP:o1.TAB_GUARD_BOTTOM;return f.classList.add(o1.TAB_GUARD,$),Z_(f,"presentation"),f}addTabGuards(_,f){let $=this.eFocusableElement;$.prepend(_),$.append(f)}removeAllChildrenExceptTabGuards(){let _=[this.eTopGuard,this.eBottomGuard];f_(this.comp.getFocusableElement()),this.addTabGuards(..._)}forceFocusOutOfContainer(_=!1){this.tabGuardCtrl.forceFocusOutOfContainer(_)}appendChild(_,f,$){if(!D$(f))f=f.getGui();let{eBottomGuard:z}=this;if(z)z.before(f);else _(f,$)}destroy(){let{eTopGuard:_,eBottomGuard:f}=this;T_(_),T_(f),super.destroy()}},r0=class extends p_{initialiseTabGuard(_,f){this.tabGuardFeature=this.createManagedBean(new yJ(this,f)),this.tabGuardFeature.initialiseTabGuard(_)}forceFocusOutOfContainer(_=!1){this.tabGuardFeature.forceFocusOutOfContainer(_)}appendChild(_,f){this.tabGuardFeature.appendChild(super.appendChild.bind(this),_,f)}},bJ=class extends r0{initialiseTabGuard(_){super.initialiseTabGuard(_,Ff)}},_9=(_,f)=>{return WX(_,()=>F_(_.getGui(),f,!1,!0))},f9=(_)=>{return _?.getFocusableContainerName()??"external"},QE=(_)=>{if(_==null)return"external";return typeof _==="string"?_:"gridBody"},JE=class extends A{constructor(){super(...arguments);this.additionalFocusableContainers=new Set}setComp(_,f,$){this.view=_,this.eGridHostDiv=f,this.eGui=$,this.eGui.setAttribute("grid-id",this.beans.context.getId());let{dragAndDrop:z,ctrlsSvc:Q}=this.beans;z?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new TJ(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let J=S0(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>J()),Q.register("gridCtrl",this)}isDetailGrid(){return ez(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){let _=this.beans;return{paginationSelector:_.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:_.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:_.sideBar?.getSelector(),statusBarSelector:_.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:_.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(_){let{view:f}=this;if(_===!1)f.setCursor(null);else f.setCursor(_===1?"ew-resize":"ns-resize")}disableUserSelect(_){this.view.setUserSelect(_?"none":null)}focusNextInnerContainer(_){let f=this.getFocusableContainers(),{indexWithFocus:$,nextIndex:z}=this.getNextFocusableIndex(f,_),Q=$===-1?_?f.length-1:0:z,{gos:J,beans:{focusSvc:q,navigation:X}}=this,Y=J.getCallback("tabToNextGridContainer");if(Y){let Z=q.getDefaultTabToNextGridContainerTarget({backwards:_,focusableContainers:f,nextIndex:Q}),G=f9(f[Q]),E=Z==null&&G==="gridBody"?"gridBody":QE(Z),U=Y({backwards:_,previousContainer:f9(f[$]),nextContainer:E,defaultTarget:Z});if(U!==void 0){if(typeof U==="boolean")return U;if(typeof U==="string"){if(U==="gridBody")return this.focusGridBodyDefault(_)||void 0;let H=f.find((W)=>W.getFocusableContainerName()===U);if(!H){Mq(`tabToNextGridContainer - ${U} container not found`);return}return _9(H,_)?!0:void 0}if(o8(U))return q.focusHeaderPosition({headerPosition:U})||void 0;return X?.ensureCellVisible(U),q.setFocusedCell({...U,forceBrowserFocus:!0}),q.isCellFocused(U)||void 0}}return this.focusNextInnerContainerDefault({backwards:_,focusableContainers:f,indexWithFocus:$,nextIndex:Q})||void 0}focusInnerElement(_){let{gos:f,beans:$,beans:{focusSvc:z,visibleCols:Q}}=this;if(f.getCallback("focusGridInnerElement")?.({fromBottom:!!_}))return!0;let q=this.getFocusableContainers();if(_){if(this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:q,indexWithFocus:q.length,nextIndex:q.length-1}))return!0;return z.focusGridView({column:b(Q.allCols),backwards:!0})}let X=Q.allCols;if(f.get("headerHeight")===0||W0($)){if(z.focusGridView({column:X[0],backwards:_}))return!0;for(let Y=1;YQ.getGui().contains($));return{indexWithFocus:z,nextIndex:z+(f?-1:1)}}focusGridBodyDefault(_){let{gos:f,beans:$,beans:{focusSvc:z,visibleCols:{allCols:Q}}}=this;if(_)return z.focusGridView({column:b(Q),backwards:!0});if(f.get("headerHeight")===0||W0($))return z.focusGridView({column:Q[0]});return z.focusFirstHeader()}focusNextInnerContainerDefault(_){let{backwards:f,focusableContainers:$,indexWithFocus:z}=_,Q=f?-1:1;for(let J=_.nextIndex;J>=0&&J<$.length;J+=Q){let q=$[J];if(q.getFocusableContainerName()==="gridBody"){if(z===-1||(f?z>J:zthis.destroyBean(this),setRtlClass:(J)=>this.addCss(J),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:(J)=>{this.getGui().style.userSelect=J!=null?J:"",this.getGui().style.webkitUserSelect=J!=null?J:""},setCursor:(J)=>{this.getGui().style.cursor=J!=null?J:""}},f=this.createManagedBean(new JE),$=f.getOptionalSelectors(),z=this.createTemplate($),Q=[$E,...Object.values($).filter((J)=>!!J)];this.setTemplate(z,Q),f.setComp(_,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{return},focusInnerElement:(J)=>f.focusInnerElement(J),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!f.isFocusable()})}insertGridIntoDom(){let _=this.getGui();this.eGridDiv.appendChild(_),this.addDestroyFunc(()=>{_.remove(),q$(this.gos,"Grid removed from DOM")})}updateLayoutClasses(_,f){let $=this.rootWrapperBody.classList,{AUTO_HEIGHT:z,NORMAL:Q,PRINT:J}=B0,{autoHeight:q,normal:X,print:Y}=f;$.toggle(z,q),$.toggle(Q,X),$.toggle(J,Y),this.toggleCss(z,q),this.toggleCss(Q,X),this.toggleCss(J,Y)}createTemplate(_){let f=_.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,$=_.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,z=_.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,Q=_.watermarkSelector?{tag:"ag-watermark"}:null,J=_.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[f,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},$]},z,J,Q]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(_=!1){if(!_&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(_);return}super.forceFocusOutOfContainer(_)}getFocusableContainers(){let _=[...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody];for(let f of[this.sideBar,this.statusBar,this.pagination])if(f)_.push(f);return _.filter((f)=>A_(f.getGui()))}},m=(_,f)=>{for(let $ of Object.keys(f))f[$]=_;return f},$9={dispatchEvent:"CommunityCore",...m("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...m("GridState",{getState:0,setState:0}),...m("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...m("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...m("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...m("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...m("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...m("ValueCache",{expireValueCache:0}),...m("CellApi",{getCellValue:0}),...m("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...m("Sort",{onSortChanged:0}),...m("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...m("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...m("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...m("HighlightChanges",{flashCells:0}),...m("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...m("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...m("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...m("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...m("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...m("ColumnResize",{setColumnWidths:0}),...m("ColumnHover",{isColumnHovered:0}),...m("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...m("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...m("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...m("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...m("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...m("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...m("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...m("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...m("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...m("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...m("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...m("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...m("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...m("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...m("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...m("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...m("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...m("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...m("ContextMenu",{showContextMenu:0}),...m("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...m("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...m("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...m("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...m("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...m("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...m("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...m("StatusBar",{getStatusPanel:0}),...m("AiToolkit",{getStructuredSchema:0})},X6={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},XE=(_,f)=>_.eventSvc.dispatchEvent(f),CX=class{};Reflect.defineProperty(CX,"name",{value:"GridApi"});var YE=class extends A{constructor(){super();this.beanName="apiFunctionSvc",this.api=new CX,this.fns={...X6,dispatchEvent:XE},this.preDestroyLink="";let{api:_}=this;for(let f of Object.keys($9))_[f]=this.makeApi(f)[f]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(_,f){let{fns:$,beans:z}=this;if($!==X6)$[_]=z?.validation?.validateApiFunction(_,f)??f}makeApi(_){return{[_]:(...f)=>{let{beans:$,fns:{[_]:z}}=this;return z?z($,...f):this.apiNotFound(_)}}}apiNotFound(_){let{beans:f,gos:$,preDestroyLink:z}=this;if(!f)j(26,{fnName:_,preDestroyLink:z});else{let Q=$9[_];if($.assertModuleRegistered(Q,`api.${_}`))j(27,{fnName:_,module:Q})}}destroy(){super.destroy(),this.fns=X6,this.beans=null}};function ZE(_){return _.context.getId()}function GE(_){_.gridDestroySvc.destroy()}function EE(_){return _.gridDestroySvc.destroyCalled}function UE(_,f){return _.gos.get(f)}function HE(_,f,$){wX(_,{[f]:$})}function wX(_,f){_.gos.updateGridOptions({options:f})}function WE(_,f){let $=f.replace(/Module$/,"");return _.gos.isModuleRegistered($)}function QQ(_,f,$){let z=h(_,f,$);if(z){let{className:J}=z;if(typeof J==="string"&&J.includes("ag-icon")||typeof J==="object"&&J["ag-icon"])return z}let Q=z_({tag:"span"});return Q.appendChild(z),Q}function h(_,f,$){let z=null;if(_==="smallDown")j(262);else if(_==="smallLeft")j(263);else if(_==="smallRight")j(264);let Q=$?.getColDef().icons;if(Q)z=Q[_];if(f.gos&&!z){let J=f.gos.get("icons");if(J)z=J[_]}if(z){let J;if(typeof z==="function")J=z();else if(typeof z==="string")J=z;else{j(38,{iconName:_});return}if(typeof J==="string")return e6(J);if(D$(J))return J;j(133,{iconName:_});return}else{let J=f.registry.getIcon(_);if(!J)f.validation?.validateIcon(_);return z_({tag:"span",cls:`ag-icon ag-icon-${J??_}`,role:"presentation",attrs:{unselectable:"on"}})}}var BE=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}",KE={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},LE=class extends w{constructor(){super();this.dragSource=null,this.eIcon=V,this.eLabel=V,this.eGhost=V,this.registerCSS(BE)}postConstruct(){let _=(f)=>QQ(f,this.beans,null);this.dropIconMap={pinned:_("columnMovePin"),hide:_("columnMoveHide"),move:_("columnMoveMove"),left:_("columnMoveLeft"),right:_("columnMoveRight"),group:_("columnMoveGroup"),aggregate:_("columnMoveValue"),pivot:_("columnMovePivot"),notAllowed:_("dropNotAllowed")}}init(_){this.dragSource=_.dragSource,this.setTemplate(KE),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(_,f){let{eGhost:$,eIcon:z,dragSource:Q,dropIconMap:J,gos:q}=this;f_(z);let X=null;if(!_)_=Q?.getDefaultIconName?Q.getDefaultIconName():"notAllowed";if(X=J[_],$.classList.toggle("ag-dnd-ghost-not-allowed",_==="notAllowed"),z.classList.toggle("ag-shake-left-to-right",f),X===J.hide&&q.get("suppressDragLeaveHidesColumns"))return;if(X)z.appendChild(X)}setLabel(_){this.eLabel.textContent=_}};var xX=(_,f)=>{if(f!=null&&_?.setPointerCapture)try{return _.setPointerCapture(f),_.hasPointerCapture(f)}catch{}return!1},FE=(_,f)=>{if(typeof PointerEvent>"u"||!(f instanceof PointerEvent))return null;let $=f.pointerId;if(!xX(_,$))return null;let z={eElement:_,pointerId:$,onLost(Q){ME(z,Q)}};return _.addEventListener("lostpointercapture",z.onLost),z},DE=(_)=>{if(!_)return;NX(_);let{eElement:f,pointerId:$}=_;if(!f)return;try{f.releasePointerCapture($)}catch{}_.eElement=null},NX=(_)=>{let{eElement:f,onLost:$}=_;if(f&&$)f.removeEventListener("lostpointercapture",$),_.onLost=null},ME=(_,f)=>{NX(_);let{eElement:$,pointerId:z}=_;if($&&f.pointerId===z)xX($,z)},E1,B1,Y6={passive:!0},$f={passive:!1},j0=(_)=>{if(!B1)B1=new WeakSet;else if(B1.has(_))return!1;return B1.add(_),!0},kE=class extends j_{constructor(){super(...arguments);this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!E1?.has(a_(this.beans))}hasPointerCapture(){let _=this.drag?.pointerCapture;return!!(_&&this.beans.eRootDiv.hasPointerCapture?.(_.pointerId))}destroy(){if(this.drag)this.cancelDrag();let _=this.dragSources;for(let f of _)z9(f);_.length=0,super.destroy()}removeDragSource(_){let f=this.dragSources;for(let $=0,z=f.length;$this.onPointerDown(_,Z),$f],[f,"mousedown",(Z)=>this.onMouseDown(_,Z)]);let Y=this.gos.get("suppressTouch");if($&&!Y)Xz(z,[f,"touchstart",(G)=>this.onTouchStart(_,G),$f])}cancelDrag(_){let f=this.drag;if(_??(_=f?.eElement),_)this.eventSvc.dispatchEvent({type:"dragCancelled",target:_});f?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(_){let f=_.type;return(f==="mousemove"||f==="pointermove")&&_.cancelable&&J$(this.beans,_)&&!s1(G6(_))}initDrag(_,...f){this.drag=_;let $=this.beans,z=(X)=>this.onScroll(X),Q=(X)=>this.onKeyDown(X),J=a_($),q=q_($);Xz(_.handlers,[J,"contextmenu",W1],[J,"keydown",Q],[q,"scroll",z,{capture:!0}],[q.defaultView||window,"scroll",z],...f)}destroyDrag(){this.dragging=!1;let _=this.drag;if(_){let f=_.rootEl;if(E1?.get(f)===_)E1.delete(f);this.drag=null,DE(_.pointerCapture),_J(_.handlers)}}onPointerDown(_,f){if(this.isPointer())return;let $=this.beans;if(B1?.has(f))return;let z=f.pointerType;if(z==="touch"){if($.gos.get("suppressTouch")||!_.includeTouch)return;if(_.stopPropagationForTouch)f.stopPropagation();if(s1(G6(f)))return}if(!f.isPrimary)return;if(z==="mouse"&&f.button!==0)return;this.destroyDrag();let Q=a_($),J=_.eElement,q=f.pointerId,X=new Z6(Q,_,f,q);E1??(E1=new WeakMap),E1.set(Q,X);let Y=(U)=>{if(U.pointerId===q)this.onMouseOrPointerMove(U)},Z=(U)=>{if(U.pointerId===q)this.onMouseOrPointerUp(U)},G=(U)=>{if(U.pointerId===q&&j0(U))this.cancelDrag()},E=(U)=>this.draggingPreventDefault(U);if(this.initDrag(X,[Q,"pointerup",Z],[Q,"pointercancel",G],[Q,"pointermove",Y,$f],[Q,"touchmove",E,$f],[J,"mousemove",E,$f]),_.dragStartPixels===0)this.onMouseOrPointerMove(f);else j0(f)}onTouchStart(_,f){if(this.gos.get("suppressTouch")||!_.includeTouch)return;if(!j0(f))return;if(s1(G6(f)))return;if(_.stopPropagationForTouch)f.stopPropagation();if(this.isPointer()){if(this.dragging)W1(f);return}this.destroyDrag();let z=this.beans,Q=a_(z),J=new Z6(Q,_,f.touches[0]),q=(U)=>this.onTouchMove(U),X=(U)=>this.onTouchUp(U),Y=(U)=>this.onTouchCancel(U),Z=(U)=>this.draggingPreventDefault(U),G=a_(z),E=f.target??_.eElement;if(this.initDrag(J,[E,"touchmove",q,Y6],[E,"touchend",X,Y6],[E,"touchcancel",Y,Y6],[G,"touchmove",Z,$f],[G,"touchend",X,$f],[G,"touchcancel",Y,$f]),_.dragStartPixels===0)this.onMove(J.start)}draggingPreventDefault(_){if(this.dragging)W1(_)}onMouseDown(_,f){if(f.button!==0)return;if(B1?.has(f))return;if(this.isPointer())return;let $=this.beans;this.destroyDrag();let z=new Z6(a_($),_,f),Q=(X)=>this.onMouseOrPointerMove(X),J=(X)=>this.onMouseOrPointerUp(X),q=a_($);if(this.initDrag(z,[q,"mousemove",Q],[q,"mouseup",J]),_.dragStartPixels===0)this.onMouseOrPointerMove(f);else j0(f)}onScroll(_){if(!j0(_))return;let f=this.drag,$=f?.lastDrag;if($&&this.dragging)f.params?.onDragging?.($)}onMouseOrPointerMove(_){if(!j0(_))return;if(ef())q_(this.beans).getSelection()?.removeAllRanges();if(this.shouldPreventMouseEvent(_))W1(_);this.onMove(_)}onTouchCancel(_){let f=this.drag;if(!f||!j0(_))return;if(!D1(f.start,_.changedTouches))return;this.cancelDrag()}onTouchMove(_){let f=this.drag;if(!f||!j0(_))return;let $=D1(f.start,_.touches);if($)this.onMove($),this.draggingPreventDefault(_)}onMove(_){let f=this.drag;if(!f)return;f.lastDrag=_;let $=f.params;if(!this.dragging){let z=f.start,J=$.dragStartPixels??4;if(Lq(_,z,J))return;if(this.dragging=!0,$.capturePointer)f.pointerCapture=FE(this.beans.eRootDiv,_);if(this.eventSvc.dispatchEvent({type:"dragStarted",target:$.eElement}),$.onDragStart?.(z),this.drag!==f)return;if($.onDragging?.(z),this.drag!==f)return}$.onDragging?.(_)}onTouchUp(_){let f=this.drag;if(f&&j0(_))this.onUp(D1(f.start,_.changedTouches))}onMouseOrPointerUp(_){if(j0(_))this.onUp(_)}onUp(_){let f=this.drag;if(!f)return;if(!_)_=f.lastDrag;if(_&&this.dragging)this.dragging=!1,f.params.onDragStop?.(_),this.eventSvc.dispatchEvent({type:"dragStopped",target:f.params.eElement});this.destroyDrag()}onKeyDown(_){if(_.key===S.ESCAPE)this.cancelDrag()}},z9=(_)=>{_J(_.handlers);let f=_.oldTouchAction;if(f!=null){let $=_.params.eElement.style;if($)$.touchAction=f}},Z6=class{constructor(_,f,$,z=null){this.rootEl=_,this.params=f,this.start=$,this.pointerId=z,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=f.eElement}},G6=(_)=>{let f=_.target;return f instanceof Element?f:null},SE=class extends kE{shouldPreventMouseEvent(_){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(_)}},AE=class extends A{constructor(){super(...arguments);this.beanName="horizontalResizeSvc"}addResizeBar(_){let f={dragStartPixels:_.dragStartPixels||0,eElement:_.eResizeBar,onDragStart:this.onDragStart.bind(this,_),onDragStop:this.onDragStop.bind(this,_),onDragging:this.onDragging.bind(this,_),onDragCancel:this.onDragStop.bind(this,_),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:$}=this.beans;return $.addDragSource(f),()=>$.removeDragSource(f)}onDragStart(_,f){this.dragStartX=f.clientX,this.setResizeIcons();let $=f instanceof MouseEvent&&f.shiftKey===!0;_.onResizeStart($)}setResizeIcons(){let _=this.beans.ctrlsSvc.get("gridCtrl");_.setResizeCursor(1),_.disableUserSelect(!0)}onDragStop(_){_.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){let _=this.beans.ctrlsSvc.get("gridCtrl");_.setResizeCursor(!1),_.disableUserSelect(!1)}onDragging(_,f){this.resizeAmount=f.clientX-this.dragStartX,_.onResizing(this.resizeAmount)}};var JQ=class{constructor(_){if(this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=_.scrollContainer,this.scrollHorizontally=_.scrollAxis.includes("x"),this.scrollVertically=_.scrollAxis.includes("y"),this.scrollByTick=_.scrollByTick??20,_.onScrollCallback)this.onScrollCallback=_.onScrollCallback;if(this.scrollVertically)this.getVerticalPosition=_.getVerticalPosition,this.setVerticalPosition=_.setVerticalPosition;if(this.scrollHorizontally)this.getHorizontalPosition=_.getHorizontalPosition,this.setHorizontalPosition=_.setHorizontalPosition;this.shouldSkipVerticalScroll=_.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=_.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(_,f=!1){let $=!this.scrollVertically||f||this.shouldSkipVerticalScroll(),z=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if($&&z)return;let Q=this.scrollContainer.getBoundingClientRect(),J=this.scrollByTick;if(this.tickLeft=!z&&_.clientXQ.right-J,this.tickUp=!$&&_.clientYQ.bottom-J,this.tickLeft||this.tickRight||this.tickUp||this.tickDown)this.ensureTickingStarted();else this.ensureCleared()}ensureTickingStarted(){if(this.tickingInterval===null)this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0}doTick(){this.tickCount++;let _=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){let f=this.getVerticalPosition();if(this.tickUp)this.setVerticalPosition(f-_);if(this.tickDown)this.setVerticalPosition(f+_)}if(this.scrollHorizontally){let f=this.getHorizontalPosition();if(this.tickLeft)this.setHorizontalPosition(f-_);if(this.tickRight)this.setHorizontalPosition(f+_)}if(this.onScrollCallback)this.onScrollCallback()}ensureCleared(){if(this.tickingInterval)window.clearInterval(this.tickingInterval),this.tickingInterval=null}},R1=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},_1=(_)=>{let f=_.childrenAfterGroup;while(f?.length){let $=f[0];if($.sourceRowIndex>=0)return $;f=$.childrenAfterGroup}},gX=(_,f,$,z)=>{if(!f.size||!_)return!1;let Q=!1,J=_.length??0,q=-1;if($){if(q=$.sourceRowIndex,$=q<0?_1($):null,$)q=$.sourceRowIndex}if(q<0||q>=J)q=J;else if(!z)++q;let X=q,Y=Math.min(q,J-1);for(let E of f){let U=E.sourceRowIndex;if(UY)Y=U}let Z=X;for(let E=X;E=q;--E){let U=_[E];if(f.has(U))continue;if(U.sourceRowIndex!==G)U.sourceRowIndex=G,_[G]=U,Q=!0;--G}for(let E of f){if(E.sourceRowIndex!==Z)E.sourceRowIndex=Z,_[Z]=E,Q=!0;++Z}return Q};function CJ(_,f){return P$(_,f.target)?.getFocusedCellPosition()??null}function wJ(_,f){let $=S_(_.gos,"normal"),z=f,Q,J;if(z.clientX!=null||z.clientY!=null)Q=z.clientX,J=z.clientY;else Q=z.x,J=z.y;let{pageFirstPixel:q}=_.pageBounds.getCurrentPagePixelRange();if(J+=q,$){let X=_.ctrlsSvc.getScrollFeature(),Y=X.getVScrollPosition(),Z=X.getHScrollPosition();Q+=Z.left,J+=Y.top}return{x:Q,y:J}}var qQ={moduleName:"Drag",version:c,beans:[SE]};var T$={moduleName:"SharedDragAndDrop",version:c,beans:[M8],dependsOn:[qQ],userComponents:{agDragAndDropImage:LE},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}};var xJ={moduleName:"HorizontalResize",version:c,beans:[AE],dependsOn:[qQ]},RE=":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}",jE=class extends A{constructor(){super(...arguments);this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>this.gridBodyCtrl=_.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(_){this.suppressAnimation=_}start(){if(this.active)return;let{gos:_}=this;if(_.get("suppressColumnMoveAnimation"))return;if(_.get("enableRtl"))return;this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0}finish(){if(!this.active)return;this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(_){if(this.activeNext)this.executeNextFuncs.push(_);else _()}executeLaterVMTurn(_){if(this.active)this.executeLaterFuncs.push(_);else _()}ensureAnimationCssClassPresent(){this.animationThreadCount++;let _=this.animationThreadCount,{gridBodyCtrl:f}=this;f.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{if(this.animationThreadCount===_)f.setColumnMovingCss(!1)})}flush(_,f){let{executeNextFuncs:$,executeLaterFuncs:z}=this;if($.length===0&&z.length===0){_(),f();return}let Q=(J)=>{while(J.length){let q=J.pop();if(q)q()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{_(),Q($)},0),window.setTimeout(()=>{f(),Q(z)},200)})}};function VE(_,f,$){_.colMoves?.moveColumnByIndex(f,$,"api")}function OE(_,f,$){_.colMoves?.moveColumns(f,$,"api")}var PE=class extends A{constructor(_){super();this.pinned=_,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(_){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;let f=_.dragItem.columns;if(!f)return;for(let $ of f){if(!$.isPrimary())continue;if($.isAnyFunctionActive())continue;if($.isAllowValue())this.columnsToAggregate.push($);else if($.isAllowRowGroup())this.columnsToGroup.push($);else if($.isAllowPivot())this.columnsToPivot.push($)}}getIconName(){if(this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0)return this.pinned?"pinned":"move";return null}onDragLeave(_){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(_){}onDragStop(_){let{valueColsSvc:f,rowGroupColsSvc:$,pivotColsSvc:z}=this.beans;if(this.columnsToAggregate.length>0)f?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop");if(this.columnsToGroup.length>0)$?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop");if(this.columnsToPivot.length>0)z?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function vE(_,f){if(!f||f.length<=1)return;if(f.filter((z)=>_.indexOf(z)<0).length>0)return;f.sort((z,Q)=>{let J=_.indexOf(z),q=_.indexOf(Q);return J-q})}function TE(_){let f=[..._];for(let $ of _){let z=null,Q=$.getParent();while(Q!=null&&Q.getDisplayedLeafColumns().length===1)z=Q,Q=Q.getParent();if(z!=null){let q=z.getColGroupDef()?.marryChildren?z.getProvidedColumnGroup().getLeafColumns():z.getLeafColumns();for(let X of q)if(!f.includes(X))f.push(X)}}return f}function IE(_,f,$,z){let Q=z.allCols,J=null,q=null;for(let X=0;X<_.length;X++){let Y=_[X],Z=$.getProposedColumnOrder(f,Y);if(!$.doesOrderPassRules(Z))continue;let G=Z.filter((U)=>Q.includes(U));if(q===null)q=G;else if(!J_(G,q))break;let E=bE(Z);if(J===null||E=W)return;if($&&B<=W)return}let L=IE(H,U,Z,G);if(!L)return;let F=L.move;if(F>Y.getCols().length-U.length)return;return{columns:U,toIndex:F}}function uX(_){let{columns:f,toIndex:$}=hX(_)||{},{finished:z,colMoves:Q}=_;if(!f||$==null)return null;return Q.moveColumns(f,$,"uiColumnMoved",z),z?null:{columns:f,toIndex:$}}function yE(_,f){let $=f.getCols(),z=_.map((Y)=>$.indexOf(Y)).sort((Y,Z)=>Y-Z),Q=z[0];return b(z)-Q!==z.length-1?null:Q}function bE(_){function f(z){let Q=[],J=z.getOriginalParent();while(J!=null)Q.push(J),J=J.getOriginalParent();return Q}let $=0;for(let z=0;z<_.length-1;z++){let Q=f(_[z]),J=f(_[z+1]);[Q,J]=Q.length>J.length?[Q,J]:[J,Q];for(let q of Q)if(J.indexOf(q)===-1)$++}return $}function CE(_,f){switch(f){case"left":return _.leftCols;case"right":return _.rightCols;default:return _.centerCols}}function wE(_){let{movingCols:f,draggingRight:$,xPosition:z,pinned:Q,gos:J,colModel:q,visibleCols:X}=_;if(J.get("suppressMovableColumns")||f.some((D)=>D.getColDef().suppressMovable))return[];let Z=CE(X,Q),G=q.getCols(),E=Z.filter((D)=>f.includes(D)),U=Z.filter((D)=>!f.includes(D)),H=G.filter((D)=>!f.includes(D)),W=0,B=z;if($){let D=0;for(let M of E)D+=M.getActualWidth();B-=D}if(B>0){for(let D=0;D0){let D=U[W-1];K=H.indexOf(D)+1}else if(K=H.indexOf(U[0]),K===-1)K=0;let L=[K],F=(D,M)=>D-M;if($){let D=K+1,M=G.length-1;while(D<=M)L.push(D),D++;L.sort(F)}else{let D=K,M=G.length-1,k=G[D];while(D<=M&&Z.indexOf(k)<0)D++,L.push(D),k=G[D];D=K-1;let R=0;while(D>=R)L.push(D),D--;L.sort(F).reverse()}return L}function C6(_){let{pinned:f,fromKeyboard:$,gos:z,ctrlsSvc:Q,useHeaderRow:J,skipScrollPadding:q}=_,X=Q.getHeaderRowContainerCtrl(f)?.eViewport,{x:Y}=_;if(!X)return 0;if($)Y-=X.getBoundingClientRect().left;if(z.get("enableRtl")){if(J)X=X.querySelector(".ag-header-row");Y=X.clientWidth-Y}if(f==null&&!q)Y+=Q.get("center").getCenterViewportScrollLeft();return Y}function E6(_,f){for(let $ of _)$.moving=f,$.dispatchColEvent("movingChanged","uiColumnMoved")}var Q9=7,w6=100,Qz=w6/2,xE=5,NE=100,gE=class extends A{constructor(_){super();this.pinned=_,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!v(_)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCon=_.gridBodyCtrl})}getIconName(){let{pinned:_,lastDraggingEvent:f}=this,{dragItem:$}=f||{},z=$?.columns??[];for(let Q of z){let J=Q.getPinned();if(Q.getColDef().lockPinned){if(J==_)return"move";continue}let q=$?.containerType;if(q===_||!_)return"move";if(_&&(!J||q!==_))return"pinned"}return"notAllowed"}onDragEnter(_){let f=_.dragItem,$=f.columns;if(_.dragSource.type===0)this.setColumnsVisible($,!0,"uiColumnDragged");else{let Q=f.visibleState,J=($||[]).filter((q)=>Q[q.getId()]&&!q.isVisible());this.setColumnsVisible(J,!0,"uiColumnDragged")}if(!this.gos.get("suppressMoveWhenColumnDragging"))this.attemptToPinColumns($,this.pinned);this.onDragging(_,!0,!0)}onDragging(_=this.lastDraggingEvent,f=!1,$=!1,z=!1){let{gos:Q,ctrlsSvc:J}=this.beans,q=Q.get("suppressMoveWhenColumnDragging");if(z&&!q){this.finishColumnMoving();return}if(this.lastDraggingEvent=_,!_||!z&&n(_.hDirection))return;let X=C6({x:_.x,pinned:this.pinned,gos:Q,ctrlsSvc:J});if(!f)this.checkCenterForScrolling(X);if(q)this.handleColumnDragWhileSuppressingMovement(_,f,$,X,z);else this.handleColumnDragWhileAllowingMovement(_,f,$,X,z)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(_,f,$){if(!_?.length)return;let z=_.filter((Q)=>!Q.getColDef().lockVisible);if(!z.length)return;this.beans.colModel.setColsVisible(z,f,$)}finishColumnMoving(){this.clearHighlighted();let _=this.lastMovedInfo;if(!_)return;let{columns:f,toIndex:$}=_;this.beans.colMoves.moveColumns(f,$,"uiColumnMoved",!0)}updateDragItemContainerType(){let{lastDraggingEvent:_}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!_)return;let f=_.dragItem;if(!f)return;f.containerType=this.pinned}handleColumnDragWhileSuppressingMovement(_,f,$,z,Q){let J=this.getAllMovingColumns(_,!0);if(Q){let q=this.isAttemptingToPin(J);if(q)this.attemptToPinColumns(J,void 0,!0);let{fromLeft:X,xPosition:Y}=this.getNormalisedXPositionInfo(J,q)||{};if(X==null||Y==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:J,xPosition:Y,fromEnter:f,fakeEvent:$,fromLeft:X})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(_))return;this.highlightHoveredColumn(J,z)}}handleColumnDragWhileAllowingMovement(_,f,$,z,Q){let J=this.getAllMovingColumns(_),q=this.normaliseDirection(_.hDirection)==="right",X=_.dragSource.type===1,Y=this.getMoveColumnParams({allMovingColumns:J,isFromHeader:X,xPosition:z,fromLeft:q,fromEnter:f,fakeEvent:$}),Z=uX({...Y,finished:Q});if(Z)this.lastMovedInfo=Z}getAllMovingColumns(_,f=!1){let $=_.dragSource.getDragItem(),z=null;if(f){if(z=$.columnsInSplit,!z)z=$.columns}else z=$.columns;let Q=(J)=>J.getColDef().lockPinned?J.getPinned()==this.pinned:!0;if(!z)return[];return z.filter(Q)}getMoveColumnParams(_){let{allMovingColumns:f,isFromHeader:$,xPosition:z,fromLeft:Q,fromEnter:J,fakeEvent:q}=_,{gos:X,colModel:Y,colMoves:Z,visibleCols:G}=this.beans;return{allMovingColumns:f,isFromHeader:$,fromLeft:Q,xPosition:z,pinned:this.pinned,fromEnter:J,fakeEvent:q,gos:X,colModel:Y,colMoves:Z,visibleCols:G}}highlightHoveredColumn(_,f){let{gos:$,colModel:z}=this.beans,Q=$.get("enableRtl"),J=z.getCols().filter((G)=>G.isVisible()&&G.getPinned()===this.pinned),q=null,X=null,Y=null;for(let G of J){if(X=G.getActualWidth(),q=this.getNormalisedColumnLeft(G,0,Q),q!=null){let E=q+X;if(q<=f&&E>=f){Y=G;break}}q=null,X=null}if(!Y){for(let G=J.length-1;G>=0;G--){let E=J[G],U=J[G].getParent();if(!U){Y=E;break}let H=U?.getDisplayedLeafColumns();if(H.length){Y=b(H);break}}if(!Y)return;q=this.getNormalisedColumnLeft(Y,0,Q),X=Y.getActualWidth()}else if(_.indexOf(Y)!==-1)Y=null;if(Y==null||q==null||X==null){if(this.lastHighlightedColumn?.column!==Y)this.clearHighlighted();return}let Z;if(f-qQ9;return f&&$||_.some((z)=>z.getPinned()!==this.pinned)}moveColumnsAfterHighlight(_){let{allMovingColumns:f,xPosition:$,fromEnter:z,fakeEvent:Q,fromLeft:J}=_,q=this.getMoveColumnParams({allMovingColumns:f,isFromHeader:!0,xPosition:$,fromLeft:J,fromEnter:z,fakeEvent:Q}),{columns:X,toIndex:Y}=hX(q)||{};if(X&&Y!=null)this.lastMovedInfo={columns:X,toIndex:Y};this.finishColumnMoving()}clearHighlighted(){let{lastHighlightedColumn:_}=this;if(!_)return;J9(_.column,null),this.lastHighlightedColumn=null}checkCenterForScrolling(_){if(!this.isCenterContainer)return;let f=this.beans.ctrlsSvc.get("center"),$=f.getCenterViewportScrollLeft(),z=$+f.getCenterWidth(),Q,J;if(this.gos.get("enableRtl"))Q=_<$+Qz,J=_>z-Qz;else J=_<$+Qz,Q=_>z-Qz;if(this.needToMoveRight=Q,this.needToMoveLeft=J,J||Q)this.ensureIntervalStarted();else this.ensureIntervalCleared()}ensureIntervalStarted(){if(this.movingIntervalId)return;this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),NE),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0)}ensureIntervalCleared(){if(!this.movingIntervalId)return;window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName())}moveInterval(){let _;if(this.intervalCount++,_=10+this.intervalCount*xE,_>w6)_=w6;let f=null,$=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft)f=$.scrollHorizontally(-_);else if(this.needToMoveRight)f=$.scrollHorizontally(_);if(f!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;let{pinnedCols:z,dragAndDrop:Q,gos:J}=this.beans;if(this.failedMoveAttempts<=Q9+1||!z)return;if(Q.setDragImageCompIcon("pinned"),!J.get("suppressMoveWhenColumnDragging")){let q=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(q,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(_,f,$=!1){let z=(_||[]).filter((q)=>!q.getColDef().lockPinned);if(!z.length)return 0;if($)f=this.getPinDirection();let{pinnedCols:Q,dragAndDrop:J}=this.beans;if(Q?.setColsPinned(z,f,"uiColumnDragged"),$)J.nudge();return z.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function J9(_,f){if(_.highlighted===f)return;_.highlighted=f,_.dispatchColEvent("headerHighlightChanged","uiColumnMoved")}function hE(_){let f=_.length,$,z;for(let Q=0;Q{let Q,J=z.gridBodyCtrl.eBodyViewport;switch($){case"left":Q=[[J,z.left.eContainer],[z.bottomLeft.eContainer],[z.topLeft.eContainer]];break;case"right":Q=[[J,z.right.eContainer],[z.bottomRight.eContainer],[z.topRight.eContainer]];break;default:Q=[[J,z.center.eViewport],[z.bottomCenter.eViewport],[z.topCenter.eViewport]];break}this.eSecondaryContainers=Q}),this.moveColumnFeature=this.createManagedBean(new gE($)),this.bodyDropPivotTarget=this.createManagedBean(new PE($)),f.addDropTarget(this),this.addDestroyFunc(()=>f.removeDropTarget(this))}isInterestedIn(_){return _===1||_===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(_){return this.beans.colModel.isPivotMode()&&_.dragSource.type===0}onDragEnter(_){this.currentDropListener=this.isDropColumnInPivotMode(_)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(_)}onDragLeave(_){this.currentDropListener.onDragLeave(_)}onDragging(_){this.currentDropListener.onDragging(_)}onDragStop(_){this.currentDropListener.onDragStop(_)}onDragCancel(){this.currentDropListener.onDragCancel()}};function iX(_,f){let $=[],z=[],Q=[];if(_.forEach((q)=>{let X=q.getColDef().lockPosition;if(X==="right")Q.push(q);else if(X==="left"||X===!0)$.push(q);else z.push(q)}),f.get("enableRtl"))return[...Q,...z,...$];return[...$,...z,...Q]}function mX(_,f){let $=!0;return y0(null,f,(z)=>{if(!X_(z))return;let Q=z;if(!Q.getColGroupDef()?.marryChildren)return;let X=[];for(let U of Q.getLeafColumns()){let H=_.indexOf(U);X.push(H)}let Y=Math.max.apply(Math,X),Z=Math.min.apply(Math,X),G=Y-Z,E=Q.getLeafColumns().length-1;if(G>E)$=!1}),$}var iE=class extends A{constructor(){super(...arguments);this.beanName="colMoves"}moveColumnByIndex(_,f,$){let z=this.beans.colModel.getCols();if(!z)return;let Q=z[_];this.moveColumns([Q],f,$)}moveColumns(_,f,$,z=!0){let{colModel:Q,colAnimation:J,visibleCols:q,eventSvc:X}=this.beans,Y=Q.getCols();if(!Y)return;if(f>Y.length-_.length){j(30,{toIndex:f});return}J?.start();let Z=Q.getColsForKeys(_);if(this.doesMovePassRules(Z,f))g2(Q.getCols(),Z,f),q.refresh($),X.dispatchEvent({type:"columnMoved",columns:Z,column:Z.length===1?Z[0]:null,toIndex:f,finished:z,source:$});J?.finish()}doesMovePassRules(_,f){let $=this.getProposedColumnOrder(_,f);return this.doesOrderPassRules($)}doesOrderPassRules(_){let{colModel:f,gos:$}=this.beans;if(!mX(_,f.getColTree()))return!1;if(!((Q)=>{let J=(Z)=>{if(!Z)return 0;return Z==="left"||Z===!0?-1:1},q=$.get("enableRtl"),X=q?1:-1,Y=!0;for(let Z of Q){let G=J(Z.getColDef().lockPosition);if(q){if(G>X)Y=!1}else if(GX?"hide":"notAllowed",getDragItem:Y?()=>pE(f,q.allCols):()=>cE(f),dragItemName:$,onDragStarted:()=>{X=!z.get("suppressDragLeaveHidesColumns"),E6(Z,!0)},onDragStopped:()=>E6(Z,!1),onDragCancelled:()=>E6(Z,!1),onGridEnter:(U)=>{if(X){let{columns:H=[],visibleState:W}=U??{},B=Y?(L)=>!W||W[L.getColId()]:()=>!0,K=H.filter((L)=>!L.getColDef().lockVisible&&B(L));Q.setColsVisible(K,!0,"uiColumnMoved")}},onGridExit:(U)=>{if(X){let H=U?.columns?.filter((W)=>!W.getColDef().lockVisible)||[];Q.setColsVisible(H,!1,"uiColumnMoved")}}};return J.addDragSource(E,!0),E}};function mE(_,f){while(_){if(_.getGroupId()===f)return _;_=_.getParent()}return}function cE(_){let f={};return f[_.getId()]=_.isVisible(),{columns:[_],visibleState:f,containerType:_.pinned}}function pE(_,f){let $=_.getProvidedColumnGroup().getLeafColumns(),z={};for(let X of $)z[X.getId()]=X.isVisible();let Q=[];for(let X of f)if($.indexOf(X)>=0)Q.push(X),Q_($,X);for(let X of $)Q.push(X);let J=[],q=_.getLeafColumns();for(let X of Q)if(q.indexOf(X)!==-1)J.push(X);return{columns:Q,columnsInSplit:J,visibleState:z,containerType:J[0]?.pinned}}var I$={moduleName:"ColumnMove",version:c,beans:[iE,jE],apiFunctions:{moveColumnByIndex:VE,moveColumns:OE},dependsOn:[T$],css:[RE]},nE=class extends A{constructor(){super(...arguments);this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.centerRowContainerCtrl=_.center})}getPreferredWidthForColumn(_,f){let $=this.getHeaderCellForColumn(_);if(!$)return-1;let z=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(_);if(!f)z.push($);return this.getPreferredWidthForElements(z)}getPreferredWidthForColumnGroup(_){let f=this.getHeaderCellForColumn(_);if(!f)return-1;return this.getPreferredWidthForElements([f])}getPreferredWidthForElements(_,f){let $=document.createElement("form");$.style.position="fixed";let z=this.centerRowContainerCtrl.eContainer;for(let J of _)this.cloneItemIntoDummy(J,$);z.appendChild($);let Q=Math.ceil($.getBoundingClientRect().width);return $.remove(),f=f??this.gos.get("autoSizePadding"),Q+f}getHeaderCellForColumn(_){let f=null;for(let $ of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){let z=$.getHtmlElementForColumnHeader(_);if(z!=null)f=z}return f}cloneItemIntoDummy(_,f){let $=_.cloneNode(!0);$.style.width="",$.style.position="static",$.style.left="";let z=document.createElement("div"),Q=z.classList;if(["ag-header-cell","ag-header-group-cell"].some((X)=>$.classList.contains(X)))Q.add("ag-header","ag-header-row"),z.style.position="static";else Q.add("ag-row");let q=_.parentElement;while(q){if(["ag-header-row","ag-row"].some((Y)=>q.classList.contains(Y))){for(let Y=0;YJ.getPinned());_.dispatchEvent({type:"columnPinned",pinned:Q!=null?Q:null,columns:f,column:z,source:$})}function tE(_,f,$){if(!f.length)return;let z=f.length===1?f[0]:null,Q=pX(f,(J)=>J.isVisible());_.dispatchEvent({type:"columnVisible",visible:Q,columns:f,column:z,source:$})}function dX(_,f,$,z){_.dispatchEvent({type:f,columns:$,column:$&&$.length==1?$[0]:null,source:z})}function P1(_,f,$,z,Q=null){if(f?.length)_.dispatchEvent({type:"columnResized",columns:f,column:f.length===1?f[0]:null,flexColumns:Q,finished:$,source:z})}var rE=class extends A{constructor(_,f,$,z){super();this.comp=_,this.eResize=f,this.pinned=$,this.columnGroup=z}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}let{horizontalResizeSvc:_,gos:f,colAutosize:$}=this.beans,z=_.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(z),!f.get("suppressAutoSize")&&$)this.addDestroyFunc($.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(_){let{columnsToResize:f,resizeStartWidth:$,resizeRatios:z,groupAfterColumns:Q,groupAfterStartWidth:J,groupAfterRatios:q}=this.getInitialValues(_);this.resizeCols=f,this.resizeStartWidth=$,this.resizeRatios=z,this.resizeTakeFromCols=Q,this.resizeTakeFromStartWidth=J,this.resizeTakeFromRatios=q,this.toggleColumnResizing(!0)}onResizing(_,f,$="uiColumnResized"){let z=this.normaliseDragChange(f),Q=this.resizeStartWidth+z;this.resizeColumnsFromLocalValues(Q,$,_)}getInitialValues(_){let f=(Y)=>Y.reduce((Z,G)=>Z+G.getActualWidth(),0),$=(Y,Z)=>Y.map((G)=>G.getActualWidth()/Z),z=this.getColumnsToResize(),Q=f(z),J=$(z,Q),q={columnsToResize:z,resizeStartWidth:Q,resizeRatios:J},X=null;if(_)X=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null;if(X){let Y=X.getDisplayedLeafColumns(),Z=q.groupAfterColumns=Y.filter((E)=>E.isResizable()),G=q.groupAfterStartWidth=f(Z);q.groupAfterRatios=$(Z,G)}else q.groupAfterColumns=void 0,q.groupAfterStartWidth=void 0,q.groupAfterRatios=void 0;return q}resizeLeafColumnsToFit(_){let f=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),$=this.getInitialValues();if(f>$.resizeStartWidth)this.resizeColumns($,f,_,!0)}resizeColumnsFromLocalValues(_,f,$=!0){if(!this.resizeCols||!this.resizeRatios)return;let z={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(z,_,f,$)}resizeColumns(_,f,$,z=!0){let{columnsToResize:Q,resizeStartWidth:J,resizeRatios:q,groupAfterColumns:X,groupAfterStartWidth:Y,groupAfterRatios:Z}=_,G=[];if(G.push({columns:Q,ratios:q,width:f}),X){let E=f-J;G.push({columns:X,ratios:Z,width:Y-E})}if(this.beans.colResize?.resizeColumnSets({resizeSets:G,finished:z,source:$}),z)this.toggleColumnResizing(!1)}toggleColumnResizing(_){this.comp.toggleCss("ag-column-resizing",_)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((f)=>f.isResizable())}normaliseDragChange(_){let f=_;if(this.gos.get("enableRtl")){if(this.pinned!=="left")f*=-1}else if(this.pinned==="right")f*=-1;return f}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},lE=class extends A{constructor(_,f,$,z,Q){super();this.pinned=_,this.column=f,this.eResize=$,this.comp=z,this.ctrl=Q}postConstruct(){let _=[],f,$,z=()=>{if(N(this.eResize,f),!f)return;let{horizontalResizeSvc:q,colAutosize:X}=this.beans,Y=q.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(_.push(Y),$&&X)_.push(X.addColumnAutosizeListeners(this.eResize,this.column))},Q=()=>{for(let q of _)q();_.length=0},J=()=>{let q=this.column.isResizable(),X=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;if(q!==f||X!==$)f=q,$=X,Q(),z()};J(),this.addDestroyFunc(Q),this.ctrl.setRefreshFunction("resize",J)}onResizing(_,f){let{column:$,lastResizeAmount:z,resizeStartWidth:Q,beans:J}=this,q=this.normaliseResizeAmount(f),X=Q+q,Y=[{key:$,newWidth:X}],{pinnedCols:Z,ctrlsSvc:G,colResize:E}=J;if(this.column.getPinned()){let U=Z?.leftWidth??0,H=Z?.rightWidth??0,W=df(G.getGridBodyCtrl().eBodyViewport)-50;if(U+H+(q-z)>W)return}if(this.lastResizeAmount=q,E?.setColumnWidths(Y,this.resizeWithShiftKey,_,"uiColumnResized"),_)this.toggleColumnResizing(!1)}onResizeStart(_){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=_,this.toggleColumnResizing(!0)}toggleColumnResizing(_){this.column.resizing=_,this.comp.toggleCss("ag-column-resizing",_)}normaliseResizeAmount(_){let f=_,$=this.pinned!=="left",z=this.pinned==="right";if(this.gos.get("enableRtl")){if($)f*=-1}else if(z)f*=-1;return f}},sE=class extends A{constructor(){super(...arguments);this.beanName="colResize"}setColumnWidths(_,f,$,z){let Q=[],{colModel:J,gos:q,visibleCols:X}=this.beans;for(let Y of _){let Z=J.getColDefCol(Y.key)||J.getCol(Y.key);if(!Z)continue;if(Q.push({width:Y.newWidth,ratios:[1],columns:[Z]}),q.get("colResizeDefault")==="shift")f=!f;if(f){let E=X.getColAfter(Z);if(!E)continue;let U=Z.getActualWidth()-Y.newWidth,H=E.getActualWidth()+U;Q.push({width:H,ratios:[1],columns:[E]})}}if(Q.length===0)return;this.resizeColumnSets({resizeSets:Q,finished:$,source:z})}resizeColumnSets(_){let{resizeSets:f,finished:$,source:z}=_;if(!(!f||f.every((G)=>aE(G)))){if($){let G=f&&f.length>0?f[0].columns:null;P1(this.eventSvc,G,$,z)}return}let J=[],q=[];for(let G of f){let{width:E,columns:U,ratios:H}=G,W={},B={};for(let F of U)q.push(F);let K=!0,L=0;while(K){if(L++,L>1000){e(31);break}K=!1;let F=[],D=0,M=E;U.forEach((R,O)=>{if(B[R.getId()])M-=W[R.getId()];else{F.push(R);let T=H[O];D+=T}});let k=1/D;F.forEach((R,O)=>{let I=O===F.length-1,T;if(I)T=M;else T=Math.round(H[O]*E*k),M-=T;let y=R.getMinWidth(),i=R.getMaxWidth();if(T0&&T>i)T=i,B[R.getId()]=!0,K=!0;W[R.getId()]=T})}for(let F of U){let D=W[F.getId()];if(F.getActualWidth()!==D)F.setActualWidth(D,z),J.push(F)}}let X=J.length>0,Y=[];if(X){let{colFlex:G,visibleCols:E,colViewport:U}=this.beans;Y=G?.refreshFlexedColumns({resizingCols:q,skipSetLeft:!0})??[],E.setLeftValues(z),E.updateBodyWidths(),U.checkViewportColumns()}let Z=q.concat(Y);if(X||$)P1(this.eventSvc,Z,$,z,Y)}resizeHeader(_,f,$){if(!_.isResizable())return;let z=_.getActualWidth(),Q=_.getMinWidth(),J=_.getMaxWidth(),q=Math.min(Math.max(z+f,Q),J);this.setColumnWidths([{key:_,newWidth:q}],$,!0,"uiColumnResized")}createResizeFeature(_,f,$,z,Q){return new lE(_,f,$,z,Q)}createGroupResizeFeature(_,f,$,z){return new rE(_,f,$,z)}};function aE(_){let{columns:f,width:$}=_,z=0,Q=0,J=!0;for(let Y of f){let Z=Y.getMinWidth();z+=Z||0;let G=Y.getMaxWidth();if(G>0)Q+=G;else J=!1}let q=$>=z,X=!J||$<=Q;return q&&X}var oE={moduleName:"ColumnResize",version:c,beans:[sE],apiFunctions:{setColumnWidths:dE},dependsOn:[xJ,cX]},eE=class extends A{constructor(_,f){super();this.removeChildListenersFuncs=[],this.columnGroup=f,this.comp=_}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();let _=this.onWidthChanged.bind(this);for(let f of this.columnGroup.getLeafColumns())f.__addEventListener("widthChanged",_),f.__addEventListener("visibleChanged",_),this.removeChildListenersFuncs.push(()=>{f.__removeEventListener("widthChanged",_),f.__removeEventListener("visibleChanged",_)})}removeListenersOnChildrenColumns(){for(let _ of this.removeChildListenersFuncs)_();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){let _=this.columnGroup.getActualWidth();this.comp.setWidth(`${_}px`),this.comp.toggleCss("ag-hidden",_===0)}},_U=class extends vJ{constructor(){super(...arguments);this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource)this.setDragSource(this.eGui)}}wireComp(_,f,$,z,Q){let{column:J,beans:q}=this,{context:X,colNames:Y,colHover:Z,rangeSvc:G,colResize:E}=q;this.comp=_,Q=O$(this,X,Q),this.setGui(f,Q),this.displayName=Y.getDisplayNameForColumnGroup(J,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(Q),this.setupExpandable(Q),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:z,compBean:Q}),this.setupUserComp(),this.addHeaderMouseListeners(Q,z),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();let U=this.rowCtrl.pinned,H=J.getProvidedColumnGroup().getLeafColumns();if(Z?.createHoverFeature(Q,H,f),G?.createRangeHighlightFeature(Q,J,_),Q.createManagedBean(new PJ(J,f,q)),Q.createManagedBean(new eE(_,J)),E)this.resizeFeature=Q.createManagedBean(E.createGroupResizeFeature(_,$,U,J));else _.setResizableDisplayed(!1);Q.createManagedBean(new t0(f,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{return},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(Q,H),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),Q.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(Q),Q.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){let{column:_,beans:f}=this,$=_.getDefinition();return C(f.gos,{colDef:$,columnGroup:_,floatingFilter:!1})}refreshMaxHeaderHeight(){let{gos:_,comp:f}=this,$=_.get("groupHeaderHeight");if($!=null)if($===0)f.setHeaderWrapperHidden(!0);else f.setHeaderWrapperMaxHeight($);else f.setHeaderWrapperHidden(!1),f.setHeaderWrapperMaxHeight(null)}addHighlightListeners(_,f){if(!this.beans.gos.get("suppressMoveWhenColumnDragging"))return;for(let $ of f)_.addManagedListeners($,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,$)})}onLeafColumnHighlightChanged(_){let f=this.column.getDisplayedLeafColumns(),$=f[0]===_,z=b(f)===_;if(!$&&!z)return;let Q=_.getHighlighted(),J=!!this.rowCtrl.getHeaderCellCtrls().find((Y)=>{return Y.column.isMoving()}),q=!1,X=!1;if(J){let Y=this.beans.gos.get("enableRtl"),Z=Q===1,G=Q===0;if($)if(Y)X=Z;else q=G;if(z)if(Y)q=G;else X=Z}this.comp.toggleCss("ag-header-highlight-before",q),this.comp.toggleCss("ag-header-highlight-after",X)}resizeHeader(_,f){let{resizeFeature:$}=this;if(!$)return;let z=$.getInitialValues(f);$.resizeColumns(z,z.resizeStartWidth+_,"uiColumnResized",!0)}resizeLeafColumnsToFit(_){this.resizeFeature?.resizeLeafColumnsToFit(_)}setupUserComp(){let{colGroupSvc:_,userCompFactory:f,gos:$,enterpriseMenuFactory:z}=this.beans,Q=this.column,J=Q.getProvidedColumnGroup(),q=C($,{displayName:this.displayName,columnGroup:Q,setExpanded:(Y)=>{_.setColumnGroupOpened(J,Y,"gridInitializing")},setTooltip:(Y,Z)=>{$.assertModuleRegistered("Tooltip",3),this.setupTooltip(Y,Z)},showColumnMenu:(Y,Z)=>z?.showMenuAfterButtonClick(J,Y,"columnMenu",Z),showColumnMenuAfterMouseClick:(Y,Z)=>z?.showMenuAfterMouseEvent(J,Y,"columnMenu",Z),eGridHeader:this.eGui}),X=H8(f,q);if(X)this.comp.setUserCompDetails(X)}addHeaderMouseListeners(_,f){let{column:$,comp:z,beans:{rangeSvc:Q},gos:J}=this,q=(G)=>this.handleMouseOverChange(G.type==="mouseenter"),X=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",$.getProvidedColumnGroup()),Y=(G)=>this.handleContextMenuMouseEvent(G,void 0,$.getProvidedColumnGroup());_.addManagedListeners(this.eGui,{mouseenter:q,mouseleave:q,click:X,contextmenu:Y}),z.toggleCss("ag-header-group-cell-selectable",Gf(J));let Z=Q?.createHeaderGroupCellMouseListenerFeature(this.column,f);if(Z)this.createManagedBean(Z)}handleMouseOverChange(_){this.eventSvc.dispatchEvent({type:_?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(_,f){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,_,f)}setupExpandable(_){let f=this.column.getProvidedColumnGroup();this.refreshExpanded();let $=this.refreshExpanded.bind(this);_.addManagedListeners(f,{expandedChanged:$,expandableChanged:$})}refreshExpanded(){let{column:_}=this;this.expandable=_.isExpandable();let f=_.isExpanded();if(this.expandable)this.comp.setAriaExpanded(f?"true":"false");else this.comp.setAriaExpanded(void 0);this.refreshHeaderStyles()}addClasses(){let{column:_}=this,f=_.getColGroupDef(),$=$Q(f,this.gos,null,_);if(_.isPadding()){if($.push("ag-header-group-cell-no-group"),_.getLeafColumns().every((Q)=>Q.isSpanHeaderHeight()))$.push("ag-header-span-height")}else if($.push("ag-header-group-cell-with-group"),f?.wrapHeaderText)$.push("ag-header-cell-wrap-text");for(let z of $)this.comp.toggleCss(z,!0)}setupMovingCss(_){let{column:f}=this,z=f.getProvidedColumnGroup().getLeafColumns(),Q=()=>this.comp.toggleCss("ag-header-cell-moving",f.isMoving());for(let J of z)_.addManagedListeners(J,{movingChanged:Q});Q()}onFocusIn(_){if(!this.eGui.contains(_.relatedTarget))this.focusThis(),this.announceAriaDescription()}handleKeyDown(_){if(super.handleKeyDown(_),!this.getWrapperHasFocus())return;let{column:$,expandable:z,gos:Q,beans:J}=this,q=Gf(Q);if(_.key!=S.ENTER)return;if(q&&!_.altKey)J.rangeSvc?.handleColumnSelection($,_);else if(z){let X=!$.isExpanded();J.colGroupSvc.setColumnGroupOpened($.getProvidedColumnGroup(),X,"uiColumnExpanded")}}refreshAnnouncement(){let _,{gos:f}=this;if(Gf(f))_=this.getLocaleTextFunc()("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group");this.ariaAnnouncement=_}announceAriaDescription(){let{beans:_,eGui:f,ariaAnnouncement:$}=this;if(!$||!f.contains(d(_)))return;_.ariaAnnounce?.announceValue($,"columnHeader")}setDragSource(_){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!_)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(_,this.column,this.displayName)??null}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some((_)=>_.getColDef().suppressMovable||_.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function fU(_,f,$){_.colGroupSvc?.setColumnGroupOpened(f,$,"api")}function $U(_,f,$){return _.colGroupSvc?.getColumnGroup(f,$)??null}function zU(_,f){return _.colGroupSvc?.getProvidedColGroup(f)??null}function QU(_,f,$){return _.colNames.getDisplayNameForColumnGroup(f,$)||""}function JU(_){return _.colGroupSvc?.getColumnGroupState()??[]}function qU(_,f){_.colGroupSvc?.setColumnGroupState(f,"api")}function XU(_){_.colGroupSvc?.resetColumnGroupState("api")}function YU(_){return _.visibleCols.treeLeft}function ZU(_){return _.visibleCols.treeCenter}function GU(_){return _.visibleCols.treeRight}function EU(_){return _.visibleCols.getAllTrees()}var tX=class{constructor(){this.existingIds={}}getInstanceIdForKey(_){let f=this.existingIds[_],$;if(typeof f!=="number")$=0;else $=f+1;return this.existingIds[_]=$,$}};function UU(_,f){for(let $=0;$=0)_[z]=_[_.length-1],_.pop()}}var HU=class extends A{constructor(){super(...arguments);this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(_,f=!1){let{colFlex:$,colModel:z,colGroupSvc:Q,colViewport:J,selectionColSvc:q}=this.beans;if(!f)this.buildTrees(z,Q);Q?.updateOpenClosedVisibility(),this.leftCols=U6(this.treeLeft),this.centerCols=U6(this.treeCenter),this.rightCols=U6(this.treeRight),q?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(z),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(_),this.autoHeightCols=this.allCols.filter((X)=>X.isAutoHeight()),$?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(z,this.leftCols,this.rightCols,_),J.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:_})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let _=0;for(let f of this.allCols){let $=f.getParent();while($){if(!$.isPadding()){let z=$.getProvidedColumnGroup().getLevel()+1;if(z>_)_=z;break}$=$.getParent()}}return _}updateBodyWidths(){let _=m0(this.centerCols),f=m0(this.leftCols),$=m0(this.rightCols);if(this.isBodyWidthDirty=this.bodyWidth!==_,this.bodyWidth!==_||this.leftWidth!==f||this.rightWidth!==$)this.bodyWidth=_,this.leftWidth=f,this.rightWidth=$,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"})}setLeftValues(_){this.setLeftValuesOfCols(_),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(_,f,$,z){let Q,J;if(this.gos.get("enableRtl"))Q=f?f[0]:null,J=$?b($):null;else Q=f?b(f):null,J=$?$[0]:null;for(let q of _.getCols())q.setLastLeftPinned(q===Q,z),q.setFirstRightPinned(q===J,z)}buildTrees(_,f){let $=_.getColsToShow(),z=$.filter((Y)=>Y.getPinned()=="left"),Q=$.filter((Y)=>Y.getPinned()=="right"),J=$.filter((Y)=>Y.getPinned()!="left"&&Y.getPinned()!="right"),q=new tX,X=(Y)=>{return f?f.createColumnGroups(Y):Y.columns};this.treeLeft=X({columns:z,idCreator:q,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=X({columns:Q,idCreator:q,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=X({columns:J,idCreator:q,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(_){let f=_.getCols(),$=[],z=[],Q=[];for(let J of f){let q=J.getPinned();if(!q)z.push(J);else if(q===!0||q==="left")$.push(J);else Q.push(J)}this.ariaOrderColumns=$.concat(z).concat(Q)}getAriaColIndex(_){let f;if(G_(_))f=_.getLeafColumns()[0];else f=_;return this.ariaOrderColumns.indexOf(f)+1}setLeftValuesOfGroups(){for(let _ of[this.treeLeft,this.treeRight,this.treeCenter])for(let f of _)if(G_(f))f.checkLeft()}setLeftValuesOfCols(_){let{colModel:f}=this.beans;if(!f.getColDefCols())return;let z=f.getCols().slice(0),Q=this.gos.get("enableRtl");for(let J of[this.leftCols,this.rightCols,this.centerCols]){if(Q){let q=m0(J);for(let X of J)q-=X.getActualWidth(),X.setLeft(q,_)}else{let q=0;for(let X of J)X.setLeft(q,_),q+=X.getActualWidth()}UU(z,J)}for(let J of z)J.setLeft(null,_)}joinCols(){if(this.gos.get("enableRtl"))this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols);else this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){if(this.treeLeft&&this.treeRight&&this.treeCenter)return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);return null}isColDisplayed(_){return this.allCols.indexOf(_)>=0}getLeftColsForRow(_){let{leftCols:f,beans:{colModel:$}}=this;if(!$.colSpanActive)return f;return this.getColsForRow(_,f)}getRightColsForRow(_){let{rightCols:f,beans:{colModel:$}}=this;if(!$.colSpanActive)return f;return this.getColsForRow(_,f)}getColsForRow(_,f,$,z){let Q=[],J=null;for(let q=0;q1){let U=Z-1;for(let H=1;H<=U;H++)G.push(f[q+H]);q+=U}let E;if($){E=!1;for(let U of G)if($(U))E=!0}else E=!0;if(E){if(Q.length===0&&J){if(z?z(X):!1)Q.push(J)}Q.push(X)}J=X}return Q}getContainerWidth(_){switch(_){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(_){let f=this.allCols,$=f.indexOf(_);if($>0)return f[$-1];return null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};let _=(f)=>{this.colsAndGroupsMap[f.getUniqueId()]=f};nf(this.treeCenter,!1,_),nf(this.treeLeft,!1,_),nf(this.treeRight,!1,_)}isVisible(_){return this.colsAndGroupsMap[_.getUniqueId()]===_}getFirstColumn(){let _=this.gos.get("enableRtl"),f=["leftCols","centerCols","rightCols"];if(_)f.reverse();for(let $=0;${if(Q0($))f.push($)}),f}var WU=class extends A{constructor(){super(...arguments);this.beanName="colGroupSvc"}getColumnGroupState(){let _=[],f=this.beans.colModel.getColTree();return y0(null,f,($)=>{if(X_($))_.push({groupId:$.getGroupId(),open:$.isExpanded()})}),_}resetColumnGroupState(_){let f=this.beans.colModel.getColDefColTree();if(!f)return;let $=[];y0(null,f,(z)=>{if(X_(z)){let Q=z.getColGroupDef(),J={groupId:z.getGroupId(),open:!Q?void 0:Q.openByDefault};$.push(J)}}),this.setColumnGroupState($,_)}setColumnGroupState(_,f){let{colModel:$,colAnimation:z,visibleCols:Q,eventSvc:J}=this.beans;if(!$.getColTree().length)return;z?.start();let X=[];for(let Y of _){let{groupId:Z,open:G}=Y,E=this.getProvidedColGroup(Z);if(!E)continue;if(E.isExpanded()===G)continue;E.setExpanded(G),X.push(E)}if(Q.refresh(f,!0),X.length)J.dispatchEvent({type:"columnGroupOpened",columnGroup:X.length===1?X[0]:void 0,columnGroups:X});z?.finish()}setColumnGroupOpened(_,f,$){let z;if(X_(_))z=_.getId();else z=_||"";this.setColumnGroupState([{groupId:z,open:f}],$)}getProvidedColGroup(_){let f=null;return y0(null,this.beans.colModel.getColTree(),($)=>{if(X_($)){if($.getId()===_)f=$}}),f}getGroupAtDirection(_,f){let $=_.getProvidedColumnGroup().getLevel()+_.getPaddingLevel(),z=_.getDisplayedLeafColumns(),Q=f==="After"?b(z):z[0],J=`getCol${f}`;while(!0){let q=this.beans.visibleCols[J](Q);if(!q)return null;let X=this.getColGroupAtLevel(q,$);if(X!==_)return X}}getColGroupAtLevel(_,f){let $=_.getParent(),z,Q;while(!0){if(z=$.getProvidedColumnGroup().getLevel(),Q=$.getPaddingLevel(),z+Q<=f)break;$=$.getParent()}return $}updateOpenClosedVisibility(){let _=this.beans.visibleCols.getAllTrees();nf(_,!1,(f)=>{if(G_(f))f.calculateDisplayedColumns()})}getColumnGroup(_,f){if(!_)return null;if(G_(_))return _;let $=this.beans.visibleCols.getAllTrees(),z=typeof f==="number",Q=null;return nf($,!1,(J)=>{if(G_(J)){let q=J,X;if(z)X=_===q.getGroupId()&&f===q.getPartId();else X=_===q.getGroupId();if(X)Q=q}}),Q}createColumnGroups(_){let{columns:f,idCreator:$,pinned:z,oldDisplayedGroups:Q,isStandaloneStructure:J}=_,q=this.mapOldGroupsById(Q),X=[],Y=f;while(Y.length){let Z=Y;Y=[];let G=0,E=(U)=>{let H=G;G=U;let W=Z[H],K=(G_(W)?W.getProvidedColumnGroup():W).getOriginalParent();if(K==null){for(let F=H;FX_(G))){Y.setChildren([q]);continue}else{Y.setChildren(_);break}Q.push(q)}}return Q}findDepth(_){let f=0,$=_;while($?.[0]&&X_($[0]))f++,$=$[0].getChildren();return f}findMaxDepth(_,f){let $=f;for(let z=0;z<_.length;z++){let Q=_[z];if(X_(Q)){let J=Q,q=this.findMaxDepth(J.getChildren(),f+1);if($=0;J--){let q=new cf(null,`FAKE_PATH_${z.getId()}_${J}`,!0,J);this.createBean(q),q.setChildren([Q]),Q.originalParent=q,Q=q}if(f===0)z.originalParent=null;$.push(Q)}return $}findExistingGroup(_,f){if(_.groupId==null)return;for(let z=0;z{for(let Q of z)if(G_(Q)){let J=Q;f[Q.getUniqueId()]=J,$(J.getChildren())}};if(_)$(_);return f}setupParentsIntoCols(_,f){for(let $ of _??[]){if($.parent!==f)this.beans.colViewport.colsWithinViewportHash="";if($.parent=f,G_($)){let z=$;this.setupParentsIntoCols(z.getChildren(),z)}}}},NJ={moduleName:"ColumnGroup",version:c,dynamicBeans:{headerGroupCellCtrl:_U},beans:[WU],apiFunctions:{getAllDisplayedColumnGroups:EU,getCenterDisplayedColumnGroups:ZU,getColumnGroup:$U,getColumnGroupState:JU,getDisplayNameForColumnGroup:QU,getLeftDisplayedColumnGroups:YU,getProvidedColumnGroup:zU,getRightDisplayedColumnGroups:GU,resetColumnGroupState:XU,setColumnGroupOpened:fU,setColumnGroupState:qU}};function d_(_,f,$){let{colModel:z,rowGroupColsSvc:Q,pivotColsSvc:J,autoColSvc:q,selectionColSvc:X,colAnimation:Y,visibleCols:Z,pivotResultCols:G,environment:E,valueColsSvc:U,eventSvc:H,gos:W}=_,B=z.getColDefCols()??[],K=X?.getColumns();if(!B.length&&!K?.length)return!1;if(f?.state&&!f.state.forEach)return j(32),!1;let L=(k,R,O,I,T)=>{if(!k)return;let y=g7(R,f.defaultState),i=y("flex").value1,x=y("sort").value1,a=y("sortType").value1,t=Ef(x)||GJ(a),u=M0(a),__=lz(x),r=t?{type:u,direction:__}:void 0;if(pq(_,k,y("hide").value1,r,y("sortIndex").value1,y("pinned").value1,i,$),i==null){let O_=y("width").value1;if(O_!=null){let P_=k.getColDef().minWidth??E.getDefaultColumnMinWidth();if(P_!=null&&O_>=P_)k.setActualWidth(O_,$)}}if(T||!k.isPrimary())return;U?.syncColumnWithState(k,$,y),Q?.syncColumnWithState(k,$,y,O),J?.syncColumnWithState(k,$,y,I)},F=(k,R,O)=>{let I=lX(_,$),T=R.slice(),y={},i={},x=[],a=[],t=[],u=0,__=Q?.columns.slice()??[],r=J?.columns.slice()??[];for(let M_ of k){let Tf=M_.colId;if(Tf.startsWith(af)){x.push(M_),t.push(M_);continue}if(x0(Tf)){a.push(M_),t.push(M_);continue}let Z1=O(Tf);if(!Z1)t.push(M_),u+=1;else L(Z1,M_,y,i,!1),Q_(T,Z1)}let O_=(M_)=>L(M_,null,y,i,!1);T.forEach(O_),Q?.sortColumns(X9.bind(Q,y,__)),J?.sortColumns(X9.bind(J,i,r)),z.refreshCols(!1,$);let P_=(M_,Tf,gQ=[])=>{for(let Z1 of Tf){let I2=M_(Z1.colId);Q_(gQ,I2),L(I2,Z1,null,null,!0)}gQ.forEach(O_)};return P_((M_)=>q?.getColumn(M_)??null,x,q?.getColumns()?.slice()),P_((M_)=>X?.getColumn(M_)??null,a,X?.getColumns()?.slice()),BU(f,z,W),Z.refresh($),H.dispatchEvent({type:"columnEverythingChanged",source:$}),I(),{unmatchedAndAutoStates:t,unmatchedCount:u}};Y?.start();let{unmatchedAndAutoStates:D,unmatchedCount:M}=F(f.state||[],B,(k)=>z.getColDefCol(k));if(D.length>0||v(f.defaultState)){let k=G?.getPivotResultCols()?.list??[];M=F(D,k,(R)=>G?.getPivotResultCol(R)??null).unmatchedCount}return Y?.finish(),M===0}function rX(_,f){let{colModel:$,autoColSvc:z,selectionColSvc:Q,eventSvc:J,gos:q}=_,X=$.getColDefCols();if(!X?.length)return;let Y=$.getColDefColTree(),Z=sz(Y),G=[],E=1000,U=1000,H=(F)=>{let D=sX(F);if(n(D.rowGroupIndex)&&D.rowGroup)D.rowGroupIndex=E++;if(n(D.pivotIndex)&&D.pivot)D.pivotIndex=U++;G.push(D)};z?.getColumns()?.forEach(H),Q?.getColumns()?.forEach(H),Z?.forEach(H),d_(_,{state:G},f);let W=z?.getColumns()??[],L=[...Q?.getColumns()??[],...W,...X].map((F)=>({colId:F.colId}));d_(_,{state:L,applyOrder:!0},f),J.dispatchEvent(C(q,{type:"columnsReset",source:f}))}function lX(_,f){let{rowGroupColsSvc:$,pivotColsSvc:z,valueColsSvc:Q,colModel:J,sortSvc:q,eventSvc:X}=_,Y={rowGroupColumns:$?.columns.slice()??[],pivotColumns:z?.columns.slice()??[],valueColumns:Q?.columns.slice()??[]},Z=q9(_),G={};for(let E of Z)G[E.colId]=E;return()=>{let E=(R,O,I,T)=>{let y=O.map(T),i=I.map(T);if(J_(y,i))return;let a=new Set(O);for(let u of I)if(!a.delete(u))a.add(u);let t=[...a];X.dispatchEvent({type:R,columns:t,column:t.length===1?t[0]:null,source:f})},U=(R)=>{let O=[];return J.forAllCols((I)=>{let T=G[I.getColId()];if(T&&R(T,I))O.push(I)}),O},H=(R)=>R.getColId();E("columnRowGroupChanged",Y.rowGroupColumns,$?.columns??[],H),E("columnPivotChanged",Y.pivotColumns,z?.columns??[],H);let B=U((R,O)=>{let I=R.aggFunc!=null,T=I!=O.isValueActive(),y=I&&R.aggFunc!=O.getAggFunc();return T||y});if(B.length>0)dX(X,"columnValueChanged",B,f);P1(X,U((R,O)=>R.width!=O.getActualWidth()),!0,f),nX(X,U((R,O)=>R.pinned!=O.getPinned()),f),tE(X,U((R,O)=>R.hide==O.isVisible()),f);let M=U((R,O)=>!Ez(O.getSortDef(),{type:M0(R.sortType),direction:lz(R.sort)})||R.sortIndex!=O.getSortIndex());if(M.length>0)q?.dispatchSortChangedEvents(f,M);let k=q9(_);LU(Z,k,f,J,X)}}function q9(_){let{colModel:f,rowGroupColsSvc:$,pivotColsSvc:z}=_,Q=f.getColDefCols();if(n(Q)||!f.isAlive())return[];let J=$?.columns,q=z?.columns,X=[],Y=(G)=>{let E=G.isRowGroupActive()&&J?J.indexOf(G):null,U=G.isPivotActive()&&q?q.indexOf(G):null,H=G.isValueActive()?G.getAggFunc():null,W=G.getSortIndex()!=null?G.getSortIndex():null;X.push({colId:G.getColId(),width:G.getActualWidth(),hide:!G.isVisible(),pinned:G.getPinned(),sort:G.getSort(),sortType:G.getSortDef()?.type,sortIndex:W,aggFunc:H,rowGroup:G.isRowGroupActive(),rowGroupIndex:E,pivot:G.isPivotActive(),pivotIndex:U,flex:G.getFlex()??null})};f.forAllCols((G)=>Y(G));let Z=new Map(f.getCols().map((G,E)=>[G.getColId(),E]));return X.sort((G,E)=>{let U=Z.has(G.colId)?Z.get(G.colId):-1,H=Z.has(E.colId)?Z.get(E.colId):-1;return U-H}),X}function sX(_){let f=(K,L)=>K!=null?K:L!=null?L:null,$=_.getColDef(),z=e_(f($.sort,$.initialSort)),Q=z.direction,J=z.type,q=f($.sortIndex,$.initialSortIndex),X=f($.hide,$.initialHide),Y=f($.pinned,$.initialPinned),Z=f($.width,$.initialWidth),G=f($.flex,$.initialFlex),E=f($.rowGroupIndex,$.initialRowGroupIndex),U=f($.rowGroup,$.initialRowGroup);if(E==null&&!U)E=null,U=null;let H=f($.pivotIndex,$.initialPivotIndex),W=f($.pivot,$.initialPivot);if(H==null&&!W)H=null,W=null;let B=f($.aggFunc,$.initialAggFunc);return{colId:_.getColId(),sort:Q,sortType:J,sortIndex:q,hide:X,pinned:Y,width:Z,flex:G,rowGroup:U,rowGroupIndex:E,pivot:W,pivotIndex:H,aggFunc:B}}function BU(_,f,$){if(!_.applyOrder||!_.state)return;let z=[];for(let Q of _.state)if(Q.colId!=null)z.push(Q.colId);KU(f.cols,z,f,$)}function KU(_,f,$,z){if(_==null)return;let Q=[],J={};for(let X of f){if(J[X])continue;let Y=_.map[X];if(Y)Q.push(Y),J[X]=!0}let q=0;for(let X of _.list){let Y=X.getColId();if(J[Y]!=null)continue;if(Y.startsWith(af))Q.splice(q++,0,X);else Q.push(X)}if(Q=iX(Q,z),!mX(Q,$.getColTree())){j(39);return}_.list=Q}function LU(_,f,$,z,Q){let J={};for(let G of f)J[G.colId]=G;let q={};for(let G of _)if(J[G.colId])q[G.colId]=!0;let X=_.filter((G)=>q[G.colId]),Y=f.filter((G)=>q[G.colId]),Z=[];if(Y.forEach((G,E)=>{let U=X?.[E];if(U&&U.colId!==G.colId){let H=z.getCol(U.colId);if(H)Z.push(H)}}),!Z.length)return;Q.dispatchEvent({type:"columnMoved",columns:Z,column:Z.length===1?Z[0]:null,finished:!0,source:$})}var X9=(_,f,$,z)=>{let Q=_[$.getId()],J=_[z.getId()],q=Q!=null,X=J!=null;if(q&&X)return Q-J;if(q)return-1;if(X)return 1;let Y=f.indexOf($),Z=f.indexOf(z),G=Y>=0,E=Z>=0;if(G&&E)return Y-Z;if(G)return-1;return 1},FU=class extends A{constructor(){super(...arguments);this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","groupHideColumnsUntilExpanded","rowNumbers","hidePaddedHeaderRows"],(_)=>this.refreshAll(Uf(_.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",(_)=>this.setPivotMode(this.gos.get("pivotMode"),Uf(_.source)))}createColsFromColDefs(_){let{beans:f}=this,{valueCache:$,colAutosize:z,rowGroupColsSvc:Q,pivotColsSvc:J,valueColsSvc:q,visibleCols:X,eventSvc:Y,groupHierarchyColSvc:Z}=f,G=this.colDefs?lX(f,_):void 0;$?.expire();let E=this.colDefCols?.list,U=this.colDefCols?.tree,H=UJ(f,this.colDefs,!0,U,_);J0(f,this.colDefCols?.tree,H.columnTree);let{columnTree:W,treeDepth:B}=H,K=sz(W),L={};for(let F of K)L[F.getId()]=F;if(this.colDefCols={tree:W,treeDepth:B,list:K,map:L},this.createColumnsForService([Z],this.colDefCols,_),Q?.extractCols(_,E),J?.extractCols(_,E),q?.extractCols(_,E),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,_),this.changeEventsDispatching=!1,X.refresh(_),Y.dispatchEvent({type:"columnEverythingChanged",source:_}),G)this.changeEventsDispatching=!0,G(),this.changeEventsDispatching=!1;if(Y.dispatchEvent({type:"newColumnsLoaded",source:_}),_==="gridInitializing")z?.applyAutosizeStrategy()}refreshCols(_,f){if(!this.colDefCols)return;let $=this.cols?.tree;this.saveColOrder();let{autoColSvc:z,selectionColSvc:Q,rowNumbersSvc:J,quickFilter:q,pivotResultCols:X,showRowGroupCols:Y,rowAutoHeight:Z,visibleCols:G,colViewport:E,eventSvc:U,formula:H}=this.beans,W=this.selectCols(X,this.colDefCols);H?.setFormulasActive(W),this.createColumnsForService([z,Q,J],W,f);let B=L7(this.gos,this.showingPivotResult);if(!_||B)this.restoreColOrder(W);if(this.positionLockedCols(W),Y?.refresh(),q?.refreshCols(),this.setColSpanActive(),Z?.setAutoHeightActive(W),G.clear(),E.clear(),!J_($,this.cols.tree))U.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(_,f,$){for(let z of _){if(!z)continue;z.createColumns(f,(Q)=>{this.lastOrder=Q(this.lastOrder),this.lastPivotOrder=Q(this.lastPivotOrder)},$),z.addColumns(f)}}selectCols(_,f){let $=_?.getPivotResultCols()??null;this.showingPivotResult=$!=null;let{map:z,list:Q,tree:J,treeDepth:q}=$??f;if(this.cols={list:Q.slice(),map:{...z},tree:J.slice(),treeDepth:q},$){if(!$.list.some((Y)=>this.cols?.map[Y.getColId()]!==void 0))this.lastPivotOrder=null}return this.cols}getColsToShow(){if(!this.cols)return[];let{beans:_,showingPivotResult:f,cols:$}=this,{valueColsSvc:z,selectionColSvc:Q,gos:J}=_,q=this.isPivotMode()&&!f,X=Q?.isSelectionColumnEnabled(),Y=F7(_),Z=z?.columns,G=XJ(J);return $.list.filter((U)=>{let H=of(U);if(q)return Z?.includes(U)||H&&(!G||U.isVisible())||X&&x0(U)||Y&&I_(U);else return H&&!G||U.isVisible()})}refreshAll(_){if(!this.ready)return;this.refreshCols(!1,_),this.beans.visibleCols.refresh(_)}setColsVisible(_,f=!1,$){d_(this.beans,{state:_.map((z)=>({colId:typeof z==="string"?z:z.getColId(),hide:!f}))},$)}restoreColOrder(_){let f=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!f)return;let $=f.filter((E)=>_.map[E.getId()]!=null);if($.length===0)return;if($.length===_.list.length){_.list=$;return}let z=(E)=>{let U=E.getOriginalParent();if(!U)return!1;if(U.getChildren().length>1)return!0;return z(U)};if(!$.some((E)=>z(E))){let E=new Set($);for(let U of _.list)if(!E.has(U))$.push(U);_.list=$;return}let Q=new Map;for(let E=0;E<$.length;E++){let U=$[E];Q.set(U,E)}let J=_.list.filter((E)=>!Q.has(E));if(J.length===0){_.list=$;return}let q=(E,U)=>{let H=U?U.getOriginalParent():E.getOriginalParent();if(!H)return null;let W=null,B=null;for(let K of H.getChildren()){if(K===U||K===E)continue;if(K instanceof Z0){let L=Q.get(K);if(L==null)continue;if(W==null||W{let F=Q.get(L);if(F==null)return;if(W==null||W=0;E--)Z[G--]=X[E];for(let E=$.length-1;E>=0;E--){let U=$[E],H=Y.get(U);if(H)if(Array.isArray(H))for(let W=H.length-1;W>=0;W--){let B=H[W];Z[G--]=B}else Z[G--]=H;Z[G--]=U}_.list=Z}positionLockedCols(_){_.list=iX(_.list,this.gos)}saveColOrder(){if(this.showingPivotResult)this.lastPivotOrder=this.cols?.list??null;else this.lastOrder=this.cols?.list??null}getColumnDefs(_){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],_)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some((_)=>_.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(_,f){if(_===this.pivotMode)return;if(this.pivotMode=_,!this.ready)return;this.refreshCols(!1,f);let{visibleCols:$,eventSvc:z}=this.beans;$.refresh(f),z.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){let _=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!_?.length}recreateColumnDefs(_){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(_);let f=Uf(_.source);this.createColsFromColDefs(f)}setColumnDefs(_,f){this.colDefs=_,this.createColsFromColDefs(f)}destroy(){J0(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(_){let{pivotResultCols:f,autoColSvc:$,selectionColSvc:z,groupHierarchyColSvc:Q}=this.beans;if(n1(this.colDefCols?.list,_))return;if(n1($?.columns?.list,_))return;if(n1(z?.columns?.list,_))return;if(n1(Q?.columns?.list,_))return;if(n1(f?.getPivotResultCols()?.list,_))return}getColsForKeys(_){if(!_)return[];return _.map((f)=>this.getCol(f)).filter((f)=>f!=null)}getColDefCol(_){if(!this.colDefCols?.list)return null;return this.getColFromCollection(_,this.colDefCols)}getCol(_){if(_==null)return null;return this.getColFromCollection(_,this.cols)}getColById(_){return this.cols?.map[_]??null}getColFromCollection(_,f){if(f==null)return null;let{map:$,list:z}=f;if(typeof _=="string"&&$[_])return $[_];for(let X=0;X_(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(_){return I0(this.getGui(),_),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(_,f){if(this.value===_)return this;if(this.previousValue=this.value,this.value=_,!f)this.dispatchLocalEvent({type:"fieldValueChanged"});return this}};function SU(_){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:_,ref:"eInput",cls:"ag-input-field-input"}]}]}}var aX=class extends kU{constructor(_,f,$="text",z="input"){super(_,_?.template??SU(z),[],f);this.inputType=$,this.displayFieldTag=z,this.eLabel=V,this.eWrapper=V,this.eInput=V}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);let{eLabel:_,eWrapper:f,eInput:$,className:z}=this;_.classList.add(`${z}-label`),f.classList.add(`${z}-input-wrapper`),$.classList.add(`${z}-input`),this.addCss("ag-input-field"),$.id=$.id||`ag-${this.getCompId()}-input`;let{inputName:Q,inputWidth:J,inputPlaceholder:q,autoComplete:X,tabIndex:Y}=this.config;if(Q!=null)this.setInputName(Q);if(J!=null)this.setInputWidth(J);if(q!=null)this.setInputPlaceholder(q);if(X!=null)this.setAutoComplete(X);this.addInputListeners(),this.activateTabIndex([$],Y)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:(_)=>this.setValue(_.target.value)})}setInputType(_){if(this.displayFieldTag==="input")this.inputType=_,gf(this.eInput,"type",_)}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(_){return Wq(this.eWrapper,_),this}setInputName(_){return this.getInputElement().setAttribute("name",_),this}getFocusableElement(){return this.eInput}setMaxLength(_){let f=this.eInput;return f.maxLength=_,this}setInputPlaceholder(_){return gf(this.eInput,"placeholder",_),this}setInputAriaLabel(_){return W_(this.eInput,_),this.refreshAriaLabelledBy(),this}setDisabled(_){return o6(this.eInput,_),super.setDisabled(_)}setAutoComplete(_){if(_===!0)gf(this.eInput,"autocomplete",null);else{let f=typeof _==="string"?_:"off";gf(this.eInput,"autocomplete",f)}return this}},gJ=class extends aX{constructor(_,f="ag-checkbox",$="checkbox"){super(_,f,$);this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();let{readOnly:_,passive:f,name:$}=this.config;if(typeof _==="boolean")this.setReadOnly(_);if(typeof f==="boolean")this.setPassive(f);if($!=null)this.setName($)}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(_){this.passive=_}isReadOnly(){return this.readOnly}setReadOnly(_){this.eWrapper.classList.toggle("ag-disabled",_),this.eInput.disabled=_,this.readOnly=_}setDisabled(_){return this.eWrapper.classList.toggle("ag-disabled",_),super.setDisabled(_)}toggle(){if(this.eInput.disabled)return;let _=this.isSelected(),f=this.getNextValue();if(this.passive)this.dispatchChange(f,_);else this.setValue(f)}getValue(){return this.isSelected()}setValue(_,f){return this.refreshSelectedClass(_),this.setSelected(_,f),this}setName(_){let f=this.getInputElement();return f.name=_,this}isSelected(){return this.selected}setSelected(_,f){if(this.isSelected()===_)return;this.previousValue=this.isSelected(),_=this.selected=typeof _==="boolean"?_:void 0;let $=this.eInput;if($.checked=_,$.indeterminate=_===void 0,!f)this.dispatchChange(this.selected,this.previousValue)}dispatchChange(_,f,$){this.dispatchLocalEvent({type:"fieldValueChanged",selected:_,previousValue:f,event:$});let z=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:z.id,name:z.name,selected:_,previousValue:f})}onCheckboxClick(_){if(this.passive||this.eInput.disabled)return;let f=this.isSelected(),$=this.selected=_.target.checked;this.refreshSelectedClass($),this.dispatchChange($,f,_)}refreshSelectedClass(_){let f=this.eWrapper.classList;f.toggle("ag-checked",_===!0),f.toggle("ag-indeterminate",_==null)}},h0={selector:"AG-CHECKBOX",component:gJ},AU=".ag-checkbox-cell{height:100%}",RU={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},jU=class extends w{constructor(){super(RU,[h0]);this.eCheckbox=V,this.registerCSS(AU)}init(_){this.refresh(_);let{eCheckbox:f,beans:$}=this,z=f.getInputElement();z.setAttribute("tabindex","-1"),o9(z,"polite"),this.addManagedListeners(z,{click:(Q)=>{if(n_(Q),f.isDisabled())return;let J=f.getValue();this.onCheckboxChanged(J)},dblclick:(Q)=>{n_(Q)}}),this.addManagedElementListeners(_.eGridCell,{keydown:(Q)=>{if(Q.key===S.SPACE&&!f.isDisabled()){if(_.eGridCell===d($))f.toggle();let J=f.getValue();this.onCheckboxChanged(J),Q.preventDefault()}}})}refresh(_){return this.params=_,this.updateCheckbox(_),!0}updateCheckbox(_){let f,$=!0,{value:z,column:Q,node:J}=_;if(J.group&&Q)if(typeof z==="boolean")f=z;else{let E=Q.getColId();if(E.startsWith(af))f=z==null||z===""?void 0:z==="true";else if(J.aggData&&J.aggData[E]!==void 0)f=z??void 0;else if(J.sourceRowIndex>=0)f=z??void 0;else $=!1}else f=z??void 0;let{eCheckbox:q}=this;if(!$){q.setDisplayed(!1);return}q.setValue(f);let X=_.disabled??!Q?.isCellEditable(J);q.setDisabled(X);let Y=this.getLocaleTextFunc(),Z=s6(Y,f),G=X?Z:`${Y("ariaToggleCellValue","Press SPACE to toggle cell value")} (${Z})`;q.setInputAriaLabel(G)}onCheckboxChanged(_){let{params:f}=this,{column:$,node:z,value:Q}=f,{editSvc:J}=this.beans;if(!$)return;let q={rowNode:z,column:$};J?.dispatchCellEvent(q,null,"cellEditingStarted",{value:Q});let X=z.setDataValue($,_,"ui");if(J?.dispatchCellEvent(q,null,"cellEditingStopped",{oldValue:Q,newValue:_,valueChanged:X}),!X)this.updateCheckbox(f)}},VU={tag:"div",cls:"ag-skeleton-container"},OU=class extends w{constructor(){super(VU)}init(_){let f=`ag-cell-skeleton-renderer-${this.getCompId()}`;if(this.getGui().setAttribute("id",f),this.addDestroyFunc(()=>z$(_.eParentOfValue)),z$(_.eParentOfValue,f),_.deferRender)this.setupLoading(_);else if(_.node.failedLoad)this.setupFailed();else this.setupLoading(_)}setupFailed(){let _=this.getLocaleTextFunc();this.getGui().textContent=_("loadingError","ERR");let f=_("ariaSkeletonCellLoadingFailed","Row failed to load");W_(this.getGui(),f)}setupLoading(_){let f=z_({tag:"div",cls:"ag-skeleton-effect"}),$=_.node.rowIndex;if($!=null){let J=75+25*($%2===0?Math.sin($):Math.cos($));f.style.width=`${J}%`}this.getGui().appendChild(f);let z=this.getLocaleTextFunc(),Q=_.deferRender?z("ariaDeferSkeletonCellLoading","Cell is loading"):z("ariaSkeletonCellLoading","Row data is loading");W_(this.getGui(),Q)}refresh(_){return!1}},PU={moduleName:"CheckboxCellRenderer",version:c,userComponents:{agCheckboxCellRenderer:jU}},vU={moduleName:"SkeletonCellRenderer",version:c,userComponents:{agSkeletonCellRenderer:OU}};var TU=class extends A{constructor(){super(...arguments);this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(_={}){let f=_.source??"flex";if(_.viewportWidth!=null)this.flexViewportWidth=_.viewportWidth;let $=this.flexViewportWidth,{visibleCols:z,colDelayRenderSvc:Q}=this.beans,J=z.centerCols,q=-1;if(_.resizingCols){let B=new Set(_.resizingCols);for(let K=J.length-1;K>=0;K--)if(B.has(J[K])){q=K;break}}let X=!1,Y=J.map((B,K)=>{let L=B.getFlex(),F=L!=null&&L>0&&K>q;return X||(X=F),{col:B,isFlex:F,flex:Math.max(0,L??0),initialSize:B.getActualWidth(),min:B.getMinWidth(),max:B.getMaxWidth(),targetSize:0}});if(X)Q?.hideColumns("colFlex"),this.columnsHidden=!0;else if(this.columnsHidden)this.revealColumns(Q);if(!$||!X)return[];let Z=Y.length,G=Y.reduce((B,K)=>B+K.flex,0),E=$,U=(B,K)=>{B.frozenSize=K,B.col.setActualWidth(K,f),E-=K,G-=B.flex,Z-=1},H=(B)=>B.frozenSize!=null;for(let B of Y)if(!B.isFlex)U(B,B.initialSize);while(Z>0){let B=Math.round(G<1?E*G:E),K,L=0,F=0;for(let k of Y){if(H(k))continue;K=k,F+=B*(k.flex/G);let R=F-L,O=Math.round(R);k.targetSize=O,L+=O}if(K)K.targetSize+=B-L;let D=0;for(let k of Y){if(H(k))continue;let R=k.targetSize,O=Math.min(Math.max(R,k.min),k.max);D+=O-R,k.violationType=O===R?void 0:O0?"min":"max";for(let k of Y){if(H(k))continue;if(M==="all"||k.violationType===M)U(k,k.targetSize)}}if(!_.skipSetLeft)z.setLeftValues(f);if(_.updateBodyWidths)z.updateBodyWidths();let W=Y.filter((B)=>B.isFlex&&!B.violationType).map((B)=>B.col);if(_.fireResizedEvent){let B=Y.filter((L)=>L.initialSize!==L.frozenSize).map((L)=>L.col),K=Y.filter((L)=>L.flex).map((L)=>L.col);P1(this.eventSvc,B,!0,f,K)}return this.revealColumns(Q),W}revealColumns(_){if(this.columnsHidden)_?.revealColumns("colFlex"),this.columnsHidden=!1}initCol(_){let{flex:f,initialFlex:$}=_.colDef;if(f!==void 0)_.flex=f;else if($!==void 0)_.flex=$}setColFlex(_,f){_.flex=f??null,_.dispatchStateUpdatedEvent("flex")}},Bf=(_)=>{if(typeof _==="bigint")return _;let f;if(typeof _==="number")f=_;else if(typeof _==="string"){if(f=_.trim(),f==="")return null;if(f.endsWith("n"))f=f.slice(0,-1);if(!/^[+-]?\d+$/.test(f))return null}if(f==null)return null;try{return BigInt(f)}catch{return null}},hJ="T",IU=new RegExp(`[${hJ} ]`),yU=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${hJ}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function xf(_,f){return _.toString().padStart(f,"0")}function Y9(_,f=!0,$=hJ){if(!_)return null;let z=[_.getFullYear(),_.getMonth()+1,_.getDate()].map((Q)=>xf(Q,2)).join("-");if(f)z+=$+[_.getHours(),_.getMinutes(),_.getSeconds()].map((Q)=>xf(Q,2)).join(":");return z}function K1(_,f=!0){if(!_)return null;if(f)return[String(_.getFullYear()),String(_.getMonth()+1),xf(_.getDate(),2),xf(_.getHours(),2),`:${xf(_.getMinutes(),2)}`,`:${xf(_.getSeconds(),2)}`];return[_.getFullYear(),_.getMonth()+1,xf(_.getDate(),2)].map(String)}var uJ=["January","February","March","April","May","June","July","August","September","October","November","December"];function Hz(_,f=!1){return!!H$(_,f)}function bU(_){return Hz(_,!0)}function H$(_,f=!1,$){if(!_)return null;if(!$&&!yU.test(_))return null;let[z,Q]=_.split(IU);if(!z)return null;let J=z.split("-").map((H)=>Number.parseInt(H,10));if(J.filter((H)=>!isNaN(H)).length!==3)return null;let[q,X,Y]=J,Z=new Date(q,X-1,Y);if(Z.getFullYear()!==q||Z.getMonth()!==X-1||Z.getDate()!==Y)return null;if(!Q&&f)return null;if(!Q||Q==="00:00:00")return Z;let[G,E,U]=Q.split(":").map((H)=>Number.parseInt(H,10));if(G>=0&&G<24)Z.setHours(G);else if(f)return null;if(E>=0&&E<60)Z.setMinutes(E);else if(f)return null;if(U>=0&&U<60)Z.setSeconds(U);else if(f)return null;return Z}function e1(_,f,$){if(!f||!_)return;if(!$)return _[f];let z=f.split("."),Q=_;for(let J=0;Jnull,suppressKeyboardEvent:({node:_,event:f,column:$})=>f.key===S.SPACE&&$.isCellEditable(_)}},date({formatValue:_}){return{cellEditor:"agDateCellEditor",keyCreator:_}},dateString({formatValue:_}){return{cellEditor:"agDateStringCellEditor",keyCreator:_}},dateTime(_){return this.date(_)},dateTimeString(_){return this.dateString(_)},object({formatValue:_,colModel:f,colId:$}){return{cellEditorParams:{useFormatter:!0},comparator:(z,Q)=>{let J=f.getColDefCol($),q=J?.getColDef();if(!J||!q)return 0;let X=z==null?"":_({column:J,node:null,value:z}),Y=Q==null?"":_({column:J,node:null,value:Q});if(X===Y)return 0;return X>Y?1:-1},keyCreator:_}},text(){return{}}}}wireBeans(_){this.colModel=_.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(_)=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(_)})}processDataTypeDefinitions(){let _=this.getDefaultDataTypes(),f={},$={},z=(G)=>{return(E)=>{let{column:U,node:H,value:W}=E,B=U.getColDef().valueFormatter;if(B===G.groupSafeValueFormatter)B=G.valueFormatter;return this.beans.valueSvc.formatValue(U,H,W,B)}};for(let G of Object.keys(_)){let E=_[G],U={...E,groupSafeValueFormatter:E9(E,this.gos)};f[G]=U,$[G]=z(U)}let Q=this.gos.get("dataTypeDefinitions")??{},J={};for(let G of Object.keys(Q)){let E=Q[G],U=this.processDataTypeDefinition(E,Q,[G],_);if(U){if(f[G]=U,E.dataTypeMatcher)J[G]=E.dataTypeMatcher;$[G]=z(U)}}let{valueParser:q,valueFormatter:X}=_.object,{valueParser:Y,valueFormatter:Z}=f.object;this.hasObjectValueParser=Y!==q,this.hasObjectValueFormatter=Z!==X,this.formatValueFuncs=$,this.dataTypeDefinitions=f,this.dataTypeMatchers=this.sortKeysInMatchers(J,_)}sortKeysInMatchers(_,f){let $={..._};for(let z of CU)delete $[z],$[z]=_[z]??f[z].dataTypeMatcher;return $}processDataTypeDefinition(_,f,$,z){let Q,J=_.extendsDataType;if(_.columnTypes)this.isColumnTypeOverrideInDataTypeDefinitions=!0;if(_.extendsDataType===_.baseDataType){let q=z[J],X=f[J];if(q&&X)q=X;if(!G9(_,q,J))return;Q=Z9(q,_)}else{if($.includes(J)){j(44);return}let q=f[J];if(!G9(_,q,J))return;let X=this.processDataTypeDefinition(q,f,[...$,J],z);if(!X)return;Q=Z9(X,_)}return{...Q,groupSafeValueFormatter:E9(Q,this.gos)}}updateColDefAndGetColumnType(_,f,$){let{cellDataType:z}=f;if(z===void 0)z=_.cellDataType;let{field:Q}=f;if(z==null||z===!0)z=this.canInferCellDataType(_,f)?this.inferCellDataType(Q,$):!1;if(this.addFormulaCellEditorToColDef(_,f),!z){_.cellDataType=!1;return}let J=this.dataTypeDefinitions[z];if(!J){j(47,{cellDataType:z});return}if(_.cellDataType=z,J.groupSafeValueFormatter)_.valueFormatter=J.groupSafeValueFormatter;if(J.valueParser)_.valueParser=J.valueParser;if(!J.suppressDefaultProperties)this.setColDefPropertiesForBaseDataType(_,z,J,$);return J.columnTypes}addFormulaCellEditorToColDef(_,f){if(!(f.allowFormula??_.allowFormula)||f.cellEditor)return;_.cellEditor="agFormulaCellEditor"}addColumnListeners(_){if(!this.isPendingInference)return;let f=this.columnStateUpdatesPendingInference[_.getColId()];if(!f)return;let $=(z)=>{f.add(z.key)};_.__addEventListener("columnStateUpdated",$),this.columnStateUpdateListenerDestroyFuncs.push(()=>_.__removeEventListener("columnStateUpdated",$))}canInferCellDataType(_,f){let{gos:$}=this;if(!o($))return!1;let z={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(H6(f,z))return!1;let Q=f.type===null?_.type:f.type;if(Q){let J=$.get("columnTypes")??{};if(Az(Q).some((X)=>{let Y=J[X.trim()];return Y&&H6(Y,z)}))return!1}return!H6(_,z)}inferCellDataType(_,f){if(!_)return;let $,z=this.getInitialData();if(z){let J=_.includes(".")&&!this.gos.get("suppressFieldDotNotation");$=e1(z,_,J)}else this.initWaitForRowData(f);if($==null)return;return Object.keys(this.dataTypeMatchers).find((J)=>this.dataTypeMatchers[J]($))??"object"}getInitialData(){let _=this.gos.get("rowData");if(_?.length)return _[0];else if(this.initialData)return this.initialData;else{let f=this.beans.rowModel.rootNode?._leafs;if(f?.length)return f[0].data}return null}initWaitForRowData(_){if(this.columnStateUpdatesPendingInference[_]=new Set,this.isPendingInference)return;this.isPendingInference=!0;let f=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:$,eventSvc:z}=this.beans;if(f&&$)$.shouldQueueResizeOperations=!0;let[Q]=this.addManagedEventListeners({rowDataUpdateStarted:(J)=>{let{firstRowData:q}=J;if(!q)return;if(Q?.(),this.isPendingInference=!1,this.processColumnsPendingInference(q,f),this.columnStateUpdatesPendingInference={},f)$?.processResizeOperations();z.dispatchEvent({type:"dataTypesInferred"})}})}processColumnsPendingInference(_,f){this.initialData=_;let $=[];this.destroyColumnStateUpdateListeners();let z={},Q={};for(let J of Object.keys(this.columnStateUpdatesPendingInference)){let q=this.columnStateUpdatesPendingInference[J],X=this.colModel.getCol(J);if(!X)continue;let Y=X.getColDef();if(!this.resetColDefIntoCol(X,"cellDataTypeInferred"))continue;let Z=X.getColDef();if(f&&Z.type&&Z.type!==Y.type){let G=iU(X,q);if(G.rowGroup&&G.rowGroupIndex==null)z[J]=G;if(G.pivot&&G.pivotIndex==null)Q[J]=G;$.push(G)}}if(f)$.push(...this.generateColumnStateForRowGroupAndPivotIndexes(z,Q));if($.length)d_(this.beans,{state:$},"cellDataTypeInferred");this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(_,f){let $={},{rowGroupColsSvc:z,pivotColsSvc:Q}=this.beans;return z?.restoreColumnOrder($,_),Q?.restoreColumnOrder($,f),Object.values($)}resetColDefIntoCol(_,f){let $=_.getUserProvidedColDef();if(!$)return!1;let z=n0(this.beans,$,_.getColId());return _.setColDef(z,$,f),!0}getDateStringTypeDefinition(_){let{dateString:f}=this.dataTypeDefinitions;if(!_)return f;return this.getDataTypeDefinition(_)??f}getDateParserFunction(_){return this.getDateStringTypeDefinition(_).dateParser}getDateFormatterFunction(_){return this.getDateStringTypeDefinition(_).dateFormatter}getDateIncludesTimeFlag(_){return _==="dateTime"||_==="dateTimeString"}getDataTypeDefinition(_){let f=_.getColDef();if(!f.cellDataType)return;return this.dataTypeDefinitions[f.cellDataType]}getBaseDataType(_){return this.getDataTypeDefinition(_)?.baseDataType}checkType(_,f){if(f==null)return!0;let $=this.getDataTypeDefinition(_)?.dataTypeMatcher;if(!$)return!0;if(_.getColDef().allowFormula&&this.beans.formula?.isFormula(f))return!0;return $(f)}validateColDef(_,f,$,z){if(_.cellDataType==="object"){let Q=(Y)=>{return Y?.cellDataType==null||Y?.cellDataType===!0},J=Q(f)&&Q($),q=(Y)=>j(48,{property:Y,inferred:J,colId:z}),{object:X}=this.dataTypeDefinitions;if(_.valueFormatter===X.groupSafeValueFormatter&&!this.hasObjectValueFormatter)q("Formatter");if(_.editable&&_.valueParser===X.valueParser&&!this.hasObjectValueParser)q("Parser")}}postProcess(_){let f=_.cellDataType;if(!f||typeof f!=="string")return;let{dataTypeDefinitions:$,beans:z,formatValueFuncs:Q}=this,J=$[f];if(!J)return;z.colFilter?.setColDefPropsForDataType(_,J,Q[f])}getFormatValue(_){return this.formatValueFuncs[_]}isColPendingInference(_){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[_]}setColDefPropertiesForBaseDataType(_,f,$,z){let Q=this.formatValueFuncs[f],J=this.columnDefinitionPropsPerDataType[$.baseDataType]({colDef:_,cellDataType:f,colModel:this.colModel,dataTypeDefinition:$,colId:z,formatValue:Q,filterModuleBean:this.beans.filterManager});if(_.cellEditor==="agFormulaCellEditor"&&J.cellEditor!==_.cellEditor)J.cellEditor=_.cellEditor;Object.assign(_,J)}getDateObjectTypeDef(_){let f=this.getLocaleTextFunc(),$=this.getDateIncludesTimeFlag(_);return{baseDataType:_,valueParser:(z)=>H$(z.newValue&&String(z.newValue)),valueFormatter:(z)=>{if(z.value==null)return"";if(!(z.value instanceof Date)||isNaN(z.value.getTime()))return f("invalidDate","Invalid Date");return Y9(z.value,$)??""},dataTypeMatcher:(z)=>z instanceof Date}}getDateStringTypeDef(_){let f=this.getDateIncludesTimeFlag(_);return{baseDataType:_,dateParser:($)=>H$($)??void 0,dateFormatter:($)=>Y9($??null,f)??void 0,valueParser:($)=>Hz(String($.newValue))?$.newValue:null,valueFormatter:($)=>Hz(String($.value))?String($.value):"",dataTypeMatcher:($)=>typeof $==="string"&&Hz($)}}getDefaultDataTypes(){let _=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:(f)=>f.newValue?.trim?.()===""?null:Number(f.newValue),valueFormatter:(f)=>{if(f.value==null)return"";if(typeof f.value!=="number"||isNaN(f.value))return _("invalidNumber","Invalid Number");return String(f.value)},dataTypeMatcher:(f)=>typeof f==="number"},bigint:{baseDataType:"bigint",valueParser:(f)=>{let{newValue:$}=f;if($==null)return null;if(typeof $==="string"&&$.trim()==="")return null;return Bf($)},valueFormatter:(f)=>{if(f.value==null)return"";if(typeof f.value!=="bigint")return _("invalidBigInt","Invalid BigInt");return String(f.value)},dataTypeMatcher:(f)=>typeof f==="bigint"},text:{baseDataType:"text",valueParser:(f)=>f.newValue===""?null:$$(f.newValue),dataTypeMatcher:(f)=>typeof f==="string"},boolean:{baseDataType:"boolean",valueParser:(f)=>{if(f.newValue==null)return f.newValue;return f.newValue?.trim?.()===""?null:String(f.newValue).toLowerCase()==="true"},valueFormatter:(f)=>f.value==null?"":String(f.value),dataTypeMatcher:(f)=>typeof f==="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:(f)=>typeof f==="string"&&bU(f)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:(f)=>$$(f.value)??""}}}destroyColumnStateUpdateListeners(){for(let _ of this.columnStateUpdateListenerDestroyFuncs)_();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function Z9(_,f){let $={..._,...f};if(_.columnTypes&&f.columnTypes&&f.appendColumnTypes)$.columnTypes=[...Az(_.columnTypes),...Az(f.columnTypes)];return $}function G9(_,f,$){if(!f)return j(45,{parentCellDataType:$}),!1;if(f.baseDataType!==_.baseDataType)return j(46),!1;return!0}var xU=(_)=>typeof _==="bigint"||typeof _==="number",NU=(_)=>_==="number"||_==="bigint";function E9(_,f){if(!_.valueFormatter)return;return($)=>{let{node:z,colDef:Q,column:J,value:q}=$;if(z?.group){let X=(Q.pivotValueColumn??J).getAggFunc();if(X){if(X==="first"||X==="last")return _.valueFormatter($);let{baseDataType:Y}=_;if(NU(Y)&&X!=="count"){if(xU(q))return _.valueFormatter($);if(q==null)return;if(typeof q==="object"){if(typeof q.toNumber==="function")return _.valueFormatter({...$,value:q.toNumber()});if("value"in q)return _.valueFormatter({...$,value:q.value})}}return}}else if(f.get("groupHideOpenParents")&&$.column.isRowGroupActive()){if(typeof $.value==="string"&&!_.dataTypeMatcher?.($.value))return}return _.valueFormatter($)}}function gU(_,f,$,z){if(!f[$])return!1;let Q=_[$];if(Q===null)return f[$]=!1,!1;else return z===void 0?!!Q:Q===z}function hU(_,f){if(_==null)return f==null?0:-1;if(f==null)return 1;let $=Bf(_),z=Bf(f);if($!=null&&z!=null){if($===z)return 0;return $>z?1:-1}return 0}function uU(_,f){if(_==null)return f==null?0:-1;if(f==null)return 1;let $=U9(_),z=U9(f);if($!=null&&z!=null){if($===z)return 0;return $>z?1:-1}return 0}function U9(_){let f=Bf(_);if(f==null)return null;return f<0n?-f:f}function H6(_,f){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([$,z])=>gU(_,f,$,z))}function iU(_,f){let $=sX(_);for(let z of f)if(delete $[z],z==="rowGroup")delete $.rowGroupIndex;else if(z==="pivot")delete $.pivotIndex;return $}var mU={moduleName:"DataType",version:c,beans:[wU],dependsOn:[PU]},cU={moduleName:"ColumnFlex",version:c,beans:[TU]};var pU=class extends A{constructor(){super(...arguments);this.beanName="colNames"}getDisplayNameForColumn(_,f,$=!1){if(!_)return null;let z=this.getHeaderName(_.getColDef(),_,null,null,f),{aggColNameSvc:Q}=this.beans;if($&&Q)return Q.getHeaderName(_,z);return z}getDisplayNameForProvidedColumnGroup(_,f,$){let z=f?.getColGroupDef();if(z)return this.getHeaderName(z,null,_,f,$);return null}getDisplayNameForColumnGroup(_,f){return this.getDisplayNameForProvidedColumnGroup(_,_.getProvidedColumnGroup(),f)}getHeaderName(_,f,$,z,Q){let J=_.headerValueGetter;if(J){let q=C(this.gos,{colDef:_,column:f,columnGroup:$,providedColumnGroup:z,location:Q});if(typeof J==="function")return J(q);else if(typeof J==="string")return this.beans.expressionSvc?.evaluate(J,q)??null;return""}else if(_.headerName!=null)return _.headerName;else if(_.field)return D4(_.field);return""}},nU=class extends A{constructor(){super(...arguments);this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(_){this.visibleCols=_.visibleCols,this.colModel=_.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(_,f,$=!1){let{visibleCols:z}=this,Q=z.isBodyWidthDirty;if(_===this.scrollWidth&&f===this.scrollPosition&&!Q)return;if(this.scrollWidth=_,this.scrollPosition=f,z.isBodyWidthDirty=!0,this.gos.get("enableRtl")){let q=z.bodyWidth;this.viewportLeft=q-f-_,this.viewportRight=q-f}else this.viewportLeft=f,this.viewportRight=_+f;if(this.colModel.ready)this.checkViewportColumns($)}getColumnHeadersToRender(_){switch(_){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(_,f){let $;switch(_){case"left":$=this.rowsOfHeadersToRenderLeft[f];break;case"right":$=this.rowsOfHeadersToRenderRight[f];break;default:$=this.rowsOfHeadersToRenderCenter[f];break}return $??[]}extractViewportColumns(){let _=this.visibleCols.centerCols;if(this.isColumnVirtualisationSuppressed())this.colsWithinViewport=_,this.headerColsWithinViewport=_;else this.colsWithinViewport=_.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=_.filter(this.isColumnInHeaderViewport.bind(this))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(_){if(_.isAutoHeaderHeight()||dU(_))return!0;return this.isColumnInRowViewport(_)}isColumnInRowViewport(_){if(_.isAutoHeight())return!0;let f=_.getLeft()||0,$=f+_.getActualWidth(),z=this.viewportLeft-200,Q=this.viewportRight+200,J=fQ&&$>Q;return!J&&!q}getViewportColumns(){let{leftCols:_,rightCols:f}=this.visibleCols;return this.colsWithinViewport.concat(_).concat(f)}getColsWithinViewport(_){if(!this.colModel.colSpanActive)return this.colsWithinViewport;let f=(J)=>{let q=J.getLeft();return v(q)&&q>this.viewportLeft},$=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:z}=this,Q=z.centerCols;return z.getColsForRow(_,Q,$,f)}checkViewportColumns(_=!1){if(this.extractViewport())this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:_})}calculateHeaderRows(){let{leftCols:_,rightCols:f}=this.visibleCols;this.columnsToRenderLeft=_,this.columnsToRenderRight=f,this.columnsToRenderCenter=this.colsWithinViewport;let $=(z)=>{let Q=new Set,J={};for(let q of z){let X=q.getParent(),Y=q.isSpanHeaderHeight();while(X){if(Q.has(X))break;if(Y&&X.isPadding()){X=X.getParent();continue}let G=X.getProvidedColumnGroup().getLevel();J[G]??(J[G]=[]),J[G].push(X),Q.add(X),X=X.getParent()}}return J};this.rowsOfHeadersToRenderLeft=$(_),this.rowsOfHeadersToRenderRight=$(f),this.rowsOfHeadersToRenderCenter=$(this.headerColsWithinViewport)}extractViewport(){let _=(z)=>`${z.getId()}-${z.getPinned()||"normal"}`;this.extractViewportColumns();let f=this.getViewportColumns().map(_).join("#"),$=this.colsWithinViewportHash!==f;if($)this.colsWithinViewportHash=f,this.calculateHeaderRows();return $}};function dU(_){while(_){if(_.isAutoHeaderHeight())return!0;_=_.getParent()}return!1}var tU=class extends A{constructor(){super(...arguments);this.beanName="agCompUtils"}adaptFunction(_,f){if(!_.cellRenderer)return null;class ${refresh(){return!1}getGui(){return this.eGui}init(z){let Q=f(z),J=typeof Q;if(J==="string"||J==="number"||J==="boolean"){this.eGui=e6(""+Q+"");return}if(Q==null){this.eGui=z_({tag:"span"});return}this.eGui=Q}}return $}},rU={moduleName:"CellRendererFunction",version:c,beans:[tU]},lU=class extends j_{constructor(){super(...arguments);this.beanName="registry"}registerDynamicBeans(_){if(_){this.dynamicBeans??(this.dynamicBeans={});for(let f of Object.keys(_))this.dynamicBeans[f]=_[f]}}createDynamicBean(_,f,...$){if(!this.dynamicBeans)throw Error(this.getDynamicError(_,!0));let z=this.dynamicBeans[_];if(z==null){if(f)throw Error(this.getDynamicError(_,!1));return}return new z(...$)}};function sU(_){return typeof _==="object"&&!!_.getComp}var aU=class extends lU{constructor(){super(...arguments);this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){let _=this.gos.get("components");if(_!=null)for(let f of Object.keys(_))this.jsComps[f]=_[f]}registerModule(_){let{icons:f,userComponents:$,dynamicBeans:z,selectors:Q}=_;if($){let J=(q,X,Y,Z)=>{if(this.agGridDefaults[q]=X,Y||Z)this.agGridDefaultOverrides[q]={params:Y,processParams:Z}};for(let q of Object.keys($)){let X=$[q];if(sU(X))X=X.getComp(this.beans);if(typeof X==="object"){let{classImp:Y,params:Z,processParams:G}=X;J(q,Y,Z,G)}else J(q,X)}}this.registerDynamicBeans(z);for(let J of Q??[])this.selectors[J.selector]=J;if(f)for(let J of Object.keys(f))this.icons[J]=f[J]}getUserComponent(_,f){let $=(X,Y,Z,G)=>({componentFromFramework:Y,component:X,params:Z,processParams:G}),{frameworkOverrides:z}=this.beans,Q=z.frameworkComponent(f,this.gos.get("components"));if(Q!=null)return $(Q,!0);let J=this.jsComps[f];if(J){let X=z.isFrameworkComponent(J);return $(J,X)}let q=this.agGridDefaults[f];if(q){let X=this.agGridDefaultOverrides[f];return $(q,!1,X?.params,X?.processParams)}return this.beans.validation?.missingUserComponent(_,f,this.agGridDefaults,this.jsComps),null}getSelector(_){return this.selectors[_]}getIcon(_){return this.icons[_]}getDynamicError(_,f){if(f)return $0(279,{name:_});return this.beans.validation?.missingDynamicBean(_)??$0(256)}},oU=23,eU=class extends A{constructor(){super(...arguments);this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(let _ of this.readyCallbacks)_(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){let _=Object.values(this.params);this.ready=_.length===oU&&_.every((f)=>{return f?.isAlive()??!1})}whenReady(_,f){if(this.ready)f(this.params);else this.readyCallbacks.push(f);_.addDestroyFunc(()=>{let $=this.readyCallbacks.indexOf(f);if($>=0)this.readyCallbacks.splice($,1)})}register(_,f){if(this.params[_]=f,this.updateReady(),this.ready)this.dispatchLocalEvent({type:"ready"});f.addDestroyFunc(()=>{this.updateReady()})}get(_){return this.params[_]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){let{leftHeader:_,centerHeader:f,rightHeader:$}=this.params;return[_,$,f]}getHeaderRowContainerCtrl(_){let f=this.params;switch(_){case"left":return f.leftHeader;case"right":return f.rightHeader;default:return f.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},_H=':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',iJ=typeof window!=="object"||!window?.document?.fonts?.forEach,vz=!1,rf=(_,f,$,z,Q,J,q=!1)=>{if(iJ||vz)return;let X=_;if(z)X=`@layer ${CSS.escape(z).replaceAll("\\.",".")} { ${_} }`;let Y=v0.map.get(f);if(!Y)Y=[],v0.map.set(f,Y);if(Y.some((U)=>U.injectedCss===X))return;let Z=document.createElement("style");if(J)Z.setAttribute("nonce",J);Z.dataset.agCss=$,Z.dataset.agCssVersion=c,Z.textContent=X;let G={rawCss:_,injectedCss:X,el:Z,priority:Q,isParams:q},E;for(let U of Y){if(U.priority>Q)break;E=U}if(E){E.el.after(Z);let U=Y.indexOf(E);Y.splice(U+1,0,G)}else{if(f.nodeName==="STYLE")f.after(Z);else f.insertBefore(Z,f.querySelector(":not(title, meta)"));Y.push(G)}},oX=(_,f,$,z)=>{rf(_H,_,"shared",f,0,$),z?.forEach((Q,J)=>Q.forEach((q)=>rf(q,_,J,f,0,$)))},fH=(_,f,$,z,Q,J)=>{if(iJ||vz)return;let q=v0.grids.get(_);if(!q)v0.grids.set(_,{styleContainer:z,paramsCss:f});else q.paramsCss=f;if(x6(z),f&&$)rf(f,z,$,Q,2,J,!0)},$H=(_)=>{let f=v0.grids.get(_)?.styleContainer;if(!f)return;if(v0.grids.delete(_),Array.from(v0.grids.values()).some((z)=>z.styleContainer===f))x6(f);else x6(f,!0),v0.map.delete(f)},x6=(_,f=!1)=>{let $=new Set;for(let Q of v0.grids.values())if(Q.styleContainer===_)$.add(Q.paramsCss);let z=v0.map.get(_)??[];for(let Q=z.length-1;Q>=0;Q--)if(f||z[Q].isParams&&!$.has(z[Q].rawCss))z[Q].el.remove(),z.splice(Q,1)},eX=()=>{let _=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map),f=_.get(c);if(!f)f={map:new WeakMap,grids:new Map,paramsId:0},_.set(c,f);return f},v0=eX(),k0=(_)=>{return new _5(_)},Jf="$default",zH=0,_5=class{constructor({feature:_,params:f,modeParams:$={},css:z,cssImports:Q}){this.feature=_,this.css=z,this.cssImports=Q,this.modeParams={[Jf]:{...$[Jf]??{},...f??{}},...$}}use(_,f,$){let z=this._inject;if(z==null){let{css:Q}=this;if(Q){let J=`ag-theme-${this.feature??"part"}-${++zH}`;if(typeof Q==="function")Q=Q();Q=`:where(.${J}) { -${Q} +(()=>{var{defineProperty:V2,getOwnPropertyNames:S4,getOwnPropertyDescriptor:O4}=Object,P4=Object.prototype.hasOwnProperty;function T4(Q){return this[Q]}var v4=(Q)=>{var z=(_7??=new WeakMap).get(Q),J;if(z)return z;if(z=V2({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var Z of S4(Q))if(!P4.call(z,Z))V2(z,Z,{get:T4.bind(Q,Z),enumerable:!(J=O4(Q,Z))||J.enumerable})}return _7.set(Q,z),z},_7;var I4=(Q)=>Q;function C4(Q,z){this[Q]=I4.bind(null,z)}var b4=(Q,z)=>{for(var J in z)V2(Q,J,{get:z[J],enumerable:!0,configurable:!0,set:C4.bind(z,J)})};var jO={};b4(jO,{themeQuartz:()=>V6,iconSetQuartzLight:()=>g$,createGrid:()=>MJ,ModuleRegistry:()=>N5,Grid:()=>R4});function b(Q){if(!Q?.length)return;return Q[Q.length-1]}function X0(Q,z,J){if(Q===z)return!0;if(!Q||!z)return Q==null&&z==null;let Z=Q.length;if(Z!==z.length)return!1;for(let $=0;$=0)Q.splice(J,1)}function JJ(Q,z){let J=0,Z=0;for(;J=0;Z--)Q.splice(J,0,z[Z])}var RQ=(Q)=>{if(Q==null||Q==="")return null;return Q};function T(Q){return Q!=null&&Q!==""}function n(Q){return!T(Q)}var c1=(Q)=>{return Q!=null&&typeof Q.toString==="function"?Q.toString():null},DZ=(Q,z)=>{let J=Q?JSON.stringify(Q):null,Z=z?JSON.stringify(z):null;return J===Z},y4=(Q,z,J=!1)=>{if(Q==null)return z==null?0:-1;if(z==null)return 1;if(typeof Q==="object"&&Q.toNumber)Q=Q.toNumber();if(typeof z==="object"&&z.toNumber)z=z.toNumber();if(!J||typeof Q!=="string"){if(Q>z)return 1;if(Q{let q=Z?()=>Z.wrapIncoming(G):G;if(z)this.dispatchAsync(q);else q()},X=this.getListeners(J,z,!1);if((X?.size??0)>0){let G=new Set(X);for(let q of G){if(!X?.has(q))continue;$(()=>q(Q))}}let Y=this.getGlobalListeners(z);if(Y.size>0){let G=new Set(Y);for(let q of G)$(()=>q(J,Q))}}getGlobalListeners(Q){return Q?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(Q){if(this.asyncFunctionsQueue.push(Q),!this.scheduled){let z=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},J=this.frameworkOverrides;if(J)J.wrapIncoming(z);else z();this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;let Q=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(let z of Q)z()}},x4=/[&<>"']/g,w4={"&":"&","<":"<",">":">",'"':""","'":"'"};function ZJ(Q){return Q?.toString().toString()??null}function W0(Q){return ZJ(Q)?.replace(x4,(z)=>w4[z])??null}function oJ(Q){return typeof Q==="string"&&Q.startsWith("=")&&Q.length>1}function N4(Q){if(!Q||Q==null)return null;let z=/([a-z])([A-Z])/g,J=/([A-Z]+)([A-Z])([a-z])/g;return Q.replace(z,"$1 $2").replace(J,"$1 $2$3").replace(/\./g," ").split(" ").map(($)=>$.substring(0,1).toUpperCase()+($.length>1?$.substring(1,$.length):"")).join(" ")}function s0(Q){return Q.eRootDiv.getRootNode()}function d(Q){return s0(Q).activeElement}function Y0(Q){let{gos:z,eRootDiv:J}=Q,Z=null,$=z.get("getDocument");if($&&T($))Z=$();else if(J)Z=J.ownerDocument;if(Z&&T(Z))return Z;return document}function hz(Q){let z=d(Q);return z===null||z===Y0(Q).body}function j5(Q){return Y0(Q).defaultView||window}function D1(Q){let z=null,J=null;try{z=Y0(Q).fullscreenElement}catch(Z){}finally{if(!z)z=s0(Q);let Z=z.querySelector("body");if(Z)J=Z;else if(z instanceof ShadowRoot)J=z;else if(z instanceof Document)J=z?.documentElement;else J=z}return J}function g4(Q){return D1(Q)?.clientWidth??(window.innerWidth||-1)}function h4(Q){return D1(Q)?.clientHeight??(window.innerHeight||-1)}function c0(Q,z,J){if(J==null||typeof J==="string"&&J=="")R5(Q,z);else XQ(Q,z,J)}function XQ(Q,z,J){Q.setAttribute(A8(z),J.toString())}function R5(Q,z){Q.removeAttribute(A8(z))}function A8(Q){return`aria-${Q}`}function H0(Q,z){if(z)Q.setAttribute("role",z);else Q.removeAttribute("role")}function u4(Q){let z=Q?.direction;if(z==="asc")return"ascending";else if(z==="desc")return"descending";else if(z==="mixed")return"other";return"none"}function j8(Q){return Number.parseInt(Q.getAttribute("aria-posinset"),10)}function m4(Q){return Q.getAttribute("aria-label")}function E0(Q,z){c0(Q,"label",z)}function p1(Q,z){c0(Q,"labelledby",z)}function MZ(Q,z){c0(Q,"describedby",z)}function R8(Q,z){c0(Q,"live",z)}function c4(Q,z){c0(Q,"atomic",z)}function p4(Q,z){c0(Q,"relevant",z)}function S8(Q,z){c0(Q,"invalid",z)}function O8(Q,z){c0(Q,"level",z)}function P8(Q,z){c0(Q,"disabled",z)}function kZ(Q,z){c0(Q,"hidden",z)}function w0(Q,z){XQ(Q,"expanded",z)}function T8(Q){R5(Q,"expanded")}function VZ(Q,z){XQ(Q,"setsize",z)}function fZ(Q,z){XQ(Q,"posinset",z)}function i4(Q,z){XQ(Q,"multiselectable",z)}function n4(Q,z){XQ(Q,"rowcount",z)}function eJ(Q,z){XQ(Q,"rowindex",z)}function d4(Q,z){XQ(Q,"colcount",z)}function v8(Q,z){XQ(Q,"colindex",z)}function t4(Q,z){XQ(Q,"colspan",z)}function r4(Q,z){XQ(Q,"sort",z)}function s4(Q){R5(Q,"sort")}function S5(Q,z){c0(Q,"selected",z)}function I8(Q,z){XQ(Q,"checked",z===void 0?"mixed":z)}function l4(Q,z){c0(Q,"controls",z)}function C8(Q,z){l4(Q,z.id),p1(z,Q.id)}function W7(Q,z){c0(Q,"owns",z)}function b8(Q,z){c0(Q,"haspopup",z===!1?null:z)}function O5(Q,z){return z===void 0?Q("ariaIndeterminate","indeterminate"):z===!0?Q("ariaChecked","checked"):Q("ariaUnchecked","unchecked")}function P5(Q,z,J){let Z=Q.parentElement,$=Z&&Z.firstChild;while($){if(z)$.classList.toggle(z,$===Q);if(J)$.classList.toggle(J,$!==Q);$=$.nextSibling}}var a4="[tabindex], input, select, button, textarea, [href]",y8="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function w1(Q){if(!Q)return!1;if(!Q.matches("input, select, button, textarea"))return!1;if(!Q.matches(y8))return!1;return f0(Q)}function N(Q,z,J={}){let{skipAriaHidden:Z}=J;if(Q.classList.toggle("ag-hidden",!z),!Z)kZ(Q,!z)}function o4(Q,z,J={}){let{skipAriaHidden:Z}=J;if(Q.classList.toggle("ag-invisible",!z),!Z)kZ(Q,!z)}function T5(Q,z){let Z=z?(X)=>X.setAttribute("disabled",""):(X)=>X.removeAttribute("disabled");Z(Q);let $=Q.querySelectorAll("input")??[];for(let X of $)Z(X)}function vz(Q,z,J){let Z=0;while(Q){if(Q.classList.contains(z))return!0;if(Q=Q.parentElement,typeof J=="number"){if(++Z>J)break}else if(Q===J)break}return!1}function M1(Q){let{height:z,width:J,borderTopWidth:Z,borderRightWidth:$,borderBottomWidth:X,borderLeftWidth:Y,paddingTop:G,paddingRight:q,paddingBottom:H,paddingLeft:_,marginTop:U,marginRight:W,marginBottom:B,marginLeft:E,boxSizing:K}=window.getComputedStyle(Q),L=Number.parseFloat;return{height:L(z||"0"),width:L(J||"0"),borderTopWidth:L(Z||"0"),borderRightWidth:L($||"0"),borderBottomWidth:L(X||"0"),borderLeftWidth:L(Y||"0"),paddingTop:L(G||"0"),paddingRight:L(q||"0"),paddingBottom:L(H||"0"),paddingLeft:L(_||"0"),marginTop:L(U||"0"),marginRight:L(W||"0"),marginBottom:L(B||"0"),marginLeft:L(E||"0"),boxSizing:K}}function AZ(Q){let z=M1(Q);if(z.boxSizing==="border-box")return z.height-z.paddingTop-z.paddingBottom-z.borderTopWidth-z.borderBottomWidth;return z.height}function xz(Q){let z=M1(Q);if(z.boxSizing==="border-box")return z.width-z.paddingLeft-z.paddingRight-z.borderLeftWidth-z.borderRightWidth;return z.width}function x8(Q){let{height:z,marginBottom:J,marginTop:Z}=M1(Q);return Math.floor(z+J+Z)}function w8(Q){let{width:z,marginLeft:J,marginRight:Z}=M1(Q);return Math.floor(z+J+Z)}function N8(Q){let z=Q.getBoundingClientRect(),{borderTopWidth:J,borderLeftWidth:Z,borderRightWidth:$,borderBottomWidth:X}=M1(Q);return{top:z.top+(J||0),left:z.left+(Z||0),right:z.right+($||0),bottom:z.bottom+(X||0)}}function QZ(Q,z){let J=Q.scrollLeft;if(z)J=Math.abs(J);return J}function zZ(Q,z,J){if(J)z*=-1;Q.scrollLeft=z}function z0(Q){while(Q?.firstChild)Q.firstChild.remove()}function T0(Q){if(Q?.parentNode)Q.remove()}function g8(Q){return!!Q.offsetParent}function f0(Q){if(Q.checkVisibility)return Q.checkVisibility({checkVisibilityCSS:!0});return!(!g8(Q)||window.getComputedStyle(Q).visibility!=="visible")}function v5(Q){let z=document.createElement("div");return z.innerHTML=(Q||"").trim(),z.firstChild}function h8(Q,z,J){if(J&&J.nextSibling===z)return;if(!Q.firstChild)Q.appendChild(z);else if(J)if(J.nextSibling)Q.insertBefore(z,J.nextSibling);else Q.appendChild(z);else if(Q.firstChild&&Q.firstChild!==z)Q.prepend(z)}function u8(Q,z){for(let J=0;J`-${z.toLocaleLowerCase()}`)}function $J(Q,z){if(!z)return;for(let J of Object.keys(z)){let Z=z[J];if(!J?.length||Z==null)continue;let $=e4(J),X=Z.toString(),Y=X.replace(/\s*!important/g,""),G=Y.length!=X.length?"important":void 0;Q.style.setProperty($,Y,G)}}function i1(Q){return()=>{let z=Q();if(!z)return!0;return QG(z)||zG(z)}}function QG(Q){return Q.clientWidthX?.disconnect()}function YQ(Q,z){let J=j5(Q);if(J.requestAnimationFrame)J.requestAnimationFrame(z);else if(J.webkitRequestAnimationFrame)J.webkitRequestAnimationFrame(z);else J.setTimeout(z,0)}var p8="data-ref",f2;function B7(){return f2??(f2=document.createTextNode(" ")),f2.cloneNode()}function K0(Q){let{attrs:z,children:J,cls:Z,ref:$,role:X,tag:Y}=Q,G=document.createElement(Y);if(Z)G.className=Z;if($)G.setAttribute(p8,$);if(X)G.setAttribute("role",X);if(z)for(let q of Object.keys(z))G.setAttribute(q,z[q]);if(J)if(typeof J==="string")G.textContent=J;else{let q=!0;for(let H of J)if(H)if(typeof H==="string")G.appendChild(document.createTextNode(H)),q=!1;else if(typeof H==="function")G.appendChild(H());else{if(q)G.appendChild(B7()),q=!1;G.append(K0(H)),G.appendChild(B7())}}return G}var ZG=["touchstart","touchend","touchmove","touchcancel","scroll"],$G=["wheel"],A2={},a2=(()=>{let Q={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return(J)=>{if(typeof A2[J]==="boolean")return A2[J];let Z=document.createElement(Q[J]||"div");return J="on"+J,A2[J]=J in Z}})();function jZ(Q,z){if(!z||!Q)return!1;return YG(z).indexOf(Q)>=0}function XG(Q){let z=[],J=Q.target;while(J)z.push(J),J=J.parentElement;return z}function YG(Q){let z=Q;if(z.path)return z.path;if(z.composedPath)return z.composedPath();return XG(z)}function GG(Q,z,J){let Z=qG(z),$;if(Z!=null)$={passive:Z};Q.addEventListener(z,J,$)}var qG=(Q)=>{let z=ZG.includes(Q),J=$G.includes(Q);if(z)return!0;if(J)return!1};function i8(Q,z,J){if(J===0)return!1;let Z=Math.abs(Q.clientX-z.clientX),$=Math.abs(Q.clientY-z.clientY);return Math.max(Z,$)<=J}var G1=(Q,z)=>{let J=Q.identifier;for(let Z=0,$=z.length;Z<$;++Z){let X=z[Z];if(X.identifier===J)return X}return null};function n1(Q,z){return Q.gos.isElementInThisInstance(z.target)}function HG(Q,z,J){let $=Q.getBoundingClientRect().height,X=g4(J)-2,Y=h4(J)-2;if(!Q.offsetParent)return;let q=N8(Q.offsetParent),{clientY:H,clientX:_}=z,U=H-q.top-$/2,W=_-q.left-10,B=Y0(J),E=B.defaultView||window,K=E.pageYOffset||B.documentElement.scrollTop,L=E.pageXOffset||B.documentElement.scrollLeft;if(X>0&&W+Q.clientWidth>X+L)W=X+L-Q.clientWidth;if(W<0)W=0;if(Y>0&&U+Q.clientHeight>Y+K)U=Y+K-Q.clientHeight;if(U<0)U=0;Q.style.left=`${W}px`,Q.style.top=`${U}px`}var pJ=(Q,...z)=>{for(let J of z){let[Z,$,X,Y]=J;Z.addEventListener($,X,Y),Q.push(J)}},I5=(Q)=>{if(Q){for(let[z,J,Z,$]of Q)z.removeEventListener(J,Z,$);Q.length=0}},J1=(Q)=>{if(Q.cancelable)Q.preventDefault()};function _G(Q,z){return z}function n8(Q){return Q?.getLocaleTextFunc()??_G}function UG(Q,z,J,Z){let $=z[J];return Q.getLocaleTextFunc()(J,typeof $==="function"?$(Z):$,Z)}var j0=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(Q){this.beans=Q,this.stubContext=Q.context,this.eventSvc=Q.eventSvc,this.gos=Q.gos}destroy(){let{destroyFunctions:Q}=this;for(let z=0;znull;let Z;if(WG(Q))Q.__addEventListener(z,J),Z=()=>{return Q.__removeEventListener(z,J),null};else{let $=BG(Q);if(Q instanceof HTMLElement)GG(Q,z,J);else if($)Q.addListener(z,J);else Q.addEventListener(z,J);Z=$?()=>{return Q.removeListener(z,J),null}:()=>{return Q.removeEventListener(z,J),null}}return this.destroyFunctions.push(Z),()=>{return Z(),this.destroyFunctions=this.destroyFunctions.filter(($)=>$!==Z),null}}setupPropertyListener(Q,z){let{gos:J}=this;J.addPropertyEventListener(Q,z);let Z=()=>{return J.removePropertyEventListener(Q,z),null};return this.destroyFunctions.push(Z),()=>{return Z(),this.destroyFunctions=this.destroyFunctions.filter(($)=>$!==Z),null}}addManagedPropertyListener(Q,z){if(this.destroyed)return()=>null;return this.setupPropertyListener(Q,z)}addManagedPropertyListeners(Q,z){if(this.destroyed)return;let J=Q.join("-")+this.propertyListenerId++,Z=($)=>{if($.changeSet){if($.changeSet&&$.changeSet.id===this.lastChangeSetIdLookup[J])return;this.lastChangeSetIdLookup[J]=$.changeSet.id}let X={type:"propertyChanged",changeSet:$.changeSet,source:$.source};z(X)};for(let $ of Q)this.setupPropertyListener($,Z)}getLocaleTextFunc(){return n8(this.beans.localeSvc)}addDestroyFunc(Q){if(this.isAlive())this.destroyFunctions.push(Q);else Q()}createOptionalManagedBean(Q,z){return Q?this.createManagedBean(Q,z):void 0}createManagedBean(Q,z){let J=this.createBean(Q,z);return this.addDestroyFunc(this.destroyBean.bind(this,Q,z)),J}createBean(Q,z,J){return(z||this.stubContext).createBean(Q,J)}destroyBean(Q,z){return(z||this.stubContext).destroyBean(Q)}destroyBeans(Q,z){return(z||this.stubContext).destroyBeans(Q)}};function WG(Q){return Q.__addEventListener!==void 0}function BG(Q){return Q.eventServiceType==="global"}var j=class extends j0{},o2=new Set,RZ=(Q,z)=>{if(!o2.has(z))o2.add(z),Q()};RZ._set=o2;var EG={pending:!1,funcs:[]},KG={pending:!1,funcs:[]};function e2(Q,z="setTimeout",J){let Z=z==="raf"?KG:EG;if(Z.funcs.push(Q),Z.pending)return;Z.pending=!0;let $=()=>{let X=Z.funcs.slice();Z.funcs.length=0,Z.pending=!1;for(let Y of X)Y()};if(z==="raf")YQ(J,$);else window.setTimeout($,0)}function gQ(Q,z,J){let Z;return function(...$){let X=this;return window.clearTimeout(Z),Z=window.setTimeout(function(){if(Q.isAlive())z.apply(X,$)},J),Z}}function E7(Q,z){let J=0;return function(...Z){let $=this,X=Date.now();if(X-J{if(X!=null)window.clearInterval(X),X=null};Q.addDestroyFunc(G);let q=()=>{let H=Date.now()-$>Z;if(z()||H)J(),Y=!0,G()};if(q(),!Y)X=window.setInterval(q,10)}var LG=new Set(["__proto__","constructor","prototype"]);function FG(Q,z){if(Q==null)return;if(Array.isArray(Q)){for(let J=0;J!LG.has(Z)))z(J,Q[J])}function B0(Q,z,J=!0,Z=!1){if(!T(z))return;FG(z,($,X)=>{let Y=Q[$];if(Y===X)return;if(Z){if(Y==null&&X!=null){if(typeof X==="object"&&X.constructor===Object)Y={},Q[$]=Y}}if(K7(X)&&K7(Y)&&!Array.isArray(Y))B0(Y,X,J,Z);else if(J||X!==void 0)Q[$]=X})}function K7(Q){return typeof Q==="object"&&Q!==null}var b5=class Q{static applyGlobalGridOptions(z){if(!Q.gridOptions)return{...z};let J={};if(B0(J,Q.gridOptions,!0,!0),Q.mergeStrategy==="deep")B0(J,z,!0,!0);else J={...J,...z};if(Q.gridOptions.context)J.context=Q.gridOptions.context;if(z.context){if(Q.mergeStrategy==="deep"&&J.context)B0(z.context,J.context,!0,!0);J.context=z.context}return J}static applyGlobalGridOption(z,J){if(Q.mergeStrategy==="deep"){let Z=DG(z);if(Z&&typeof Z==="object"&&typeof J==="object")return Q.applyGlobalGridOptions({[z]:J})[z]}return J}};b5.gridOptions=void 0;b5.mergeStrategy="shallow";var y5=b5;function DG(Q){return y5.gridOptions?.[Q]}var MG={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2000,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1000,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},d8="https://www.ag-grid.com";function d1(Q,z,...J){if(Q.get("debug"))console.log("AG Grid: "+z,...J)}function zz(Q,...z){RZ(()=>t8(Q,...z),Q+z?.join(""))}function q1(Q,...z){RZ(()=>kG(Q,...z),Q+z?.join(""))}function kG(Q,...z){console.error("AG Grid: "+Q,...z)}function t8(Q,...z){console.warn("AG Grid: "+Q,...z)}var r8=new Set,JZ={},Iz={},iJ,s8=!1,l8=!1,VG=!1;function fG(Q){let[z,J]=Q.version.split(".")||[],[Z,$]=iJ.split(".")||[];return z===Z&&J===$}function AG(Q){if(!iJ)iJ=Q.version;let z=(Z)=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${Z} Please update all modules to the same version.`;if(!Q.version)q1(z(`'${Q.moduleName}' is incompatible.`));else if(!fG(Q))q1(z(`'${Q.moduleName}' is version ${Q.version} but the other modules are version ${iJ}.`));let J=Q.validate?.();if(J&&!J.isValid)q1(`${J.message}`)}function t1(Q,z,J=!1){if(!J)s8=!0;AG(Q);let Z=Q.rowModels??["all"];r8.add(Q);let $;if(z!==void 0){if(l8=!0,Iz[z]===void 0)Iz[z]={};$=Iz[z]}else $=JZ;for(let X of Z){if($[X]===void 0)$[X]={};$[X][Q.moduleName]=Q}if(Q.dependsOn)for(let X of Q.dependsOn)t1(X,z,J)}function jG(Q){delete Iz[Q]}function Q5(Q,z,J){let Z=($)=>!!JZ[$]?.[Q]||!!Iz[z]?.[$]?.[Q];return Z(J)||Z("all")}function x5(){return l8}function RG(Q,z){let J=Iz[Q]??{};return[...Object.values(JZ.all??{}),...Object.values(J.all??{}),...Object.values(JZ[z]??{}),...Object.values(J[z]??{})]}function SG(){return new Set(r8)}function a8(Q,z){let J=Iz[Q]??{};return[...Object.values(J.all??{}),...Object.values(J[z]??{})]}function OG(){return s8}function w5(){return VG}var N5=class{static register(Q){t1(Q,void 0)}static registerModules(Q){for(let z of Q)t1(z,void 0)}};var p="35.2.1",L7=2000,F7=100,o8="_version_",e8=null,H1=`${d8}/javascript-data-grid`;function PG(Q){e8=Q}function TG(Q){H1=Q}function Q9(Q,z,J){return e8?.(Q,z)??[bG(Q,z,J)]}function SZ(Q,z,J,Z,$){Q(`${Z?"warning":"error"} #${z}`,...Q9(z,J,$))}function vG(Q){if(!Q)return String(Q);let z={};for(let J of Object.keys(Q))if(typeof Q[J]!=="object"&&typeof Q[J]!=="function")z[J]=Q[J];return JSON.stringify(z)}function IG(Q){let z=Q;if(Q instanceof Error)z=Q.toString();else if(typeof Q==="object")z=vG(Q);return z}function nJ(Q){return Q===void 0?"undefined":Q===null?"null":Q}function z5(Q,z){return`${Q}?${z.toString()}`}function CG(Q,z,J){let Z=Array.from(z.entries()).sort((X,Y)=>Y[1].length-X[1].length),$=z5(Q,z);for(let[X,Y]of Z){if(X===o8)continue;let G=$.length-J;if(G<=0)break;let q="...",H=G+q.length,_=Y.length-H>F7?Y.slice(0,Y.length-H)+q:Y.slice(0,F7)+q;z.set(X,_),$=z5(Q,z)}return $}function z9(Q,z){let J=new URLSearchParams;if(J.append(o8,p),z)for(let X of Object.keys(z))J.append(X,IG(z[X]));let Z=`${H1}/errors/${Q}`,$=z5(Z,J);return $.length<=L7?$:CG(Z,J,L7)}var bG=(Q,z,J)=>{let Z=z9(Q,z),$=`${J?J+` +`:""}Visit ${Z}`;if(w5())return $;return`${$}${J?"":` + Alternatively register the ValidationModule to see the full message in the console.`}`};function R(...Q){SZ(zz,Q[0],Q[1],!0)}function e(...Q){SZ(q1,Q[0],Q[1],!1)}function y1(Q,z,J){SZ(q1,Q,z,!1,J)}function J9(Q,z,J){SZ(zz,Q,z,!0,J)}function yG(Q,z){let J=z[0];return`error #${J} `+Q9(J,z[1],Q).join(" ")}function QQ(...Q){return yG(void 0,Q)}function Z9(Q,z){return Q.get("rowModelType")===z}function o(Q,z){return Z9(Q,"clientSide")}function Hz(Q,z){return Z9(Q,"serverSide")}function V0(Q,z){return Q.get("domLayout")===z}function hQ(Q){return ZZ(Q)!==void 0}function $9(Q){return typeof Q.get("getRowHeight")==="function"}function xG(Q,z){if(z)return!Q.get("enableStrictPivotColumnOrder");return Q.get("maintainColumnOrder")}function wG({gos:Q,formula:z}){let J=Q.get("rowNumbers");return J||!!z?.active&&J!==!1}function r1(Q,z,J=!1,Z){let{gos:$,environment:X}=Q;if(Z==null)Z=X.getDefaultRowHeight();if($9($)){if(J)return{height:Z,estimated:!0};let q={node:z,data:z.data},H=$.getCallback("getRowHeight")(q);if(J5(H)){if(H===0)R(23);return{height:Math.max(1,H),estimated:!1}}}if(z.detail&&$.get("masterDetail"))return NG($);let Y=$.get("rowHeight");return{height:Y&&J5(Y)?Y:Z,estimated:!1}}function NG(Q){if(Q.get("detailRowAutoHeight"))return{height:1,estimated:!1};let z=Q.get("detailRowHeight");if(J5(z))return{height:z,estimated:!1};return{height:300,estimated:!1}}function X9(Q){let{environment:z,gos:J}=Q,Z=J.get("rowHeight");if(!Z||n(Z))return z.getDefaultRowHeight();let $=z.refreshRowHeightVariable();if($!==-1)return $;return R(24),z.getDefaultRowHeight()}function J5(Q){return!isNaN(Q)&&typeof Q==="number"&&isFinite(Q)}function Y9(Q,z,J){let Z=z[Q.getDomDataKey()];return Z?Z[J]:void 0}function wz(Q,z,J,Z){let $=Q.getDomDataKey(),X=z[$];if(n(X))X={},z[$]=X;X[J]=Z}function _1(Q){if(Q.get("ensureDomOrder"))return!1;return Q.get("animateRows")}function k1(Q){return!(Q.get("paginateChildRows")||Q.get("groupHideOpenParents")||V0(Q,"print"))}function WQ(Q){return!Q.get("autoGroupColumnDef")?.comparator&&!Q.get("treeData")}function TQ(Q){let z=Q.get("groupAggFiltering");if(typeof z==="function")return Q.getCallback("groupAggFiltering");if(z===!0)return()=>!0;return}function _z(Q){return Q.get("grandTotalRow")}function OZ(Q){let z=Q.get("groupTotalRow");if(typeof z==="function")return Q.getCallback("groupTotalRow");return()=>z??void 0}function YJ(Q){if(!!Q.get("groupHideOpenParents"))return!0;return Q.get("groupDisplayType")==="multipleColumns"}function g5(Q){return YJ(Q)&&Q.get("groupHideColumnsUntilExpanded")&&o(Q)}function PZ(Q,z){if(z)return!1;return Q.get("groupDisplayType")==="groupRows"}function G9(Q,z,J){return!!z.group&&!z.footer&&PZ(Q,J)}function Z5(Q){let z=Q.getCallback("getRowId");if(z===void 0)return z;return(J)=>{let Z=z(J);if(typeof Z!=="string")RZ(()=>R(25,{id:Z}),"getRowIdString"),Z=String(Z);return Z}}function gG(Q,z){let J=Q.get("groupHideParentOfSingleChild");if(J===!0)return!0;if(J==="leafGroupsOnly"&&z.leafGroup)return!0;if(Q.get("groupRemoveSingleChildren"))return!0;if(Q.get("groupRemoveLowestSingleChildren")&&z.leafGroup)return!0;return!1}function TZ(Q,z){let J=Q.get("suppressGroupChangesColumnVisibility");if(J===!0)return!1;if(z&&J==="suppressHideOnGroup")return!1;if(!z&&J==="suppressShowOnUngroup")return!1;let Z=Q.get("suppressRowGroupHidesColumns");if(z&&Z===!0)return!1;let $=Q.get("suppressMakeColumnVisibleAfterUnGroup");if(!z&&$===!0)return!1;return!0}function Jz(Q){return Q?.checkboxes??!0}function dJ(Q){return Q?.mode==="multiRow"&&(Q.headerCheckbox??!0)}function E1(Q){if(typeof Q!=="object")return;return Q.checkboxLocation??"selectionColumn"}function j2(Q){return Q?.hideDisabledCheckboxes??!1}function hG(Q){return typeof Q.get("rowSelection")!=="string"}function q9(Q){return Q.get("cellSelection")!==void 0}function H9(Q){let z=Q.get("cellSelection");if(z===void 0)return Q.get("suppressMultiRangeSelection");return typeof z!=="boolean"?z?.suppressMultiRanges??!1:!1}function u0(Q){let z=Q.get("cellSelection");return z!==void 0?!!z:Q.get("enableRangeSelection")}function vZ(Q){let z=Q.get("cellSelection");if(z===void 0)return{mode:"fill",setFillValue:Q.get("fillOperation"),direction:Q.get("fillHandleDirection"),suppressClearOnFillReduction:Q.get("suppressClearOnFillReduction")};return typeof z!=="boolean"&&z.handle?.mode==="fill"?z.handle:void 0}function Zz(Q){let z=Q.get("cellSelection")??!1;return(typeof z==="object"&&z.enableColumnSelection)??!1}function _9(Q){let z=Q.get("rowSelection")??"single";if(typeof z==="string"){let J=Q.get("suppressRowClickSelection"),Z=Q.get("suppressRowDeselection");if(J&&Z)return!1;else if(J)return"enableDeselection";else if(Z)return"enableSelection";else return!0}return z.mode==="singleRow"||z.mode==="multiRow"?z.enableClickSelection??!1:!1}function uG(Q){let z=_9(Q);return z===!0||z==="enableSelection"}function mG(Q){let z=_9(Q);return z===!0||z==="enableDeselection"}function $5(Q){let z=Q.get("rowSelection");if(typeof z==="string")return Q.get("isRowSelectable");return z?.isRowSelectable}function ZZ(Q){let z="beanName"in Q&&Q.beanName==="gos"?Q.get("rowSelection"):Q.rowSelection;if(typeof z==="string")switch(z){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(z?.mode){case"multiRow":case"singleRow":return z.mode;default:return}}function s1(Q){return ZZ(Q)==="multiRow"}function cG(Q){let z=Q.get("rowSelection");if(typeof z==="string")return Q.get("rowMultiSelectWithClick");return z?.enableSelectionWithoutKeys??!1}function $Z(Q){let z=Q.get("rowSelection");if(typeof z==="string"){let J=Q.get("groupSelectsChildren"),Z=Q.get("groupSelectsFiltered");if(J&&Z)return"filteredDescendants";else if(J)return"descendants";else return"self"}return z?.mode==="multiRow"?z.groupSelects:void 0}function U9(Q,z=!0){let J=Q.get("rowSelection");if(typeof J!=="object")return z?"all":void 0;return J.mode==="multiRow"?J.selectAll:"all"}function pG(Q){let z=Q.get("rowSelection");if(typeof z==="string")return!1;return z?.mode==="multiRow"?z.ctrlASelectsRows??!1:!1}function l1(Q){let z=$Z(Q);return z==="descendants"||z==="filteredDescendants"}function D7(Q){let z=Q.get("rowSelection");return typeof z==="object"&&z.masterSelects||"self"}function iG(Q){return Q.isModuleRegistered("SetFilter")&&!Q.get("suppressSetFilterByDefault")}function U0(Q){return Q.get("columnMenu")==="legacy"}function h5(Q){return!U0(Q)}function nG(Q){if(!Q||Q.length<2)return Q;return"on"+Q[0].toUpperCase()+Q.substring(1)}function y(Q,z){return Q.addCommon(z)}function u5({gos:Q},z){return z.button===2||z.ctrlKey&&Q.get("allowContextMenuWithControlKey")}var dG={resizable:!0,sortable:!0},tG=0;function W9(){return tG++}function JQ(Q){return Q instanceof GQ}var rG=["asc","desc",null],sG=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],GQ=class extends j{constructor(Q,z,J,Z){super();this.colDef=Q,this.userProvidedColDef=z,this.colId=J,this.primary=Z,this.isColumn=!0,this.instanceId=W9(),this.autoHeaderHeight=null,this.sortDef=a0(),this._wasSortExplicitlyRemoved=!1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new KQ,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=W0(J)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){let{colDef:Q,beans:{sortSvc:z,pinnedCols:J,colFlex:Z}}=this;z?.initCol(this);let $=Q.hide;if($!==void 0)this.visible=!$;else this.visible=!Q.initialHide;J?.initCol(this),Z?.initCol(this)}setColDef(Q,z,J){let Z=Q.spanRows!==this.colDef.spanRows;if(this.colDef=Q,this.userProvidedColDef=z,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),Z)this.beans.rowSpanSvc?.deregister(this),this.initRowSpan();this.dispatchColEvent("colDefChanged",J)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){let{gos:Q,colDef:{field:z,tooltipField:J}}=this,Z=Q.get("suppressFieldDotNotation");this.fieldContainsDots=T(z)&&z.includes(".")&&!Z,this.tooltipFieldContainsDots=T(J)&&J.includes(".")&&!Z}initMinAndMaxWidths(){let Q=this.colDef;this.minWidth=Q.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=Q.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){if(this.colDef.spanRows)this.beans.rowSpanSvc?.register(this)}addPivotListener(){let Q=this.beans.pivotColDefSvc,z=this.colDef.pivotValueColumn;if(!Q||!z)return;this.addManagedListeners(z,{colDefChanged:(J)=>{let Z=Q.recreateColDef(this.colDef);this.setColDef(Z,Z,J.source)}})}resetActualWidth(Q){let z=this.calculateColInitialWidth(this.colDef);this.setActualWidth(z,Q,!0)}calculateColInitialWidth(Q){let z=Q.width??Q.initialWidth??200;return Math.max(Math.min(z,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(Q){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,Q)??!1}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(Q,z){this.colEventSvc.addEventListener(Q,z)}__removeEventListener(Q,z){this.colEventSvc.removeEventListener(Q,z)}addEventListener(Q,z){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);let J=this.frameworkEventListenerService?.wrap(Q,z)??z;this.colEventSvc.addEventListener(Q,J)}removeEventListener(Q,z){let J=this.frameworkEventListenerService?.unwrap(Q,z)??z;this.colEventSvc.removeEventListener(Q,J)}createColumnFunctionCallbackParams(Q){return y(this.gos,{node:Q,data:Q.data,column:this,colDef:this.colDef})}isSuppressNavigable(Q){return this.beans.cellNavigation?.isSuppressNavigable(this,Q)??!1}isCellEditable(Q){return this.beans.editSvc?.isCellEditable({rowNode:Q,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(Q){return this.isColumnFunc(Q,this.colDef.rowDrag)}isDndSource(Q){return this.isColumnFunc(Q,this.colDef.dndSource)}isCellCheckboxSelection(Q){return this.beans.selectionSvc?.isCellCheckboxSelection(this,Q)??!1}isSuppressPaste(Q){return this.isColumnFunc(Q,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(Q){return this.colDef[Q]??dG[Q]}isColumnFunc(Q,z){if(typeof z==="boolean")return z;if(typeof z==="function"){let J=this.createColumnFunctionCallbackParams(Q);return z(J)}return!1}createColumnEvent(Q,z){return y(this.gos,{type:Q,column:this,columns:[this],source:z})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){if(!this.sortDef.direction)return null;return this.sortDef}getColDefAllowedSortTypes(){let Q=[],{sort:z,initialSort:J}=this.colDef,Z=z===null?z:LQ(z?.type),$=J===null?J:LQ(J?.type);if(Z)Q.push(Z);if($)Q.push($);return Q}getSortingOrder(){let Q=this.getColDefAllowedSortTypes().includes("absolute")?sG:rG;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??Q).map((z)=>a0(z))}getAvailableSortTypes(){let Q=this.getSortingOrder().reduce((z,J)=>{if(J.direction)z.push(J.type);return z},this.getColDefAllowedSortTypes());return new Set(Q)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(Q,z=!1){if(!z)this._wasSortExplicitlyRemoved=!Q.direction;this.sortDef=Q}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return n(this.getSort())}isSorting(){return T(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(Q,z){if(this.oldLeft=this.left,this.left!==Q)this.left=Q,this.dispatchColEvent("leftChanged",z)}isFilterActive(){return this.filterActive}isHovered(){return R(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(Q,z){if(this.firstRightPinned!==Q)this.firstRightPinned=Q,this.dispatchColEvent("firstRightPinnedChanged",z)}setLastLeftPinned(Q,z){if(this.lastLeftPinned!==Q)this.lastLeftPinned=Q,this.dispatchColEvent("lastLeftPinnedChanged",z)}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(Q,z){let J=Q===!0;if(this.visible!==J)this.visible=J,this.dispatchColEvent("visibleChanged",z);this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let Q=this.getOriginalParent();while(Q?.isPadding())Q=Q.getOriginalParent();return Q}getColumnGroupPaddingInfo(){let Q=this.getParent();if(!Q?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};let z=Q.getPaddingLevel()+1,J=!0;while(Q){if(!Q.isPadding()){J=!1;break}Q=Q.getParent()}return{numberOfParents:z,isSpanningTotal:J}}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(Q){let z=Q!==this.autoHeaderHeight;return this.autoHeaderHeight=Q,z}createBaseColDefParams(Q){return y(this.gos,{node:Q,data:Q.data,colDef:this.colDef,column:this})}getColSpan(Q){if(n(this.colDef.colSpan))return 1;let z=this.createBaseColDefParams(Q),J=this.colDef.colSpan(z);return Math.max(J,1)}getRowSpan(Q){if(n(this.colDef.rowSpan))return 1;let z=this.createBaseColDefParams(Q),J=this.colDef.rowSpan(z);return Math.max(J,1)}setActualWidth(Q,z,J=!1){if(Q=Math.max(Q,this.minWidth),Q=Math.min(Q,this.maxWidth),this.actualWidth!==Q){if(this.actualWidth=Q,this.flex!=null&&z!=="flex"&&z!=="gridInitializing")this.flex=null;if(!J)this.fireColumnWidthChangedEvent(z)}this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(Q){this.dispatchColEvent("widthChanged",Q)}isGreaterThanMax(Q){return Q>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.colDef.allowFormula===!0}dispatchColEvent(Q,z,J){let Z=this.createColumnEvent(Q,z);if(J)B0(Z,J);this.colEventSvc.dispatchEvent(Z)}dispatchStateUpdatedEvent(Q){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:Q})}};function a0(Q){if(U1(Q))return{direction:Q.direction,type:Q.type};return{direction:IZ(Q),type:LQ(Q)}}function $z(Q){return Q==="asc"||Q==="desc"||Q===null}function m5(Q){return Q==="default"||Q==="absolute"}function U1(Q){if(!Q||typeof Q!=="object")return!1;let z=Q;return m5(z.type)&&$z(z.direction)}function tJ(Q,z){if(!Q)return z?z.direction===null:!0;if(!z)return Q?Q.direction===null:!0;return Q.type===z.type&&Q.direction===z.direction}function IZ(Q){return $z(Q)?Q:null}function LQ(Q){return m5(Q)?Q:"default"}function c5(Q,z,J){let $=J?.()??z.sortSvc.getDisplaySortForColumn(Q),X=LQ($?.type),Y=IZ($?.direction),G=Q.getAvailableSortTypes(),q=G.has("default"),H=G.has("absolute");return{isDefaultSortAllowed:q,isAbsoluteSortAllowed:H,isAbsoluteSort:X==="absolute",isDefaultSort:X==="default",isAscending:Y==="asc",isDescending:Y==="desc",direction:Y}}function G0(Q){return Q instanceof Cz}var Cz=class extends j{constructor(Q,z,J,Z){super();this.colGroupDef=Q,this.groupId=z,this.padding=J,this.level=Z,this.isColumn=!1,this.expandable=!1,this.instanceId=W9(),this.expandableListenerRemoveCallback=null,this.expanded=!!Q?.openByDefault}destroy(){if(this.expandableListenerRemoveCallback)this.reset(null,void 0);super.destroy()}reset(Q,z){if(this.colGroupDef=Q,this.level=z,this.originalParent=null,this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){if(this.children)return this.children.some((Q)=>Q.isVisible());return!1}isPadding(){return this.padding}setExpanded(Q){this.expanded=Q===void 0?!1:Q,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(Q){this.children=Q}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){let Q=[];return this.addLeafColumns(Q),Q}forEachLeafColumn(Q){if(!this.children)return;for(let z of this.children)if(JQ(z))Q(z);else if(G0(z))z.forEachLeafColumn(Q)}addLeafColumns(Q){if(!this.children)return;for(let z of this.children)if(JQ(z))Q.push(z);else if(G0(z))z.addLeafColumns(Q)}getColumnGroupShow(){let Q=this.colGroupDef;if(!Q)return;return Q.columnGroupShow}setupExpandable(){if(this.setExpandable(),this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();let Q=this.onColumnVisibilityChanged.bind(this);for(let z of this.getLeafColumns())z.__addEventListener("visibleChanged",Q);this.expandableListenerRemoveCallback=()=>{for(let z of this.getLeafColumns())z.__removeEventListener("visibleChanged",Q);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let Q=!1,z=!1,J=!1,Z=this.findChildrenRemovingPadding();for(let X=0,Y=Z.length;X{for(let Z of J)if(G0(Z)&&Z.isPadding())z(Z.children);else Q.push(Z)};return z(this.children),Q}onColumnVisibilityChanged(){this.setExpandable()}},lG={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function X5(Q,z,J){let Z={},$=Q.gos;return Object.assign(Z,$.get("defaultColGroupDef")),Object.assign(Z,z),$.validateColDef(Z,J),Z}var aG=class{constructor(){this.existingKeys={}}addExistingKeys(Q){for(let z=0;z0)R(273,{providedId:Q,usedId:$});return this.existingKeys[$]=!0,$}J++}}},B9=(Q,z)=>{if(G0(Q))Q.setupExpandable();Q.originalParent=z};function E9(Q,z=null,J,Z,$){let{existingCols:X,existingGroups:Y}=K9(Z),G=new Map(X.map((K)=>[K.getId(),K])),q=new Map(Y.map((K)=>[K.getId(),K])),H=0,_=(K,L)=>{if(H=Math.max(H,L),M9(K)){if(!Q.colGroupSvc)return null;let k=K.groupId,f=q.get(k),A=X5(Q,K,k),O=new Cz(A,k,!1,L);if(Q.context.createBean(O),f)O.setExpanded(f.isExpanded());return O.setChildren(K.children.map((v)=>_(v,L+1))),O}let F=K.colId,D=G.get(F),M=uQ(Q,K,D?.getColId()??F);if(!D)D=new GQ(M,K,F,J),Q.context.createBean(D);else D.setColDef(M,K,$),D9(Q,D,M,$);return Q.dataTypeSvc?.addColumnListeners(D),D},U=z?.map((K)=>_(K,0))??[],W=0,B={getUniqueKey:(K,L)=>String(++W)},E=Q.colGroupSvc?Q.colGroupSvc.balanceColumnTree(U,0,H,B):U;return OQ(null,E,B9),{columnTree:E,treeDepth:H}}function p5(Q,z=null,J,Z,$){let X=new aG,{existingCols:Y,existingGroups:G,existingColKeys:q}=K9(Z);X.addExistingKeys(q);let H=L9(Q,z,0,J,Y,X,G,$),{colGroupSvc:_}=Q,U=_?.findMaxDepth(H,0)??0,W=_?_.balanceColumnTree(H,0,U,X):H;return OQ(null,W,B9),{columnTree:W,treeDepth:U}}function K9(Q){let z=[],J=[],Z=[];if(Q)OQ(null,Q,($)=>{if(G0($)){let X=$;J.push(X)}else{let X=$;Z.push(X.getId()),z.push(X)}});return{existingCols:z,existingGroups:J,existingColKeys:Z}}function L9(Q,z,J,Z,$,X,Y,G){if(!z)return[];let{colGroupSvc:q}=Q,H=Array(z.length);for(let _=0;_0)return;if(J.width!=null)z.setActualWidth(J.width,Z);else{let X=z.getActualWidth();z.setActualWidth(X,Z)}}function eG(Q,z){if(!z)return;for(let J=0;J{for(let $=0;$z+J.getActualWidth(),0)}function ZQ(Q,z,J){let Z={};if(!z)return;if(OQ(null,z,(X)=>{Z[X.getInstanceId()]=X}),J)OQ(null,J,(X)=>{Z[X.getInstanceId()]=null});let $=Object.values(Z).filter((X)=>X!=null);Q.context.destroyBeans($)}function mz(Q){return Q.getId().startsWith(uz)}function IQ(Q){return(typeof Q==="string"?Q:("getColId"in Q)?Q.getColId():Q.colId)?.startsWith(k9)??!1}function v0(Q){return(typeof Q==="string"?Q:("getColId"in Q)?Q.getColId():Q.colId)?.startsWith(V9)??!1}function GJ(Q){return IQ(Q)||v0(Q)}function XZ(Q){let z=[];if(Q instanceof Array)z=Q;else if(typeof Q==="string")z=Q.split(",");return z}function qJ(Q,z){return X0(Q,z,(J,Z)=>J.getColId()===Z.getColId())}function HJ(Q){Q.map={};for(let z of Q.list)Q.map[z.getId()]=z}function Xz(Q){return Q==="optionsUpdated"?"gridOptionsChanged":Q}function PQ(Q,z){return Q===z||Q.colId==z||Q.getColDef()===z}var Jq=(Q,z)=>(J,Z)=>{let $={value1:void 0,value2:void 0},X=!1;if(Q){if(Q[J]!==void 0)$.value1=Q[J],X=!0;if(T(Z)&&Q[Z]!==void 0)$.value2=Q[Z],X=!0}if(!X&&z){if(z[J]!==void 0)$.value1=z[J];if(T(Z)&&z[Z]!==void 0)$.value2=z[Z]}return $};function i5(Q,z){let J={...Q,sort:void 0,colId:z},Z=A9(Q);if(Z)J.sort=Z.direction,J.sortType=Z.type;return J}function A9(Q){let{sort:z,initialSort:J}=Q,Z=U1(z)||$z(z),$=U1(J)||$z(J);if(Z)return a0(z);if($)return a0(J);return null}function j9(Q,z){return Q+"_"+z}function _0(Q){return Q instanceof a1}var a1=class extends j{constructor(Q,z,J,Z){super();this.providedColumnGroup=Q,this.groupId=z,this.partId=J,this.pinned=Z,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=W0(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return j9(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){let Q=this.getProvidedColumnGroup().getLeafColumns();if(!Q||Q.length===0)return!1;return Q.every((z)=>z.isMoving())}checkLeft(){for(let Q of this.displayedChildren)if(_0(Q))Q.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){let z=b(this.displayedChildren).getLeft();this.setLeft(z)}else{let Q=this.displayedChildren[0].getLeft();this.setLeft(Q)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(Q){if(this.oldLeft=this.left,this.left!==Q)this.left=Q,this.dispatchLocalEvent({type:"leftChanged"})}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let Q=0;for(let z of this.displayedChildren??[])Q+=z.getActualWidth();return Q}isResizable(){if(!this.displayedChildren)return!1;let Q=!1;for(let z of this.displayedChildren)if(z.isResizable())Q=!0;return Q}getMinWidth(){let Q=0;for(let z of this.displayedChildren)Q+=z.getMinWidth();return Q}addChild(Q){if(!this.children)this.children=[];this.children.push(Q)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){let Q=[];return this.addLeafColumns(Q),Q}getDisplayedLeafColumns(){let Q=[];return this.addDisplayedLeafColumns(Q),Q}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(Q){this.providedColumnGroup.setExpanded(Q)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(Q){let z=Q!==this.autoHeaderHeight;return this.autoHeaderHeight=Q,z}addDisplayedLeafColumns(Q){for(let z of this.displayedChildren??[])if(JQ(z))Q.push(z);else if(_0(z))z.addDisplayedLeafColumns(Q)}addLeafColumns(Q){for(let z of this.children??[])if(JQ(z))Q.push(z);else if(_0(z))z.addLeafColumns(Q)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let Q=this.getParent();if(!this.isPadding()||!Q?.isPadding())return 0;return 1+Q.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let Q=this;while(Q?.isPadding())Q=Q.getParent();if(!(Q?Q.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(let J of this.children??[]){if(_0(J)&&!J.displayedChildren?.length)continue;switch(J.getColumnGroupShow()){case"open":if(Q.getProvidedColumnGroup().isExpanded())this.displayedChildren.push(J);break;case"closed":if(!Q.getProvidedColumnGroup().isExpanded())this.displayedChildren.push(J);break;default:this.displayedChildren.push(J);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},V={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},Zq=65,$q=67,Xq=86,Yq=68,Gq=90,qq=89;function R9(Q){let{keyCode:z}=Q,J;switch(z){case Zq:J=V.A;break;case $q:J=V.C;break;case Xq:J=V.V;break;case Yq:J=V.D;break;case Gq:J=V.Z;break;case qq:J=V.Y;break;default:J=Q.code}return J}function Hq(Q,z){return new g((J)=>{J(window.setInterval(Q,z))})}var g=class Q{constructor(z){this.status=0,this.resolution=null,this.waiters=[],z((J)=>this.onDone(J),(J)=>this.onReject(J))}static all(z){return z.length?new Q((J)=>{let Z=z.length,$=Array(Z);z.forEach((X,Y)=>{X.then((G)=>{if($[Y]=G,Z--,Z===0)J($)})})}):Q.resolve()}static resolve(z=null){return new Q((J)=>J(z))}then(z){return new Q((J)=>{if(this.status===1)J(z(this.resolution));else this.waiters.push((Z)=>J(z(Z)))})}onDone(z){this.status=1,this.resolution=z;for(let J of this.waiters)J(z)}onReject(z){}},_q=class extends j0{constructor(){super(...arguments);this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(Q,z=!1){let J={capturePointer:!0,dragSource:Q,eElement:Q.eElement,dragStartPixels:Q.dragStartPixels,onDragStart:(Z)=>this.onDragStart(Q,Z),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:z};this.dragSourceAndParamsList.push(J),this.beans.dragSvc.addDragSource(J)}setDragImageCompIcon(Q,z=!1){let J=this.dragImageComp;if(J&&(z||this.dragImageLastIcon!==Q))this.dragImageLastIcon=Q,J.setIcon(Q,z)}removeDragSource(Q){let{dragSourceAndParamsList:z,beans:J}=this;for(let Z=0,$=z.length;Z<$;Z++)if(z[Z].dragSource===Q){let X=z[Z];J.dragSvc?.removeDragSource(X),z.splice(Z,1);break}}destroy(){let{dragSourceAndParamsList:Q,dropTargets:z,beans:J}=this,Z=J.dragSvc;for(let $ of Q)Z?.removeDragSource($);Q.length=0,z.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){let Q=this.lastMouseEvent;if(Q)this.onDragging(Q,!0)}onDragStart(Q,z){this.lastMouseEvent=z,this.dragSource=Q,this.dragItem=Q.getDragItem();let J=Q.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=z.clientX-J.left,this.dragInitialSourcePointerOffsetY=z.clientY-J.top,Q.onDragStarted?.(),this.createAndUpdateDragImageComp(Q)}onDragStop(Q){let{dragSource:z,lastDropTarget:J}=this;if(z?.onDragStopped?.(),J){let Z=this.dropTargetEvent(J,Q,!1);J.onDragStop?.(Z)}this.clearDragAndDropProperties()}onDragCancel(){let{dragSource:Q,lastDropTarget:z,lastMouseEvent:J}=this;if(Q?.onDragCancelled?.(),z&&J){let Z=this.dropTargetEvent(z,J,!1);z.onDragCancel?.(Z)}this.clearDragAndDropProperties()}onDragging(Q,z=!1){this.positionDragImageComp(Q);let J=this.findCurrentDropTarget(Q),{lastDropTarget:Z,dragSource:$,dragItem:X}=this,Y=!1;if(J!==Z){if(Y=!0,Z){let G=this.dropTargetEvent(Z,Q,z);Z.onDragLeave?.(G)}if(Z!==null&&!J)this.handleExit($,X);else if(Z===null&&J)this.handleEnter($,X);if(J){let G=this.dropTargetEvent(J,Q,z);J.onDragEnter?.(G)}this.lastDropTarget=J}else if(J){let G=this.dropTargetEvent(J,Q,z);if(J.onDragging?.(G),G?.changed)Y=!0}if(this.lastMouseEvent=Q,Y)this.updateDragImageComp()}clearDragAndDropProperties(){this.removeDragImageComp(this.dragImageComp),this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.lastDropTarget=null,this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.dragSource=null}getAllContainersFromDropTarget(Q){let z=Q.getContainer(),J=Q.getSecondaryContainers?.(),Z=J?.length;if(!Z)return[[z]];let $=Array(Z+1);$[0]=[z];for(let X=0;X{for(let H of q){let{width:_,height:U,left:W,right:B,top:E,bottom:K}=H.getBoundingClientRect();if(_===0||U===0)return!1;let L=G.clientX>=W&&G.clientX=E&&G.clientY0}findExternalZone(Q){let z=this.dropTargets;for(let J=0,Z=z.length;J0?"down":E<0?"up":null,hDirection:B<0?"left":B>0?"right":null,initialSourcePointerOffsetX:G,initialSourcePointerOffsetY:q,dragSource:Z,fromNudge:J,dragItem:$,dropZoneTarget:H,dropTarget:X?.dropTarget??null,changed:!!X?.changed});return this.lastDraggingEvent=K,K}positionDragImageComp(Q){let z=this.dragImageComp?.getGui();if(z)HG(z,Q,this.beans)}removeDragImageComp(Q){if(this.dragImageComp===Q)this.dragImageComp=null;if(Q)Q.getGui()?.remove(),this.destroyBean(Q)}createAndUpdateDragImageComp(Q){let z=this.createDragImageComp(Q)??null;this.dragImageCompPromise=z,z?.then((J)=>{let Z=this.lastMouseEvent;if(z!==this.dragImageCompPromise||!Z||!this.isAlive()){this.destroyBean(J);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;let $=this.dragImageComp;if($!==J)this.dragImageComp=J,this.removeDragImageComp($);if(J)this.appendDragImageComp(J),this.updateDragImageComp(),this.positionDragImageComp(Z)})}appendDragImageComp(Q){let z=Q.getGui(),J=z.style;if(J.position="absolute",J.zIndex="9999",this.beans.dragSvc?.hasPointerCapture())J.pointerEvents="none";this.gos.setInstanceDomData(z),this.beans.environment.applyThemeClasses(z),J.top="20px",J.left="20px";let Z=D1(this.beans);if(!Z)this.warnNoBody();else Z.appendChild(z)}updateDragImageComp(){let{dragImageComp:Q,dragSource:z,lastDropTarget:J,lastDraggingEvent:Z,dragImageLastLabel:$}=this;if(!Q)return;this.setDragImageCompIcon(J?.getIconName?.(Z)??null);let X=z?.dragItemName;if(typeof X==="function")X=X(Z);if(X||(X=""),$!==X)this.dragImageLastLabel=X,Q.setLabel(X)}};function S9(Q){return typeof Q==="object"&&!!Q.component}function Uq(Q){if(!Q)return!1;return Q.prototype&&"getGui"in Q.prototype}function O9(Q,z,J,Z){let{name:$}=J,X,Y,G,q,H,_;if(z){let U=z,W=U[$+"Selector"],B=W?W(Z):null,E=(K)=>{if(typeof K==="string")X=K;else if(K!=null&&K!==!0)if(Q.isFrameworkComponent(K))G=K;else Y=K};if(B)E(B.component),q=B.params,H=B.popup,_=B.popupPosition;else E(U[$])}return{compName:X,jsComp:Y,fwComp:G,paramsFromSelector:q,popupFromSelector:H,popupPositionFromSelector:_}}var Wq=class extends j{constructor(){super(...arguments);this.beanName="userCompFactory"}wireBeans(Q){this.agCompUtils=Q.agCompUtils,this.registry=Q.registry,this.frameworkCompWrapper=Q.frameworkCompWrapper,this.gridOptions=Q.gridOptions}getCompDetailsFromGridOptions(Q,z,J,Z=!1){return this.getCompDetails(this.gridOptions,Q,z,J,Z)}getCompDetails(Q,z,J,Z,$=!1){let{name:X,cellRenderer:Y}=z,{compName:G,jsComp:q,fwComp:H,paramsFromSelector:_,popupFromSelector:U,popupPositionFromSelector:W}=O9(this.beans.frameworkOverrides,Q,z,Z),B,E,K=(M)=>{let k=this.registry.getUserComponent(X,M);if(k)q=!k.componentFromFramework?k.component:void 0,H=k.componentFromFramework?k.component:void 0,B=k.params,E=k.processParams};if(G!=null)K(G);if(q==null&&H==null&&J!=null)K(J);if(q&&Y&&!Uq(q))q=this.agCompUtils?.adaptFunction(z,q);if(!q&&!H){let{validation:M}=this.beans;if($&&(G!==J||!J))if(G){if(!M?.isProvidedUserComp(G))e(50,{compName:G})}else if(J){if(!M)e(260,{...this.gos.getModuleErrorParams(),propName:X,compName:J})}else e(216,{name:X});else if(J&&!M)e(146,{comp:J});return}let L=this.mergeParams(Q,z,Z,_,B,E),F=q==null,D=q??H;return{componentFromFramework:F,componentClass:D,params:L,type:z,popupFromSelector:U,popupPositionFromSelector:W,newAgStackInstance:()=>this.newAgStackInstance(D,F,L,z)}}newAgStackInstance(Q,z,J,Z){let $=!z,X;if($)X=new Q;else X=this.frameworkCompWrapper.wrap(Q,Z.mandatoryMethods,Z.optionalMethods,Z);this.createBean(X);let Y=X.init?.(J);if(Y==null)return g.resolve(X);return Y.then(()=>X)}mergeParams(Q,z,J,Z=null,$,X){let Y={...J,...$},q=Q?.[z.name+"Params"];if(typeof q==="function"){let H=q(J);B0(Y,H)}else if(typeof q==="object")B0(Y,q);return B0(Y,Z),X?X(Y):Y}};var Bq={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Eq={name:"headerComponent",optionalMethods:["refresh"]},Kq={name:"innerHeaderComponent"},Lq={name:"innerHeaderGroupComponent"},Fq={name:"headerGroupComponent"},Dq={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},Mq={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0};var kq={name:"loadingCellRenderer",cellRenderer:!0},Vq={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},fq={name:"tooltipComponent"},n5={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},Aq={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},jq={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Rq={name:"loadingCellRenderer",cellRenderer:!0},Sq={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},Oq={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function Pq(Q,z){return Q.getCompDetailsFromGridOptions(Bq,"agDragAndDropImage",z,!0)}function _J(Q,z,J){return Q.getCompDetails(z,Dq,void 0,J)}function Tq(Q,z,J){return Q.getCompDetails(z,Eq,"agColumnHeader",J)}function vq(Q,z,J){return Q.getCompDetails(z,Kq,void 0,J)}function Iq(Q,z){let J=z.columnGroup.getColGroupDef();return Q.getCompDetails(J,Fq,"agColumnGroupHeader",z)}function Cq(Q,z,J){return Q.getCompDetails(z,Lq,void 0,J)}function bq(Q,z){return Q.getCompDetailsFromGridOptions(jq,void 0,z,!0)}function yq(Q,z){return Q.getCompDetailsFromGridOptions(Rq,"agLoadingCellRenderer",z,!0)}function xq(Q,z){return Q.getCompDetailsFromGridOptions(Sq,"agGroupRowRenderer",z,!0)}function wq(Q,z){return Q.getCompDetailsFromGridOptions(Oq,"agDetailCellRenderer",z,!0)}function o1(Q,z,J){return Q.getCompDetails(z,Mq,void 0,J)}function M7(Q,z,J){return Q.getCompDetails(z,kq,"agSkeletonCellRenderer",J,!0)}function P9(Q,z,J){return Q.getCompDetails(z,Vq,"agCellEditor",J,!0)}function d5(Q,z,J,Z){let $=z.filter;if(S9($))z={filter:$.component,filterParams:z.filterParams};return Q.getCompDetails(z,n5,Z,J,!0)}function Nq(Q,z){return Q.getCompDetails(z.colDef,fq,"agTooltipComponent",z,!0)}function t5(Q,z,J,Z){return Q.getCompDetails(z,Aq,Z,J)}function T9(Q,z){return O9(Q,z,n5)}function R2(Q,z,J){return Q.mergeParams(z,n5,J)}var qQ=((Q)=>{return Q[Q.ToolPanel=0]="ToolPanel",Q[Q.HeaderCell=1]="HeaderCell",Q[Q.RowDrag=2]="RowDrag",Q[Q.ChartPanel=3]="ChartPanel",Q[Q.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",Q})(qQ||{}),gq=class extends _q{createEvent(Q){return y(this.gos,Q)}createDragImageComp(Q){let{gos:z,beans:J}=this;return Pq(J.userCompFactory,y(z,{dragSource:Q}))?.newAgStackInstance()}handleEnter(Q,z){Q?.onGridEnter?.(z)}handleExit(Q,z){Q?.onGridExit?.(z)}warnNoBody(){R(54)}isDropZoneWithinThisGrid(Q){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(Q.dropZoneTarget)}registerGridDropTarget(Q,z){let J={getContainer:Q,isInterestedIn:(Z)=>Z===1||Z===0,getIconName:()=>"notAllowed"};this.addDropTarget(J),z.addDestroyFunc(()=>this.removeDropTarget(J))}};var v9="ag-resizer-wrapper",tQ=(Q,z)=>({tag:"div",ref:`${Q}Resizer`,cls:`ag-resizer ag-resizer-${z}`}),hq={tag:"div",cls:v9,children:[tQ("eTopLeft","topLeft"),tQ("eTop","top"),tQ("eTopRight","topRight"),tQ("eRight","right"),tQ("eBottomRight","bottomRight"),tQ("eBottom","bottom"),tQ("eBottomLeft","bottomLeft"),tQ("eLeft","left")]},r5=class extends j0{constructor(Q,z){super();this.element=Q,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...z}}wireBeans(Q){this.popupSvc=Q.popupSvc,this.dragSvc=Q.dragSvc}center(Q){let{clientHeight:z,clientWidth:J}=this.offsetParent,Z=J/2-this.getWidth()/2,$=z/2-this.getHeight()/2;this.offsetElement(Z,$,Q)}initialisePosition(Q){if(this.positioned)return;let{centered:z,forcePopupParentAsOffsetParent:J,minWidth:Z,width:$,minHeight:X,height:Y,x:G,y:q}=this.config;if(!this.offsetParent)this.setOffsetParent();let H=0,_=0,U=f0(this.element);if(U){let W=this.findBoundaryElement(),B=window.getComputedStyle(W);if(B.minWidth!=null){let E=W.offsetWidth-this.element.offsetWidth;_=Number.parseInt(B.minWidth,10)-E}if(B.minHeight!=null){let E=W.offsetHeight-this.element.offsetHeight;H=Number.parseInt(B.minHeight,10)-E}}if(this.minHeight=X||H,this.minWidth=Z||_,$)this.setWidth($);if(Y)this.setHeight(Y);if(!$||!Y)this.refreshSize();if(z)this.center(Q);else if(G||q)this.offsetElement(G,q,Q);else if(U&&J){let W=this.boundaryEl,B=!0;if(!W)W=this.findBoundaryElement(),B=!1;if(W){let E=Number.parseFloat(W.style.top),K=Number.parseFloat(W.style.left);if(B)this.offsetElement(Number.isNaN(K)?0:K,Number.isNaN(E)?0:E,Q);else this.setPosition(K,E)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(Q,z){if(!this.config.popup||Q===this.movable)return;this.movable=Q;let J=this.moveElementDragListener||{eElement:z,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};if(Q)this.dragSvc?.addDragSource(J),this.moveElementDragListener=J;else this.dragSvc?.removeDragSource(J),this.moveElementDragListener=void 0}setResizable(Q){if(this.clearResizeListeners(),Q)this.addResizers();else this.removeResizers();if(typeof Q==="boolean"){if(Q===!1)return;Q={topLeft:Q,top:Q,topRight:Q,right:Q,bottomRight:Q,bottom:Q,bottomLeft:Q,left:Q}}for(let z of Object.keys(Q)){let J=!!Q[z],Z=this.getResizerElement(z),$={dragStartPixels:0,eElement:Z,onDragStart:(X)=>this.onResizeStart(X,z),onDragging:this.onResize.bind(this),onDragStop:(X)=>this.onResizeEnd(X,z)};if(J||!this.isAlive()&&!J){if(J)this.dragSvc?.addDragSource($),this.resizeListeners.push($),Z.style.pointerEvents="all";else Z.style.pointerEvents="none";this.resizable[z]=J}}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";let{height:Q,width:z}=this.lastSize;if(z!==-1)this.element.style.width=`${z}px`;if(Q!==-1)this.element.style.height=`${Q}px`}getHeight(){return this.element.offsetHeight}setHeight(Q){let{popup:z}=this.config,J=this.element,Z=!1;if(typeof Q==="string"&&Q.includes("%"))N1(J,Q),Q=x8(J),Z=!0;else if(Q=Math.max(this.minHeight,Q),this.positioned){let $=this.getAvailableHeight();if($&&Q>$)Q=$}if(this.getHeight()===Q)return;if(Z)J.style.maxHeight="unset",J.style.minHeight="unset";else if(z)N1(J,Q);else J.style.height=`${Q}px`,J.style.flex="0 0 auto",this.lastSize.height=typeof Q==="number"?Q:Number.parseFloat(Q)}getAvailableHeight(){let{popup:Q,forcePopupParentAsOffsetParent:z}=this.config;if(!this.positioned)this.initialisePosition();let{clientHeight:J}=this.offsetParent;if(!J)return null;let Z=this.element.getBoundingClientRect(),$=this.offsetParent.getBoundingClientRect(),X=Q?this.position.y:Z.top,Y=Q?0:$.top,G=0;if(z){let H=this.element.parentElement;if(H){let{bottom:_}=H.getBoundingClientRect();G=_-Z.bottom}}return J+Y-X-G}getWidth(){return this.element.offsetWidth}setWidth(Q){let z=this.element,{popup:J}=this.config,Z=!1;if(typeof Q==="string"&&Q.includes("%"))SQ(z,Q),Q=w8(z),Z=!0;else if(this.positioned){Q=Math.max(this.minWidth,Q);let{clientWidth:$}=this.offsetParent,X=J?this.position.x:this.element.getBoundingClientRect().left;if($&&Q+X>$)Q=$-X}if(this.getWidth()===Q)return;if(Z)z.style.maxWidth="unset",z.style.minWidth="unset";else if(this.config.popup)SQ(z,Q);else z.style.width=`${Q}px`,z.style.flex=" unset",this.lastSize.width=typeof Q==="number"?Q:Number.parseFloat(Q)}offsetElement(Q=0,z=0,J){let{forcePopupParentAsOffsetParent:Z}=this.config,$=Z?this.boundaryEl:this.element;if(!$)return;this.popupSvc?.positionPopup({ePopup:$,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:Q,y:z}),postProcessCallback:J}),this.setPosition(Number.parseFloat($.style.left),Number.parseFloat($.style.top))}constrainSizeToAvailableHeight(Q){if(!this.config.forcePopupParentAsOffsetParent)return;let z=()=>{let J=this.getAvailableHeight();this.element.style.setProperty("max-height",`${J}px`)};if(Q&&this.popupSvc)this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=DQ(this.beans,this.popupSvc?.getPopupParent(),z);else if(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber)this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0}setPosition(Q,z){this.position.x=Q,this.position.y=z}updateDragStartPosition(Q,z){this.dragStartPosition={x:Q,y:z}}calculateMouseMovement(Q){let{e:z,isLeft:J,isTop:Z,anywhereWithin:$,topBuffer:X}=Q,Y=z.clientX-this.dragStartPosition.x,G=z.clientY-this.dragStartPosition.y,q=this.shouldSkipX(z,!!J,!!$,Y)?0:Y,H=this.shouldSkipY(z,!!Z,X,G)?0:G;return{movementX:q,movementY:H}}shouldSkipX(Q,z,J,Z){let $=this.element.getBoundingClientRect(),X=this.offsetParent.getBoundingClientRect(),Y=this.boundaryEl.getBoundingClientRect(),G=this.config.popup?this.position.x:$.left,q=G<=0&&X.left>=Q.clientX||X.right<=Q.clientX&&X.right<=Y.right;if(q)return!0;if(z)q=Z<0&&Q.clientX>G+X.left||Z>0&&Q.clientXY.right||Z>0&&Q.clientXY.right||Z>0&&Q.clientX=Q.clientY||X.bottom<=Q.clientY&&X.bottom<=Y.bottom;if(q)return!0;if(z)q=Z<0&&Q.clientY>G+X.top+J||Z>0&&Q.clientYY.bottom||Z>0&&Q.clientY({element:this.element.querySelector(`[data-ref=${z}Resizer]`)});this.resizerMap={topLeft:Q("eTopLeft"),top:Q("eTop"),topRight:Q("eTopRight"),right:Q("eRight"),bottomRight:Q("eBottomRight"),bottom:Q("eBottom"),bottomLeft:Q("eBottomLeft"),left:Q("eLeft")}}addResizers(){if(this.resizersAdded)return;let Q=this.element;if(!Q)return;Q.appendChild(K0(hq)),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${v9}`)?.remove(),this.resizersAdded=!1}getResizerElement(Q){return this.resizerMap[Q].element}onResizeStart(Q,z){if(this.boundaryEl=this.findBoundaryElement(),!this.positioned)this.initialisePosition();this.currentResizer={isTop:!!z.match(/top/i),isRight:!!z.match(/right/i),isBottom:!!z.match(/bottom/i),isLeft:!!z.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[z].element.classList.add("ag-active");let{popup:J,forcePopupParentAsOffsetParent:Z}=this.config;if(!J&&!Z)this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop);this.isResizing=!0,this.updateDragStartPosition(Q.clientX,Q.clientY)}getSiblings(){let z=this.element.parentElement;if(!z)return null;return Array.prototype.slice.call(z.children).filter((J)=>!J.classList.contains("ag-hidden"))}getMinSizeOfSiblings(){let Q=this.getSiblings()||[],z=0,J=0;for(let Z of Q){let $=!!Z.style.flex&&Z.style.flex!=="0 0 auto";if(Z===this.element)continue;let X=this.minHeight||0,Y=this.minWidth||0;if($){let G=window.getComputedStyle(Z);if(G.minHeight)X=Number.parseInt(G.minHeight,10);if(G.minWidth)Y=Number.parseInt(G.minWidth,10)}else X=Z.offsetHeight,Y=Z.offsetWidth;z+=X,J+=Y}return{height:z,width:J}}applySizeToSiblings(Q){let z=null,J=this.getSiblings();if(!J)return;for(let Z=0;ZQ)}onResize(Q){if(!this.isResizing||!this.currentResizer)return;let{popup:z,forcePopupParentAsOffsetParent:J}=this.config,{isTop:Z,isRight:$,isBottom:X,isLeft:Y}=this.currentResizer,G=$||Y,q=X||Z,{movementX:H,movementY:_}=this.calculateMouseMovement({e:Q,isLeft:Y,isTop:Z}),U=this.position.x,W=this.position.y,B=0,E=0;if(G&&H){let K=Y?-1:1,L=this.getWidth(),F=L+H*K,D=!1;if(Y){if(B=L-F,U+B<=0||F<=this.minWidth)D=!0,B=0}if(!D)this.setWidth(F)}if(q&&_){let K=Z?-1:1,L=this.getHeight(),F=L+_*K,D=!1;if(Z){if(E=L-F,W+E<=0||F<=this.minHeight)D=!0,E=0}else if(!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&Lthis.element.parentElement.offsetHeight)D=!0;if(!D)this.setHeight(F)}if(this.updateDragStartPosition(Q.clientX,Q.clientY),(z||J)&&B||E)this.offsetElement(U+B,W+E)}onResizeEnd(Q,z){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[z].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){let Q=this.element;if(this.config.popup){if(!this.config.width)this.setWidth(Q.offsetWidth);if(!this.config.height)this.setHeight(Q.offsetHeight)}}onMoveStart(Q){if(this.boundaryEl=this.findBoundaryElement(),!this.positioned)this.initialisePosition();this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(Q.clientX,Q.clientY)}onMove(Q){if(!this.isMoving)return;let{x:z,y:J}=this.position,Z;if(this.config.calculateTopBuffer)Z=this.config.calculateTopBuffer();let{movementX:$,movementY:X}=this.calculateMouseMovement({e:Q,isTop:!0,anywhereWithin:!0,topBuffer:Z});this.offsetElement(z+$,J+X),this.updateDragStartPosition(Q.clientX,Q.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){if(this.config.forcePopupParentAsOffsetParent&&this.popupSvc)this.offsetParent=this.popupSvc.getPopupParent();else this.offsetParent=this.element.offsetParent}findBoundaryElement(){let Q=this.element;while(Q){if(window.getComputedStyle(Q).position!=="static")return Q;Q=Q.parentElement}return this.element}clearResizeListeners(){while(this.resizeListeners.length){let Q=this.resizeListeners.pop();this.dragSvc?.removeDragSource(Q)}}destroy(){if(super.destroy(),this.moveElementDragListener)this.dragSvc?.removeDragSource(this.moveElementDragListener);this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},UJ=class extends r5{},S=null;function bZ(Q){return typeof Q?.getGui==="function"}var I9=class{constructor(Q){this.cssClassStates={},this.getGui=Q}toggleCss(Q,z){if(!Q)return;if(Q.includes(" ")){let Z=(Q||"").split(" ");if(Z.length>1){for(let $ of Z)this.toggleCss($,z);return}}if(this.cssClassStates[Q]!==z&&Q.length)this.getGui()?.classList.toggle(Q,z),this.cssClassStates[Q]=z}},uq=0,p0=class extends j0{constructor(Q,z){super();if(this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=uq++,this.cssManager=new I9(()=>this.eGui),this.componentSelectors=new Map((z??[]).map((J)=>[J.selector,J])),Q)this.setTemplate(Q)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(Q,z){if(Q&&this.gos)this.applyElementsToComponent(Q),this.createChildComponentsFromTags(Q,z)}getCompId(){return this.compId}getDataRefAttribute(Q){if(Q.getAttribute)return Q.getAttribute(p8);return null}applyElementsToComponent(Q,z,J,Z=null){if(z===void 0)z=this.getDataRefAttribute(Q);if(z){let $=this[z];if($===S)this[z]=Z??Q;else{let X=J?.[z];if(!this.suppressDataRefValidation&&!X)throw Error(`data-ref: ${z} on ${this.constructor.name} with ${$}`)}}}createChildComponentsFromTags(Q,z){let J=[];for(let Z of Q.childNodes??[])J.push(Z);for(let Z of J){if(!(Z instanceof HTMLElement))continue;let $=this.createComponentFromElement(Z,(X)=>{let Y=X.getGui();if(Y)for(let G of Z.attributes??[])Y.setAttribute(G.name,G.value)},z);if($){if($.addItems&&Z.children.length){this.createChildComponentsFromTags(Z,z);let X=Array.prototype.slice.call(Z.children);$.addItems(X)}this.swapComponentForNode($,Q,Z)}else if(Z.childNodes)this.createChildComponentsFromTags(Z,z)}}createComponentFromElement(Q,z,J){let Z=Q.nodeName,$=this.getDataRefAttribute(Q),X=Z.indexOf("AG-")===0,Y=X?this.componentSelectors.get(Z):null,G=null;if(Y){let q=J&&$?J[$]:void 0;G=new Y.component(q),G.setParentComponent(this),this.createBean(G,null,z)}else if(X)throw Error(`selector: ${Z}`);return this.applyElementsToComponent(Q,$,J,G),G}swapComponentForNode(Q,z,J){let Z=Q.getGui();z.replaceChild(Z,J),z.insertBefore(document.createComment(J.nodeName),Z),this.addDestroyFunc(this.destroyBean.bind(this,Q))}activateTabIndex(Q,z){let J=z??this.gos.get("tabIndex");if(!Q)Q=[];if(!Q.length)Q.push(this.getGui());for(let Z of Q)Z.setAttribute("tabindex",J.toString())}setTemplate(Q,z,J){let Z;if(typeof Q==="string"||Q==null)Z=v5(Q);else Z=K0(Q);this.setTemplateFromElement(Z,z,J)}setTemplateFromElement(Q,z,J,Z=!1){if(this.eGui=Q,this.suppressDataRefValidation=Z,z)for(let $=0;$this.eGui.removeEventListener(Q,z))}addCss(Q){this.cssManager.toggleCss(Q,!0)}removeCss(Q){this.cssManager.toggleCss(Q,!1)}toggleCss(Q,z){this.cssManager.toggleCss(Q,z)}registerCSS(Q){if(this.css===k7)this.css=[Q],this.addGlobalCss();else this.css||(this.css=[]),this.css.push(Q)}addGlobalCss(){if(Array.isArray(this.css)){let Q="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(let z of this.css??[])this.beans.environment.addGlobalCSS(z,Q)}this.css=k7}},k7=Symbol(),x=class extends p0{},S2,O2,P2,T2,Y5,G5,v2;function cz(){if(S2===void 0)S2=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return S2}function yZ(){if(O2===void 0)O2=/(firefox)/i.test(navigator.userAgent);return O2}function C9(){if(P2===void 0)P2=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);return P2}function bz(){if(T2===void 0)T2=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return T2}function q5(Q){if(!Q)return null;let z=Q.tabIndex,J=Q.getAttribute("tabIndex");if(z===-1&&(J===null||J===""&&!yZ()))return null;return z.toString()}function mq(){if(v2!==void 0)return v2;if(!document.body)return-1;let Q=1e6,z=yZ()?6000000:1e9,J=document.createElement("div");document.body.appendChild(J);while(!0){let Z=Q*2;if(J.style.height=Z+"px",Z>z||J.clientHeight!==Z)break;else Q=Z}return J.remove(),v2=Q,Q}function s5(){if(G5==null)b9();return G5}function b9(){let Q=document.body,z=document.createElement("div");z.style.width=z.style.height="100px",z.style.opacity="0",z.style.overflow="scroll",z.style.msOverflowStyle="scrollbar",z.style.position="absolute",Q.appendChild(z);let J=z.offsetWidth-z.clientWidth;if(J===0&&z.clientWidth===0)J=null;if(z.parentNode)z.remove();if(J!=null)G5=J,Y5=J===0}function y9(){if(Y5==null)b9();return Y5}var H5=!1,YZ=0;function cq(Q){if(YZ>0)return;Q.addEventListener("keydown",GZ),Q.addEventListener("mousedown",GZ)}function pq(Q){if(YZ>0)return;Q.removeEventListener("keydown",GZ),Q.removeEventListener("mousedown",GZ)}function GZ(Q){let z=H5,J=Q.type==="keydown";if(J){if(Q.ctrlKey||Q.metaKey||Q.altKey)return}if(z===J)return;H5=J}function iq(Q){let z=Y0(Q);return cq(z),YZ++,()=>{YZ--,pq(z)}}function V1(){return H5}function EQ(Q,z,J=!1){let Z=a4,$=y8;if(z)$+=", "+z;if(J)$+=', [tabindex="-1"]';let X=Array.prototype.slice.apply(Q.querySelectorAll(Z)).filter((q)=>{return f0(q)}),Y=Array.prototype.slice.apply(Q.querySelectorAll($));if(!Y.length)return X;return((q,H)=>q.filter((_)=>H.indexOf(_)===-1))(X,Y)}function D0(Q,z=!1,J=!1,Z=!1){let $=EQ(Q,Z?".ag-tab-guard":null,J),X=z?b($):$[0];if(X)return X.focus({preventScroll:!0}),!0;return!1}function R0(Q,z,J,Z){let $=EQ(z,J?':not([tabindex="-1"])':null),X=d(Q),Y;if(J)Y=$.findIndex((q)=>q.contains(X));else Y=$.indexOf(X);let G=Y+(Z?-1:1);if(G<0||G>=$.length)return null;return $[G]}function xZ(Q,z=5){let J=0;while(Q&&q5(Q)===null&&++J<=z)Q=Q.parentElement;if(q5(Q)===null)return null;return Q}var l5="ag-focus-managed",x9=class extends j0{constructor(Q,z={isStopPropagation:()=>!1,stopPropagation:()=>{}},J={}){super();this.eFocusable=Q,this.stopPropagationCallbacks=z,this.callbacks=J,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:(Z)=>{if(Z.defaultPrevented)return;let $=R0(this.beans,this.eFocusable,!1,Z.shiftKey);if(!$)return;$.focus(),Z.preventDefault()},...J}}postConstruct(){let{eFocusable:Q,callbacks:{onFocusIn:z,onFocusOut:J}}=this;if(Q.classList.add(l5),this.addKeyDownListeners(Q),z)this.addManagedElementListeners(Q,{focusin:z});if(J)this.addManagedElementListeners(Q,{focusout:J})}addKeyDownListeners(Q){this.addManagedElementListeners(Q,{keydown:(z)=>{if(z.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(z))return;let{callbacks:J}=this;if(J.shouldStopEventPropagation(z)){this.stopPropagationCallbacks.stopPropagation(z);return}if(z.key===V.TAB)J.onTabKeyDown(z);else if(J.handleKeyDown)J.handleKeyDown(z)}})}},w9="__ag_Grid_Stop_Propagation";function i0(Q){Q[w9]=!0}function zQ(Q){return Q[w9]===!0}var Uz={isStopPropagation:zQ,stopPropagation:i0},cQ=class extends x9{constructor(Q,z){super(Q,Uz,z)}},nq={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:(Q)=>`(${Q[0]}, ${Q[1]})`,filterSummaryTextQuote:(Q)=>`"${Q[0]}"`,minDateValidation:(Q)=>`Date must be after ${Q[0]}`,maxDateValidation:(Q)=>`Date must be before ${Q[0]}`,strictMinValueValidation:(Q)=>`Must be greater than ${Q[0]}`,strictMaxValueValidation:(Q)=>`Must be less than ${Q[0]}`};function N9(Q,z,J){return UG(Q,nq,z,J)}function dq(Q,z){let{debounceMs:J}=Q;if(WJ(Q)){if(J!=null)R(71);return 0}return J??z}function WJ(Q){return(Q.buttons?.indexOf("apply")??-1)>=0}var wZ=class extends x{constructor(Q,z){super();this.filterNameKey=Q,this.cssIdentifier=z,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){let Q={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(Q,this.getAgComponents()),this.createManagedBean(new cQ(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new UJ(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(Q){}init(Q){let z=Q;this.setParams(z),this.setModelIntoUi(z.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(Q,z){return Q===z}refresh(Q){let z=Q,J=this.params;this.params=z;let{source:Z,state:$,additionalEventAttributes:X}=z;if(Z==="colDef")this.updateParams(z,J);let Y=this.state;this.state=$;let G=X?.fromAction;if(G&&G!=="apply"||$.model!==Y.model||!this.areStatesEqual($.state,Y.state))this.setModelIntoUi($.model);return!0}setParams(Q){this.params=Q,this.state=Q.state,this.commonUpdateParams(Q)}updateParams(Q,z){this.commonUpdateParams(Q,z)}commonUpdateParams(Q,z){this.applyActive=WJ(Q),this.setupApplyDebounced()}doesFilterPass(Q){R(283);let{getHandler:z,model:J,column:Z}=this.params;return z().doesFilterPass({...Q,model:J,handlerParams:this.beans.colFilter.getHandlerParams(Z)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return R(284),this.params.model!=null}setupApplyDebounced(){let Q=dq(this.params,this.defaultDebounceMs),z=gQ(this,this.checkApplyDebounce.bind(this),Q);this.applyDebounced=()=>{this.debouncePending=!0,z()}}checkApplyDebounce(){if(this.debouncePending)this.debouncePending=!1,this.doApplyModel()}getModel(){return R(285),this.params.model}setModel(Q){R(286);let{beans:z,params:J}=this;return z.colFilter.setModelForColumnLegacy(J.column,Q)}applyModel(Q="api"){return this.doApplyModel()}canApply(Q){return!0}doApplyModel(Q){let{params:z,state:{valid:J=!0,model:Z}}=this;if(!J)return!1;let $=!this.areModelsEqual(z.model,Z);if($)z.onAction("apply",Q);return $}onNewRowsLoaded(){}onUiChanged(Q,z=!1){this.updateUiVisibility();let J=this.getModelFromUi(),Z={model:J,state:this.getState(),valid:this.canApply(J)};this.state=Z;let{params:$,gos:X,eventSvc:Y,applyActive:G}=this;if($.onStateChange(Z),$.onUiChange(this.getUiChangeEventParams()),!X.get("enableFilterHandlers"))Y.dispatchEvent({type:"filterModified",column:$.column,filterInstance:this});if(!Z.valid)return;if(Q??(Q=G?void 0:"debounce"),Q==="immediately")this.doApplyModel({afterFloatingFilter:z,afterDataChange:!1});else if(Q==="debounce")this.applyDebounced()}getState(){return}getUiChangeEventParams(){return}afterGuiAttached(Q){this.lastContainerType=Q?.container,this.refreshFilterResizer(Q?.container)}refreshFilterResizer(Q){let{positionableFeature:z,gos:J}=this;if(!z)return;let Z=Q==="floatingFilter"||Q==="columnFilter";if(Z)z.restoreLastSize(),z.setResizable(J.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0});else z.removeSizeFromEl(),z.setResizable(!1);z.constrainSizeToAvailableHeight(Z)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(Q,z){return N9(this,Q,z)}getPositionableElement(){return this.getGui()}areModelsEqual(Q,z){if(Q===z||Q==null&&z==null)return!0;if(Q==null||z==null)return!1;return this.areNonNullModelsEqual(Q,z)}};var a5=class extends p0{isPopup(){return!0}setParentComponent(Q){Q.addCss("ag-has-popup"),super.setParentComponent(Q)}destroy(){let Q=this.parentComponent;if(Q?.isAlive())Q.getGui().classList.remove("ag-has-popup");super.destroy()}},tq=class extends a5{constructor(){super(...arguments);this.errorMessages=null}init(Q){this.params=Q,this.initialiseEditor(Q),this.eEditor.onValueChange(()=>Q.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function o5(Q){let z=Q.rowModel;return z.getType()==="clientSide"?z:void 0}var V7="row-group-",rq="t-",sq="b-",lq=0,Wz=class{constructor(Q){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenAfterGroup=null,this.childrenAfterFilter=null,this.childrenAfterAggFilter=null,this.childrenAfterSort=null,this.allChildrenCount=null,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this._expanded=void 0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=lq++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=Q}get groupData(){let Q=this._groupData;if(Q!==void 0)return Q;if(this.footer)return this.sibling?.groupData;return this.beans.groupStage?.loadGroupData(this)??null}set groupData(Q){this._groupData=Q}get primaryRow(){let Q=this.footer&&this.sibling?this.sibling:this,{pinnedSibling:z}=Q;if(z&&Q.rowPinned){if(Q=z,Q.footer&&Q.sibling)Q=Q.sibling}return Q}get allLeafChildren(){let Q=this._leafs;return Q===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:Q}set allLeafChildren(Q){this._leafs=Q}get expanded(){let Q=this.beans.expansionSvc;return Q?Q.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(Q){this._expanded=Q}setData(Q){this.setDataCommon(Q,!1)}updateData(Q){this.setDataCommon(Q,!0)}setDataCommon(Q,z){let{valueCache:J,eventSvc:Z}=this.beans,$=this.data;this.data=Q,J?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();let X=this.createDataChangedEvent(Q,$,z);if(this.__localEventService?.dispatchEvent(X),this.sibling){this.sibling.data=Q;let G=this.sibling.createDataChangedEvent(Q,$,z);this.sibling.__localEventService?.dispatchEvent(G)}Z.dispatchEvent({type:"rowNodeDataChanged",node:this});let Y=this.pinnedSibling;if(Y)Y.data=Q,Y.__localEventService?.dispatchEvent(Y.createDataChangedEvent(Q,$,z)),Z.dispatchEvent({type:"rowNodeDataChanged",node:Y})}updateDataOnDetailNode(){let Q=this.detailNode;if(Q)Q.data=this.data}createDataChangedEvent(Q,z,J){return{type:"dataChanged",node:this,oldData:z,newData:Q,update:J}}getRowIndexString(){if(this.rowIndex==null)return e(13),null;if(this.rowPinned==="top")return rq+this.rowIndex;if(this.rowPinned==="bottom")return sq+this.rowIndex;return this.rowIndex.toString()}setDataAndId(Q,z){let{selectionSvc:J}=this.beans,Z=J?.createDaemonNode?.(this),$=this.data;if(this.data=Q,this.updateDataOnDetailNode(),this.setId(z),J)J.updateRowSelectable(this),J.syncInRowNode(this,Z);let X=this.createDataChangedEvent(Q,$,!1);this.__localEventService?.dispatchEvent(X)}setId(Q){let z=Z5(this.beans.gos);if(z)if(this.data){let J=this.parent?.getRoute()??[];if(this.id=z({data:this.data,parentKeys:J.length>0?J:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(V7))e(14,{groupPrefix:V7})}else this.id=void 0;else this.id=Q}setRowTop(Q){if(this.oldRowTop=this.rowTop,this.rowTop===Q)return;this.rowTop=Q,this.dispatchRowEvent("topChanged");let z=Q!==null;if(this.displayed!==z)this.displayed=z,this.dispatchRowEvent("displayedChanged")}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(Q){this.hovered=Q}isHovered(){return this.hovered}setRowHeight(Q,z=!1){this.rowHeight=Q,this.rowHeightEstimated=z,this.dispatchRowEvent("heightChanged")}setExpanded(Q,z,J){this.beans.expansionSvc?.setExpanded(this,Q,z,J)}setDataValue(Q,z,J){let{colModel:Z,valueSvc:$,gos:X,editSvc:Y}=this.beans;if(Q==null)return!1;let G=Z.getCol(Q)??Z.getColDefCol(Q);if(!G)return!1;if(!this.group){let _=G.getColDef();if(_.pivotValueColumn)G=_.pivotValueColumn}let q=$.getValueForDisplay({column:G,node:this,from:"data"}).value;if(X.get("readOnlyEdit")){let{beans:{eventSvc:_},data:U,rowIndex:W,rowPinned:B}=this;return _.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:W,rowPinned:B,column:G,colDef:G.colDef,data:U,node:this,oldValue:q,newValue:z,value:z,source:J}),!1}if(J!=="data"&&Y&&!Y.committing){let _=Y.setDataValue({rowNode:this,column:G},z,J);if(_!=null)return _}let H=$.setValue(this,G,z,J);if(this.dispatchCellChangedEvent(G,z,q),H)this.pinnedSibling?.dispatchCellChangedEvent(G,z,q);return H}getDataValue(Q,z="data"){let{colModel:J,valueSvc:Z,formula:$}=this.beans;if(Q==null)return;let X=J.getCol(Q)??J.getColDefCol(Q);if(!X)return;let Y=z==="data-raw",G=Y||z==="value"?"data":z,q=Z.getValue(X,this,G,Y);if(!Y){if($&&X.isAllowFormula()&&$.isFormula(q))q=$.resolveValue(X,this);if(z!=="data"&&X.getAggFunc()&&typeof q==="object"&&q!=null){if(typeof q.toNumber==="function")return q.toNumber();if("value"in q)return q.value}}return q}updateHasChildren(){let Q=this.group&&!this.footer||!!this.childrenAfterGroup?.length,{rowChildrenSvc:z}=this.beans;if(z)Q=z.getHasChildrenValue(this);if(Q!==this.__hasChildren)this.__hasChildren=!!Q,this.dispatchRowEvent("hasChildrenChanged")}hasChildren(){if(this.__hasChildren==null)this.updateHasChildren();return this.__hasChildren}dispatchCellChangedEvent(Q,z,J){let Z={type:"cellChanged",node:this,column:Q,newValue:z,oldValue:J};this.__localEventService?.dispatchEvent(Z)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();let Q=this.rowPinned&&this.pinnedSibling;if(Q)return Q.isSelected();return this.__selected}depthFirstSearch(Q){let z=this.childrenAfterGroup;if(z)for(let J=0,Z=z.length;J{let J=new Wz(z);for(let Z of Object.keys(Q)){if(aq.has(Z))continue;J[Z]=Q[Z]}return J.oldRowTop=null,J},h9=(Q,z,J)=>{if(!J)return;let Z=J.rowIndex;if(Z==null)return;Z+=z;let $=Q.getRowCount();while(Z>=0&&Z<$){let X=Q.getRow(Z);if(!X||!X.footer&&!X.detail)return X;Z+=z}return};var oq=500,eq=550,yJ,QH=(Q)=>{if(!yJ)yJ=new WeakSet;else if(yJ.has(Q))return!1;return yJ.add(Q),!0},h0=class{constructor(Q,z=!1){this.eElement=Q,this.preventClick=z,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(Q,z){let J=this.eventSvc;if(!J){if(J===null)return;this.eventSvc=J=new KQ;let Z=this.onTouchStart.bind(this);this.startListener=Z,this.eElement.addEventListener("touchstart",Z,{passive:!0})}J.addEventListener(Q,z)}removeEventListener(Q,z){this.eventSvc?.removeEventListener(Q,z)}onTouchStart(Q){if(this.touchStart||!QH(Q))return;let z=Q.touches[0];this.touchStart=z;let J=this.handlers;if(!J.length){let Z=this.eElement,$=Z.ownerDocument,X=this.onTouchMove.bind(this),Y=this.onTouchEnd.bind(this),G=this.onTouchCancel.bind(this),q={passive:!0},H={passive:!1};pJ(J,[Z,"touchmove",X,q],[$,"touchcancel",G,q],[$,"touchend",Y,H],[$,"contextmenu",J1,H])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{if(this.longPressTimer=0,this.touchStart===z&&!this.moved)this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:z,touchEvent:Q})},eq)}onTouchMove(Q){let{moved:z,touchStart:J}=this;if(!z&&J){let Z=G1(J,Q.touches);if(Z&&!i8(Z,J,4))this.clearLongPress(),this.moved=!0}}onTouchEnd(Q){let z=this.touchStart;if(!z||!G1(z,Q.changedTouches))return;if(!this.moved)this.eventSvc?.dispatchEvent({type:"tap",touchStart:z}),this.checkDoubleTap(z);if(this.preventClick)J1(Q);this.cancel()}onTouchCancel(Q){let z=this.touchStart;if(!z||!G1(z,Q.changedTouches))return;this.lastTapTime=null,this.cancel()}checkDoubleTap(Q){let z=Date.now(),J=this.lastTapTime;if(J){if(z-J>oq)this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:Q}),z=null}this.lastTapTime=z}cancel(){this.clearLongPress(),I5(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){let Q=this.startListener;if(Q)this.startListener=null,this.eElement.removeEventListener("touchstart",Q);this.cancel(),this.eElement=null,this.eventSvc=null}},CQ=((Q)=>{return Q[Q.VALUE=0]="VALUE",Q[Q.DIMENSION=1]="DIMENSION",Q})(CQ||{}),zH=1,JH=class{constructor(Q){if(this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=zH++,!Q?.beanClasses)return;this.beanDestroyComparator=Q.beanDestroyComparator,this.init(Q)}init(Q){this.id=Q.id,this.beans.context=this,this.destroyCallback=Q.destroyCallback;for(let z of Object.keys(Q.providedBeanInstances))this.beans[z]=Q.providedBeanInstances[z];for(let z of Q.beanClasses){let J=new z;if(J.beanName)this.beans[J.beanName]=J;else console.error(`Bean ${z.name} is missing beanName`);this.createdBeans.push(J)}for(let z of Q.derivedBeans??[]){let{beanName:J,bean:Z}=z(this);this.beans[J]=Z,this.createdBeans.push(Z)}if(Q.beanInitComparator)this.createdBeans.sort(Q.beanInitComparator);this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(Q,z){return this.initBeans([Q],z),Q}initBeans(Q,z){let J=this.beans;for(let Z of Q)Z.preWireBeans?.(J),Z.wireBeans?.(J);for(let Z of Q)Z.preConstruct?.();if(z)Q.forEach(z);for(let Z of Q)Z.postConstruct?.()}getBeans(){return this.beans}getBean(Q){return this.beans[Q]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;let Q=this.getBeanInstances();if(this.beanDestroyComparator)Q.sort(this.beanDestroyComparator);this.destroyBeans(Q),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(Q){Q?.destroy?.()}destroyBeans(Q){if(Q)for(let z=0;z[Q,z]));function XH(Q,z){let J=(Q.beanName?f7[Q.beanName]:void 0)??Number.MAX_SAFE_INTEGER,Z=(z.beanName?f7[z.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return J-Z}function YH(Q,z){if(Q?.beanName==="gridDestroySvc")return-1;if(z?.beanName==="gridDestroySvc")return 1;return 0}function bQ(Q){let{rowIndex:z,rowPinned:J,column:Z}=Q;return`${z}.${J==null?"null":J}.${Z.getId()}`}function f1(Q,z){let J=Q.column===z.column,Z=Q.rowPinned===z.rowPinned,$=Q.rowIndex===z.rowIndex;return J&&Z&&$}function q0(Q,z){switch(Q.rowPinned){case"top":if(z.rowPinned!=="top")return!0;break;case"bottom":if(z.rowPinned!=="bottom")return!1;break;default:if(T(z.rowPinned))return z.rowPinned!=="top";break}return Q.rowIndexU.rowNode.rowIndex===z.rowIndex),q=G?X:Y,H=(J?-1:1)*(G?-1:1),_;for(let U=0;U{if(!Z.defaultPrevented&&!UH(Z)&&Z.key===V.TAB){let $=Z.shiftKey;if(!R0(Q,J,!1,$)){if($Q(Q,$))Z.preventDefault()}}}})}function _Q(Q){return Q.gos.get("suppressHeaderFocus")||!!Q.overlays?.exclusive}function qZ(Q){return Q.gos.get("suppressCellFocus")||!!Q.overlays?.exclusive}function $Q(Q,z,J=!1){let Z=Q.ctrlsSvc.get("gridCtrl"),$=Z.focusNextInnerContainer(z);if($===!0)return!0;if($===!1)return $;if(J||!z&&!Z.isDetailGrid()&&Z.isFocusInsideGridBody())Z.forceFocusOutOfContainer(z);return!1}function HH(Q,z){let J=Q.focusSvc,Z=J.getFocusedCell();if(Z&&z&&f1(Z,z)){let{rowIndex:$,rowPinned:X,column:Y}=z;if(hz(Q))J.setFocusedCell({rowIndex:$,column:Y,rowPinned:X,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!V1()})}}function _H(Q,z){let J=Q.getFocusableContainerName();if(J==="gridBody")return z();return m9(Q,()=>EQ(Q.getGui(),".ag-tab-guard").length>0)?J:null}function m9(Q,z){Q.setAllowFocus?.(!0);try{return z()}finally{Q.setAllowFocus?.(!1)}}var c9="__ag_Grid_Skip_Focusable_Container";function p9(Q){Q[c9]=!0}function UH(Q){return Q[c9]===!0}function i9(Q){if(!Q.cols)return-1;return Q.cols.treeDepth+1}function l0(Q){return Q.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function z6(Q){let z=[],J=Q.ctrlsSvc.getHeaderRowContainerCtrls();for(let Z of J){if(!Z)continue;let $=Z.getGroupRowCount()||0;for(let X=0;X<$;X++){let Y=Z.getGroupRowCtrlAtIndex(X),G=z[X];if(Y){let q=WH(Q,Y);if(G==null||q>G)z[X]=q}}}return z}function WH(Q,z){let Z=Q.colModel.isPivotMode()?EH(Q):d9(Q),$=z.getHeaderCellCtrls();for(let X of $){let{column:Y}=X,G=Y.getAutoHeaderHeight();if(G!=null&&G>Z&&Y.isAutoHeaderHeight())Z=G}return Z}function J6(Q){let J=Q.colModel.isPivotMode()?BH(Q):NZ(Q);return Q.colModel.forAllCols((Z)=>{let $=Z.getAutoHeaderHeight();if($!=null&&$>J&&Z.isAutoHeaderHeight())J=$}),J}function NZ(Q){return Q.gos.get("headerHeight")??Q.environment.getDefaultHeaderHeight()}function n9(Q){return Q.gos.get("floatingFiltersHeight")??NZ(Q)}function d9(Q){return Q.gos.get("groupHeaderHeight")??NZ(Q)}function BH(Q){return Q.gos.get("pivotHeaderHeight")??NZ(Q)}function EH(Q){return Q.gos.get("pivotGroupHeaderHeight")??d9(Q)}function KH(Q,z){return Q.headerRowIndex===z.headerRowIndex&&Q.column===z.column}function LH(Q){return Q?.headerRowIndex!=null}var FH=class extends j{setComp(Q,z,J){this.comp=Q,this.eGui=z;let{beans:Z}=this,{headerNavigation:$,touchSvc:X,ctrlsSvc:Y}=Z;if($)this.createManagedBean(new cQ(J,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)}));this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,Z),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,Z)}),this.onPivotModeChanged(Z),this.setupHeaderHeight();let G=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:G}),X?.mockHeaderContextMenu(this,G),Y.register("gridHeaderCtrl",this)}setupHeaderHeight(){let Q=this.setHeaderHeight.bind(this);Q(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],Q),this.addManagedEventListeners({headerRowsChanged:Q,columnHeaderHeightChanged:Q,columnGroupHeaderHeightChanged:()=>YQ(this.beans,()=>Q()),stylesChanged:Q,advancedFilterEnabledChanged:Q})}setHeaderHeight(){let{beans:Q}=this,z=0,J=z6(Q).reduce((Y,G)=>Y+G,0),Z=J6(Q);if(Q.filterManager?.hasFloatingFilters())z+=n9(Q);z+=J,z+=Z;let $=Q.environment.getHeaderRowBorderWidth(),X=z+$;if(this.headerHeightWithBorder!==X){this.headerHeightWithBorder=X;let Y=`${X}px`;this.comp.setHeightAndMinHeight(Y)}if(this.headerHeight!==z)this.headerHeight=z,this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(Q){let z=Q.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",z),this.comp.toggleCss("ag-pivot-off",!z)}onDisplayedColumnsChanged(Q){let J=Q.visibleCols.allCols.some((Z)=>Z.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",J)}onTabKeyDown(Q){let z=this.gos.get("enableRtl"),J=Q.shiftKey,Z=J!==z?"LEFT":"RIGHT",{beans:$}=this,{headerNavigation:X,focusSvc:Y}=$;if(X.navigateHorizontally(Z,!0,Q)||!J&&Y.focusOverlay(!1)||$Q($,J,!0))Q.preventDefault()}handleKeyDown(Q){let z=null,{headerNavigation:J}=this.beans;switch(Q.key){case V.LEFT:z="LEFT";case V.RIGHT:{if(!T(z))z="RIGHT";if(J.navigateHorizontally(z,!1,Q))Q.preventDefault();break}case V.UP:z="UP";case V.DOWN:{if(!T(z))z="DOWN";if(J.navigateVertically(z,Q))Q.preventDefault();break}default:return}}onFocusOut(Q){let{relatedTarget:z}=Q,{eGui:J,beans:Z}=this;if(!z&&J.contains(d(Z)))return;if(!J.contains(z))Z.focusSvc.focusedHeader=null}onHeaderContextMenu(Q,z,J){let{menuSvc:Z,ctrlsSvc:$}=this.beans;if(!Q&&!J||!Z?.isHeaderContextMenuEnabled())return;let{target:X}=Q??z;if(X===this.eGui||X===$.getHeaderRowContainerCtrl()?.eViewport)Z.showHeaderContextMenu(void 0,Q,J)}},Z6=class extends x{constructor(Q,z){super(Q);this.ctrl=z}getCtrl(){return this.ctrl}},DH={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},MH=class extends Z6{constructor(Q){super(DH,Q);this.eResize=S,this.eHeaderCompWrapper=S,this.headerCompVersion=0}postConstruct(){let Q=this.getGui(),z=()=>{let Z=this.ctrl.getSelectAllGui();if(Z)this.eResize.insertAdjacentElement("afterend",Z),this.addDestroyFunc(()=>Z.remove())},J={setWidth:(Z)=>Q.style.width=Z,toggleCss:(Z,$)=>this.toggleCss(Z,$),setUserStyles:(Z)=>$J(Q,Z),setAriaSort:(Z)=>Z?r4(Q,Z):s4(Q),setUserCompDetails:(Z)=>this.setUserCompDetails(Z),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:z,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(J,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),z()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){if(this.headerComp)this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0}setUserCompDetails(Q){this.headerCompVersion++;let z=this.headerCompVersion;Q.newAgStackInstance().then((J)=>this.afterCompCreated(z,J))}afterCompCreated(Q,z){if(Q!=this.headerCompVersion||!this.isAlive()){this.destroyBean(z);return}this.destroyHeaderComp(),this.headerComp=z,this.headerCompGui=z.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},kH={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},VH=class extends Z6{constructor(Q){super(kH,Q);this.eResize=S,this.eHeaderCompWrapper=S}postConstruct(){let Q=this.getGui(),z=(Z,$)=>$!=null?Q.setAttribute(Z,$):Q.removeAttribute(Z),J={toggleCss:(Z,$)=>this.toggleCss(Z,$),setUserStyles:(Z)=>$J(Q,Z),setHeaderWrapperHidden:(Z)=>{if(Z)this.eHeaderCompWrapper.style.setProperty("display","none");else this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:(Z)=>{if(Z!=null)this.eHeaderCompWrapper.style.setProperty("max-height",`${Z}px`);else this.eHeaderCompWrapper.style.removeProperty("max-height");this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",Z!=null)},setResizableDisplayed:(Z)=>N(this.eResize,Z),setWidth:(Z)=>Q.style.width=Z,setAriaExpanded:(Z)=>z("aria-expanded",Z),setUserCompDetails:(Z)=>this.setUserCompDetails(Z),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(J,Q,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(Q){Q.newAgStackInstance().then((z)=>this.afterHeaderCompCreated(z))}afterHeaderCompCreated(Q){let z=()=>this.destroyBean(Q);if(!this.isAlive()){z();return}let J=this.getGui(),Z=Q.getGui();this.eHeaderCompWrapper.appendChild(Z),this.addDestroyFunc(z),this.headerGroupComp=Q,this.ctrl.setDragSource(J)}},fH={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},AH=class extends Z6{constructor(Q){super(fH,Q);this.eFloatingFilterBody=S,this.eButtonWrapper=S,this.eButtonShowMainFilter=S}postConstruct(){let Q=this.getGui(),z={toggleCss:(J,Z)=>this.toggleCss(J,Z),setUserStyles:(J)=>$J(Q,J),addOrRemoveBodyCssClass:(J,Z)=>this.eFloatingFilterBody.classList.toggle(J,Z),setButtonWrapperDisplayed:(J)=>N(this.eButtonWrapper,J),setCompDetails:(J)=>this.setCompDetails(J),getFloatingFilterComp:()=>this.compPromise,setWidth:(J)=>Q.style.width=J,setMenuIcon:(J)=>this.eButtonShowMainFilter.appendChild(J)};this.ctrl.setComp(z,Q,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(Q){if(!Q){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=Q.newAgStackInstance(),this.compPromise.then((z)=>this.afterCompCreated(z))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(Q){if(!Q)return;if(!this.isAlive()){this.destroyBean(Q);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=Q,this.eFloatingFilterBody.appendChild(Q.getGui()),Q.afterGuiAttached?.()}},jH=class extends x{constructor(Q){super({tag:"div",cls:Q.headerRowClass,role:"row"});this.ctrl=Q,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),eJ(this.getGui(),this.ctrl.getAriaRowIndex());let z={setHeight:(J)=>this.getGui().style.height=J,setTop:(J)=>this.getGui().style.top=J,setHeaderCtrls:(J,Z)=>this.setHeaderCtrls(J,Z),setWidth:(J)=>this.getGui().style.width=J,setRowIndex:(J)=>eJ(this.getGui(),J)};this.ctrl.setComp(z,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(Q,z){if(!this.isAlive())return;let J=this.headerComps;this.headerComps={};for(let Z of Q){let $=Z.instanceId,X=J[$];if(delete J[$],X==null)X=this.createHeaderComp(Z),this.getGui().appendChild(X.getGui());this.headerComps[$]=X}if(Object.values(J).forEach((Z)=>{Z.getGui().remove(),this.destroyBean(Z)}),z){let Z=Object.values(this.headerComps);Z.sort((X,Y)=>{let G=X.getCtrl().column.getLeft(),q=Y.getCtrl().column.getLeft();return G-q});let $=Z.map((X)=>X.getGui());u8(this.getGui(),$)}}createHeaderComp(Q){let z;switch(this.ctrl.type){case"group":z=new VH(Q);break;case"filter":z=new AH(Q);break;default:z=new MH(Q);break}return this.createBean(z),z.setParentComponent(this),z}},$6=class extends j{constructor(Q,z=!1){super();this.callback=Q,this.addSpacer=z}postConstruct(){let Q=this.setWidth.bind(this);if(this.addManagedPropertyListener("domLayout",Q),this.addManagedEventListeners({columnContainerWidthChanged:Q,displayedColumnsChanged:Q,leftPinnedWidthChanged:Q}),this.addSpacer)this.addManagedEventListeners({rightPinnedWidthChanged:Q,scrollVisibilityChanged:Q,scrollbarWidthChanged:Q});this.setWidth()}setWidth(){let Q=V0(this.gos,"print"),{visibleCols:z,scrollVisibleSvc:J}=this.beans,Z=z.bodyWidth,$=z.getColsLeftWidth(),X=z.getDisplayedColumnsRightWidth(),Y;if(Q)Y=Z+$+X;else if(Y=Z,this.addSpacer){if((this.gos.get("enableRtl")?$:X)===0&&J.verticalScrollShowing)Y+=J.getScrollbarWidth()}this.callback(Y)}};function BJ(Q,z,J){if(J)Q.addDestroyFunc(()=>z.destroyBean(J));return J??Q}var X6=class extends j{constructor(Q,z,J,Z){super();this.columnOrGroup=Q,this.eCell=z,this.colsSpanning=Z,this.columnOrGroup=Q,this.ariaEl=z.querySelector("[role=columnheader]")||z,this.beans=J}setColsSpanning(Q){this.colsSpanning=Q,this.onLeftChanged()}getColumnOrGroup(){let{beans:Q,colsSpanning:z}=this;if(Q.gos.get("enableRtl")&&z)return b(z);return this.columnOrGroup}postConstruct(){let Q=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:Q}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:Q}),this.addManagedPropertyListener("domLayout",Q)}setLeftFirstTime(){let{gos:Q,colAnimation:z}=this.beans,J=Q.get("suppressColumnMoveAnimation"),Z=T(this.columnOrGroup.getOldLeft());if(z?.isActive()&&Z&&!J)this.animateInLeft();else this.onLeftChanged()}animateInLeft(){let Q=this.getColumnOrGroup(),z=this.modifyLeftForPrintLayout(Q,Q.getOldLeft()),J=this.modifyLeftForPrintLayout(Q,Q.getLeft());this.setLeft(z),this.actualLeft=J,this.beans.colAnimation.executeNextVMTurn(()=>{if(this.actualLeft===J)this.setLeft(J)})}onLeftChanged(){let Q=this.getColumnOrGroup(),z=Q.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(Q,z),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(Q,z){let{gos:J,visibleCols:Z}=this.beans;if(!V0(J,"print"))return z;if(Q.getPinned()==="left")return z;let X=Z.getColsLeftWidth();if(Q.getPinned()==="right"){let Y=Z.bodyWidth;return X+Y+z}return X+z}setLeft(Q){if(T(Q))this.eCell.style.left=`${Q}px`;if(_0(this.columnOrGroup)){let z=this.columnOrGroup.getLeafColumns();if(!z.length)return;if(z.length>1)t4(this.ariaEl,z.length)}}},RH="ag-column-first",SH="ag-column-last";function gZ(Q,z,J,Z){if(n(Q))return[];return r9(Q.headerClass,Q,z,J,Z)}function hZ(Q,z,J,Z){if(n(Q))return[];return r9(Q.toolPanelClass,Q,z,J,Z)}function t9(Q,z,J){Q.toggleCss(RH,J.isColAtEdge(z,"first")),Q.toggleCss(SH,J.isColAtEdge(z,"last"))}function OH(Q,z,J,Z){return y(z,{colDef:Q,column:J,columnGroup:Z})}function r9(Q,z,J,Z,$){if(n(Q))return[];let X;if(typeof Q==="function"){let Y=OH(z,J,Z,$);X=Q(Y)}else X=Q;if(typeof X==="string")return[X];if(Array.isArray(X))return[...X];return[]}var PH=0,s9="headerCtrl",Y6=class extends j{constructor(Q,z){super();this.column=Q,this.rowCtrl=z,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=Q.getUniqueId()+"-"+PH++}postConstruct(){let Q=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],Q),this.addManagedEventListeners({overlayExclusiveChanged:Q})}setComp(Q,z,J,Z,$){if(z.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(Q,z,J,Z,$),this.reAttemptToFocus)this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0)}shouldStopEventPropagation(Q){let{headerRowIndex:z,column:J}=this.beans.focusSvc.focusedHeader,Z=J.getDefinition(),$=Z?.suppressHeaderKeyboardEvent;if(!T($))return!1;let X=y(this.gos,{colDef:Z,column:J,headerRowIndex:z,event:Q});return!!$(X)}getWrapperHasFocus(){return d(this.beans)===this.eGui}setGui(Q,z){this.eGui=Q,this.addDomData(z),z.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),z.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){let Q=this.column.getDefinition();if(!Q)return;let{headerStyle:z}=Q,J;if(typeof z==="function"){let Z=this.getHeaderClassParams();J=z(Z)}else J=z;if(J)this.comp.setUserStyles(J)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(Q){let{wrapperElement:z,checkMeasuringCallback:J,compBean:Z}=Q,{beans:$}=this,X=(U)=>{if(!this.isAlive()||!Z.isAlive())return;let{paddingTop:W,paddingBottom:B,borderBottomWidth:E,borderTopWidth:K}=M1(this.eGui),L=W+B+E+K,D=z.offsetHeight+L;if(U<5){let k=!Y0($)?.contains(z),f=D==0;if(k||f){e2(()=>X(U+1),"raf",$);return}}this.setColHeaderHeight(this.column,D)},Y=!1,G,q=()=>{let U=this.column.isAutoHeaderHeight();if(U&&!Y)H();if(!U&&Y)_()},H=()=>{Y=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),X(0),G=DQ(this.beans,z,()=>X(0))},_=()=>{if(Y=!1,G)G();this.comp.toggleCss("ag-header-cell-auto-height",!1),G=void 0};if(q(),Z.addDestroyFunc(()=>_()),Z.addManagedListeners(this.column,{widthChanged:()=>Y&&X(0)}),Z.addManagedEventListeners({sortChanged:()=>{if(Y)window.setTimeout(()=>X(0))}}),J)J(q)}onDisplayedColumnsChanged(){let{comp:Q,column:z,beans:J,eGui:Z}=this;if(!Q||!z||!Z)return;t9(Q,z,J.visibleCols),v8(Z,J.visibleCols.getAriaColIndex(z))}addResizeAndMoveKeyboardListeners(Q){Q.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){let Q=_Q(this.beans);if(this.eGui)Pz(this.eGui,"tabindex",Q?null:"-1")}onGuiKeyDown(Q){let z=d(this.beans),J=Q.key===V.LEFT||Q.key===V.RIGHT;if(this.isResizing)Q.preventDefault(),Q.stopImmediatePropagation();if(z!==this.eGui||!Q.shiftKey&&!Q.altKey&&!Q.ctrlKey&&!Q.metaKey)return;if(this.isResizing||J)Q.preventDefault(),Q.stopImmediatePropagation();if((Q.ctrlKey||Q.metaKey)&&R9(Q)===V.C)return this.beans.clipboardSvc?.copyToClipboard();if(!J)return;let X=Q.key===V.LEFT!==this.gos.get("enableRtl")?"left":"right";if(Q.altKey){this.isResizing=!0,this.resizeMultiplier+=1;let Y=this.getViewportAdjustedResizeDiff(Q);this.resizeHeader(Y,Q.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(X)}moveHeader(Q){this.beans.colMoves?.moveHeader(Q,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(Q){let z=this.getResizeDiff(Q),{pinnedCols:J}=this.beans;return J?J.getHeaderResizeDiff(z,this.column):z}getResizeDiff(Q){let{gos:z,column:J}=this,Z=Q.key===V.LEFT!==z.get("enableRtl"),$=J.getPinned(),X=z.get("enableRtl");if($){if(X!==($==="right"))Z=!Z}return(Z?-1:1)*this.resizeMultiplier}onGuiKeyUp(){if(!this.isResizing)return;if(this.resizeToggleTimeout)window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0;this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150)}handleKeyDown(Q){let z=this.getWrapperHasFocus();switch(Q.key){case V.PAGE_DOWN:case V.PAGE_UP:case V.PAGE_HOME:case V.PAGE_END:if(z)Q.preventDefault()}}addDomData(Q){let z=s9,{eGui:J,gos:Z}=this;wz(Z,J,z,this),Q.addDestroyFunc(()=>wz(Z,J,z,null))}focus(Q){if(!this.isAlive())return!1;let{eGui:z}=this;if(!z)this.reAttemptToFocus=!0;else this.lastFocusEvent=Q||null,z.focus();return!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){if(this.dragSource)this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null}handleContextMenuMouseEvent(Q,z,J){let Z=Q??z,{menuSvc:$,gos:X}=this.beans;if(X.get("preventDefaultOnContextMenu"))Z.preventDefault();if($?.isHeaderContextMenuEnabled(J))$.showHeaderContextMenu(J,Q,z);this.dispatchColumnMouseEvent("columnHeaderContextMenu",J)}dispatchColumnMouseEvent(Q,z){this.eventSvc.dispatchEvent({type:Q,column:z})}setColHeaderHeight(Q,z){if(!Q.setAutoHeaderHeight(z))return;let{eventSvc:J}=this;if(Q.isColumn)J.dispatchEvent({type:"columnHeaderHeightChanged",column:Q,columns:[Q],source:"autosizeColumnHeaderHeight"});else J.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:Q,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},TH=class extends Y6{constructor(){super(...arguments);this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(Q,z,J,Z,$){this.comp=Q;let{rowCtrl:X,column:Y,beans:G}=this,{colResize:q,context:H,colHover:_,rangeSvc:U}=G,W=BJ(this,H,$);if(this.setGui(z,W),this.updateState(),this.setupWidth(W),this.setupMovingCss(W),this.setupMenuClass(W),this.setupSortableClass(W),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:Z,checkMeasuringCallback:(E)=>this.setRefreshFunction("measuring",E),compBean:W}),this.addColumnHoverListener(W),this.setupFilterClass(W),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(W),this.setupSelectAll(W),this.setupUserComp(),this.refreshAria(),q)this.resizeFeature=W.createManagedBean(q.createResizeFeature(X.pinned,Y,J,Q,this));else N(J,!1);_?.createHoverFeature(W,[Y],z),U?.createRangeHighlightFeature(W,Y,Q),W.createManagedBean(new X6(Y,z,G)),W.createManagedBean(new cQ(z,{shouldStopEventPropagation:(E)=>this.shouldStopEventPropagation(E),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(W),W.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),W.addManagedListeners(Y,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});let B=()=>this.checkDisplayName();W.addManagedEventListeners({columnValueChanged:B,columnRowGroupChanged:B,columnPivotChanged:B,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),W.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(Q,z){this.beans.colResize?.resizeHeader(this.column,Q,z)}getHeaderClassParams(){let{column:Q,beans:z}=this,J=Q.colDef;return y(z.gos,{colDef:J,column:Q,floatingFilter:!1})}setupUserComp(){let Q=this.lookupUserCompDetails();if(Q)this.setCompDetails(Q)}setCompDetails(Q){this.userCompDetails=Q,this.comp.setUserCompDetails(Q)}lookupUserCompDetails(){let Q=this.createParams(),z=this.column.getColDef();return Tq(this.beans.userCompFactory,z,Q)}createParams(){let{menuSvc:Q,sortSvc:z,colFilter:J,gos:Z}=this.beans;return y(Z,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!Q?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!J&&(!this.openFilterEnabled||U0(this.gos)),showColumnMenu:(X,Y)=>{Q?.showColumnMenu({column:this.column,buttonElement:X,positionBy:"button",onClosedCallback:Y})},showColumnMenuAfterMouseClick:(X,Y)=>{Q?.showColumnMenu({column:this.column,mouseEvent:X,positionBy:"mouse",onClosedCallback:Y})},showFilter:(X)=>{Q?.showFilterMenu({column:this.column,buttonElement:X,containerType:"columnFilter",positionBy:"button"})},progressSort:(X)=>{z?.progressSort(this.column,!!X,"uiColumnSorted")},setSort:(X,Y)=>{z?.setSortForColumn(this.column,a0(X),!!Y,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(X,Y)=>{Z.assertModuleRegistered("Tooltip",3),this.setupTooltip(X,Y)}})}setupSelectAll(Q){let{selectionSvc:z}=this.beans;if(!z)return;this.selectAllFeature=Q.createOptionalManagedBean(z.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),Q.addManagedPropertyListener("rowSelection",()=>{let J=z.createSelectAllFeature(this.column);if(J&&!this.selectAllFeature)this.selectAllFeature=Q.createManagedBean(J),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui();else if(this.selectAllFeature&&!J)this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature)})}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(Q){if(super.handleKeyDown(Q),Q.key===V.SPACE)this.selectAllFeature?.onSpaceKeyDown(Q);else if(Q.key===V.ENTER)this.onEnterKeyDown(Q);else if(Q.key===V.DOWN&&Q.altKey)this.showMenuOnKeyPress(Q,!1)}onEnterKeyDown(Q){let{column:z,gos:J,sortable:Z,beans:$}=this,X=!1;if(Q.ctrlKey||Q.metaKey)X=this.showMenuOnKeyPress(Q,!0);if(!X){if(!Q.altKey&&Zz(J))$.rangeSvc?.handleColumnSelection(z,Q);else if(Z)$.sortSvc?.progressSort(z,Q.shiftKey,"uiColumnSorted")}}showMenuOnKeyPress(Q,z){let J=this.comp.getUserCompInstance();if(!A7(J))return!1;if(J.onMenuKeyboardShortcut(z))return Q.preventDefault(),!0;return!1}onFocusIn(Q){if(!this.eGui.contains(Q.relatedTarget))this.focusThis(),this.announceAriaDescription();if(V1())this.setActiveHeader(!0)}onFocusOut(Q){if(this.eGui.contains(Q.relatedTarget))return;this.setActiveHeader(!1)}setupTooltip(Q,z){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,Q,z)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){let Q=()=>{let z=this.column.getColDef(),J=gZ(z,this.gos,this.column,null),Z=this.userHeaderClasses;this.userHeaderClasses=new Set(J);for(let $ of J)if(Z.has($))Z.delete($);else this.comp.toggleCss($,!0);for(let $ of Z)this.comp.toggleCss($,!1)};this.setRefreshFunction("headerClasses",Q),Q()}setDragSource(Q){if(this.dragSourceElement=Q,this.removeDragSource(),!Q||!this.draggable)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(Q,this.column,this.displayName)??null}updateState(){let{menuSvc:Q}=this.beans;this.menuEnabled=!!Q?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!Q?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(Q,z){this.refreshFunctions[Q]=z}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(let Q of Object.values(this.refreshFunctions))Q()}refreshHeaderComp(){let Q=this.lookupUserCompDetails();if(!Q)return;if(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==Q.componentClass?this.attemptHeaderCompRefresh(Q.params):!1)this.setDragSource(this.dragSourceElement);else this.setCompDetails(Q)}attemptHeaderCompRefresh(Q){let z=this.comp.getUserCompInstance();if(!z)return!1;if(!z.refresh)return!1;return z.refresh(Q)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){if(this.displayName!==this.calculateDisplayName())this.refresh()}workOutDraggable(){let Q=this.column.getColDef();return!this.gos.get("suppressMovableColumns")&&!Q.suppressMovable&&!Q.lockPosition||!!Q.enableRowGroup||!!Q.enablePivot}setupWidth(Q){let z=()=>{let J=this.column.getActualWidth();this.comp.setWidth(`${J}px`)};Q.addManagedListeners(this.column,{widthChanged:z}),z()}setupMovingCss(Q){let z=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};Q.addManagedListeners(this.column,{movingChanged:z}),z()}setupMenuClass(Q){let z=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};Q.addManagedListeners(this.column,{menuVisibleChanged:z}),z()}setupSortableClass(Q){let z=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};z(),this.setRefreshFunction("updateSortable",z),Q.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(Q){let z=()=>{let J=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",J),this.refreshAria()};Q.addManagedListeners(this.column,{filterActiveChanged:z}),z()}setupWrapTextClass(){let Q=()=>{let z=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",z)};Q(),this.setRefreshFunction("wrapText",Q)}onHeaderHighlightChanged(){let Q=this.column.getHighlighted(),z=Q===0,J=Q===1;this.comp.toggleCss("ag-header-highlight-before",z),this.comp.toggleCss("ag-header-highlight-after",J)}onDisplayedColumnsChanged(){if(super.onDisplayedColumnsChanged(),!this.isAlive())return;this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){let{eGui:Q,column:z,comp:J,beans:Z}=this,$=z6(this.beans),X=$.reduce((W,B)=>W+B,0)===0;if(J.toggleCss("ag-header-parent-hidden",X),!z.isSpanHeaderHeight()){Q.style.removeProperty("top"),Q.style.removeProperty("height"),J.toggleCss("ag-header-span-height",!1),J.toggleCss("ag-header-span-total",!1);return}let{numberOfParents:Y,isSpanningTotal:G}=this.column.getColumnGroupPaddingInfo();J.toggleCss("ag-header-span-height",Y>0);let q=J6(Z);if(Y===0){J.toggleCss("ag-header-span-total",!1),Q.style.setProperty("top","0px"),Q.style.setProperty("height",`${q}px`);return}J.toggleCss("ag-header-span-total",G);let H=(this.column.getFirstRealParent()?.getLevel()??-1)+1,_=$.length-H,U=0;for(let W=0;W<_;W++)U+=$[$.length-1-W];Q.style.setProperty("top",`${-U}px`),Q.style.setProperty("height",`${q+U}px`)}refreshAriaSort(){let Q=null,{beans:z,column:J,comp:Z,sortable:$}=this;if($){let X=this.getLocaleTextFunc(),Y=z.sortSvc?.getDisplaySortForColumn(J)??null;Z.setAriaSort(u4(Y)),Q=X("ariaSortableColumn","Press ENTER to sort")}else Z.setAriaSort();this.setAriaDescriptionProperty("sort",Q)}refreshAriaMenu(){let Q=null;if(this.menuEnabled)Q=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu");this.setAriaDescriptionProperty("menu",Q)}refreshAriaFilterButton(){let Q=null,{openFilterEnabled:z,gos:J}=this;if(z&&!U0(J))Q=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter");this.setAriaDescriptionProperty("filterButton",Q)}refreshAriaFiltered(){let Q=null;if(this.column.isFilterActive())Q=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered");this.setAriaDescriptionProperty("filter",Q)}refreshAriaCellSelection(){let Q=null,{gos:z,column:J}=this;if(Zz(z)&&!v0(J))Q=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column");this.setAriaDescriptionProperty("cellSelection",Q)}setAriaDescriptionProperty(Q,z){let J=this.ariaDescriptionProperties;if(z!=null)J.set(Q,z);else J.delete(Q)}announceAriaDescription(){let{beans:Q,eGui:z,ariaDescriptionProperties:J}=this;if(!z.contains(d(Q)))return;let Z=Array.from(J.keys()).sort(($,X)=>$==="filter"?-1:X.charCodeAt(0)-$.charCodeAt(0)).map(($)=>J.get($)).join(". ");Q.ariaAnnounce?.announceValue(Z,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(Q){this.beans.colHover?.addHeaderColumnHoverListener(Q,this.comp,this.column)}addActiveHeaderMouseListeners(Q){let z=($)=>this.handleMouseOverChange($.type==="mouseenter"),J=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},Z=($)=>this.handleContextMenuMouseEvent($,void 0,this.column);Q.addManagedListeners(this.eGui,{mouseenter:z,mouseleave:z,click:J,contextmenu:Z})}handleMouseOverChange(Q){this.setActiveHeader(Q),this.eventSvc.dispatchEvent({type:Q?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(Q){this.comp.toggleCss("ag-header-active",Q)}getAnchorElementForMenu(Q){let z=this.comp.getUserCompInstance();if(A7(z))return z.getAnchorElementForMenu(Q);return this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function A7(Q){return typeof Q?.getAnchorElementForMenu==="function"&&typeof Q.onMenuKeyboardShortcut==="function"}var vH=0,I2=class extends j{constructor(Q,z,J){super();this.rowIndex=Q,this.pinned=z,this.type=J,this.instanceId=vH++,this.comp=null,this.allCtrls=[];let Z="ag-header-row-column";if(J==="group")Z="ag-header-row-group";else if(J==="filter")Z="ag-header-row-filter";this.headerRowClass=`ag-header-row ${Z}`}setRowIndex(Q){this.rowIndex=Q,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=V0(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){if(!this.comp)return!1;return this.allCtrls.every((Q)=>Q.eGui!=null)}setComp(Q,z,J=!0){if(this.comp=Q,z=BJ(this,this.beans.context,z),J)this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged();this.setWidth(),this.addEventListeners(z)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(Q){let z=this.onRowHeightChanged.bind(this),J=this.onDisplayedColumnsChanged.bind(this);Q.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:J,virtualColumnsChanged:(Z)=>this.onVirtualColumnsChanged(Z.afterScroll),columnGroupHeaderHeightChanged:z,columnHeaderHeightChanged:z,stylesChanged:z,advancedFilterEnabledChanged:z}),Q.addManagedPropertyListener("domLayout",J),Q.addManagedPropertyListener("ensureDomOrder",(Z)=>this.isEnsureDomOrder=Z.currentValue),Q.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],z)}onDisplayedColumnsChanged(){this.isPrintLayout=V0(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;let Q=this.getWidthForRow();this.comp.setWidth(`${Q}px`)}getWidthForRow(){let{visibleCols:Q}=this.beans;if(this.isPrintLayout){if(this.pinned!=null)return 0;return Q.getContainerWidth("right")+Q.getContainerWidth("left")+Q.getContainerWidth(null)}return Q.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;let{topOffset:Q,rowHeight:z}=this.getTopAndHeight();this.comp.setTop(Q+"px"),this.comp.setHeight(z+"px")}getTopAndHeight(){let Q=0,z=z6(this.beans);for(let $=0;${let{focusSvc:$,visibleCols:X}=this.beans;if(!$.isHeaderWrapperFocused(Z))return!1;return X.isVisible(Z.column)};if(Q)for(let[Z,$]of Q)if(J($))this.ctrlsById.set(Z,$);else this.destroyBean($);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(Q,z,J){if(Q.isEmptyGroup())return;let Z=Q.getUniqueId(),$;if(J)$=J.get(Z),J.delete(Z);if($&&$.column!=Q)this.destroyBean($),$=void 0;if($==null)switch(this.type){case"filter":{$=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,Q,this));break}case"group":$=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,Q,this));break;default:$=this.createBean(new TH(Q,this));break}z.set(Z,$)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];let Q=[];for(let z of["left",null,"right"])Q.push(...this.getComponentsToRender(z));return Q}getComponentsToRender(Q=this.pinned){if(this.type==="group")return this.beans.colViewport.getHeadersToRender(Q,this.rowIndex);return this.beans.colViewport.getColumnHeadersToRender(Q)}focusHeader(Q,z){let J=this.allCtrls.find(($)=>$.column==Q);if(!J)return!1;return J.focus(z)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},IH=class extends j{constructor(Q){super();this.pinned=Q,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(Q,z){this.comp=Q,this.eViewport=z;let{pinnedCols:J,ctrlsSvc:Z,colModel:$,colMoves:X}=this.beans;this.setupCenterWidth(),J?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(X,this.eViewport);let Y=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:Y,advancedFilterEnabledChanged:Y});let G=`${typeof this.pinned==="string"?this.pinned:"center"}Header`;if(Z.register(G,this),$.ready)this.refresh()}getAllCtrls(){let Q=[...this.groupsRowCtrls];if(this.columnsRowCtrl)Q.push(this.columnsRowCtrl);if(this.filtersRowCtrl)Q.push(this.filtersRowCtrl);return Q}refresh(Q=!1){let{focusSvc:z,filterManager:J,visibleCols:Z}=this.beans,$=0,X=z.getFocusHeaderToUseAfterRefresh(),Y=()=>{let U=Z.headerGroupRowCount;if($=U,!Q)this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);let W=this.groupsRowCtrls.length;if(W===U)return;if(W>U){for(let B=U;B{let U=$++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}if(this.columnsRowCtrl==null||!Q)this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new I2(U,this.pinned,"column"));else if(this.columnsRowCtrl.rowIndex!==U)this.columnsRowCtrl.setRowIndex(U)},q=()=>{this.includeFloatingFilter=!!J?.hasFloatingFilters()&&!this.hidden;let U=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){U();return}if(!Q)U();let W=$++;if(this.filtersRowCtrl){if(this.filtersRowCtrl.rowIndex!==W)this.filtersRowCtrl.setRowIndex(W)}else this.filtersRowCtrl=this.createBean(new I2(W,this.pinned,"filter"))},H=this.getAllCtrls();Y(),G(),q();let _=this.getAllCtrls();if(this.comp.setCtrls(_),this.restoreFocusOnHeader(z,X),H.length!==_.length)this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(Q){let z=(J)=>J?.getHeaderCellCtrls().find((Z)=>Z.column===Q);if(JQ(Q))return z(this.columnsRowCtrl);if(this.groupsRowCtrls.length===0)return;for(let J=0;Jthis.comp.setCenterWidth(`${Q}px`),!0))}},CH={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},bH={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},yH={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},C2=class extends x{constructor(Q){super();this.eCenterContainer=S,this.headerRowComps={},this.rowCompsList=[],this.pinned=Q}postConstruct(){this.selectAndSetTemplate();let Q={setDisplayed:(J)=>this.setDisplayed(J),setCtrls:(J)=>this.setCtrls(J),setCenterWidth:(J)=>this.eCenterContainer.style.width=J,setViewportScrollLeft:(J)=>this.getGui().scrollLeft=J,setPinnedContainerWidth:(J)=>{let Z=this.getGui();Z.style.width=J,Z.style.maxWidth=J,Z.style.minWidth=J}};this.createManagedBean(new IH(this.pinned)).setComp(Q,this.getGui())}selectAndSetTemplate(){let Q=this.pinned=="left",z=this.pinned=="right",J=Q?CH:z?bH:yH;this.setTemplate(J),this.eRowContainer=this.eCenterContainer!==S?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(Q){this.destroyBean(Q),Q.getGui().remove()}setCtrls(Q){let z=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let J,Z=($)=>{let X=$.getGui();if(X.parentElement!=this.eRowContainer)this.eRowContainer.appendChild(X);if(J)h8(this.eRowContainer,X,J);J=X};for(let $ of Q){let X=$.instanceId,Y=z[X];delete z[X];let G=Y?Y:this.createBean(new jH($));this.headerRowComps[X]=G,this.rowCompsList.push(G),Z(G)}for(let $ of Object.values(z))this.destroyRowComp($)}},xH={tag:"div",cls:"ag-header",role:"presentation"},wH=class extends x{constructor(){super(xH)}postConstruct(){let Q={toggleCss:(Z,$)=>this.toggleCss(Z,$),setHeightAndMinHeight:(Z)=>{this.getGui().style.height=Z,this.getGui().style.minHeight=Z}};this.createManagedBean(new FH).setComp(Q,this.getGui(),this.getFocusableElement());let J=(Z)=>{this.createManagedBean(Z),this.appendChild(Z)};J(new C2("left")),J(new C2(null)),J(new C2("right"))}},NH={selector:"AG-HEADER-ROOT",component:wH},UQ={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},G6=class extends j{constructor(Q){super();this.view=Q}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){let Q=this.gos.get("domLayout"),z={autoHeight:Q==="autoHeight",normal:Q==="normal",print:Q==="print"},J=z.autoHeight?UQ.AUTO_HEIGHT:z.print?UQ.PRINT:UQ.NORMAL;this.view.updateLayoutClasses(J,z)}},l9=class extends x{constructor(Q,z){super();this.direction=z,this.eViewport=S,this.eContainer=S,this.hideTimeout=0,this.setTemplate(Q)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",C9()||bz())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.invisibleScrollbar=y9(),this.invisibleScrollbar)this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()}addActiveListenerToggles(){let Q=this.getGui(),z=()=>this.toggleCss("ag-scrollbar-active",!0),J=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(Q,{mouseenter:z,mousedown:z,touchstart:z,mouseleave:J,touchend:J})}onScrollVisibilityChanged(){if(this.invisibleScrollbar===void 0)this.initialiseInvisibleScrollbar();YQ(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:(Q)=>{if(Q.direction===this.direction){if(this.hideTimeout)window.clearTimeout(this.hideTimeout),this.hideTimeout=0;this.toggleCss("ag-scrollbar-scrolling",!0)}},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(Q){let z=this.eViewport;C5(this,()=>f0(z),()=>this.setScrollPosition(Q),100)}onScrollCallback(Q){this.addManagedElementListeners(this.eViewport,{scroll:Q})}},gH={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},hH=class extends l9{constructor(){super(gH,"horizontal");this.eLeftSpacer=S,this.eRightSpacer=S,this.setScrollVisibleDebounce=0}wireBeans(Q){this.visibleCols=Q.visibleCols,this.scrollVisibleSvc=Q.scrollVisibleSvc}postConstruct(){super.postConstruct();let Q=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:Q,displayedColumnsWidthChanged:Q,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",Q),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new $6((z)=>this.eContainer.style.width=`${z}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar)this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;let Q=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${Q}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){let Q=this.scrollVisibleSvc.verticalScrollShowing,z=this.visibleCols.getDisplayedColumnsRightWidth(),J=!this.enableRtl&&Q,Z=this.scrollVisibleSvc.getScrollbarWidth();if(J)z+=Z;SQ(this.eRightSpacer,z),this.eRightSpacer.classList.toggle("ag-scroller-corner",z<=Z);let $=this.visibleCols.getColsLeftWidth();if(this.enableRtl&&Q)$+=Z;SQ(this.eLeftSpacer,$),this.eLeftSpacer.classList.toggle("ag-scroller-corner",$<=Z)}setScrollVisible(){let Q=this.scrollVisibleSvc.horizontalScrollShowing,z=this.invisibleScrollbar,J=this.gos.get("suppressHorizontalScroll"),Z=Q?this.scrollVisibleSvc.getScrollbarWidth()||0:0,X=!J?Z===0&&z?16:Z:0,Y=()=>{if(this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",z),N1(this.getGui(),X),N1(this.eViewport,X),N1(this.eContainer,X),!X)this.eContainer.style.setProperty("min-height","1px");this.setVisible(Q,{skipAriaHidden:!0})};if(window.clearTimeout(this.setScrollVisibleDebounce),!Q)Y();else this.setScrollVisibleDebounce=window.setTimeout(Y,100)}getScrollPosition(){return QZ(this.eViewport,this.enableRtl)}setScrollPosition(Q){if(!f0(this.eViewport))this.attemptSettingScrollPosition(Q);zZ(this.eViewport,Q,this.enableRtl)}},uH={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:hH},a9=class extends j{constructor(Q,z){super();this.eContainer=Q,this.eViewport=z}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(Q){let z=Q.uiContainerHeight,J=z!=null?`${z}px`:"";if(this.eContainer.style.height=J,this.eViewport)this.eViewport.style.height=J}},mH={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},cH=class extends l9{constructor(){super(mH,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new a9(this.eContainer));let{ctrlsSvc:Q}=this.beans;Q.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,Q)})}setScrollVisible(){let{scrollVisibleSvc:Q}=this.beans,z=Q.verticalScrollShowing,J=this.invisibleScrollbar,Z=z?Q.getScrollbarWidth()||0:0,$=Z===0&&J?16:Z;this.toggleCss("ag-scrollbar-invisible",J),SQ(this.getGui(),$),SQ(this.eViewport,$),SQ(this.eContainer,$),this.setDisplayed(z,{skipAriaHidden:!0})}onRowContainerHeightChanged(Q){let J=Q.getGridBodyCtrl().eBodyViewport,Z=this.getScrollPosition(),$=J.scrollTop;if(Z!=$)this.setScrollPosition($,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(Q,z){if(!z&&!f0(this.eViewport))this.attemptSettingScrollPosition(Q);this.eViewport.scrollTop=Q}},pH={selector:"AG-FAKE-VERTICAL-SCROLL",component:cH};var rQ="Viewport",j7="fakeVScrollComp",b2=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],R7=100,y2=150,iH=class extends j{constructor(Q){super();this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=Q,this.resetLastHScrollDebounced=gQ(this,()=>this.lastScrollSource[1]=null,y2),this.resetLastVScrollDebounced=gQ(this,()=>this.lastScrollSource[0]=null,y2)}wireBeans(Q){this.ctrlsSvc=Q.ctrlsSvc,this.animationFrameSvc=Q.animationFrameSvc,this.visibleCols=Q.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");let Q=this.invalidateVerticalScroll.bind(this),z=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:Q,scrollGapChanged:z}),this.addManagedElementListeners(this.eBodyViewport,{scroll:Q}),this.ctrlsSvc.whenReady(this,(J)=>{this.centerRowsCtrl=J.center,this.fakeVScrollComp=J.fakeVScrollComp,this.fakeHScrollComp=J.fakeHScrollComp,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,rQ)});for(let Q of b2){let z=this.ctrlsSvc.get(Q);this.registerScrollPartner(z,this.onHScroll.bind(this,Q))}}addVerticalScrollListeners(){let Q=this.gos.get("debounceVerticalScrollbar"),z=Q?gQ(this,this.onVScroll.bind(this,rQ),R7):this.onVScroll.bind(this,rQ),J=Q?gQ(this,this.onVScroll.bind(this,j7),R7):this.onVScroll.bind(this,j7);this.addManagedElementListeners(this.eBodyViewport,{scroll:z}),this.registerScrollPartner(this.fakeVScrollComp,J)}registerScrollPartner(Q,z){Q.onScrollCallback(z)}onDisplayedColumnsWidthChanged(){if(this.enableRtl)this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(Q){if(this.centerRowsCtrl==null)return;if(Q===void 0)Q=this.centerRowsCtrl.getCenterViewportScrollLeft();this.setScrollLeftForAllContainersExceptCurrent(Math.abs(Q))}setScrollLeftForAllContainersExceptCurrent(Q){for(let z of[...b2,rQ]){if(this.lastScrollSource[1]===z)continue;let J=this.getViewportForSource(z);zZ(J,Q,this.enableRtl)}}getViewportForSource(Q){if(Q===rQ)return this.centerRowsCtrl.eViewport;return this.ctrlsSvc.get(Q).eViewport}isControllingScroll(Q,z){if(this.lastScrollSource[z]==null){if(z===0)this.lastScrollSource[0]=Q;else this.lastScrollSource[1]=Q;return!0}return this.lastScrollSource[z]===Q}onHScroll(Q){if(!this.isControllingScroll(Q,1))return;let z=this.centerRowsCtrl.eViewport,{scrollLeft:J}=z;if(this.shouldBlockScrollUpdate(1,J,!0))return;let Z=QZ(this.getViewportForSource(Q),this.enableRtl);this.doHorizontalScroll(Z),this.resetLastHScrollDebounced()}onVScroll(Q){if(!this.isControllingScroll(Q,0))return;let z=Q===rQ?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition(),J=z;if(this.shouldBlockScrollUpdate(0,J,!0))return;if(Q===rQ)this.fakeVScrollComp.setScrollPosition(J);else if(this.eBodyViewport.scrollTop=z,J=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),J!==z)this.fakeVScrollComp.setScrollPosition(J,!0);let{animationFrameSvc:Z}=this;if(Z?.setScrollTop(J),this.nextScrollTop=J,Z?.active)Z.schedule();else this.scrollGridIfNeeded(!0);this.resetLastVScrollDebounced()}doHorizontalScroll(Q){let z=this.fakeHScrollComp.getScrollPosition();if(this.scrollLeft===Q&&Q===z)return;this.scrollLeft=Q,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(Q),this.centerRowsCtrl.onHorizontalViewportChanged(!0)}isScrolling(){return this.isScrollActive}fireScrollEvent(Q){let z={type:"bodyScroll",direction:Q===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(z),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...z,type:"bodyScrollEnd"})},y2)}shouldBlockScrollUpdate(Q,z,J=!1){if(J&&!bz())return!1;if(Q===0)return this.shouldBlockVerticalScroll(z);return this.shouldBlockHorizontalScroll(z)}shouldBlockVerticalScroll(Q){let z=AZ(this.eBodyViewport),{scrollHeight:J}=this.eBodyViewport;return Q<0||Q+z>J}shouldBlockHorizontalScroll(Q){let z=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:J}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(Q>0)return!0}else if(Q<0)return!0;return Math.abs(Q)+z>J}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){let Q=this.scrollLeft,z=!1;for(let J of b2)if(this.getViewportForSource(J).scrollLeft!==Q){z=!0;break}if(z)this.onHScroll(rQ)}scrollGridIfNeeded(Q=!1){let z=this.scrollTop!=this.nextScrollTop;if(z){if(this.scrollTop=this.nextScrollTop,Q)this.invalidateVerticalScroll();this.redrawRowsAfterScroll()}return z}setHorizontalScrollPosition(Q,z=!1){let Z=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();if(!z&&this.shouldBlockScrollUpdate(1,Q))if(this.enableRtl)Q=Q>0?0:Z;else Q=Math.min(Math.max(Q,0),Z);zZ(this.centerRowsCtrl.eViewport,Math.abs(Q),this.enableRtl),this.doHorizontalScroll(Q)}setVerticalScrollPosition(Q){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=Q}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){let{lastOffsetHeight:J,lastScrollTop:Z}=this;return{top:Z,bottom:Z+J}}this.isVerticalPositionInvalidated=!1;let{scrollTop:Q,offsetHeight:z}=this.eBodyViewport;return this.lastScrollTop=Q,this.lastOffsetHeight=z,{top:Q,bottom:Q+z}}getApproximateVScollPosition(){if(this.lastScrollTop>=0&&this.lastOffsetHeight>=0)return{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight};return this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){if(this.isHorizontalPositionInvalidated)this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1;return this.lastIsHorizontalScrollShowing}scrollHorizontally(Q){let z=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(z+Q),this.centerRowsCtrl.eViewport.scrollLeft-z}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(Q,z=null){let{rowModel:J}=this.beans,Z=J.getRowCount(),$=-1;for(let X=0;X=0)this.ensureIndexVisible($,z)}ensureIndexVisible(Q,z,J=0){if(V0(this.gos,"print"))return;let{rowModel:Z}=this.beans,$=Z.getRowCount();if(typeof Q!=="number"||Q<0||Q>=$){R(88,{index:Q});return}this.clearRetryListeners();let{frameworkOverrides:X,pageBounds:Y,rowContainerHeight:G,rowRenderer:q}=this.beans;X.wrapIncoming(()=>{let H=this.ctrlsSvc.getGridBodyCtrl(),_=Z.getRow(Q),U,W,B=0;this.invalidateVerticalScroll();do{let{stickyTopHeight:E,stickyBottomHeight:K}=H,L=_.rowTop,F=_.rowHeight,D=Y.getPixelOffset(),M=_.rowTop-D,k=M+_.rowHeight,f=this.getVScrollPosition(),A=G.divStretchOffset,O=f.top+A,v=f.bottom+A,I=v-O,C=G.getScrollPositionForPixel(M),m=G.getScrollPositionForPixel(k-I),w=Math.min((C+m)/2,M),a=O+E>M,t=v-KI)u=C-E;else u=m+K;if(u!==null)this.setVerticalScrollPosition(u),q.redraw({afterScroll:!0});U=L!==_.rowTop||F!==_.rowHeight,W=E!==H.stickyTopHeight||K!==H.stickyBottomHeight,B++}while((U||W)&&B<10);if(this.animationFrameSvc?.flushAllFrames(),J<10&&(_?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){let E=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{let K=this.getVScrollPosition().top;if(E===K)return;this.clearRetryListeners()},modelUpdated:()=>{if(this.clearRetryListeners(),Q>=Z.getRowCount())return;this.ensureIndexVisible(Q,z,J+1)}})}})}clearRetryListeners(){for(let Q of this.clearRetryListenerFncs)Q();this.clearRetryListenerFncs=[]}ensureColumnVisible(Q,z="auto"){let{colModel:J,frameworkOverrides:Z}=this.beans,$=J.getCol(Q);if(!$)return;if($.isPinned())return;if(!this.visibleCols.isColDisplayed($))return;let X=this.getPositionedHorizontalScroll($,z);Z.wrapIncoming(()=>{if(X!==null)this.centerRowsCtrl.setCenterViewportScrollLeft(X);this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(Q,z){let{columnBeforeStart:J,columnAfterEnd:Z}=this.isColumnOutsideViewport(Q),$=this.centerRowsCtrl.getCenterWidth()$:J<$,G=X?JZ;return{columnBeforeStart:Y,columnAfterEnd:G}}getColumnBounds(Q){let z=this.enableRtl,J=this.visibleCols.bodyWidth,Z=Q.getActualWidth(),$=Q.getLeft(),X=z?-1:1,Y=z?J-$:$,G=Y+Z*X,q=Y+Z/2*X;return{colLeft:Y,colMiddle:q,colRight:G}}getViewportBounds(){let Q=this.centerRowsCtrl.getCenterWidth(),z=this.centerRowsCtrl.getCenterViewportScrollLeft(),J=z,Z=Q+z;return{start:J,end:Z,width:Q}}},S7={horizontal:{overflow:(Q)=>Q.scrollWidth-Q.clientWidth,scrollSize:(Q)=>Q.scrollWidth,clientSize:(Q)=>Q.clientWidth,opposite:"vertical"},vertical:{overflow:(Q)=>Q.scrollHeight-Q.clientHeight,scrollSize:(Q)=>Q.scrollHeight,clientSize:(Q)=>Q.clientHeight,opposite:"horizontal"}};function nH(Q,z,J=s5()||0,Z,$){return o9(Q,z,"horizontal",J,Z,$)}function dH(Q,z,J=s5()||0,Z,$){return o9(Q,z,"vertical",J,Z,$)}function o9(Q,z,J,Z,$,X){let Y=S7[J],G=S7[Y.opposite],q=$?f0($):!0,H=X?f0(X):!0,_=Y.overflow(Q);if(_<=0)return!1;if(!z||Z===0)return!0;let U=G.overflow(z);if(U<=0)return!0;if(_<=Z){if(q&&H&&tH({candidateOverflow:U,candidateScrollSize:G.scrollSize(z),candidateClientSize:G.clientSize(z),scrollbarWidth:Z}))return!1;let W=Y.clientSize(Q)+Z;return Y.scrollSize(Q)<=W}return!0}function tH({candidateOverflow:Q,candidateScrollSize:z,candidateClientSize:J,scrollbarWidth:Z}){if(Q<=0||Q>Z)return!1;let $=J+Z;return z>J&&z<=$}var rH=class extends j{constructor(Q){super();this.centerContainerCtrl=Q}wireBeans(Q){this.scrollVisibleSvc=Q.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(Q)=>{this.gridBodyCtrl=Q.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){let{beans:Q,centerContainerCtrl:z,gridBodyCtrl:J}=this,Z=()=>{YQ(Q,()=>{this.onCenterViewportResized()})};z.registerViewportResizeListener(Z),J.registerBodyViewportResizeListener(Z)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){let{pinnedCols:Q,colFlex:z}=this.beans;Q?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();let J=this.centerContainerCtrl.getCenterWidth();if(J!==this.centerWidth)this.centerWidth=J,z?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0})}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){let Q=this.gridBodyCtrl.eBodyViewport,z=AZ(Q);if(this.bodyHeight!==z)this.bodyHeight=z,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"})}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;let Q={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(Q)}onHorizontalViewportChanged(){let{centerContainerCtrl:Q,beans:z}=this,J=Q.getCenterWidth(),Z=Q.getViewportScrollLeft();z.colViewport.setScrollPosition(J,Z)}};function e9(Q){if(Q.altKey||Q.ctrlKey||Q.metaKey)return!1;return Q.key?.length===1}function rJ(Q,z,J,Z){let $=z.getColDef().cellRendererParams?.suppressMouseEventHandling;return Q$(Q,z,J,Z,$)}function sH(Q,z,J,Z){let $=z?.suppressMouseEventHandling;return Q$(Q,void 0,J,Z,$)}function Q$(Q,z,J,Z,$){if(!$)return!1;return $(y(Q,{column:z,node:J,event:Z}))}function z$(Q,z,J){let Z=z;while(Z){let $=Y9(Q,Z,J);if($)return $;Z=Z.parentElement}return null}var HZ="cellCtrl";function EJ(Q,z){return z$(Q,z,HZ)}var _Z="renderedRow";function q6(Q,z){return z$(Q,z,_Z)}function _5(Q,z,J,Z,$){let X=Z?Z.getColDef().suppressKeyboardEvent:void 0;if(!X)return!1;let Y=y(Q,{event:z,editing:$,column:Z,node:J,data:J.data,colDef:Z.getColDef()});if(X){if(X(Y))return!0}return!1}function lH(Q){let{pinnedRowModel:z,rowModel:J,rangeSvc:Z,visibleCols:$}=Q;if(!Z||$.allCols.length===0)return;let X=z?.isEmpty("top")??!0,Y=z?.isEmpty("bottom")??!0,G=X?null:"top",q,H;if(Y)q=null,H=J.getRowCount()-1;else q="bottom",H=z?.getPinnedBottomRowCount()??-1;Z.setCellRange({rowStartIndex:0,rowStartPinned:G,rowEndIndex:H,rowEndPinned:q})}var aH=class extends j{constructor(Q){super();this.element=Q}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){let z=this.processKeyboardEvent.bind(this,"keydown");this.addManagedElementListeners(this.element,{["keydown"]:z})}addMouseListeners(){let Q="mousedown";if(a2("pointerdown"))Q="pointerdown";else if(a2("touchstart"))Q="touchstart";let z=["dblclick","contextmenu","mouseover","mouseout","click",Q];for(let J of z){let Z=this.processMouseEvent.bind(this,J);this.addManagedElementListeners(this.element,{[J]:Z})}}processMouseEvent(Q,z){if(!n1(this.beans,z)||zQ(z))return;let{cellCtrl:J,rowCtrl:Z}=this.getControlsForEventTarget(z.target);if(Q==="contextmenu"){if(J?.column)J.dispatchCellContextMenuEvent(z);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(z,void 0,Z,J)}else{if(J)J.onMouseEvent(Q,z);if(Z)Z.onMouseEvent(Q,z)}}getControlsForEventTarget(Q){let{gos:z}=this;return{cellCtrl:EJ(z,Q),rowCtrl:q6(z,Q)}}processKeyboardEvent(Q,z){let{cellCtrl:J,rowCtrl:Z}=this.getControlsForEventTarget(z.target);if(z.defaultPrevented)return;if(J)this.processCellKeyboardEvent(J,Q,z);else if(Z?.isFullWidth())this.processFullWidthRowKeyboardEvent(Z,Q,z)}processCellKeyboardEvent(Q,z,J){let Z=this.editSvc?.isEditing(Q,{withOpenEditor:!0})??!1;if(!_5(this.gos,J,Q.rowNode,Q.column,Z)){if(z==="keydown"){if(!(!Z&&this.beans.navigation?.handlePageScrollingKey(J)))Q.onKeyDown(J);if(this.doGridOperations(J,Z),e9(J))Q.processCharacter(J)}}if(z==="keydown")this.eventSvc.dispatchEvent(Q.createEvent(J,"cellKeyDown"))}processFullWidthRowKeyboardEvent(Q,z,J){let{rowNode:Z}=Q,{focusSvc:$,navigation:X}=this.beans,G=$.getFocusedCell()?.column;if(!_5(this.gos,J,Z,G,!1)){let H=J.key;if(z==="keydown")switch(H){case V.PAGE_HOME:case V.PAGE_END:case V.PAGE_UP:case V.PAGE_DOWN:X?.handlePageScrollingKey(J,!0);break;case V.LEFT:case V.RIGHT:if(!this.gos.get("embedFullWidthRows"))break;case V.UP:case V.DOWN:Q.onKeyboardNavigate(J);break;case V.TAB:Q.onTabKeyDown(J);break;default:}}if(z==="keydown")this.eventSvc.dispatchEvent(Q.createRowEvent("cellKeyDown",J))}doGridOperations(Q,z){if(!Q.ctrlKey&&!Q.metaKey)return;if(z)return;if(!n1(this.beans,Q))return;let J=R9(Q),{clipboardSvc:Z,undoRedo:$}=this.beans;if(J===V.A)return this.onCtrlAndA(Q);if(J===V.C)return this.onCtrlAndC(Z,Q);if(J===V.D)return this.onCtrlAndD(Z,Q);if(J===V.V)return this.onCtrlAndV(Z,Q);if(J===V.X)return this.onCtrlAndX(Z,Q);if(J===V.Y)return this.onCtrlAndY($);if(J===V.Z)return this.onCtrlAndZ($,Q)}onCtrlAndA(Q){let{beans:{rowModel:z,rangeSvc:J,selectionSvc:Z},gos:$}=this;if(J&&u0($)&&!pG($)&&z.isRowsToRender())lH(this.beans);else if(Z)Z.selectAllRowNodes({source:"keyboardSelectAll",selectAll:U9($)});Q.preventDefault()}onCtrlAndC(Q,z){if(!Q||this.gos.get("enableCellTextSelection"))return;let{cellCtrl:J}=this.getControlsForEventTarget(z.target);if(this.editSvc?.isEditing(J,{withOpenEditor:!0}))return;z.preventDefault(),Q.copyToClipboard()}onCtrlAndX(Q,z){if(!Q||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;let{cellCtrl:J}=this.getControlsForEventTarget(z.target);if(this.editSvc?.isEditing(J,{withOpenEditor:!0}))return;z.preventDefault(),Q.cutToClipboard(void 0,"ui")}onCtrlAndV(Q,z){let{cellCtrl:J}=this.getControlsForEventTarget(z.target);if(this.editSvc?.isEditing(J,{withOpenEditor:!0}))return;if(Q&&!this.gos.get("suppressClipboardPaste"))Q.pasteFromClipboard()}onCtrlAndD(Q,z){if(Q&&!this.gos.get("suppressClipboardPaste"))Q.copyRangeDown();z.preventDefault()}onCtrlAndZ(Q,z){if(!this.gos.get("undoRedoCellEditing")||!Q)return;if(z.preventDefault(),z.shiftKey)Q.redo("ui");else Q.undo("ui")}onCtrlAndY(Q){Q?.redo("ui")}},xJ=(Q)=>Q.topRowCtrls,wJ=(Q)=>Q.getStickyTopRowCtrls(),NJ=(Q)=>Q.getStickyBottomRowCtrls(),gJ=(Q)=>Q.bottomRowCtrls,hJ=(Q)=>Q.allRowCtrls,x2=(Q)=>Q.getCtrls("top"),w2=(Q)=>Q.getCtrls("center"),N2=(Q)=>Q.getCtrls("bottom"),oH={center:{type:"center",name:"center-cols",getRowCtrls:hJ,getSpannedRowCtrls:w2},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:hJ,getSpannedRowCtrls:w2},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:hJ,getSpannedRowCtrls:w2},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:hJ},topCenter:{type:"center",name:"floating-top",getRowCtrls:xJ,getSpannedRowCtrls:x2},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:xJ,getSpannedRowCtrls:x2},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:xJ,getSpannedRowCtrls:x2},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:xJ},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:wJ},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:wJ},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:wJ},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:wJ},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:NJ},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:NJ},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:NJ},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:NJ},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:gJ,getSpannedRowCtrls:N2},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:gJ,getSpannedRowCtrls:N2},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:gJ,getSpannedRowCtrls:N2},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:gJ}};function J$(Q){return`ag-${KJ(Q).name}-viewport`}function Z$(Q){let z=KJ(Q);return z.container??`ag-${z.name}-container`}function eH(Q){return`ag-${KJ(Q).name}-spanned-cells-container`}function KJ(Q){return oH[Q]}var Q_=["topCenter","topLeft","topRight"],z_=["bottomCenter","bottomLeft","bottomRight"],J_=["center","left","right"],Z_=["center","left","right","fullWidth"],$_=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],X_=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Y_=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],$$=["stickyTopCenter","stickyTopLeft","stickyTopRight"],X$=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],G_=[...$$,"stickyTopFullWidth",...X$,"stickyBottomFullWidth"],q_=[...Q_,...z_,...J_,...$$,...X$],H_=class extends j{constructor(Q){super();this.name=Q,this.visible=!0,this.EMPTY_CTRLS=[],this.options=KJ(Q)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new rH(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(Q){this.comp.setOffsetTop(`${Q.offset}px`)}registerWithCtrlsService(){if(this.options.fullWidth)return;this.beans.ctrlsSvc.register(this.name,this)}forContainers(Q,z){if(Q.indexOf(this.name)>=0)z()}setComp(Q,z,J,Z){this.comp=Q,this.eContainer=z,this.eSpannedContainer=J,this.eViewport=Z,this.createManagedBean(new aH(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();let{pinnedCols:$,rangeSvc:X}=this.beans,Y=()=>this.onPinnedWidthChanged();if(this.forContainers(X_,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean($?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:Y})}),this.forContainers(Y_,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean($?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:Y})}),this.forContainers(Z_,()=>this.createManagedBean(new a9(this.eContainer,this.name==="center"?Z:void 0))),X)this.forContainers(q_,()=>this.createManagedBean(X.createDragListenerFeature(this.eContainer)));this.forContainers($_,()=>this.createManagedBean(new $6((G)=>this.comp.setContainerWidth(`${G}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(Q){this.addManagedElementListeners(this.eViewport,{scroll:Q})}addListeners(){let{spannedRowRenderer:Q,gos:z}=this.beans,J=this.onDisplayedColumnsChanged.bind(this);if(this.addManagedEventListeners({displayedColumnsChanged:J,displayedColumnsWidthChanged:J,displayedRowsChanged:(Z)=>this.onDisplayedRowsChanged(Z.afterScroll)}),J(),this.onDisplayedRowsChanged(),Q&&this.options.getSpannedRowCtrls&&z.get("enableCellSpan"))this.addManagedListeners(Q,{spannedRowsUpdated:()=>{let Z=this.options.getSpannedRowCtrls(Q);if(!Z)return;this.comp.setSpannedRowCtrls(Z,!1)}})}listenOnDomOrder(){if(G_.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}let z=()=>{let J=this.gos.get("ensureDomOrder"),Z=V0(this.gos,"print");this.comp.setDomOrder(J||Z)};this.addManagedPropertyListener("domLayout",z),z()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){let{dragSvc:Q}=this.beans;if(!Q)return;let z=(J)=>{if(Q.dragging){if(J.cancelable)J.preventDefault()}};this.eContainer.addEventListener("touchmove",z,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",z))}onHorizontalViewportChanged(Q=!1){let z=this.getCenterWidth(),J=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(z,J,Q)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return xz(this.eViewport)}getCenterViewportScrollLeft(){return QZ(this.eViewport,this.enableRtl)}registerViewportResizeListener(Q){let z=DQ(this.beans,this.eViewport,Q);this.addDestroyFunc(()=>z())}isViewportInTheDOMTree(){return g8(this.eViewport)}getViewportScrollLeft(){return QZ(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){let{beans:Q,gos:z,eViewport:J}=this,Z=z.get("alwaysShowHorizontalScroll"),{ctrlsSvc:$}=Q,X=$.getGridBodyCtrl()?.eBodyViewport,Y=$.get("fakeHScrollComp")?.getGui(),G=$.get("fakeVScrollComp")?.getGui();return Z||nH(J,X,void 0,Y,G)}setHorizontalScroll(Q){this.comp.setHorizontalScroll(Q)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(Q){zZ(this.eViewport,Q,this.enableRtl)}isContainerVisible(){return this.options.pinnedType==null||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){let Q=this.isContainerVisible();if(this.visible!=Q)this.visible=Q,this.onDisplayedRowsChanged()}onDisplayedRowsChanged(Q=!1){let z=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||z.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}let J=V0(this.gos,"print"),$=this.gos.get("embedFullWidthRows")||J,X=z.filter((Y)=>{let G=Y.isFullWidth();return this.options.fullWidth?!$&&G:$||!G});this.comp.setRowCtrls({rowCtrls:X,useFlushSync:Q})}},Y$="ag-force-vertical-scroll",__="ag-selectable",U_="ag-column-moving",W_=class extends j{constructor(){super(...arguments);this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(Q){this.ctrlsSvc=Q.ctrlsSvc,this.colModel=Q.colModel,this.scrollVisibleSvc=Q.scrollVisibleSvc,this.pinnedRowModel=Q.pinnedRowModel,this.filterManager=Q.filterManager,this.rowGroupColsSvc=Q.rowGroupColsSvc}setComp(Q,z,J,Z,$,X,Y){this.comp=Q,this.eGridBody=z,this.eBodyViewport=J,this.eTop=Z,this.eBottom=$,this.eStickyTop=X,this.eStickyBottom=Y,this.eCenterColsViewport=J.querySelector(`.${J$("center")}`),this.eFullWidthContainer=J.querySelector(`.${Z$("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(G)=>this.setCellTextSelection(G.currentValue)),this.createManagedBean(new G6(this.comp)),this.scrollFeature=this.createManagedBean(new iH(J)),this.beans.rowDragSvc?.setupRowDrag(J,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([Z,J,$,X,Y]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(Z),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){let Q=this.setFloatingHeights.bind(this),z=this.setGridRootRole.bind(this),J=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:Q,pinnedHeightChanged:Q,pinnedRowsChanged:Q,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:z,columnPivotChanged:z,rowResizeStarted:J,rowResizeEnded:J}),this.addManagedPropertyListener("treeData",z)}toggleRowResizeStyles(Q){let z=Q.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",z)}onGridColumnsChanged(){let Q=this.beans.colModel.getCols();this.comp.setColumnCount(Q.length)}onScrollVisibilityChanged(){let{scrollVisibleSvc:Q}=this,z=Q.verticalScrollShowing;this.setVerticalScrollPaddingVisible(z),this.setStickyWidth(z),this.setStickyBottomOffsetBottom();let J=z?Q.getScrollbarWidth()||0:0,Z=y9()?16:0,$=`calc(100% + ${J+Z}px)`;YQ(this.beans,()=>this.comp.setBodyViewportWidth($)),this.updateScrollingClasses()}setGridRootRole(){let{rowGroupColsSvc:Q,colModel:z,gos:J}=this,Z=J.get("treeData");if(!Z){let $=z.isPivotMode();Z=(!Q?0:Q.columns.length)>=($?2:1)}this.comp.setGridRootRole(Z?"treegrid":"grid")}addFocusListeners(Q){for(let z of Q)this.addManagedElementListeners(z,{focusin:(J)=>{let{target:Z}=J,$=vz(Z,"ag-root",z);z.classList.toggle("ag-has-focus",!$)},focusout:(J)=>{let{target:Z,relatedTarget:$}=J,X=z.contains($),Y=vz($,"ag-root",z);if(vz(Z,"ag-root",z))return;if(!X||Y)z.classList.remove("ag-has-focus")}})}setColumnMovingCss(Q){this.comp.setColumnMovingCss(U_,Q)}setCellTextSelection(Q=!1){this.comp.setCellSelectableCss(__,Q)}updateScrollingClasses(){let{eGridBody:{classList:Q},scrollVisibleSvc:z}=this;Q.toggle("ag-body-vertical-content-no-gap",!z.verticalScrollGap),Q.toggle("ag-body-horizontal-content-no-gap",!z.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:(Q)=>{if(Q.target instanceof HTMLImageElement)return Q.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){let Q=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:z}=this.beans,J=z.isLastRowIndexKnown()?z.getRowCount():-1,Z=J===-1?-1:Q+J;this.comp.setRowCount(Z)}registerBodyViewportResizeListener(Q){this.comp.registerBodyViewportResizeListener(Q)}setVerticalScrollPaddingVisible(Q){let z=Q?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(z)}isVerticalScrollShowing(){let{gos:Q,comp:z,ctrlsSvc:J}=this,Z=Q.get("alwaysShowVerticalScroll"),$=Z?Y$:null,X=V0(Q,"normal");z.setAlwaysVerticalScrollClass($,Z);let Y=J.get("center")?.eViewport,G=J.get("fakeHScrollComp")?.getGui(),q=J.get("fakeVScrollComp")?.getGui();return Z||X&&dH(this.eBodyViewport,Y,void 0,q,G)}setupRowAnimationCssClass(){let{rowContainerHeight:Q,environment:z}=this.beans,J=z.sizesMeasured,Z=()=>{let $=J&&_1(this.gos)&&!Q.stretching,X=$?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(X,$)};Z(),this.addManagedEventListeners({heightScaleChanged:Z}),this.addManagedPropertyListener("animateRows",Z),this.addManagedEventListeners({stylesChanged:()=>{if(!J&&z.sizesMeasured)J=!0,Z()}})}addBodyViewportListener(){let{eBodyViewport:Q,eStickyTop:z,eStickyBottom:J,eTop:Z,eBottom:$,beans:{popupSvc:X,touchSvc:Y}}=this,G=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(Q,{contextmenu:G}),Y?.mockBodyContextMenu(this,G),this.addManagedElementListeners(Q,{wheel:this.onBodyViewportWheel.bind(this,X)});let q=this.onStickyWheel.bind(this);for(let _ of[z,J,Z,$])this.addManagedElementListeners(_,{wheel:q});let H=this.onHorizontalWheel.bind(this);for(let _ of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(_).eContainer,{wheel:H});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:(Q)=>this.onFullWidthContainerWheel(Q)})}onFullWidthContainerWheel(Q){let{deltaX:z,deltaY:J,shiftKey:Z}=Q;if((Z||Math.abs(z)>Math.abs(J))&&n1(this.beans,Q))this.scrollGridBodyToMatchEvent(Q)}onStickyWheel(Q){let{deltaY:z}=Q;if(this.scrollVertically(z)>0)Q.preventDefault()}onHorizontalWheel(Q){let{deltaX:z,deltaY:J,shiftKey:Z}=Q;if(!(Z||Math.abs(z)>Math.abs(J)))return;this.scrollGridBodyToMatchEvent(Q)}scrollGridBodyToMatchEvent(Q){let{deltaX:z,deltaY:J}=Q;Q.preventDefault(),this.eCenterColsViewport.scrollBy({left:z||J})}onBodyViewportContextMenu(Q,z,J){if(!Q&&!J)return;if(this.gos.get("preventDefaultOnContextMenu"))(Q||J).preventDefault();let{target:Z}=Q||z;if(Z===this.eBodyViewport||Z===this.ctrlsSvc.get("center").eViewport)this.beans.contextMenuSvc?.showContextMenu({mouseEvent:Q,touchEvent:J,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(Q,z){if(!this.gos.get("suppressScrollWhenPopupsAreOpen"))return;if(Q?.hasAnchoredPopup())z.preventDefault()}scrollVertically(Q){let z=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(z+Q),this.eBodyViewport.scrollTop-z}setFloatingHeights(){let{pinnedRowModel:Q,beans:{environment:z}}=this,J=Q?.getPinnedTopTotalHeight(),Z=Q?.getPinnedBottomTotalHeight(),$=z.getPinnedRowBorderWidth(),X=z.getRowBorderWidth(),Y=$-X,G=!J?0:Y+J,q=!Z?0:Y+Z;this.comp.setTopHeight(G),this.comp.setBottomHeight(q),this.comp.setTopInvisible(G<=0),this.comp.setBottomInvisible(q<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(Q=0){this.comp.setStickyTopHeight(`${Q}px`),this.stickyTopHeight=Q}setStickyBottomHeight(Q=0){this.comp.setStickyBottomHeight(`${Q}px`),this.stickyBottomHeight=Q}setStickyWidth(Q){if(!Q)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{let z=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${z}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${z}px)`)}}setStickyTopOffsetTop(){let z=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),J=this.pinnedRowModel?.getPinnedTopTotalHeight()??0,Z=0;if(z>0)Z+=z;if(J>0)Z+=J;if(Z>0)Z+=1;this.comp.setStickyTopTop(`${Z}px`)}setStickyBottomOffsetBottom(){let{pinnedRowModel:Q,scrollVisibleSvc:z,comp:J}=this,Z=Q?.getPinnedBottomTotalHeight()??0,X=z.horizontalScrollShowing?z.getScrollbarWidth()||0:0,Y=Z+X;J.setStickyBottomBottom(`${Y}px`)}};function Z0(Q){return K0(Q)}var B_=class extends x{constructor(Q,z,J,Z,$){super();this.cellCtrl=z,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=Q,this.gos=Q.gos,this.column=z.column,this.rowNode=z.rowNode,this.eRow=Z;let X=Z0({tag:"div",role:z.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":z.column.colIdSanitised}});this.eCell=X;let Y;if(z.isCellSpanning())Y=Z0({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),Y.appendChild(X),this.setTemplateFromElement(Y);else this.setTemplateFromElement(X);this.cellCssManager=new I9(()=>X),this.forceWrapper=z.isForceWrapper(),this.refreshWrapper(!1);let G={toggleCss:(q,H)=>this.cellCssManager.toggleCss(q,H),setUserStyles:(q)=>$J(X,q),getFocusableElement:()=>X,setIncludeSelection:(q)=>this.includeSelection=q,setIncludeRowDrag:(q)=>this.includeRowDrag=q,setIncludeDndSource:(q)=>this.includeDndSource=q,setRowResizerElement:(q)=>this.setRowResizerElement(q),setRenderDetails:(q,H,_)=>this.setRenderDetails(q,H,_),setEditDetails:(q,H,_)=>this.setEditDetails(q,H,_),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(q,H)=>this.refreshEditStyles(q,H)};z.setComp(G,X,Y,this.eCellWrapper,J,$,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(Q){if(this.rowResizerElement)T0(this.rowResizerElement);if(this.rowResizerElement=Q,Q)this.eCell.appendChild(Q)}setRenderDetails(Q,z,J){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;let $=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),Q){if(!(J||$?!1:this.refreshCellRenderer(Q)))this.destroyRenderer(),this.createCellRendererInstance(Q)}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(z);if(this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement)this.eCell.appendChild(this.rowResizerElement)}setEditDetails(Q,z,J){if(Q)this.createCellEditorInstance(Q,z,J);else this.destroyEditor()}removeControls(){let Q=this.beans.context;this.checkboxSelectionComp=Q.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=Q.destroyBean(this.dndSourceComp),this.rowDraggingComp=Q.destroyBean(this.rowDraggingComp)}refreshWrapper(Q){let z=this.includeRowDrag||this.includeDndSource||this.includeSelection,J=z||this.forceWrapper,Z=J&&this.eCellWrapper==null;if(Z)this.eCellWrapper=Z0({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper);let $=!J&&this.eCellWrapper!=null;if($)T0(this.eCellWrapper),this.eCellWrapper=void 0;this.cellCssManager.toggleCss("ag-cell-value",!J);let X=!Q&&J,Y=X&&this.eCellValue==null;if(Y){let H=this.cellCtrl.getCellValueClass();this.eCellValue=Z0({tag:"span",cls:H,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}let G=!X&&this.eCellValue!=null;if(G)T0(this.eCellValue),this.eCellValue=void 0;let q=Z||$||Y||G;if(q)this.removeControls();if(!Q&&z)this.addControls();return q}addControls(){let{cellCtrl:Q,eCellWrapper:z,eCellValue:J,includeRowDrag:Z,includeDndSource:$,includeSelection:X}=this,Y=(G)=>{if(G)z.insertBefore(G.getGui(),J)};if(Z&&this.rowDraggingComp==null)this.rowDraggingComp=Q.createRowDragComp(),Y(this.rowDraggingComp);if($&&this.dndSourceComp==null)this.dndSourceComp=Q.createDndSource(),Y(this.dndSourceComp);if(X&&this.checkboxSelectionComp==null)this.checkboxSelectionComp=Q.createSelectionCheckbox(),Y(this.checkboxSelectionComp)}createCellEditorInstance(Q,z,J){let Z=this.editorVersion,$=Q.newAgStackInstance(),{params:X}=Q;if($.then((G)=>this.afterCellEditorCreated(Z,G,X,z,J)),n(this.cellEditor)&&X.cellStartedEdit)this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(Q){let z=this.getParentOfValue();z0(z);let J=ZJ(Q);if(J!=null)z.textContent=J}destroyRenderer(){let{context:Q}=this.beans;this.cellRenderer=Q.destroyBean(this.cellRenderer),T0(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){let{context:Q}=this.beans;if(this.cellEditorPopupWrapper?.getGui().contains(d(this.beans))||this.cellCtrl.hasBrowserFocus())this.eCell.focus({preventScroll:!0});this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=Q.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=Q.destroyBean(this.cellEditorPopupWrapper),T0(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(Q){if(this.cellRenderer?.refresh==null)return!1;if(this.cellRendererClass!==Q.componentClass)return!1;let z=this.cellRenderer.refresh(Q.params);return z===!0||z===void 0}createCellRendererInstance(Q){let z=this.rendererVersion,J=(X)=>(Y)=>{if(this.rendererVersion!==z||!this.isAlive())return;let q=X.newAgStackInstance(),H=this.afterCellRendererCreated.bind(this,z,X.componentClass);q?.then(H)},{animationFrameSvc:Z}=this.beans,$;if(Z?.active&&this.firstRender)$=(X,Y=!1)=>{Z.createTask(J(X),this.rowNode.rowIndex,"p2",X.componentFromFramework,Y)};else $=(X)=>J(X)();if(Q.params?.deferRender&&!this.cellCtrl.rowNode.group){let{loadingComp:X,onReady:Y}=this.cellCtrl.getDeferLoadingCellRenderer();if(X)$(X),Y.then(()=>$(Q,!0))}else $(Q)}afterCellRendererCreated(Q,z,J){if(!this.isAlive()||Q!==this.rendererVersion){this.beans.context.destroyBean(J);return}this.cellRenderer=J,this.cellRendererClass=z;let $=J.getGui();if(this.cellRendererGui=$,$!=null){let X=this.getParentOfValue();z0(X),X.appendChild($)}}afterCellEditorCreated(Q,z,J,Z,$){let X=Q!==this.editorVersion,{context:Y}=this.beans;if(X){Y.destroyBean(z);return}if(z.isCancelBeforeStart?.()){Y.destroyBean(z),this.cellCtrl.stopEditing(!0);return}if(!z.getGui){R(97,{colId:this.column.getId()}),Y.destroyBean(z);return}this.cellEditor=z,this.cellEditorGui=z.getGui();let q=Z||z.isPopup?.();if(q)this.addPopupCellEditor(J,$);else this.addInCellEditor();this.refreshEditStyles(!0,q),z.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(z),this.cellCtrl.cellEditorAttached()}refreshEditStyles(Q,z){let{cellCssManager:J}=this;J.toggleCss("ag-cell-inline-editing",Q&&!z),J.toggleCss("ag-cell-popup-editing",Q&&!!z),J.toggleCss("ag-cell-not-inline-editing",!Q||!!z)}addInCellEditor(){let{eCell:Q}=this;if(Q.contains(d(this.beans)))Q.focus();if(this.destroyRenderer(),this.refreshWrapper(!0),z0(this.getParentOfValue()),this.cellEditorGui)this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(Q,z){let{gos:J,context:Z,popupSvc:$,editSvc:X}=this.beans;if(J.get("editType")==="fullRow")R(98);let Y=this.cellEditorPopupWrapper=Z.createBean(X.createPopupEditorWrapper(Q)),{cellEditor:G,cellEditorGui:q,eCell:H,rowNode:_,column:U,cellCtrl:W}=this,B=Y.getGui();if(q)B.appendChild(q);let E=J.get("stopEditingWhenCellsLoseFocus"),K=z!=null?z:G.getPopupPosition?.()??"over",L=J.get("enableRtl"),F={ePopup:B,additionalParams:{column:U,rowNode:_},type:"popupCellEditor",eventSource:H,position:K,alignSide:L?"right":"left",keepWithinBounds:!0},D=$.positionPopupByComponent.bind($,F),M=$.addPopup({modal:E,eChild:B,closeOnEsc:!0,closedCallback:(k)=>{W.onPopupEditorClosed(k)},anchorToElement:H,positionCallback:D,ariaOwns:H});if(M)this.hideEditorPopup=M.hideFunc}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},E_=class extends x{constructor(Q,z,J){super();this.cellComps=new Map,this.beans=z,this.rowCtrl=Q;let Z=Z0({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(Z,J),this.setTemplateFromElement(Z);let $=Z.style;this.domOrder=this.rowCtrl.getDomOrder();let X={setDomOrder:(Y)=>this.domOrder=Y,setCellCtrls:(Y)=>this.setCellCtrls(Y),showFullWidth:(Y)=>this.showFullWidth(Y),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(Y,G)=>this.toggleCss(Y,G),setUserStyles:(Y)=>$J(Z,Y),setTop:(Y)=>$.top=Y,setTransform:(Y)=>$.transform=Y,setRowIndex:(Y)=>Z.setAttribute("row-index",Y),setRowId:(Y)=>Z.setAttribute("row-id",Y),setRowBusinessKey:(Y)=>Z.setAttribute("row-business-key",Y),refreshFullWidth:(Y)=>{let G=Y();return this.fullWidthCellRendererParams=G,this.fullWidthCellRenderer?.refresh?.(G)??!1}};Q.setComp(X,this.getGui(),J,void 0),this.addDestroyFunc(()=>{Q.unsetComp(J)})}setInitialStyle(Q,z){let J=this.rowCtrl.getInitialTransform(z);if(J)Q.style.setProperty("transform",J);else{let Z=this.rowCtrl.getInitialRowTop(z);if(Z)Q.style.setProperty("top",Z)}}showFullWidth(Q){let z=(Z)=>{if(this.isAlive()){let $=Z.getGui();this.getGui().appendChild($),this.rowCtrl.setupDetailRowAutoHeight($),this.setFullWidthRowComp(Z,Q.params)}else this.beans.context.destroyBean(Z)};Q.newAgStackInstance().then(z)}setCellCtrls(Q){let z=new Map(this.cellComps);for(let J of Q){let Z=J.instanceId;if(!this.cellComps.has(Z))this.newCellComp(J);else z.delete(Z)}this.destroyCells(z),this.ensureDomOrder(Q)}ensureDomOrder(Q){if(!this.domOrder)return;let z=[];for(let J of Q){let Z=this.cellComps.get(J.instanceId);if(Z)z.push(Z.getGui())}u8(this.getGui(),z)}newCellComp(Q){let z=this.beans.editSvc?.isEditing(Q,{withOpenEditor:!0})??!1,J=new B_(this.beans,Q,this.rowCtrl.printLayout,this.getGui(),z);this.cellComps.set(Q.instanceId,J),this.getGui().appendChild(J.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(Q,z){this.fullWidthCellRenderer=Q,this.fullWidthCellRendererParams=z,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(Q){for(let z of Q.values()){if(!z)continue;let J=z.cellCtrl.instanceId;if(this.cellComps.get(J)!==z)continue;z.detach(),z.destroy(),this.cellComps.delete(J)}}};function K_(Q,z,J){let Z=!!J.gos.get("enableCellSpan")&&!!z.getSpannedRowCtrls,$={tag:"div",ref:"eContainer",cls:Z$(Q),role:"rowgroup"};if(z.type==="center"||Z){let X={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${eH(Q)}`,role:"presentation"};return $.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${J$(Q)}`,role:"rowgroup",children:[$,Z?X:null]}}return $}var L_=class extends x{constructor(Q){super();this.eViewport=S,this.eContainer=S,this.eSpannedContainer=S,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=Q?.name,this.options=KJ(this.name)}postConstruct(){this.setTemplate(K_(this.name,this.options,this.beans));let Q={setHorizontalScroll:(J)=>this.eViewport.scrollLeft=J,setViewportHeight:(J)=>this.eViewport.style.height=J,setRowCtrls:({rowCtrls:J})=>this.setRowCtrls(J),setSpannedRowCtrls:(J)=>this.setRowCtrls(J,!0),setDomOrder:(J)=>{this.domOrder=J},setContainerWidth:(J)=>{if(this.eContainer.style.width=J,this.eSpannedContainer)this.eSpannedContainer.style.width=J},setOffsetTop:(J)=>{let Z=`translateY(${J})`;if(this.eContainer.style.transform=Z,this.eSpannedContainer)this.eSpannedContainer.style.transform=Z}};this.createManagedBean(new H_(this.name)).setComp(Q,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(Q,z){let{beans:J,options:Z}=this,$=z?this.eSpannedContainer:this.eContainer,X=z?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},Y={};if(z)this.rowCompsWithSpan=Y;else this.rowCompsNoSpan=Y;this.lastPlacedElement=null;let G=[];for(let q of Q){let H=q.instanceId,_=X[H],U;if(_)U=_,delete X[H];else{if(!q.rowNode.displayed)continue;U=new E_(q,J,Z.type)}Y[H]=U,G.push([U,!_])}this.removeOldRows(Object.values(X)),this.addRowNodes(G,$)}addRowNodes(Q,z){let{domOrder:J}=this;for(let[Z,$]of Q){let X=Z.getGui();if(!J){if($)z.appendChild(X)}else this.ensureDomOrder(X,z)}}removeOldRows(Q){for(let z of Q)z.getGui().remove(),z.destroy()}ensureDomOrder(Q,z){h8(z,Q,this.lastPlacedElement),this.lastPlacedElement=Q}},F_={selector:"AG-ROW-CONTAINER",component:L_};function C1(Q,z){return z.map((J)=>{let Z=`e${J[0].toUpperCase()+J.substring(1)}RowContainer`;return Q[Z]={name:J},{tag:"ag-row-container",ref:Z,attrs:{name:J}}})}function D_(Q){let z={},J={tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:C1(z,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:C1(z,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:C1(z,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:C1(z,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:C1(z,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},Q?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:z,elementParams:J}}var M_=class extends x{constructor(){super(...arguments);this.eGridRoot=S,this.eBodyViewport=S,this.eStickyTop=S,this.eStickyBottom=S,this.eTop=S,this.eBottom=S,this.eBody=S}postConstruct(){let{overlays:Q,rangeSvc:z}=this.beans,J=Q?.getOverlayWrapperSelector(),{paramsMap:Z,elementParams:$}=D_(!!J);this.setTemplate($,[...J?[J]:[],uH,pH,NH,F_],Z);let X=(G,q)=>{let H=`${G}px`;q.style.minHeight=H,q.style.height=H},Y={setRowAnimationCssOnBodyViewport:(G,q)=>this.setRowAnimationCssOnBodyViewport(G,q),setColumnCount:(G)=>d4(this.getGui(),G),setRowCount:(G)=>n4(this.getGui(),G),setTopHeight:(G)=>X(G,this.eTop),setBottomHeight:(G)=>X(G,this.eBottom),setTopInvisible:(G)=>this.eTop.classList.toggle("ag-invisible",G),setBottomInvisible:(G)=>this.eBottom.classList.toggle("ag-invisible",G),setStickyTopHeight:(G)=>this.eStickyTop.style.height=G,setStickyTopTop:(G)=>this.eStickyTop.style.top=G,setStickyTopWidth:(G)=>this.eStickyTop.style.width=G,setStickyBottomHeight:(G)=>{this.eStickyBottom.style.height=G,this.eStickyBottom.classList.toggle("ag-invisible",G==="0px")},setStickyBottomBottom:(G)=>this.eStickyBottom.style.bottom=G,setStickyBottomWidth:(G)=>this.eStickyBottom.style.width=G,setColumnMovingCss:(G,q)=>this.toggleCss(G,q),updateLayoutClasses:(G,q)=>{let H=[this.eBodyViewport.classList,this.eBody.classList];for(let _ of H)_.toggle(UQ.AUTO_HEIGHT,q.autoHeight),_.toggle(UQ.NORMAL,q.normal),_.toggle(UQ.PRINT,q.print);this.toggleCss(UQ.AUTO_HEIGHT,q.autoHeight),this.toggleCss(UQ.NORMAL,q.normal),this.toggleCss(UQ.PRINT,q.print)},setAlwaysVerticalScrollClass:(G,q)=>this.eBodyViewport.classList.toggle(Y$,q),registerBodyViewportResizeListener:(G)=>{let q=DQ(this.beans,this.eBodyViewport,G);this.addDestroyFunc(()=>q())},setPinnedTopBottomOverflowY:(G)=>this.eTop.style.overflowY=this.eBottom.style.overflowY=G,setCellSelectableCss:(G,q)=>{for(let H of[this.eTop,this.eBodyViewport,this.eBottom])H.classList.toggle(G,q)},setBodyViewportWidth:(G)=>this.eBodyViewport.style.width=G,setGridRootRole:(G)=>H0(this.eGridRoot,G)};if(this.ctrl=this.createManagedBean(new W_),this.ctrl.setComp(Y,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),z&&u0(this.gos)||s1(this.gos))i4(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(Q,z){let J=this.eBodyViewport.classList;J.toggle("ag-row-animation",z),J.toggle("ag-row-no-animation",!z)}getFocusableContainerName(){return"gridBody"}},k_={selector:"AG-GRID-BODY",component:M_},g1={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},V_=class extends j0{constructor(Q,z){super();this.stopPropagationCallbacks=z,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;let{comp:J,eTopGuard:Z,eBottomGuard:$,focusTrapActive:X,forceFocusOutWhenTabGuardsAreEmpty:Y,isFocusableContainer:G,focusInnerElement:q,onFocusIn:H,onFocusOut:_,shouldStopEventPropagation:U,onTabKeyDown:W,handleKeyDown:B,isEmpty:E,eFocusableElement:K}=Q;this.comp=J,this.eTopGuard=Z,this.eBottomGuard=$,this.providedFocusInnerElement=q,this.eFocusableElement=K,this.focusTrapActive=!!X,this.forceFocusOutWhenTabGuardsAreEmpty=!!Y,this.isFocusableContainer=!!G,this.providedFocusIn=H,this.providedFocusOut=_,this.providedShouldStopEventPropagation=U,this.providedOnTabKeyDown=W,this.providedHandleKeyDown=B,this.providedIsEmpty=E}postConstruct(){this.createManagedBean(new x9(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:(Q)=>this.onTabKeyDown(Q),handleKeyDown:(Q)=>this.handleKeyDown(Q),onFocusIn:(Q)=>this.onFocusIn(Q),onFocusOut:(Q)=>this.onFocusOut(Q)})),this.activateTabGuards();for(let Q of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(Q,{focus:this.onFocus.bind(this)})}handleKeyDown(Q){if(this.providedHandleKeyDown)this.providedHandleKeyDown(Q)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){if(this.providedShouldStopEventPropagation)return this.providedShouldStopEventPropagation();return!1}activateTabGuards(){if(this.forcingFocusOut)return;let Q=this.gos.get("tabIndex");this.comp.setTabIndex(Q.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(Q){if(this.isFocusableContainer&&!this.eFocusableElement.contains(Q.relatedTarget)){if(!this.allowFocus){this.findNextElementOutsideAndFocus(Q.target===this.eBottomGuard);return}}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty){if(this.providedIsEmpty?this.providedIsEmpty():EQ(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(Q.target===this.eBottomGuard);return}}if(this.isFocusableContainer&&this.eFocusableElement.contains(Q.relatedTarget))return;let z=Q.target===this.eBottomGuard;if(!(this.providedFocusInnerElement?this.providedFocusInnerElement(z):this.focusInnerElement(z))&&this.forceFocusOutWhenTabGuardsAreEmpty)this.findNextElementOutsideAndFocus(Q.target===this.eBottomGuard)}findNextElementOutsideAndFocus(Q){let z=Y0(this.beans),J=EQ(z.body,null,!0),Z=J.indexOf(Q?this.eTopGuard:this.eBottomGuard);if(Z===-1)return;let $,X;if(Q)$=0,X=Z;else $=Z+1,X=J.length;let Y=J.slice($,X),G=this.gos.get("tabIndex");Y.sort((q,H)=>{let _=Number.parseInt(q.getAttribute("tabindex")||"0"),U=Number.parseInt(H.getAttribute("tabindex")||"0");if(U===G)return 1;if(_===G)return-1;if(_===0)return 1;if(U===0)return-1;return _-U}),Y[Q?Y.length-1:0]?.focus()}onFocusIn(Q){if(this.focusTrapActive||this.forcingFocusOut)return;if(this.providedFocusIn)this.providedFocusIn(Q);if(!this.isFocusableContainer)this.deactivateTabGuards()}onFocusOut(Q){if(this.focusTrapActive)return;if(this.providedFocusOut)this.providedFocusOut(Q);if(!this.eFocusableElement.contains(Q.relatedTarget))this.activateTabGuards()}onTabKeyDown(Q){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(Q);return}if(this.focusTrapActive)return;if(Q.defaultPrevented)return;let z=this.tabGuardsAreActive();if(z)this.deactivateTabGuards();let J=this.getNextFocusableElement(Q.shiftKey);if(z)setTimeout(()=>this.activateTabGuards(),0);if(!J)return;J.focus(),Q.preventDefault()}focusInnerElement(Q=!1){let z=EQ(this.eFocusableElement);if(this.tabGuardsAreActive())z.splice(0,1),z.splice(-1,1);if(!z.length)return!1;return z[Q?z.length-1:0].focus({preventScroll:!0}),!0}getNextFocusableElement(Q){return R0(this.beans,this.eFocusableElement,!1,Q)}forceFocusOutOfContainer(Q=!1){if(this.forcingFocusOut)return;let z=Q?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,z.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(Q,z){return Q===this.eTopGuard&&!z||Q===this.eBottomGuard&&(z??!0)}setAllowFocus(Q){this.allowFocus=Q}},H6=class extends j0{constructor(Q,z){super();this.comp=Q,this.stopPropagationCallbacks=z}initialiseTabGuard(Q){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();let{eTopGuard:z,eBottomGuard:J,eFocusableElement:Z,stopPropagationCallbacks:$}=this,X=[z,J],Y={setTabIndex:(F)=>{for(let D of X)if(F==null)D.removeAttribute("tabindex");else D.setAttribute("tabindex",F)}};this.addTabGuards(z,J);let{focusTrapActive:G=!1,onFocusIn:q,onFocusOut:H,focusInnerElement:_,handleKeyDown:U,onTabKeyDown:W,shouldStopEventPropagation:B,isEmpty:E,forceFocusOutWhenTabGuardsAreEmpty:K,isFocusableContainer:L}=Q;this.tabGuardCtrl=this.createManagedBean(new V_({comp:Y,focusTrapActive:G,eTopGuard:z,eBottomGuard:J,eFocusableElement:Z,onFocusIn:q,onFocusOut:H,focusInnerElement:_,handleKeyDown:U,onTabKeyDown:W,shouldStopEventPropagation:B,isEmpty:E,forceFocusOutWhenTabGuardsAreEmpty:K,isFocusableContainer:L},$))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(Q){let z=Y0(this.beans).createElement("div"),J=Q==="top"?g1.TAB_GUARD_TOP:g1.TAB_GUARD_BOTTOM;return z.classList.add(g1.TAB_GUARD,J),H0(z,"presentation"),z}addTabGuards(Q,z){let J=this.eFocusableElement;J.prepend(Q),J.append(z)}removeAllChildrenExceptTabGuards(){let Q=[this.eTopGuard,this.eBottomGuard];z0(this.comp.getFocusableElement()),this.addTabGuards(...Q)}forceFocusOutOfContainer(Q=!1){this.tabGuardCtrl.forceFocusOutOfContainer(Q)}appendChild(Q,z,J){if(!XJ(z))z=z.getGui();let{eBottomGuard:Z}=this;if(Z)Z.before(z);else Q(z,J)}destroy(){let{eTopGuard:Q,eBottomGuard:z}=this;T0(Q),T0(z),super.destroy()}},pQ=class extends p0{initialiseTabGuard(Q,z){this.tabGuardFeature=this.createManagedBean(new H6(this,z)),this.tabGuardFeature.initialiseTabGuard(Q)}forceFocusOutOfContainer(Q=!1){this.tabGuardFeature.forceFocusOutOfContainer(Q)}appendChild(Q,z){this.tabGuardFeature.appendChild(super.appendChild.bind(this),Q,z)}},_6=class extends pQ{initialiseTabGuard(Q){super.initialiseTabGuard(Q,Uz)}},O7=(Q,z)=>{return m9(Q,()=>D0(Q.getGui(),z,!1,!0))},P7=(Q)=>{return Q?.getFocusableContainerName()??"external"},f_=(Q)=>{if(Q==null)return"external";return typeof Q==="string"?Q:"gridBody"},A_=class extends j{constructor(){super(...arguments);this.additionalFocusableContainers=new Set}setComp(Q,z,J){this.view=Q,this.eGridHostDiv=z,this.eGui=J,this.eGui.setAttribute("grid-id",this.beans.context.getId());let{dragAndDrop:Z,ctrlsSvc:$}=this.beans;Z?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new G6(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let X=DQ(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>X()),$.register("gridCtrl",this)}isDetailGrid(){return xZ(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){let Q=this.beans;return{paginationSelector:Q.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:Q.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:Q.sideBar?.getSelector(),statusBarSelector:Q.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:Q.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(Q){let{view:z}=this;if(Q===!1)z.setCursor(null);else z.setCursor(Q===1?"ew-resize":"ns-resize")}disableUserSelect(Q){this.view.setUserSelect(Q?"none":null)}focusNextInnerContainer(Q){let z=this.getFocusableContainers(),{indexWithFocus:J,nextIndex:Z}=this.getNextFocusableIndex(z,Q),$=J===-1?Q?z.length-1:0:Z,{gos:X,beans:{focusSvc:Y,navigation:G}}=this,q=X.getCallback("tabToNextGridContainer");if(q){let H=Y.getDefaultTabToNextGridContainerTarget({backwards:Q,focusableContainers:z,nextIndex:$}),_=P7(z[$]),U=H==null&&_==="gridBody"?"gridBody":f_(H),W=q({backwards:Q,previousContainer:P7(z[J]),nextContainer:U,defaultTarget:H});if(W!==void 0){if(typeof W==="boolean")return W;if(typeof W==="string"){if(W==="gridBody")return this.focusGridBodyDefault(Q)||void 0;let B=z.find((E)=>E.getFocusableContainerName()===W);if(!B){t8(`tabToNextGridContainer - ${W} container not found`);return}return O7(B,Q)?!0:void 0}if(LH(W))return Y.focusHeaderPosition({headerPosition:W})||void 0;return G?.ensureCellVisible(W),Y.setFocusedCell({...W,forceBrowserFocus:!0}),Y.isCellFocused(W)||void 0}}return this.focusNextInnerContainerDefault({backwards:Q,focusableContainers:z,indexWithFocus:J,nextIndex:$})||void 0}focusInnerElement(Q){let{gos:z,beans:J,beans:{focusSvc:Z,visibleCols:$}}=this;if(z.getCallback("focusGridInnerElement")?.({fromBottom:!!Q}))return!0;let Y=this.getFocusableContainers();if(Q){if(this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:Y,indexWithFocus:Y.length,nextIndex:Y.length-1}))return!0;return Z.focusGridView({column:b($.allCols),backwards:!0})}let G=$.allCols;if(z.get("headerHeight")===0||_Q(J)){if(Z.focusGridView({column:G[0],backwards:Q}))return!0;for(let q=1;q$.getGui().contains(J));return{indexWithFocus:Z,nextIndex:Z+(z?-1:1)}}focusGridBodyDefault(Q){let{gos:z,beans:J,beans:{focusSvc:Z,visibleCols:{allCols:$}}}=this;if(Q)return Z.focusGridView({column:b($),backwards:!0});if(z.get("headerHeight")===0||_Q(J))return Z.focusGridView({column:$[0]});return Z.focusFirstHeader()}focusNextInnerContainerDefault(Q){let{backwards:z,focusableContainers:J,indexWithFocus:Z}=Q,$=z?-1:1;for(let X=Q.nextIndex;X>=0&&XX:Zthis.destroyBean(this),setRtlClass:(X)=>this.addCss(X),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:(X)=>{this.getGui().style.userSelect=X!=null?X:"",this.getGui().style.webkitUserSelect=X!=null?X:""},setCursor:(X)=>{this.getGui().style.cursor=X!=null?X:""}},z=this.createManagedBean(new A_),J=z.getOptionalSelectors(),Z=this.createTemplate(J),$=[k_,...Object.values(J).filter((X)=>!!X)];this.setTemplate(Z,$),z.setComp(Q,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{return},focusInnerElement:(X)=>z.focusInnerElement(X),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!z.isFocusable()})}insertGridIntoDom(){let Q=this.getGui();this.eGridDiv.appendChild(Q),this.addDestroyFunc(()=>{Q.remove(),d1(this.gos,"Grid removed from DOM")})}updateLayoutClasses(Q,z){let J=this.rootWrapperBody.classList,{AUTO_HEIGHT:Z,NORMAL:$,PRINT:X}=UQ,{autoHeight:Y,normal:G,print:q}=z;J.toggle(Z,Y),J.toggle($,G),J.toggle(X,q),this.toggleCss(Z,Y),this.toggleCss($,G),this.toggleCss(X,q)}createTemplate(Q){let z=Q.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,J=Q.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,Z=Q.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,$=Q.watermarkSelector?{tag:"ag-watermark"}:null,X=Q.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[z,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},J]},Z,X,$]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(Q=!1){if(!Q&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(Q);return}super.forceFocusOutOfContainer(Q)}getFocusableContainers(){let Q=[...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody];for(let z of[this.sideBar,this.statusBar,this.pagination])if(z)Q.push(z);return Q.filter((z)=>f0(z.getGui()))}},c=(Q,z)=>{for(let J of Object.keys(z))z[J]=Q;return z},T7={dispatchEvent:"CommunityCore",...c("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...c("GridState",{getState:0,setState:0}),...c("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...c("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...c("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...c("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...c("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...c("ValueCache",{expireValueCache:0}),...c("CellApi",{getCellValue:0}),...c("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...c("Sort",{onSortChanged:0}),...c("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...c("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...c("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...c("HighlightChanges",{flashCells:0}),...c("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...c("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...c("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...c("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...c("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...c("ColumnResize",{setColumnWidths:0}),...c("ColumnHover",{isColumnHovered:0}),...c("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...c("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...c("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...c("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...c("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...c("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...c("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...c("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...c("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...c("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...c("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...c("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...c("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...c("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...c("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...c("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...c("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...c("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...c("ContextMenu",{showContextMenu:0}),...c("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...c("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...c("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...c("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...c("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...c("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...c("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...c("StatusBar",{getStatusPanel:0}),...c("AiToolkit",{getStructuredSchema:0})},g2={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},R_=(Q,z)=>Q.eventSvc.dispatchEvent(z),G$=class{};Reflect.defineProperty(G$,"name",{value:"GridApi"});var S_=class extends j{constructor(){super();this.beanName="apiFunctionSvc",this.api=new G$,this.fns={...g2,dispatchEvent:R_},this.preDestroyLink="";let{api:Q}=this;for(let z of Object.keys(T7))Q[z]=this.makeApi(z)[z]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(Q,z){let{fns:J,beans:Z}=this;if(J!==g2)J[Q]=Z?.validation?.validateApiFunction(Q,z)??z}makeApi(Q){return{[Q]:(...z)=>{let{beans:J,fns:{[Q]:Z}}=this;return Z?Z(J,...z):this.apiNotFound(Q)}}}apiNotFound(Q){let{beans:z,gos:J,preDestroyLink:Z}=this;if(!z)R(26,{fnName:Q,preDestroyLink:Z});else{let $=T7[Q];if(J.assertModuleRegistered($,`api.${Q}`))R(27,{fnName:Q,module:$})}}destroy(){super.destroy(),this.fns=g2,this.beans=null}};function O_(Q){return Q.context.getId()}function P_(Q){Q.gridDestroySvc.destroy()}function T_(Q){return Q.gridDestroySvc.destroyCalled}function v_(Q,z){return Q.gos.get(z)}function I_(Q,z,J){q$(Q,{[z]:J})}function q$(Q,z){Q.gos.updateGridOptions({options:z})}function C_(Q,z){let J=z.replace(/Module$/,"");return Q.gos.isModuleRegistered(J)}function uZ(Q,z,J){let Z=h(Q,z,J);if(Z){let{className:X}=Z;if(typeof X==="string"&&X.includes("ag-icon")||typeof X==="object"&&X["ag-icon"])return Z}let $=Z0({tag:"span"});return $.appendChild(Z),$}function h(Q,z,J){let Z=null;if(Q==="smallDown")R(262);else if(Q==="smallLeft")R(263);else if(Q==="smallRight")R(264);let $=J?.getColDef().icons;if($)Z=$[Q];if(z.gos&&!Z){let X=z.gos.get("icons");if(X)Z=X[Q]}if(Z){let X;if(typeof Z==="function")X=Z();else if(typeof Z==="string")X=Z;else{R(38,{iconName:Q});return}if(typeof X==="string")return v5(X);if(XJ(X))return X;R(133,{iconName:Q});return}else{let X=z.registry.getIcon(Q);if(!X)z.validation?.validateIcon(Q);return Z0({tag:"span",cls:`ag-icon ag-icon-${X??Q}`,role:"presentation",attrs:{unselectable:"on"}})}}var b_=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}",y_={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},x_=class extends x{constructor(){super();this.dragSource=null,this.eIcon=S,this.eLabel=S,this.eGhost=S,this.registerCSS(b_)}postConstruct(){let Q=(z)=>uZ(z,this.beans,null);this.dropIconMap={pinned:Q("columnMovePin"),hide:Q("columnMoveHide"),move:Q("columnMoveMove"),left:Q("columnMoveLeft"),right:Q("columnMoveRight"),group:Q("columnMoveGroup"),aggregate:Q("columnMoveValue"),pivot:Q("columnMovePivot"),notAllowed:Q("dropNotAllowed")}}init(Q){this.dragSource=Q.dragSource,this.setTemplate(y_),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(Q,z){let{eGhost:J,eIcon:Z,dragSource:$,dropIconMap:X,gos:Y}=this;z0(Z);let G=null;if(!Q)Q=$?.getDefaultIconName?$.getDefaultIconName():"notAllowed";if(G=X[Q],J.classList.toggle("ag-dnd-ghost-not-allowed",Q==="notAllowed"),Z.classList.toggle("ag-shake-left-to-right",z),G===X.hide&&Y.get("suppressDragLeaveHidesColumns"))return;if(G)Z.appendChild(G)}setLabel(Q){this.eLabel.textContent=Q}};var H$=(Q,z)=>{if(z!=null&&Q?.setPointerCapture)try{return Q.setPointerCapture(z),Q.hasPointerCapture(z)}catch{}return!1},w_=(Q,z)=>{if(typeof PointerEvent>"u"||!(z instanceof PointerEvent))return null;let J=z.pointerId;if(!H$(Q,J))return null;let Z={eElement:Q,pointerId:J,onLost($){g_(Z,$)}};return Q.addEventListener("lostpointercapture",Z.onLost),Z},N_=(Q)=>{if(!Q)return;_$(Q);let{eElement:z,pointerId:J}=Q;if(!z)return;try{z.releasePointerCapture(J)}catch{}Q.eElement=null},_$=(Q)=>{let{eElement:z,onLost:J}=Q;if(z&&J)z.removeEventListener("lostpointercapture",J),Q.onLost=null},g_=(Q,z)=>{_$(Q);let{eElement:J,pointerId:Z}=Q;if(J&&z.pointerId===Z)H$(J,Z)},ez,Z1,h2={passive:!0},sQ={passive:!1},kQ=(Q)=>{if(!Z1)Z1=new WeakSet;else if(Z1.has(Q))return!1;return Z1.add(Q),!0},h_=class extends j0{constructor(){super(...arguments);this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!ez?.has(s0(this.beans))}hasPointerCapture(){let Q=this.drag?.pointerCapture;return!!(Q&&this.beans.eRootDiv.hasPointerCapture?.(Q.pointerId))}destroy(){if(this.drag)this.cancelDrag();let Q=this.dragSources;for(let z of Q)v7(z);Q.length=0,super.destroy()}removeDragSource(Q){let z=this.dragSources;for(let J=0,Z=z.length;Jthis.onPointerDown(Q,H),sQ],[z,"mousedown",(H)=>this.onMouseDown(Q,H)]);let q=this.gos.get("suppressTouch");if(J&&!q)pJ(Z,[z,"touchstart",(_)=>this.onTouchStart(Q,_),sQ])}cancelDrag(Q){let z=this.drag;if(Q??(Q=z?.eElement),Q)this.eventSvc.dispatchEvent({type:"dragCancelled",target:Q});z?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(Q){let z=Q.type;return(z==="mousemove"||z==="pointermove")&&Q.cancelable&&n1(this.beans,Q)&&!w1(m2(Q))}initDrag(Q,...z){this.drag=Q;let J=this.beans,Z=(G)=>this.onScroll(G),$=(G)=>this.onKeyDown(G),X=s0(J),Y=Y0(J);pJ(Q.handlers,[X,"contextmenu",J1],[X,"keydown",$],[Y,"scroll",Z,{capture:!0}],[Y.defaultView||window,"scroll",Z],...z)}destroyDrag(){this.dragging=!1;let Q=this.drag;if(Q){let z=Q.rootEl;if(ez?.get(z)===Q)ez.delete(z);this.drag=null,N_(Q.pointerCapture),I5(Q.handlers)}}onPointerDown(Q,z){if(this.isPointer())return;let J=this.beans;if(Z1?.has(z))return;let Z=z.pointerType;if(Z==="touch"){if(J.gos.get("suppressTouch")||!Q.includeTouch)return;if(Q.stopPropagationForTouch)z.stopPropagation();if(w1(m2(z)))return}if(!z.isPrimary)return;if(Z==="mouse"&&z.button!==0)return;this.destroyDrag();let $=s0(J),X=Q.eElement,Y=z.pointerId,G=new u2($,Q,z,Y);ez??(ez=new WeakMap),ez.set($,G);let q=(W)=>{if(W.pointerId===Y)this.onMouseOrPointerMove(W)},H=(W)=>{if(W.pointerId===Y)this.onMouseOrPointerUp(W)},_=(W)=>{if(W.pointerId===Y&&kQ(W))this.cancelDrag()},U=(W)=>this.draggingPreventDefault(W);if(this.initDrag(G,[$,"pointerup",H],[$,"pointercancel",_],[$,"pointermove",q,sQ],[$,"touchmove",U,sQ],[X,"mousemove",U,sQ]),Q.dragStartPixels===0)this.onMouseOrPointerMove(z);else kQ(z)}onTouchStart(Q,z){if(this.gos.get("suppressTouch")||!Q.includeTouch)return;if(!kQ(z))return;if(w1(m2(z)))return;if(Q.stopPropagationForTouch)z.stopPropagation();if(this.isPointer()){if(this.dragging)J1(z);return}this.destroyDrag();let Z=this.beans,$=s0(Z),X=new u2($,Q,z.touches[0]),Y=(W)=>this.onTouchMove(W),G=(W)=>this.onTouchUp(W),q=(W)=>this.onTouchCancel(W),H=(W)=>this.draggingPreventDefault(W),_=s0(Z),U=z.target??Q.eElement;if(this.initDrag(X,[U,"touchmove",Y,h2],[U,"touchend",G,h2],[U,"touchcancel",q,h2],[_,"touchmove",H,sQ],[_,"touchend",G,sQ],[_,"touchcancel",q,sQ]),Q.dragStartPixels===0)this.onMove(X.start)}draggingPreventDefault(Q){if(this.dragging)J1(Q)}onMouseDown(Q,z){if(z.button!==0)return;if(Z1?.has(z))return;if(this.isPointer())return;let J=this.beans;this.destroyDrag();let Z=new u2(s0(J),Q,z),$=(G)=>this.onMouseOrPointerMove(G),X=(G)=>this.onMouseOrPointerUp(G),Y=s0(J);if(this.initDrag(Z,[Y,"mousemove",$],[Y,"mouseup",X]),Q.dragStartPixels===0)this.onMouseOrPointerMove(z);else kQ(z)}onScroll(Q){if(!kQ(Q))return;let z=this.drag,J=z?.lastDrag;if(J&&this.dragging)z.params?.onDragging?.(J)}onMouseOrPointerMove(Q){if(!kQ(Q))return;if(cz())Y0(this.beans).getSelection()?.removeAllRanges();if(this.shouldPreventMouseEvent(Q))J1(Q);this.onMove(Q)}onTouchCancel(Q){let z=this.drag;if(!z||!kQ(Q))return;if(!G1(z.start,Q.changedTouches))return;this.cancelDrag()}onTouchMove(Q){let z=this.drag;if(!z||!kQ(Q))return;let J=G1(z.start,Q.touches);if(J)this.onMove(J),this.draggingPreventDefault(Q)}onMove(Q){let z=this.drag;if(!z)return;z.lastDrag=Q;let J=z.params;if(!this.dragging){let Z=z.start,X=J.dragStartPixels??4;if(i8(Q,Z,X))return;if(this.dragging=!0,J.capturePointer)z.pointerCapture=w_(this.beans.eRootDiv,Q);if(this.eventSvc.dispatchEvent({type:"dragStarted",target:J.eElement}),J.onDragStart?.(Z),this.drag!==z)return;if(J.onDragging?.(Z),this.drag!==z)return}J.onDragging?.(Q)}onTouchUp(Q){let z=this.drag;if(z&&kQ(Q))this.onUp(G1(z.start,Q.changedTouches))}onMouseOrPointerUp(Q){if(kQ(Q))this.onUp(Q)}onUp(Q){let z=this.drag;if(!z)return;if(!Q)Q=z.lastDrag;if(Q&&this.dragging)this.dragging=!1,z.params.onDragStop?.(Q),this.eventSvc.dispatchEvent({type:"dragStopped",target:z.params.eElement});this.destroyDrag()}onKeyDown(Q){if(Q.key===V.ESCAPE)this.cancelDrag()}},v7=(Q)=>{I5(Q.handlers);let z=Q.oldTouchAction;if(z!=null){let J=Q.params.eElement.style;if(J)J.touchAction=z}},u2=class{constructor(Q,z,J,Z=null){this.rootEl=Q,this.params=z,this.start=J,this.pointerId=Z,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=z.eElement}},m2=(Q)=>{let z=Q.target;return z instanceof Element?z:null},u_=class extends h_{shouldPreventMouseEvent(Q){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(Q)}},m_=class extends j{constructor(){super(...arguments);this.beanName="horizontalResizeSvc"}addResizeBar(Q){let z={dragStartPixels:Q.dragStartPixels||0,eElement:Q.eResizeBar,onDragStart:this.onDragStart.bind(this,Q),onDragStop:this.onDragStop.bind(this,Q),onDragging:this.onDragging.bind(this,Q),onDragCancel:this.onDragStop.bind(this,Q),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:J}=this.beans;return J.addDragSource(z),()=>J.removeDragSource(z)}onDragStart(Q,z){this.dragStartX=z.clientX,this.setResizeIcons();let J=z instanceof MouseEvent&&z.shiftKey===!0;Q.onResizeStart(J)}setResizeIcons(){let Q=this.beans.ctrlsSvc.get("gridCtrl");Q.setResizeCursor(1),Q.disableUserSelect(!0)}onDragStop(Q){Q.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){let Q=this.beans.ctrlsSvc.get("gridCtrl");Q.setResizeCursor(!1),Q.disableUserSelect(!1)}onDragging(Q,z){this.resizeAmount=z.clientX-this.dragStartX,Q.onResizing(this.resizeAmount)}};var mZ=class{constructor(Q){if(this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=Q.scrollContainer,this.scrollHorizontally=Q.scrollAxis.includes("x"),this.scrollVertically=Q.scrollAxis.includes("y"),this.scrollByTick=Q.scrollByTick??20,Q.onScrollCallback)this.onScrollCallback=Q.onScrollCallback;if(this.scrollVertically)this.getVerticalPosition=Q.getVerticalPosition,this.setVerticalPosition=Q.setVerticalPosition;if(this.scrollHorizontally)this.getHorizontalPosition=Q.getHorizontalPosition,this.setHorizontalPosition=Q.setHorizontalPosition;this.shouldSkipVerticalScroll=Q.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=Q.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(Q,z=!1){let J=!this.scrollVertically||z||this.shouldSkipVerticalScroll(),Z=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(J&&Z)return;let $=this.scrollContainer.getBoundingClientRect(),X=this.scrollByTick;if(this.tickLeft=!Z&&Q.clientX<$.left+X,this.tickRight=!Z&&Q.clientX>$.right-X,this.tickUp=!J&&Q.clientY<$.top+X,this.tickDown=!J&&Q.clientY>$.bottom-X,this.tickLeft||this.tickRight||this.tickUp||this.tickDown)this.ensureTickingStarted();else this.ensureCleared()}ensureTickingStarted(){if(this.tickingInterval===null)this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0}doTick(){this.tickCount++;let Q=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){let z=this.getVerticalPosition();if(this.tickUp)this.setVerticalPosition(z-Q);if(this.tickDown)this.setVerticalPosition(z+Q)}if(this.scrollHorizontally){let z=this.getHorizontalPosition();if(this.tickLeft)this.setHorizontalPosition(z-Q);if(this.tickRight)this.setHorizontalPosition(z+Q)}if(this.onScrollCallback)this.onScrollCallback()}ensureCleared(){if(this.tickingInterval)window.clearInterval(this.tickingInterval),this.tickingInterval=null}},W1=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},pz=(Q)=>{let z=Q.childrenAfterGroup;while(z?.length){let J=z[0];if(J.sourceRowIndex>=0)return J;z=J.childrenAfterGroup}},U$=(Q,z,J,Z)=>{if(!z.size||!Q)return!1;let $=!1,X=Q.length??0,Y=-1;if(J){if(Y=J.sourceRowIndex,J=Y<0?pz(J):null,J)Y=J.sourceRowIndex}if(Y<0||Y>=X)Y=X;else if(!Z)++Y;let G=Y,q=Math.min(Y,X-1);for(let U of z){let W=U.sourceRowIndex;if(Wq)q=W}let H=G;for(let U=G;U=Y;--U){let W=Q[U];if(z.has(W))continue;if(W.sourceRowIndex!==_)W.sourceRowIndex=_,Q[_]=W,$=!0;--_}for(let U of z){if(U.sourceRowIndex!==H)U.sourceRowIndex=H,Q[H]=U,$=!0;++H}return $};function U6(Q,z){return EJ(Q,z.target)?.getFocusedCellPosition()??null}function W6(Q,z){let J=V0(Q.gos,"normal"),Z=z,$,X;if(Z.clientX!=null||Z.clientY!=null)$=Z.clientX,X=Z.clientY;else $=Z.x,X=Z.y;let{pageFirstPixel:Y}=Q.pageBounds.getCurrentPagePixelRange();if(X+=Y,J){let G=Q.ctrlsSvc.getScrollFeature(),q=G.getVScrollPosition(),H=G.getHScrollPosition();$+=H.left,X+=q.top}return{x:$,y:X}}var cZ={moduleName:"Drag",version:p,beans:[u_]};var LJ={moduleName:"SharedDragAndDrop",version:p,beans:[gq],dependsOn:[cZ],userComponents:{agDragAndDropImage:x_},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}};var B6={moduleName:"HorizontalResize",version:p,beans:[m_],dependsOn:[cZ]},c_=":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}",p_=class extends j{constructor(){super(...arguments);this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(Q)=>this.gridBodyCtrl=Q.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(Q){this.suppressAnimation=Q}start(){if(this.active)return;let{gos:Q}=this;if(Q.get("suppressColumnMoveAnimation"))return;if(Q.get("enableRtl"))return;this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0}finish(){if(!this.active)return;this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(Q){if(this.activeNext)this.executeNextFuncs.push(Q);else Q()}executeLaterVMTurn(Q){if(this.active)this.executeLaterFuncs.push(Q);else Q()}ensureAnimationCssClassPresent(){this.animationThreadCount++;let Q=this.animationThreadCount,{gridBodyCtrl:z}=this;z.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{if(this.animationThreadCount===Q)z.setColumnMovingCss(!1)})}flush(Q,z){let{executeNextFuncs:J,executeLaterFuncs:Z}=this;if(J.length===0&&Z.length===0){Q(),z();return}let $=(X)=>{while(X.length){let Y=X.pop();if(Y)Y()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{Q(),$(J)},0),window.setTimeout(()=>{z(),$(Z)},200)})}};function i_(Q,z,J){Q.colMoves?.moveColumnByIndex(z,J,"api")}function n_(Q,z,J){Q.colMoves?.moveColumns(z,J,"api")}var d_=class extends j{constructor(Q){super();this.pinned=Q,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(Q){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;let z=Q.dragItem.columns;if(!z)return;for(let J of z){if(!J.isPrimary())continue;if(J.isAnyFunctionActive())continue;if(J.isAllowValue())this.columnsToAggregate.push(J);else if(J.isAllowRowGroup())this.columnsToGroup.push(J);else if(J.isAllowPivot())this.columnsToPivot.push(J)}}getIconName(){if(this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0)return this.pinned?"pinned":"move";return null}onDragLeave(Q){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(Q){}onDragStop(Q){let{valueColsSvc:z,rowGroupColsSvc:J,pivotColsSvc:Z}=this.beans;if(this.columnsToAggregate.length>0)z?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop");if(this.columnsToGroup.length>0)J?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop");if(this.columnsToPivot.length>0)Z?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function t_(Q,z){if(!z||z.length<=1)return;if(z.filter((Z)=>Q.indexOf(Z)<0).length>0)return;z.sort((Z,$)=>{let X=Q.indexOf(Z),Y=Q.indexOf($);return X-Y})}function r_(Q){let z=[...Q];for(let J of Q){let Z=null,$=J.getParent();while($!=null&&$.getDisplayedLeafColumns().length===1)Z=$,$=$.getParent();if(Z!=null){let Y=Z.getColGroupDef()?.marryChildren?Z.getProvidedColumnGroup().getLeafColumns():Z.getLeafColumns();for(let G of Y)if(!z.includes(G))z.push(G)}}return z}function s_(Q,z,J,Z){let $=Z.allCols,X=null,Y=null;for(let G=0;G$.includes(W));if(Y===null)Y=_;else if(!X0(_,Y))break;let U=a_(H);if(X===null||U=E)return;if(J&&K<=E)return}let F=s_(B,W,H,_);if(!F)return;let D=F.move;if(D>q.getCols().length-W.length)return;return{columns:W,toIndex:D}}function B$(Q){let{columns:z,toIndex:J}=W$(Q)||{},{finished:Z,colMoves:$}=Q;if(!z||J==null)return null;return $.moveColumns(z,J,"uiColumnMoved",Z),Z?null:{columns:z,toIndex:J}}function l_(Q,z){let J=z.getCols(),Z=Q.map((q)=>J.indexOf(q)).sort((q,H)=>q-H),$=Z[0];return b(Z)-$!==Z.length-1?null:$}function a_(Q){function z(Z){let $=[],X=Z.getOriginalParent();while(X!=null)$.push(X),X=X.getOriginalParent();return $}let J=0;for(let Z=0;ZX.length?[$,X]:[X,$];for(let Y of $)if(X.indexOf(Y)===-1)J++}return J}function o_(Q,z){switch(z){case"left":return Q.leftCols;case"right":return Q.rightCols;default:return Q.centerCols}}function e_(Q){let{movingCols:z,draggingRight:J,xPosition:Z,pinned:$,gos:X,colModel:Y,visibleCols:G}=Q;if(X.get("suppressMovableColumns")||z.some((M)=>M.getColDef().suppressMovable))return[];let H=o_(G,$),_=Y.getCols(),U=H.filter((M)=>z.includes(M)),W=H.filter((M)=>!z.includes(M)),B=_.filter((M)=>!z.includes(M)),E=0,K=Z;if(J){let M=0;for(let k of U)M+=k.getActualWidth();K-=M}if(K>0){for(let M=0;M0){let M=W[E-1];L=B.indexOf(M)+1}else if(L=B.indexOf(W[0]),L===-1)L=0;let F=[L],D=(M,k)=>M-k;if(J){let M=L+1,k=_.length-1;while(M<=k)F.push(M),M++;F.sort(D)}else{let M=L,k=_.length-1,f=_[M];while(M<=k&&H.indexOf(f)<0)M++,F.push(M),f=_[M];M=L-1;let A=0;while(M>=A)F.push(M),M--;F.sort(D).reverse()}return F}function U5(Q){let{pinned:z,fromKeyboard:J,gos:Z,ctrlsSvc:$,useHeaderRow:X,skipScrollPadding:Y}=Q,G=$.getHeaderRowContainerCtrl(z)?.eViewport,{x:q}=Q;if(!G)return 0;if(J)q-=G.getBoundingClientRect().left;if(Z.get("enableRtl")){if(X)G=G.querySelector(".ag-header-row");q=G.clientWidth-q}if(z==null&&!Y)q+=$.get("center").getCenterViewportScrollLeft();return q}function c2(Q,z){for(let J of Q)J.moving=z,J.dispatchColEvent("movingChanged","uiColumnMoved")}var I7=7,W5=100,uJ=W5/2,QU=5,zU=100,JU=class extends j{constructor(Q){super();this.pinned=Q,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!T(Q)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(Q)=>{this.gridBodyCon=Q.gridBodyCtrl})}getIconName(){let{pinned:Q,lastDraggingEvent:z}=this,{dragItem:J}=z||{},Z=J?.columns??[];for(let $ of Z){let X=$.getPinned();if($.getColDef().lockPinned){if(X==Q)return"move";continue}let Y=J?.containerType;if(Y===Q||!Q)return"move";if(Q&&(!X||Y!==Q))return"pinned"}return"notAllowed"}onDragEnter(Q){let z=Q.dragItem,J=z.columns;if(Q.dragSource.type===0)this.setColumnsVisible(J,!0,"uiColumnDragged");else{let $=z.visibleState,X=(J||[]).filter((Y)=>$[Y.getId()]&&!Y.isVisible());this.setColumnsVisible(X,!0,"uiColumnDragged")}if(!this.gos.get("suppressMoveWhenColumnDragging"))this.attemptToPinColumns(J,this.pinned);this.onDragging(Q,!0,!0)}onDragging(Q=this.lastDraggingEvent,z=!1,J=!1,Z=!1){let{gos:$,ctrlsSvc:X}=this.beans,Y=$.get("suppressMoveWhenColumnDragging");if(Z&&!Y){this.finishColumnMoving();return}if(this.lastDraggingEvent=Q,!Q||!Z&&n(Q.hDirection))return;let G=U5({x:Q.x,pinned:this.pinned,gos:$,ctrlsSvc:X});if(!z)this.checkCenterForScrolling(G);if(Y)this.handleColumnDragWhileSuppressingMovement(Q,z,J,G,Z);else this.handleColumnDragWhileAllowingMovement(Q,z,J,G,Z)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(Q,z,J){if(!Q?.length)return;let Z=Q.filter(($)=>!$.getColDef().lockVisible);if(!Z.length)return;this.beans.colModel.setColsVisible(Z,z,J)}finishColumnMoving(){this.clearHighlighted();let Q=this.lastMovedInfo;if(!Q)return;let{columns:z,toIndex:J}=Q;this.beans.colMoves.moveColumns(z,J,"uiColumnMoved",!0)}updateDragItemContainerType(){let{lastDraggingEvent:Q}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!Q)return;let z=Q.dragItem;if(!z)return;z.containerType=this.pinned}handleColumnDragWhileSuppressingMovement(Q,z,J,Z,$){let X=this.getAllMovingColumns(Q,!0);if($){let Y=this.isAttemptingToPin(X);if(Y)this.attemptToPinColumns(X,void 0,!0);let{fromLeft:G,xPosition:q}=this.getNormalisedXPositionInfo(X,Y)||{};if(G==null||q==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:X,xPosition:q,fromEnter:z,fakeEvent:J,fromLeft:G})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(Q))return;this.highlightHoveredColumn(X,Z)}}handleColumnDragWhileAllowingMovement(Q,z,J,Z,$){let X=this.getAllMovingColumns(Q),Y=this.normaliseDirection(Q.hDirection)==="right",G=Q.dragSource.type===1,q=this.getMoveColumnParams({allMovingColumns:X,isFromHeader:G,xPosition:Z,fromLeft:Y,fromEnter:z,fakeEvent:J}),H=B$({...q,finished:$});if(H)this.lastMovedInfo=H}getAllMovingColumns(Q,z=!1){let J=Q.dragSource.getDragItem(),Z=null;if(z){if(Z=J.columnsInSplit,!Z)Z=J.columns}else Z=J.columns;let $=(X)=>X.getColDef().lockPinned?X.getPinned()==this.pinned:!0;if(!Z)return[];return Z.filter($)}getMoveColumnParams(Q){let{allMovingColumns:z,isFromHeader:J,xPosition:Z,fromLeft:$,fromEnter:X,fakeEvent:Y}=Q,{gos:G,colModel:q,colMoves:H,visibleCols:_}=this.beans;return{allMovingColumns:z,isFromHeader:J,fromLeft:$,xPosition:Z,pinned:this.pinned,fromEnter:X,fakeEvent:Y,gos:G,colModel:q,colMoves:H,visibleCols:_}}highlightHoveredColumn(Q,z){let{gos:J,colModel:Z}=this.beans,$=J.get("enableRtl"),X=Z.getCols().filter((_)=>_.isVisible()&&_.getPinned()===this.pinned),Y=null,G=null,q=null;for(let _ of X){if(G=_.getActualWidth(),Y=this.getNormalisedColumnLeft(_,0,$),Y!=null){let U=Y+G;if(Y<=z&&U>=z){q=_;break}}Y=null,G=null}if(!q){for(let _=X.length-1;_>=0;_--){let U=X[_],W=X[_].getParent();if(!W){q=U;break}let B=W?.getDisplayedLeafColumns();if(B.length){q=b(B);break}}if(!q)return;Y=this.getNormalisedColumnLeft(q,0,$),G=q.getActualWidth()}else if(Q.indexOf(q)!==-1)q=null;if(q==null||Y==null||G==null){if(this.lastHighlightedColumn?.column!==q)this.clearHighlighted();return}let H;if(z-YI7;return z&&J||Q.some((Z)=>Z.getPinned()!==this.pinned)}moveColumnsAfterHighlight(Q){let{allMovingColumns:z,xPosition:J,fromEnter:Z,fakeEvent:$,fromLeft:X}=Q,Y=this.getMoveColumnParams({allMovingColumns:z,isFromHeader:!0,xPosition:J,fromLeft:X,fromEnter:Z,fakeEvent:$}),{columns:G,toIndex:q}=W$(Y)||{};if(G&&q!=null)this.lastMovedInfo={columns:G,toIndex:q};this.finishColumnMoving()}clearHighlighted(){let{lastHighlightedColumn:Q}=this;if(!Q)return;C7(Q.column,null),this.lastHighlightedColumn=null}checkCenterForScrolling(Q){if(!this.isCenterContainer)return;let z=this.beans.ctrlsSvc.get("center"),J=z.getCenterViewportScrollLeft(),Z=J+z.getCenterWidth(),$,X;if(this.gos.get("enableRtl"))$=QZ-uJ;else X=QZ-uJ;if(this.needToMoveRight=$,this.needToMoveLeft=X,X||$)this.ensureIntervalStarted();else this.ensureIntervalCleared()}ensureIntervalStarted(){if(this.movingIntervalId)return;this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),zU),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0)}ensureIntervalCleared(){if(!this.movingIntervalId)return;window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName())}moveInterval(){let Q;if(this.intervalCount++,Q=10+this.intervalCount*QU,Q>W5)Q=W5;let z=null,J=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft)z=J.scrollHorizontally(-Q);else if(this.needToMoveRight)z=J.scrollHorizontally(Q);if(z!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;let{pinnedCols:Z,dragAndDrop:$,gos:X}=this.beans;if(this.failedMoveAttempts<=I7+1||!Z)return;if($.setDragImageCompIcon("pinned"),!X.get("suppressMoveWhenColumnDragging")){let Y=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(Y,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(Q,z,J=!1){let Z=(Q||[]).filter((Y)=>!Y.getColDef().lockPinned);if(!Z.length)return 0;if(J)z=this.getPinDirection();let{pinnedCols:$,dragAndDrop:X}=this.beans;if($?.setColsPinned(Z,z,"uiColumnDragged"),J)X.nudge();return Z.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function C7(Q,z){if(Q.highlighted===z)return;Q.highlighted=z,Q.dispatchColEvent("headerHighlightChanged","uiColumnMoved")}function ZU(Q){let z=Q.length,J,Z;for(let $=0;${let $,X=Z.gridBodyCtrl.eBodyViewport;switch(J){case"left":$=[[X,Z.left.eContainer],[Z.bottomLeft.eContainer],[Z.topLeft.eContainer]];break;case"right":$=[[X,Z.right.eContainer],[Z.bottomRight.eContainer],[Z.topRight.eContainer]];break;default:$=[[X,Z.center.eViewport],[Z.bottomCenter.eViewport],[Z.topCenter.eViewport]];break}this.eSecondaryContainers=$}),this.moveColumnFeature=this.createManagedBean(new JU(J)),this.bodyDropPivotTarget=this.createManagedBean(new d_(J)),z.addDropTarget(this),this.addDestroyFunc(()=>z.removeDropTarget(this))}isInterestedIn(Q){return Q===1||Q===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(Q){return this.beans.colModel.isPivotMode()&&Q.dragSource.type===0}onDragEnter(Q){this.currentDropListener=this.isDropColumnInPivotMode(Q)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(Q)}onDragLeave(Q){this.currentDropListener.onDragLeave(Q)}onDragging(Q){this.currentDropListener.onDragging(Q)}onDragStop(Q){this.currentDropListener.onDragStop(Q)}onDragCancel(){this.currentDropListener.onDragCancel()}};function E$(Q,z){let J=[],Z=[],$=[];if(Q.forEach((Y)=>{let G=Y.getColDef().lockPosition;if(G==="right")$.push(Y);else if(G==="left"||G===!0)J.push(Y);else Z.push(Y)}),z.get("enableRtl"))return[...$,...Z,...J];return[...J,...Z,...$]}function K$(Q,z){let J=!0;return OQ(null,z,(Z)=>{if(!G0(Z))return;let $=Z;if(!$.getColGroupDef()?.marryChildren)return;let G=[];for(let W of $.getLeafColumns()){let B=Q.indexOf(W);G.push(B)}let q=Math.max.apply(Math,G),H=Math.min.apply(Math,G),_=q-H,U=$.getLeafColumns().length-1;if(_>U)J=!1}),J}var XU=class extends j{constructor(){super(...arguments);this.beanName="colMoves"}moveColumnByIndex(Q,z,J){let Z=this.beans.colModel.getCols();if(!Z)return;let $=Z[Q];this.moveColumns([$],z,J)}moveColumns(Q,z,J,Z=!0){let{colModel:$,colAnimation:X,visibleCols:Y,eventSvc:G}=this.beans,q=$.getCols();if(!q)return;if(z>q.length-Q.length){R(30,{toIndex:z});return}X?.start();let H=$.getColsForKeys(Q);if(this.doesMovePassRules(H,z))U7($.getCols(),H,z),Y.refresh(J),G.dispatchEvent({type:"columnMoved",columns:H,column:H.length===1?H[0]:null,toIndex:z,finished:Z,source:J});X?.finish()}doesMovePassRules(Q,z){let J=this.getProposedColumnOrder(Q,z);return this.doesOrderPassRules(J)}doesOrderPassRules(Q){let{colModel:z,gos:J}=this.beans;if(!K$(Q,z.getColTree()))return!1;if(!(($)=>{let X=(H)=>{if(!H)return 0;return H==="left"||H===!0?-1:1},Y=J.get("enableRtl"),G=Y?1:-1,q=!0;for(let H of $){let _=X(H.getColDef().lockPosition);if(Y){if(_>G)q=!1}else if(_G?"hide":"notAllowed",getDragItem:q?()=>qU(z,Y.allCols):()=>GU(z),dragItemName:J,onDragStarted:()=>{G=!Z.get("suppressDragLeaveHidesColumns"),c2(H,!0)},onDragStopped:()=>c2(H,!1),onDragCancelled:()=>c2(H,!1),onGridEnter:(W)=>{if(G){let{columns:B=[],visibleState:E}=W??{},K=q?(F)=>!E||E[F.getColId()]:()=>!0,L=B.filter((F)=>!F.getColDef().lockVisible&&K(F));$.setColsVisible(L,!0,"uiColumnMoved")}},onGridExit:(W)=>{if(G){let B=W?.columns?.filter((E)=>!E.getColDef().lockVisible)||[];$.setColsVisible(B,!1,"uiColumnMoved")}}};return X.addDragSource(U,!0),U}};function YU(Q,z){while(Q){if(Q.getGroupId()===z)return Q;Q=Q.getParent()}return}function GU(Q){let z={};return z[Q.getId()]=Q.isVisible(),{columns:[Q],visibleState:z,containerType:Q.pinned}}function qU(Q,z){let J=Q.getProvidedColumnGroup().getLeafColumns(),Z={};for(let G of J)Z[G.getId()]=G.isVisible();let $=[];for(let G of z)if(J.indexOf(G)>=0)$.push(G),$0(J,G);for(let G of J)$.push(G);let X=[],Y=Q.getLeafColumns();for(let G of $)if(Y.indexOf(G)!==-1)X.push(G);return{columns:$,columnsInSplit:X,visibleState:Z,containerType:X[0]?.pinned}}var FJ={moduleName:"ColumnMove",version:p,beans:[XU,p_],apiFunctions:{moveColumnByIndex:i_,moveColumns:n_},dependsOn:[LJ],css:[c_]},HU=class extends j{constructor(){super(...arguments);this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(Q)=>{this.centerRowContainerCtrl=Q.center})}getPreferredWidthForColumn(Q,z){let J=this.getHeaderCellForColumn(Q);if(!J)return-1;let Z=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(Q);if(!z)Z.push(J);return this.getPreferredWidthForElements(Z)}getPreferredWidthForColumnGroup(Q){let z=this.getHeaderCellForColumn(Q);if(!z)return-1;return this.getPreferredWidthForElements([z])}getPreferredWidthForElements(Q,z){let J=document.createElement("form");J.style.position="fixed";let Z=this.centerRowContainerCtrl.eContainer;for(let X of Q)this.cloneItemIntoDummy(X,J);Z.appendChild(J);let $=Math.ceil(J.getBoundingClientRect().width);return J.remove(),z=z??this.gos.get("autoSizePadding"),$+z}getHeaderCellForColumn(Q){let z=null;for(let J of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){let Z=J.getHtmlElementForColumnHeader(Q);if(Z!=null)z=Z}return z}cloneItemIntoDummy(Q,z){let J=Q.cloneNode(!0);J.style.width="",J.style.position="static",J.style.left="";let Z=document.createElement("div"),$=Z.classList;if(["ag-header-cell","ag-header-group-cell"].some((G)=>J.classList.contains(G)))$.add("ag-header","ag-header-row"),Z.style.position="static";else $.add("ag-row");let Y=Q.parentElement;while(Y){if(["ag-header-row","ag-row"].some((q)=>Y.classList.contains(q))){for(let q=0;qX.getPinned());Q.dispatchEvent({type:"columnPinned",pinned:$!=null?$:null,columns:z,column:Z,source:J})}function UU(Q,z,J){if(!z.length)return;let Z=z.length===1?z[0]:null,$=F$(z,(X)=>X.isVisible());Q.dispatchEvent({type:"columnVisible",visible:$,columns:z,column:Z,source:J})}function M$(Q,z,J,Z){Q.dispatchEvent({type:z,columns:J,column:J&&J.length==1?J[0]:null,source:Z})}function L1(Q,z,J,Z,$=null){if(z?.length)Q.dispatchEvent({type:"columnResized",columns:z,column:z.length===1?z[0]:null,flexColumns:$,finished:J,source:Z})}var WU=class extends j{constructor(Q,z,J,Z){super();this.comp=Q,this.eResize=z,this.pinned=J,this.columnGroup=Z}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}let{horizontalResizeSvc:Q,gos:z,colAutosize:J}=this.beans,Z=Q.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(Z),!z.get("suppressAutoSize")&&J)this.addDestroyFunc(J.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(Q){let{columnsToResize:z,resizeStartWidth:J,resizeRatios:Z,groupAfterColumns:$,groupAfterStartWidth:X,groupAfterRatios:Y}=this.getInitialValues(Q);this.resizeCols=z,this.resizeStartWidth=J,this.resizeRatios=Z,this.resizeTakeFromCols=$,this.resizeTakeFromStartWidth=X,this.resizeTakeFromRatios=Y,this.toggleColumnResizing(!0)}onResizing(Q,z,J="uiColumnResized"){let Z=this.normaliseDragChange(z),$=this.resizeStartWidth+Z;this.resizeColumnsFromLocalValues($,J,Q)}getInitialValues(Q){let z=(q)=>q.reduce((H,_)=>H+_.getActualWidth(),0),J=(q,H)=>q.map((_)=>_.getActualWidth()/H),Z=this.getColumnsToResize(),$=z(Z),X=J(Z,$),Y={columnsToResize:Z,resizeStartWidth:$,resizeRatios:X},G=null;if(Q)G=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null;if(G){let q=G.getDisplayedLeafColumns(),H=Y.groupAfterColumns=q.filter((U)=>U.isResizable()),_=Y.groupAfterStartWidth=z(H);Y.groupAfterRatios=J(H,_)}else Y.groupAfterColumns=void 0,Y.groupAfterStartWidth=void 0,Y.groupAfterRatios=void 0;return Y}resizeLeafColumnsToFit(Q){let z=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),J=this.getInitialValues();if(z>J.resizeStartWidth)this.resizeColumns(J,z,Q,!0)}resizeColumnsFromLocalValues(Q,z,J=!0){if(!this.resizeCols||!this.resizeRatios)return;let Z={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(Z,Q,z,J)}resizeColumns(Q,z,J,Z=!0){let{columnsToResize:$,resizeStartWidth:X,resizeRatios:Y,groupAfterColumns:G,groupAfterStartWidth:q,groupAfterRatios:H}=Q,_=[];if(_.push({columns:$,ratios:Y,width:z}),G){let U=z-X;_.push({columns:G,ratios:H,width:q-U})}if(this.beans.colResize?.resizeColumnSets({resizeSets:_,finished:Z,source:J}),Z)this.toggleColumnResizing(!1)}toggleColumnResizing(Q){this.comp.toggleCss("ag-column-resizing",Q)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((z)=>z.isResizable())}normaliseDragChange(Q){let z=Q;if(this.gos.get("enableRtl")){if(this.pinned!=="left")z*=-1}else if(this.pinned==="right")z*=-1;return z}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},BU=class extends j{constructor(Q,z,J,Z,$){super();this.pinned=Q,this.column=z,this.eResize=J,this.comp=Z,this.ctrl=$}postConstruct(){let Q=[],z,J,Z=()=>{if(N(this.eResize,z),!z)return;let{horizontalResizeSvc:Y,colAutosize:G}=this.beans,q=Y.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(Q.push(q),J&&G)Q.push(G.addColumnAutosizeListeners(this.eResize,this.column))},$=()=>{for(let Y of Q)Y();Q.length=0},X=()=>{let Y=this.column.isResizable(),G=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;if(Y!==z||G!==J)z=Y,J=G,$(),Z()};X(),this.addDestroyFunc($),this.ctrl.setRefreshFunction("resize",X)}onResizing(Q,z){let{column:J,lastResizeAmount:Z,resizeStartWidth:$,beans:X}=this,Y=this.normaliseResizeAmount(z),G=$+Y,q=[{key:J,newWidth:G}],{pinnedCols:H,ctrlsSvc:_,colResize:U}=X;if(this.column.getPinned()){let W=H?.leftWidth??0,B=H?.rightWidth??0,E=xz(_.getGridBodyCtrl().eBodyViewport)-50;if(W+B+(Y-Z)>E)return}if(this.lastResizeAmount=Y,U?.setColumnWidths(q,this.resizeWithShiftKey,Q,"uiColumnResized"),Q)this.toggleColumnResizing(!1)}onResizeStart(Q){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=Q,this.toggleColumnResizing(!0)}toggleColumnResizing(Q){this.column.resizing=Q,this.comp.toggleCss("ag-column-resizing",Q)}normaliseResizeAmount(Q){let z=Q,J=this.pinned!=="left",Z=this.pinned==="right";if(this.gos.get("enableRtl")){if(J)z*=-1}else if(Z)z*=-1;return z}},EU=class extends j{constructor(){super(...arguments);this.beanName="colResize"}setColumnWidths(Q,z,J,Z){let $=[],{colModel:X,gos:Y,visibleCols:G}=this.beans;for(let q of Q){let H=X.getColDefCol(q.key)||X.getCol(q.key);if(!H)continue;if($.push({width:q.newWidth,ratios:[1],columns:[H]}),Y.get("colResizeDefault")==="shift")z=!z;if(z){let U=G.getColAfter(H);if(!U)continue;let W=H.getActualWidth()-q.newWidth,B=U.getActualWidth()+W;$.push({width:B,ratios:[1],columns:[U]})}}if($.length===0)return;this.resizeColumnSets({resizeSets:$,finished:J,source:Z})}resizeColumnSets(Q){let{resizeSets:z,finished:J,source:Z}=Q;if(!(!z||z.every((_)=>KU(_)))){if(J){let _=z&&z.length>0?z[0].columns:null;L1(this.eventSvc,_,J,Z)}return}let X=[],Y=[];for(let _ of z){let{width:U,columns:W,ratios:B}=_,E={},K={};for(let D of W)Y.push(D);let L=!0,F=0;while(L){if(F++,F>1000){e(31);break}L=!1;let D=[],M=0,k=U;W.forEach((A,O)=>{if(K[A.getId()])k-=E[A.getId()];else{D.push(A);let I=B[O];M+=I}});let f=1/M;D.forEach((A,O)=>{let v=O===D.length-1,I;if(v)I=k;else I=Math.round(B[O]*U*f),k-=I;let C=A.getMinWidth(),m=A.getMaxWidth();if(I0&&I>m)I=m,K[A.getId()]=!0,L=!0;E[A.getId()]=I})}for(let D of W){let M=E[D.getId()];if(D.getActualWidth()!==M)D.setActualWidth(M,Z),X.push(D)}}let G=X.length>0,q=[];if(G){let{colFlex:_,visibleCols:U,colViewport:W}=this.beans;q=_?.refreshFlexedColumns({resizingCols:Y,skipSetLeft:!0})??[],U.setLeftValues(Z),U.updateBodyWidths(),W.checkViewportColumns()}let H=Y.concat(q);if(G||J)L1(this.eventSvc,H,J,Z,q)}resizeHeader(Q,z,J){if(!Q.isResizable())return;let Z=Q.getActualWidth(),$=Q.getMinWidth(),X=Q.getMaxWidth(),Y=Math.min(Math.max(Z+z,$),X);this.setColumnWidths([{key:Q,newWidth:Y}],J,!0,"uiColumnResized")}createResizeFeature(Q,z,J,Z,$){return new BU(Q,z,J,Z,$)}createGroupResizeFeature(Q,z,J,Z){return new WU(Q,z,J,Z)}};function KU(Q){let{columns:z,width:J}=Q,Z=0,$=0,X=!0;for(let q of z){let H=q.getMinWidth();Z+=H||0;let _=q.getMaxWidth();if(_>0)$+=_;else X=!1}let Y=J>=Z,G=!X||J<=$;return Y&&G}var LU={moduleName:"ColumnResize",version:p,beans:[EU],apiFunctions:{setColumnWidths:_U},dependsOn:[B6,L$]},FU=class extends j{constructor(Q,z){super();this.removeChildListenersFuncs=[],this.columnGroup=z,this.comp=Q}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();let Q=this.onWidthChanged.bind(this);for(let z of this.columnGroup.getLeafColumns())z.__addEventListener("widthChanged",Q),z.__addEventListener("visibleChanged",Q),this.removeChildListenersFuncs.push(()=>{z.__removeEventListener("widthChanged",Q),z.__removeEventListener("visibleChanged",Q)})}removeListenersOnChildrenColumns(){for(let Q of this.removeChildListenersFuncs)Q();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){let Q=this.columnGroup.getActualWidth();this.comp.setWidth(`${Q}px`),this.comp.toggleCss("ag-hidden",Q===0)}},DU=class extends Y6{constructor(){super(...arguments);this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource)this.setDragSource(this.eGui)}}wireComp(Q,z,J,Z,$){let{column:X,beans:Y}=this,{context:G,colNames:q,colHover:H,rangeSvc:_,colResize:U}=Y;this.comp=Q,$=BJ(this,G,$),this.setGui(z,$),this.displayName=q.getDisplayNameForColumnGroup(X,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss($),this.setupExpandable($),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:Z,compBean:$}),this.setupUserComp(),this.addHeaderMouseListeners($,Z),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();let W=this.rowCtrl.pinned,B=X.getProvidedColumnGroup().getLeafColumns();if(H?.createHoverFeature($,B,z),_?.createRangeHighlightFeature($,X,Q),$.createManagedBean(new X6(X,z,Y)),$.createManagedBean(new FU(Q,X)),U)this.resizeFeature=$.createManagedBean(U.createGroupResizeFeature(Q,J,W,X));else Q.setResizableDisplayed(!1);$.createManagedBean(new cQ(z,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{return},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners($,B),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),$.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners($),$.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){let{column:Q,beans:z}=this,J=Q.getDefinition();return y(z.gos,{colDef:J,columnGroup:Q,floatingFilter:!1})}refreshMaxHeaderHeight(){let{gos:Q,comp:z}=this,J=Q.get("groupHeaderHeight");if(J!=null)if(J===0)z.setHeaderWrapperHidden(!0);else z.setHeaderWrapperMaxHeight(J);else z.setHeaderWrapperHidden(!1),z.setHeaderWrapperMaxHeight(null)}addHighlightListeners(Q,z){if(!this.beans.gos.get("suppressMoveWhenColumnDragging"))return;for(let J of z)Q.addManagedListeners(J,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,J)})}onLeafColumnHighlightChanged(Q){let z=this.column.getDisplayedLeafColumns(),J=z[0]===Q,Z=b(z)===Q;if(!J&&!Z)return;let $=Q.getHighlighted(),X=!!this.rowCtrl.getHeaderCellCtrls().find((q)=>{return q.column.isMoving()}),Y=!1,G=!1;if(X){let q=this.beans.gos.get("enableRtl"),H=$===1,_=$===0;if(J)if(q)G=H;else Y=_;if(Z)if(q)Y=_;else G=H}this.comp.toggleCss("ag-header-highlight-before",Y),this.comp.toggleCss("ag-header-highlight-after",G)}resizeHeader(Q,z){let{resizeFeature:J}=this;if(!J)return;let Z=J.getInitialValues(z);J.resizeColumns(Z,Z.resizeStartWidth+Q,"uiColumnResized",!0)}resizeLeafColumnsToFit(Q){this.resizeFeature?.resizeLeafColumnsToFit(Q)}setupUserComp(){let{colGroupSvc:Q,userCompFactory:z,gos:J,enterpriseMenuFactory:Z}=this.beans,$=this.column,X=$.getProvidedColumnGroup(),Y=y(J,{displayName:this.displayName,columnGroup:$,setExpanded:(q)=>{Q.setColumnGroupOpened(X,q,"gridInitializing")},setTooltip:(q,H)=>{J.assertModuleRegistered("Tooltip",3),this.setupTooltip(q,H)},showColumnMenu:(q,H)=>Z?.showMenuAfterButtonClick(X,q,"columnMenu",H),showColumnMenuAfterMouseClick:(q,H)=>Z?.showMenuAfterMouseEvent(X,q,"columnMenu",H),eGridHeader:this.eGui}),G=Iq(z,Y);if(G)this.comp.setUserCompDetails(G)}addHeaderMouseListeners(Q,z){let{column:J,comp:Z,beans:{rangeSvc:$},gos:X}=this,Y=(_)=>this.handleMouseOverChange(_.type==="mouseenter"),G=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",J.getProvidedColumnGroup()),q=(_)=>this.handleContextMenuMouseEvent(_,void 0,J.getProvidedColumnGroup());Q.addManagedListeners(this.eGui,{mouseenter:Y,mouseleave:Y,click:G,contextmenu:q}),Z.toggleCss("ag-header-group-cell-selectable",Zz(X));let H=$?.createHeaderGroupCellMouseListenerFeature(this.column,z);if(H)this.createManagedBean(H)}handleMouseOverChange(Q){this.eventSvc.dispatchEvent({type:Q?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(Q,z){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,Q,z)}setupExpandable(Q){let z=this.column.getProvidedColumnGroup();this.refreshExpanded();let J=this.refreshExpanded.bind(this);Q.addManagedListeners(z,{expandedChanged:J,expandableChanged:J})}refreshExpanded(){let{column:Q}=this;this.expandable=Q.isExpandable();let z=Q.isExpanded();if(this.expandable)this.comp.setAriaExpanded(z?"true":"false");else this.comp.setAriaExpanded(void 0);this.refreshHeaderStyles()}addClasses(){let{column:Q}=this,z=Q.getColGroupDef(),J=gZ(z,this.gos,null,Q);if(Q.isPadding()){if(J.push("ag-header-group-cell-no-group"),Q.getLeafColumns().every(($)=>$.isSpanHeaderHeight()))J.push("ag-header-span-height")}else if(J.push("ag-header-group-cell-with-group"),z?.wrapHeaderText)J.push("ag-header-cell-wrap-text");for(let Z of J)this.comp.toggleCss(Z,!0)}setupMovingCss(Q){let{column:z}=this,Z=z.getProvidedColumnGroup().getLeafColumns(),$=()=>this.comp.toggleCss("ag-header-cell-moving",z.isMoving());for(let X of Z)Q.addManagedListeners(X,{movingChanged:$});$()}onFocusIn(Q){if(!this.eGui.contains(Q.relatedTarget))this.focusThis(),this.announceAriaDescription()}handleKeyDown(Q){if(super.handleKeyDown(Q),!this.getWrapperHasFocus())return;let{column:J,expandable:Z,gos:$,beans:X}=this,Y=Zz($);if(Q.key!=V.ENTER)return;if(Y&&!Q.altKey)X.rangeSvc?.handleColumnSelection(J,Q);else if(Z){let G=!J.isExpanded();X.colGroupSvc.setColumnGroupOpened(J.getProvidedColumnGroup(),G,"uiColumnExpanded")}}refreshAnnouncement(){let Q,{gos:z}=this;if(Zz(z))Q=this.getLocaleTextFunc()("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group");this.ariaAnnouncement=Q}announceAriaDescription(){let{beans:Q,eGui:z,ariaAnnouncement:J}=this;if(!J||!z.contains(d(Q)))return;Q.ariaAnnounce?.announceValue(J,"columnHeader")}setDragSource(Q){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!Q)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(Q,this.column,this.displayName)??null}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some((Q)=>Q.getColDef().suppressMovable||Q.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function MU(Q,z,J){Q.colGroupSvc?.setColumnGroupOpened(z,J,"api")}function kU(Q,z,J){return Q.colGroupSvc?.getColumnGroup(z,J)??null}function VU(Q,z){return Q.colGroupSvc?.getProvidedColGroup(z)??null}function fU(Q,z,J){return Q.colNames.getDisplayNameForColumnGroup(z,J)||""}function AU(Q){return Q.colGroupSvc?.getColumnGroupState()??[]}function jU(Q,z){Q.colGroupSvc?.setColumnGroupState(z,"api")}function RU(Q){Q.colGroupSvc?.resetColumnGroupState("api")}function SU(Q){return Q.visibleCols.treeLeft}function OU(Q){return Q.visibleCols.treeCenter}function PU(Q){return Q.visibleCols.treeRight}function TU(Q){return Q.visibleCols.getAllTrees()}var k$=class{constructor(){this.existingIds={}}getInstanceIdForKey(Q){let z=this.existingIds[Q],J;if(typeof z!=="number")J=0;else J=z+1;return this.existingIds[Q]=J,J}};function vU(Q,z){for(let J=0;J=0)Q[Z]=Q[Q.length-1],Q.pop()}}var IU=class extends j{constructor(){super(...arguments);this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(Q,z=!1){let{colFlex:J,colModel:Z,colGroupSvc:$,colViewport:X,selectionColSvc:Y}=this.beans;if(!z)this.buildTrees(Z,$);$?.updateOpenClosedVisibility(),this.leftCols=p2(this.treeLeft),this.centerCols=p2(this.treeCenter),this.rightCols=p2(this.treeRight),Y?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(Z),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(Q),this.autoHeightCols=this.allCols.filter((G)=>G.isAutoHeight()),J?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(Z,this.leftCols,this.rightCols,Q),X.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:Q})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let Q=0;for(let z of this.allCols){let J=z.getParent();while(J){if(!J.isPadding()){let Z=J.getProvidedColumnGroup().getLevel()+1;if(Z>Q)Q=Z;break}J=J.getParent()}}return Q}updateBodyWidths(){let Q=NQ(this.centerCols),z=NQ(this.leftCols),J=NQ(this.rightCols);if(this.isBodyWidthDirty=this.bodyWidth!==Q,this.bodyWidth!==Q||this.leftWidth!==z||this.rightWidth!==J)this.bodyWidth=Q,this.leftWidth=z,this.rightWidth=J,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"})}setLeftValues(Q){this.setLeftValuesOfCols(Q),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(Q,z,J,Z){let $,X;if(this.gos.get("enableRtl"))$=z?z[0]:null,X=J?b(J):null;else $=z?b(z):null,X=J?J[0]:null;for(let Y of Q.getCols())Y.setLastLeftPinned(Y===$,Z),Y.setFirstRightPinned(Y===X,Z)}buildTrees(Q,z){let J=Q.getColsToShow(),Z=J.filter((q)=>q.getPinned()=="left"),$=J.filter((q)=>q.getPinned()=="right"),X=J.filter((q)=>q.getPinned()!="left"&&q.getPinned()!="right"),Y=new k$,G=(q)=>{return z?z.createColumnGroups(q):q.columns};this.treeLeft=G({columns:Z,idCreator:Y,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=G({columns:$,idCreator:Y,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=G({columns:X,idCreator:Y,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(Q){let z=Q.getCols(),J=[],Z=[],$=[];for(let X of z){let Y=X.getPinned();if(!Y)Z.push(X);else if(Y===!0||Y==="left")J.push(X);else $.push(X)}this.ariaOrderColumns=J.concat(Z).concat($)}getAriaColIndex(Q){let z;if(_0(Q))z=Q.getLeafColumns()[0];else z=Q;return this.ariaOrderColumns.indexOf(z)+1}setLeftValuesOfGroups(){for(let Q of[this.treeLeft,this.treeRight,this.treeCenter])for(let z of Q)if(_0(z))z.checkLeft()}setLeftValuesOfCols(Q){let{colModel:z}=this.beans;if(!z.getColDefCols())return;let Z=z.getCols().slice(0),$=this.gos.get("enableRtl");for(let X of[this.leftCols,this.rightCols,this.centerCols]){if($){let Y=NQ(X);for(let G of X)Y-=G.getActualWidth(),G.setLeft(Y,Q)}else{let Y=0;for(let G of X)G.setLeft(Y,Q),Y+=G.getActualWidth()}vU(Z,X)}for(let X of Z)X.setLeft(null,Q)}joinCols(){if(this.gos.get("enableRtl"))this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols);else this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){if(this.treeLeft&&this.treeRight&&this.treeCenter)return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);return null}isColDisplayed(Q){return this.allCols.indexOf(Q)>=0}getLeftColsForRow(Q){let{leftCols:z,beans:{colModel:J}}=this;if(!J.colSpanActive)return z;return this.getColsForRow(Q,z)}getRightColsForRow(Q){let{rightCols:z,beans:{colModel:J}}=this;if(!J.colSpanActive)return z;return this.getColsForRow(Q,z)}getColsForRow(Q,z,J,Z){let $=[],X=null;for(let Y=0;Y1){let W=H-1;for(let B=1;B<=W;B++)_.push(z[Y+B]);Y+=W}let U;if(J){U=!1;for(let W of _)if(J(W))U=!0}else U=!0;if(U){if($.length===0&&X){if(Z?Z(G):!1)$.push(X)}$.push(G)}X=G}return $}getContainerWidth(Q){switch(Q){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(Q){let z=this.allCols,J=z.indexOf(Q);if(J>0)return z[J-1];return null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};let Q=(z)=>{this.colsAndGroupsMap[z.getUniqueId()]=z};yz(this.treeCenter,!1,Q),yz(this.treeLeft,!1,Q),yz(this.treeRight,!1,Q)}isVisible(Q){return this.colsAndGroupsMap[Q.getUniqueId()]===Q}getFirstColumn(){let Q=this.gos.get("enableRtl"),z=["leftCols","centerCols","rightCols"];if(Q)z.reverse();for(let J=0;J{if(JQ(J))z.push(J)}),z}var CU=class extends j{constructor(){super(...arguments);this.beanName="colGroupSvc"}getColumnGroupState(){let Q=[],z=this.beans.colModel.getColTree();return OQ(null,z,(J)=>{if(G0(J))Q.push({groupId:J.getGroupId(),open:J.isExpanded()})}),Q}resetColumnGroupState(Q){let z=this.beans.colModel.getColDefColTree();if(!z)return;let J=[];OQ(null,z,(Z)=>{if(G0(Z)){let $=Z.getColGroupDef(),X={groupId:Z.getGroupId(),open:!$?void 0:$.openByDefault};J.push(X)}}),this.setColumnGroupState(J,Q)}setColumnGroupState(Q,z){let{colModel:J,colAnimation:Z,visibleCols:$,eventSvc:X}=this.beans;if(!J.getColTree().length)return;Z?.start();let G=[];for(let q of Q){let{groupId:H,open:_}=q,U=this.getProvidedColGroup(H);if(!U)continue;if(U.isExpanded()===_)continue;U.setExpanded(_),G.push(U)}if($.refresh(z,!0),G.length)X.dispatchEvent({type:"columnGroupOpened",columnGroup:G.length===1?G[0]:void 0,columnGroups:G});Z?.finish()}setColumnGroupOpened(Q,z,J){let Z;if(G0(Q))Z=Q.getId();else Z=Q||"";this.setColumnGroupState([{groupId:Z,open:z}],J)}getProvidedColGroup(Q){let z=null;return OQ(null,this.beans.colModel.getColTree(),(J)=>{if(G0(J)){if(J.getId()===Q)z=J}}),z}getGroupAtDirection(Q,z){let J=Q.getProvidedColumnGroup().getLevel()+Q.getPaddingLevel(),Z=Q.getDisplayedLeafColumns(),$=z==="After"?b(Z):Z[0],X=`getCol${z}`;while(!0){let Y=this.beans.visibleCols[X]($);if(!Y)return null;let G=this.getColGroupAtLevel(Y,J);if(G!==Q)return G}}getColGroupAtLevel(Q,z){let J=Q.getParent(),Z,$;while(!0){if(Z=J.getProvidedColumnGroup().getLevel(),$=J.getPaddingLevel(),Z+$<=z)break;J=J.getParent()}return J}updateOpenClosedVisibility(){let Q=this.beans.visibleCols.getAllTrees();yz(Q,!1,(z)=>{if(_0(z))z.calculateDisplayedColumns()})}getColumnGroup(Q,z){if(!Q)return null;if(_0(Q))return Q;let J=this.beans.visibleCols.getAllTrees(),Z=typeof z==="number",$=null;return yz(J,!1,(X)=>{if(_0(X)){let Y=X,G;if(Z)G=Q===Y.getGroupId()&&z===Y.getPartId();else G=Q===Y.getGroupId();if(G)$=Y}}),$}createColumnGroups(Q){let{columns:z,idCreator:J,pinned:Z,oldDisplayedGroups:$,isStandaloneStructure:X}=Q,Y=this.mapOldGroupsById($),G=[],q=z;while(q.length){let H=q;q=[];let _=0,U=(W)=>{let B=_;_=W;let E=H[B],L=(_0(E)?E.getProvidedColumnGroup():E).getOriginalParent();if(L==null){for(let D=B;DG0(_))){q.setChildren([Y]);continue}else{q.setChildren(Q);break}$.push(Y)}}return $}findDepth(Q){let z=0,J=Q;while(J?.[0]&&G0(J[0]))z++,J=J[0].getChildren();return z}findMaxDepth(Q,z){let J=z;for(let Z=0;Z=0;X--){let Y=new Cz(null,`FAKE_PATH_${Z.getId()}_${X}`,!0,X);this.createBean(Y),Y.setChildren([$]),$.originalParent=Y,$=Y}if(z===0)Z.originalParent=null;J.push($)}return J}findExistingGroup(Q,z){if(Q.groupId==null)return;for(let Z=0;Z{for(let $ of Z)if(_0($)){let X=$;z[$.getUniqueId()]=X,J(X.getChildren())}};if(Q)J(Q);return z}setupParentsIntoCols(Q,z){for(let J of Q??[]){if(J.parent!==z)this.beans.colViewport.colsWithinViewportHash="";if(J.parent=z,_0(J)){let Z=J;this.setupParentsIntoCols(Z.getChildren(),Z)}}}},E6={moduleName:"ColumnGroup",version:p,dynamicBeans:{headerGroupCellCtrl:DU},beans:[CU],apiFunctions:{getAllDisplayedColumnGroups:TU,getCenterDisplayedColumnGroups:OU,getColumnGroup:kU,getColumnGroupState:AU,getDisplayNameForColumnGroup:fU,getLeftDisplayedColumnGroups:SU,getProvidedColumnGroup:VU,getRightDisplayedColumnGroups:PU,resetColumnGroupState:RU,setColumnGroupOpened:MU,setColumnGroupState:jU}};function n0(Q,z,J){let{colModel:Z,rowGroupColsSvc:$,pivotColsSvc:X,autoColSvc:Y,selectionColSvc:G,colAnimation:q,visibleCols:H,pivotResultCols:_,environment:U,valueColsSvc:W,eventSvc:B,gos:E}=Q,K=Z.getColDefCols()??[],L=G?.getColumns();if(!K.length&&!L?.length)return!1;if(z?.state&&!z.state.forEach)return R(32),!1;let F=(f,A,O,v,I)=>{if(!f)return;let C=Jq(A,z.defaultState),m=C("flex").value1,w=C("sort").value1,a=C("sortType").value1,t=$z(w)||m5(a),u=LQ(a),Q0=IZ(w),r=t?{type:u,direction:Q0}:void 0;if(F9(Q,f,C("hide").value1,r,C("sortIndex").value1,C("pinned").value1,m,J),m==null){let S0=C("width").value1;if(S0!=null){let O0=f.getColDef().minWidth??U.getDefaultColumnMinWidth();if(O0!=null&&S0>=O0)f.setActualWidth(S0,J)}}if(I||!f.isPrimary())return;W?.syncColumnWithState(f,J,C),$?.syncColumnWithState(f,J,C,O),X?.syncColumnWithState(f,J,C,v)},D=(f,A,O)=>{let v=f$(Q,J),I=A.slice(),C={},m={},w=[],a=[],t=[],u=0,Q0=$?.columns.slice()??[],r=X?.columns.slice()??[];for(let k0 of f){let Az=k0.colId;if(Az.startsWith(uz)){w.push(k0),t.push(k0);continue}if(IQ(Az)){a.push(k0),t.push(k0);continue}let oz=O(Az);if(!oz)t.push(k0),u+=1;else F(oz,k0,C,m,!1),$0(I,oz)}let S0=(k0)=>F(k0,null,C,m,!1);I.forEach(S0),$?.sortColumns(y7.bind($,C,Q0)),X?.sortColumns(y7.bind(X,m,r)),Z.refreshCols(!1,J);let O0=(k0,Az,k2=[])=>{for(let oz of Az){let H7=k0(oz.colId);$0(k2,H7),F(H7,oz,null,null,!0)}k2.forEach(S0)};return O0((k0)=>Y?.getColumn(k0)??null,w,Y?.getColumns()?.slice()),O0((k0)=>G?.getColumn(k0)??null,a,G?.getColumns()?.slice()),bU(z,Z,E),H.refresh(J),B.dispatchEvent({type:"columnEverythingChanged",source:J}),v(),{unmatchedAndAutoStates:t,unmatchedCount:u}};q?.start();let{unmatchedAndAutoStates:M,unmatchedCount:k}=D(z.state||[],K,(f)=>Z.getColDefCol(f));if(M.length>0||T(z.defaultState)){let f=_?.getPivotResultCols()?.list??[];k=D(M,f,(A)=>_?.getPivotResultCol(A)??null).unmatchedCount}return q?.finish(),k===0}function V$(Q,z){let{colModel:J,autoColSvc:Z,selectionColSvc:$,eventSvc:X,gos:Y}=Q,G=J.getColDefCols();if(!G?.length)return;let q=J.getColDefColTree(),H=CZ(q),_=[],U=1000,W=1000,B=(D)=>{let M=A$(D);if(n(M.rowGroupIndex)&&M.rowGroup)M.rowGroupIndex=U++;if(n(M.pivotIndex)&&M.pivot)M.pivotIndex=W++;_.push(M)};Z?.getColumns()?.forEach(B),$?.getColumns()?.forEach(B),H?.forEach(B),n0(Q,{state:_},z);let E=Z?.getColumns()??[],F=[...$?.getColumns()??[],...E,...G].map((D)=>({colId:D.colId}));n0(Q,{state:F,applyOrder:!0},z),X.dispatchEvent(y(Y,{type:"columnsReset",source:z}))}function f$(Q,z){let{rowGroupColsSvc:J,pivotColsSvc:Z,valueColsSvc:$,colModel:X,sortSvc:Y,eventSvc:G}=Q,q={rowGroupColumns:J?.columns.slice()??[],pivotColumns:Z?.columns.slice()??[],valueColumns:$?.columns.slice()??[]},H=b7(Q),_={};for(let U of H)_[U.colId]=U;return()=>{let U=(A,O,v,I)=>{let C=O.map(I),m=v.map(I);if(X0(C,m))return;let a=new Set(O);for(let u of v)if(!a.delete(u))a.add(u);let t=[...a];G.dispatchEvent({type:A,columns:t,column:t.length===1?t[0]:null,source:z})},W=(A)=>{let O=[];return X.forAllCols((v)=>{let I=_[v.getColId()];if(I&&A(I,v))O.push(v)}),O},B=(A)=>A.getColId();U("columnRowGroupChanged",q.rowGroupColumns,J?.columns??[],B),U("columnPivotChanged",q.pivotColumns,Z?.columns??[],B);let K=W((A,O)=>{let v=A.aggFunc!=null,I=v!=O.isValueActive(),C=v&&A.aggFunc!=O.getAggFunc();return I||C});if(K.length>0)M$(G,"columnValueChanged",K,z);L1(G,W((A,O)=>A.width!=O.getActualWidth()),!0,z),D$(G,W((A,O)=>A.pinned!=O.getPinned()),z),UU(G,W((A,O)=>A.hide==O.isVisible()),z);let k=W((A,O)=>!tJ(O.getSortDef(),{type:LQ(A.sortType),direction:IZ(A.sort)})||A.sortIndex!=O.getSortIndex());if(k.length>0)Y?.dispatchSortChangedEvents(z,k);let f=b7(Q);xU(H,f,z,X,G)}}function b7(Q){let{colModel:z,rowGroupColsSvc:J,pivotColsSvc:Z}=Q,$=z.getColDefCols();if(n($)||!z.isAlive())return[];let X=J?.columns,Y=Z?.columns,G=[],q=(_)=>{let U=_.isRowGroupActive()&&X?X.indexOf(_):null,W=_.isPivotActive()&&Y?Y.indexOf(_):null,B=_.isValueActive()?_.getAggFunc():null,E=_.getSortIndex()!=null?_.getSortIndex():null;G.push({colId:_.getColId(),width:_.getActualWidth(),hide:!_.isVisible(),pinned:_.getPinned(),sort:_.getSort(),sortType:_.getSortDef()?.type,sortIndex:E,aggFunc:B,rowGroup:_.isRowGroupActive(),rowGroupIndex:U,pivot:_.isPivotActive(),pivotIndex:W,flex:_.getFlex()??null})};z.forAllCols((_)=>q(_));let H=new Map(z.getCols().map((_,U)=>[_.getColId(),U]));return G.sort((_,U)=>{let W=H.has(_.colId)?H.get(_.colId):-1,B=H.has(U.colId)?H.get(U.colId):-1;return W-B}),G}function A$(Q){let z=(L,F)=>L!=null?L:F!=null?F:null,J=Q.getColDef(),Z=a0(z(J.sort,J.initialSort)),$=Z.direction,X=Z.type,Y=z(J.sortIndex,J.initialSortIndex),G=z(J.hide,J.initialHide),q=z(J.pinned,J.initialPinned),H=z(J.width,J.initialWidth),_=z(J.flex,J.initialFlex),U=z(J.rowGroupIndex,J.initialRowGroupIndex),W=z(J.rowGroup,J.initialRowGroup);if(U==null&&!W)U=null,W=null;let B=z(J.pivotIndex,J.initialPivotIndex),E=z(J.pivot,J.initialPivot);if(B==null&&!E)B=null,E=null;let K=z(J.aggFunc,J.initialAggFunc);return{colId:Q.getColId(),sort:$,sortType:X,sortIndex:Y,hide:G,pinned:q,width:H,flex:_,rowGroup:W,rowGroupIndex:U,pivot:E,pivotIndex:B,aggFunc:K}}function bU(Q,z,J){if(!Q.applyOrder||!Q.state)return;let Z=[];for(let $ of Q.state)if($.colId!=null)Z.push($.colId);yU(z.cols,Z,z,J)}function yU(Q,z,J,Z){if(Q==null)return;let $=[],X={};for(let G of z){if(X[G])continue;let q=Q.map[G];if(q)$.push(q),X[G]=!0}let Y=0;for(let G of Q.list){let q=G.getColId();if(X[q]!=null)continue;if(q.startsWith(uz))$.splice(Y++,0,G);else $.push(G)}if($=E$($,Z),!K$($,J.getColTree())){R(39);return}Q.list=$}function xU(Q,z,J,Z,$){let X={};for(let _ of z)X[_.colId]=_;let Y={};for(let _ of Q)if(X[_.colId])Y[_.colId]=!0;let G=Q.filter((_)=>Y[_.colId]),q=z.filter((_)=>Y[_.colId]),H=[];if(q.forEach((_,U)=>{let W=G?.[U];if(W&&W.colId!==_.colId){let B=Z.getCol(W.colId);if(B)H.push(B)}}),!H.length)return;$.dispatchEvent({type:"columnMoved",columns:H,column:H.length===1?H[0]:null,finished:!0,source:J})}var y7=(Q,z,J,Z)=>{let $=Q[J.getId()],X=Q[Z.getId()],Y=$!=null,G=X!=null;if(Y&&G)return $-X;if(Y)return-1;if(G)return 1;let q=z.indexOf(J),H=z.indexOf(Z),_=q>=0,U=H>=0;if(_&&U)return q-H;if(_)return-1;return 1},wU=class extends j{constructor(){super(...arguments);this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","groupHideColumnsUntilExpanded","rowNumbers","hidePaddedHeaderRows"],(Q)=>this.refreshAll(Xz(Q.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",(Q)=>this.setPivotMode(this.gos.get("pivotMode"),Xz(Q.source)))}createColsFromColDefs(Q){let{beans:z}=this,{valueCache:J,colAutosize:Z,rowGroupColsSvc:$,pivotColsSvc:X,valueColsSvc:Y,visibleCols:G,eventSvc:q,groupHierarchyColSvc:H}=z,_=this.colDefs?f$(z,Q):void 0;J?.expire();let U=this.colDefCols?.list,W=this.colDefCols?.tree,B=p5(z,this.colDefs,!0,W,Q);ZQ(z,this.colDefCols?.tree,B.columnTree);let{columnTree:E,treeDepth:K}=B,L=CZ(E),F={};for(let D of L)F[D.getId()]=D;if(this.colDefCols={tree:E,treeDepth:K,list:L,map:F},this.createColumnsForService([H],this.colDefCols,Q),$?.extractCols(Q,U),X?.extractCols(Q,U),Y?.extractCols(Q,U),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,Q),this.changeEventsDispatching=!1,G.refresh(Q),q.dispatchEvent({type:"columnEverythingChanged",source:Q}),_)this.changeEventsDispatching=!0,_(),this.changeEventsDispatching=!1;if(q.dispatchEvent({type:"newColumnsLoaded",source:Q}),Q==="gridInitializing")Z?.applyAutosizeStrategy()}refreshCols(Q,z){if(!this.colDefCols)return;let J=this.cols?.tree;this.saveColOrder();let{autoColSvc:Z,selectionColSvc:$,rowNumbersSvc:X,quickFilter:Y,pivotResultCols:G,showRowGroupCols:q,rowAutoHeight:H,visibleCols:_,colViewport:U,eventSvc:W,formula:B}=this.beans,E=this.selectCols(G,this.colDefCols);B?.setFormulasActive(E),this.createColumnsForService([Z,$,X],E,z);let K=xG(this.gos,this.showingPivotResult);if(!Q||K)this.restoreColOrder(E);if(this.positionLockedCols(E),q?.refresh(),Y?.refreshCols(),this.setColSpanActive(),H?.setAutoHeightActive(E),_.clear(),U.clear(),!X0(J,this.cols.tree))W.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(Q,z,J){for(let Z of Q){if(!Z)continue;Z.createColumns(z,($)=>{this.lastOrder=$(this.lastOrder),this.lastPivotOrder=$(this.lastPivotOrder)},J),Z.addColumns(z)}}selectCols(Q,z){let J=Q?.getPivotResultCols()??null;this.showingPivotResult=J!=null;let{map:Z,list:$,tree:X,treeDepth:Y}=J??z;if(this.cols={list:$.slice(),map:{...Z},tree:X.slice(),treeDepth:Y},J){if(!J.list.some((q)=>this.cols?.map[q.getColId()]!==void 0))this.lastPivotOrder=null}return this.cols}getColsToShow(){if(!this.cols)return[];let{beans:Q,showingPivotResult:z,cols:J}=this,{valueColsSvc:Z,selectionColSvc:$,gos:X}=Q,Y=this.isPivotMode()&&!z,G=$?.isSelectionColumnEnabled(),q=wG(Q),H=Z?.columns,_=g5(X);return J.list.filter((W)=>{let B=mz(W);if(Y)return H?.includes(W)||B&&(!_||W.isVisible())||G&&IQ(W)||q&&v0(W);else return B&&!_||W.isVisible()})}refreshAll(Q){if(!this.ready)return;this.refreshCols(!1,Q),this.beans.visibleCols.refresh(Q)}setColsVisible(Q,z=!1,J){n0(this.beans,{state:Q.map((Z)=>({colId:typeof Z==="string"?Z:Z.getColId(),hide:!z}))},J)}restoreColOrder(Q){let z=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!z)return;let J=z.filter((U)=>Q.map[U.getId()]!=null);if(J.length===0)return;if(J.length===Q.list.length){Q.list=J;return}let Z=(U)=>{let W=U.getOriginalParent();if(!W)return!1;if(W.getChildren().length>1)return!0;return Z(W)};if(!J.some((U)=>Z(U))){let U=new Set(J);for(let W of Q.list)if(!U.has(W))J.push(W);Q.list=J;return}let $=new Map;for(let U=0;U!$.has(U));if(X.length===0){Q.list=J;return}let Y=(U,W)=>{let B=W?W.getOriginalParent():U.getOriginalParent();if(!B)return null;let E=null,K=null;for(let L of B.getChildren()){if(L===W||L===U)continue;if(L instanceof GQ){let F=$.get(L);if(F==null)continue;if(E==null||E{let D=$.get(F);if(D==null)return;if(E==null||E=0;U--)H[_--]=G[U];for(let U=J.length-1;U>=0;U--){let W=J[U],B=q.get(W);if(B)if(Array.isArray(B))for(let E=B.length-1;E>=0;E--){let K=B[E];H[_--]=K}else H[_--]=B;H[_--]=W}Q.list=H}positionLockedCols(Q){Q.list=E$(Q.list,this.gos)}saveColOrder(){if(this.showingPivotResult)this.lastPivotOrder=this.cols?.list??null;else this.lastOrder=this.cols?.list??null}getColumnDefs(Q){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],Q)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some((Q)=>Q.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(Q,z){if(Q===this.pivotMode)return;if(this.pivotMode=Q,!this.ready)return;this.refreshCols(!1,z);let{visibleCols:J,eventSvc:Z}=this.beans;J.refresh(z),Z.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){let Q=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!Q?.length}recreateColumnDefs(Q){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(Q);let z=Xz(Q.source);this.createColsFromColDefs(z)}setColumnDefs(Q,z){this.colDefs=Q,this.createColsFromColDefs(z)}destroy(){ZQ(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(Q){let{pivotResultCols:z,autoColSvc:J,selectionColSvc:Z,groupHierarchyColSvc:$}=this.beans;if(I1(this.colDefCols?.list,Q))return;if(I1(J?.columns?.list,Q))return;if(I1(Z?.columns?.list,Q))return;if(I1($?.columns?.list,Q))return;if(I1(z?.getPivotResultCols()?.list,Q))return}getColsForKeys(Q){if(!Q)return[];return Q.map((z)=>this.getCol(z)).filter((z)=>z!=null)}getColDefCol(Q){if(!this.colDefCols?.list)return null;return this.getColFromCollection(Q,this.colDefCols)}getCol(Q){if(Q==null)return null;return this.getColFromCollection(Q,this.cols)}getColById(Q){return this.cols?.map[Q]??null}getColFromCollection(Q,z){if(z==null)return null;let{map:J,list:Z}=z;if(typeof Q=="string"&&J[Q])return J[Q];for(let G=0;GQ(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(Q){return SQ(this.getGui(),Q),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(Q,z){if(this.value===Q)return this;if(this.previousValue=this.value,this.value=Q,!z)this.dispatchLocalEvent({type:"fieldValueChanged"});return this}};function uU(Q){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:Q,ref:"eInput",cls:"ag-input-field-input"}]}]}}var j$=class extends hU{constructor(Q,z,J="text",Z="input"){super(Q,Q?.template??uU(Z),[],z);this.inputType=J,this.displayFieldTag=Z,this.eLabel=S,this.eWrapper=S,this.eInput=S}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);let{eLabel:Q,eWrapper:z,eInput:J,className:Z}=this;Q.classList.add(`${Z}-label`),z.classList.add(`${Z}-input-wrapper`),J.classList.add(`${Z}-input`),this.addCss("ag-input-field"),J.id=J.id||`ag-${this.getCompId()}-input`;let{inputName:$,inputWidth:X,inputPlaceholder:Y,autoComplete:G,tabIndex:q}=this.config;if($!=null)this.setInputName($);if(X!=null)this.setInputWidth(X);if(Y!=null)this.setInputPlaceholder(Y);if(G!=null)this.setAutoComplete(G);this.addInputListeners(),this.activateTabIndex([J],q)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:(Q)=>this.setValue(Q.target.value)})}setInputType(Q){if(this.displayFieldTag==="input")this.inputType=Q,Pz(this.eInput,"type",Q)}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(Q){return m8(this.eWrapper,Q),this}setInputName(Q){return this.getInputElement().setAttribute("name",Q),this}getFocusableElement(){return this.eInput}setMaxLength(Q){let z=this.eInput;return z.maxLength=Q,this}setInputPlaceholder(Q){return Pz(this.eInput,"placeholder",Q),this}setInputAriaLabel(Q){return E0(this.eInput,Q),this.refreshAriaLabelledBy(),this}setDisabled(Q){return T5(this.eInput,Q),super.setDisabled(Q)}setAutoComplete(Q){if(Q===!0)Pz(this.eInput,"autocomplete",null);else{let z=typeof Q==="string"?Q:"off";Pz(this.eInput,"autocomplete",z)}return this}},K6=class extends j${constructor(Q,z="ag-checkbox",J="checkbox"){super(Q,z,J);this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();let{readOnly:Q,passive:z,name:J}=this.config;if(typeof Q==="boolean")this.setReadOnly(Q);if(typeof z==="boolean")this.setPassive(z);if(J!=null)this.setName(J)}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(Q){this.passive=Q}isReadOnly(){return this.readOnly}setReadOnly(Q){this.eWrapper.classList.toggle("ag-disabled",Q),this.eInput.disabled=Q,this.readOnly=Q}setDisabled(Q){return this.eWrapper.classList.toggle("ag-disabled",Q),super.setDisabled(Q)}toggle(){if(this.eInput.disabled)return;let Q=this.isSelected(),z=this.getNextValue();if(this.passive)this.dispatchChange(z,Q);else this.setValue(z)}getValue(){return this.isSelected()}setValue(Q,z){return this.refreshSelectedClass(Q),this.setSelected(Q,z),this}setName(Q){let z=this.getInputElement();return z.name=Q,this}isSelected(){return this.selected}setSelected(Q,z){if(this.isSelected()===Q)return;this.previousValue=this.isSelected(),Q=this.selected=typeof Q==="boolean"?Q:void 0;let J=this.eInput;if(J.checked=Q,J.indeterminate=Q===void 0,!z)this.dispatchChange(this.selected,this.previousValue)}dispatchChange(Q,z,J){this.dispatchLocalEvent({type:"fieldValueChanged",selected:Q,previousValue:z,event:J});let Z=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:Z.id,name:Z.name,selected:Q,previousValue:z})}onCheckboxClick(Q){if(this.passive||this.eInput.disabled)return;let z=this.isSelected(),J=this.selected=Q.target.checked;this.refreshSelectedClass(J),this.dispatchChange(J,z,Q)}refreshSelectedClass(Q){let z=this.eWrapper.classList;z.toggle("ag-checked",Q===!0),z.toggle("ag-indeterminate",Q==null)}},yQ={selector:"AG-CHECKBOX",component:K6},mU=".ag-checkbox-cell{height:100%}",cU={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},pU=class extends x{constructor(){super(cU,[yQ]);this.eCheckbox=S,this.registerCSS(mU)}init(Q){this.refresh(Q);let{eCheckbox:z,beans:J}=this,Z=z.getInputElement();Z.setAttribute("tabindex","-1"),R8(Z,"polite"),this.addManagedListeners(Z,{click:($)=>{if(i0($),z.isDisabled())return;let X=z.getValue();this.onCheckboxChanged(X)},dblclick:($)=>{i0($)}}),this.addManagedElementListeners(Q.eGridCell,{keydown:($)=>{if($.key===V.SPACE&&!z.isDisabled()){if(Q.eGridCell===d(J))z.toggle();let X=z.getValue();this.onCheckboxChanged(X),$.preventDefault()}}})}refresh(Q){return this.params=Q,this.updateCheckbox(Q),!0}updateCheckbox(Q){let z,J=!0,{value:Z,column:$,node:X}=Q;if(X.group&&$)if(typeof Z==="boolean")z=Z;else{let U=$.getColId();if(U.startsWith(uz))z=Z==null||Z===""?void 0:Z==="true";else if(X.aggData&&X.aggData[U]!==void 0)z=Z??void 0;else if(X.sourceRowIndex>=0)z=Z??void 0;else J=!1}else z=Z??void 0;let{eCheckbox:Y}=this;if(!J){Y.setDisplayed(!1);return}Y.setValue(z);let G=Q.disabled??!$?.isCellEditable(X);Y.setDisabled(G);let q=this.getLocaleTextFunc(),H=O5(q,z),_=G?H:`${q("ariaToggleCellValue","Press SPACE to toggle cell value")} (${H})`;Y.setInputAriaLabel(_)}onCheckboxChanged(Q){let{params:z}=this,{column:J,node:Z,value:$}=z,{editSvc:X}=this.beans;if(!J)return;let Y={rowNode:Z,column:J};X?.dispatchCellEvent(Y,null,"cellEditingStarted",{value:$});let G=Z.setDataValue(J,Q,"ui");if(X?.dispatchCellEvent(Y,null,"cellEditingStopped",{oldValue:$,newValue:Q,valueChanged:G}),!G)this.updateCheckbox(z)}},iU={tag:"div",cls:"ag-skeleton-container"},nU=class extends x{constructor(){super(iU)}init(Q){let z=`ag-cell-skeleton-renderer-${this.getCompId()}`;if(this.getGui().setAttribute("id",z),this.addDestroyFunc(()=>p1(Q.eParentOfValue)),p1(Q.eParentOfValue,z),Q.deferRender)this.setupLoading(Q);else if(Q.node.failedLoad)this.setupFailed();else this.setupLoading(Q)}setupFailed(){let Q=this.getLocaleTextFunc();this.getGui().textContent=Q("loadingError","ERR");let z=Q("ariaSkeletonCellLoadingFailed","Row failed to load");E0(this.getGui(),z)}setupLoading(Q){let z=Z0({tag:"div",cls:"ag-skeleton-effect"}),J=Q.node.rowIndex;if(J!=null){let X=75+25*(J%2===0?Math.sin(J):Math.cos(J));z.style.width=`${X}%`}this.getGui().appendChild(z);let Z=this.getLocaleTextFunc(),$=Q.deferRender?Z("ariaDeferSkeletonCellLoading","Cell is loading"):Z("ariaSkeletonCellLoading","Row data is loading");E0(this.getGui(),$)}refresh(Q){return!1}},dU={moduleName:"CheckboxCellRenderer",version:p,userComponents:{agCheckboxCellRenderer:pU}},tU={moduleName:"SkeletonCellRenderer",version:p,userComponents:{agSkeletonCellRenderer:nU}};var rU=class extends j{constructor(){super(...arguments);this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(Q={}){let z=Q.source??"flex";if(Q.viewportWidth!=null)this.flexViewportWidth=Q.viewportWidth;let J=this.flexViewportWidth,{visibleCols:Z,colDelayRenderSvc:$}=this.beans,X=Z.centerCols,Y=-1;if(Q.resizingCols){let K=new Set(Q.resizingCols);for(let L=X.length-1;L>=0;L--)if(K.has(X[L])){Y=L;break}}let G=!1,q=X.map((K,L)=>{let F=K.getFlex(),D=F!=null&&F>0&&L>Y;return G||(G=D),{col:K,isFlex:D,flex:Math.max(0,F??0),initialSize:K.getActualWidth(),min:K.getMinWidth(),max:K.getMaxWidth(),targetSize:0}});if(G)$?.hideColumns("colFlex"),this.columnsHidden=!0;else if(this.columnsHidden)this.revealColumns($);if(!J||!G)return[];let H=q.length,_=q.reduce((K,L)=>K+L.flex,0),U=J,W=(K,L)=>{K.frozenSize=L,K.col.setActualWidth(L,z),U-=L,_-=K.flex,H-=1},B=(K)=>K.frozenSize!=null;for(let K of q)if(!K.isFlex)W(K,K.initialSize);while(H>0){let K=Math.round(_<1?U*_:U),L,F=0,D=0;for(let f of q){if(B(f))continue;L=f,D+=K*(f.flex/_);let A=D-F,O=Math.round(A);f.targetSize=O,F+=O}if(L)L.targetSize+=K-F;let M=0;for(let f of q){if(B(f))continue;let A=f.targetSize,O=Math.min(Math.max(A,f.min),f.max);M+=O-A,f.violationType=O===A?void 0:O0?"min":"max";for(let f of q){if(B(f))continue;if(k==="all"||f.violationType===k)W(f,f.targetSize)}}if(!Q.skipSetLeft)Z.setLeftValues(z);if(Q.updateBodyWidths)Z.updateBodyWidths();let E=q.filter((K)=>K.isFlex&&!K.violationType).map((K)=>K.col);if(Q.fireResizedEvent){let K=q.filter((F)=>F.initialSize!==F.frozenSize).map((F)=>F.col),L=q.filter((F)=>F.flex).map((F)=>F.col);L1(this.eventSvc,K,!0,z,L)}return this.revealColumns($),E}revealColumns(Q){if(this.columnsHidden)Q?.revealColumns("colFlex"),this.columnsHidden=!1}initCol(Q){let{flex:z,initialFlex:J}=Q.colDef;if(z!==void 0)Q.flex=z;else if(J!==void 0)Q.flex=J}setColFlex(Q,z){Q.flex=z??null,Q.dispatchStateUpdatedEvent("flex")}},qz=(Q)=>{if(typeof Q==="bigint")return Q;let z;if(typeof Q==="number")z=Q;else if(typeof Q==="string"){if(z=Q.trim(),z==="")return null;if(z.endsWith("n"))z=z.slice(0,-1);if(!/^[+-]?\d+$/.test(z))return null}if(z==null)return null;try{return BigInt(z)}catch{return null}},L6="T",sU=new RegExp(`[${L6} ]`),lU=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${L6}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Sz(Q,z){return Q.toString().padStart(z,"0")}function x7(Q,z=!0,J=L6){if(!Q)return null;let Z=[Q.getFullYear(),Q.getMonth()+1,Q.getDate()].map(($)=>Sz($,2)).join("-");if(z)Z+=J+[Q.getHours(),Q.getMinutes(),Q.getSeconds()].map(($)=>Sz($,2)).join(":");return Z}function $1(Q,z=!0){if(!Q)return null;if(z)return[String(Q.getFullYear()),String(Q.getMonth()+1),Sz(Q.getDate(),2),Sz(Q.getHours(),2),`:${Sz(Q.getMinutes(),2)}`,`:${Sz(Q.getSeconds(),2)}`];return[Q.getFullYear(),Q.getMonth()+1,Sz(Q.getDate(),2)].map(String)}var F6=["January","February","March","April","May","June","July","August","September","October","November","December"];function sJ(Q,z=!1){return!!e1(Q,z)}function aU(Q){return sJ(Q,!0)}function e1(Q,z=!1,J){if(!Q)return null;if(!J&&!lU.test(Q))return null;let[Z,$]=Q.split(sU);if(!Z)return null;let X=Z.split("-").map((B)=>Number.parseInt(B,10));if(X.filter((B)=>!isNaN(B)).length!==3)return null;let[Y,G,q]=X,H=new Date(Y,G-1,q);if(H.getFullYear()!==Y||H.getMonth()!==G-1||H.getDate()!==q)return null;if(!$&&z)return null;if(!$||$==="00:00:00")return H;let[_,U,W]=$.split(":").map((B)=>Number.parseInt(B,10));if(_>=0&&_<24)H.setHours(_);else if(z)return null;if(U>=0&&U<60)H.setMinutes(U);else if(z)return null;if(W>=0&&W<60)H.setSeconds(W);else if(z)return null;return H}function h1(Q,z,J){if(!z||!Q)return;if(!J)return Q[z];let Z=z.split("."),$=Q;for(let X=0;Xnull,suppressKeyboardEvent:({node:Q,event:z,column:J})=>z.key===V.SPACE&&J.isCellEditable(Q)}},date({formatValue:Q}){return{cellEditor:"agDateCellEditor",keyCreator:Q}},dateString({formatValue:Q}){return{cellEditor:"agDateStringCellEditor",keyCreator:Q}},dateTime(Q){return this.date(Q)},dateTimeString(Q){return this.dateString(Q)},object({formatValue:Q,colModel:z,colId:J}){return{cellEditorParams:{useFormatter:!0},comparator:(Z,$)=>{let X=z.getColDefCol(J),Y=X?.getColDef();if(!X||!Y)return 0;let G=Z==null?"":Q({column:X,node:null,value:Z}),q=$==null?"":Q({column:X,node:null,value:$});if(G===q)return 0;return G>q?1:-1},keyCreator:Q}},text(){return{}}}}wireBeans(Q){this.colModel=Q.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(Q)=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(Q)})}processDataTypeDefinitions(){let Q=this.getDefaultDataTypes(),z={},J={},Z=(_)=>{return(U)=>{let{column:W,node:B,value:E}=U,K=W.getColDef().valueFormatter;if(K===_.groupSafeValueFormatter)K=_.valueFormatter;return this.beans.valueSvc.formatValue(W,B,E,K)}};for(let _ of Object.keys(Q)){let U=Q[_],W={...U,groupSafeValueFormatter:g7(U,this.gos)};z[_]=W,J[_]=Z(W)}let $=this.gos.get("dataTypeDefinitions")??{},X={};for(let _ of Object.keys($)){let U=$[_],W=this.processDataTypeDefinition(U,$,[_],Q);if(W){if(z[_]=W,U.dataTypeMatcher)X[_]=U.dataTypeMatcher;J[_]=Z(W)}}let{valueParser:Y,valueFormatter:G}=Q.object,{valueParser:q,valueFormatter:H}=z.object;this.hasObjectValueParser=q!==Y,this.hasObjectValueFormatter=H!==G,this.formatValueFuncs=J,this.dataTypeDefinitions=z,this.dataTypeMatchers=this.sortKeysInMatchers(X,Q)}sortKeysInMatchers(Q,z){let J={...Q};for(let Z of oU)delete J[Z],J[Z]=Q[Z]??z[Z].dataTypeMatcher;return J}processDataTypeDefinition(Q,z,J,Z){let $,X=Q.extendsDataType;if(Q.columnTypes)this.isColumnTypeOverrideInDataTypeDefinitions=!0;if(Q.extendsDataType===Q.baseDataType){let Y=Z[X],G=z[X];if(Y&&G)Y=G;if(!N7(Q,Y,X))return;$=w7(Y,Q)}else{if(J.includes(X)){R(44);return}let Y=z[X];if(!N7(Q,Y,X))return;let G=this.processDataTypeDefinition(Y,z,[...J,X],Z);if(!G)return;$=w7(G,Q)}return{...$,groupSafeValueFormatter:g7($,this.gos)}}updateColDefAndGetColumnType(Q,z,J){let{cellDataType:Z}=z;if(Z===void 0)Z=Q.cellDataType;let{field:$}=z;if(Z==null||Z===!0)Z=this.canInferCellDataType(Q,z)?this.inferCellDataType($,J):!1;if(this.addFormulaCellEditorToColDef(Q,z),!Z){Q.cellDataType=!1;return}let X=this.dataTypeDefinitions[Z];if(!X){R(47,{cellDataType:Z});return}if(Q.cellDataType=Z,X.groupSafeValueFormatter)Q.valueFormatter=X.groupSafeValueFormatter;if(X.valueParser)Q.valueParser=X.valueParser;if(!X.suppressDefaultProperties)this.setColDefPropertiesForBaseDataType(Q,Z,X,J);return X.columnTypes}addFormulaCellEditorToColDef(Q,z){if(!(z.allowFormula??Q.allowFormula)||z.cellEditor)return;Q.cellEditor="agFormulaCellEditor"}addColumnListeners(Q){if(!this.isPendingInference)return;let z=this.columnStateUpdatesPendingInference[Q.getColId()];if(!z)return;let J=(Z)=>{z.add(Z.key)};Q.__addEventListener("columnStateUpdated",J),this.columnStateUpdateListenerDestroyFuncs.push(()=>Q.__removeEventListener("columnStateUpdated",J))}canInferCellDataType(Q,z){let{gos:J}=this;if(!o(J))return!1;let Z={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(i2(z,Z))return!1;let $=z.type===null?Q.type:z.type;if($){let X=J.get("columnTypes")??{};if(XZ($).some((G)=>{let q=X[G.trim()];return q&&i2(q,Z)}))return!1}return!i2(Q,Z)}inferCellDataType(Q,z){if(!Q)return;let J,Z=this.getInitialData();if(Z){let X=Q.includes(".")&&!this.gos.get("suppressFieldDotNotation");J=h1(Z,Q,X)}else this.initWaitForRowData(z);if(J==null)return;return Object.keys(this.dataTypeMatchers).find((X)=>this.dataTypeMatchers[X](J))??"object"}getInitialData(){let Q=this.gos.get("rowData");if(Q?.length)return Q[0];else if(this.initialData)return this.initialData;else{let z=this.beans.rowModel.rootNode?._leafs;if(z?.length)return z[0].data}return null}initWaitForRowData(Q){if(this.columnStateUpdatesPendingInference[Q]=new Set,this.isPendingInference)return;this.isPendingInference=!0;let z=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:J,eventSvc:Z}=this.beans;if(z&&J)J.shouldQueueResizeOperations=!0;let[$]=this.addManagedEventListeners({rowDataUpdateStarted:(X)=>{let{firstRowData:Y}=X;if(!Y)return;if($?.(),this.isPendingInference=!1,this.processColumnsPendingInference(Y,z),this.columnStateUpdatesPendingInference={},z)J?.processResizeOperations();Z.dispatchEvent({type:"dataTypesInferred"})}})}processColumnsPendingInference(Q,z){this.initialData=Q;let J=[];this.destroyColumnStateUpdateListeners();let Z={},$={};for(let X of Object.keys(this.columnStateUpdatesPendingInference)){let Y=this.columnStateUpdatesPendingInference[X],G=this.colModel.getCol(X);if(!G)continue;let q=G.getColDef();if(!this.resetColDefIntoCol(G,"cellDataTypeInferred"))continue;let H=G.getColDef();if(z&&H.type&&H.type!==q.type){let _=XW(G,Y);if(_.rowGroup&&_.rowGroupIndex==null)Z[X]=_;if(_.pivot&&_.pivotIndex==null)$[X]=_;J.push(_)}}if(z)J.push(...this.generateColumnStateForRowGroupAndPivotIndexes(Z,$));if(J.length)n0(this.beans,{state:J},"cellDataTypeInferred");this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(Q,z){let J={},{rowGroupColsSvc:Z,pivotColsSvc:$}=this.beans;return Z?.restoreColumnOrder(J,Q),$?.restoreColumnOrder(J,z),Object.values(J)}resetColDefIntoCol(Q,z){let J=Q.getUserProvidedColDef();if(!J)return!1;let Z=uQ(this.beans,J,Q.getColId());return Q.setColDef(Z,J,z),!0}getDateStringTypeDefinition(Q){let{dateString:z}=this.dataTypeDefinitions;if(!Q)return z;return this.getDataTypeDefinition(Q)??z}getDateParserFunction(Q){return this.getDateStringTypeDefinition(Q).dateParser}getDateFormatterFunction(Q){return this.getDateStringTypeDefinition(Q).dateFormatter}getDateIncludesTimeFlag(Q){return Q==="dateTime"||Q==="dateTimeString"}getDataTypeDefinition(Q){let z=Q.getColDef();if(!z.cellDataType)return;return this.dataTypeDefinitions[z.cellDataType]}getBaseDataType(Q){return this.getDataTypeDefinition(Q)?.baseDataType}checkType(Q,z){if(z==null)return!0;let J=this.getDataTypeDefinition(Q)?.dataTypeMatcher;if(!J)return!0;if(Q.getColDef().allowFormula&&this.beans.formula?.isFormula(z))return!0;return J(z)}validateColDef(Q,z,J,Z){if(Q.cellDataType==="object"){let $=(q)=>{return q?.cellDataType==null||q?.cellDataType===!0},X=$(z)&&$(J),Y=(q)=>R(48,{property:q,inferred:X,colId:Z}),{object:G}=this.dataTypeDefinitions;if(Q.valueFormatter===G.groupSafeValueFormatter&&!this.hasObjectValueFormatter)Y("Formatter");if(Q.editable&&Q.valueParser===G.valueParser&&!this.hasObjectValueParser)Y("Parser")}}postProcess(Q){let z=Q.cellDataType;if(!z||typeof z!=="string")return;let{dataTypeDefinitions:J,beans:Z,formatValueFuncs:$}=this,X=J[z];if(!X)return;Z.colFilter?.setColDefPropsForDataType(Q,X,$[z])}getFormatValue(Q){return this.formatValueFuncs[Q]}isColPendingInference(Q){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[Q]}setColDefPropertiesForBaseDataType(Q,z,J,Z){let $=this.formatValueFuncs[z],X=this.columnDefinitionPropsPerDataType[J.baseDataType]({colDef:Q,cellDataType:z,colModel:this.colModel,dataTypeDefinition:J,colId:Z,formatValue:$,filterModuleBean:this.beans.filterManager});if(Q.cellEditor==="agFormulaCellEditor"&&X.cellEditor!==Q.cellEditor)X.cellEditor=Q.cellEditor;Object.assign(Q,X)}getDateObjectTypeDef(Q){let z=this.getLocaleTextFunc(),J=this.getDateIncludesTimeFlag(Q);return{baseDataType:Q,valueParser:(Z)=>e1(Z.newValue&&String(Z.newValue)),valueFormatter:(Z)=>{if(Z.value==null)return"";if(!(Z.value instanceof Date)||isNaN(Z.value.getTime()))return z("invalidDate","Invalid Date");return x7(Z.value,J)??""},dataTypeMatcher:(Z)=>Z instanceof Date}}getDateStringTypeDef(Q){let z=this.getDateIncludesTimeFlag(Q);return{baseDataType:Q,dateParser:(J)=>e1(J)??void 0,dateFormatter:(J)=>x7(J??null,z)??void 0,valueParser:(J)=>sJ(String(J.newValue))?J.newValue:null,valueFormatter:(J)=>sJ(String(J.value))?String(J.value):"",dataTypeMatcher:(J)=>typeof J==="string"&&sJ(J)}}getDefaultDataTypes(){let Q=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:(z)=>z.newValue?.trim?.()===""?null:Number(z.newValue),valueFormatter:(z)=>{if(z.value==null)return"";if(typeof z.value!=="number"||isNaN(z.value))return Q("invalidNumber","Invalid Number");return String(z.value)},dataTypeMatcher:(z)=>typeof z==="number"},bigint:{baseDataType:"bigint",valueParser:(z)=>{let{newValue:J}=z;if(J==null)return null;if(typeof J==="string"&&J.trim()==="")return null;return qz(J)},valueFormatter:(z)=>{if(z.value==null)return"";if(typeof z.value!=="bigint")return Q("invalidBigInt","Invalid BigInt");return String(z.value)},dataTypeMatcher:(z)=>typeof z==="bigint"},text:{baseDataType:"text",valueParser:(z)=>z.newValue===""?null:c1(z.newValue),dataTypeMatcher:(z)=>typeof z==="string"},boolean:{baseDataType:"boolean",valueParser:(z)=>{if(z.newValue==null)return z.newValue;return z.newValue?.trim?.()===""?null:String(z.newValue).toLowerCase()==="true"},valueFormatter:(z)=>z.value==null?"":String(z.value),dataTypeMatcher:(z)=>typeof z==="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:(z)=>typeof z==="string"&&aU(z)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:(z)=>c1(z.value)??""}}}destroyColumnStateUpdateListeners(){for(let Q of this.columnStateUpdateListenerDestroyFuncs)Q();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function w7(Q,z){let J={...Q,...z};if(Q.columnTypes&&z.columnTypes&&z.appendColumnTypes)J.columnTypes=[...XZ(Q.columnTypes),...XZ(z.columnTypes)];return J}function N7(Q,z,J){if(!z)return R(45,{parentCellDataType:J}),!1;if(z.baseDataType!==Q.baseDataType)return R(46),!1;return!0}var QW=(Q)=>typeof Q==="bigint"||typeof Q==="number",zW=(Q)=>Q==="number"||Q==="bigint";function g7(Q,z){if(!Q.valueFormatter)return;return(J)=>{let{node:Z,colDef:$,column:X,value:Y}=J;if(Z?.group){let G=($.pivotValueColumn??X).getAggFunc();if(G){if(G==="first"||G==="last")return Q.valueFormatter(J);let{baseDataType:q}=Q;if(zW(q)&&G!=="count"){if(QW(Y))return Q.valueFormatter(J);if(Y==null)return;if(typeof Y==="object"){if(typeof Y.toNumber==="function")return Q.valueFormatter({...J,value:Y.toNumber()});if("value"in Y)return Q.valueFormatter({...J,value:Y.value})}}return}}else if(z.get("groupHideOpenParents")&&J.column.isRowGroupActive()){if(typeof J.value==="string"&&!Q.dataTypeMatcher?.(J.value))return}return Q.valueFormatter(J)}}function JW(Q,z,J,Z){if(!z[J])return!1;let $=Q[J];if($===null)return z[J]=!1,!1;else return Z===void 0?!!$:$===Z}function ZW(Q,z){if(Q==null)return z==null?0:-1;if(z==null)return 1;let J=qz(Q),Z=qz(z);if(J!=null&&Z!=null){if(J===Z)return 0;return J>Z?1:-1}return 0}function $W(Q,z){if(Q==null)return z==null?0:-1;if(z==null)return 1;let J=h7(Q),Z=h7(z);if(J!=null&&Z!=null){if(J===Z)return 0;return J>Z?1:-1}return 0}function h7(Q){let z=qz(Q);if(z==null)return null;return z<0n?-z:z}function i2(Q,z){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([J,Z])=>JW(Q,z,J,Z))}function XW(Q,z){let J=A$(Q);for(let Z of z)if(delete J[Z],Z==="rowGroup")delete J.rowGroupIndex;else if(Z==="pivot")delete J.pivotIndex;return J}var YW={moduleName:"DataType",version:p,beans:[eU],dependsOn:[dU]},GW={moduleName:"ColumnFlex",version:p,beans:[rU]};var qW=class extends j{constructor(){super(...arguments);this.beanName="colNames"}getDisplayNameForColumn(Q,z,J=!1){if(!Q)return null;let Z=this.getHeaderName(Q.getColDef(),Q,null,null,z),{aggColNameSvc:$}=this.beans;if(J&&$)return $.getHeaderName(Q,Z);return Z}getDisplayNameForProvidedColumnGroup(Q,z,J){let Z=z?.getColGroupDef();if(Z)return this.getHeaderName(Z,null,Q,z,J);return null}getDisplayNameForColumnGroup(Q,z){return this.getDisplayNameForProvidedColumnGroup(Q,Q.getProvidedColumnGroup(),z)}getHeaderName(Q,z,J,Z,$){let X=Q.headerValueGetter;if(X){let Y=y(this.gos,{colDef:Q,column:z,columnGroup:J,providedColumnGroup:Z,location:$});if(typeof X==="function")return X(Y);else if(typeof X==="string")return this.beans.expressionSvc?.evaluate(X,Y)??null;return""}else if(Q.headerName!=null)return Q.headerName;else if(Q.field)return N4(Q.field);return""}},HW=class extends j{constructor(){super(...arguments);this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(Q){this.visibleCols=Q.visibleCols,this.colModel=Q.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(Q,z,J=!1){let{visibleCols:Z}=this,$=Z.isBodyWidthDirty;if(Q===this.scrollWidth&&z===this.scrollPosition&&!$)return;if(this.scrollWidth=Q,this.scrollPosition=z,Z.isBodyWidthDirty=!0,this.gos.get("enableRtl")){let Y=Z.bodyWidth;this.viewportLeft=Y-z-Q,this.viewportRight=Y-z}else this.viewportLeft=z,this.viewportRight=Q+z;if(this.colModel.ready)this.checkViewportColumns(J)}getColumnHeadersToRender(Q){switch(Q){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(Q,z){let J;switch(Q){case"left":J=this.rowsOfHeadersToRenderLeft[z];break;case"right":J=this.rowsOfHeadersToRenderRight[z];break;default:J=this.rowsOfHeadersToRenderCenter[z];break}return J??[]}extractViewportColumns(){let Q=this.visibleCols.centerCols;if(this.isColumnVirtualisationSuppressed())this.colsWithinViewport=Q,this.headerColsWithinViewport=Q;else this.colsWithinViewport=Q.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=Q.filter(this.isColumnInHeaderViewport.bind(this))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(Q){if(Q.isAutoHeaderHeight()||_W(Q))return!0;return this.isColumnInRowViewport(Q)}isColumnInRowViewport(Q){if(Q.isAutoHeight())return!0;let z=Q.getLeft()||0,J=z+Q.getActualWidth(),Z=this.viewportLeft-200,$=this.viewportRight+200,X=z$&&J>$;return!X&&!Y}getViewportColumns(){let{leftCols:Q,rightCols:z}=this.visibleCols;return this.colsWithinViewport.concat(Q).concat(z)}getColsWithinViewport(Q){if(!this.colModel.colSpanActive)return this.colsWithinViewport;let z=(X)=>{let Y=X.getLeft();return T(Y)&&Y>this.viewportLeft},J=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:Z}=this,$=Z.centerCols;return Z.getColsForRow(Q,$,J,z)}checkViewportColumns(Q=!1){if(this.extractViewport())this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:Q})}calculateHeaderRows(){let{leftCols:Q,rightCols:z}=this.visibleCols;this.columnsToRenderLeft=Q,this.columnsToRenderRight=z,this.columnsToRenderCenter=this.colsWithinViewport;let J=(Z)=>{let $=new Set,X={};for(let Y of Z){let G=Y.getParent(),q=Y.isSpanHeaderHeight();while(G){if($.has(G))break;if(q&&G.isPadding()){G=G.getParent();continue}let _=G.getProvidedColumnGroup().getLevel();X[_]??(X[_]=[]),X[_].push(G),$.add(G),G=G.getParent()}}return X};this.rowsOfHeadersToRenderLeft=J(Q),this.rowsOfHeadersToRenderRight=J(z),this.rowsOfHeadersToRenderCenter=J(this.headerColsWithinViewport)}extractViewport(){let Q=(Z)=>`${Z.getId()}-${Z.getPinned()||"normal"}`;this.extractViewportColumns();let z=this.getViewportColumns().map(Q).join("#"),J=this.colsWithinViewportHash!==z;if(J)this.colsWithinViewportHash=z,this.calculateHeaderRows();return J}};function _W(Q){while(Q){if(Q.isAutoHeaderHeight())return!0;Q=Q.getParent()}return!1}var UW=class extends j{constructor(){super(...arguments);this.beanName="agCompUtils"}adaptFunction(Q,z){if(!Q.cellRenderer)return null;class J{refresh(){return!1}getGui(){return this.eGui}init(Z){let $=z(Z),X=typeof $;if(X==="string"||X==="number"||X==="boolean"){this.eGui=v5(""+$+"");return}if($==null){this.eGui=Z0({tag:"span"});return}this.eGui=$}}return J}},WW={moduleName:"CellRendererFunction",version:p,beans:[UW]},BW=class extends j0{constructor(){super(...arguments);this.beanName="registry"}registerDynamicBeans(Q){if(Q){this.dynamicBeans??(this.dynamicBeans={});for(let z of Object.keys(Q))this.dynamicBeans[z]=Q[z]}}createDynamicBean(Q,z,...J){if(!this.dynamicBeans)throw Error(this.getDynamicError(Q,!0));let Z=this.dynamicBeans[Q];if(Z==null){if(z)throw Error(this.getDynamicError(Q,!1));return}return new Z(...J)}};function EW(Q){return typeof Q==="object"&&!!Q.getComp}var KW=class extends BW{constructor(){super(...arguments);this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){let Q=this.gos.get("components");if(Q!=null)for(let z of Object.keys(Q))this.jsComps[z]=Q[z]}registerModule(Q){let{icons:z,userComponents:J,dynamicBeans:Z,selectors:$}=Q;if(J){let X=(Y,G,q,H)=>{if(this.agGridDefaults[Y]=G,q||H)this.agGridDefaultOverrides[Y]={params:q,processParams:H}};for(let Y of Object.keys(J)){let G=J[Y];if(EW(G))G=G.getComp(this.beans);if(typeof G==="object"){let{classImp:q,params:H,processParams:_}=G;X(Y,q,H,_)}else X(Y,G)}}this.registerDynamicBeans(Z);for(let X of $??[])this.selectors[X.selector]=X;if(z)for(let X of Object.keys(z))this.icons[X]=z[X]}getUserComponent(Q,z){let J=(G,q,H,_)=>({componentFromFramework:q,component:G,params:H,processParams:_}),{frameworkOverrides:Z}=this.beans,$=Z.frameworkComponent(z,this.gos.get("components"));if($!=null)return J($,!0);let X=this.jsComps[z];if(X){let G=Z.isFrameworkComponent(X);return J(X,G)}let Y=this.agGridDefaults[z];if(Y){let G=this.agGridDefaultOverrides[z];return J(Y,!1,G?.params,G?.processParams)}return this.beans.validation?.missingUserComponent(Q,z,this.agGridDefaults,this.jsComps),null}getSelector(Q){return this.selectors[Q]}getIcon(Q){return this.icons[Q]}getDynamicError(Q,z){if(z)return QQ(279,{name:Q});return this.beans.validation?.missingDynamicBean(Q)??QQ(256)}},LW=23,FW=class extends j{constructor(){super(...arguments);this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(let Q of this.readyCallbacks)Q(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){let Q=Object.values(this.params);this.ready=Q.length===LW&&Q.every((z)=>{return z?.isAlive()??!1})}whenReady(Q,z){if(this.ready)z(this.params);else this.readyCallbacks.push(z);Q.addDestroyFunc(()=>{let J=this.readyCallbacks.indexOf(z);if(J>=0)this.readyCallbacks.splice(J,1)})}register(Q,z){if(this.params[Q]=z,this.updateReady(),this.ready)this.dispatchLocalEvent({type:"ready"});z.addDestroyFunc(()=>{this.updateReady()})}get(Q){return this.params[Q]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){let{leftHeader:Q,centerHeader:z,rightHeader:J}=this.params;return[Q,J,z]}getHeaderRowContainerCtrl(Q){let z=this.params;switch(Q){case"left":return z.leftHeader;case"right":return z.rightHeader;default:return z.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},DW=':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',D6=typeof window!=="object"||!window?.document?.fonts?.forEach,UZ=!1,Nz=(Q,z,J,Z,$,X,Y=!1)=>{if(D6||UZ)return;let G=Q;if(Z)G=`@layer ${CSS.escape(Z).replaceAll("\\.",".")} { ${Q} }`;let q=jQ.map.get(z);if(!q)q=[],jQ.map.set(z,q);if(q.some((W)=>W.injectedCss===G))return;let H=document.createElement("style");if(X)H.setAttribute("nonce",X);H.dataset.agCss=J,H.dataset.agCssVersion=p,H.textContent=G;let _={rawCss:Q,injectedCss:G,el:H,priority:$,isParams:Y},U;for(let W of q){if(W.priority>$)break;U=W}if(U){U.el.after(H);let W=q.indexOf(U);q.splice(W+1,0,_)}else{if(z.nodeName==="STYLE")z.after(H);else z.insertBefore(H,z.querySelector(":not(title, meta)"));q.push(_)}},R$=(Q,z,J,Z)=>{Nz(DW,Q,"shared",z,0,J),Z?.forEach(($,X)=>$.forEach((Y)=>Nz(Y,Q,X,z,0,J)))},MW=(Q,z,J,Z,$,X)=>{if(D6||UZ)return;let Y=jQ.grids.get(Q);if(!Y)jQ.grids.set(Q,{styleContainer:Z,paramsCss:z});else Y.paramsCss=z;if(B5(Z),z&&J)Nz(z,Z,J,$,2,X,!0)},kW=(Q)=>{let z=jQ.grids.get(Q)?.styleContainer;if(!z)return;if(jQ.grids.delete(Q),Array.from(jQ.grids.values()).some((Z)=>Z.styleContainer===z))B5(z);else B5(z,!0),jQ.map.delete(z)},B5=(Q,z=!1)=>{let J=new Set;for(let $ of jQ.grids.values())if($.styleContainer===Q)J.add($.paramsCss);let Z=jQ.map.get(Q)??[];for(let $=Z.length-1;$>=0;$--)if(z||Z[$].isParams&&!J.has(Z[$].rawCss))Z[$].el.remove(),Z.splice($,1)},S$=()=>{let Q=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map),z=Q.get(p);if(!z)z={map:new WeakMap,grids:new Map,paramsId:0},Q.set(p,z);return z},jQ=S$(),FQ=(Q)=>{return new O$(Q)},oQ="$default",VW=0,O$=class{constructor({feature:Q,params:z,modeParams:J={},css:Z,cssImports:$}){this.feature=Q,this.css=Z,this.cssImports=$,this.modeParams={[oQ]:{...J[oQ]??{},...z??{}},...J}}use(Q,z,J){let Z=this._inject;if(Z==null){let{css:$}=this;if($){let X=`ag-theme-${this.feature??"part"}-${++VW}`;if(typeof $==="function")$=$();$=`:where(.${X}) { +${$} } -`;for(let q of this.cssImports??[])Q=`@import url(${JSON.stringify(q)}); -${Q}`;z={css:Q,class:J}}else z=!1;this._inject=z}if(z&&_)rf(z.css,_,z.class,f,1,$);return z?z.class:!1}},QH=(_)=>_.replace(/[A-Z]|\d+/g,(f)=>`-${f}`).toLowerCase(),mJ=(_)=>`--ag-${QH(_)}`,w0=(_)=>`var(${mJ(_)})`,JH=(_,f,$)=>Math.max(f,Math.min($,_)),qH=(_)=>{let f=new Map;return($)=>{let z=$;if(!f.has(z))f.set(z,_($));return f.get(z)}},O0=(_)=>({ref:"accentColor",mix:_}),s_=(_)=>({ref:"foregroundColor",mix:_}),_0=(_)=>({ref:"foregroundColor",mix:_,onto:"backgroundColor"}),XH=(_)=>({ref:"foregroundColor",mix:_,onto:"headerBackgroundColor"}),x_={ref:"backgroundColor"},hf={ref:"foregroundColor"},P0={ref:"accentColor"},Tz={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:s_(0.15),chromeBackgroundColor:_0(0.02),browserColorScheme:"light"},YH={...Tz,textColor:hf,accentColor:"#2196f3",invalidColor:"#e02525",fontFamily:["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],subtleTextColor:{ref:"textColor",mix:0.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,fontWeight:"inherit",focusShadow:{spread:3,color:O0(0.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:0.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:x_,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:0.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:P0,toggleButtonOffBackgroundColor:_0(0.3),toggleButtonSwitchBackgroundColor:x_,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:0.25}},panelBackgroundColor:x_,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,dialogShadow:{ref:"popupShadow"},dialogBorder:{color:s_(0.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:s_(0.2)},menuBackgroundColor:_0(0.03),menuTextColor:_0(0.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},ZH=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],GH=qH((_)=>{return _=_.toLowerCase(),ZH.find((f)=>_.endsWith(f.toLowerCase()))??"length"}),XQ=(_)=>{if(typeof _==="object"&&_?.ref)return w0(_.ref);if(typeof _==="string")return _;if(typeof _==="number")return String(_);return!1},cJ=(_)=>{if(typeof _==="string")return _;if(typeof _==="object"&&_&&"ref"in _){let f=w0(_.ref);if(_.mix==null)return f;return`color-mix(in srgb, ${_.onto?w0(_.onto):"transparent"}, ${f} ${JH(_.mix*100,0,100)}%)`}return!1},EH=XQ,L1=(_)=>{if(typeof _==="string")return _;if(typeof _==="number")return`${_}px`;if(typeof _==="object"&&_&&"calc"in _)return`calc(${_.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,($)=>$[0]==="-"?$:" "+w0($)+" ")})`;if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return!1},UH=XQ,N6=(_,f)=>{if(typeof _==="string")return _;if(_===!0)return N6({},f);if(_===!1)return f==="columnBorder"?N6({color:"transparent"},f):"none";if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return f5(_.style??"solid")+" "+L1(_.width??{ref:"borderWidth"})+" "+cJ(_.color??{ref:"borderColor"})},H9=(_)=>{return[L1(_.offsetX??0),L1(_.offsetY??0),L1(_.radius??0),L1(_.spread??0),cJ(_.color??{ref:"foregroundColor"}),..._.inset?["inset"]:[]].join(" ")},HH=(_)=>{if(typeof _==="string")return _;if(_===!1)return"none";if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);if(Array.isArray(_))return _.map(H9).join(", ");return H9(_)},f5=XQ,$5=(_)=>{if(typeof _==="string")return _.includes(",")?_:W9(_);if(typeof _==="object"&&_&&"googleFont"in _)return $5(_.googleFont);if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);if(Array.isArray(_))return _.map((f)=>{if(typeof f==="object"&&"googleFont"in f)f=f.googleFont;return W9(f)}).join(", ");return!1},W9=(_)=>/^[\w-]+$|\w\(/.test(_)?_:JSON.stringify(_),WH=XQ,z5=(_)=>{if(typeof _==="string")return _;if(typeof _==="object"&&_&&"url"in _)return`url(${JSON.stringify(_.url)})`;if(typeof _==="object"&&_&&"svg"in _)return z5({url:`data:image/svg+xml,${encodeURIComponent(_.svg)}`});if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return!1},BH=(_,f,$)=>{if(typeof _==="string")return _;if(typeof _==="number"){if(_>=10)$?.warn(104,{value:_,param:f});return`${_}s`}if(typeof _==="object"&&_&&"ref"in _)return w0(_.ref);return!1},KH={color:cJ,colorScheme:EH,length:L1,scale:UH,border:N6,borderStyle:f5,shadow:HH,image:z5,fontFamily:$5,fontWeight:WH,duration:BH},LH=(_,f,$)=>{let z=GH(_);return KH[z](f,_,$)};var FH=(_,f)=>new Q5({themeLogger:_,overridePrefix:f}),Q5=class _{constructor(f,$=[]){this.params=f,this.parts=$}withPart(f){if(typeof f==="function")f=f();if(!(f instanceof _5))return this.params.themeLogger.preInitErr(259,"Invalid part",{part:f}),this;return new _(this.params,[...this.parts,f])}withoutPart(f){return this.withPart(k0({feature:f}))}withParams(f,$=Jf){return this.withPart(k0({modeParams:{[$]:f}}))}_startUse({styleContainer:f,cssLayer:$,nonce:z,loadThemeGoogleFonts:Q,moduleCss:J}){if(iJ)return;if(vz)return;MH(),oX(f,$,z,J);let q=DH(this);if(q.length>0){for(let X of q)if(Q)kH(X,z)}for(let X of this.parts)X.use(f,$,z)}_getCssClass(){if(vz)return"ag-theme-quartz";return this._cssClassCache??(this._cssClassCache=B9(this.parts).map((f)=>f.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName=`ag-theme-params-${++eX().paramsId}`)}_getModeParams(){let f=this._paramsCache;if(!f){let $={[Jf]:{...YH}};for(let z of B9(this.parts))for(let Q of Object.keys(z.modeParams)){let J=z.modeParams[Q];if(J){let q=$[Q]??($[Q]={}),X=new Set;for(let Y of Object.keys(J)){let Z=J[Y];if(Z!==void 0)q[Y]=Z,X.add(Y)}if(Q===Jf)for(let Y of Object.keys($)){let Z=$[Y];if(Y!==Jf)for(let G of X)delete Z[G]}}}this._paramsCache=f=$}return f}_getParamsCss(){if(!this._paramsCssCache){let f="",$="",z=this._getModeParams(),{overridePrefix:Q,themeLogger:J}=this.params,q=Q?`--ag-${Q}-`:void 0;for(let Z of Object.keys(z)){let G=z[Z];if(Z!==Jf){let U=`:where([data-ag-theme-mode="${typeof CSS==="object"?CSS.escape(Z):Z}"]) & { -`;f+=U,$+=U}for(let E of Object.keys(G).sort()){let U=G[E],H=LH(E,U,J);if(H===!1)J.error(107,{key:E,value:U});else{let W=mJ(E),B=q?W.replace("--ag-",q):W,K=W.replace("--ag-","--ag-inherited-");f+=` ${W}: var(${K}, ${H}); -`,$+=` ${K}: var(${B}); -`}}if(Z!==Jf)f+=`} -`,$+=`} -`}let X=`:where(.${this._getParamsClassName()})`,Y=`${X} { -${f}} -`;Y+=`:has(> ${X}):not(${X}) { -${$}} -`,this._paramsCssCache=Y}return this._paramsCssCache}},B9=(_)=>{let f=new Map;for(let z of _)f.set(z.feature,z);let $=[];for(let z of _)if(!z.feature||f.get(z.feature)===z)$.push(z);return $},DH=(_)=>{let f=new Set,$=(J)=>{if(Array.isArray(J))J.forEach($);else{let q=J?.googleFont;if(typeof q==="string")f.add(q)}};return Object.values(_._getModeParams()).flatMap((J)=>Object.values(J)).forEach($),Array.from(f).sort()},K9=!1,MH=()=>{if(K9)return;K9=!0;for(let _ of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))_.remove()},kH=async(_,f)=>{let $=`@import url('https://${SH}/css2?family=${encodeURIComponent(_)}:wght@100;200;300;400;500;600;700;800;900&display=swap'); -`;rf($,document.head,`googleFont:${_}`,void 0,0,f)},SH="fonts.googleapis.com",L9={changeKey:"listItemHeight",type:"length",defaultValue:24},AH=class extends j_{constructor(){super(...arguments);this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(_){this.eRootDiv=_.eRootDiv}postConstruct(){let{gos:_,eRootDiv:f}=this;_.setInstanceDomData(f);let $=_.get("themeStyleContainer"),z=typeof ShadowRoot<"u",Q=z&&f.getRootNode()instanceof ShadowRoot;if(this.eStyleContainer=(typeof $==="function"?$():$)??(Q?f:document.head),!$&&!Q&&z)RH(f,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this));this.cssLayer=_.get("themeCssLayer"),this.styleNonce=_.get("styleNonce"),this.addManagedPropertyListener("theme",()=>this.handleThemeChange()),this.handleThemeChange(),this.getSizeEl(L9),this.initVariables(),this.addDestroyFunc(()=>$H(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(_,f=[]){let{theme:$}=this,z=$?$._getCssClass():this.applyLegacyThemeClasses();for(let Q of Array.from(_.classList))if(Q.startsWith("ag-theme-"))_.classList.remove(Q);if(z){let Q=_.className;_.className=`${Q}${Q?" ":""}${z}${f?.length?" "+f.join(" "):""}`}}applyLegacyThemeClasses(){let _="";this.mutationObserver.disconnect();let f=this.eRootDiv;while(f){let $=!1;for(let z of Array.from(f.classList))if(z.startsWith("ag-theme-"))$=!0,_=_?`${_} ${z}`:z;if($)this.mutationObserver.observe(f,{attributes:!0,attributeFilter:["class"]});f=f.parentElement}return _}addGlobalCSS(_,f){if(this.theme)rf(_,this.eStyleContainer,f,this.cssLayer,0,this.styleNonce);else this.globalCSS.push([_,f])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(L9)}getCSSVariablePixelValue(_){let f=this.lastKnownValues.get(_);if(f!=null)return f;let $=this.measureSizeEl(_);if($==="detached"||$==="no-styles"){if(_.cacheDefault)this.lastKnownValues.set(_,_.defaultValue);return _.defaultValue}return this.lastKnownValues.set(_,$),$}measureSizeEl(_){let f=this.getSizeEl(_);if(f.offsetParent==null)return"detached";let $=f.offsetWidth;if($===W6)return"no-styles";return this.sizesMeasured=!0,$}getMeasurementContainer(){let _=this.eMeasurementContainer;if(!_)_=this.eMeasurementContainer=B_({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(_);return _}getSizeEl(_){let f=this.sizeEls.get(_);if(f)return f;let $=this.getMeasurementContainer();f=B_({tag:"div"});let z=this.setSizeElStyles(f,_);$.appendChild(f),this.sizeEls.set(_,f);let{type:Q,noWarn:J}=_;if(Q!=="length"&&Q!=="border")return f;let q=this.measureSizeEl(_);if(q==="no-styles"&&!J)this.varError(z,_.defaultValue);let X=S0(this.beans,f,()=>{let Y=this.measureSizeEl(_);if(Y==="detached"||Y==="no-styles")return;if(this.lastKnownValues.set(_,Y),Y!==q)q=Y,this.fireStylesChangedEvent(_.changeKey)});return this.addDestroyFunc(()=>X()),f}setSizeElStyles(_,f){let{changeKey:$,type:z}=f,Q=mJ($);if(z==="border"){if(Q.endsWith("-width"))Q=Q.slice(0,-6);_.className="ag-measurement-element-border",_.style.setProperty("--ag-internal-measurement-border",`var(${Q}, solid ${W6}px)`)}else _.style.width=`var(${Q}, ${W6}px)`;return Q}handleThemeChange(){let{gos:_,theme:f}=this,$=_.get("theme"),z;if($==="legacy")z=void 0;else{let Q=$??this.getDefaultTheme();if(Q instanceof Q5)z=Q;else this.themeError(Q)}if(z!==f)this.handleNewTheme(z);this.postProcessThemeChange(z,$)}handleNewTheme(_){let{gos:f,eRootDiv:$,globalCSS:z}=this,Q=this.getAdditionalCss();if(_){oX(this.eStyleContainer,this.cssLayer,this.styleNonce,Q);for(let[J,q]of z)rf(J,this.eStyleContainer,q,this.cssLayer,0,this.styleNonce);z.length=0}this.theme=_,_?._startUse({loadThemeGoogleFonts:f.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:Q}),fH(this,_?._getParamsCss()??null,_?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses($),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(_){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${_}Changed`]:!0})}},W6=15538,RH=(_,f,$)=>{let z=60,Q=setInterval(()=>{if(typeof ShadowRoot<"u"&&_.getRootNode()instanceof ShadowRoot)f(),clearInterval(Q);if(_.isConnected||--z<0)clearInterval(Q)},1000);$(()=>clearInterval(Q))},jH=".ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:\"\";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:\"\";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:\"\";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:\"\";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:\"\";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:\"\";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:\"\";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:\"\";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path(\"M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z\");color:var(--ag-icon-button-active-color)}}",VH={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarPanelAnimationDuration:0,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:x_,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},cellFontSize:{ref:"dataFontSize"},cellFontWeight:{ref:"fontWeight"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:P0,rangeSelectionBackgroundColor:O0(0.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:O0(0.5),rangeHeaderHighlightColor:XH(0.08),rowNumbersSelectedColor:O0(0.5),rowHoverColor:O0(0.08),columnHoverColor:O0(0.05),selectedRowBackgroundColor:O0(0.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:0.66},dataBackgroundColor:x_,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{ref:"rowHeight",calc:"max(rowHeight, 22px)"},dragHandleColor:s_(0.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:s_(0.1),iconButtonActiveColor:P0,iconButtonActiveBackgroundColor:O0(0.28),iconButtonActiveIndicatorColor:P0,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:s_(0.8),cellEditingBorder:{color:P0},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.25},columnSelectIndentSize:{ref:"iconSize"},toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:s_(0.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:s_(0.13)},selectCellBackgroundColor:s_(0.07),selectCellBorder:{color:s_(0.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:x_,filterPanelApplyButtonBackgroundColor:P0,columnPanelApplyButtonColor:x_,columnPanelApplyButtonBackgroundColor:P0,filterPanelCardSubtleColor:{ref:"textColor",mix:0.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:hf,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:hf,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:s_(0.15),statusBarLabelColor:hf,statusBarLabelFontWeight:500,statusBarValueColor:hf,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2},OH=".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}",J5={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},PH={...J5,cellBatchEditTextColor:"#f3d0b3"},vH=()=>k0({feature:"batchEditStyle",params:J5,css:OH}),TH=vH(),IH=":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}",yH={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}};var bH=()=>k0({feature:"buttonStyle",params:{...yH,buttonBackgroundColor:x_,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:P0}},css:IH}),CH=bH();var wH=".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}";var xH=()=>{return k0({feature:"columnDropStyle",css:wH})},q5=xH();var NH={formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:0.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:0.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:0.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:0.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:0.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:0.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:0.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}}},gH=()=>k0({feature:"formulaStyle",params:NH}),hH=gH(),uH={warn:(..._)=>{j(_[0],_[1])},error:(..._)=>{e(_[0],_[1])},preInitErr:(..._)=>{r1(_[0],_[2],_[1])}},iH=()=>FH(uH).withParams(VH).withPart(CH).withPart(q5).withPart(TH).withPart(hH),mH='.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}',cH=()=>k0({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:x_,checkboxUncheckedBorderColor:_0(0.3),checkboxCheckedBackgroundColor:P0,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:''},checkboxCheckedShapeColor:x_,checkboxIndeterminateBackgroundColor:_0(0.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:''},checkboxIndeterminateShapeColor:x_,radioCheckedShapeImage:{svg:''}},css:mH}),pH=cH();var X5=()=>({...Tz,...PH,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:_0(0.05),rowHoverColor:O0(0.15),selectedRowBackgroundColor:O0(0.2),menuBackgroundColor:_0(0.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:hf,columnPanelApplyButtonColor:hf,findMatchColor:x_,findActiveMatchColor:x_,checkboxUncheckedBorderColor:_0(0.4),toggleButtonOffBackgroundColor:_0(0.4),rowBatchEditBackgroundColor:_0(0.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"});var nH=()=>({...X5(),backgroundColor:"#1f2836"});var dH=()=>k0({feature:"colorScheme",params:Tz,modeParams:{light:Tz,dark:X5(),"dark-blue":nH()}}),tH=dH();var Y5={aggregation:'',arrows:'',asc:'',cancel:'',chart:'',"color-picker":'',columns:'',contracted:'',copy:'',cross:'',csv:'',cut:'',desc:'',down:'',excel:'',expanded:'',eye:'',"eye-slash":'',filter:'',first:'',grip:'',group:'',last:'',left:'',linked:'',loading:'',maximize:'',menu:'',"menu-alt":'',minimize:'',minus:'',next:'',none:'',"not-allowed":'',paste:'',pin:'',pivot:'',plus:'',previous:'',right:'',save:'',settings:'',"small-left":'',"small-right":'',tick:'',"tree-closed":'',"tree-indeterminate":'',"tree-open":'',unlinked:'',up:''},Z5={aasc:'',adesc:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"column-arrow":'',edit:'',"filter-add":'',"pinned-bottom":'',"pinned-top":'',"small-down":'',"small-up":'',"un-pin":''},rH=(_={})=>{let f="";for(let $ of[...Object.keys(Y5),...Object.keys(Z5)]){let z=lH($,_.strokeWidth);f+=`.ag-icon-${$}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(z)}'); } -`}return f},lH=(_,f=1.5)=>{let $=Z5[_];if($)return $;let z=Y5[_];if(!z)throw Error(`Missing icon data for ${_}`);return``+z+""},G5=(_={})=>{return k0({feature:"iconSet",css:()=>rH(_)})},E5=G5({strokeWidth:1}),sH=G5();var aH=":where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:\"\";display:block;height:12px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}",oH=".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}";var eH={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:0.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4};var _W=()=>k0({feature:"inputStyle",params:{...eH,inputBackgroundColor:x_,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:P0},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:_0(0.06),inputDisabledTextColor:{ref:"textColor",mix:0.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>aH+oH}),fW=_W();var $W=".ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:\"\";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}";var zW={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1};var QW=()=>k0({feature:"tabStyle",params:{...zW,tabBarBorder:!0,tabBarBackgroundColor:s_(0.05),tabTextColor:{ref:"textColor",mix:0.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:x_},css:$W}),JW=QW();var qW=()=>({fontFamily:[{googleFont:"IBM Plex Sans"},"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu"]}),XW=()=>iH().withPart(pH).withPart(tH).withPart(sH).withPart(JW).withPart(fW).withPart(q5).withParams(qW()),pJ=XW();var kf=(_,f,$,z,Q)=>({changeKey:_,type:f,defaultValue:$,noWarn:z,cacheDefault:Q}),YW=kf("cellHorizontalPadding","length",16),ZW=kf("indentationLevel","length",0,!0,!0),GW=kf("rowGroupIndentSize","length",0),F9=kf("rowHeight","length",42),D9=kf("headerHeight","length",48),B6=kf("rowBorderWidth","border",1),M9=kf("pinnedRowBorderWidth","border",1),EW=kf("headerRowBorderWidth","border",1);function UW(_,f){for(let $ of f.sort((z,Q)=>z.moduleName.localeCompare(Q.moduleName))){let z=$.css;if(z)_.set(`module-${$.moduleName}`,z)}}var HW=class extends AH{initVariables(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.getSizeEl(F9),this.getSizeEl(D9),this.getSizeEl(B6),this.getSizeEl(M9),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(M9)}getRowBorderWidth(){return this.getCSSVariablePixelValue(B6)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(EW)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(F9)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(D9)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(YW)}getCellPaddingLeft(){let _=this.getDefaultCellHorizontalPadding(),f=this.getCSSVariablePixelValue(ZW),$=this.getCSSVariablePixelValue(GW);return _-1+$*f}getCellPadding(){let _=this.getDefaultCellHorizontalPadding()-1;return this.getCellPaddingLeft()+_}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){let{eRootDiv:_}=this,f=_.style.getPropertyValue("--ag-line-height").trim(),$=this.gos.get("rowHeight");if($==null||isNaN($)||!isFinite($)){if(f!==null)_.style.setProperty("--ag-line-height",null);return-1}let z=`${$}px`;if(f!=z)return _.style.setProperty("--ag-line-height",z),$;return f!=""?Number.parseFloat(f):-1}fireStylesChangedEvent(_){if(_==="rowBorderWidth")this.refreshRowBorderWidthVariable();super.fireStylesChangedEvent(_)}refreshRowBorderWidthVariable(){let _=this.getCSSVariablePixelValue(B6);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${_}px`)}postProcessThemeChange(_,f){if(_&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded"))if(f)e(106);else e(239)}getAdditionalCss(){let _=new Map;return _.set("core",[jH]),UW(_,Array.from(Y7())),_}getDefaultTheme(){return pJ}varError(_,f){j(9,{variable:{cssName:_,defaultValue:f}})}themeError(_){e(240,{theme:_})}shadowRootError(){e(293)}},WW=class extends j_{constructor(){super(...arguments);this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new D0}addListener(_,f,$){this.globalSvc.addEventListener(_,f,$)}removeListener(_,f,$){this.globalSvc.removeEventListener(_,f,$)}addGlobalListener(_,f=!1){this.globalSvc.addGlobalListener(_,f)}removeGlobalListener(_,f=!1){this.globalSvc.removeGlobalListener(_,f)}dispatchEvent(_){this.globalSvc.dispatchEvent(this.gos.addCommon(_))}dispatchEventOnce(_){this.globalSvc.dispatchEventOnce(this.gos.addCommon(_))}},BW=class extends WW{postConstruct(){let{globalListener:_,globalSyncListener:f}=this.beans;if(_)this.addGlobalListener(_,!0);if(f)this.addGlobalListener(f,!1)}};function g6(_,f,$){let z=_.visibleCols.headerGroupRowCount;if($>=z)return{column:f,headerRowIndex:$};let Q=f.getParent();while(Q&&Q.getProvidedColumnGroup().getLevel()>$)Q=Q.getParent();let J=f.isSpanHeaderHeight();if(!Q||J&&Q.isPadding())return{column:f,headerRowIndex:z};return{column:Q,headerRowIndex:Q.getProvidedColumnGroup().getLevel()}}var KW=class extends A{constructor(){super(...arguments);this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){let _=this.beans;_.ctrlsSvc.whenReady(this,($)=>{this.gridBodyCon=$.gridBodyCtrl});let f=q_(_);this.addManagedElementListeners(f,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(_,f){let $,{colModel:z,colGroupSvc:Q,ctrlsSvc:J}=this.beans;if(typeof _==="string"){if($=z.getCol(_),!$)$=Q?.getColumnGroup(_)??null}else $=_;if(!$)return null;let X=J.getHeaderRowContainerCtrl()?.getAllCtrls(),Y=b(X||[]).type==="filter",Z=o_(this.beans)-1,G=-1,E=$;while(E)G++,E=E.getParent();let U=G;if(f&&Y&&U===Z-1)U++;return U===-1?null:{headerRowIndex:U,column:$}}navigateVertically(_,f){let{focusSvc:$,visibleCols:z}=this.beans,{focusedHeader:Q}=$;if(!Q)return!1;let{headerRowIndex:J}=Q,q=Q.column,X=o_(this.beans),Y=this.getHeaderRowType(J),Z=z.headerGroupRowCount,{headerRowIndex:G,column:E,headerRowIndexWithoutSpan:U}=_==="UP"?LW(Y,q,J):FW(q,J,Z),H=!1;if(G<0)G=0,E=q,H=!0;if(G>=X)G=-1,this.currentHeaderRowWithoutSpan=-1;else if(U!==void 0)this.currentHeaderRowWithoutSpan=U;if(!H&&!E)return!1;return $.focusHeaderPosition({headerPosition:{headerRowIndex:G,column:E},allowUserOverride:!0,event:f})}navigateHorizontally(_,f=!1,$){let{focusSvc:z,gos:Q}=this.beans,J={...z.focusedHeader},q,X;if(this.currentHeaderRowWithoutSpan!==-1)J.headerRowIndex=this.currentHeaderRowWithoutSpan;else this.currentHeaderRowWithoutSpan=J.headerRowIndex;if(_==="LEFT"!==Q.get("enableRtl"))X="Before",q=this.findHeader(J,X);else X="After",q=this.findHeader(J,X);let Y=Q.getCallback("tabToNextHeader");if(f&&Y){let Z=z.focusHeaderPositionFromUserFunc({userFunc:Y,headerPosition:q,direction:X});if(Z){let{headerRowIndex:G}=z.focusedHeader||{};if(G!=null&&G!=J.headerRowIndex)this.currentHeaderRowWithoutSpan=G}return Z}if(q||!f)return z.focusHeaderPosition({headerPosition:q,direction:X,fromTab:f,allowUserOverride:!0,event:$});return this.focusNextHeaderRow(J,X,$)}focusNextHeaderRow(_,f,$){let z=this.beans,Q=_.headerRowIndex,J=null,q,X=o_(z),Y=this.beans.visibleCols.allCols;if(f==="Before"){if(Q<=0)return!1;J=b(Y),q=Q-1,this.currentHeaderRowWithoutSpan-=1}else if(J=Y[0],q=Q+1,this.currentHeaderRowWithoutSpan=X)G=-1;return z.focusSvc.focusHeaderPosition({headerPosition:{column:Z,headerRowIndex:G},direction:f,fromTab:!0,allowUserOverride:!0,event:$})}scrollToColumn(_,f="After"){if(_.getPinned())return;let $;if(G_(_)){let z=_.getDisplayedLeafColumns();$=f==="Before"?b(z):z[0]}else $=_;this.gridBodyCon.scrollFeature.ensureColumnVisible($)}findHeader(_,f){let{colGroupSvc:$,visibleCols:z}=this.beans,Q=_.column;if(Q instanceof E$){let Y=Q.getDisplayedLeafColumns();Q=f==="Before"?Y[0]:Y[Y.length-1]}let J=f==="Before"?z.getColBefore(Q):z.getColAfter(Q);if(!J)return;let q=z.headerGroupRowCount;if(_.headerRowIndex>=q)return{headerRowIndex:_.headerRowIndex,column:J};let X=$?.getColGroupAtLevel(J,_.headerRowIndex);if(!X)return{headerRowIndex:J instanceof Z0&&J.isSpanHeaderHeight()?z.headerGroupRowCount:_.headerRowIndex,column:J};if(X.isPadding()&&J.isSpanHeaderHeight())return{headerRowIndex:z.headerGroupRowCount,column:J};return{headerRowIndex:_.headerRowIndex,column:X??J}}getHeaderRowType(_){let f=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(f)return f.getRowType(_)}};function LW(_,f,$){let z=$-1;if(_!=="filter"){let Q=f instanceof Z0&&f.isSpanHeaderHeight(),J=f.getParent();while(J&&(J.getProvidedColumnGroup().getLevel()>z||Q&&J.isPadding()))J=J.getParent();if(J)if(Q)return{column:J,headerRowIndex:J.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:z};else return{column:J,headerRowIndex:z,headerRowIndexWithoutSpan:z}}return{column:f,headerRowIndex:z,headerRowIndexWithoutSpan:z}}function FW(_,f,$){let z=f+1,Q={column:_,headerRowIndex:z,headerRowIndexWithoutSpan:z};if(_ instanceof E$){if(z>=$)return{column:_.getDisplayedLeafColumns()[0],headerRowIndex:$,headerRowIndexWithoutSpan:z};let q=_.getDisplayedChildren()[0];if(q instanceof E$&&q.isPadding()){let Y=q.getDisplayedLeafColumns()[0];if(Y.isSpanHeaderHeight())q=Y}if(Q.column=q,q instanceof Z0&&q.isSpanHeaderHeight())Q.headerRowIndex=$,Q.headerRowIndexWithoutSpan=z}return Q}var DW=class extends A{constructor(){super(...arguments);this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(_){this.colModel=_.colModel,this.visibleCols=_.visibleCols,this.rowRenderer=_.rowRenderer,this.navigation=_.navigation,this.filterManager=_.filterManager,this.overlays=_.overlays}postConstruct(){let _=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:_,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:_,columnRowGroupChanged:_}),this.addDestroyFunc(V8(this.beans))}attemptToRecoverFocus(){if(this.needsFocusRestored=!0,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout);this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){if(this.needsFocusRestored=!1,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null}shouldTakeFocus(){if(this.gos.get("suppressFocusAfterRefresh"))return this.setFocusRecovered(),!1;if(this.needsFocusRestored)return this.setFocusRecovered(),!0;return this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;let _=this.focusedCell.column,f=this.colModel.getCol(_.getId());if(_!==f)this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){let{gos:_,focusedCell:f}=this;if(_.get("suppressFocusAfterRefresh")||_.get("suppressCellFocus")||!f)return null;if(!this.doesRowOrCellHaveBrowserFocus())return null;return f}getFocusHeaderToUseAfterRefresh(){if(this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader)return null;if(!this.isDomDataPresentInHierarchy(d(this.beans),SX))return null;return this.focusedHeader}doesRowOrCellHaveBrowserFocus(){let _=d(this.beans);if(this.isDomDataPresentInHierarchy(_,Oz,!0))return!0;return this.isDomDataPresentInHierarchy(_,Pz,!0)}isDomDataPresentInHierarchy(_,f,$){let z=_;while(z){let Q=bq(this.gos,z,f);if(Q){if(Q.destroyed&&$)return this.attemptToRecoverFocus(),!1;return!0}z=z.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(_){let{rowIndex:f,rowPinned:$,column:z}=_,Q={rowIndex:f,rowPinned:$,column:z,isFullWidthCell:!1},J=this.rowRenderer.getRowByPosition({rowIndex:f,rowPinned:$});if(J)Q.isFullWidthCell=J.isFullWidth();return Q}clearFocusedCell(){if(this.focusedCell==null)return;let _=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",..._})}setFocusedCell(_){this.setFocusRecovered();let{column:f,rowIndex:$,rowPinned:z,forceBrowserFocus:Q=!1,preventScrollOnBrowserFocus:J=!1,sourceEvent:q}=_,X=this.colModel.getCol(f);if(!X){this.focusedCell=null;return}this.focusedCell={rowIndex:$,rowPinned:T0(z),column:X};let Y=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...Y,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:Q,preventScrollOnBrowserFocus:J,sourceEvent:q}),this.previousCellFocusParams=Y}isCellFocused(_){if(this.focusedCell==null)return!1;return C1(_,this.focusedCell)}isHeaderWrapperFocused(_){if(this.focusedHeader==null)return!1;let{column:f,rowCtrl:{rowIndex:$,pinned:z}}=_,{column:Q,headerRowIndex:J}=this.focusedHeader;return f===Q&&$===J&&z==Q.getPinned()}focusHeaderPosition(_){if(this.setFocusRecovered(),W0(this.beans))return!1;let{direction:f,fromTab:$,allowUserOverride:z,event:Q,fromCell:J,rowWithoutSpanValue:q,scroll:X=!0}=_,{headerPosition:Y}=_;if(J&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(Y);if(z){let Z=this.focusedHeader,G=o_(this.beans);if($){let E=this.gos.getCallback("tabToNextHeader");if(E)Y=this.getHeaderPositionFromUserFunc({userFunc:E,direction:f,currentPosition:Z,headerPosition:Y,headerRowCount:G})}else{let E=this.gos.getCallback("navigateToNextHeader");if(E&&Q){let U={key:Q.key,previousHeaderPosition:Z,nextHeaderPosition:Y,headerRowCount:G,event:Q},H=E(U);Y=H===null?Z:H}}}if(!Y)return!1;return this.focusProvidedHeaderPosition({headerPosition:Y,direction:f,event:Q,fromCell:J,rowWithoutSpanValue:q,scroll:X})}focusHeaderPositionFromUserFunc(_){if(W0(this.beans))return!1;let{userFunc:f,headerPosition:$,direction:z,event:Q}=_,J=this.focusedHeader,q=o_(this.beans),X=this.getHeaderPositionFromUserFunc({userFunc:f,direction:z,currentPosition:J,headerPosition:$,headerRowCount:q});return!!X&&this.focusProvidedHeaderPosition({headerPosition:X,direction:z,event:Q})}getHeaderPositionFromUserFunc(_){let{userFunc:f,direction:$,currentPosition:z,headerPosition:Q,headerRowCount:J}=_,X=f({backwards:$==="Before",previousHeaderPosition:z,nextHeaderPosition:Q,headerRowCount:J});if(X===!0)return z;if(X===!1)return null;return X}focusProvidedHeaderPosition(_){let{headerPosition:f,direction:$,fromCell:z,rowWithoutSpanValue:Q,event:J,scroll:q=!0}=_,{column:X,headerRowIndex:Y}=f,{filterManager:Z,ctrlsSvc:G,headerNavigation:E}=this.beans;if(this.focusedHeader&&a8(_.headerPosition,this.focusedHeader))return!1;if(Y===-1){if(Z?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(f);return this.focusGridView({column:X,event:J})}if(q)E?.scrollToColumn(X,$);let H=G.getHeaderRowContainerCtrl(X.getPinned())?.focusHeader(f.headerRowIndex,X,J)||!1;if(E&&H&&(Q!=null||z))E.currentHeaderRowWithoutSpan=Q??-1;return H}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;let _=this.visibleCols.allCols[0];if(!_)return!1;let f=g6(this.beans,_,0);return this.focusHeaderPosition({headerPosition:f,rowWithoutSpanValue:0})}focusLastHeader(_){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;let f=o_(this.beans)-1,$=b(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:f,column:$},rowWithoutSpanValue:-1,event:_})}focusPreviousFromFirstCell(_){if(this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(null);return this.focusLastHeader(_)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(_,f){if(this.focusedCell==null)return!1;return this.focusedCell.rowIndex===_&&this.focusedCell.rowPinned===T0(f)}focusOverlay(_){let f=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!f&&F_(f,_)}getDefaultTabToNextGridContainerTarget(_){let{backwards:f,focusableContainers:$}=_,z=f?-1:1,Q,J=()=>{if(Q===void 0)Q=this.getGridBodyTabTarget(f);return Q};for(let q=_.nextIndex;q>=0&&q<$.length;q+=z){let X=d8($[q],J);if(X)return X}return null}getGridBodyTabTarget(_){if(_)return this.getGridViewTabTarget({column:b(this.visibleCols.allCols),backwards:!0});let f=this.visibleCols.allCols[0];if(this.gos.get("headerHeight")===0||W0(this.beans))return this.getGridViewTabTarget({column:f});if(!f)return null;return g6(this.beans,f,0)}getGridViewTabTarget(_){let{backwards:f=!1}=_,$=_.column??this.focusedHeader?.column;if(!$)return null;if(this.overlays?.exclusive)return null;if(Vz(this.beans))return f&&!W0(this.beans)?{headerRowIndex:o_(this.beans)-1,column:$}:null;let z=f?Wf(this.beans):O1(this.beans);if(z?.rowIndex==null){if(this.overlays?.isVisible())return null;if(f&&!W0(this.beans)){let J=b(this.visibleCols.allCols);if(J)return{headerRowIndex:o_(this.beans)-1,column:J}}return null}let Q=D_(this.beans,z);if(!Q||$.isSuppressNavigable(Q))return null;if(f){if(this.rowRenderer.getRowByPosition(z)?.isFullWidth())return null}return{rowIndex:z.rowIndex,rowPinned:z.rowPinned,column:$}}focusGridView(_){let{backwards:f=!1,canFocusOverlay:$=!0,event:z}=_;if(this.overlays?.exclusive)return $&&this.focusOverlay(f);if(Vz(this.beans)){if(f){if(!W0(this.beans))return this.focusLastHeader()}if($&&this.focusOverlay(f))return!0;if(f)return!1;return q0(this.beans,f)}let Q=f?Wf(this.beans):O1(this.beans);if(Q){let J=_.column??this.focusedHeader?.column,{rowIndex:q,rowPinned:X}=Q,Y=D_(this.beans,Q);if(!J||!Y||q==null)return!1;if(J.isSuppressNavigable(Y)){let Z=this.gos.get("enableRtl"),G;if(!z||z.key===S.TAB)G=Z?S.LEFT:S.RIGHT;else G=z.key;return this.beans.navigation?.navigateToNextCell(null,G,{rowIndex:q,column:J,rowPinned:X||null},!0),!0}if(this.navigation?.ensureCellVisible({rowIndex:q,column:J,rowPinned:X}),f){if(this.rowRenderer.getRowByPosition(Q)?.isFullWidth()&&this.navigation?.tryToFocusFullWidthRow(Q,f))return!0}if(this.setFocusedCell({rowIndex:q,column:J,rowPinned:T0(X),forceBrowserFocus:!0}),!I_(J))this.beans.rangeSvc?.setRangeToCell({rowIndex:q,rowPinned:X,column:J});return!0}if($&&this.focusOverlay(f))return!0;if(f&&this.focusLastHeader())return!0;return!1}focusAdvancedFilter(_){return this.advFilterFocusColumn=_?.column,this.beans.advancedFilter?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(_,f){let $=(f?void 0:this.advFilterFocusColumn)??this.visibleCols.allCols?.[0];if(_)return this.focusHeaderPosition({headerPosition:{column:$,headerRowIndex:o_(this.beans)-1}});return this.focusGridView({column:$})}clearAdvancedFilterColumn(){this.advFilterFocusColumn=void 0}},MW=class extends A{constructor(){super(...arguments);this.beanName="scrollVisibleSvc"}wireBeans(_){this.ctrlsSvc=_.ctrlsSvc,this.colAnimation=_.colAnimation}postConstruct(){let{gos:_}=this;this.horizontalScrollShowing=_.get("alwaysShowHorizontalScroll")===!0,this.verticalScrollShowing=_.get("alwaysShowVerticalScroll")===!0,this.getScrollbarWidth();let f=this.updateScrollVisible.bind(this);this.addManagedEventListeners({displayedColumnsChanged:f,displayedColumnsWidthChanged:f,newColumnsLoaded:f})}updateScrollVisible(){let{colAnimation:_}=this;if(_?.isActive())_.executeLaterVMTurn(()=>{_.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())});else this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){let _=this.ctrlsSvc.get("center");if(!_||this.colAnimation?.isActive())return;let f={horizontalScrollShowing:_.isHorizontalScrollShowing(),verticalScrollShowing:this.verticalScrollShowing};this.setScrollsVisible(f),this.updateScrollGap()}updateScrollGap(){let _=this.ctrlsSvc.get("center"),f=_.hasHorizontalScrollGap(),$=_.hasVerticalScrollGap();if(this.horizontalScrollGap!==f||this.verticalScrollGap!==$)this.horizontalScrollGap=f,this.verticalScrollGap=$,this.eventSvc.dispatchEvent({type:"scrollGapChanged"})}setScrollsVisible(_){if(this.horizontalScrollShowing!==_.horizontalScrollShowing||this.verticalScrollShowing!==_.verticalScrollShowing)this.horizontalScrollShowing=_.horizontalScrollShowing,this.verticalScrollShowing=_.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"})}getScrollbarWidth(){if(this.scrollbarWidth==null){let _=this.gos.get("scrollbarWidth"),$=typeof _==="number"&&_>=0?_:FJ();if($!=null)this.scrollbarWidth=$,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"})}return this.scrollbarWidth}},kW=class extends A{constructor(){super(...arguments);this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;let{stateSvc:_,ctrlsSvc:f,context:$}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:_?.getState()??{}}),this.destroyCalled=!0,f.get("gridCtrl")?.destroyGridUi(),$.destroy(),super.destroy()}},SW=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","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","filterUiChanged","filterOpened","floatingFilterUiChanged","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","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped"];var Wz=new Set(["gridPreDestroyed","fillStart","pasteStart"]),nJ=SW.reduce((_,f)=>{return _[f]=O7(f),_},{}),j1={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find"};function k9(_){return`"${_}"`}var AW=()=>({checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."},rowGroupingHierarchy:{version:"34.3",message:"Use `colDef.groupHierarchy` instead."}}),RW={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:_,editable:f,groupRowEditable:$})=>{if(!(!!f||!!$))return null;if(typeof _==="string")return j1[_]??"CustomEditor";return"CustomEditor"},cellRenderer:({cellRenderer:_})=>{if(typeof _!=="string")return null;return j1[_]},cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:_,cellEditor:f})=>{if(_&&!f)return"TextEditor";return null},groupRowEditable:({groupRowEditable:_,cellEditor:f})=>{if(!_)return null;return f?"RowGroupingEdit":["RowGroupingEdit","TextEditor"]},groupRowValueSetter:({groupRowValueSetter:_})=>_?"RowGroupingEdit":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:_})=>{if(_&&typeof _!=="string"&&typeof _!=="boolean")return"CustomFilter";if(typeof _==="string")return j1[_]??"ColumnFilter";return"ColumnFilter"},floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:(_)=>{let f=["columnsMenuTab","generalMenuTab"];if(_.menuTabs?.some(($)=>f.includes($)))return"ColumnMenu";return null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},jW=()=>{return{autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(f,{paginationAutoPageSize:$})=>{if($)return"colDef.autoHeight is not supported with paginationAutoPageSize.";return null}},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:(f)=>{if((f.rowGroup!=null||f.rowGroupIndex!=null||f.cellRenderer==="agGroupCellRenderer")&&"checkbox"in f.cellRendererParams)return'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.';return null}},flex:{validate:(f,$)=>{if($.autoSizeStrategy)return"colDef.flex is not supported with gridOptions.autoSizeStrategy";return null}},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(f,{rowSelection:$})=>$==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(f,{rowSelection:$})=>$==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(f,{rowSelection:$})=>$==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:(f)=>{let $=f.headerValueGetter;if(typeof $==="function"||typeof $==="string")return null;return"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:f})=>{if(f){if(f.smallDown)return $0(262);if(f.smallLeft)return $0(263);if(f.smallRight)return $0(264)}return null}},sort:{validate:(f)=>{if(A1(f.sort)||Ef(f.sort))return null;return`sort must be of type (SortDirection | SortDef), currently it is ${typeof f.sort==="object"?JSON.stringify(f.sort):Zz(f.sort)}`}},initialSort:{validate:(f)=>{if(A1(f.initialSort)||Ef(f.initialSort))return null;return`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof f.initialSort==="object"?JSON.stringify(f.initialSort):Zz(f.initialSort)}`}},sortingOrder:{validate:(f)=>{let $=f.sortingOrder;if(Array.isArray($)&&$.length>0){let z=$.filter((Q)=>{return!(A1(Q)||Ef(Q))});if(z.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${z.map((Q)=>typeof Q==="string"||Q==null?Zz(Q):JSON.stringify(Q)).join(", ")}]`}else if(!Array.isArray($)||!$.length)return`sortingOrder must be an array with at least one element, currently it is [${$}]`;return null}},type:{validate:(f)=>{let $=f.type;if($ instanceof Array){if($.some((Q)=>typeof Q!=="string"))return"if colDef.type is supplied an array it should be of type 'string[]'";return null}if(typeof $==="string")return null;return"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(f,{suppressRowTransform:$})=>{if(!$)return"colDef.rowSpan requires suppressRowTransform to be enabled.";return null}},spanRows:{dependencies:{editable:{required:[!1,void 0]},groupRowEditable:{required:[!1,void 0]},rowDrag:{required:[!1,void 0]},colSpan:{required:[void 0]},rowSpan:{required:[void 0]}},validate:(f,{rowSelection:$,cellSelection:z,suppressRowTransform:Q,enableCellSpan:J,rowDragEntireRow:q,enableCellTextSelection:X})=>{if(typeof $==="object"){if($?.mode==="singleRow"&&$?.enableClickSelection)return"colDef.spanRows is not supported with rowSelection.clickSelection"}if(z)return"colDef.spanRows is not supported with cellSelection.";if(Q)return"colDef.spanRows is not supported with suppressRowTransform.";if(!J)return"colDef.spanRows requires enableCellSpan to be enabled.";if(q)return"colDef.spanRows is not supported with rowDragEntireRow.";if(X)return"colDef.spanRows is not supported with enableCellTextSelection.";return null}},groupHierarchy:{validate(f,{groupHierarchyConfig:$={}},z){let Q=new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),J=[];for(let q of f.groupHierarchy??[]){if(typeof q==="object"){z.validation?.validateColDef(q);continue}if(!Q.has(q)&&!(q in $))J.push(k9(q))}if(J.length>0){let q=`The following parts of colDef.groupHierarchy are not recognised: ${J.join(", ")}.`,X=`Choose one of ${[...Q].map(k9).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`;return`${q} -${X}`}return null}}}},VW={headerName:void 0,columnGroupShow:void 0,headerStyle:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,headerTooltipValueGetter:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,groupRowEditable:void 0,groupRowValueSetter:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,spanRows:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,tooltipComponentSelector:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0,dateComponent:void 0,dateComponentParams:void 0,getFindText:void 0,rowGroupingHierarchy:void 0,groupHierarchy:void 0,allowFormula:void 0},OW=()=>Object.keys(VW),PW=()=>({objectName:"colDef",allProperties:OW(),docsUrl:"column-properties/",deprecations:AW(),validations:jW()}),vW=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","treeDataChildrenField","treeDataParentIdField","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","invalidEditValueMode","grandTotalRow","themeCssLayer","findSearchValue","styleNonce","renderingMode"],TW=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","activeOverlayParams","popupParent","themeStyleContainer","statusBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterParent","advancedFilterBuilderParams","advancedFilterParams","formulaDataSource","formulaFuncs","initialState","autoSizeStrategy","selectionColumnDef","findOptions","filterHandlers","groupHierarchyConfig"],IW=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","suppressOverlays"],U5=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipSwitchShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns","rowDragInsertDelay"],yW=["theme","rowSelection"],bW=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],H5=["loadThemeGoogleFonts","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","allowContextMenuWithControlKey","suppressContextMenu","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","enableCellSpan","suppressClickEdit","rowDragEntireRow","rowDragManaged","refreshAfterGroupEdit","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupHideColumnsUntilExpanded","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","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault","enableFilterHandlers","suppressStartEditOnTab","hidePaddedHeaderRows","ssrmExpandAllAffectsAllRows","animateColumnResizing"],CW=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","overlayComponent","loadingOverlayComponent","noRowsOverlayComponent","overlayComponentSelector","activeOverlay","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getFullRowEditValidationErrors","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","tabToNextGridContainer","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","chartMenuItems","groupTotalRow","alwaysPassFilter","isRowPinnable","isRowPinned","isRowValidDropPosition"],wW=()=>[...IW,...TW,...vW,...U5,...CW,...H5,...bW,...yW];var xW=()=>({suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."},groupRemoveSingleChildren:{version:"33",message:"Use `groupHideParentOfSingleChild` instead."},groupRemoveLowestSingleChildren:{version:"33",message:'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'},suppressRowGroupHidesColumns:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'},suppressMakeColumnVisibleAfterUnGroup:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'},unSortIcon:{version:"33",message:"Use `defaultColDef.unSortIcon` instead."},sortingOrder:{version:"33",message:"Use `defaultColDef.sortingOrder` instead."},suppressPropertyNamesCheck:{version:"33",message:"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."},suppressAdvancedFilterEval:{version:"34",message:"Advanced filter no longer uses function evaluation, so this option has no effect."}});function V0(_,f,$){if(typeof f==="number"||f==null){if(f==null)return null;return f>=$?null:`${_}: value should be greater than or equal to ${$}`}return`${_}: value should be a number`}var NW={alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:"SharedRowGrouping",grandTotalRow:"ClientSideRowModelHierarchy",initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDetail:"SharedMasterDetail",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:"SharedPivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:"SharedRowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:"SharedTreeData",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},gW=()=>{let _={autoSizePadding:{validate({autoSizePadding:$}){return V0("autoSizePadding",$,0)}},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate({cacheBlockSize:$}){return V0("cacheBlockSize",$,1)}},cacheOverflowSize:{validate({cacheOverflowSize:$}){return V0("cacheOverflowSize",$,1)}},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:($)=>{let z=$.domLayout,Q=["autoHeight","normal","print"];if(z&&!Q.includes(z))return`domLayout must be one of [${Q.join()}], currently it's ${z}`;return null}},enableFillHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableCellSpan:{supportedRowModels:["clientSide","serverSide"]},enableRangeSelection:{dependencies:{rowDragEntireRow:{required:[!1,void 0]}}},enableRowPinning:{supportedRowModels:["clientSide"],validate({enableRowPinning:$,pinnedTopRowData:z,pinnedBottomRowData:Q}){if($&&(z||Q))return"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";return null}},isRowPinnable:{supportedRowModels:["clientSide"],validate({enableRowPinning:$,isRowPinnable:z,pinnedTopRowData:Q,pinnedBottomRowData:J}){if(z&&(Q||J))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!$&&z)return"`isRowPinnable` requires `enableRowPinning` to be set.";return null}},isRowPinned:{supportedRowModels:["clientSide"],validate({enableRowPinning:$,isRowPinned:z,pinnedTopRowData:Q,pinnedBottomRowData:J}){if(z&&(Q||J))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!$&&z)return"`isRowPinned` requires `enableRowPinning` to be set.";return null}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideColumnsUntilExpanded:{supportedRowModels:["clientSide"],validate({groupHideColumnsUntilExpanded:$,groupHideOpenParents:z,groupDisplayType:Q}){if($&&!z&&Q!=="multipleColumns")return"`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`";return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:{required:[void 0,"bottom"]},treeData:{required:[void 0,!1],reason:"Tree Data has values at the group level so it doesn't make sense to hide them."}}},groupHideParentOfSingleChild:{dependencies:{groupHideOpenParents:{required:[void 0,!1]}}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveSingleChildren:{required:[void 0,!1]}}},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveLowestSingleChildren:{required:[void 0,!1]}}},groupSelectsChildren:{dependencies:{rowSelection:{required:["multiple"]}}},groupHierarchyConfig:{validate({groupHierarchyConfig:$={}},z,Q){for(let J of Object.keys($))Q.validation?.validateColDef($[J]);return null}},icons:{validate:({icons:$})=>{if($){if($.smallDown)return $0(262);if($.smallLeft)return $0(263);if($.smallRight)return $0(264)}return null}},infiniteInitialRowCount:{validate({infiniteInitialRowCount:$}){return V0("infiniteInitialRowCount",$,1)}},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:($)=>{if(typeof $.ssrmExpandAllAffectsAllRows==="boolean"){if($.rowModelType!=="serverSide")return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if($.ssrmExpandAllAffectsAllRows&&typeof $.getRowId!=="function")return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate({keepDetailRowsCount:$}){return V0("keepDetailRowsCount",$,1)}},paginationPageSize:{validate({paginationPageSize:$}){return V0("paginationPageSize",$,1)}},paginationPageSizeSelector:{validate:($)=>{let z=$.paginationPageSizeSelector;if(typeof z==="boolean"||z==null)return null;if(!z.length)return`'paginationPageSizeSelector' cannot be an empty array. - If you want to hide the page size selector, set paginationPageSizeSelector to false.`;return null}},pivotMode:{dependencies:{treeData:{required:[!1,void 0],reason:"Pivot Mode is not supported with Tree Data."}}},quickFilterText:{supportedRowModels:["clientSide"]},rowBuffer:{validate({rowBuffer:$}){return V0("rowBuffer",$,0)}},rowClass:{validate:($)=>{if(typeof $.rowClass==="function")return"rowClass should not be a function, please use getRowClass instead";return null}},rowData:{supportedRowModels:["clientSide"]},rowDragManaged:{supportedRowModels:["clientSide"],dependencies:{pagination:{required:[!1,void 0]}}},rowSelection:{validate({rowSelection:$}){if($&&typeof $==="string")return'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.';if($&&typeof $!=="object")return"Expected `RowSelectionOptions` object for the `rowSelection` property.";if($&&$.mode!=="multiRow"&&$.mode!=="singleRow")return`Selection mode "${$.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`;return null}},rowStyle:{validate:($)=>{let z=$.rowStyle;if(z&&typeof z==="function")return"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead";return null}},serverSideDatasource:{supportedRowModels:["serverSide"]},serverSideInitialRowCount:{supportedRowModels:["serverSide"],validate({serverSideInitialRowCount:$}){return V0("serverSideInitialRowCount",$,1)}},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:($)=>{let z=$.sortingOrder;if(Array.isArray(z)&&z.length>0){let Q=z.filter((J)=>!e_(J));if(Q.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${Q.map((J)=>typeof J==="string"||J==null?Zz(J):JSON.stringify(J))}]`}else if(!Array.isArray(z)||!z.length)return`sortingOrder must be an array with at least one element, currently it's ${z}`;return null}},tooltipHideDelay:{validate:($)=>{if($.tooltipHideDelay&&$.tooltipHideDelay<0)return"tooltipHideDelay should not be lower than 0";return null}},tooltipShowDelay:{validate:($)=>{if($.tooltipShowDelay&&$.tooltipShowDelay<0)return"tooltipShowDelay should not be lower than 0";return null}},tooltipSwitchShowDelay:{validate:($)=>{if($.tooltipSwitchShowDelay&&$.tooltipSwitchShowDelay<0)return"tooltipSwitchShowDelay should not be lower than 0";return null}},treeData:{supportedRowModels:["clientSide","serverSide"],validate:($)=>{let z=$.rowModelType??"clientSide";switch(z){case"clientSide":{let{treeDataChildrenField:Q,treeDataParentIdField:J,getDataPath:q,getRowId:X}=$;if(!Q&&!J&&!q)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if(Q){if(q)return"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";if(J)return"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."}if(J){if(!X)return"getRowId callback not provided, tree data with parent id cannot be built.";if(q)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{let Q=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${z} row model.`;return $.isServerSideGroup&&$.getServerSideGroupKey?null:Q}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate({viewportRowModelBufferSize:$}){return V0("viewportRowModelBufferSize",$,0)}},viewportRowModelPageSize:{validate({viewportRowModelPageSize:$}){return V0("viewportRowModelPageSize",$,1)}},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate({autoGroupColumnDef:$,showOpenedGroup:z}){if($?.field&&z)return"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.";if($?.valueGetter&&z)return"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.";return null}},renderingMode:{validate:($)=>{let z=$.renderingMode,Q=["default","legacy"];if(z&&!Q.includes(z))return`renderingMode must be one of [${Q.join()}], currently it's ${z}`;return null}},autoSizeStrategy:{validate:({autoSizeStrategy:$})=>{if(!$)return null;let z=["fitCellContents","fitGridWidth","fitProvidedWidth"],Q=$.type;if(Q!=="fitCellContents"&&Q!=="fitGridWidth"&&Q!=="fitProvidedWidth")return`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${z.map((J)=>'"'+J+'"').join(", ")}, currently it's ${Q}`;if(Q==="fitProvidedWidth"&&typeof $.width!="number")return`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${$.width}`;return null}}},f={};for(let $ of H5)f[$]={expectedType:"boolean"};for(let $ of U5)f[$]={expectedType:"number"};return H_(f,_),f},hW=()=>({objectName:"gridOptions",allProperties:[...wW(),...Object.values(nJ)],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:xW(),validations:gW()}),uW=0,iW=0,S9="__ag_grid_instance",mW=class extends A{constructor(){super(...arguments);this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.instanceId=iW++,this.gridReadyFired=!1,this.queueEvents=[],this.propEventSvc=new D0,this.globalEventHandlerFactory=(_)=>{return(f,$)=>{if(!this.isAlive())return;let z=Wz.has(f);if(z&&!_||!z&&_)return;if(!cW(f))return;let Q=(J,q)=>{let X=nJ[J],Y=this.gridOptions[X];if(typeof Y==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>Y(q))};if(this.gridReadyFired)Q(f,$);else if(f==="gridReady"){Q(f,$),this.gridReadyFired=!0;for(let J of this.queueEvents)Q(J.eventName,J.event);this.queueEvents=[]}else this.queueEvents.push({eventName:f,event:$})}}}wireBeans(_){this.gridOptions=_.gridOptions,this.validation=_.validation,this.api=_.gridApi,this.gridId=_.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:_})=>{this.updateGridOptions({options:_,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(_){return this.gridOptions[_]??f7[_]}getCallback(_){return this.mergeGridCommonParams(this.gridOptions[_])}exists(_){return v(this.gridOptions[_])}mergeGridCommonParams(_){if(_)return($)=>{return _(this.addCommon($))};return _}updateGridOptions({options:_,force:f,source:$="api"}){let z={id:uW++,properties:[]},Q=[],{gridOptions:J,validation:q}=this;for(let X of Object.keys(_)){let Y=zJ.applyGlobalGridOption(X,_[X]);q?.warnOnInitialPropertyUpdate($,X);let Z=f||typeof Y==="object"&&$==="api",G=J[X];if(Z||G!==Y){J[X]=Y;let E={type:X,currentValue:Y,previousValue:G,changeSet:z,source:$};Q.push(E)}}this.validateGridOptions(this.gridOptions),z.properties=Q.map((X)=>X.type);for(let X of Q)q$(this,`Updated property ${X.type} from`,X.previousValue," to ",X.currentValue),this.propEventSvc.dispatchEvent(X)}addPropertyEventListener(_,f){this.propEventSvc.addEventListener(_,f)}removePropertyEventListener(_,f){this.propEventSvc.removeEventListener(_,f)}getDomDataKey(){return this.domDataKey}addCommon(_){return _.api=this.api,_.context=this.gridOptionsContext,_}validateOptions(_,f){for(let $ of Object.keys(_)){let z=_[$];if(z==null||z===!1)continue;let Q=f[$];if(typeof Q==="function")Q=Q(_,this.gridOptions,this.beans);if(Q)this.assertModuleRegistered(Q,$)}}validateGridOptions(_){this.validateOptions(_,NW),this.validation?.processGridOptions(_)}validateColDef(_,f,$){if($||!this.beans.dataTypeSvc?.isColPendingInference(f))this.validateOptions(_,RW),this.validation?.validateColDef(_)}assertModuleRegistered(_,f){let $=Array.isArray(_)?_.some((z)=>this.isModuleRegistered(z)):this.isModuleRegistered(_);if(!$)e(200,{...this.getModuleErrorParams(),moduleName:_,reasonOrId:f});return $}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:QJ(),rowModelType:this.get("rowModelType"),isUmd:JJ()}}isModuleRegistered(_){return A6(_,this.gridId,this.get("rowModelType"))}setInstanceDomData(_){_[S9]=this.instanceId}isElementInThisInstance(_){let f=_;while(f){let $=f[S9];if(v($))return $===this.instanceId;f=f.parentElement}return!1}};function cW(_){return!!nJ[_]}var pW=class extends A{constructor(_,f){super();this.column=_,this.eGui=f,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(_)=>_&&this.onClick(_)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(_){let{sortSvc:f,rangeSvc:$,gos:z}=this.beans;if(!(Gf(z)?_.altKey:!0))$?.handleColumnSelection(this.column,_);else if(this.column.isSortable()){let J=this.column.isMoving(),X=Date.now()-this.lastMovingChanged<50;if(!(J||X))f?.progressSortFromEvent(this.column,_)}}};function nW(_,f){let $={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:$},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:$},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[_?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:$},f?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}var dW=class extends w{constructor(){super(...arguments);this.eFilter=V,this.eFilterButton=V,this.eSortIndicator=V,this.eMenu=V,this.eLabel=V,this.eText=V,this.eColRef=V,this.eSortOrder=V,this.eSortAsc=V,this.eSortDesc=V,this.eSortMixed=V,this.eSortNone=V,this.eSortAbsoluteAsc=V,this.eSortAbsoluteDesc=V,this.isLoadingInnerComponent=!1}refresh(_){let f=this.params;if(this.params=_,this.workOutTemplate(_,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||_.enableSorting!=this.currentSort||_.column.formulaRef!=this.currentRef||this.currentSuppressMenuHide!=null&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||f.enableFilterButton!=_.enableFilterButton||f.enableFilterIcon!=_.enableFilterIcon)return!1;if(this.innerHeaderComponent){let $={..._};H_($,_.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.($)}else this.setDisplayName(_);return!0}workOutTemplate(_,f){let{formula:$}=this.beans,z=_.template;if(z)return z?.trim?z.trim():z;return nW(!!$?.active,f)}init(_){this.params=_;let{sortSvc:f,touchSvc:$,rowNumbersSvc:z,userCompFactory:Q}=this.beans,J=f?.getSortIndicatorSelector();if(this.currentTemplate=this.workOutTemplate(_,!!J),this.setTemplate(this.currentTemplate,J?[J]:void 0),this.eLabel)this.mouseListener??(this.mouseListener=this.createManagedBean(new pW(_.column,this.eLabel)));$?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),z?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent(Q,_),this.setDisplayName(_)}workOutInnerHeaderComponent(_,f){let $=U8(_,f,f);if(!$)return;this.isLoadingInnerComponent=!0,$.newAgStackInstance().then((z)=>{if(this.isLoadingInnerComponent=!1,!z)return;if(this.isAlive()){if(this.innerHeaderComponent=z,this.eText)this.eText.appendChild(z.getGui())}else this.destroyBean(z)})}setDisplayName(_){let{displayName:f}=_,$=this.currentDisplayName;if(this.currentDisplayName=f,!this.eText||$===f||this.innerHeaderComponent||this.isLoadingInnerComponent)return;this.eText.textContent=L$(f)}addInIcon(_,f,$){let z=h(_,this.beans,$);if(z)f.appendChild(z)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){T_(this.eMenu),this.eMenu=void 0;return}let{gos:_,eMenu:f,params:$}=this,z=E_(_);this.addInIcon(z?"menu":"menuAlt",f,$.column),f.classList.toggle("ag-header-menu-icon",!z);let Q=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=Q,this.addManagedElementListeners(f,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow(Q)}toggleMenuAlwaysShow(_){this.eMenu?.classList.toggle("ag-header-menu-always-show",_)}showColumnMenu(_){let{currentSuppressMenuHide:f,params:$}=this;if(!f)this.toggleMenuAlwaysShow(!0);$.showColumnMenu(_,()=>{if(!f)this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(_){let{params:f,gos:$,beans:z,eMenu:Q,eFilterButton:J}=this,q=f.column,X=E_($);if(_&&!X){if(z.menuSvc?.isFilterMenuInHeaderEnabled(q))return f.showFilter(J??Q??this.getGui()),!0}else if(f.enableMenu)return this.showColumnMenu(Q??J??this.getGui()),!0;return!1}setupSort(){let{sortSvc:_}=this.beans;if(!_)return;let{enableSorting:f,column:$}=this.params;if(this.currentSort=f,!this.eSortIndicator){this.eSortIndicator=this.createBean(_.createSortIndicator(!0));let{eSortIndicator:z,eSortOrder:Q,eSortAsc:J,eSortDesc:q,eSortMixed:X,eSortNone:Y,eSortAbsoluteAsc:Z,eSortAbsoluteDesc:G}=this;z.attachCustomElements(Q,J,q,X,Y,Z,G)}if(this.eSortIndicator.setupSort($),!this.currentSort)return;_.setupHeader(this,$)}setupColumnRefIndicator(){let{eColRef:_,beans:{editModelSvc:f},params:$}=this;if(!_)return;this.currentRef=$.column.formulaRef,_.textContent=this.currentRef,N(_,!1),this.addManagedEventListeners({cellEditingStarted:()=>{let z=f?.getEditPositions(),Q=!!this.currentRef&&!!z?.some((J)=>J.column.isAllowFormula());N(_,Q)},cellEditingStopped:()=>{N(_,!1)}})}setupFilterIcon(){let{eFilter:_,params:f}=this;if(!_)return;let $=()=>{let z=f.column.isFilterActive();N(_,z,{skipAriaHidden:!0})};this.configureFilter(f.enableFilterIcon,_,$,"filterActive")}setupFilterButton(){let{eFilterButton:_,params:f}=this;if(!_)return;if(this.configureFilter(f.enableFilterButton,_,this.onFilterChangedButton.bind(this),"filter"))this.addManagedElementListeners(_,{click:()=>f.showFilter(_)});else this.eFilterButton=void 0}configureFilter(_,f,$,z){if(!_)return T_(f),!1;let Q=this.params.column;return this.addInIcon(z,f,Q),this.addManagedListeners(Q,{filterChanged:$}),$(),!0}onFilterChangedButton(){let _=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",_)}getAnchorElementForMenu(_){let{eFilterButton:f,eMenu:$}=this;if(_)return f??$??this.getGui();return $??f??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}},tW=class extends A{constructor(_,f){super();this.eLabel=_,this.columnGroup=f,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){let{columnGroup:_,beans:f}=this,{ctrlsSvc:$}=f;$.whenReady(this,()=>{let z=this.refreshPosition.bind(this);if(_.getPinned()==null)this.addManagedEventListeners({bodyScroll:(Q)=>{if(Q.direction==="horizontal")this.updateSticky(Q.left)}});this.addManagedListeners(_,{leftChanged:z,displayedChildrenChanged:z}),this.addManagedEventListeners({columnResized:z}),this.refreshPosition()})}refreshPosition(){let{columnGroup:_,beans:f}=this,$=_.getLeft(),z=_.getActualWidth();if($==null||z===0){this.left=null,this.right=null,this.setSticky(!1);return}this.left=$,this.right=$+z;let Q=f.colViewport.getScrollPosition();if(Q!=null)this.updateSticky(Q)}updateSticky(_){let{beans:f,left:$,right:z}=this;if($==null||z==null){this.setSticky(!1);return}let{gos:Q,visibleCols:J}=f,X=Q.get("enableRtl")?J.bodyWidth-_:_;this.setSticky($X)}setSticky(_){let{isSticky:f,eLabel:$}=this;if(f===_)return;this.isSticky=_,$.classList.toggle("ag-sticky-label",_)}},rW={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},lW=class extends w{constructor(){super(rW);this.agOpened=V,this.agClosed=V,this.agLabel=V,this.isLoadingInnerComponent=!1}init(_){let{userCompFactory:f,touchSvc:$}=this.beans;this.params=_,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(f,_),this.setupLabel(_),this.addGroupExpandIcon(_),this.setupExpandIcons(),$?.setupForHeaderGroup(this)}checkWarnings(){if(this.params.template)j(89)}workOutInnerHeaderGroupComponent(_,f){let $=W8(_,f,f);if(!$)return;this.isLoadingInnerComponent=!0,$.newAgStackInstance().then((z)=>{if(this.isLoadingInnerComponent=!1,!z)return;if(this.isAlive())this.innerHeaderGroupComponent=z,this.agLabel.appendChild(z.getGui());else this.destroyBean(z)})}setupExpandIcons(){let{agOpened:_,agClosed:f,params:{columnGroup:$},beans:{colGroupSvc:z}}=this;this.addInIcon("columnGroupOpened",_),this.addInIcon("columnGroupClosed",f);let Q=(Y)=>{if(z0(Y))return;let Z=!$.isExpanded();z.setColumnGroupOpened($.getProvidedColumnGroup(),Z,"uiColumnExpanded")};this.addTouchAndClickListeners(f,Q),this.addTouchAndClickListeners(_,Q);let J=(Y)=>{n_(Y)};this.addManagedElementListeners(f,{dblclick:J}),this.addManagedElementListeners(_,{dblclick:J}),this.addManagedElementListeners(this.getGui(),{dblclick:Q}),this.updateIconVisibility();let q=$.getProvidedColumnGroup(),X=this.updateIconVisibility.bind(this);this.addManagedListeners(q,{expandedChanged:X,expandableChanged:X})}addTouchAndClickListeners(_,f){this.beans.touchSvc?.setupForHeaderGroupElement(this,_,f),this.addManagedElementListeners(_,{click:f})}updateIconVisibility(){let{agOpened:_,agClosed:f,params:{columnGroup:$}}=this;if($.isExpandable()){let z=$.isExpanded();N(_,z),N(f,!z)}else N(_,!1),N(f,!1)}addInIcon(_,f){let $=h(_,this.beans,null);if($)f.appendChild($)}addGroupExpandIcon(_){if(!_.columnGroup.isExpandable()){let{agOpened:f,agClosed:$}=this;N(f,!1),N($,!1)}}setupLabel(_){let{displayName:f,columnGroup:$}=_,{innerHeaderGroupComponent:z,isLoadingInnerComponent:Q}=this,J=z||Q;if(v(f)&&!J)this.agLabel.textContent=L$(f);if(!$.getColGroupDef()?.suppressStickyLabel)this.createManagedBean(new tW(this.getGui(),$))}destroy(){if(super.destroy(),this.innerHeaderGroupComponent)this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0}},sW={moduleName:"ColumnHeaderComp",version:c,userComponents:{agColumnHeader:dW},icons:{menu:"menu",menuAlt:"menu-alt"}},aW={moduleName:"ColumnGroupHeaderComp",version:c,userComponents:{agColumnGroupHeader:lW},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},oW=class extends A{constructor(){super(...arguments);this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(_){if(this.scrollGoingDown=_>=this.lastScrollTop,_===0)this.scrollGoingDown=!0;this.lastScrollTop=_}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){if(this.active===!1)j(92)}createTask(_,f,$,z,Q=!1){this.verify();let J=$;if(z&&this.batchFrameworkComps)J="f1";let q={task:_,index:f,createOrder:++this.taskCount,deferred:Q};this.addTaskToList(this[J],q),this.schedule()}addTaskToList(_,f){_.list.push(f),_.sorted=!1}sortTaskList(_){if(_.sorted)return;let f=this.scrollGoingDown?1:-1;_.list.sort(($,z)=>{if($.deferred!==z.deferred)return $.deferred?-1:1;if($.index!==z.index)return f*(z.index-$.index);return z.createOrder-$.createOrder}),_.sorted=!0}addDestroyTask(_){this.verify(),this.destroyTasks.push(_),this.schedule()}executeFrame(_){let{p1:f,p2:$,f1:z,destroyTasks:Q,beans:J}=this,{ctrlsSvc:q,frameworkOverrides:X}=J,Y=f.list,Z=$.list,G=z.list,E=Date.now(),U=0,H=_<=0,W=q.getScrollFeature();while(H||U<_){if(!W.scrollGridIfNeeded()){let K;if(Y.length)this.sortTaskList(f),K=Y.pop().task;else if(Z.length)this.sortTaskList($),K=Z.pop().task;else if(G.length)X.wrapOutgoing(()=>{while(H||U<_){if(!W.scrollGridIfNeeded())if(G.length)this.sortTaskList(z),K=G.pop().task,K();else break;else break;U=Date.now()-E}}),K=()=>{};else if(Q.length)K=Q.pop();else break;K()}U=Date.now()-E}if(Y.length||Z.length||G.length||Q.length)this.requestFrame();else this.ticking=!1}flushAllFrames(){if(!this.active)return;this.executeFrame(-1)}schedule(){if(!this.active)return;if(!this.ticking)this.ticking=!0,this.requestFrame()}requestFrame(){let _=this.executeFrame.bind(this,60);Y0(this.beans,_)}isQueueEmpty(){return!this.ticking}},eW={moduleName:"AnimationFrame",version:c,beans:[oW]},_B=class extends A{constructor(){super(...arguments);this.beanName="iconSvc"}createIconNoSpan(_,f){return h(_,this.beans,f?.column)}},fB=(_,f,$)=>f||_&&$,$B=class extends A{constructor(){super(...arguments);this.beanName="touchSvc"}mockBodyContextMenu(_,f){this.mockContextMenu(_,_.eBodyViewport,f)}mockHeaderContextMenu(_,f){this.mockContextMenu(_,_.eGui,f)}mockRowContextMenu(_){if(!pf())return;let f=($,z,Q)=>{let{rowCtrl:J,cellCtrl:q}=_.getControlsForEventTarget(Q?.target??null);if(q?.column)q.dispatchCellContextMenuEvent(Q??null);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,Q,J,q)};this.mockContextMenu(_,_.element,f)}handleCellDoubleClick(_,f){if((()=>{if(!pf()||M6("dblclick"))return!1;let z=Date.now(),Q=z-_.lastIPadMouseClickEvent<200;return _.lastIPadMouseClickEvent=z,Q})())return _.onCellDoubleClicked(f),f.preventDefault(),!0;return!1}setupForHeader(_){let{gos:f,sortSvc:$,menuSvc:z}=this.beans;if(f.get("suppressTouch"))return;let{params:Q,eMenu:J,eFilterButton:q}=_,X=new u_(_.getGui(),!0);_.addDestroyFunc(()=>X.destroy());let Y=_.shouldSuppressMenuHide(),Z=Y&&v(J)&&Q.enableMenu,G=!!z?.isHeaderContextMenuEnabled(Q.column),E=fB(Q.enableMenu,G,E_(f)),U=X;if(Z)U=new u_(J,!0),_.addDestroyFunc(()=>U.destroy());let H=(W)=>Q.showColumnMenuAfterMouseClick(W.touchStart);if(Z&&Q.enableMenu)_.addManagedListeners(U,{tap:H});if(E)_.addManagedListeners(X,{longTap:H});if(Q.enableSorting){let W=(B)=>{let K=B.touchStart.target;if(Y&&(J?.contains(K)||q?.contains(K)))return;$?.progressSort(Q.column,!1,"uiColumnSorted")};_.addManagedListeners(X,{tap:W})}if(Q.enableFilterButton&&q){let W=new u_(q,!0);_.addManagedListeners(W,{tap:()=>Q.showFilter(q)}),_.addDestroyFunc(()=>W.destroy())}}setupForHeaderGroup(_){let f=_.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(f.columnGroup.getProvidedColumnGroup())){let $=new u_(f.eGridHeader,!0),z=(Q)=>f.showColumnMenuAfterMouseClick(Q.touchStart);_.addManagedListeners($,{longTap:z}),_.addDestroyFunc(()=>$.destroy())}}setupForHeaderGroupElement(_,f,$){let z=new u_(f,!0);_.addManagedListeners(z,{tap:$}),_.addDestroyFunc(()=>z.destroy())}mockContextMenu(_,f,$){if(!pf())return;let z=new u_(f),Q=(J)=>{if(!J$(this.beans,J.touchEvent))return;$(void 0,J.touchStart,J.touchEvent)};_.addManagedListeners(z,{longTap:Q}),_.addDestroyFunc(()=>z.destroy())}},zB={moduleName:"Touch",version:c,beans:[$B]},QB=class extends A{constructor(){super(...arguments);this.beanName="cellNavigation"}wireBeans(_){this.rowSpanSvc=_.rowSpanSvc}getNextCellToFocus(_,f,$=!1){if($)return this.getNextCellToFocusWithCtrlPressed(_,f);return this.getNextCellToFocusWithoutCtrlPressed(_,f)}getNextCellToFocusWithCtrlPressed(_,f){let $=_===S.UP,z=_===S.DOWN,Q=_===S.LEFT,J,q,{pageBounds:X,gos:Y,visibleCols:Z,pinnedRowModel:G}=this.beans,{rowPinned:E}=f;if($||z){if(E&&G)if($)q=0;else q=E==="top"?G.getPinnedTopRowCount()-1:G.getPinnedBottomRowCount()-1;else q=$?X.getFirstRow():X.getLastRow();J=f.column}else{let U=Y.get("enableRtl");q=f.rowIndex,J=(Q!==U?Z.allCols:[...Z.allCols].reverse()).find((W)=>!I_(W)&&this.isCellGoodToFocusOn({rowIndex:q,rowPinned:null,column:W}))}return J?{rowIndex:q,rowPinned:E,column:J}:null}getNextCellToFocusWithoutCtrlPressed(_,f){let $=f,z=!1;while(!z){switch(_){case S.UP:$=this.getCellAbove($);break;case S.DOWN:$=this.getCellBelow($);break;case S.RIGHT:$=this.gos.get("enableRtl")?this.getCellToLeft($):this.getCellToRight($);break;case S.LEFT:$=this.gos.get("enableRtl")?this.getCellToRight($):this.getCellToLeft($);break;default:$=null,j(8,{key:_});break}if($)z=this.isCellGoodToFocusOn($);else z=!0}return $}isCellGoodToFocusOn(_){let f=_.column,$,{pinnedRowModel:z,rowModel:Q}=this.beans;switch(_.rowPinned){case"top":$=z?.getPinnedTopRow(_.rowIndex);break;case"bottom":$=z?.getPinnedBottomRow(_.rowIndex);break;default:$=Q.getRow(_.rowIndex);break}if(!$)return!1;return!this.isSuppressNavigable(f,$)}getCellToLeft(_){if(!_)return null;let f=this.beans.visibleCols.getColBefore(_.column);if(!f)return null;return{rowIndex:_.rowIndex,column:f,rowPinned:_.rowPinned}}getCellToRight(_){if(!_)return null;let f=this.beans.visibleCols.getColAfter(_.column);if(!f)return null;return{rowIndex:_.rowIndex,column:f,rowPinned:_.rowPinned}}getCellBelow(_){if(!_)return null;let f=this.rowSpanSvc?.getCellEnd(_)??_,$=K_(this.beans,f,!0);if($)return{rowIndex:$.rowIndex,column:_.column,rowPinned:$.rowPinned};return null}getCellAbove(_){if(!_)return null;let f=this.rowSpanSvc?.getCellStart(_)??_,$=m_(this.beans,{rowIndex:f.rowIndex,rowPinned:f.rowPinned},!0);if($)return{rowIndex:$.rowIndex,column:_.column,rowPinned:$.rowPinned};return null}getNextTabbedCell(_,f){if(f)return this.getNextTabbedCellBackwards(_);return this.getNextTabbedCellForwards(_)}getNextTabbedCellForwards(_){let{visibleCols:f,pagination:$}=this.beans,z=f.allCols,Q=_.rowIndex,J=_.rowPinned,q=f.getColAfter(_.column);if(!q){q=z[0];let X=K_(this.beans,_,!0);if(n(X))return null;if(!X.rowPinned&&!($?.isRowInPage(X.rowIndex)??!0))return null;Q=X?X.rowIndex:null,J=X?X.rowPinned:null}return{rowIndex:Q,column:q,rowPinned:J}}getNextTabbedCellBackwards(_){let{beans:f}=this,{visibleCols:$,pagination:z}=f,Q=$.allCols,J=_.rowIndex,q=_.rowPinned,X=$.getColBefore(_.column);if(!X){X=b(Q);let Y=m_(f,{rowIndex:_.rowIndex,rowPinned:_.rowPinned},!0);if(n(Y))return null;if(!Y.rowPinned&&!(z?.isRowInPage(Y.rowIndex)??!0))return null;J=Y?Y.rowIndex:null,q=Y?Y.rowPinned:null}return{rowIndex:J,column:X,rowPinned:q}}isSuppressNavigable(_,f){let{suppressNavigable:$}=_.colDef;if(typeof $==="boolean")return $;if(typeof $==="function"){let z=_.createColumnFunctionCallbackParams(f);return $(z)}return!1}};function JB(_){return _.focusSvc.getFocusedCell()}function qB(_){return _.focusSvc.clearFocusedCell()}function XB(_,f,$,z){_.focusSvc.setFocusedCell({rowIndex:f,column:$,rowPinned:z,forceBrowserFocus:!0})}function YB(_,f){return _.navigation?.tabToNextCell(!1,f)??!1}function ZB(_,f){return _.navigation?.tabToNextCell(!0,f)??!1}function GB(_,f,$=!1){let z=_.headerNavigation?.getHeaderPositionForColumn(f,$);if(!z)return;_.focusSvc.focusHeaderPosition({headerPosition:z})}function d0(_){let f=_;return f?.getFrameworkComponentInstance!=null?f.getFrameworkComponentInstance():_}var EB=class extends A{constructor(){super(...arguments);this.beanName="editModelSvc",this.edits=new Map,this.cellValidations=new W5,this.rowValidations=new B5,this.suspendEdits=!1}suspend(_){this.suspendEdits=_}removeEdits({rowNode:_,column:f}){if(!this.hasEdits({rowNode:_})||!_)return;let $=this.getEditRow(_);if(f)$.delete(f);else $.clear();if($.size===0)this.edits.delete(_)}getEditRow(_,f={}){if(this.suspendEdits)return;if(this.edits.size===0)return;let $=_&&this.edits.get(_);if($)return $;if(f.checkSiblings){let z=_.pinnedSibling;if(z)return this.getEditRow(z)}return}getEditRowDataValue(_,{checkSiblings:f}={}){if(!_||this.edits.size===0)return;let $=this.getEditRow(_),z=_.pinnedSibling,Q=f&&z&&this.getEditRow(z);if(!$&&!Q)return;let J={..._.data},q=(X,Y)=>X.forEach(({editorValue:Z,pendingValue:G},E)=>{let U=Z===void 0?G:Z;if(U!==v_)Y[E.getColId()]=U});if($)q($,J);if(Q)q(Q,J);return J}getEdit(_={},f){let{rowNode:$,column:z}=_,Q=this.edits;if(this.suspendEdits||Q.size===0||!$||!z)return;let J=Q.get($)?.get(z);if(J)return J;if(f?.checkSiblings){let q=$.pinnedSibling;if(q)return Q.get(q)?.get(z)}return}getEditMap(_=!0){if(this.suspendEdits||this.edits.size===0)return new Map;if(!_)return this.edits;let f=new Map;return this.edits.forEach(($,z)=>{let Q=new Map;$.forEach(({editorState:J,...q},X)=>Q.set(X,{...q})),f.set(z,Q)}),f}setEditMap(_){this.edits.clear(),_.forEach((f,$)=>{let z=new Map;f.forEach((Q,J)=>z.set(J,{...Q})),this.edits.set($,z)})}setEdit(_,f){let $=this.edits;if($.size===0||!$.has(_.rowNode))$.set(_.rowNode,new Map);let z=this.getEdit(_),Q={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...z,...f};return this.getEditRow(_.rowNode).set(_.column,Q),Q}clearEditValue(_){let{rowNode:f,column:$}=_;if(!f)return;let z=(J)=>{J.editorValue=void 0,J.pendingValue=J.sourceValue,J.state="changed"};if(!$){this.getEditRow(f)?.forEach(z);return}let Q=this.getEdit(_);if(Q)z(Q)}getState(_){if(this.suspendEdits)return;return this.getEdit(_)?.state}getEditPositions(_){if(this.suspendEdits||(_??this.edits).size===0)return[];let f=[];return(_??this.edits).forEach(($,z)=>{for(let Q of $.keys()){let{editorState:J,...q}=$.get(Q);f.push({rowNode:z,column:Q,...q})}}),f}hasRowEdits(_,f){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;return!!this.getEditRow(_,f)}hasEdits(_={},f={}){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;let{rowNode:$,column:z}=_,{withOpenEditor:Q}=f;if($){let J=this.getEditRow($,f);if(!J)return!1;if(z){if(Q)return this.getEdit(_)?.state==="editing";return J.has(z)}if(J.size!==0){if(Q)return Array.from(J.values()).some(({state:q})=>q==="editing");return!0}return!1}if(Q)return this.getEditPositions().some(({state:J})=>J==="editing");return this.edits.size>0}start(_){let f=this.getEditRow(_.rowNode)??new Map,{rowNode:$,column:z}=_;if(z&&!f.has(z))f.set(z,{editorValue:void 0,pendingValue:v_,sourceValue:this.beans.valueSvc.getValue(z,$,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}});this.edits.set($,f)}stop(_,f,$){if(!this.hasEdits(_))return;if(f){let z=this.getEditRow(_.rowNode)?.get(_.column);if(z&&(z.pendingValue===v_||z.pendingValue===z.sourceValue))this.removeEdits(_);else if(z&&$)z.editorValue=void 0}else this.removeEdits(_)}clear(){for(let _ of this.edits.values())_.clear();this.edits.clear()}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(_){this.cellValidations=_}setRowValidationModel(_){this.rowValidations=_}destroy(){super.destroy(),this.clear()}},W5=class{constructor(){this.cellValidations=new Map}getCellValidation(_){let{rowNode:f,column:$}=_||{};return this.cellValidations?.get(f)?.get($)}hasCellValidation(_){if(!_?.rowNode||!_.column)return this.cellValidations.size>0;return!!this.getCellValidation(_)}setCellValidation(_,f){let{rowNode:$,column:z}=_;if(!this.cellValidations.has($))this.cellValidations.set($,new Map);this.cellValidations.get($).set(z,f)}clearCellValidation(_){let{rowNode:f,column:$}=_;this.cellValidations.get(f)?.delete($)}setCellValidationMap(_){this.cellValidations=_}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},B5=class{constructor(){this.rowValidations=new Map}getRowValidation(_){let{rowNode:f}=_||{};return this.rowValidations.get(f)}hasRowValidation(_){if(!_?.rowNode)return this.rowValidations.size>0;return!!this.getRowValidation(_)}setRowValidation({rowNode:_},f){this.rowValidations.set(_,f)}clearRowValidation({rowNode:_}){this.rowValidations.delete(_)}setRowValidationMap(_){this.rowValidations=_}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}};function Iz(_,f={}){let{rowIndex:$,rowId:z,rowCtrl:Q,rowPinned:J}=f;if(Q)return Q;let{rowModel:q,rowRenderer:X}=_,{rowNode:Y}=f;if(!Y){if(z)Y=c8(_,z,J);else if($!=null)Y=q.getRow($)}return Y?X.getRowCtrlByNode(Y):void 0}function l(_,f={}){let{cellCtrl:$,colId:z,columnId:Q,column:J}=f;if($)return $;let q=_.colModel.getCol(z??Q??h6(J)),X=f.rowCtrl??Iz(_,f),Y=X?.getCellCtrl(q)??void 0;if(Y)return Y;let Z=f.rowNode??X?.rowNode;if(Z)return _.rowRenderer.getCellCtrls([Z],[q])?.[0];return}function A9(_){let{editSvc:f}=_;if(f?.isBatchEditing())Xf(_,{persist:!0}),qf(_);else f?.stopEditing(void 0,{source:"api"})}function UB(_,f,$){let{gos:z,popupSvc:Q}=f;if(!z.get("stopEditingWhenCellsLoseFocus"))return;let J=(q)=>{let X=q.relatedTarget;if(I6(X)===null){A9(f);return}let Y=$.some((Z)=>Z.contains(X))&&z.isElementInThisInstance(X);if(!Y)Y=!!Q&&(Q.getActivePopups().some((Z)=>Z.contains(X))||Q.isElementWithinCustomPopup(X));if(!Y)A9(f)};for(let q of $)_.addManagedElementListeners(q,{focusout:J})}function h6(_){if(!_)return;if(typeof _==="string")return _;return _.getColId()}var v_=Symbol("unedited"),HB=(_,f={})=>{let $=_.rowRenderer.getCellCtrls(f.rowNodes,f.columns),z=Array($.length),Q=0;for(let J=0,q=$.length;J0)f.set($,Q)}return f}function lf(_,f,$){let{key:z,event:Q,cellStartedEdit:J,silent:q}=$??{},{editModelSvc:X,gos:Y,userCompFactory:Z}=_,G=l(_,f),E=G?.comp?.getCellEditor(),U=L5(_,f,z,J&&!q),H=X?.getEdit(f),W=U.value??H?.sourceValue;if(E){X?.setEdit(f,{editorValue:v1(_,W,!0,f.column),state:"editing"}),E.refresh?.(U);return}let B=f.column.getColDef(),K=fX(Z,B,U);if(!K)return;let{popupFromSelector:L,popupPositionFromSelector:F}=K,D=L??!!B.cellEditorPopup,M=F??B.cellEditorPopupPosition;if(F5(K.params,Q),!G)return;let{rangeFeature:k,rowCtrl:R,comp:O,onEditorAttachedFuncs:I}=G;X?.setEdit(f,{editorValue:v1(_,W,!0,f.column),state:"editing",editorState:{cellStartedEditing:void 0,cellStoppedEditing:void 0}}),G.editCompDetails=K,I.push(()=>k?.unsetComp()),O?.setEditDetails(K,D,M,Y.get("reactiveCustomComponents")),R?.refreshRow({suppressFlash:!0}),KB(_,f,Q,W,q)}function KB(_,f,$,z,Q){let{editSvc:J,editModelSvc:q}=_,X=q?.getEdit(f);if(!Q&&X?.state==="editing"&&!X?.editorState?.cellStartedEditing)J?.dispatchCellEvent(f,$,"cellEditingStarted",{value:z}),q?.setEdit(f,{editorState:{cellStartedEditing:!0}})}function K5(_,f,$){let z={editorValueExists:!1};if(dJ(_)){if((f.getValidationErrors?.()?.length??0)>0)return z}if($?.isCancelling)return z;if($?.isStopping){let J=f?.isCancelAfterEnd?.();if(J)return{...z,isCancelAfterEnd:J}}return{editorValue:f.getValue(),editorValueExists:!0}}function L5(_,f,$,z){let{valueSvc:Q,gos:J,editSvc:q}=_,X=_.gos.get("enableGroupEdit"),Y=l(_,f),Z=f.rowNode?.rowIndex??void 0,G=q?.isBatchEditing(),E=_.colModel.getCol(f.column.getId()),{rowNode:U,column:H}=f,W=Y.comp?.getCellEditor(),B=q?.getCellDataValue(f),K=B===void 0?W?K5(_,W)?.editorValue:void 0:B,L=K===v_?Q.getValueForDisplay({column:E,node:U,from:"edit"})?.value:K,F=X?K:L;if(H.isAllowFormula()&&_.formula?.isFormula(F))F=_.formula?.normaliseFormula(F,!0)??F;return C(J,{value:F,eventKey:$??null,column:H,colDef:H.getColDef(),rowIndex:Z,node:U,data:U.data,cellStartedEdit:!!z,onKeyDown:Y?.onKeyDown.bind(Y),stopEditing:(D)=>{q.stopEditing(f,{source:G?"ui":"api",suppressNavigateAfterEdit:D}),W$(_,f,{})},eGridCell:Y?.eGui,parseValue:(D)=>Q.parseValue(E,U,D,Y?.value),formatValue:Y?.formatValue.bind(Y),validate:()=>{q?.validateEdit()}})}function l1(_,f){let{editModelSvc:$}=_;$?.getEditMap().forEach((z,Q)=>{z.forEach((J,q)=>{if(!f&&(J.state==="editing"||J.pendingValue===v_))return;if(!L0(J)&&(J.state!=="editing"||f))$?.removeEdits({rowNode:Q,column:q})})})}function LB(_,f){let $=f.comp?.getCellEditor();if(!$?.refresh)return;let{eventKey:z,cellStartedEdit:Q}=f.editCompDetails.params,{column:J}=f,q=L5(_,f,z,Q),X=J.getColDef(),Y=fX(_.userCompFactory,X,q);$.refresh(F5(Y.params,z))}function F5(_,f){if(f instanceof KeyboardEvent&&_.column.getColDef().cellEditor==="agNumberCellEditor")_.suppressPreventDefault=["-","+",".","e"].includes(f?.key??"")||_.suppressPreventDefault;else f?.preventDefault?.();return _}function Xf(_,f){for(let $ of _.editModelSvc?.getEditPositions()??[]){let z=l(_,$);if(!z)continue;let Q=z.comp?.getCellEditor();if(!Q)continue;let{editorValue:J,editorValueExists:q,isCancelAfterEnd:X}=K5(_,Q,f);if(X){let{cellStartedEditing:Y,cellStoppedEditing:Z}=_.editModelSvc?.getEdit($)?.editorState||{};_.editModelSvc?.setEdit($,{editorState:{isCancelAfterEnd:X,cellStartedEditing:Y,cellStoppedEditing:Z}})}H1(_,$,J,void 0,!q,f)}}function H1(_,f,$,z,Q,J){let{editModelSvc:q,valueSvc:X}=_;if(!q)return;let{rowNode:Y,column:Z}=f;if(!(Y&&Z))return;let G=q.getEdit(f);if(G?.sourceValue===void 0){let E=G?v1(_,G.editorValue,!1,Z):v_,U={sourceValue:X.getValue(Z,Y,"data"),pendingValue:E};if(J?.persist)U.state="changed";G=q.setEdit(f,U)}if(q.setEdit(f,{editorValue:Q?v1(_,G.sourceValue,!0,Z):$}),J?.persist)FB(_,f)}function v1(_,f,$,z){let{formula:Q}=_;if(z.isAllowFormula()&&Q?.isFormula(f))return Q?.normaliseFormula(f,$)??f;return f}function FB(_,f){let{editModelSvc:$}=_,z=$?.getEdit(f),J={pendingValue:v1(_,z?.editorValue,!1,f.column)};if(!z?.editorState?.cellStoppedEditing&&z?.state!=="editing")J.state="changed";$?.setEdit(f,J)}function qf(_,f,$={}){if(!f)f=_.editModelSvc?.getEditPositions();if(f)for(let z of f)W$(_,z,$)}function W$(_,f,$,z=l(_,f)){let Q=_.editModelSvc,J=Q?.getEdit(f),q;if(J&&J.state!=="editing"&&J.editorState?.cellStoppedEditing)q=J.state;else q="changed";if(!z){if(J)Q?.setEdit(f,{state:q});return}let X=z.comp,Y=X?.getCellEditor();if(X&&!Y){if(z?.refreshCell(),J){Q?.setEdit(f,{state:q});let G=_.gos.get("enableGroupEdit")?R9(J,$?.cancel):{valueChanged:!1,newValue:void 0,oldValue:J.sourceValue};j9(_,f,G,$)}return}if(dJ(_)){let G=J&&Y?.getValidationErrors?.(),E=Q?.getCellValidationModel();if(G?.length)E?.setCellValidation(f,{errorMessages:G});else E?.clearCellValidation(f)}if(J)Q?.setEdit(f,{state:q});X?.setEditDetails(),X?.refreshEditStyles(!1,!1),z?.refreshCell({force:!0,suppressFlash:!0});let Z=Q?.getEdit(f);if(Z&&Z.state!=="editing"){let G=$?.cancel,E=_.gos.get("enableGroupEdit")?R9(Z,G):DB(Z,J,G);j9(_,f,E,$)}}function R9(_,f){let{sourceValue:$,pendingValue:z}=_,Q;if(!f&&z!==v_)Q=z;return{valueChanged:!f&&L0(_),newValue:Q,oldValue:$,value:$}}function DB(_,f,$){if($||_.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:_.sourceValue};let z=_.editorValue;if(z==null||z===v_)z=f?.pendingValue;if(z===v_)z=void 0;return{valueChanged:L0(_),newValue:z,oldValue:_.sourceValue}}function j9(_,f,$,{silent:z,event:Q}={}){let{editSvc:J,editModelSvc:q}=_,X=q?.getEdit(f),{editorState:Y}=X||{},{isCancelBeforeStart:Z,cellStartedEditing:G,cellStoppedEditing:E}=Y||{};if(!z&&!Z&&G&&!E)J?.dispatchCellEvent(f,Q,"cellEditingStopped",$),q?.setEdit(f,{editorState:{cellStoppedEditing:!0}})}function MB(_){if(!_)return!1;for(let f=0,$=_.length;f<$;++f){let z=_[f],Q=z.cellEditorParams;if(!Q||!z.editable&&!z.groupRowEditable)continue;if(Q.minLength!==void 0||Q.maxLength!==void 0||Q.getValidationErrors!==void 0||Q.min!==void 0||Q.max!==void 0)return!0}return!1}function kB(_){let f=_.rowRenderer.getCellCtrls();for(let $=0,z=f.length;$0,D=F?K.join(". "):"";if(e9(L,F),F)z.announceValue(`${Z} ${K}`,"editorValidation");if(L instanceof HTMLInputElement)L.setCustomValidity(D);else L.classList.toggle("invalid",F)}if(K?.length>0)$.setCellValidation({rowNode:W,column:B},{errorMessages:K});G.add(E.rowCtrl)}if(Xf(_,{persist:!1}),J?.setCellValidationModel($),X){let E=SB(_);J?.setRowValidationModel(E)}for(let E of G.values()){E.rowEditStyleFeature?.applyRowStyles();for(let U of E.getAllCellCtrls())U.tooltipFeature?.refreshTooltip(!0),U.editorTooltipFeature?.refreshTooltip(!0),U.editStyleFeature?.applyCellStyles?.()}}var SB=(_)=>{let f=new B5,$=_.gos.get("getFullRowEditValidationErrors"),z=_.editModelSvc?.getEditMap();if(!z)return f;for(let Q of z.keys()){let J=z.get(Q);if(!J)continue;let q=[],{rowIndex:X,rowPinned:Y}=Q;for(let G of J.keys()){let E=J.get(G);if(!E)continue;let{editorValue:U,pendingValue:H,sourceValue:W}=E,B=U??(H===v_?void 0:H)??W;q.push({column:G,colId:G.getColId(),rowIndex:X,rowPinned:Y,oldValue:W,newValue:B})}let Z=$?.({editorsState:q})??[];if(Z.length>0)f.setRowValidation({rowNode:Q},{errorMessages:Z})}return f};function AB(_){Hf(_,!0);let f=_.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!f)return null;let $=[];return f.forEach((z,Q)=>{z.forEach(({errorMessages:J},q)=>{$.push({column:q,rowIndex:Q.rowIndex,rowPinned:Q.rowPinned,messages:J??null})})}),$}function YQ(_){return!!(_.rowPinned&&_.pinnedSibling)}function l_(_,f,$,z){let Q=f==="top";if(!$)return l_(_,f,Q?_.getPinnedTopRow(0):_.getPinnedBottomRow(0),z);if(!z){let Y=Q?_.getPinnedTopRowCount():_.getPinnedBottomRowCount();return l_(_,f,$,Q?_.getPinnedTopRow(Y-1):_.getPinnedBottomRow(Y-1))}let J=!1,q=!1,X=[];return _.forEachPinnedRow(f,(Y)=>{if(Y===$&&!J){J=!0,X.push(Y);return}if(J&&Y===z){q=!0,X.push(Y);return}if(J&&!q)X.push(Y)}),X}function RB(_,f,$,{rowNode:z,column:Q},J){return C(_.gos,{type:$,node:z,data:z.data,value:J,column:Q,colDef:Q.getColDef(),rowPinned:z.rowPinned,event:f,rowIndex:z.rowIndex})}function jB(_,f=!1){if(_===S.DELETE)return!0;if(!f&&_===S.BACKSPACE)return JX();return!1}var VB=class extends A{constructor(_,f,$,z){super();this.cellCtrl=_,this.rowNode=$,this.rowCtrl=z,this.beans=f}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(_){let f=_.key;if(f===S.ENTER&&I_(this.cellCtrl.column)&&this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition,_))return;switch(f){case S.ENTER:this.onEnterKeyDown(_);break;case S.F2:this.onF2KeyDown(_);break;case S.ESCAPE:this.onEscapeKeyDown(_);break;case S.TAB:this.onTabKeyDown(_);break;case S.BACKSPACE:case S.DELETE:this.onBackspaceOrDeleteKeyDown(f,_);break;case S.DOWN:case S.UP:case S.RIGHT:case S.LEFT:this.onNavigationKeyDown(_,f);break}}onNavigationKeyDown(_,f){let{cellCtrl:$,beans:z}=this;if(z.editSvc?.isEditing($,{withOpenEditor:!0}))return;if(_.shiftKey&&$.isRangeSelectionEnabled())this.onShiftRangeSelect(_);else{let Q=$.getFocusedCellPosition();z.navigation?.navigateToNextCell(_,f,Q,!0)}_.preventDefault()}onShiftRangeSelect(_){let{rangeSvc:f,navigation:$}=this.beans;if(!f)return;let z=f.extendLatestRangeInDirection(_);if(!z)return;if(_.key===S.LEFT||_.key===S.RIGHT)$?.ensureColumnVisible(z.column);else $?.ensureRowVisible(z.rowIndex)}onTabKeyDown(_){this.beans.navigation?.onTabKeyDown(this.cellCtrl,_)}onBackspaceOrDeleteKeyDown(_,f){let{cellCtrl:$,beans:z,rowNode:Q}=this,{gos:J,rangeSvc:q,eventSvc:X,editSvc:Y}=z;if(X.dispatchEvent({type:"keyShortcutChangedCellStart"}),jB(_,J.get("enableCellEditingOnBackspace"))&&!Y?.isEditing($,{withOpenEditor:!0})){if(q&&i_(J))q.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if($.isCellEditable()){let Z=z.valueSvc.getDeleteValue($.column,Q);Q.setDataValue($.column,Z,"cellClear")}}else if(!Y?.isEditing($,{withOpenEditor:!0}))z.editSvc?.startEditing($,{startedEdit:!0,event:f});X.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(_){let{cellCtrl:f,beans:$}=this,{editSvc:z,navigation:Q}=$,J=z?.isEditing(f,{withOpenEditor:!0}),q=f.rowNode,X=z?.isRowEditing(q,{withOpenEditor:!0}),Y=(Z)=>{if(z?.startEditing(Z,{startedEdit:!0,event:_,source:"edit"}))_.preventDefault()};if(J||X){if(this.isCtrlEnter(_)){z?.applyBulkEdit(f,$?.rangeSvc?.getCellRanges()||[]);return}if(Hf($),z?.checkNavWithValidation(void 0,_)==="block-stop")return;if(z?.isEditing(f,{withOpenEditor:!0}))z?.stopEditing(f,{event:_,source:"edit"});else if(X&&!f.isCellEditable())z?.stopEditing({rowNode:q},{event:_,source:"edit"});else Y(f)}else if($.gos.get("enterNavigatesVertically")){let Z=_.shiftKey?S.UP:S.DOWN;Q?.navigateToNextCell(null,Z,f.cellPosition,!1)}else{if(z?.hasValidationErrors())return;if(z?.hasValidationErrors(f))z.revertSingleCellEdit(f,!0);Y(f)}}isCtrlEnter(_){return(_.ctrlKey||_.metaKey)&&_.key===S.ENTER}onF2KeyDown(_){let{cellCtrl:f,beans:{editSvc:$}}=this;if($?.isEditing()){if(Hf(this.beans),$?.checkNavWithValidation(void 0,_)==="block-stop")return}$?.startEditing(f,{startedEdit:!0,event:_})}onEscapeKeyDown(_){let{cellCtrl:f,beans:{editSvc:$}}=this;if($?.checkNavWithValidation(f,_)==="block-stop")$.revertSingleCellEdit(f);setTimeout(()=>{$?.stopEditing(f,{event:_,cancel:!0})})}processCharacter(_){let $=_.target!==this.eGui,{beans:{editSvc:z},cellCtrl:Q}=this;if($)return;if(z?.isEditing(Q,{withOpenEditor:!0}))return;if(_.key===S.SPACE)this.onSpaceKeyDown(_);else if(z?.isCellEditable(Q,"ui")){if(z?.hasValidationErrors()&&!z?.hasValidationErrors(Q))return;if(z?.startEditing(Q,{startedEdit:!0,event:_,source:"api",editable:!0}),!Q.editCompDetails?.params?.suppressPreventDefault)_.preventDefault()}}onSpaceKeyDown(_){let{gos:f,editSvc:$}=this.beans,{rowNode:z}=this.cellCtrl;if(!$?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&p0(f))this.beans.selectionSvc?.handleSelectionEvent(_,z,"spaceKey");_.preventDefault()}},OB=class extends A{constructor(_,f,$){super();this.cellCtrl=_,this.column=$,this.beans=f}onMouseEvent(_,f){if(z0(f))return;switch(_){case"click":this.onCellClicked(f);break;case"pointerdown":case"mousedown":case"touchstart":this.onMouseDown(f);break;case"dblclick":this.onCellDoubleClicked(f);break;case"mouseout":this.onMouseOut(f);break;case"mouseover":this.onMouseOver(f);break}}onCellClicked(_){if(this.beans.touchSvc?.handleCellDoubleClick(this,_))return;let{eventSvc:f,rangeSvc:$,editSvc:z,editModelSvc:Q,frameworkOverrides:J,gos:q}=this.beans,X=_.ctrlKey||_.metaKey,{cellCtrl:Y}=this,{column:Z,cellPosition:G,rowNode:E}=Y,U=Uz(q,Z,E,_);if($&&X&&!U){if($.getCellRangeCount(G)>1)$.intersectLastRange(!0)}let H=Y.createEvent(_,"cellClicked");H.isEventHandlingSuppressed=U,f.dispatchEvent(H);let W=Z.getColDef();if(W.onCellClicked)window.setTimeout(()=>{J.wrapOutgoing(()=>{W.onCellClicked(H)})},0);if(U)return;if(Q?.getState(Y)!=="editing"){let B=z?.isEditing(),K=z?.isRangeSelectionEnabledWhileEditing(),L=Q?.getCellValidationModel().getCellValidationMap().size??0,F=Q?.getRowValidationModel().getRowValidationMap().size??0;if(B&&(K||L>0||F>0))return;if(z?.shouldStartEditing(Y,_))z?.startEditing(Y,{event:_});else if(z?.shouldStopEditing(Y,_))if(this.beans.gos.get("editType")==="fullRow")z?.stopEditing(Y,{event:_,source:"edit"});else z?.stopEditing(void 0,{event:_,source:"edit"})}}onCellDoubleClicked(_){let{column:f,beans:$,cellCtrl:z}=this,{eventSvc:Q,frameworkOverrides:J,editSvc:q,editModelSvc:X,gos:Y}=$,Z=Uz(Y,z.column,z.rowNode,_),G=f.getColDef(),E=z.createEvent(_,"cellDoubleClicked");if(E.isEventHandlingSuppressed=Z,Q.dispatchEvent(E),typeof G.onCellDoubleClicked==="function")window.setTimeout(()=>{J.wrapOutgoing(()=>{G.onCellDoubleClicked(E)})},0);if(Z)return;if(q?.shouldStartEditing(z,_)&&X?.getState(z)!=="editing"){let U=q?.isEditing(),H=q?.isRangeSelectionEnabledWhileEditing(),W=X?.getCellValidationModel().getCellValidationMap().size??0,B=X?.getRowValidationModel().getRowValidationMap().size??0;if(U&&(H||W>0||B>0))return;q?.startEditing(z,{event:_})}}onMouseDown(_){let{shiftKey:f}=_,$=_.target,{cellCtrl:z,beans:Q}=this,{eventSvc:J,rangeSvc:q,rowNumbersSvc:X,focusSvc:Y,gos:Z,editSvc:G}=Q,{column:E,rowNode:U,cellPosition:H}=z,W=Uz(Z,E,U,_),B=()=>{let D=z.createEvent(_,"cellMouseDown");D.isEventHandlingSuppressed=W,J.dispatchEvent(D)};if(W){B();return}if(this.isRightClickInExistingRange(_))return;let K=q&&!q.isEmpty(),L=this.containsWidget($),F=I_(E);if(X&&F&&!X.handleMouseDownOnCell(H,_))return;if(!f||!K){let D=G?.isEditing(z),k=Z.get("enableCellTextSelection")&&_.defaultPrevented,R=(ef()||k)&&!D&&!s1($)&&!L;z.focusCell(R,_)}if(f&&K&&!Y.isCellFocused(H)){_.preventDefault();let D=Y.getFocusedCell();if(D){let{column:M,rowIndex:k,rowPinned:R}=D,O=!!G?.isRangeSelectionEnabledWhileEditing?.();if(G?.isEditing(D)&&!O)G?.stopEditing(D);if(!O)Y.setFocusedCell({column:M,rowIndex:k,rowPinned:R,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:_})}}if(L)return;q?.handleCellMouseDown(_,H),B()}isRightClickInExistingRange(_){let{rangeSvc:f}=this.beans;if(f){let $=f.isCellInAnyRange(this.cellCtrl.cellPosition),z=ZJ(this.beans,_);if($&&z)return!0}return!1}containsWidget(_){return uf(_,"ag-selection-checkbox",3)||uf(_,"ag-drag-handle",3)}onMouseOut(_){if(this.mouseStayingInsideCell(_))return;let{eventSvc:f,colHover:$}=this.beans;f.dispatchEvent(this.cellCtrl.createEvent(_,"cellMouseOut")),$?.clearMouseOver()}onMouseOver(_){if(this.mouseStayingInsideCell(_))return;let{eventSvc:f,colHover:$}=this.beans;f.dispatchEvent(this.cellCtrl.createEvent(_,"cellMouseOver")),$?.setMouseOver([this.column])}mouseStayingInsideCell(_){if(!_.target||!_.relatedTarget)return!1;let f=this.cellCtrl.eGui,$=f.contains(_.target),z=f.contains(_.relatedTarget);return $&&z}},PB=class extends A{constructor(_,f){super();this.cellCtrl=_,this.beans=f,this.column=_.column,this.rowNode=_.rowNode}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.eSetLeft=this.cellCtrl.getRootElement(),this.eContent=this.cellCtrl.eGui;let _=this.cellCtrl.getCellSpan();if(!_)this.setupColSpan(),this.setupRowSpan();if(this.onLeftChanged(),this.onWidthChanged(),!_)this._legacyApplyRowSpan();if(_){let f=this.refreshSpanHeight.bind(this,_);f(),this.addManagedListeners(this.beans.eventSvc,{paginationChanged:f,recalculateRowBounds:f,pinnedHeightChanged:f})}}refreshSpanHeight(_){let f=_.getCellHeight();if(f!=null)this.eContent.style.height=`${f}px`}onNewColumnsLoaded(){let _=this.column.getRowSpan(this.rowNode);if(this.rowSpan===_)return;this.rowSpan=_,this._legacyApplyRowSpan(!0)}onDisplayColumnsChanged(){let _=this.getColSpanningList();if(!J_(this.colsSpanning,_))this.colsSpanning=_,this.onWidthChanged(),this.onLeftChanged()}setupColSpan(){if(this.column.getColDef().colSpan==null)return;this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)})}onWidthChanged(){if(!this.eContent)return;let _=this.getCellWidth();this.eContent.style.width=`${_}px`}getCellWidth(){if(!this.colsSpanning)return this.column.getActualWidth();return this.colsSpanning.reduce((_,f)=>_+f.getActualWidth(),0)}getColSpanningList(){let{column:_,rowNode:f}=this,$=_.getColSpan(f),z=[];if($===1)z.push(_);else{let Q=_,J=_.getPinned();for(let q=0;Q&&q<$;q++){if(z.push(Q),Q=this.beans.visibleCols.getColAfter(Q),!Q||n(Q))break;if(J!==Q.getPinned())break}}return z}onLeftChanged(){if(!this.eSetLeft)return;let _=this.modifyLeftForPrintLayout(this.getCellLeft());this.eSetLeft.style.left=_+"px"}getCellLeft(){let _;if(this.beans.gos.get("enableRtl")&&this.colsSpanning)_=b(this.colsSpanning);else _=this.column;return _.getLeft()}modifyLeftForPrintLayout(_){if(!this.cellCtrl.printLayout||this.column.getPinned()==="left")return _;let{visibleCols:f}=this.beans,$=f.getColsLeftWidth();if(this.column.getPinned()==="right"){let z=f.bodyWidth;return $+z+(_||0)}return $+(_||0)}_legacyApplyRowSpan(_){if(this.rowSpan===1&&!_)return;let $=yq(this.beans)*this.rowSpan;this.eContent.style.height=`${$}px`,this.eContent.style.zIndex="1"}destroy(){super.destroy()}},vB="ag-cell",TB="ag-cell-auto-height",IB="ag-cell-normal-height",yB="ag-cell-focus",bB="ag-cell-first-right-pinned",CB="ag-cell-last-left-pinned",wB="ag-cell-not-inline-editing",xB="ag-cell-wrap-text",NB=0,_$=class extends A{constructor(_,f,$,z){super();this.column=_,this.rowNode=f,this.rowCtrl=z,this.rangeFeature=void 0,this.rowResizeFeature=void 0,this.positionFeature=void 0,this.customStyleFeature=void 0,this.editStyleFeature=void 0,this.mouseListener=void 0,this.keyboardListener=void 0,this.suppressRefreshCell=!1,this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.focusEventWhileNotReady=null,this.hasBeenFocused=!1,this.hasEdit=!1,this.tooltipFeature=void 0,this.editorTooltipFeature=void 0,this.beans=$,this.gos=$.gos,this.editSvc=$.editSvc,this.hasEdit=!!$.editSvc;let{colId:Q}=_;this.instanceId=Q+"-"+NB++,this.createCellPosition(),this.updateAndFormatValue(!1)}addFeatures(){let{beans:_}=this;this.positionFeature=new PB(this,_),this.customStyleFeature=_.cellStyles?.createCellCustomStyleFeature(this),this.editStyleFeature=_.editSvc?.createCellStyleFeature(this),this.mouseListener=new OB(this,_,this.column),this.keyboardListener=new VB(this,_,this.rowNode,this.rowCtrl),this.enableTooltipFeature();let{rangeSvc:f}=_;if(f&&i_(_.gos))this.rangeFeature=f.createCellRangeFeature(this);if(I_(this.column))this.rowResizeFeature=this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(this)}isCellSpanning(){return!1}getCellSpan(){return}removeFeatures(){let _=this.beans.context;this.positionFeature=_.destroyBean(this.positionFeature),this.editorTooltipFeature=_.destroyBean(this.editorTooltipFeature),this.customStyleFeature=_.destroyBean(this.customStyleFeature),this.editStyleFeature=_.destroyBean(this.editStyleFeature),this.mouseListener=_.destroyBean(this.mouseListener),this.keyboardListener=_.destroyBean(this.keyboardListener),this.rangeFeature=_.destroyBean(this.rangeFeature),this.rowResizeFeature=_.destroyBean(this.rowResizeFeature),this.disableTooltipFeature()}enableTooltipFeature(_,f){this.tooltipFeature=this.beans.tooltipSvc?.enableCellTooltipFeature(this,_,f)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature)}enableEditorTooltipFeature(_){if(this.editorTooltipFeature)this.disableEditorTooltipFeature();this.editorTooltipFeature=this.beans.tooltipSvc?.setupCellEditorTooltip(this,_),Hf(this.beans)}disableEditorTooltipFeature(){this.editorTooltipFeature=this.beans.context.destroyBean(this.editorTooltipFeature)}setComp(_,f,$,z,Q,J,q){this.comp=_,this.eGui=f,this.printLayout=Q,q??(q=this),this.addDomData(q),this.addFeatures(),q.addDestroyFunc(()=>this.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(z,q),this.refreshFirstAndLastStyles(),this.checkFormulaError(),this.refreshAriaRowIndex(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(_),this.editStyleFeature?.setComp(_),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(_),this.rowResizeFeature?.refreshRowResizer();let X=J?this.isCellEditable():void 0,Y=!X&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(X||Y)this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:X});else this.showValue(!1,!0);if(this.onCompAttachedFuncs.length){for(let Z of this.onCompAttachedFuncs)Z();this.onCompAttachedFuncs=[]}}checkFormulaError(){let _=!!this.beans.formula?.getFormulaError(this.column,this.rowNode);this.eGui.classList.toggle("formula-error",_)}setupAutoHeight(_,f){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,_,f)??!1}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){let _=this.column.getColDef();return _.cellRenderer!=null||_.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){let{beans:_,column:f}=this,{userCompFactory:$,ctrlsSvc:z,eventSvc:Q}=_,J=f.getColDef(),q=this.createCellRendererParams();q.deferRender=!0;let X=d2($,J,q);if(z.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let Y,Z=new g((E)=>{Y=E}),[G]=this.addManagedListeners(Q,{bodyScrollEnd:()=>{Y(),G()}});return{loadingComp:X,onReady:Z}}return{loadingComp:X,onReady:g.resolve()}}showValue(_,f){let{beans:$,column:z,rowNode:Q,rangeFeature:J}=this,{userCompFactory:q}=$,X=this.getValueToDisplay(),Y,Z=Q.stub&&Q.groupData?.[z.getId()]==null,G=z.getColDef();if(Z||this.isCellRenderer()){let E=this.createCellRendererParams();if(!Z||I_(z))Y=U$(q,G,E);else Y=d2(q,G,E)}if(!Y&&!Z&&$.findSvc?.isMatch(Q,z)){let E=this.createCellRendererParams();Y=U$(q,{...z.getColDef(),cellRenderer:"agFindCellRenderer"},E)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing(Q,{checkSiblings:!0})){let E=this.editSvc.prepDetailsDuringBatch(this,{compDetails:Y,valueToDisplay:X});if(E){if(E.compDetails)Y=E.compDetails;else if(E.valueToDisplay)X=E.valueToDisplay}}if(this.comp.setRenderDetails(Y,X,_),this.customRowDragComp?.refreshVisibility(),!f&&J)Y0($,()=>J?.refreshRangeStyleAndHandle());this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){let _=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(_),!0),this.includeRowDrag=this.isIncludeControl(_.rowDrag),this.includeDndSource=this.isIncludeControl(_.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){let f=this.column.getColDef().cellRenderer==="agCheckboxCellRenderer",$="";if(f)$=" ag-allow-overflow";return`ag-cell-value${$}`}isIncludeControl(_,f=!1){return(this.rowNode.rowPinned==null||f&&YQ(this.rowNode))&&!!_}isCheckboxSelection(_){let{rowSelection:f,groupDisplayType:$}=this.beans.gridOptions,z=V1(f),Q=x0(this.column);if($==="custom"&&z!=="selectionColumn"&&Q)return!1;return _.checkboxSelection||Q&&typeof f==="object"&&Zf(f)}refreshShouldDestroy(){let _=this.column.getColDef(),f=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(_),!0),$=this.includeRowDrag!=this.isIncludeControl(_.rowDrag),z=this.includeDndSource!=this.isIncludeControl(_.dndSource),Q=this.isAutoHeight!=this.column.isAutoHeight();return f||$||z||Q}onPopupEditorClosed(_){let{editSvc:f}=this.beans;if(!f?.isEditing(this,{withOpenEditor:!0}))return;let $=_ instanceof KeyboardEvent,z=_ instanceof MouseEvent,Q=$&&_.key===S.ESCAPE;if(f.stopEditing(this,{source:f.isBatchEditing()?"ui":"api",cancel:Q,event:$||z?_:void 0}),Q)this.focusCell(!0,_)}stopEditing(_=!1){let{editSvc:f}=this.beans;return f?.stopEditing(this,{cancel:_,source:f?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){let{value:_,valueFormatted:f,column:$,rowNode:z,comp:Q,eGui:J,beans:{valueSvc:q,gos:X,editSvc:Y}}=this;return C(X,{value:_,valueFormatted:f,getValue:()=>q.getValueForDisplay({column:$,node:z,from:"edit"}).value,setValue:(G)=>Y?.setDataValue({rowNode:z,column:$},G)||z.setDataValue($,G),formatValue:this.formatValue.bind(this),data:z.data,node:z,pinned:$.getPinned(),colDef:$.getColDef(),column:$,refreshCell:this.refreshCell.bind(this),eGridCell:J,eParentOfValue:Q.getParentOfValue(),registerRowDragger:(G,E,U,H)=>this.registerRowDragger(G,E,H),setTooltip:(G,E)=>{if(X.assertModuleRegistered("Tooltip",3),this.tooltipFeature)this.disableTooltipFeature();this.enableTooltipFeature(G,E),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(_){if(_.column===this.column)this.refreshCell()}refreshOrDestroyCell(_){if(this.refreshShouldDestroy())this.rowCtrl?.recreateCell(this);else this.refreshCell(_);if(this.hasEdit&&this.editCompDetails){let{editSvc:f,comp:$}=this;if(!$?.getCellEditor()&&f.isEditing(this,{withOpenEditor:!0}))f.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(_){let{editStyleFeature:f,customStyleFeature:$,rowCtrl:{rowEditStyleFeature:z},beans:{cellFlashSvc:Q,filterManager:J},column:q,comp:X,suppressRefreshCell:Y,tooltipFeature:Z}=this;if(Y)return;let{field:G,valueGetter:E,showRowGroup:U,enableCellChangeFlash:H}=q.getColDef(),W=G==null&&E==null&&U==null,B=_?.newData??!1,K=W||_&&(_.force||B),L=!!X,F=this.updateAndFormatValue(L),D=K||F;if(!L)return;if(D){this.showValue(!!B,!1);let M=J?.isSuppressFlashingCellsBecauseFiltering();if(!_?.suppressFlash&&!M&&H)Q?.flashCell(this);f?.applyCellStyles?.(),$?.applyUserStyles(),$?.applyClassesFromColDef(),z?.applyRowStyles(),this.checkFormulaError()}Z?.refreshTooltip(),$?.applyCellClassRules()}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(_){return this.callValueFormatter(_)??_}callValueFormatter(_){return this.beans.valueSvc.formatValue(this.column,this.rowNode,_)}updateAndFormatValue(_){let f=this.value,$=this.valueFormatted,{value:z,valueFormatted:Q}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});if(this.value=z,this.valueFormatted=Q,_)return!this.valuesAreEqual(f,this.value)||this.valueFormatted!=$;return!0}valuesAreEqual(_,f){let $=this.column.getColDef();return $.equals?$.equals(_,f):_===f}addDomData(_){let f=this.eGui;tf(this.beans.gos,f,Oz,this),_.addDestroyFunc(()=>tf(this.beans.gos,f,Oz,null))}createEvent(_,f){let{rowNode:$,column:z,value:Q,beans:J}=this;return RB(J,_,f,{rowNode:$,column:z},Q)}processCharacter(_){this.keyboardListener?.processCharacter(_)}onKeyDown(_){this.keyboardListener?.onKeyDown(_)}onMouseEvent(_,f){this.mouseListener?.onMouseEvent(_,f)}getColSpanningList(){return this.positionFeature?.getColSpanningList()??[]}onLeftChanged(){if(!this.comp)return;this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){if(!this.eGui)return;this.refreshAriaColIndex(),this.refreshFirstAndLastStyles()}refreshFirstAndLastStyles(){let{comp:_,column:f,beans:$}=this;MX(_,f,$.visibleCols)}refreshAriaColIndex(){let _=this.beans.visibleCols.getAriaColIndex(this.column);zq(this.eGui,_)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){let{rowIndex:_,rowPinned:f}=this.cellPosition;return{rowIndex:_,rowPinned:f}}updateRangeBordersIfRangeCount(){if(!this.comp)return;this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){if(!this.comp)return;this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.rangeFeature!=null}focusCell(_=!1,f){let $=this.editSvc?.allowedFocusTargetOnValidation(this);if($&&$!==this)return;this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:_,sourceEvent:f})}restoreFocus(_=!1){let{beans:{editSvc:f,focusSvc:$},comp:z}=this;if(!z||f?.isEditing(this)||!this.isCellFocused()||!$.shouldTakeFocus())return;let Q=()=>{if(!this.isAlive())return;let J=z.getFocusableElement();if(this.isCellFocused())J.focus({preventScroll:!0})};if(_){setTimeout(Q,0);return}Q()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(_){let f=this.eGui;if(!f)return;gf(f,"tabindex",_?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;let _=this.column.isFirstRightPinned();this.comp.toggleCss(bB,_)}onLastLeftPinnedChanged(){if(!this.comp)return;let _=this.column.isLastLeftPinned();this.comp.toggleCss(CB,_)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){let _=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=_),_}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(_){let{beans:f}=this;if(Vz(f))return;if(!this.comp){if(_)this.focusEventWhileNotReady=_;return}let $=this.isCellFocused(),z=f.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss(yB,$),$&&(_?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let Q=this.comp.getFocusableElement();if(z){let q=F0(Q,null,!0);if(q.length)Q=q[0]}let J=_?_.preventScrollOnBrowserFocus:!0;Q.focus({preventScroll:J}),g4(f,Q)}if($&&this.focusEventWhileNotReady)this.focusEventWhileNotReady=null;if($&&_)this.rowCtrl.announceDescription()}createCellPosition(){let{rowIndex:_,rowPinned:f}=this.rowNode;this.cellPosition={rowIndex:_,rowPinned:T0(f),column:this.column}}applyStaticCssClasses(){let{comp:_}=this;_.toggleCss(vB,!0),_.toggleCss(wB,!0);let f=this.column.isAutoHeight()==!0;_.toggleCss(TB,f),_.toggleCss(IB,!f)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){if(!this.comp)return;if(this.column.isTooltipEnabled())this.disableTooltipFeature(),this.enableTooltipFeature();else this.disableTooltipFeature();if(this.setWrapText(),this.editSvc?.isEditing(this))this.editSvc?.handleColDefChanged(this);else this.refreshOrDestroyCell({force:!0,suppressFlash:!0})}setWrapText(){let _=this.column.getColDef().wrapText==!0;this.comp.toggleCss(xB,_)}dispatchCellContextMenuEvent(_){let f=this.column.getColDef(),$=this.createEvent(_,"cellContextMenu"),{beans:z}=this;if(z.eventSvc.dispatchEvent($),f.onCellContextMenu)window.setTimeout(()=>{z.frameworkOverrides.wrapOutgoing(()=>{f.onCellContextMenu($)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){if(this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.isCellFocused()&&this.hasBrowserFocus())this.beans.focusSvc.attemptToRecoverFocus();super.destroy()}hasBrowserFocus(){return this.eGui?.contains(d(this.beans))??!1}createSelectionCheckbox(){let _=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(!_)return;return this.beans.context.createBean(_),_.init({rowNode:this.rowNode,column:this.column}),_}createDndSource(){let _=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);if(_)this.beans.context.createBean(_);return _}registerRowDragger(_,f,$){if(this.customRowDragComp){this.customRowDragComp.setDragElement(_,f);return}let z=this.createRowDragComp(_,f,$);if(z)this.customRowDragComp=z,this.addDestroyFunc(()=>{this.beans.context.destroyBean(z),this.customRowDragComp=null}),z.refreshVisibility()}createRowDragComp(_,f,$){let z=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,_,f,$);if(!z)return;return this.beans.context.createBean(z),z}cellEditorAttached(){for(let _ of this.onEditorAttachedFuncs)_();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(_){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!I_(this.column)||!this.eGui)return;let{ariaRowIndex:_}=this.rowCtrl;if(_!=null)Lz(this.eGui,_)}getRootElement(){return this.eGui}};function D5(_,f,$,z,Q,J){if($==null&&f==null)return;let q={},X={},Y=(Z,G)=>{for(let E of Z.split(" ")){if(E.trim()=="")continue;G(E)}};if($){let Z=Object.keys($);for(let G=0;G{if(H)q[W]=!0;else X[W]=!0})}}if(f&&J)for(let Z of Object.keys(f))Y(Z,(G)=>{if(!q[G])X[G]=!0});if(J)Object.keys(X).forEach(J);Object.keys(q).forEach(Q)}function V9(_){if(_.group)return _.level;let f=_.parent;return f?f.level+1:0}var gB=0,u6=class extends A{constructor(_,f,$,z,Q){super();this.rowNode=_,this.useAnimationFrameForCreate=z,this.printLayout=Q,this.focusEventWhileNotReady=null,this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.ariaRowIndex=null,this.businessKey=null,this.beans=f,this.gos=f.gos,this.paginationPage=f.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=_.id+"-"+gB++,this.rowId=U_(_.id),this.initRowBusinessKey(),this.rowFocused=f.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=V9(this.rowNode),this.setRowType(),this.setAnimateFlags($),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=f.editSvc?.createRowStyleFeature(this),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!=="function")return;let _=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=U_(_)}updateGui(_,f){if(_==="left")this.leftGui=f;else if(_==="right")this.rightGui=f;else if(_==="fullWidth")this.fullWidthGui=f;else this.centerGui=f}setComp(_,f,$,z){let{context:Q,rowRenderer:J}=this.beans;z=O$(this,Q,z);let q={rowComp:_,element:f,containerType:$,compBean:z};this.allRowGuis.push(q),this.updateGui($,q),this.initialiseRowComp(q);let X=this.rowNode,Y=this.rowType==="FullWidthLoading"||X.stub,Z=!X.data&&this.beans.rowModel.getType()==="infinite";if(!Y&&!Z&&!X.rowPinned)J.dispatchFirstDataRenderedEvent();this.setupFocus()}unsetComp(_){this.allRowGuis=this.allRowGuis.filter((f)=>f.containerType!==_),this.updateGui(_,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(_){let f=_?"none":"";for(let $ of this.allRowGuis)$.element.style.display=f}initialiseRowComp(_){let f=this.gos;if(this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(_),this.onRowHeightChanged(_),this.updateRowIndexes(_),this.setFocusedClasses(_),this.setStylesFromGridOptions(!1,_),p0(f)&&this.rowNode.selectable)this.onRowSelected(_);this.updateColumnLists(!this.useAnimationFrameForCreate);let $=_.rowComp,z=this.getInitialRowClasses(_.containerType);for(let Q of z)$.toggleCss(Q,!0);if(this.executeSlideAndFadeAnimations(_),this.rowNode.group)N_(_.element,!!this.rowNode.expanded);if(this.setRowCompRowId($),this.setRowCompRowBusinessKey($),tf(f,_.element,Pz,this),_.compBean.addDestroyFunc(()=>tf(f,_.element,Pz,null)),this.useAnimationFrameForCreate)this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,_),this.rowNode.rowIndex,"p2",!1);else this.addHoverFunctionality(_);if(this.isFullWidth())this.setupFullWidth(_);if(f.get("rowDragEntireRow"))this.addRowDraggerToRow(_);if(this.useAnimationFrameForCreate)this.beans.animationFrameSvc.addDestroyTask(()=>{if(!this.isAlive())return;_.rowComp.toggleCss("ag-after-created",!0)});this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(_){if(this.businessKey==null)return;_.setRowBusinessKey(this.businessKey)}setRowCompRowId(_){let f=U_(this.rowNode.id);if(this.rowId=f,f==null)return;_.setRowId(f)}executeSlideAndFadeAnimations(_){let{containerType:f}=_;if(this.slideInAnimation[f])S6(()=>{this.onTopChanged()}),this.slideInAnimation[f]=!1;if(this.fadeInAnimation[f])S6(()=>{_.rowComp.toggleCss("ag-opacity-zero",!1)}),this.fadeInAnimation[f]=!1}addRowDraggerToRow(_){let f=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,_.element);if(!f)return;let $=this.createBean(f,this.beans.context);this.rowDragComps.push($),_.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter((z)=>z!==$),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean($,this.beans.context)})}setupFullWidth(_){let f=this.getPinnedForContainer(_.containerType),$=this.createFullWidthCompDetails(_.element,f);_.rowComp.showFullWidth($)}getFullWidthCellRenderers(){if(this.gos.get("embedFullWidthRows"))return this.allRowGuis.map((_)=>_?.rowComp?.getFullWidthCellRenderer());return[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){let _=this.gos.getCallback("processRowPostCreate");if(!_||!this.areAllContainersReady())return;let f={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};_(f)}areAllContainersReady(){let{leftGui:_,centerGui:f,rightGui:$,beans:{visibleCols:z}}=this,Q=!!_||!z.isPinningLeft(),J=!!f,q=!!$||!z.isPinningRight();return Q&&J&&q}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;let _=this.beans.gos.getCallback("isFullWidthRow");return _?_({rowNode:this.rowNode}):!1}setRowType(){let{rowNode:_,gos:f,beans:{colModel:$}}=this,z=_.stub&&!f.get("suppressServerSideFullWidthLoadingRow")&&!f.get("groupHideOpenParents"),Q=this.isNodeFullWidthCell(),J=f.get("masterDetail")&&_.detail,q=$.isPivotMode(),X=Cq(f,_,q);if(z)this.rowType="FullWidthLoading";else if(J)this.rowType="FullWidthDetail";else if(Q)this.rowType="FullWidth";else if(X)this.rowType="FullWidthGroup";else this.rowType="Normal"}updateColumnLists(_=!1,f=!1){if(this.isFullWidth())return;let{animationFrameSvc:$}=this.beans;if(!$?.active||_||this.printLayout){this.updateColumnListsImpl(f);return}if(this.updateColumnListsPending)return;$.createTask(()=>{if(!this.active)return;this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0}getNewCellCtrl(_){if(this.beans.rowSpanSvc?.isCellSpanning(_,this.rowNode))return;return new _$(_,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(_){return!this.beans.rowSpanSvc?.isCellSpanning(_.column,this.rowNode)}createCellCtrls(_,f,$=null){let z={list:[],map:{}},Q=(Z,G,E)=>{if(E!=null)z.list.splice(E,0,G);else z.list.push(G);z.map[Z]=G},J=[];for(let Z of f){let G=Z.getInstanceId(),E=_.map[G];if(E&&!this.isCorrectCtrlForSpan(E))E.destroy(),E=void 0;if(!E)E=this.getNewCellCtrl(Z);if(!E)continue;Q(G,E)}for(let Z of _.list){let G=Z.column.getInstanceId();if(z.map[G]!=null)continue;if(!this.isCellEligibleToBeRemoved(Z,$))J.push([G,Z]);else Z.destroy()}if(J.length)for(let[Z,G]of J){let E=z.list.findIndex((H)=>H.column.getLeft()>G.column.getLeft()),U=E===-1?void 0:Math.max(E-1,0);Q(Z,G,U)}let{focusSvc:q,visibleCols:X}=this.beans,Y=q.getFocusedCell();if(Y&&Y.column.getPinned()==$){let Z=Y.column.getInstanceId();if(!z.map[Z]&&X.allCols.includes(Y.column)){let E=this.createFocusedCellCtrl();if(E){let U=z.list.findIndex((W)=>W.column.getLeft()>E.column.getLeft()),H=U===-1?void 0:Math.max(U-1,0);Q(Z,E,H)}}}return z}createFocusedCellCtrl(){let{focusSvc:_,rowSpanSvc:f}=this.beans,$=_.getFocusedCell();if(!$)return;let z=f?.getCellSpan($.column,this.rowNode);if(z){if(z.firstNode!==this.rowNode||!z.doesSpanContain($))return}else if(!_.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl($.column)}updateColumnListsImpl(_){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(_)}setCellCtrls(_){for(let f of this.allRowGuis){let $=this.getCellCtrlsForContainer(f.containerType);f.rowComp.setCellCtrls($,_)}}getCellCtrlsForContainer(_){switch(_){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){let _=this.beans.colViewport,f=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,f.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{let $=_.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,$);let z=f.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,z,"left");let Q=f.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,Q,"right")}}isCellEligibleToBeRemoved(_,f){let{column:Q}=_;if(Q.getPinned()!=f)return!0;if(!this.isCorrectCtrlForSpan(_))return!0;let{visibleCols:J,editSvc:q}=this.beans,X=q?.isEditing(_),Y=_.isCellFocused();if(X||Y)return J.allCols.indexOf(Q)>=0?!1:!0;return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||S_(this.gos,"print")}listenOnDomOrder(_){let f=()=>{_.rowComp.setDomOrder(this.getDomOrder())};_.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],f)}setAnimateFlags(_){if(this.rowNode.sticky||!_)return;let f=v(this.rowNode.oldRowTop),{visibleCols:$}=this.beans,z=$.isPinningLeft(),Q=$.isPinningRight();if(f){let{slideInAnimation:J}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){J.fullWidth=!0;return}J.center=!0,J.left=z,J.right=Q}else{let{fadeInAnimation:J}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){J.fullWidth=!0;return}J.center=!0,J.left=z,J.right=Q}}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){let _=(q,X)=>{if(!q)return!0;return q.rowComp.refreshFullWidth(()=>{return this.createFullWidthCompDetails(q.element,X).params})},f=_(this.fullWidthGui,null),$=_(this.centerGui,null),z=_(this.leftGui,"left"),Q=_(this.rightGui,"right");return f&&$&&z&&Q}addListeners(){let{beans:_,gos:f,rowNode:$}=this,{expansionSvc:z,eventSvc:Q,context:J,rowSpanSvc:q}=_;if(this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...z?.getRowExpandedListeners(this)??{}}),$.detail)this.addManagedListeners($.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)});if(this.addManagedListeners($,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners(Q,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),q)this.addManagedListeners(q,{spannedCellsUpdated:({pinned:X})=>{if(X&&!$.rowPinned)return;this.updateColumnLists()}});this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,J),this.tooltipFeature=this.destroyBean(this.tooltipFeature,J),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,J)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(f.get("rowDragEntireRow")){for(let Y of this.allRowGuis)this.addRowDraggerToRow(Y);return}this.rowDragComps=this.destroyBeans(this.rowDragComps,J)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{for(let _ of this.getAllCellCtrls())_.onRowIndexChanged()},cellChanged:(_)=>{for(let f of this.getAllCellCtrls())f.onCellChanged(_)}})}onRowPinned(){for(let _ of this.allRowGuis)_.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(_){this.refreshRow({suppressFlash:!_.update,newData:!_.update})}refreshRow(_){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){if(!this.refreshFullWidth())this.beans.rowRenderer.redrawRow(this.rowNode);return}for(let $ of this.getAllCellCtrls())$.refreshCell(_);for(let $ of this.allRowGuis)this.setRowCompRowId($.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey($.rowComp);this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.rowEditStyleFeature?.applyRowStyles(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){let _=this.beans.rowDropHighlightSvc,f=_?.row===this.rowNode?_.position:"none",$=f==="above",z=f==="inside",Q=f==="below",J=f!=="none",q=$||Q,X=this.rowNode.uiLevel,Y=q&&X>0,Z=Y?X.toString():"0";for(let G of this.allRowGuis){let E=G.rowComp;if(E.toggleCss("ag-row-highlight-above",$),E.toggleCss("ag-row-highlight-inside",z),E.toggleCss("ag-row-highlight-below",Q),E.toggleCss("ag-row-highlight-indent",Y),J)G.element.style.setProperty("--ag-row-highlight-level",Z);else G.element.style.removeProperty("--ag-row-highlight-level")}}postProcessRowDragging(){let _=this.rowNode.dragging;for(let f of this.allRowGuis)f.rowComp.toggleCss("ag-row-dragging",_)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:T0(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(_){let f=this.findFullWidthInfoForEvent(_);if(!f)return;let{rowGui:$,column:z}=f;if($.element!==_.target)return;let q=this.rowNode,{focusSvc:X,navigation:Y}=this.beans,Z=X.getFocusedCell(),G={rowIndex:q.rowIndex,rowPinned:q.rowPinned,column:Z?.column??z};Y?.navigateToNextCell(_,_.key,G,!0),_.preventDefault()}onTabKeyDown(_){if(_.defaultPrevented||z0(_))return;let f=this.allRowGuis.find((X)=>X.element.contains(_.target)),$=f?f.element:null,z=$===_.target,Q=d(this.beans),J=!1;if($&&Q)J=$.contains(Q)&&Q.classList.contains("ag-cell");let q=null;if(!z&&!J)q=V_(this.beans,$,!1,_.shiftKey);if(this.isFullWidth()&&z||!q)this.beans.navigation?.onTabKeyDown(this,_)}getFullWidthElement(){if(this.fullWidthGui)return this.fullWidthGui.element;return null}getRowYPosition(){let _=this.allRowGuis.find((f)=>A_(f.element))?.element;if(_)return _.getBoundingClientRect().top;return 0}onSuppressCellFocusChanged(_){let f=this.isFullWidth()&&_?void 0:this.gos.get("tabIndex");for(let $ of this.allRowGuis)gf($.element,"tabindex",f)}setupFocus(){if(!this.isFullWidth())return;this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0)}restoreFullWidthFocus(_=!1){let{focusSvc:f,editSvc:$}=this.beans;if($?.isEditing(this))return;if(!f.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!f.shouldTakeFocus())return;let z=this.getFullWidthRowGuiForFocus();if(!z)return;let Q=()=>{if(!this.isAlive())return;if(f.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))z.element.focus({preventScroll:!0})};if(_){setTimeout(Q,0);return}Q()}getFullWidthRowGuiForFocus(_){if(this.fullWidthGui)return this.fullWidthGui;let f=this.beans.focusSvc.getFocusedCell(),$=this.beans.colModel.getCol(_?.column??f?.column);if(!$)return;let z=$?.pinned;if(z==="right")return this.rightGui;if(z==="left")return this.leftGui;return this.centerGui}setFullWidthRowFocusedClass(_,f){this.forEachGui(void 0,($)=>{$.element.classList.toggle("ag-full-width-focus",f&&$===_)})}onFullWidthRowFocused(_){let{focusSvc:f}=this.beans;if(!(this.isFullWidth()&&f.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))){this.setFullWidthRowFocusedClass(void 0,!1);return}let z=this.getFullWidthRowGuiForFocus(_);if(!z){if(_)this.focusEventWhileNotReady=_;this.setFullWidthRowFocusedClass(void 0,!1);return}if(this.setFullWidthRowFocusedClass(z,!0),this.focusEventWhileNotReady=null,_?.forceBrowserFocus)z.element.focus({preventScroll:!0})}recreateCell(_){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,_),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,_),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,_),_.destroy(),this.updateColumnLists()}removeCellCtrl(_,f){let $={list:[],map:{}};for(let z of _.list){if(z===f)continue;$.list.push(z),$.map[z.column.getInstanceId()]=z}return $}onMouseEvent(_,f){switch(_){case"dblclick":this.onRowDblClick(f);break;case"click":this.onRowClick(f);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(f);break}}createRowEvent(_,f){let{rowNode:$}=this;return C(this.gos,{type:_,node:$,data:$.data,rowIndex:$.rowIndex,rowPinned:$.rowPinned,event:f})}createRowEventWithSource(_,f){let $=this.createRowEvent(_,f);return $.source=this,$}onRowDblClick(_){if(z0(_))return;let f=this.createRowEventWithSource("rowDoubleClicked",_);f.isEventHandlingSuppressed=this.isSuppressMouseEvent(_),this.beans.eventSvc.dispatchEvent(f)}findFullWidthInfoForEvent(_){if(!_)return;let f=this.findFullWidthRowGui(_.target),$=this.getColumnForFullWidth(f);if(!f||!$)return;return{rowGui:f,column:$}}findFullWidthRowGui(_){return this.allRowGuis.find((f)=>f.element.contains(_))}getColumnForFullWidth(_){let{visibleCols:f}=this.beans;switch(_?.containerType){case"center":return f.centerCols[0];case"left":return f.leftCols[0];case"right":return f.rightCols[0];default:return f.allCols[0]}}onRowMouseDown(_){if(this.lastMouseDownOnDragger=uf(_.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(_))return;let{rangeSvc:f,focusSvc:$}=this.beans;f?.removeAllCellRanges();let z=this.findFullWidthInfoForEvent(_);if(!z)return;let{rowGui:Q,column:J}=z,q=Q.element,X=_.target,Y=this.rowNode,Z=_.defaultPrevented||ef();if(q&&q.contains(X)&&s1(X))Z=!1;$.setFocusedCell({rowIndex:Y.rowIndex,column:J,rowPinned:Y.rowPinned,forceBrowserFocus:Z})}isSuppressMouseEvent(_){let{gos:f,rowNode:$}=this;if(this.isFullWidth()){let Q=this.findFullWidthRowGui(_.target);return IG(f,Q?.rowComp.getFullWidthCellRendererParams(),$,_)}let z=P$(f,_.target);return z!=null&&Uz(f,z.column,$,_)}onRowClick(_){if(z0(_)||this.lastMouseDownOnDragger)return;let $=this.isSuppressMouseEvent(_),{eventSvc:z,selectionSvc:Q}=this.beans,J=this.createRowEventWithSource("rowClicked",_);if(J.isEventHandlingSuppressed=$,z.dispatchEvent(J),$)return;Q?.handleSelectionEvent(_,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(_){if(this.rowType!=="FullWidthDetail")return;this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,_)}createFullWidthCompDetails(_,f){let{gos:$,rowNode:z}=this,Q=C($,{fullWidth:!0,data:z.data,node:z,value:z.key,valueFormatted:z.key,eGridCell:_,eParentOfValue:_,pinned:f,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(q,X,Y,Z)=>this.addFullWidthRowDragging(q,X,Y,Z),setTooltip:(q,X)=>{$.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(q,X)}}),J=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return F8(J,Q);case"FullWidthGroup":{let{value:q,valueFormatted:X}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return Q.value=q,Q.valueFormatted=X,L8(J,Q)}case"FullWidthLoading":return K8(J,Q);default:return B8(J,Q)}}setupFullWidthRowTooltip(_,f){if(!this.fullWidthGui)return;this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,_,f)}addFullWidthRowDragging(_,f,$="",z){let{rowDragSvc:Q,context:J}=this.beans;if(!Q||!this.isFullWidth())return;let q=Q.createRowDragComp(()=>$,this.rowNode,void 0,_,f,z);this.createBean(q,J),this.addDestroyFunc(()=>{this.destroyBean(q,J)})}onUiLevelChanged(){let _=V9(this.rowNode);if(this.rowLevel!=_){let f="ag-row-level-"+_,$="ag-row-level-"+this.rowLevel;for(let z of this.allRowGuis)z.rowComp.toggleCss(f,!0),z.rowComp.toggleCss($,!1)}this.rowLevel=_}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){let _=this.isFirstRowOnPage(),f=this.isLastRowOnPage();if(this.firstRowOnPage!==_){this.firstRowOnPage=_;for(let $ of this.allRowGuis)$.rowComp.toggleCss("ag-row-first",_)}if(this.lastRowOnPage!==f){this.lastRowOnPage=f;for(let $ of this.allRowGuis)$.rowComp.toggleCss("ag-row-last",f)}}getAllCellCtrls(){if(this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){let _=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(_,this.rowNode),!_.length)return;for(let f of _)for(let $ of this.allRowGuis)$.rowComp.toggleCss(f,!0)}postProcessRowClassRules(){this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,(_)=>{for(let f of this.allRowGuis)f.rowComp.toggleCss(_,!0)},(_)=>{for(let f of this.allRowGuis)f.rowComp.toggleCss(_,!1)})}setStylesFromGridOptions(_,f){if(_)this.rowStyles=this.processStylesFromGridOptions();this.forEachGui(f,($)=>$.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(_){if(_==="left"||_==="right")return _;return null}getInitialRowClasses(_){let f=this.getPinnedForContainer(_),$=this.isFullWidth(),{rowNode:z,beans:Q}=this,J=[];if(J.push("ag-row"),J.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[_])J.push("ag-opacity-zero");if(J.push(z.rowIndex%2===0?"ag-row-even":"ag-row-odd"),z.isRowPinned()){if(J.push("ag-row-pinned"),Q.pinnedRowModel?.isManual())J.push("ag-row-pinned-manual")}if(!z.isRowPinned()&&z.pinnedSibling)J.push("ag-row-pinned-source");if(z.isSelected())J.push("ag-row-selected");if(z.footer)J.push("ag-row-footer");if(J.push("ag-row-level-"+this.rowLevel),z.stub)J.push("ag-row-loading");if($)J.push("ag-full-width-row");if(Q.expansionSvc?.addExpandedCss(J,z),z.dragging)J.push("ag-row-dragging");let{rowStyleSvc:q}=Q;if(q)q.processClassesFromGridOptions(J,z),q.preProcessRowClassRules(J,z);if(J.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage())J.push("ag-row-first");if(this.isLastRowOnPage())J.push("ag-row-last");if($){if(f==="left")J.push("ag-cell-last-left-pinned");if(f==="right")J.push("ag-cell-first-right-pinned")}return J}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(_){this.beans.selectionSvc?.onRowCtrlSelected(this,(f)=>{if(f===this.centerGui||f===this.fullWidthGui)this.announceDescription()},_)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(_){if(!this.active)return;let{element:f,compBean:$}=_,{rowNode:z,beans:Q,gos:J}=this;$.addManagedListeners(f,{pointerenter:(q)=>{if(q.pointerType==="mouse")z.dispatchRowEvent("mouseEnter")},pointerleave:(q)=>{if(q.pointerType==="mouse")z.dispatchRowEvent("mouseLeave")}}),$.addManagedListeners(z,{mouseEnter:()=>{if(!Q.dragSvc?.dragging&&!J.get("suppressRowHoverHighlight"))f.classList.add("ag-row-hover"),z.setHovered(!0)},mouseLeave:()=>{this.resetHoveredStatus(f)}})}resetHoveredStatus(_){let f=_?[_]:this.allRowGuis.map(($)=>$.element);for(let $ of f)$.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(_){let f=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),$=this.applyPaginationOffset(f.top,!0)-100,z=this.applyPaginationOffset(f.bottom,!0)+100;return Math.min(Math.max($,_),z)}forEachGui(_,f){if(_)f(_);else for(let $ of this.allRowGuis)f($)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(_){if(this.rowNode.rowHeight==null)return;let f=this.rowNode.rowHeight,$=this.beans.environment.getDefaultRowHeight(),Q=Iq(this.gos)?Y$(this.beans,this.rowNode).height:void 0,J=Q?`${Math.min($,Q)-2}px`:void 0;this.forEachGui(_,(q)=>{if(q.element.style.height=`${f}px`,J)q.element.style.setProperty("--ag-line-height",J)})}destroyFirstPass(_=!1){this.active=!1;let{rowNode:f}=this;if(!_&&S1(this.gos)&&!f.sticky)if(f.rowTop!=null){let Q=this.roundRowTopToBounds(f.rowTop);this.setRowTop(Q)}else for(let Q of this.allRowGuis)Q.rowComp.toggleCss("ag-opacity-zero",!0);if(this.fullWidthGui?.element.contains(d(this.beans)))this.beans.focusSvc.attemptToRecoverFocus();f.setHovered(!1);let $=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent($),this.beans.eventSvc.dispatchEvent($),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;let _=(f)=>{for(let $ of f.list)$.destroy();return{list:[],map:{}}};this.centerCellCtrls=_(this.centerCellCtrls),this.leftCellCtrls=_(this.leftCellCtrls),this.rightCellCtrls=_(this.rightCellCtrls)}setFocusedClasses(_){this.forEachGui(_,(f)=>{f.rowComp.toggleCss("ag-row-focus",this.rowFocused),f.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){let{focusSvc:_}=this.beans,f=_.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);if(f!==this.rowFocused)this.rowFocused=f,this.setFocusedClasses()}onPaginationChanged(){let _=this.beans.pagination?.getCurrentPage()??0;if(this.paginationPage!==_)this.paginationPage=_,this.onTopChanged();this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(_,f=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return _;let $=this.beans.pageBounds.getPixelOffset();return _+$*(f?1:-1)}setRowTop(_){if(this.printLayout)return;if(v(_)){let f=this.applyPaginationOffset(_),Q=`${this.rowNode.isRowPinned()||this.rowNode.sticky?f:this.beans.rowContainerHeight.getRealPixelPosition(f)}px`;this.setRowTopStyle(Q)}}getInitialRowTop(_){return this.suppressRowTransform?this.getInitialRowTopShared(_):void 0}getInitialTransform(_){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(_)})`}getInitialRowTopShared(_){if(this.printLayout)return"";let f=this.rowNode,$;if(f.sticky)$=f.stickyRowTop;else{let z=this.slideInAnimation[_]?this.roundRowTopToBounds(f.oldRowTop):f.rowTop,Q=this.applyPaginationOffset(z);$=f.isRowPinned()?Q:this.beans.rowContainerHeight.getRealPixelPosition(Q)}return $+"px"}setRowTopStyle(_){for(let f of this.allRowGuis)if(this.suppressRowTransform)f.rowComp.setTop(_);else f.rowComp.setTransform(`translateY(${_})`)}getCellCtrl(_,f=!1){let $=null;for(let z of this.getAllCellCtrls())if(z.column==_)$=z;if($!=null||f)return $;for(let z of this.getAllCellCtrls())if(z?.getColSpanningList().indexOf(_)>=0)$=z;return $}onRowIndexChanged(){if(this.rowNode.rowIndex!=null)this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss()}updateRowIndexes(_){let f=this.rowNode.getRowIndexString();if(f===null)return;let $=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),z=this.rowNode.rowIndex%2===0,Q=this.ariaRowIndex=$+this.rowNode.rowIndex+1;this.forEachGui(_,(J)=>{J.rowComp.setRowIndex(f),J.rowComp.toggleCss("ag-row-even",z),J.rowComp.toggleCss("ag-row-odd",!z),Lz(J.element,Q)})}},hB=class extends A{constructor(){super();this.beanName="navigation",this.onPageDown=i2(this.onPageDown,100),this.onPageUp=i2(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCon=_.gridBodyCtrl})}handlePageScrollingKey(_,f=!1){let{key:$,altKey:z}=_,Q=_.ctrlKey||_.metaKey,J=!!this.beans.rangeSvc&&_.shiftKey,q=CJ(this.gos,_),X=!1;switch($){case S.PAGE_HOME:case S.PAGE_END:if(!Q&&!z)this.onHomeOrEndKey($),X=!0;break;case S.LEFT:case S.RIGHT:case S.UP:case S.DOWN:if(!q)return!1;if(Q&&!z&&!J)this.onCtrlUpDownLeftRight($,q),X=!0;break;case S.PAGE_DOWN:case S.PAGE_UP:if(!Q&&!z)X=this.handlePageUpDown($,q,f);break}if(X)_.preventDefault();return X}handlePageUpDown(_,f,$){if($)f=this.beans.focusSvc.getFocusedCell();if(!f)return!1;if(_===S.PAGE_UP)this.onPageUp(f);else this.onPageDown(f);return!0}navigateTo({scrollIndex:_,scrollType:f,scrollColumn:$,focusIndex:z,focusColumn:Q,isAsync:J,rowPinned:q}){let{scrollFeature:X}=this.gridBodyCon;if(v($)&&!$.isPinned())X.ensureColumnVisible($);if(v(_))X.ensureIndexVisible(_,f);if(!J)X.ensureIndexVisible(z);let{focusSvc:Y}=this.beans;Y.setFocusedCell({rowIndex:z,column:Q,rowPinned:q,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:z,rowPinned:q,column:Q})}onPageDown(_){let f=this.beans,$=K6(f),z=this.getViewportHeight(),{pageBounds:Q,rowModel:J,rowAutoHeight:q}=f,X=Q.getPixelOffset(),Y=$.top+z,Z=J.getRowIndexAtPixel(Y+X);if(q?.active)this.navigateToNextPageWithAutoHeight(_,Z);else this.navigateToNextPage(_,Z)}onPageUp(_){let f=this.beans,$=K6(f),{pageBounds:z,rowModel:Q,rowAutoHeight:J}=f,q=z.getPixelOffset(),X=$.top,Y=Q.getRowIndexAtPixel(X+q);if(J?.active)this.navigateToNextPageWithAutoHeight(_,Y,!0);else this.navigateToNextPage(_,Y,!0)}navigateToNextPage(_,f,$=!1){let{pageBounds:z,rowModel:Q}=this.beans,J=this.getViewportHeight(),q=z.getFirstRow(),X=z.getLastRow(),Y=z.getPixelOffset(),Z=Q.getRow(_.rowIndex),G=$?Z?.rowHeight-J-Y:J-Y,E=Z?.rowTop+G,U=Q.getRowIndexAtPixel(E+Y);if(U===_.rowIndex){let W=$?-1:1;f=U=_.rowIndex+W}let H;if($){if(H="bottom",UX)U=X;if(f>X)f=X}if(this.isRowTallerThanView(Q.getRow(U)))f=U,H="top";this.navigateTo({scrollIndex:f,scrollType:H,scrollColumn:null,focusIndex:U,focusColumn:_.column})}navigateToNextPageWithAutoHeight(_,f,$=!1){this.navigateTo({scrollIndex:f,scrollType:$?"bottom":"top",scrollColumn:null,focusIndex:f,focusColumn:_.column}),setTimeout(()=>{let z=this.getNextFocusIndexForAutoHeight(_,$);this.navigateTo({scrollIndex:f,scrollType:$?"bottom":"top",scrollColumn:null,focusIndex:z,focusColumn:_.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(_,f=!1){let $=f?-1:1,z=this.getViewportHeight(),{pageBounds:Q,rowModel:J}=this.beans,q=Q.getLastRow(),X=0,Y=_.rowIndex;while(Y>=0&&Y<=q){let Z=J.getRow(Y);if(Z){let G=Z.rowHeight??0;if(X+G>z)break;X+=G}Y+=$}return Math.max(0,Math.min(Y,q))}getViewportHeight(){let _=this.beans,f=K6(_),$=this.beans.scrollVisibleSvc.getScrollbarWidth(),z=f.bottom-f.top;if(_.ctrlsSvc.get("center").isHorizontalScrollShowing())z-=$;return z}isRowTallerThanView(_){if(!_)return!1;let f=_.rowHeight;if(typeof f!=="number")return!1;return f>this.getViewportHeight()}onCtrlUpDownLeftRight(_,f){let $=this.beans.cellNavigation.getNextCellToFocus(_,f,!0);if(!$)return;let z=this.getNormalisedPosition($),{rowIndex:Q,rowPinned:J,column:q}=z??$,X=q;this.navigateTo({scrollIndex:Q,scrollType:null,scrollColumn:X,focusIndex:Q,focusColumn:X,rowPinned:J})}onHomeOrEndKey(_){let f=_===S.PAGE_HOME,{visibleCols:$,pageBounds:z,rowModel:Q}=this.beans,J=$.allCols,q=f?z.getFirstRow():z.getLastRow(),X=Q.getRow(q);if(!X)return;let Y=(f?J:[...J].reverse()).find((Z)=>!Z.isSuppressNavigable(X)&&!I_(Z));if(!Y)return;this.navigateTo({scrollIndex:q,scrollType:null,scrollColumn:Y,focusIndex:q,focusColumn:Y})}onTabKeyDown(_,f){let $=f.shiftKey,z=this.tabToNextCellCommon(_,$,f),Q=this.beans,{ctrlsSvc:J,pageBounds:q,focusSvc:X,gos:Y}=Q;if(z!==!1){if(z)f.preventDefault();else if(z===null)J.get("gridCtrl").allowFocusForNextCoreContainer($);return}if($){let{rowIndex:Z,rowPinned:G}=_.getRowPosition();if(G?Z===0:Z===q.getFirstRow())if(Y.get("headerHeight")===0||W0(Q))q0(Q,!0,!0);else f.preventDefault(),X.focusPreviousFromFirstCell(f)}else{if(_ instanceof _$)_.focusCell(!0);if(X.focusOverlay(!1)||q0(Q,$))f.preventDefault()}}tabToNextCell(_,f){let $=this.beans,{focusSvc:z,rowRenderer:Q}=$,J=z.getFocusedCell();if(!J)return!1;let q=f0($,J);if(!q){if(q=Q.getRowByPosition(J),!q?.isFullWidth())return!1}return!!this.tabToNextCellCommon(q,_,f,"api")}tabToNextCellCommon(_,f,$,z="ui"){let{editSvc:Q,focusSvc:J}=this.beans,q=void 0,X=_ instanceof _$?_:_.getAllCellCtrls()?.[0];if(Q?.isEditing())q=Q?.moveToNextCell(X,f,$,z);else q=this.moveToNextCellNotEditing(_,f,$);if(q===null)return q;return q||!!J.focusedHeader}moveToNextCellNotEditing(_,f,$){let z=this.beans.visibleCols.allCols,Q;if(_ instanceof u6){if(Q={..._.getRowPosition(),column:f?z[0]:b(z)},this.gos.get("embedFullWidthRows")&&$){let q=_.findFullWidthInfoForEvent($);if(q)Q.column=q.column}}else Q=_.getFocusedCellPosition();let J=this.findNextCellToFocusOn(Q,{backwards:f,startEditing:!1});if(J===!1)return null;if(J instanceof _$)J.focusCell(!0);else if(J)return this.tryToFocusFullWidthRow(J,f);return v(J)}findNextCellToFocusOn(_,{backwards:f,startEditing:$,skipToNextEditableCell:z}){let Q=_,J=this.beans,{cellNavigation:q,gos:X,focusSvc:Y,rowRenderer:Z}=J;while(!0){if(_!==Q)_=Q;if(!f)Q=this.getLastCellOfColSpan(Q);Q=q.getNextTabbedCell(Q,f);let G=X.getCallback("tabToNextCell");if(v(G)){let W=G({backwards:f,editing:$,previousCellPosition:_,nextCellPosition:Q?Q:null});if(W===!0)Q=_;else if(W===!1)return!1;else Q={rowIndex:W.rowIndex,column:W.column,rowPinned:W.rowPinned}}if(!Q)return null;if(Q.rowIndex<0){let H=o_(J);return Y.focusHeaderPosition({headerPosition:{headerRowIndex:H+Q.rowIndex,column:Q.column},fromCell:!0}),null}let E=X.get("editType")==="fullRow";if($&&(!E||z)){if(!this.isCellEditable(Q))continue}this.ensureCellVisible(Q);let U=f0(J,Q);if(!U){let H=Z.getRowByPosition(Q);if(!H||!H.isFullWidth()||$)continue;return{...H.getRowPosition(),column:Q?.column}}if(q.isSuppressNavigable(U.column,U.rowNode))continue;return U.setFocusedCellPosition(Q),this.setRangeToCellIfSupported(Q),U}}isCellEditable(_){let f=this.lookupRowNodeForCell(_);if(f)return _.column.isCellEditable(f);return!1}lookupRowNodeForCell({rowIndex:_,rowPinned:f}){let{pinnedRowModel:$,rowModel:z}=this.beans;if(f==="top")return $?.getPinnedTopRow(_);if(f==="bottom")return $?.getPinnedBottomRow(_);return z.getRow(_)}navigateToNextCell(_,f,$,z){let Q=$,J=!1,q=this.beans,{cellNavigation:X,focusSvc:Y,gos:Z}=q;while(Q&&(Q===$||!this.isValidNavigateCell(Q))){if(Z.get("enableRtl")){if(f===S.LEFT)Q=this.getLastCellOfColSpan(Q)}else if(f===S.RIGHT)Q=this.getLastCellOfColSpan(Q);Q=X.getNextCellToFocus(f,Q),J=n(Q)}if(J&&_&&_.key===S.UP)Q={rowIndex:-1,rowPinned:null,column:$.column};if(z){let E=Z.getCallback("navigateToNextCell");if(v(E)){let H=E({key:f,previousCellPosition:$,nextCellPosition:Q?Q:null,event:_});if(v(H))Q={rowPinned:H.rowPinned,rowIndex:H.rowIndex,column:H.column};else Q=null}}if(!Q)return;if(Q.rowIndex<0){let E=o_(q);Y.focusHeaderPosition({headerPosition:{headerRowIndex:E+Q.rowIndex,column:Q.column??$.column},event:_||void 0,fromCell:!0});return}let G=this.getNormalisedPosition(Q);if(G)this.focusPosition(G);else this.tryToFocusFullWidthRow(Q)}getNormalisedPosition(_){if(!!this.beans.spannedRowRenderer?.getCellByPosition(_))return _;this.ensureCellVisible(_);let $=f0(this.beans,_);if(!$)return null;return _=$.getFocusedCellPosition(),this.ensureCellVisible(_),_}tryToFocusFullWidthRow(_,f){let{visibleCols:$,rowRenderer:z,focusSvc:Q,eventSvc:J}=this.beans,q=$.allCols;if(!z.getRowByPosition(_)?.isFullWidth())return!1;let Y=Q.getFocusedCell(),Z={rowIndex:_.rowIndex,rowPinned:_.rowPinned,column:_.column||(f?b(q):q[0])};this.focusPosition(Z);let G=f==null?Y!=null&&Y_(Z,Y):f;return J.dispatchEvent({type:"fullWidthRowFocused",rowIndex:Z.rowIndex,rowPinned:Z.rowPinned,column:Z.column,isFullWidthCell:!0,fromBelow:G}),!0}focusPosition(_){let{focusSvc:f}=this.beans;f.setFocusedCell({rowIndex:_.rowIndex,column:_.column,rowPinned:_.rowPinned,forceBrowserFocus:!0}),this.setRangeToCellIfSupported(_)}setRangeToCellIfSupported(_){if(I_(_.column))return;this.beans.rangeSvc?.setRangeToCell(_)}isValidNavigateCell(_){return!!D_(this.beans,_)}getLastCellOfColSpan(_){let f=f0(this.beans,_);if(!f)return _;let $=f.getColSpanningList();if($.length===1)return _;return{rowIndex:_.rowIndex,column:b($),rowPinned:_.rowPinned}}ensureCellVisible(_){let f=y1(this.gos),$=this.beans.rowModel.getRow(_.rowIndex),z=f&&$?.sticky,{scrollFeature:Q}=this.gridBodyCon;if(!z&&n(_.rowPinned))Q.ensureIndexVisible(_.rowIndex);if(!_.column.isPinned())Q.ensureColumnVisible(_.column)}ensureColumnVisible(_){let f=this.gridBodyCon.scrollFeature;if(!_.isPinned())f.ensureColumnVisible(_)}ensureRowVisible(_){this.gridBodyCon.scrollFeature.ensureIndexVisible(_)}};function K6(_){return _.ctrlsSvc.getScrollFeature().getVScrollPosition()}var f1={moduleName:"KeyboardNavigation",version:c,beans:[hB,QB,KW],apiFunctions:{getFocusedCell:JB,clearFocusedCell:qB,setFocusedCell:XB,setFocusedHeader:GB,tabToNextCell:YB,tabToPreviousCell:ZB}},uB=class extends A{constructor(){super(...arguments);this.beanName="pageBoundsListener"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(_){this.calculatePages(),this.eventSvc.dispatchEvent({type:"paginationChanged",animate:_?.animate??!1,newData:_?.newData??!1,newPage:_?.newPage??!1,newPageSize:_?.newPageSize??!1,keepRenderedRows:_?.keepRenderedRows??!1})}calculatePages(){let{pageBounds:_,pagination:f,rowModel:$}=this.beans;if(f)f.calculatePages();else _.calculateBounds(0,$.getRowCount()-1)}},iB=class extends A{constructor(){super(...arguments);this.beanName="pageBounds",this.pixelOffset=0}getFirstRow(){return this.topRowBounds?.rowIndex??-1}getLastRow(){return this.bottomRowBounds?.rowIndex??-1}getCurrentPageHeight(){let{topRowBounds:_,bottomRowBounds:f}=this;if(!_||!f)return 0;return Math.max(f.rowTop+f.rowHeight-_.rowTop,0)}getCurrentPagePixelRange(){let{topRowBounds:_,bottomRowBounds:f}=this,$=_?.rowTop??0,z=f?f.rowTop+f.rowHeight:0;return{pageFirstPixel:$,pageLastPixel:z}}calculateBounds(_,f){let{rowModel:$}=this.beans,z=$.getRowBounds(_);if(z)z.rowIndex=_;this.topRowBounds=z;let Q=$.getRowBounds(f);if(Q)Q.rowIndex=f;this.bottomRowBounds=Q,this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){let _=this.topRowBounds?.rowTop??0;if(this.pixelOffset===_)return;this.pixelOffset=_,this.eventSvc.dispatchEvent({type:"paginationPixelOffsetChanged"})}},mB=".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}",cB=class extends A{constructor(_,f){super();this.isLeft=_,this.elements=f,this.getWidth=_?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[`${this.isLeft?"left":"right"}PinnedWidthChanged`]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){let _=this.getWidth(),f=_>0;for(let $ of this.elements)if($)N($,f),I0($,_)}},pB=class extends A{constructor(){super(...arguments);this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(f)=>{this.gridBodyCtrl=f.gridBodyCtrl});let _=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:_,displayedColumnsWidthChanged:_}),this.addManagedPropertyListener("domLayout",_)}checkContainerWidths(){let{gos:_,visibleCols:f,eventSvc:$}=this.beans,z=S_(_,"print"),Q=z?0:f.getColsLeftWidth(),J=z?0:f.getDisplayedColumnsRightWidth();if(Q!=this.leftWidth)this.leftWidth=Q,$.dispatchEvent({type:"leftPinnedWidthChanged"});if(J!=this.rightWidth)this.rightWidth=J,$.dispatchEvent({type:"rightPinnedWidthChanged"})}keepPinnedColumnsNarrowerThanViewport(){let _=this.gridBodyCtrl.eBodyViewport,f=df(_);if(f<=50)return;let $=this.getPinnedColumnsOverflowingViewport(f-50),z=this.gos.getCallback("processUnpinnedColumns"),{columns:Q,hasLockedPinned:J}=$,q=Q;if(!q.length&&!J)return;if(z)q=z({columns:q,viewportWidth:f});if(!q?.length)return;q=q.filter((X)=>!I_(X)),this.setColsPinned(q,null,"viewportSizeFeature")}createPinnedWidthFeature(_,...f){return new cB(_,f)}setColsPinned(_,f,$){let{colModel:z,colAnimation:Q,visibleCols:J,gos:q}=this.beans;if(!z.cols)return;if(!_?.length)return;if(S_(q,"print")){j(37);return}Q?.start();let X;if(f===!0||f==="left")X="left";else if(f==="right")X="right";else X=null;let Y=[];for(let Z of _){if(!Z)continue;let G=z.getCol(Z);if(!G)continue;if(G.getPinned()!==X)this.setColPinned(G,X),Y.push(G)}if(Y.length)J.refresh($),nX(this.eventSvc,Y,$);Q?.finish()}initCol(_){let{pinned:f,initialPinned:$}=_.colDef;if(f!==void 0)this.setColPinned(_,f);else this.setColPinned(_,$)}setColPinned(_,f){if(f===!0||f==="left")_.pinned="left";else if(f==="right")_.pinned="right";else _.pinned=null;_.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(_){let{scrollVisibleSvc:f}=this.beans;if(_.pinned==null)return;let $=_.pinned==="left",z=_.pinned==="right";_.hidden=!0;let Q=()=>{let J=$?this.leftWidth:this.rightWidth;if(J==null)return;let q=J==0,X=_.hidden!==q,Y=this.gos.get("enableRtl"),Z=f.getScrollbarWidth(),E=f.verticalScrollShowing&&(Y&&$||!Y&&z)?J+Z:J;if(_.comp.setPinnedContainerWidth(`${E}px`),_.comp.setDisplayed(!q),X)_.hidden=q,_.refresh()};_.addManagedEventListeners({leftPinnedWidthChanged:Q,rightPinnedWidthChanged:Q,scrollVisibilityChanged:Q,scrollbarWidthChanged:Q})}getHeaderResizeDiff(_,f){if(f.getPinned()){let{leftWidth:z,rightWidth:Q}=this,J=df(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-50;if(z+Q+_>J)if(J>z+Q)_=J-z-Q;else return 0}return _}getPinnedColumnsOverflowingViewport(_){let f=this.rightWidth??0,$=this.leftWidth??0,z=f+$,Q=!1;if(z<_)return{columns:[],hasLockedPinned:Q};let{visibleCols:J}=this.beans,q=[...J.leftCols],X=[...J.rightCols],Y=0,Z=0,G=0,E=[],U=z-G-_;while((Z0){if(Y0){let H=q[Z++];if(H.colDef.lockPinned){Q=!0;continue}U-=H.getActualWidth(),E.push(H)}}return{columns:E,hasLockedPinned:Q}}},nB={moduleName:"PinnedColumn",version:c,beans:[pB],css:[mB]},dB=class extends j_{constructor(){super();this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.lastAnnouncement="",this.updateAnnouncement=c0(this,this.updateAnnouncement.bind(this),200)}postConstruct(){let _=this.beans,f=q_(_),$=this.descriptionContainer=f.createElement("div");$.classList.add("ag-aria-description-container"),o9($,"polite"),j4($,"additions text"),R4($,!0),_.eRootDiv.appendChild($)}announceValue(_,f){this.pendingAnnouncements.set(f,_),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;let _=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.handleAnnouncementUpdate(_)},50)}handleAnnouncementUpdate(_){if(!this.isAlive()||!this.descriptionContainer)return;let f=_;if(f==null||f.replace(/[ .]/g,"")==""){this.lastAnnouncement="";return}if(this.lastAnnouncement===f)f=`${f}​`;this.lastAnnouncement=f,this.descriptionContainer.textContent=f}destroy(){super.destroy();let{descriptionContainer:_}=this;if(_)f_(_),_.remove();this.descriptionContainer=null,this.pendingAnnouncements.clear()}},tB=class extends dB{},rB={moduleName:"Aria",version:c,beans:[tB]},lB=":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}",O9="ag-delay-render",sB=class extends A{constructor(){super(...arguments);this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=new Set}hideColumns(_){if(this.alreadyRevealed||this.requesters.has(_))return;if(this.requesters.add(_),!this.hideRequested)this.beans.ctrlsSvc.whenReady(this,(f)=>{f.gridBodyCtrl.eGridBody.classList.add(O9)}),this.hideRequested=!0}revealColumns(_){if(this.alreadyRevealed||!this.isAlive())return;if(this.requesters.delete(_),this.requesters.size>0)return;let{renderStatus:f,ctrlsSvc:$}=this.beans;if(f){if(!f.areHeaderCellsRendered()&&this.timesRetried<5){this.timesRetried++,setTimeout(()=>this.revealColumns(_));return}this.timesRetried=0}$.getGridBodyCtrl().eGridBody.classList.remove(O9),this.alreadyRevealed=!0}},aB={moduleName:"ColumnDelayRender",version:c,beans:[sB],css:[lB]},ZQ=class extends w{constructor(){super()}},oB={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},eB=class extends ZQ{constructor(){super(...arguments);this.eExportingIcon=V,this.eExportingText=V}init(_){let{beans:f}=this;this.setTemplate(oB);let $=h("overlayExporting",f,null);if($)this.eExportingIcon.appendChild($);let z=_.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=z,f.ariaAnnounce.announceValue(z,"overlay")}},_3={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},f3=class extends ZQ{constructor(){super(...arguments);this.eLoadingIcon=V,this.eLoadingText=V}init(_){let{beans:f,gos:$}=this,z=T0($.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(z??_3),!z){let Q=h("overlayLoading",f,null);if(Q)this.eLoadingIcon.appendChild(Q);let J=_.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=J,f.ariaAnnounce.announceValue(J,"overlay")}}},$3={tag:"span",cls:"ag-overlay-no-matching-rows-center"},z3=class extends ZQ{init(_){let{beans:f}=this;this.setTemplate($3);let $=_.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=$,f.ariaAnnounce.announceValue($,"overlay")}},Q3={tag:"span",cls:"ag-overlay-no-rows-center"},J3=class extends ZQ{init(_){let{beans:f,gos:$}=this,z=T0($.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(z??Q3),!z){let Q=_.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=Q,f.ariaAnnounce.announceValue(Q,"overlay")}}};function q3(_){_.overlays?.showLoadingOverlay()}function X3(_){_.overlays?.showNoRowsOverlay()}function Y3(_){_.overlays?.hideOverlay()}var Z3=".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}",G3={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},M5=class extends w{constructor(){super(G3);this.eOverlayWrapper=V,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(Z3)}handleKeyDown(_){if(_.key!==S.TAB||_.defaultPrevented||z0(_))return;let{beans:f,eOverlayWrapper:$}=this;if($&&V_(f,$,!1,_.shiftKey))return;let Q=!1;if(_.shiftKey)Q=f.focusSvc.focusGridView({column:b(f.visibleCols.allCols),backwards:!0,canFocusOverlay:!1});else Q=q0(f,!1);if(Q)_.preventDefault()}updateLayoutClasses(_,f){let $=this.eOverlayWrapper;if(!$)return;let z=$.classList,{AUTO_HEIGHT:Q,NORMAL:J,PRINT:q}=B0;z.toggle(Q,f.autoHeight),z.toggle(J,f.normal),z.toggle(q,f.print)}postConstruct(){this.createManagedBean(new TJ(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(_){let f=this.eOverlayWrapper?.classList;if(!f){this.activeCssClass=null;return}if(this.activeCssClass)f.toggle(this.activeCssClass,!1);this.activeCssClass=_,f.toggle(_,!0)}showOverlay(_,f,$){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=_,this.overlayExclusive=$,!_)return this.refreshWrapperPadding(),g.resolve();if(this.setWrapperTypeClass(f),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),$&&this.isGridFocused()){let z=d(this.beans);if(z&&!sf(this.beans))this.elToFocusAfter=z}return _.then((z)=>{let Q=this.eOverlayWrapper;if(!Q){this.destroyBean(z);return}if(this.activePromise!==_){if(this.activeOverlay!==z)this.destroyBean(z),z=null;return}if(this.activePromise=null,!z)return;if(this.activeOverlay!==z)Q.appendChild(z.getGui()),this.activeOverlay=z;if($&&this.isGridFocused())F_(Q)}),_}refreshWrapperPadding(){if(!this.eOverlayWrapper){this.oldWrapperPadding=null;return}let _=!!this.activeOverlay||!!this.activePromise,f=0;if(_&&!this.overlayExclusive)f=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0;if(f!==this.oldWrapperPadding)this.oldWrapperPadding=f,this.eOverlayWrapper.style.setProperty("padding-top",`${f}px`)}destroyActiveOverlay(){this.activePromise=null;let _=this.activeOverlay;if(!_){this.overlayExclusive=!1,this.elToFocusAfter=null,this.refreshWrapperPadding();return}let f=this.elToFocusAfter;if(this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,f&&!this.isGridFocused())f=null;this.destroyBean(_);let $=this.eOverlayWrapper;if($)f_($);f?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){let _=d(this.beans);return!!_&&this.beans.eGridDiv.contains(_)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},E3={selector:"AG-OVERLAY-WRAPPER",component:M5},U3=["refresh"],y$=(_)=>({name:_,optionalMethods:U3}),Nf={id:"agLoadingOverlay",overlayType:"loading",comp:y$("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:(_)=>{let f=_.get("loading");return f===!1||_.get("suppressLoadingOverlay")===!0&&f!==!0}},F1={id:"agNoRowsOverlay",overlayType:"noRows",comp:y$("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:(_)=>_.get("suppressNoRowsOverlay")},tJ={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:y$("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},yz={id:"agExportingOverlay",overlayType:"exporting",comp:y$("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},Bz={id:"activeOverlay",comp:y$("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},H3=(_)=>{if(!_)return null;return{agLoadingOverlay:Nf,agNoRowsOverlay:F1,agNoMatchingRowsOverlay:tJ,agExportingOverlay:yz}[_]??Bz},W3=(_)=>{if(!_)return null;return{loading:Nf,noRows:F1,noMatchingRows:tJ,exporting:yz}[_]},B3=class extends A{constructor(){super(...arguments);this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.newColumnsLoadedCleanup=null}postConstruct(){let _=this.gos;this.showInitialOverlay=o(_);let f=()=>{if(this.userForcedNoRows)return;this.updateOverlay(!1)},[$,z,Q,J]=this.addManagedEventListeners({newColumnsLoaded:f,rowCountReady:()=>{this.disableInitialOverlay(),f(),z()},rowDataUpdated:f,modelUpdated:f});this.newColumnsLoadedCleanup=$,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],(q)=>this.onPropChange(new Set(q.changeSet?.properties)))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(_,f){if(!this.isAlive())return;if(!f)this.eWrapper=_;else if(this.eWrapper===_)this.eWrapper=void 0;this.updateOverlay(!1)}isVisible(){return!!this.currentDef}showLoadingOverlay(){this.showInitialOverlay=!1;let _=this.gos;if(!this.eWrapper||_.get("activeOverlay"))return;if(this.isDisabled(Nf))return;let f=_.get("loading");if(!f&&f!==void 0)return;this.doShowOverlay(Nf)}showNoRowsOverlay(){this.showInitialOverlay=!1;let _=this.gos;if(!this.eWrapper||_.get("activeOverlay")||_.get("loading")||this.isDisabled(F1))return;this.userForcedNoRows=!0,this.doShowOverlay(F1)}async showExportOverlay(_){let{gos:f,beans:$}=this;if(!this.eWrapper||f.get("activeOverlay")||f.get("loading")||this.isDisabled(yz)||this.userForcedNoRows&&this.currentDef===F1){_();return}let z=this.getDesiredDefWithOverride(yz);if(!z){_();return}this.exportsInProgress++,this.focusedCell=$.focusSvc.getFocusedCell(),await this.doShowOverlay(z),await new Promise((J)=>setTimeout(()=>J()));let Q=Date.now();try{_()}finally{let J=Date.now()-Q,q=Math.max(0,300-J),X=()=>{if(this.exportsInProgress--,this.exportsInProgress===0)this.updateOverlay(!1),n8($,this.focusedCell),this.focusedCell=null};if(q>0)setTimeout(()=>X(),q);else X()}}hideOverlay(){let _=this.gos;this.showInitialOverlay=!1;let f=this.userForcedNoRows;if(this.userForcedNoRows=!1,_.get("loading")){j(99);return}if(_.get("activeOverlay")){j(296);return}if(this.currentDef===tJ){j(297);return}if(this.doHideOverlay(),f){if(this.getOverlayDef()!==F1)this.updateOverlay(!1)}}getOverlayWrapperSelector(){return E3}getOverlayWrapperCompClass(){return M5}onPropChange(_){let f=_.has("activeOverlay");if(f||_.has("loading")){if(this.updateOverlay(f))return}let $=this.currentDef,z=this.eWrapper?.activeOverlay;if(z&&$){let Q=_.has("activeOverlayParams");if($===Bz){if(Q)z.refresh?.(this.makeCompParams(!0))}else{let J=$.paramsKey;if(_.has("overlayComponentParams")||J&&_.has(J))z.refresh?.(this.makeCompParams(!1,J,$.overlayType))}}}updateOverlay(_){let f=this.eWrapper;if(!f)return this.currentDef=null,!1;let $=this.getDesiredDefWithOverride(),z=this.currentDef,Q=$===Bz&&_;if($!==z){if(!$)return this.disableInitialOverlay(),this.doHideOverlay();return this.doShowOverlay($),!0}if(Q&&$)return f.hideOverlay(),this.doShowOverlay($),!0;if(!$)this.disableInitialOverlay();return!1}getDesiredDefWithOverride(_){let{gos:f}=this,$=H3(f.get("activeOverlay"));if(!$){if($=_??this.getOverlayDef(),$&&this.isDisabled($))$=null}return $}getOverlayDef(){let{gos:_,beans:f}=this,{rowModel:$}=f,z=_.get("loading");if(z!==void 0){if(this.disableInitialOverlay(),z)return Nf}else if(this.showInitialOverlay){if(!this.isDisabled(Nf)&&(!_.get("columnDefs")||!_.get("rowData")))return Nf;this.disableInitialOverlay()}else this.disableInitialOverlay();let J=$.getOverlayType();return W3(J)}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(_){let{gos:f,beans:$}=this,{userCompFactory:z}=$;this.currentDef=_;let Q=_!==Bz,J=!!_.exclusive;this.exclusive=J;let q;if(_.paramsKey&&f.get(_.paramsKey)||_.compKey&&f.get(_.compKey))q=_.paramsKey;let X=void 0;if(Q){if(f.get("overlayComponent")||f.get("overlayComponentSelector"))X=z.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,_.paramsKey,_.overlayType))}X??(X=z.getCompDetailsFromGridOptions(_.comp,Q?_.id:void 0,this.makeCompParams(!Q,q,_.overlayType),!1));let Y=X?.newAgStackInstance()??null,Z=this.eWrapper?this.eWrapper.showOverlay(Y,_.wrapperCls,J):g.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(J),Z}makeCompParams(_,f,$){let{gos:z}=this,Q=_?z.get("activeOverlayParams"):{...z.get("overlayComponentParams"),...f&&z.get(f)||null,overlayType:$};return C(z,Q??{})}doHideOverlay(){let _=!1;if(this.currentDef)this.currentDef=null,_=!0;this.exclusive=!1;let f=this.eWrapper;if(f)f.hideOverlay(),f.refreshWrapperPadding(),this.setExclusive(!1);return _}setExclusive(_){if(this.oldExclusive!==_)this.oldExclusive=_,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"})}isDisabled(_){let{gos:f}=this;return _.overlayType&&f.get("suppressOverlays")?.includes(_.overlayType)||_.isSuppressed?.(f)===!0}},K3={moduleName:"Overlay",version:c,userComponents:{agLoadingOverlay:f3,agNoRowsOverlay:J3,agNoMatchingRowsOverlay:z3,agExportingOverlay:eB},apiFunctions:{showLoadingOverlay:q3,showNoRowsOverlay:X3,hideOverlay:Y3},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[B3]},L3=class extends A{constructor(){super(...arguments);this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=A8(),q$(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;let _=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,f=this.getUiBodyHeight();if(_!==this.scrollY||f!==this.uiBodyHeight)this.scrollY=_,this.uiBodyHeight=f,this.calculateOffset()}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;let _=this.scrollY/this.maxScrollY,f=_*this.pixelsToShave;q$(this.gos,`RowContainerHeightService - Div Stretch Offset = ${f} (${this.pixelsToShave} * ${_})`),this.setDivStretchOffset(f)}setUiContainerHeight(_){if(_!==this.uiContainerHeight)this.uiContainerHeight=_,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"})}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(_){let f=typeof _==="number"?Math.floor(_):null;if(this.divStretchOffset===f)return;this.divStretchOffset=f,this.eventSvc.dispatchEvent({type:"heightScaleChanged"})}setModelHeight(_){if(this.modelHeight=_,this.stretching=_!=null&&this.maxDivHeight>0&&_>this.maxDivHeight,this.stretching)this.calculateOffset();else this.clearOffset()}getRealPixelPosition(_){return _-this.divStretchOffset}getUiBodyHeight(){let _=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return _.bottom-_.top}getScrollPositionForPixel(_){if(this.pixelsToShave<=0)return _;let f=this.modelHeight-this.getUiBodyHeight(),$=_/f;return this.maxScrollY*$}},F3=400,D3=class extends A{constructor(){super(...arguments);this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{let _=()=>{for(let J of this.getAllCellCtrls())J.onCellSelectionChanged()},f=()=>{for(let J of this.getAllCellCtrls())J.updateRangeBordersIfRangeCount()},$=()=>{this.eventSvc.addListener("cellSelectionChanged",_),this.eventSvc.addListener("columnMoved",f),this.eventSvc.addListener("columnPinned",f),this.eventSvc.addListener("columnVisible",f)},z=()=>{this.eventSvc.removeListener("cellSelectionChanged",_),this.eventSvc.removeListener("columnMoved",f),this.eventSvc.removeListener("columnPinned",f),this.eventSvc.removeListener("columnVisible",f)};if(this.addDestroyFunc(()=>z()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(i_(this.gos))$();else z()}),i_(this.gos))$()}}wireBeans(_){this.pageBounds=_.pageBounds,this.colModel=_.colModel,this.pinnedRowModel=_.pinnedRowModel,this.rowModel=_.rowModel,this.focusSvc=_.focusSvc,this.rowContainerHeight=_.rowContainerHeight,this.ctrlsSvc=_.ctrlsSvc,this.editSvc=_.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,(_)=>{this.gridBodyCtrl=_.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",(z)=>this.onSuppressCellFocusChanged(z.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:z,previousValue:Q})=>{if(!Q&&z||Q&&!z)this.redrawRows()});let{stickyRowSvc:_,gos:f,showRowGroupCols:$}=this.beans;if($)this.addManagedPropertyListener("showOpenedGroup",()=>{let z=$.columns;if(z.length)this.refreshCells({columns:z,force:!0})});if(_)this.stickyRowFeature=_.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{let z=this.gridBodyCtrl;z.setStickyTopHeight(0),z.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=S_(f,"print"),this.embedFullWidthRows=this.printLayout||f.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){let _=this.getKeepDetailRowsCount(),f=_!=null?_:3;this.cachedRowCtrls=new M3(f)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){let _=Object.values(this.rowCtrlsByRowIndex),f=Object.values(this.zombieRowCtrls),$=this.cachedRowCtrls?.getEntries()??[];if(f.length>0||$.length>0)this.allRowCtrls=[..._,...f,...$];else this.allRowCtrls=_}isCellBeingRendered(_,f){let $=this.rowCtrlsByRowIndex[_];if(!f||!$)return!!$;if($.isFullWidth())return!0;return!!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:_,column:f,rowPinned:null})||!!$.getCellCtrl(f)||!$.isRowRendered()}updateCellFocus(_){for(let f of this.getAllCellCtrls())f.onCellFocused(_);for(let f of this.getFullWidthRowCtrls())f.onFullWidthRowFocused(_)}onCellFocusChanged(_){if(_?.rowIndex!=null&&!_.rowPinned){let f=this.beans.colModel.getCol(_.column)??void 0;if(!this.isCellBeingRendered(_.rowIndex,f))this.redraw()}this.updateCellFocus(_)}onSuppressCellFocusChanged(_){for(let f of this.getAllCellCtrls())f.onSuppressCellFocusChanged(_);for(let f of this.getFullWidthRowCtrls())f.onSuppressCellFocusChanged(_)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:(_)=>this.onCellFocusChanged(_),cellFocusCleared:()=>this.updateCellFocus(),flashCells:(_)=>{let{cellFlashSvc:f}=this.beans;if(f)for(let $ of this.getAllCellCtrls())f.onFlashCells($,_)},columnHoverChanged:()=>{for(let _ of this.getAllCellCtrls())_.onColumnHover()},displayedColumnsChanged:()=>{for(let _ of this.getAllCellCtrls())_.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(let _ of this.getAllCellCtrls())_.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(let _ of this.destroyFuncsForColumnListeners)_();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();let _=this.colModel.getCols();for(let f of _){let $=(Y)=>{for(let Z of this.getAllCellCtrls())if(Z.column===f)Y(Z)},z=()=>{$((Y)=>Y.onLeftChanged())},Q=()=>{$((Y)=>Y.onWidthChanged())},J=()=>{$((Y)=>Y.onFirstRightPinnedChanged())},q=()=>{$((Y)=>Y.onLastLeftPinnedChanged())},X=()=>{$((Y)=>Y.onColDefChanged())};f.__addEventListener("leftChanged",z),f.__addEventListener("widthChanged",Q),f.__addEventListener("firstRightPinnedChanged",J),f.__addEventListener("lastLeftPinnedChanged",q),f.__addEventListener("colDefChanged",X),this.destroyFuncsForColumnListeners.push(()=>{f.__removeEventListener("leftChanged",z),f.__removeEventListener("widthChanged",Q),f.__removeEventListener("firstRightPinnedChanged",J),f.__removeEventListener("lastLeftPinnedChanged",q),f.__removeEventListener("colDefChanged",X)})}}onDomLayoutChanged(){let _=S_(this.gos,"print"),f=_||this.gos.get("embedFullWidthRows"),$=f!==this.embedFullWidthRows||this.printLayout!==_;if(this.printLayout=_,this.embedFullWidthRows=f,$)this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;let _=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(_)}onPageLoaded(_){let f={recycleRows:_.keepRenderedRows,animate:_.animate,newData:_.newData,newPage:_.newPage,onlyBody:!0};this.redrawAfterModelUpdate(f)}getAllCellsNotSpanningForColumn(_){let f=[];for(let $ of this.getAllRowCtrls()){let z=$.getCellCtrl(_,!0)?.eGui;if(z)f.push(z)}return f}refreshFloatingRowComps(_=!0){this.refreshFloatingRows(this.topRowCtrls,"top",_),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",_)}refreshFloatingRows(_,f,$){let{pinnedRowModel:z,beans:Q,printLayout:J}=this,q=Object.fromEntries(_.map((Y)=>[Y.rowNode.id,Y]));z?.forEachPinnedRow(f,(Y,Z)=>{let G=_[Z];if(G&&z.getPinnedRowById(G.rowNode.id,f)===void 0)G.destroyFirstPass(),G.destroySecondPass();if(Y.id in q&&$)_[Z]=q[Y.id],delete q[Y.id];else _[Z]=new u6(Y,Q,!1,!1,J)});let X=(f==="top"?z?.getPinnedTopRowCount():z?.getPinnedBottomRowCount())??0;_.length=X}onPinnedRowDataChanged(){let _={recycleRows:!0};this.redrawAfterModelUpdate(_)}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(_,f=!1){if(_.sticky)this.stickyRowFeature?.refreshStickyNode(_);else if(this.cachedRowCtrls?.has(_)){this.cachedRowCtrls.removeRow(_);return}else{let $=(z)=>{let Q=z[_.rowIndex];if(!Q)return;if(Q.rowNode!==_)return;Q.destroyFirstPass(),Q.destroySecondPass(),z[_.rowIndex]=this.createRowCon(_,!1,!1)};switch(_.rowPinned){case"top":$(this.topRowCtrls);break;case"bottom":$(this.bottomRowCtrls);break;default:$(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}if(!f)this.dispatchDisplayedRowsChanged(!1)}redrawRows(_){let{editSvc:f}=this.beans;if(f?.isEditing())if(f.isBatchEditing())f.cleanupEditors();else f.stopEditing(void 0,{source:"api"});if(_!=null){for(let z of _??[])this.redrawRow(z,!0);this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}redrawAfterModelUpdate(_={}){this.getLockOnRefresh();let f=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(_);let $=!_.domLayoutChanged&&!!_.recycleRows,z=_.animate&&S1(this.gos),Q=$?this.getRowsToRecycle():null;if(!$)this.removeAllRowComps();this.workOutFirstAndLastRowsToRender();let{stickyRowFeature:J,gos:q}=this;if(J){J.checkStickyRows();let X=J.extraTopHeight+J.extraBottomHeight;if(X)this.updateContainerHeights(X)}if(this.recycleRows(Q,z),this.gridBodyCtrl.updateRowCount(),!_.onlyBody)this.refreshFloatingRowComps(q.get("enableRowPinning")?$:void 0);if(this.dispatchDisplayedRowsChanged(),f!=null)this.restoreFocusedCell(f);this.releaseLockOnRefresh()}scrollToTopIfNewData(_){let f=_.newData||_.newPage,$=this.gos.get("suppressScrollOnNewData");if(f&&!$)this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets()}updateContainerHeights(_=0){let{rowContainerHeight:f}=this;if(this.printLayout){f.setModelHeight(null);return}let $=this.pageBounds.getCurrentPageHeight();if($===0)$=1;f.setModelHeight($+_)}getLockOnRefresh(){if(this.refreshInProgress)throw Error($0(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(_){if(!_)return;let f=this.beans.focusSvc,$=this.findPositionToFocus(_);if(!$){f.focusHeaderPosition({headerPosition:{headerRowIndex:o_(this.beans)-1,column:_.column}});return}if(_.rowIndex!==$.rowIndex||_.rowPinned!=$.rowPinned){f.setFocusedCell({...$,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0});return}if(!f.doesRowOrCellHaveBrowserFocus())this.updateCellFocus(C(this.gos,{...$,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}findPositionToFocus(_){let{pagination:f,pageBounds:$}=this.beans,z=_;if(z.rowPinned==null&&f&&$&&!f.isRowInPage(z.rowIndex))z={rowPinned:null,rowIndex:$.getFirstRow()};while(z){if(z.rowPinned==null&&$){if(z.rowIndex<$.getFirstRow()){if(z=m_(this.beans,{rowPinned:null,rowIndex:0}),!z)return null}else if(z.rowIndex>$.getLastRow())z={rowPinned:null,rowIndex:$.getLastRow()}}let Q=this.getRowByPosition(z);if(Q?.isAlive())return{...Q.getRowPosition(),column:_.column};z=m_(this.beans,z)}return null}getAllCellCtrls(){let _=[],f=this.getAllRowCtrls(),$=f.length;for(let z=0;z<$;z++){let Q=f[z].getAllCellCtrls(),J=Q.length;for(let q=0;q{let Q=z.rowNode;return v9(Q,f)})}getCellCtrls(_,f){let $;if(v(f))$={},f.forEach((Q)=>{let J=this.colModel.getCol(Q);if(v(J))$[J.getId()]=!0});let z=[];for(let Q of this.getRowCtrls(_))for(let J of Q.getAllCellCtrls()){let q=J.column.getId();if($&&!$[q])continue;z.push(J)}return z}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(_=!1){let f=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(f,_),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){let _=[];for(let $ of Object.keys(this.rowCtrlsByRowIndex))if(this.rowCtrlsByRowIndex[$].rowNode.id==null)_.push($);this.removeRowCtrls(_);let f={};for(let $ of Object.values(this.rowCtrlsByRowIndex)){let z=$.rowNode;f[z.id]=$}return this.rowCtrlsByRowIndex={},f}removeRowCtrls(_,f=!1){for(let $ of _){let z=this.rowCtrlsByRowIndex[$];if(z)z.destroyFirstPass(f),z.destroySecondPass();delete this.rowCtrlsByRowIndex[$]}}onBodyScroll(_){if(_.direction!=="vertical")return;this.redraw({afterScroll:!0})}redraw(_={}){let{focusSvc:f,animationFrameSvc:$}=this.beans,{afterScroll:z}=_,Q,J=this.stickyRowFeature;if(J)Q=f?.getFocusCellToUseAfterRefresh()||void 0;let q=this.firstRenderedRow,X=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let Y=!1;if(J){Y=J.checkStickyRows();let G=J.extraTopHeight+J.extraBottomHeight;if(G)this.updateContainerHeights(G)}let Z=this.firstRenderedRow!==q||this.lastRenderedRow!==X;if(z&&!Y&&!Z)return;if(this.getLockOnRefresh(),this.recycleRows(null,!1,z),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(z&&!Y),Q!=null){let G=f?.getFocusCellToUseAfterRefresh();if(Q!=null&&G==null)$?.flushAllFrames(),this.restoreFocusedCell(Q)}}removeRowCompsNotToDraw(_,f){let $={};for(let J of _)$[J]=!0;let Q=Object.keys(this.rowCtrlsByRowIndex).filter((J)=>!$[J]);this.removeRowCtrls(Q,f)}calculateIndexesToDraw(_){let f=[];for(let q=this.firstRenderedRow;q<=this.lastRenderedRow;q++)f.push(q);let $=this.beans.pagination,z=this.beans.focusSvc?.getFocusedCell()?.rowIndex;if(z!=null&&(zthis.lastRenderedRow)&&(!$||$.isRowInPage(z))&&z{let X=q.rowNode.rowIndex;if(X==null||X===z)return;if(Xthis.lastRenderedRow){if(this.doNotUnVirtualiseRow(q))f.push(X)}};for(let q of Object.values(this.rowCtrlsByRowIndex))Q(q);if(_)for(let q of Object.values(_))Q(q);f.sort((q,X)=>q-X);let J=[];for(let q=0;q{this.destroyRowCtrls(_,f),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()});else this.destroyRowCtrls(_,f)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(_=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:_})}onDisplayedColumnsChanged(){let{visibleCols:_}=this.beans,f=_.isPinningLeft(),$=_.isPinningRight();if(this.pinningLeft!==f||$!==this.pinningRight){if(this.pinningLeft=f,this.pinningRight=$,this.embedFullWidthRows)this.redrawFullWidthEmbeddedRows()}}redrawFullWidthEmbeddedRows(){let _=[];for(let f of this.getFullWidthRowCtrls()){let $=f.rowNode.rowIndex;_.push($.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(_),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(_){let f=P9(_);return this.getAllRowCtrls().filter(($)=>{if(!$.isFullWidth())return!1;let z=$.rowNode;if(f!=null&&!v9(z,f))return!1;return!0})}createOrUpdateRowCtrl(_,f,$,z){let Q,J=this.rowCtrlsByRowIndex[_];if(!J){if(Q=this.rowModel.getRow(_),v(Q)&&v(f)&&f[Q.id]&&Q.alreadyRendered)J=f[Q.id],f[Q.id]=null}if(!J){if(!Q)Q=this.rowModel.getRow(_);if(v(Q))J=this.createRowCon(Q,$,z);else return}if(Q)Q.alreadyRendered=!0;this.rowCtrlsByRowIndex[_]=J}destroyRowCtrls(_,f){let $=[];if(_)for(let z of Object.values(_)){if(!z)continue;if(this.cachedRowCtrls&&z.isCacheable()){this.cachedRowCtrls.addRow(z);continue}if(z.destroyFirstPass(!f),f){let Q=z.instanceId;this.zombieRowCtrls[Q]=z,$.push(()=>{z.destroySecondPass(),delete this.zombieRowCtrls[Q]})}else z.destroySecondPass()}if(f)$.push(()=>{if(this.isAlive())this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),window.setTimeout(()=>{for(let z of $)z()},F3)}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){let _=this.getRowBuffer(),f=yq(this.beans);return _*f}workOutFirstAndLastRowsToRender(){let{rowContainerHeight:_,pageBounds:f,rowModel:$}=this;_.updateOffset();let z,Q;if(!$.isRowsToRender())z=0,Q=-1;else if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),z=f.getFirstRow(),Q=f.getLastRow();else{let G=this.getRowBufferInPixels(),E=this.ctrlsSvc.getScrollFeature(),U=this.gos.get("suppressRowVirtualisation"),H=!1,W,B;do{let M=f.getPixelOffset(),{pageFirstPixel:k,pageLastPixel:R}=f.getCurrentPagePixelRange(),O=_.divStretchOffset,I=E.getVScrollPosition(),T=I.top,y=I.bottom;if(U)W=k+O,B=R+O;else W=Math.max(T+M-G,k)+O,B=Math.min(y+M+G,R)+O;this.firstVisibleVPixel=Math.max(T+M,k)+O,this.lastVisibleVPixel=Math.min(y+M,R)+O,H=this.ensureAllRowsInRangeHaveHeightsCalculated(W,B)}while(H);let K=$.getRowIndexAtPixel(W),L=$.getRowIndexAtPixel(B),F=f.getFirstRow(),D=f.getLastRow();if(KD)L=D;z=K,Q=L}let J=S_(this.gos,"normal"),q=this.gos.get("suppressMaxRenderedRowRestriction"),X=Math.max(this.getRowBuffer(),500);if(J&&!q){if(Q-z>X)Q=z+X}let Y=z!==this.firstRenderedRow,Z=Q!==this.lastRenderedRow;if(Y||Z)this.firstRenderedRow=z,this.lastRenderedRow=Q,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:z,lastRow:Q})}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0,Y0(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})})}ensureAllRowsInRangeHaveHeightsCalculated(_,f){let $=this.pinnedRowModel?.ensureRowHeightsValid(),z=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:Q,rowModel:J}=this,q=J.ensureRowHeightsValid(_,f,Q.getFirstRow(),Q.getLastRow());if(q||z)this.eventSvc.dispatchEvent({type:"recalculateRowBounds"});if(z||q||$)return this.updateContainerHeights(),!0;return!1}doNotUnVirtualiseRow(_){let z=_.rowNode,Q=this.focusSvc.isRowFocused(z.rowIndex,z.rowPinned),J=this.editSvc?.isEditing(_),q=z.detail;if(!(Q||J||q))return!1;return this.isRowPresent(z)?!0:!1}isRowPresent(_){if(!this.rowModel.isRowPresent(_))return!1;return this.beans.pagination?.isRowInPage(_.rowIndex)??!0}createRowCon(_,f,$){let z=this.cachedRowCtrls?.getRow(_)??null;if(z)return z;let Q=$&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new u6(_,this.beans,f,Q,this.printLayout)}getRenderedNodes(){let _=Object.values(this.rowCtrlsByRowIndex).map((z)=>z.rowNode),f=this.getStickyTopRowCtrls().map((z)=>z.rowNode),$=this.getStickyBottomRowCtrls().map((z)=>z.rowNode);return[...f,..._,...$]}getRowByPosition(_){let f,{rowIndex:$}=_;switch(_.rowPinned){case"top":f=this.topRowCtrls[$];break;case"bottom":f=this.bottomRowCtrls[$];break;default:if(f=this.rowCtrlsByRowIndex[$],!f){if(f=this.getStickyTopRowCtrls().find((z)=>z.rowNode.rowIndex===$)||null,!f)f=this.getStickyBottomRowCtrls().find((z)=>z.rowNode.rowIndex===$)||null}break}return f}isRangeInRenderedViewport(_,f){if(_==null||f==null)return!1;let z=_>this.lastRenderedRow;return!(fthis.maxCount){let f=this.entriesList[0];f.destroyFirstPass(),f.destroySecondPass(),this.removeFromCache(f)}}getRow(_){if(_?.id==null)return null;let f=this.entriesMap[_.id];if(!f)return null;return this.removeFromCache(f),f.setCached(!1),f.rowNode!=_?null:f}has(_){return this.entriesMap[_.id]!=null}removeRow(_){let f=_.id,$=this.entriesMap[f];delete this.entriesMap[f],Q_(this.entriesList,$)}removeFromCache(_){let f=_.rowNode.id;delete this.entriesMap[f],Q_(this.entriesList,_)}getEntries(){return this.entriesList}};function P9(_){if(!_)return;let f={top:{},bottom:{},normal:{}};for(let $ of _){let z=$.id;switch($.rowPinned){case"top":f.top[z]=$;break;case"bottom":f.bottom[z]=$;break;default:f.normal[z]=$;break}}return f}function v9(_,f){let $=_.id;switch(_.rowPinned){case"top":return f.top[$]!=null;case"bottom":return f.bottom[$]!=null;default:return f.normal[$]!=null}}var k3=class extends A{constructor(){super(...arguments);this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=o(this.gos)?_1:S3,this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],this.updateOptions.bind(this));let _=this.updatePivotModeState.bind(this);this.addManagedEventListeners({columnPivotModeChanged:_,columnPivotChanged:_}),this.updateOptions(),_()}updateOptions(){this.accentedSort=!!this.gos.get("accentedSort"),this.primaryColumnsSortGroups=K0(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(_,f){return _.sort(($,z)=>this.compareRowNodes(f,$,z))}compareRowNodes(_,f,$){if(f===$)return 0;let z=this.accentedSort;for(let Q=0,J=_.length;Q{if(_.data)return _;let f=_.childrenAfterGroup;while(f?.length){let $=f[0];if($.data)return $;f=$.childrenAfterGroup}},T9=(_)=>{if(!_)return _;if(typeof _==="bigint")return _<0n?-_:_;let f=Number(_);return isNaN(f)?_:Math.abs(f)};function A3(_){_.sortSvc?.onSortChanged("api")}var Cf=(_,f)=>({tag:"span",ref:`eSort${_}`,cls:`ag-sort-indicator-icon ag-sort-${f} ag-hidden`,attrs:{"aria-hidden":"true"}}),R3={tag:"span",cls:"ag-sort-indicator-container",children:[Cf("Order","order"),Cf("Asc","ascending-icon"),Cf("Desc","descending-icon"),Cf("Mixed","mixed-icon"),Cf("AbsoluteAsc","absolute-ascending-icon"),Cf("AbsoluteDesc","absolute-descending-icon"),Cf("None","none-icon")]},rJ=class extends w{constructor(_){super();if(this.eSortOrder=V,this.eSortAsc=V,this.eSortDesc=V,this.eSortMixed=V,this.eSortNone=V,this.eSortAbsoluteAsc=V,this.eSortAbsoluteDesc=V,!_)this.setTemplate(R3)}attachCustomElements(_,f,$,z,Q,J,q){this.eSortOrder=_,this.eSortAsc=f,this.eSortDesc=$,this.eSortMixed=z,this.eSortNone=Q,this.eSortAbsoluteAsc=J,this.eSortAbsoluteDesc=q}setupSort(_,f=!1,$){if(this.column=_,this.suppressOrder=f,this.getSortDefOverride=$,this.setupMultiSortIndicator(),!_.isSortable()&&!_.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,_),this.addInIcon("sortDescending",this.eSortDesc,_),this.addInIcon("sortUnSort",this.eSortNone,_),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,_),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,_);let z=this.updateIcons.bind(this),Q=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",z),this.addManagedEventListeners({newColumnsLoaded:z,sortChanged:Q,columnRowGroupChanged:Q}),this.onSortChanged()}addInIcon(_,f,$){if(f==null)return;let z=h(_,this.beans,$);if(z)f.appendChild(z)}onSortChanged(){if(this.updateIcons(),!this.suppressOrder)this.updateSortOrder()}updateIcons(){let{eSortAsc:_,eSortDesc:f,eSortAbsoluteAsc:$,eSortAbsoluteDesc:z,eSortNone:Q,column:J,gos:q,beans:X}=this,Y=EJ(J,X,this.getSortDefOverride),Z=Y.isDefaultSortAllowed,G=Y.isAbsoluteSortAllowed,{isAbsoluteSort:E,isDefaultSort:U,isAscending:H,isDescending:W,direction:B}=Y;if(_)N(_,H&&U&&Z,{skipAriaHidden:!0});if(f)N(f,W&&U&&Z,{skipAriaHidden:!0});if(Q){let K=!J.getColDef().unSortIcon&&!q.get("unSortIcon");N(Q,!K&&!B,{skipAriaHidden:!0})}if($)N($,H&&E&&G,{skipAriaHidden:!0});if(z)N(z,W&&E&&G,{skipAriaHidden:!0})}setupMultiSortIndicator(){let{eSortMixed:_,column:f,gos:$}=this;this.addInIcon("sortUnSort",_,f);let z=f.getColDef().showRowGroup;if(K0($)&&z)this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator()}updateMultiSortIndicator(){let{eSortMixed:_,beans:f,column:$}=this;if(_){let z=f.sortSvc.getDisplaySortForColumn($)?.direction==="mixed";N(_,z,{skipAriaHidden:!0})}}updateSortOrder(){let{eSortOrder:_,column:f,beans:{sortSvc:$}}=this;if(!_)return;let z=$.getColumnsWithSortingOrdered(),Q=$.getDisplaySortIndexForColumn(f)??-1,J=z.some((X)=>$.getDisplaySortIndexForColumn(X)??!1),q=Q>=0&&J;if(N(_,q,{skipAriaHidden:!0}),Q>=0)_.textContent=(Q+1).toString();else f_(_)}refresh(){this.onSortChanged()}},j3={selector:"AG-SORT-INDICATOR",component:rJ},V3=class extends A{constructor(){super(...arguments);this.beanName="sortSvc"}progressSort(_,f,$){let z=this.getNextSortDirection(_);this.setSortForColumn(_,z,f,$)}progressSortFromEvent(_,f){let z=this.gos.get("multiSortKey")==="ctrl"?f.ctrlKey||f.metaKey:f.shiftKey;this.progressSort(_,z,"uiColumnSorted")}setSortForColumn(_,f,$,z){let{gos:Q,showRowGroupCols:J}=this.beans,q=K0(Q),X=[_];if(q){if(_.getColDef().showRowGroup){let E=J?.getSourceColumnsForGroupColumn?.(_)?.filter((U)=>U.isSortable());if(E)X=[_,...E]}}for(let G of X)this.setColSort(G,f,z);let Y=($||Q.get("alwaysMultiSort"))&&!Q.get("suppressMultiSort"),Z=[];if(!Y){let G=this.clearSortBarTheseColumns(X,z);Z.push(...G)}this.updateSortIndex(_),Z.push(...X),this.dispatchSortChangedEvents(z,Z)}updateSortIndex(_){let{gos:f,colModel:$,showRowGroupCols:z}=this.beans,Q=K0(f),J=z?.getShowRowGroupCol(_.getId()),q=Q?J||_:_,X=this.getColumnsWithSortingOrdered();$.forAllCols((G)=>this.setColSortIndex(G,null));let Y=X.filter((G)=>{if(Q&&G.getColDef().showRowGroup)return!1;return G!==q});(q.getSortDef()?[...Y,q]:Y).forEach((G,E)=>this.setColSortIndex(G,E))}onSortChanged(_,f){this.dispatchSortChangedEvents(_,f)}isSortActive(){let _=!1;return this.beans.colModel.forAllCols((f)=>{if(f.getSortDef())return _=!0,!0}),_}dispatchSortChangedEvents(_,f){let $={type:"sortChanged",source:_};if(f)$.columns=f;this.eventSvc.dispatchEvent($)}clearSortBarTheseColumns(_,f){let $=[];return this.beans.colModel.forAllCols((z)=>{if(!_.includes(z)){if(z.getSortDef())$.push(z);this.setColSort(z,void 0,f)}}),$}getNextSortDirection(_,f){let $=_.getSortingOrder(),z=f===void 0?_.getSortDef():e_(f),J=$.findIndex((q)=>Ez(q,z))+1;if(J>=$.length)J=0;return e_($[J])}getIndexedSortMap(){let{gos:_,colModel:f,showRowGroupCols:$,rowGroupColsSvc:z}=this.beans,Q=[];if(f.forAllCols((Z)=>{if(Z.getSortDef())Q.push(Z)}),f.isPivotMode()){let Z=K0(_);Q=Q.filter((G)=>{let E=!!G.getAggFunc(),U=!G.isPrimary(),H=Z?$?.getShowRowGroupCol(G.getId()):G.getColDef().showRowGroup;return E||U||H})}let J=z?.columns.filter((Z)=>!!Z.getSortDef())??[],q={};Q.forEach((Z,G)=>q[Z.getId()]=G),Q.sort((Z,G)=>{let E=Z.getSortIndex(),U=G.getSortIndex();if(E!=null&&U!=null)return E-U;else if(E==null&&U==null){let H=q[Z.getId()],W=q[G.getId()];return H>W?1:-1}else if(U==null)return-1;else return 1});let X=K0(_)&&!!J.length;if(X)Q=[...new Set(Q.map((Z)=>$?.getShowRowGroupCol(Z.getId())??Z))];let Y=new Map;if(Q.forEach((Z,G)=>Y.set(Z,G)),X)for(let Z of J){let G=$.getShowRowGroupCol(Z.getId());Y.set(Z,Y.get(G))}return Y}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,_],[,f])=>_-f).map(([_])=>_)}collectSortItems(_=!1){let f=[],$=this.getColumnsWithSortingOrdered();for(let z of $){let Q=z.getSortDef()?.direction;if(!Q)continue;let J=M0(z.getSortDef()?.type),q={sort:Q,type:J};if(_)q.colId=z.getId();else q.column=z;f.push(q)}return f}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(_){let f=K0(this.gos),$=!!_.getColDef().showRowGroup;return f&&$}getDisplaySortForColumn(_){let f=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(_);if(!this.canColumnDisplayMixedSort(_)||!f?.length)return _.getSortDef();let z=_.getColDef().field!=null||!!_.getColDef().valueGetter?[_,...f]:f,Q=z[0].getSortDef();if(!z.every((q)=>Ez(q.getSortDef(),Q)))return{type:M0(_.getSortDef()?.type),direction:"mixed"};return Q}getDisplaySortIndexForColumn(_){return this.getIndexedSortMap().get(_)}setupHeader(_,f){let $=()=>{let{type:z,direction:Q}=e_(f.getSortDef());if(_.toggleCss("ag-header-cell-sorted-asc",Q==="asc"),_.toggleCss("ag-header-cell-sorted-desc",Q==="desc"),_.toggleCss("ag-header-cell-sorted-abs-asc",z==="absolute"&&Q==="asc"),_.toggleCss("ag-header-cell-sorted-abs-desc",z==="absolute"&&Q==="desc"),_.toggleCss("ag-header-cell-sorted-none",!Q),f.getColDef().showRowGroup){let X=!this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(f)?.every((Y)=>Q==Y.getSortDef()?.direction);_.toggleCss("ag-header-cell-sorted-mixed",X)}};_.addManagedEventListeners({sortChanged:$,columnPinned:$,columnRowGroupChanged:$,displayedColumnsChanged:$})}initCol(_){let{sortIndex:f,initialSortIndex:$}=_.colDef,z=sq(_.colDef);if(z)_.setSortDef(z,!0);if(f!==void 0){if(f!==null)_.sortIndex=f}else if($!==null)_.sortIndex=$}updateColSort(_,f,$){if(f===void 0)return;this.setColSort(_,e_(f),$)}setColSort(_,f,$){if(!Ez(_.getSortDef(),f))_.setSortDef(e_(f),f===void 0),_.dispatchColEvent("sortChanged",$);_.dispatchStateUpdatedEvent("sort")}setColSortIndex(_,f){_.sortIndex=f,_.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(_){return new rJ(_)}getSortIndicatorSelector(){return j3}},k5={moduleName:"Sort",version:c,beans:[V3,k3],apiFunctions:{onSortChanged:A3},userComponents:{agSortIndicator:rJ},icons:{sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc"}},O3=class extends A{constructor(){super(...arguments);this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",(_)=>this.setColumnDefs(_))}start(){this.beans.ctrlsSvc.whenReady(this,()=>{let _=this.gos.get("columnDefs");if(_)this.setColumnsAndData(_);else this.waitingForColumns=!0;this.gridReady()})}setColumnsAndData(_){let{colModel:f,rowModel:$}=this.beans;f.setColumnDefs(_??[],"gridInitializing"),$.start()}gridReady(){let{eventSvc:_,gos:f}=this;_.dispatchEvent({type:"gridReady"}),q$(f,`initialised successfully, enterprise = ${f.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(_){let f=this.gos.get("columnDefs");if(!f)return;if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(f);return}this.beans.colModel.setColumnDefs(f,Uf(_.source))}};var P3="paste",v3=class extends A{constructor(){super(...arguments);this.beanName="changeDetectionSvc",this.deferredDepth=0,this.batchedPath=null,this.batchedNodes=null}destroy(){super.destroy(),this.batchedPath=null,this.batchedNodes=null}postConstruct(){this.csrm=kJ(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(this.deferredDepth===0)return;if(--this.deferredDepth>0)return;let _=this.batchedPath,f=this.batchedNodes;if(this.batchedPath=null,this.batchedNodes=null,_)this.csrm?.doAggregate(_);let{rowRenderer:$}=this.beans;if(f)for(let z of f)I9($,z);if(_){let z=_.getSortedRows();for(let Q=0,J=z.length;Q{let{sibling:$,pinnedSibling:z}=f;_.refreshRowByNode(f),_.refreshRowByNode($),_.refreshRowByNode(z),_.refreshRowByNode($?.pinnedSibling),_.refreshRowByNode(z?.sibling)},T3=class extends A{constructor(){super(...arguments);this.beanName="expressionSvc",this.cache={}}evaluate(_,f){if(typeof _==="string")return this.evaluateExpression(_,f);else e(15,{expression:_})}evaluateExpression(_,f){try{return this.createExpressionFunction(_)(f.value,f.context,f.oldValue,f.newValue,f.value,f.node,f.data,f.colDef,f.rowIndex,f.api,f.getValue,f.column,f.columnGroup)}catch($){return e(16,{expression:_,params:f,e:$}),null}}createExpressionFunction(_){let f=this.cache;if(f[_])return f[_];let $=this.createFunctionBody(_),z=Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",$);return f[_]=z,z}createFunctionBody(_){if(_.includes("return"))return _;else return"return "+_+";"}};var I3={moduleName:"Expression",version:c,beans:[T3]},y3={moduleName:"ChangeDetection",version:c,beans:[v3]};var b3=class extends A{constructor(){super(...arguments);this.beanName="valueSvc",this.initialised=!1,this.isSsrm=!1}wireBeans(_){this.expressionSvc=_.expressionSvc,this.colModel=_.colModel,this.valueCache=_.valueCache,this.dataTypeSvc=_.dataTypeSvc,this.editSvc=_.editSvc,this.formulaDataSvc=_.formulaDataSvc,this.rowGroupColsSvc=_.rowGroupColsSvc}postConstruct(){if(!this.initialised)this.init()}init(){let{gos:_,valueCache:f}=this;this.executeValueGetter=f?this.executeValueGetterWithValueCache.bind(this):this.executeValueGetterWithoutValueCache.bind(this),this.isSsrm=Kf(_),this.cellExpressions=_.get("enableCellExpressions"),this.isTreeData=_.get("treeData"),this.initialised=!0;let $=(z)=>this.callColumnCellValueChangedHandler(z);this.eventSvc.addListener("cellValueChanged",$,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",$,!0)),this.addManagedPropertyListener("treeData",(z)=>this.isTreeData=z.currentValue)}getValueForDisplay(_){let f=this.beans,$=_.column,z=_.node,Q=f.showRowGroupColValueSvc,J=!$&&z.group,q=$?.colDef.showRowGroup,X=!this.isTreeData||z.footer;if(Q&&X&&(J||q)){let U=Q.getGroupValue(z,$,this.displayIgnoresAggData(z));if(U==null)return{value:null,valueFormatted:null};return{value:U.value,valueFormatted:_.includeValueFormatted?Q.formatAndPrefixGroupColValue(U,$,_.exporting):null}}if(!$)return{value:z.key,valueFormatted:null};let Y=this.getValue($,z,_.from,this.displayIgnoresAggData(z)),Z=Y,G=f.formula;if($.isAllowFormula()&&G?.isFormula(Y))if(_.useRawFormula)Y=G.normaliseFormula(Y,!0),Z=G.resolveValue($,z);else Y=G.resolveValue($,z),Z=Y;let E=_.includeValueFormatted&&!(_.exporting&&$.colDef.useValueFormatterForExport===!1);return{value:Y,valueFormatted:E?this.formatValue($,z,Z):null}}getValue(_,f,$,z=!1){if(!this.initialised)this.init();if(!f)return;let Q=_.colDef,J=f.group;if(!J){let Y=Q.pivotValueColumn;if(Y)_=Y}let q=this.editSvc?.getPendingEditValue(f,_,$);if(q!==void 0)return q;let X=this.resolveValue(_,f,z,J);if(X===void 0){if(J){let Y=Q.showRowGroup;if(typeof Y==="string"){let Z=this.rowGroupColsSvc?.getColumnIndex(Y);if(Z!=null&&Z>f.level)return null}}return}if(this.cellExpressions&&Kz(X)){let Y=X.substring(1);X=this.executeValueGetter(Y,f.data,_,f)}return X}displayIgnoresAggData(_){if(!_.group||_.footer||_.level===-1)return!1;if(!_.sibling||this.gos.get("groupSuppressBlankHeader"))return!1;if(_.leafGroup&&this.colModel.isPivotMode())return!1;return!!_.expanded}resolveValue(_,f,$,z){let{colDef:Q,colId:J}=_,q=!z&&this.formulaDataSvc;if(q&&q.hasDataSource()&&Q.allowFormula===!0){let F=q.getFormula({column:_,rowNode:f});if(Kz(F))return F}let X=z&&!$?f.aggData:void 0,Y=this.isTreeData;if(Y&&X?.[J]!==void 0)return X[J];let Z=f.data,G=Q.field,E=Q.valueGetter;if(Y){if(E)return this.executeValueGetter(E,Z,_,f);if(G&&Z)return e1(Z,G,_.isFieldContainsDots())}let U=f.groupData;if(U&&J in U)return U[J];if(X?.[J]!==void 0)return X[J];let H=Q.showRowGroup,W=typeof H!=="string"||!z,B=this.isSsrm,K=B&&$&&!!Q.aggFunc;if(E&&!K)return W?this.executeValueGetter(E,Z,_,f):void 0;if(B&&f.footer&&f.field&&(H===!0||H===f.field))return e1(Z,f.field,_.isFieldContainsDots());if(G&&Z&&!K)return W?e1(Z,G,_.isFieldContainsDots()):void 0;return}parseValue(_,f,$,z){let Q=_.getColDef();if(Q.allowFormula&&this.beans.formula?.isFormula($))return $;let J=Q.valueParser;if(v(J)){let q=C(this.gos,{node:f,data:f?.data,oldValue:z,newValue:$,colDef:Q,column:_});if(typeof J==="function")return J(q);return this.expressionSvc?.evaluate(J,q)}return $}getDeleteValue(_,f){if(v(_.getColDef().valueParser))return this.parseValue(_,f,"",this.getValueForDisplay({column:_,node:f,from:"edit"}).value)??null;return null}formatValue(_,f,$,z,Q=!0){let{expressionSvc:J}=this.beans,q=null,X,Y=_.getColDef();if(z)X=z;else if(Q)X=Y.valueFormatter;if(X){let Z=f?f.data:null,G=C(this.gos,{value:$,node:f,data:Z,colDef:Y,column:_});if(typeof X==="function")q=X(G);else q=J?J.evaluate(X,G):null}else if(Y.refData)return Y.refData[$]||"";if(q==null&&Array.isArray($))q=$.join(", ");return q}setValue(_,f,$,z){let Q=f.getColDef();if(!_.data&&this.canCreateRowNodeData(_,Q))_.data={};if(!this.isSetValueSupported(f,_,$,Q))return!1;let J=this.getValue(f,_,"data"),q=C(this.gos,{node:_,data:_.data,oldValue:J,newValue:$,colDef:Q,column:f}),X=!1;if(_.data){let Z=this.handleExternalFormulaChange({column:f,eventSource:z,newValue:$,setterParams:q,rowNode:_});if(Z!==null)return Z;X=this.computeValueChange({column:f,rowNode:_,newValue:$,params:q,rowData:_.data,valueSetter:Q.valueSetter,field:Q.field})??!0}let Y=this.beans.changeDetectionSvc;Y?.beginDeferred();try{if(_.group){let Z=this.beans.rowGroupingEditValueSvc?.setGroupDataValue(_,f,$,J,z,X||$!==J);if(Z!==void 0){if(!X&&!Z)return!1;return this.finishValueChange(_,f,q,z,$)}}if(!X)return!1;return this.finishValueChange(_,f,q,z)}finally{Y?.endDeferred()}}canCreateRowNodeData(_,f){if(!_.group)return!0;if(f.groupRowValueSetter!=null||f.groupRowEditable!=null)return!1;if(f.pivotValueColumn)return!1;return!0}finishValueChange(_,f,$,z,Q){_.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();let J=Q===void 0?this.getValue(f,_,"data"):Q;if(this.dispatchCellValueChangedEvent(_,$,J,z),_.pinnedSibling)this.dispatchCellValueChangedEvent(_.pinnedSibling,$,J,z);return!0}isSetValueSupported(_,f,$,z){let{field:Q,valueSetter:J}=z,q=this.beans.formula,X=_.isAllowFormula()&&q?.isFormula($),Y=!!this.formulaDataSvc?.hasDataSource();if(n(Q)&&n(J)&&!(Y&&X)){if(f.group&&(z.groupRowValueSetter||z.groupRowEditable))return!0;return j(17),!1}if(this.dataTypeSvc&&!this.dataTypeSvc.checkType(_,$))return j(135),!1;return!0}handleExternalFormulaChange(_){let{column:f,rowNode:$,newValue:z,eventSource:Q,setterParams:J}=_,q=this.beans.formula,X=this.formulaDataSvc;if(!X?.hasDataSource()||!f.isAllowFormula())return null;let Y=q?.isFormula(z),Z=X.getFormula({column:f,rowNode:$});if(Y){if(Z===z)return!1;X.setFormula({column:f,rowNode:$,formula:z});let E=q?.resolveValue(f,$),U=f.getColDef();if(v(U.valueSetter)||!n(U.field)){let H={...J,newValue:E};this.computeValueChange({column:f,rowNode:$,newValue:E,params:H,rowData:$.data,valueSetter:U.valueSetter,field:U.field})}return this.finishValueChange($,f,J,Q)}if(Z!==void 0)X.setFormula({column:f,rowNode:$,formula:void 0});return null}computeValueChange(_){let{valueSetter:f,params:$,rowData:z,field:Q,column:J,newValue:q}=_;if(v(f)){if(typeof f==="function")return f($);return this.expressionSvc?.evaluate(f,$)}return!!z&&this.setValueUsingField(z,Q,q,J.isFieldContainsDots())}dispatchCellValueChangedEvent(_,f,$,z){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:_.rowIndex,rowPinned:_.rowPinned,column:f.column,colDef:f.colDef,data:_.data,node:_,oldValue:f.oldValue,newValue:$,newRawValue:f.newValue,value:$,source:z})}callColumnCellValueChangedHandler(_){let f=_.colDef.onCellValueChanged;if(typeof f==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>{f(_)})}setValueUsingField(_,f,$,z){if(!f)return!1;let Q=!1;if(!z){if(Q=_[f]===$,!Q)_[f]=$}else{let J=f.split("."),q=_;while(J.length>0&&q){let X=J.shift();if(J.length===0){if(Q=q[X]===$,!Q)q[X]=$}else q=q[X]}}return!Q}executeValueGetterWithValueCache(_,f,$,z){let Q=$.getColId(),J=this.valueCache.getValue(z,Q);if(J!==void 0)return J;let q=this.executeValueGetterWithoutValueCache(_,f,$,z);return this.valueCache.setValue(z,Q,q),q}executeValueGetterWithoutValueCache(_,f,$,z){let Q=C(this.gos,{data:f,node:z,column:$,colDef:$.getColDef(),getValue:(q)=>this.getValueCallback(z,q)}),J;if(typeof _==="function")J=_(Q);else J=this.expressionSvc?.evaluate(_,Q);return J}getValueCallback(_,f){let $=this.colModel.getColDefCol(f);if($)return this.getValue($,_,"data");return null}getKeyForNode(_,f){let $=this.getValue(_,f,"data"),z=_.getColDef().keyCreator,Q=$;if(z){let J=C(this.gos,{value:$,colDef:_.getColDef(),column:_,node:f,data:f.data});Q=z(J)}if(typeof Q==="string"||Q==null)return Q;if(Q=String(Q),Q==="[object Object]")j(121);return Q}},C3={moduleName:"CommunityCore",version:c,beans:[kW,YE,aU,r7,L3,HU,BW,mW,FU,iB,uB,D3,b3,DW,HW,MW,eU,O3,pU,nU,_B],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:ZE,destroy:GE,isDestroyed:EE,getGridOption:UE,setGridOption:HE,updateGridOptions:wX,isModuleRegistered:WE},dependsOn:[mU,I$,oE,k5,sW,NJ,aW,K3,y3,eW,f1,nB,rB,zB,rU,cU,I3,vU,aB]};function i6(_){let{inputValue:f,allSuggestions:$,hideIrrelevant:z,filterByPercentageOfBestMatch:Q}=_,J=($??[]).map((Y,Z)=>({value:Y,relevance:w3(f,Y),idx:Z}));if(J.sort((Y,Z)=>Y.relevance-Z.relevance),z)J=J.filter((Y)=>Y.relevance0&&Q&&Q>0){let Z=J[0].relevance*Q;J=J.filter((G)=>Z-G.relevance<0)}let q=[],X=[];for(let Y of J)q.push(Y.value),X.push(Y.idx);return{values:q,indices:X}}function w3(_,f){let $=_.length,z=f.length;if(z===0)return $?$:0;let Q=_.toLocaleLowerCase(),J=f.toLocaleLowerCase(),q;if(_.length1&&W>1){let L=_[E-2],F=Q[E-2],D=f[W-2],M=J[W-2];if(F===M){if(Z++,L===D)Z++}}if(E`No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule: +`;for(let Y of this.cssImports??[])$=`@import url(${JSON.stringify(Y)}); +${$}`;Z={css:$,class:X}}else Z=!1;this._inject=Z}if(Z&&Q)Nz(Z.css,Q,Z.class,z,1,J);return Z?Z.class:!1}},fW=(Q)=>Q.replace(/[A-Z]|\d+/g,(z)=>`-${z}`).toLowerCase(),M6=(Q)=>`--ag-${fW(Q)}`,vQ=(Q)=>`var(${M6(Q)})`,AW=(Q,z,J)=>Math.max(z,Math.min(J,Q)),jW=(Q)=>{let z=new Map;return(J)=>{let Z=J;if(!z.has(Z))z.set(Z,Q(J));return z.get(Z)}},fQ=(Q)=>({ref:"accentColor",mix:Q}),r0=(Q)=>({ref:"foregroundColor",mix:Q}),o0=(Q)=>({ref:"foregroundColor",mix:Q,onto:"backgroundColor"}),RW=(Q)=>({ref:"foregroundColor",mix:Q,onto:"headerBackgroundColor"}),x0={ref:"backgroundColor"},Tz={ref:"foregroundColor"},AQ={ref:"accentColor"},WZ={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:r0(0.15),chromeBackgroundColor:o0(0.02),browserColorScheme:"light"},SW={...WZ,textColor:Tz,accentColor:"#2196f3",invalidColor:"#e02525",fontFamily:["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],subtleTextColor:{ref:"textColor",mix:0.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,fontWeight:"inherit",focusShadow:{spread:3,color:fQ(0.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:0.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:x0,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:0.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:AQ,toggleButtonOffBackgroundColor:o0(0.3),toggleButtonSwitchBackgroundColor:x0,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:0.25}},panelBackgroundColor:x0,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,dialogShadow:{ref:"popupShadow"},dialogBorder:{color:r0(0.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:r0(0.2)},menuBackgroundColor:o0(0.03),menuTextColor:o0(0.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},OW=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],PW=jW((Q)=>{return Q=Q.toLowerCase(),OW.find((z)=>Q.endsWith(z.toLowerCase()))??"length"}),pZ=(Q)=>{if(typeof Q==="object"&&Q?.ref)return vQ(Q.ref);if(typeof Q==="string")return Q;if(typeof Q==="number")return String(Q);return!1},k6=(Q)=>{if(typeof Q==="string")return Q;if(typeof Q==="object"&&Q&&"ref"in Q){let z=vQ(Q.ref);if(Q.mix==null)return z;return`color-mix(in srgb, ${Q.onto?vQ(Q.onto):"transparent"}, ${z} ${AW(Q.mix*100,0,100)}%)`}return!1},TW=pZ,X1=(Q)=>{if(typeof Q==="string")return Q;if(typeof Q==="number")return`${Q}px`;if(typeof Q==="object"&&Q&&"calc"in Q)return`calc(${Q.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,(J)=>J[0]==="-"?J:" "+vQ(J)+" ")})`;if(typeof Q==="object"&&Q&&"ref"in Q)return vQ(Q.ref);return!1},vW=pZ,E5=(Q,z)=>{if(typeof Q==="string")return Q;if(Q===!0)return E5({},z);if(Q===!1)return z==="columnBorder"?E5({color:"transparent"},z):"none";if(typeof Q==="object"&&Q&&"ref"in Q)return vQ(Q.ref);return P$(Q.style??"solid")+" "+X1(Q.width??{ref:"borderWidth"})+" "+k6(Q.color??{ref:"borderColor"})},u7=(Q)=>{return[X1(Q.offsetX??0),X1(Q.offsetY??0),X1(Q.radius??0),X1(Q.spread??0),k6(Q.color??{ref:"foregroundColor"}),...Q.inset?["inset"]:[]].join(" ")},IW=(Q)=>{if(typeof Q==="string")return Q;if(Q===!1)return"none";if(typeof Q==="object"&&Q&&"ref"in Q)return vQ(Q.ref);if(Array.isArray(Q))return Q.map(u7).join(", ");return u7(Q)},P$=pZ,T$=(Q)=>{if(typeof Q==="string")return Q.includes(",")?Q:m7(Q);if(typeof Q==="object"&&Q&&"googleFont"in Q)return T$(Q.googleFont);if(typeof Q==="object"&&Q&&"ref"in Q)return vQ(Q.ref);if(Array.isArray(Q))return Q.map((z)=>{if(typeof z==="object"&&"googleFont"in z)z=z.googleFont;return m7(z)}).join(", ");return!1},m7=(Q)=>/^[\w-]+$|\w\(/.test(Q)?Q:JSON.stringify(Q),CW=pZ,v$=(Q)=>{if(typeof Q==="string")return Q;if(typeof Q==="object"&&Q&&"url"in Q)return`url(${JSON.stringify(Q.url)})`;if(typeof Q==="object"&&Q&&"svg"in Q)return v$({url:`data:image/svg+xml,${encodeURIComponent(Q.svg)}`});if(typeof Q==="object"&&Q&&"ref"in Q)return vQ(Q.ref);return!1},bW=(Q,z,J)=>{if(typeof Q==="string")return Q;if(typeof Q==="number"){if(Q>=10)J?.warn(104,{value:Q,param:z});return`${Q}s`}if(typeof Q==="object"&&Q&&"ref"in Q)return vQ(Q.ref);return!1},yW={color:k6,colorScheme:TW,length:X1,scale:vW,border:E5,borderStyle:P$,shadow:IW,image:v$,fontFamily:T$,fontWeight:CW,duration:bW},xW=(Q,z,J)=>{let Z=PW(Q);return yW[Z](z,Q,J)};var wW=(Q,z)=>new I$({themeLogger:Q,overridePrefix:z}),I$=class Q{constructor(z,J=[]){this.params=z,this.parts=J}withPart(z){if(typeof z==="function")z=z();if(!(z instanceof O$))return this.params.themeLogger.preInitErr(259,"Invalid part",{part:z}),this;return new Q(this.params,[...this.parts,z])}withoutPart(z){return this.withPart(FQ({feature:z}))}withParams(z,J=oQ){return this.withPart(FQ({modeParams:{[J]:z}}))}_startUse({styleContainer:z,cssLayer:J,nonce:Z,loadThemeGoogleFonts:$,moduleCss:X}){if(D6)return;if(UZ)return;gW(),R$(z,J,Z,X);let Y=NW(this);if(Y.length>0){for(let G of Y)if($)hW(G,Z)}for(let G of this.parts)G.use(z,J,Z)}_getCssClass(){if(UZ)return"ag-theme-quartz";return this._cssClassCache??(this._cssClassCache=c7(this.parts).map((z)=>z.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName=`ag-theme-params-${++S$().paramsId}`)}_getModeParams(){let z=this._paramsCache;if(!z){let J={[oQ]:{...SW}};for(let Z of c7(this.parts))for(let $ of Object.keys(Z.modeParams)){let X=Z.modeParams[$];if(X){let Y=J[$]??(J[$]={}),G=new Set;for(let q of Object.keys(X)){let H=X[q];if(H!==void 0)Y[q]=H,G.add(q)}if($===oQ)for(let q of Object.keys(J)){let H=J[q];if(q!==oQ)for(let _ of G)delete H[_]}}}this._paramsCache=z=J}return z}_getParamsCss(){if(!this._paramsCssCache){let z="",J="",Z=this._getModeParams(),{overridePrefix:$,themeLogger:X}=this.params,Y=$?`--ag-${$}-`:void 0;for(let H of Object.keys(Z)){let _=Z[H];if(H!==oQ){let W=`:where([data-ag-theme-mode="${typeof CSS==="object"?CSS.escape(H):H}"]) & { +`;z+=W,J+=W}for(let U of Object.keys(_).sort()){let W=_[U],B=xW(U,W,X);if(B===!1)X.error(107,{key:U,value:W});else{let E=M6(U),K=Y?E.replace("--ag-",Y):E,L=E.replace("--ag-","--ag-inherited-");z+=` ${E}: var(${L}, ${B}); +`,J+=` ${L}: var(${K}); +`}}if(H!==oQ)z+=`} +`,J+=`} +`}let G=`:where(.${this._getParamsClassName()})`,q=`${G} { +${z}} +`;q+=`:has(> ${G}):not(${G}) { +${J}} +`,this._paramsCssCache=q}return this._paramsCssCache}},c7=(Q)=>{let z=new Map;for(let Z of Q)z.set(Z.feature,Z);let J=[];for(let Z of Q)if(!Z.feature||z.get(Z.feature)===Z)J.push(Z);return J},NW=(Q)=>{let z=new Set,J=(X)=>{if(Array.isArray(X))X.forEach(J);else{let Y=X?.googleFont;if(typeof Y==="string")z.add(Y)}};return Object.values(Q._getModeParams()).flatMap((X)=>Object.values(X)).forEach(J),Array.from(z).sort()},p7=!1,gW=()=>{if(p7)return;p7=!0;for(let Q of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))Q.remove()},hW=async(Q,z)=>{let J=`@import url('https://${uW}/css2?family=${encodeURIComponent(Q)}:wght@100;200;300;400;500;600;700;800;900&display=swap'); +`;Nz(J,document.head,`googleFont:${Q}`,void 0,0,z)},uW="fonts.googleapis.com",i7={changeKey:"listItemHeight",type:"length",defaultValue:24},mW=class extends j0{constructor(){super(...arguments);this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(Q){this.eRootDiv=Q.eRootDiv}postConstruct(){let{gos:Q,eRootDiv:z}=this;Q.setInstanceDomData(z);let J=Q.get("themeStyleContainer"),Z=typeof ShadowRoot<"u",$=Z&&z.getRootNode()instanceof ShadowRoot;if(this.eStyleContainer=(typeof J==="function"?J():J)??($?z:document.head),!J&&!$&&Z)cW(z,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this));this.cssLayer=Q.get("themeCssLayer"),this.styleNonce=Q.get("styleNonce"),this.addManagedPropertyListener("theme",()=>this.handleThemeChange()),this.handleThemeChange(),this.getSizeEl(i7),this.initVariables(),this.addDestroyFunc(()=>kW(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(Q,z=[]){let{theme:J}=this,Z=J?J._getCssClass():this.applyLegacyThemeClasses();for(let $ of Array.from(Q.classList))if($.startsWith("ag-theme-"))Q.classList.remove($);if(Z){let $=Q.className;Q.className=`${$}${$?" ":""}${Z}${z?.length?" "+z.join(" "):""}`}}applyLegacyThemeClasses(){let Q="";this.mutationObserver.disconnect();let z=this.eRootDiv;while(z){let J=!1;for(let Z of Array.from(z.classList))if(Z.startsWith("ag-theme-"))J=!0,Q=Q?`${Q} ${Z}`:Z;if(J)this.mutationObserver.observe(z,{attributes:!0,attributeFilter:["class"]});z=z.parentElement}return Q}addGlobalCSS(Q,z){if(this.theme)Nz(Q,this.eStyleContainer,z,this.cssLayer,0,this.styleNonce);else this.globalCSS.push([Q,z])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(i7)}getCSSVariablePixelValue(Q){let z=this.lastKnownValues.get(Q);if(z!=null)return z;let J=this.measureSizeEl(Q);if(J==="detached"||J==="no-styles"){if(Q.cacheDefault)this.lastKnownValues.set(Q,Q.defaultValue);return Q.defaultValue}return this.lastKnownValues.set(Q,J),J}measureSizeEl(Q){let z=this.getSizeEl(Q);if(z.offsetParent==null)return"detached";let J=z.offsetWidth;if(J===n2)return"no-styles";return this.sizesMeasured=!0,J}getMeasurementContainer(){let Q=this.eMeasurementContainer;if(!Q)Q=this.eMeasurementContainer=K0({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(Q);return Q}getSizeEl(Q){let z=this.sizeEls.get(Q);if(z)return z;let J=this.getMeasurementContainer();z=K0({tag:"div"});let Z=this.setSizeElStyles(z,Q);J.appendChild(z),this.sizeEls.set(Q,z);let{type:$,noWarn:X}=Q;if($!=="length"&&$!=="border")return z;let Y=this.measureSizeEl(Q);if(Y==="no-styles"&&!X)this.varError(Z,Q.defaultValue);let G=DQ(this.beans,z,()=>{let q=this.measureSizeEl(Q);if(q==="detached"||q==="no-styles")return;if(this.lastKnownValues.set(Q,q),q!==Y)Y=q,this.fireStylesChangedEvent(Q.changeKey)});return this.addDestroyFunc(()=>G()),z}setSizeElStyles(Q,z){let{changeKey:J,type:Z}=z,$=M6(J);if(Z==="border"){if($.endsWith("-width"))$=$.slice(0,-6);Q.className="ag-measurement-element-border",Q.style.setProperty("--ag-internal-measurement-border",`var(${$}, solid ${n2}px)`)}else Q.style.width=`var(${$}, ${n2}px)`;return $}handleThemeChange(){let{gos:Q,theme:z}=this,J=Q.get("theme"),Z;if(J==="legacy")Z=void 0;else{let $=J??this.getDefaultTheme();if($ instanceof I$)Z=$;else this.themeError($)}if(Z!==z)this.handleNewTheme(Z);this.postProcessThemeChange(Z,J)}handleNewTheme(Q){let{gos:z,eRootDiv:J,globalCSS:Z}=this,$=this.getAdditionalCss();if(Q){R$(this.eStyleContainer,this.cssLayer,this.styleNonce,$);for(let[X,Y]of Z)Nz(X,this.eStyleContainer,Y,this.cssLayer,0,this.styleNonce);Z.length=0}this.theme=Q,Q?._startUse({loadThemeGoogleFonts:z.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:$}),MW(this,Q?._getParamsCss()??null,Q?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses(J),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(Q){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${Q}Changed`]:!0})}},n2=15538,cW=(Q,z,J)=>{let Z=60,$=setInterval(()=>{if(typeof ShadowRoot<"u"&&Q.getRootNode()instanceof ShadowRoot)z(),clearInterval($);if(Q.isConnected||--Z<0)clearInterval($)},1000);J(()=>clearInterval($))},pW=".ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:\"\";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:\"\";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:\"\";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:\"\";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:\"\";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:\"\";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:\"\";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:\"\";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path(\"M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z\");color:var(--ag-icon-button-active-color)}}",iW={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarPanelAnimationDuration:0,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:x0,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},cellFontSize:{ref:"dataFontSize"},cellFontWeight:{ref:"fontWeight"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:AQ,rangeSelectionBackgroundColor:fQ(0.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:fQ(0.5),rangeHeaderHighlightColor:RW(0.08),rowNumbersSelectedColor:fQ(0.5),rowHoverColor:fQ(0.08),columnHoverColor:fQ(0.05),selectedRowBackgroundColor:fQ(0.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:0.66},dataBackgroundColor:x0,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{ref:"rowHeight",calc:"max(rowHeight, 22px)"},dragHandleColor:r0(0.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:r0(0.1),iconButtonActiveColor:AQ,iconButtonActiveBackgroundColor:fQ(0.28),iconButtonActiveIndicatorColor:AQ,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:r0(0.8),cellEditingBorder:{color:AQ},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.25},columnSelectIndentSize:{ref:"iconSize"},toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:r0(0.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:r0(0.13)},selectCellBackgroundColor:r0(0.07),selectCellBorder:{color:r0(0.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:x0,filterPanelApplyButtonBackgroundColor:AQ,columnPanelApplyButtonColor:x0,columnPanelApplyButtonBackgroundColor:AQ,filterPanelCardSubtleColor:{ref:"textColor",mix:0.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:Tz,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:Tz,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:r0(0.15),statusBarLabelColor:Tz,statusBarLabelFontWeight:500,statusBarValueColor:Tz,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2},nW=".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}",C$={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},dW={...C$,cellBatchEditTextColor:"#f3d0b3"},tW=()=>FQ({feature:"batchEditStyle",params:C$,css:nW}),rW=tW(),sW=":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}",lW={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}};var aW=()=>FQ({feature:"buttonStyle",params:{...lW,buttonBackgroundColor:x0,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:AQ}},css:sW}),oW=aW();var eW=".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}";var QB=()=>{return FQ({feature:"columnDropStyle",css:eW})},b$=QB();var zB={formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:0.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:0.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:0.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:0.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:0.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:0.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:0.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}}},JB=()=>FQ({feature:"formulaStyle",params:zB}),ZB=JB(),$B={warn:(...Q)=>{R(Q[0],Q[1])},error:(...Q)=>{e(Q[0],Q[1])},preInitErr:(...Q)=>{y1(Q[0],Q[2],Q[1])}},XB=()=>wW($B).withParams(iW).withPart(oW).withPart(b$).withPart(rW).withPart(ZB),YB='.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}',GB=()=>FQ({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:x0,checkboxUncheckedBorderColor:o0(0.3),checkboxCheckedBackgroundColor:AQ,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:''},checkboxCheckedShapeColor:x0,checkboxIndeterminateBackgroundColor:o0(0.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:''},checkboxIndeterminateShapeColor:x0,radioCheckedShapeImage:{svg:''}},css:YB}),qB=GB();var y$=()=>({...WZ,...dW,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:o0(0.05),rowHoverColor:fQ(0.15),selectedRowBackgroundColor:fQ(0.2),menuBackgroundColor:o0(0.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:Tz,columnPanelApplyButtonColor:Tz,findMatchColor:x0,findActiveMatchColor:x0,checkboxUncheckedBorderColor:o0(0.4),toggleButtonOffBackgroundColor:o0(0.4),rowBatchEditBackgroundColor:o0(0.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"});var HB=()=>({...y$(),backgroundColor:"#1f2836"});var _B=()=>FQ({feature:"colorScheme",params:WZ,modeParams:{light:WZ,dark:y$(),"dark-blue":HB()}}),UB=_B();var x$={aggregation:'',arrows:'',asc:'',cancel:'',chart:'',"color-picker":'',columns:'',contracted:'',copy:'',cross:'',csv:'',cut:'',desc:'',down:'',excel:'',expanded:'',eye:'',"eye-slash":'',filter:'',first:'',grip:'',group:'',last:'',left:'',linked:'',loading:'',maximize:'',menu:'',"menu-alt":'',minimize:'',minus:'',next:'',none:'',"not-allowed":'',paste:'',pin:'',pivot:'',plus:'',previous:'',right:'',save:'',settings:'',"small-left":'',"small-right":'',tick:'',"tree-closed":'',"tree-indeterminate":'',"tree-open":'',unlinked:'',up:''},w$={aasc:'',adesc:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"column-arrow":'',edit:'',"filter-add":'',"pinned-bottom":'',"pinned-top":'',"small-down":'',"small-up":'',"un-pin":''},WB=(Q={})=>{let z="";for(let J of[...Object.keys(x$),...Object.keys(w$)]){let Z=BB(J,Q.strokeWidth);z+=`.ag-icon-${J}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(Z)}'); } +`}return z},BB=(Q,z=1.5)=>{let J=w$[Q];if(J)return J;let Z=x$[Q];if(!Z)throw Error(`Missing icon data for ${Q}`);return``+Z+""},N$=(Q={})=>{return FQ({feature:"iconSet",css:()=>WB(Q)})},g$=N$({strokeWidth:1}),EB=N$();var KB=":where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:\"\";display:block;height:12px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}",LB=".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}";var FB={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:0.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4};var DB=()=>FQ({feature:"inputStyle",params:{...FB,inputBackgroundColor:x0,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:AQ},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:o0(0.06),inputDisabledTextColor:{ref:"textColor",mix:0.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>KB+LB}),MB=DB();var kB=".ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:\"\";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}";var VB={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1};var fB=()=>FQ({feature:"tabStyle",params:{...VB,tabBarBorder:!0,tabBarBackgroundColor:r0(0.05),tabTextColor:{ref:"textColor",mix:0.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:x0},css:kB}),AB=fB();var jB=()=>({fontFamily:[{googleFont:"IBM Plex Sans"},"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu"]}),RB=()=>XB().withPart(qB).withPart(UB).withPart(EB).withPart(AB).withPart(MB).withPart(b$).withParams(jB()),V6=RB();var Ez=(Q,z,J,Z,$)=>({changeKey:Q,type:z,defaultValue:J,noWarn:Z,cacheDefault:$}),SB=Ez("cellHorizontalPadding","length",16),OB=Ez("indentationLevel","length",0,!0,!0),PB=Ez("rowGroupIndentSize","length",0),n7=Ez("rowHeight","length",42),d7=Ez("headerHeight","length",48),d2=Ez("rowBorderWidth","border",1),t7=Ez("pinnedRowBorderWidth","border",1),TB=Ez("headerRowBorderWidth","border",1);function vB(Q,z){for(let J of z.sort((Z,$)=>Z.moduleName.localeCompare($.moduleName))){let Z=J.css;if(Z)Q.set(`module-${J.moduleName}`,Z)}}var IB=class extends mW{initVariables(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.getSizeEl(n7),this.getSizeEl(d7),this.getSizeEl(d2),this.getSizeEl(t7),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(t7)}getRowBorderWidth(){return this.getCSSVariablePixelValue(d2)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(TB)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(n7)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(d7)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(SB)}getCellPaddingLeft(){let Q=this.getDefaultCellHorizontalPadding(),z=this.getCSSVariablePixelValue(OB),J=this.getCSSVariablePixelValue(PB);return Q-1+J*z}getCellPadding(){let Q=this.getDefaultCellHorizontalPadding()-1;return this.getCellPaddingLeft()+Q}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){let{eRootDiv:Q}=this,z=Q.style.getPropertyValue("--ag-line-height").trim(),J=this.gos.get("rowHeight");if(J==null||isNaN(J)||!isFinite(J)){if(z!==null)Q.style.setProperty("--ag-line-height",null);return-1}let Z=`${J}px`;if(z!=Z)return Q.style.setProperty("--ag-line-height",Z),J;return z!=""?Number.parseFloat(z):-1}fireStylesChangedEvent(Q){if(Q==="rowBorderWidth")this.refreshRowBorderWidthVariable();super.fireStylesChangedEvent(Q)}refreshRowBorderWidthVariable(){let Q=this.getCSSVariablePixelValue(d2);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${Q}px`)}postProcessThemeChange(Q,z){if(Q&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded"))if(z)e(106);else e(239)}getAdditionalCss(){let Q=new Map;return Q.set("core",[pW]),vB(Q,Array.from(SG())),Q}getDefaultTheme(){return V6}varError(Q,z){R(9,{variable:{cssName:Q,defaultValue:z}})}themeError(Q){e(240,{theme:Q})}shadowRootError(){e(293)}},CB=class extends j0{constructor(){super(...arguments);this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new KQ}addListener(Q,z,J){this.globalSvc.addEventListener(Q,z,J)}removeListener(Q,z,J){this.globalSvc.removeEventListener(Q,z,J)}addGlobalListener(Q,z=!1){this.globalSvc.addGlobalListener(Q,z)}removeGlobalListener(Q,z=!1){this.globalSvc.removeGlobalListener(Q,z)}dispatchEvent(Q){this.globalSvc.dispatchEvent(this.gos.addCommon(Q))}dispatchEventOnce(Q){this.globalSvc.dispatchEventOnce(this.gos.addCommon(Q))}},bB=class extends CB{postConstruct(){let{globalListener:Q,globalSyncListener:z}=this.beans;if(Q)this.addGlobalListener(Q,!0);if(z)this.addGlobalListener(z,!1)}};function K5(Q,z,J){let Z=Q.visibleCols.headerGroupRowCount;if(J>=Z)return{column:z,headerRowIndex:J};let $=z.getParent();while($&&$.getProvidedColumnGroup().getLevel()>J)$=$.getParent();let X=z.isSpanHeaderHeight();if(!$||X&&$.isPadding())return{column:z,headerRowIndex:Z};return{column:$,headerRowIndex:$.getProvidedColumnGroup().getLevel()}}var yB=class extends j{constructor(){super(...arguments);this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){let Q=this.beans;Q.ctrlsSvc.whenReady(this,(J)=>{this.gridBodyCon=J.gridBodyCtrl});let z=Y0(Q);this.addManagedElementListeners(z,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(Q,z){let J,{colModel:Z,colGroupSvc:$,ctrlsSvc:X}=this.beans;if(typeof Q==="string"){if(J=Z.getCol(Q),!J)J=$?.getColumnGroup(Q)??null}else J=Q;if(!J)return null;let G=X.getHeaderRowContainerCtrl()?.getAllCtrls(),q=b(G||[]).type==="filter",H=l0(this.beans)-1,_=-1,U=J;while(U)_++,U=U.getParent();let W=_;if(z&&q&&W===H-1)W++;return W===-1?null:{headerRowIndex:W,column:J}}navigateVertically(Q,z){let{focusSvc:J,visibleCols:Z}=this.beans,{focusedHeader:$}=J;if(!$)return!1;let{headerRowIndex:X}=$,Y=$.column,G=l0(this.beans),q=this.getHeaderRowType(X),H=Z.headerGroupRowCount,{headerRowIndex:_,column:U,headerRowIndexWithoutSpan:W}=Q==="UP"?xB(q,Y,X):wB(Y,X,H),B=!1;if(_<0)_=0,U=Y,B=!0;if(_>=G)_=-1,this.currentHeaderRowWithoutSpan=-1;else if(W!==void 0)this.currentHeaderRowWithoutSpan=W;if(!B&&!U)return!1;return J.focusHeaderPosition({headerPosition:{headerRowIndex:_,column:U},allowUserOverride:!0,event:z})}navigateHorizontally(Q,z=!1,J){let{focusSvc:Z,gos:$}=this.beans,X={...Z.focusedHeader},Y,G;if(this.currentHeaderRowWithoutSpan!==-1)X.headerRowIndex=this.currentHeaderRowWithoutSpan;else this.currentHeaderRowWithoutSpan=X.headerRowIndex;if(Q==="LEFT"!==$.get("enableRtl"))G="Before",Y=this.findHeader(X,G);else G="After",Y=this.findHeader(X,G);let q=$.getCallback("tabToNextHeader");if(z&&q){let H=Z.focusHeaderPositionFromUserFunc({userFunc:q,headerPosition:Y,direction:G});if(H){let{headerRowIndex:_}=Z.focusedHeader||{};if(_!=null&&_!=X.headerRowIndex)this.currentHeaderRowWithoutSpan=_}return H}if(Y||!z)return Z.focusHeaderPosition({headerPosition:Y,direction:G,fromTab:z,allowUserOverride:!0,event:J});return this.focusNextHeaderRow(X,G,J)}focusNextHeaderRow(Q,z,J){let Z=this.beans,$=Q.headerRowIndex,X=null,Y,G=l0(Z),q=this.beans.visibleCols.allCols;if(z==="Before"){if($<=0)return!1;X=b(q),Y=$-1,this.currentHeaderRowWithoutSpan-=1}else if(X=q[0],Y=$+1,this.currentHeaderRowWithoutSpan=G)_=-1;return Z.focusSvc.focusHeaderPosition({headerPosition:{column:H,headerRowIndex:_},direction:z,fromTab:!0,allowUserOverride:!0,event:J})}scrollToColumn(Q,z="After"){if(Q.getPinned())return;let J;if(_0(Q)){let Z=Q.getDisplayedLeafColumns();J=z==="Before"?b(Z):Z[0]}else J=Q;this.gridBodyCon.scrollFeature.ensureColumnVisible(J)}findHeader(Q,z){let{colGroupSvc:J,visibleCols:Z}=this.beans,$=Q.column;if($ instanceof a1){let q=$.getDisplayedLeafColumns();$=z==="Before"?q[0]:q[q.length-1]}let X=z==="Before"?Z.getColBefore($):Z.getColAfter($);if(!X)return;let Y=Z.headerGroupRowCount;if(Q.headerRowIndex>=Y)return{headerRowIndex:Q.headerRowIndex,column:X};let G=J?.getColGroupAtLevel(X,Q.headerRowIndex);if(!G)return{headerRowIndex:X instanceof GQ&&X.isSpanHeaderHeight()?Z.headerGroupRowCount:Q.headerRowIndex,column:X};if(G.isPadding()&&X.isSpanHeaderHeight())return{headerRowIndex:Z.headerGroupRowCount,column:X};return{headerRowIndex:Q.headerRowIndex,column:G??X}}getHeaderRowType(Q){let z=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(z)return z.getRowType(Q)}};function xB(Q,z,J){let Z=J-1;if(Q!=="filter"){let $=z instanceof GQ&&z.isSpanHeaderHeight(),X=z.getParent();while(X&&(X.getProvidedColumnGroup().getLevel()>Z||$&&X.isPadding()))X=X.getParent();if(X)if($)return{column:X,headerRowIndex:X.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:Z};else return{column:X,headerRowIndex:Z,headerRowIndexWithoutSpan:Z}}return{column:z,headerRowIndex:Z,headerRowIndexWithoutSpan:Z}}function wB(Q,z,J){let Z=z+1,$={column:Q,headerRowIndex:Z,headerRowIndexWithoutSpan:Z};if(Q instanceof a1){if(Z>=J)return{column:Q.getDisplayedLeafColumns()[0],headerRowIndex:J,headerRowIndexWithoutSpan:Z};let Y=Q.getDisplayedChildren()[0];if(Y instanceof a1&&Y.isPadding()){let q=Y.getDisplayedLeafColumns()[0];if(q.isSpanHeaderHeight())Y=q}if($.column=Y,Y instanceof GQ&&Y.isSpanHeaderHeight())$.headerRowIndex=J,$.headerRowIndexWithoutSpan=Z}return $}var NB=class extends j{constructor(){super(...arguments);this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(Q){this.colModel=Q.colModel,this.visibleCols=Q.visibleCols,this.rowRenderer=Q.rowRenderer,this.navigation=Q.navigation,this.filterManager=Q.filterManager,this.overlays=Q.overlays}postConstruct(){let Q=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:Q,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:Q,columnRowGroupChanged:Q}),this.addDestroyFunc(iq(this.beans))}attemptToRecoverFocus(){if(this.needsFocusRestored=!0,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout);this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){if(this.needsFocusRestored=!1,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null}shouldTakeFocus(){if(this.gos.get("suppressFocusAfterRefresh"))return this.setFocusRecovered(),!1;if(this.needsFocusRestored)return this.setFocusRecovered(),!0;return this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;let Q=this.focusedCell.column,z=this.colModel.getCol(Q.getId());if(Q!==z)this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){let{gos:Q,focusedCell:z}=this;if(Q.get("suppressFocusAfterRefresh")||Q.get("suppressCellFocus")||!z)return null;if(!this.doesRowOrCellHaveBrowserFocus())return null;return z}getFocusHeaderToUseAfterRefresh(){if(this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader)return null;if(!this.isDomDataPresentInHierarchy(d(this.beans),s9))return null;return this.focusedHeader}doesRowOrCellHaveBrowserFocus(){let Q=d(this.beans);if(this.isDomDataPresentInHierarchy(Q,HZ,!0))return!0;return this.isDomDataPresentInHierarchy(Q,_Z,!0)}isDomDataPresentInHierarchy(Q,z,J){let Z=Q;while(Z){let $=Y9(this.gos,Z,z);if($){if($.destroyed&&J)return this.attemptToRecoverFocus(),!1;return!0}Z=Z.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(Q){let{rowIndex:z,rowPinned:J,column:Z}=Q,$={rowIndex:z,rowPinned:J,column:Z,isFullWidthCell:!1},X=this.rowRenderer.getRowByPosition({rowIndex:z,rowPinned:J});if(X)$.isFullWidthCell=X.isFullWidth();return $}clearFocusedCell(){if(this.focusedCell==null)return;let Q=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",...Q})}setFocusedCell(Q){this.setFocusRecovered();let{column:z,rowIndex:J,rowPinned:Z,forceBrowserFocus:$=!1,preventScrollOnBrowserFocus:X=!1,sourceEvent:Y}=Q,G=this.colModel.getCol(z);if(!G){this.focusedCell=null;return}this.focusedCell={rowIndex:J,rowPinned:RQ(Z),column:G};let q=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...q,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:$,preventScrollOnBrowserFocus:X,sourceEvent:Y}),this.previousCellFocusParams=q}isCellFocused(Q){if(this.focusedCell==null)return!1;return f1(Q,this.focusedCell)}isHeaderWrapperFocused(Q){if(this.focusedHeader==null)return!1;let{column:z,rowCtrl:{rowIndex:J,pinned:Z}}=Q,{column:$,headerRowIndex:X}=this.focusedHeader;return z===$&&J===X&&Z==$.getPinned()}focusHeaderPosition(Q){if(this.setFocusRecovered(),_Q(this.beans))return!1;let{direction:z,fromTab:J,allowUserOverride:Z,event:$,fromCell:X,rowWithoutSpanValue:Y,scroll:G=!0}=Q,{headerPosition:q}=Q;if(X&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(q);if(Z){let H=this.focusedHeader,_=l0(this.beans);if(J){let U=this.gos.getCallback("tabToNextHeader");if(U)q=this.getHeaderPositionFromUserFunc({userFunc:U,direction:z,currentPosition:H,headerPosition:q,headerRowCount:_})}else{let U=this.gos.getCallback("navigateToNextHeader");if(U&&$){let W={key:$.key,previousHeaderPosition:H,nextHeaderPosition:q,headerRowCount:_,event:$},B=U(W);q=B===null?H:B}}}if(!q)return!1;return this.focusProvidedHeaderPosition({headerPosition:q,direction:z,event:$,fromCell:X,rowWithoutSpanValue:Y,scroll:G})}focusHeaderPositionFromUserFunc(Q){if(_Q(this.beans))return!1;let{userFunc:z,headerPosition:J,direction:Z,event:$}=Q,X=this.focusedHeader,Y=l0(this.beans),G=this.getHeaderPositionFromUserFunc({userFunc:z,direction:Z,currentPosition:X,headerPosition:J,headerRowCount:Y});return!!G&&this.focusProvidedHeaderPosition({headerPosition:G,direction:Z,event:$})}getHeaderPositionFromUserFunc(Q){let{userFunc:z,direction:J,currentPosition:Z,headerPosition:$,headerRowCount:X}=Q,G=z({backwards:J==="Before",previousHeaderPosition:Z,nextHeaderPosition:$,headerRowCount:X});if(G===!0)return Z;if(G===!1)return null;return G}focusProvidedHeaderPosition(Q){let{headerPosition:z,direction:J,fromCell:Z,rowWithoutSpanValue:$,event:X,scroll:Y=!0}=Q,{column:G,headerRowIndex:q}=z,{filterManager:H,ctrlsSvc:_,headerNavigation:U}=this.beans;if(this.focusedHeader&&KH(Q.headerPosition,this.focusedHeader))return!1;if(q===-1){if(H?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(z);return this.focusGridView({column:G,event:X})}if(Y)U?.scrollToColumn(G,J);let B=_.getHeaderRowContainerCtrl(G.getPinned())?.focusHeader(z.headerRowIndex,G,X)||!1;if(U&&B&&($!=null||Z))U.currentHeaderRowWithoutSpan=$??-1;return B}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;let Q=this.visibleCols.allCols[0];if(!Q)return!1;let z=K5(this.beans,Q,0);return this.focusHeaderPosition({headerPosition:z,rowWithoutSpanValue:0})}focusLastHeader(Q){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;let z=l0(this.beans)-1,J=b(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:z,column:J},rowWithoutSpanValue:-1,event:Q})}focusPreviousFromFirstCell(Q){if(this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(null);return this.focusLastHeader(Q)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(Q,z){if(this.focusedCell==null)return!1;return this.focusedCell.rowIndex===Q&&this.focusedCell.rowPinned===RQ(z)}focusOverlay(Q){let z=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!z&&D0(z,Q)}getDefaultTabToNextGridContainerTarget(Q){let{backwards:z,focusableContainers:J}=Q,Z=z?-1:1,$,X=()=>{if($===void 0)$=this.getGridBodyTabTarget(z);return $};for(let Y=Q.nextIndex;Y>=0&&Y{Q.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())});else this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){let Q=this.ctrlsSvc.get("center");if(!Q||this.colAnimation?.isActive())return;let z={horizontalScrollShowing:Q.isHorizontalScrollShowing(),verticalScrollShowing:this.verticalScrollShowing};this.setScrollsVisible(z),this.updateScrollGap()}updateScrollGap(){let Q=this.ctrlsSvc.get("center"),z=Q.hasHorizontalScrollGap(),J=Q.hasVerticalScrollGap();if(this.horizontalScrollGap!==z||this.verticalScrollGap!==J)this.horizontalScrollGap=z,this.verticalScrollGap=J,this.eventSvc.dispatchEvent({type:"scrollGapChanged"})}setScrollsVisible(Q){if(this.horizontalScrollShowing!==Q.horizontalScrollShowing||this.verticalScrollShowing!==Q.verticalScrollShowing)this.horizontalScrollShowing=Q.horizontalScrollShowing,this.verticalScrollShowing=Q.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"})}getScrollbarWidth(){if(this.scrollbarWidth==null){let Q=this.gos.get("scrollbarWidth"),J=typeof Q==="number"&&Q>=0?Q:s5();if(J!=null)this.scrollbarWidth=J,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"})}return this.scrollbarWidth}},hB=class extends j{constructor(){super(...arguments);this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;let{stateSvc:Q,ctrlsSvc:z,context:J}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:Q?.getState()??{}}),this.destroyCalled=!0,z.get("gridCtrl")?.destroyGridUi(),J.destroy(),super.destroy()}},uB=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","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","filterUiChanged","filterOpened","floatingFilterUiChanged","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","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped"];var lJ=new Set(["gridPreDestroyed","fillStart","pasteStart"]),f6=uB.reduce((Q,z)=>{return Q[z]=nG(z),Q},{}),B1={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find"};function r7(Q){return`"${Q}"`}var mB=()=>({checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."},rowGroupingHierarchy:{version:"34.3",message:"Use `colDef.groupHierarchy` instead."}}),cB={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:Q,editable:z,groupRowEditable:J})=>{if(!(!!z||!!J))return null;if(typeof Q==="string")return B1[Q]??"CustomEditor";return"CustomEditor"},cellRenderer:({cellRenderer:Q})=>{if(typeof Q!=="string")return null;return B1[Q]},cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:Q,cellEditor:z})=>{if(Q&&!z)return"TextEditor";return null},groupRowEditable:({groupRowEditable:Q,cellEditor:z})=>{if(!Q)return null;return z?"RowGroupingEdit":["RowGroupingEdit","TextEditor"]},groupRowValueSetter:({groupRowValueSetter:Q})=>Q?"RowGroupingEdit":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:Q})=>{if(Q&&typeof Q!=="string"&&typeof Q!=="boolean")return"CustomFilter";if(typeof Q==="string")return B1[Q]??"ColumnFilter";return"ColumnFilter"},floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:(Q)=>{let z=["columnsMenuTab","generalMenuTab"];if(Q.menuTabs?.some((J)=>z.includes(J)))return"ColumnMenu";return null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},pB=()=>{return{autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(z,{paginationAutoPageSize:J})=>{if(J)return"colDef.autoHeight is not supported with paginationAutoPageSize.";return null}},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:(z)=>{if((z.rowGroup!=null||z.rowGroupIndex!=null||z.cellRenderer==="agGroupCellRenderer")&&"checkbox"in z.cellRendererParams)return'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.';return null}},flex:{validate:(z,J)=>{if(J.autoSizeStrategy)return"colDef.flex is not supported with gridOptions.autoSizeStrategy";return null}},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(z,{rowSelection:J})=>J==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(z,{rowSelection:J})=>J==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(z,{rowSelection:J})=>J==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:(z)=>{let J=z.headerValueGetter;if(typeof J==="function"||typeof J==="string")return null;return"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:z})=>{if(z){if(z.smallDown)return QQ(262);if(z.smallLeft)return QQ(263);if(z.smallRight)return QQ(264)}return null}},sort:{validate:(z)=>{if(U1(z.sort)||$z(z.sort))return null;return`sort must be of type (SortDirection | SortDef), currently it is ${typeof z.sort==="object"?JSON.stringify(z.sort):nJ(z.sort)}`}},initialSort:{validate:(z)=>{if(U1(z.initialSort)||$z(z.initialSort))return null;return`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof z.initialSort==="object"?JSON.stringify(z.initialSort):nJ(z.initialSort)}`}},sortingOrder:{validate:(z)=>{let J=z.sortingOrder;if(Array.isArray(J)&&J.length>0){let Z=J.filter(($)=>{return!(U1($)||$z($))});if(Z.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${Z.map(($)=>typeof $==="string"||$==null?nJ($):JSON.stringify($)).join(", ")}]`}else if(!Array.isArray(J)||!J.length)return`sortingOrder must be an array with at least one element, currently it is [${J}]`;return null}},type:{validate:(z)=>{let J=z.type;if(J instanceof Array){if(J.some(($)=>typeof $!=="string"))return"if colDef.type is supplied an array it should be of type 'string[]'";return null}if(typeof J==="string")return null;return"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(z,{suppressRowTransform:J})=>{if(!J)return"colDef.rowSpan requires suppressRowTransform to be enabled.";return null}},spanRows:{dependencies:{editable:{required:[!1,void 0]},groupRowEditable:{required:[!1,void 0]},rowDrag:{required:[!1,void 0]},colSpan:{required:[void 0]},rowSpan:{required:[void 0]}},validate:(z,{rowSelection:J,cellSelection:Z,suppressRowTransform:$,enableCellSpan:X,rowDragEntireRow:Y,enableCellTextSelection:G})=>{if(typeof J==="object"){if(J?.mode==="singleRow"&&J?.enableClickSelection)return"colDef.spanRows is not supported with rowSelection.clickSelection"}if(Z)return"colDef.spanRows is not supported with cellSelection.";if($)return"colDef.spanRows is not supported with suppressRowTransform.";if(!X)return"colDef.spanRows requires enableCellSpan to be enabled.";if(Y)return"colDef.spanRows is not supported with rowDragEntireRow.";if(G)return"colDef.spanRows is not supported with enableCellTextSelection.";return null}},groupHierarchy:{validate(z,{groupHierarchyConfig:J={}},Z){let $=new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),X=[];for(let Y of z.groupHierarchy??[]){if(typeof Y==="object"){Z.validation?.validateColDef(Y);continue}if(!$.has(Y)&&!(Y in J))X.push(r7(Y))}if(X.length>0){let Y=`The following parts of colDef.groupHierarchy are not recognised: ${X.join(", ")}.`,G=`Choose one of ${[...$].map(r7).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`;return`${Y} +${G}`}return null}}}},iB={headerName:void 0,columnGroupShow:void 0,headerStyle:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,headerTooltipValueGetter:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,groupRowEditable:void 0,groupRowValueSetter:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,spanRows:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,tooltipComponentSelector:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0,dateComponent:void 0,dateComponentParams:void 0,getFindText:void 0,rowGroupingHierarchy:void 0,groupHierarchy:void 0,allowFormula:void 0},nB=()=>Object.keys(iB),dB=()=>({objectName:"colDef",allProperties:nB(),docsUrl:"column-properties/",deprecations:mB(),validations:pB()}),tB=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","treeDataChildrenField","treeDataParentIdField","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","invalidEditValueMode","grandTotalRow","themeCssLayer","findSearchValue","styleNonce","renderingMode"],rB=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","activeOverlayParams","popupParent","themeStyleContainer","statusBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterParent","advancedFilterBuilderParams","advancedFilterParams","formulaDataSource","formulaFuncs","initialState","autoSizeStrategy","selectionColumnDef","findOptions","filterHandlers","groupHierarchyConfig"],sB=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","suppressOverlays"],h$=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipSwitchShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns","rowDragInsertDelay"],lB=["theme","rowSelection"],aB=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],u$=["loadThemeGoogleFonts","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","allowContextMenuWithControlKey","suppressContextMenu","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","enableCellSpan","suppressClickEdit","rowDragEntireRow","rowDragManaged","refreshAfterGroupEdit","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupHideColumnsUntilExpanded","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","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault","enableFilterHandlers","suppressStartEditOnTab","hidePaddedHeaderRows","ssrmExpandAllAffectsAllRows","animateColumnResizing"],oB=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","overlayComponent","loadingOverlayComponent","noRowsOverlayComponent","overlayComponentSelector","activeOverlay","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getFullRowEditValidationErrors","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","tabToNextGridContainer","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","chartMenuItems","groupTotalRow","alwaysPassFilter","isRowPinnable","isRowPinned","isRowValidDropPosition"],eB=()=>[...sB,...rB,...tB,...h$,...oB,...u$,...aB,...lB];var Q3=()=>({suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."},groupRemoveSingleChildren:{version:"33",message:"Use `groupHideParentOfSingleChild` instead."},groupRemoveLowestSingleChildren:{version:"33",message:'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'},suppressRowGroupHidesColumns:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'},suppressMakeColumnVisibleAfterUnGroup:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'},unSortIcon:{version:"33",message:"Use `defaultColDef.unSortIcon` instead."},sortingOrder:{version:"33",message:"Use `defaultColDef.sortingOrder` instead."},suppressPropertyNamesCheck:{version:"33",message:"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."},suppressAdvancedFilterEval:{version:"34",message:"Advanced filter no longer uses function evaluation, so this option has no effect."}});function VQ(Q,z,J){if(typeof z==="number"||z==null){if(z==null)return null;return z>=J?null:`${Q}: value should be greater than or equal to ${J}`}return`${Q}: value should be a number`}var z3={alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:"SharedRowGrouping",grandTotalRow:"ClientSideRowModelHierarchy",initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDetail:"SharedMasterDetail",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:"SharedPivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:"SharedRowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:"SharedTreeData",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},J3=()=>{let Q={autoSizePadding:{validate({autoSizePadding:J}){return VQ("autoSizePadding",J,0)}},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate({cacheBlockSize:J}){return VQ("cacheBlockSize",J,1)}},cacheOverflowSize:{validate({cacheOverflowSize:J}){return VQ("cacheOverflowSize",J,1)}},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:(J)=>{let Z=J.domLayout,$=["autoHeight","normal","print"];if(Z&&!$.includes(Z))return`domLayout must be one of [${$.join()}], currently it's ${Z}`;return null}},enableFillHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableCellSpan:{supportedRowModels:["clientSide","serverSide"]},enableRangeSelection:{dependencies:{rowDragEntireRow:{required:[!1,void 0]}}},enableRowPinning:{supportedRowModels:["clientSide"],validate({enableRowPinning:J,pinnedTopRowData:Z,pinnedBottomRowData:$}){if(J&&(Z||$))return"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";return null}},isRowPinnable:{supportedRowModels:["clientSide"],validate({enableRowPinning:J,isRowPinnable:Z,pinnedTopRowData:$,pinnedBottomRowData:X}){if(Z&&($||X))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!J&&Z)return"`isRowPinnable` requires `enableRowPinning` to be set.";return null}},isRowPinned:{supportedRowModels:["clientSide"],validate({enableRowPinning:J,isRowPinned:Z,pinnedTopRowData:$,pinnedBottomRowData:X}){if(Z&&($||X))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!J&&Z)return"`isRowPinned` requires `enableRowPinning` to be set.";return null}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideColumnsUntilExpanded:{supportedRowModels:["clientSide"],validate({groupHideColumnsUntilExpanded:J,groupHideOpenParents:Z,groupDisplayType:$}){if(J&&!Z&&$!=="multipleColumns")return"`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`";return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:{required:[void 0,"bottom"]},treeData:{required:[void 0,!1],reason:"Tree Data has values at the group level so it doesn't make sense to hide them."}}},groupHideParentOfSingleChild:{dependencies:{groupHideOpenParents:{required:[void 0,!1]}}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveSingleChildren:{required:[void 0,!1]}}},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveLowestSingleChildren:{required:[void 0,!1]}}},groupSelectsChildren:{dependencies:{rowSelection:{required:["multiple"]}}},groupHierarchyConfig:{validate({groupHierarchyConfig:J={}},Z,$){for(let X of Object.keys(J))$.validation?.validateColDef(J[X]);return null}},icons:{validate:({icons:J})=>{if(J){if(J.smallDown)return QQ(262);if(J.smallLeft)return QQ(263);if(J.smallRight)return QQ(264)}return null}},infiniteInitialRowCount:{validate({infiniteInitialRowCount:J}){return VQ("infiniteInitialRowCount",J,1)}},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:(J)=>{if(typeof J.ssrmExpandAllAffectsAllRows==="boolean"){if(J.rowModelType!=="serverSide")return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if(J.ssrmExpandAllAffectsAllRows&&typeof J.getRowId!=="function")return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate({keepDetailRowsCount:J}){return VQ("keepDetailRowsCount",J,1)}},paginationPageSize:{validate({paginationPageSize:J}){return VQ("paginationPageSize",J,1)}},paginationPageSizeSelector:{validate:(J)=>{let Z=J.paginationPageSizeSelector;if(typeof Z==="boolean"||Z==null)return null;if(!Z.length)return`'paginationPageSizeSelector' cannot be an empty array. + If you want to hide the page size selector, set paginationPageSizeSelector to false.`;return null}},pivotMode:{dependencies:{treeData:{required:[!1,void 0],reason:"Pivot Mode is not supported with Tree Data."}}},quickFilterText:{supportedRowModels:["clientSide"]},rowBuffer:{validate({rowBuffer:J}){return VQ("rowBuffer",J,0)}},rowClass:{validate:(J)=>{if(typeof J.rowClass==="function")return"rowClass should not be a function, please use getRowClass instead";return null}},rowData:{supportedRowModels:["clientSide"]},rowDragManaged:{supportedRowModels:["clientSide"],dependencies:{pagination:{required:[!1,void 0]}}},rowSelection:{validate({rowSelection:J}){if(J&&typeof J==="string")return'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.';if(J&&typeof J!=="object")return"Expected `RowSelectionOptions` object for the `rowSelection` property.";if(J&&J.mode!=="multiRow"&&J.mode!=="singleRow")return`Selection mode "${J.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`;return null}},rowStyle:{validate:(J)=>{let Z=J.rowStyle;if(Z&&typeof Z==="function")return"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead";return null}},serverSideDatasource:{supportedRowModels:["serverSide"]},serverSideInitialRowCount:{supportedRowModels:["serverSide"],validate({serverSideInitialRowCount:J}){return VQ("serverSideInitialRowCount",J,1)}},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:(J)=>{let Z=J.sortingOrder;if(Array.isArray(Z)&&Z.length>0){let $=Z.filter((X)=>!a0(X));if($.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${$.map((X)=>typeof X==="string"||X==null?nJ(X):JSON.stringify(X))}]`}else if(!Array.isArray(Z)||!Z.length)return`sortingOrder must be an array with at least one element, currently it's ${Z}`;return null}},tooltipHideDelay:{validate:(J)=>{if(J.tooltipHideDelay&&J.tooltipHideDelay<0)return"tooltipHideDelay should not be lower than 0";return null}},tooltipShowDelay:{validate:(J)=>{if(J.tooltipShowDelay&&J.tooltipShowDelay<0)return"tooltipShowDelay should not be lower than 0";return null}},tooltipSwitchShowDelay:{validate:(J)=>{if(J.tooltipSwitchShowDelay&&J.tooltipSwitchShowDelay<0)return"tooltipSwitchShowDelay should not be lower than 0";return null}},treeData:{supportedRowModels:["clientSide","serverSide"],validate:(J)=>{let Z=J.rowModelType??"clientSide";switch(Z){case"clientSide":{let{treeDataChildrenField:$,treeDataParentIdField:X,getDataPath:Y,getRowId:G}=J;if(!$&&!X&&!Y)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if($){if(Y)return"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";if(X)return"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."}if(X){if(!G)return"getRowId callback not provided, tree data with parent id cannot be built.";if(Y)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{let $=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${Z} row model.`;return J.isServerSideGroup&&J.getServerSideGroupKey?null:$}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate({viewportRowModelBufferSize:J}){return VQ("viewportRowModelBufferSize",J,0)}},viewportRowModelPageSize:{validate({viewportRowModelPageSize:J}){return VQ("viewportRowModelPageSize",J,1)}},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate({autoGroupColumnDef:J,showOpenedGroup:Z}){if(J?.field&&Z)return"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.";if(J?.valueGetter&&Z)return"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.";return null}},renderingMode:{validate:(J)=>{let Z=J.renderingMode,$=["default","legacy"];if(Z&&!$.includes(Z))return`renderingMode must be one of [${$.join()}], currently it's ${Z}`;return null}},autoSizeStrategy:{validate:({autoSizeStrategy:J})=>{if(!J)return null;let Z=["fitCellContents","fitGridWidth","fitProvidedWidth"],$=J.type;if($!=="fitCellContents"&&$!=="fitGridWidth"&&$!=="fitProvidedWidth")return`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${Z.map((X)=>'"'+X+'"').join(", ")}, currently it's ${$}`;if($==="fitProvidedWidth"&&typeof J.width!="number")return`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${J.width}`;return null}}},z={};for(let J of u$)z[J]={expectedType:"boolean"};for(let J of h$)z[J]={expectedType:"number"};return B0(z,Q),z},Z3=()=>({objectName:"gridOptions",allProperties:[...eB(),...Object.values(f6)],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:Q3(),validations:J3()}),$3=0,X3=0,s7="__ag_grid_instance",Y3=class extends j{constructor(){super(...arguments);this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.instanceId=X3++,this.gridReadyFired=!1,this.queueEvents=[],this.propEventSvc=new KQ,this.globalEventHandlerFactory=(Q)=>{return(z,J)=>{if(!this.isAlive())return;let Z=lJ.has(z);if(Z&&!Q||!Z&&Q)return;if(!G3(z))return;let $=(X,Y)=>{let G=f6[X],q=this.gridOptions[G];if(typeof q==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>q(Y))};if(this.gridReadyFired)$(z,J);else if(z==="gridReady"){$(z,J),this.gridReadyFired=!0;for(let X of this.queueEvents)$(X.eventName,X.event);this.queueEvents=[]}else this.queueEvents.push({eventName:z,event:J})}}}wireBeans(Q){this.gridOptions=Q.gridOptions,this.validation=Q.validation,this.api=Q.gridApi,this.gridId=Q.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:Q})=>{this.updateGridOptions({options:Q,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(Q){return this.gridOptions[Q]??MG[Q]}getCallback(Q){return this.mergeGridCommonParams(this.gridOptions[Q])}exists(Q){return T(this.gridOptions[Q])}mergeGridCommonParams(Q){if(Q)return(J)=>{return Q(this.addCommon(J))};return Q}updateGridOptions({options:Q,force:z,source:J="api"}){let Z={id:$3++,properties:[]},$=[],{gridOptions:X,validation:Y}=this;for(let G of Object.keys(Q)){let q=y5.applyGlobalGridOption(G,Q[G]);Y?.warnOnInitialPropertyUpdate(J,G);let H=z||typeof q==="object"&&J==="api",_=X[G];if(H||_!==q){X[G]=q;let U={type:G,currentValue:q,previousValue:_,changeSet:Z,source:J};$.push(U)}}this.validateGridOptions(this.gridOptions),Z.properties=$.map((G)=>G.type);for(let G of $)d1(this,`Updated property ${G.type} from`,G.previousValue," to ",G.currentValue),this.propEventSvc.dispatchEvent(G)}addPropertyEventListener(Q,z){this.propEventSvc.addEventListener(Q,z)}removePropertyEventListener(Q,z){this.propEventSvc.removeEventListener(Q,z)}getDomDataKey(){return this.domDataKey}addCommon(Q){return Q.api=this.api,Q.context=this.gridOptionsContext,Q}validateOptions(Q,z){for(let J of Object.keys(Q)){let Z=Q[J];if(Z==null||Z===!1)continue;let $=z[J];if(typeof $==="function")$=$(Q,this.gridOptions,this.beans);if($)this.assertModuleRegistered($,J)}}validateGridOptions(Q){this.validateOptions(Q,z3),this.validation?.processGridOptions(Q)}validateColDef(Q,z,J){if(J||!this.beans.dataTypeSvc?.isColPendingInference(z))this.validateOptions(Q,cB),this.validation?.validateColDef(Q)}assertModuleRegistered(Q,z){let J=Array.isArray(Q)?Q.some((Z)=>this.isModuleRegistered(Z)):this.isModuleRegistered(Q);if(!J)e(200,{...this.getModuleErrorParams(),moduleName:Q,reasonOrId:z});return J}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:x5(),rowModelType:this.get("rowModelType"),isUmd:w5()}}isModuleRegistered(Q){return Q5(Q,this.gridId,this.get("rowModelType"))}setInstanceDomData(Q){Q[s7]=this.instanceId}isElementInThisInstance(Q){let z=Q;while(z){let J=z[s7];if(T(J))return J===this.instanceId;z=z.parentElement}return!1}};function G3(Q){return!!f6[Q]}var q3=class extends j{constructor(Q,z){super();this.column=Q,this.eGui=z,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(Q)=>Q&&this.onClick(Q)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(Q){let{sortSvc:z,rangeSvc:J,gos:Z}=this.beans;if(!(Zz(Z)?Q.altKey:!0))J?.handleColumnSelection(this.column,Q);else if(this.column.isSortable()){let X=this.column.isMoving(),G=Date.now()-this.lastMovingChanged<50;if(!(X||G))z?.progressSortFromEvent(this.column,Q)}}};function H3(Q,z){let J={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:J},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:J},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[Q?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:J},z?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}var _3=class extends x{constructor(){super(...arguments);this.eFilter=S,this.eFilterButton=S,this.eSortIndicator=S,this.eMenu=S,this.eLabel=S,this.eText=S,this.eColRef=S,this.eSortOrder=S,this.eSortAsc=S,this.eSortDesc=S,this.eSortMixed=S,this.eSortNone=S,this.eSortAbsoluteAsc=S,this.eSortAbsoluteDesc=S,this.isLoadingInnerComponent=!1}refresh(Q){let z=this.params;if(this.params=Q,this.workOutTemplate(Q,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||Q.enableSorting!=this.currentSort||Q.column.formulaRef!=this.currentRef||this.currentSuppressMenuHide!=null&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||z.enableFilterButton!=Q.enableFilterButton||z.enableFilterIcon!=Q.enableFilterIcon)return!1;if(this.innerHeaderComponent){let J={...Q};B0(J,Q.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.(J)}else this.setDisplayName(Q);return!0}workOutTemplate(Q,z){let{formula:J}=this.beans,Z=Q.template;if(Z)return Z?.trim?Z.trim():Z;return H3(!!J?.active,z)}init(Q){this.params=Q;let{sortSvc:z,touchSvc:J,rowNumbersSvc:Z,userCompFactory:$}=this.beans,X=z?.getSortIndicatorSelector();if(this.currentTemplate=this.workOutTemplate(Q,!!X),this.setTemplate(this.currentTemplate,X?[X]:void 0),this.eLabel)this.mouseListener??(this.mouseListener=this.createManagedBean(new q3(Q.column,this.eLabel)));J?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),Z?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent($,Q),this.setDisplayName(Q)}workOutInnerHeaderComponent(Q,z){let J=vq(Q,z,z);if(!J)return;this.isLoadingInnerComponent=!0,J.newAgStackInstance().then((Z)=>{if(this.isLoadingInnerComponent=!1,!Z)return;if(this.isAlive()){if(this.innerHeaderComponent=Z,this.eText)this.eText.appendChild(Z.getGui())}else this.destroyBean(Z)})}setDisplayName(Q){let{displayName:z}=Q,J=this.currentDisplayName;if(this.currentDisplayName=z,!this.eText||J===z||this.innerHeaderComponent||this.isLoadingInnerComponent)return;this.eText.textContent=ZJ(z)}addInIcon(Q,z,J){let Z=h(Q,this.beans,J);if(Z)z.appendChild(Z)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){T0(this.eMenu),this.eMenu=void 0;return}let{gos:Q,eMenu:z,params:J}=this,Z=U0(Q);this.addInIcon(Z?"menu":"menuAlt",z,J.column),z.classList.toggle("ag-header-menu-icon",!Z);let $=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=$,this.addManagedElementListeners(z,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow($)}toggleMenuAlwaysShow(Q){this.eMenu?.classList.toggle("ag-header-menu-always-show",Q)}showColumnMenu(Q){let{currentSuppressMenuHide:z,params:J}=this;if(!z)this.toggleMenuAlwaysShow(!0);J.showColumnMenu(Q,()=>{if(!z)this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(Q){let{params:z,gos:J,beans:Z,eMenu:$,eFilterButton:X}=this,Y=z.column,G=U0(J);if(Q&&!G){if(Z.menuSvc?.isFilterMenuInHeaderEnabled(Y))return z.showFilter(X??$??this.getGui()),!0}else if(z.enableMenu)return this.showColumnMenu($??X??this.getGui()),!0;return!1}setupSort(){let{sortSvc:Q}=this.beans;if(!Q)return;let{enableSorting:z,column:J}=this.params;if(this.currentSort=z,!this.eSortIndicator){this.eSortIndicator=this.createBean(Q.createSortIndicator(!0));let{eSortIndicator:Z,eSortOrder:$,eSortAsc:X,eSortDesc:Y,eSortMixed:G,eSortNone:q,eSortAbsoluteAsc:H,eSortAbsoluteDesc:_}=this;Z.attachCustomElements($,X,Y,G,q,H,_)}if(this.eSortIndicator.setupSort(J),!this.currentSort)return;Q.setupHeader(this,J)}setupColumnRefIndicator(){let{eColRef:Q,beans:{editModelSvc:z},params:J}=this;if(!Q)return;this.currentRef=J.column.formulaRef,Q.textContent=this.currentRef,N(Q,!1),this.addManagedEventListeners({cellEditingStarted:()=>{let Z=z?.getEditPositions(),$=!!this.currentRef&&!!Z?.some((X)=>X.column.isAllowFormula());N(Q,$)},cellEditingStopped:()=>{N(Q,!1)}})}setupFilterIcon(){let{eFilter:Q,params:z}=this;if(!Q)return;let J=()=>{let Z=z.column.isFilterActive();N(Q,Z,{skipAriaHidden:!0})};this.configureFilter(z.enableFilterIcon,Q,J,"filterActive")}setupFilterButton(){let{eFilterButton:Q,params:z}=this;if(!Q)return;if(this.configureFilter(z.enableFilterButton,Q,this.onFilterChangedButton.bind(this),"filter"))this.addManagedElementListeners(Q,{click:()=>z.showFilter(Q)});else this.eFilterButton=void 0}configureFilter(Q,z,J,Z){if(!Q)return T0(z),!1;let $=this.params.column;return this.addInIcon(Z,z,$),this.addManagedListeners($,{filterChanged:J}),J(),!0}onFilterChangedButton(){let Q=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",Q)}getAnchorElementForMenu(Q){let{eFilterButton:z,eMenu:J}=this;if(Q)return z??J??this.getGui();return J??z??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}},U3=class extends j{constructor(Q,z){super();this.eLabel=Q,this.columnGroup=z,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){let{columnGroup:Q,beans:z}=this,{ctrlsSvc:J}=z;J.whenReady(this,()=>{let Z=this.refreshPosition.bind(this);if(Q.getPinned()==null)this.addManagedEventListeners({bodyScroll:($)=>{if($.direction==="horizontal")this.updateSticky($.left)}});this.addManagedListeners(Q,{leftChanged:Z,displayedChildrenChanged:Z}),this.addManagedEventListeners({columnResized:Z}),this.refreshPosition()})}refreshPosition(){let{columnGroup:Q,beans:z}=this,J=Q.getLeft(),Z=Q.getActualWidth();if(J==null||Z===0){this.left=null,this.right=null,this.setSticky(!1);return}this.left=J,this.right=J+Z;let $=z.colViewport.getScrollPosition();if($!=null)this.updateSticky($)}updateSticky(Q){let{beans:z,left:J,right:Z}=this;if(J==null||Z==null){this.setSticky(!1);return}let{gos:$,visibleCols:X}=z,G=$.get("enableRtl")?X.bodyWidth-Q:Q;this.setSticky(JG)}setSticky(Q){let{isSticky:z,eLabel:J}=this;if(z===Q)return;this.isSticky=Q,J.classList.toggle("ag-sticky-label",Q)}},W3={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},B3=class extends x{constructor(){super(W3);this.agOpened=S,this.agClosed=S,this.agLabel=S,this.isLoadingInnerComponent=!1}init(Q){let{userCompFactory:z,touchSvc:J}=this.beans;this.params=Q,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(z,Q),this.setupLabel(Q),this.addGroupExpandIcon(Q),this.setupExpandIcons(),J?.setupForHeaderGroup(this)}checkWarnings(){if(this.params.template)R(89)}workOutInnerHeaderGroupComponent(Q,z){let J=Cq(Q,z,z);if(!J)return;this.isLoadingInnerComponent=!0,J.newAgStackInstance().then((Z)=>{if(this.isLoadingInnerComponent=!1,!Z)return;if(this.isAlive())this.innerHeaderGroupComponent=Z,this.agLabel.appendChild(Z.getGui());else this.destroyBean(Z)})}setupExpandIcons(){let{agOpened:Q,agClosed:z,params:{columnGroup:J},beans:{colGroupSvc:Z}}=this;this.addInIcon("columnGroupOpened",Q),this.addInIcon("columnGroupClosed",z);let $=(q)=>{if(zQ(q))return;let H=!J.isExpanded();Z.setColumnGroupOpened(J.getProvidedColumnGroup(),H,"uiColumnExpanded")};this.addTouchAndClickListeners(z,$),this.addTouchAndClickListeners(Q,$);let X=(q)=>{i0(q)};this.addManagedElementListeners(z,{dblclick:X}),this.addManagedElementListeners(Q,{dblclick:X}),this.addManagedElementListeners(this.getGui(),{dblclick:$}),this.updateIconVisibility();let Y=J.getProvidedColumnGroup(),G=this.updateIconVisibility.bind(this);this.addManagedListeners(Y,{expandedChanged:G,expandableChanged:G})}addTouchAndClickListeners(Q,z){this.beans.touchSvc?.setupForHeaderGroupElement(this,Q,z),this.addManagedElementListeners(Q,{click:z})}updateIconVisibility(){let{agOpened:Q,agClosed:z,params:{columnGroup:J}}=this;if(J.isExpandable()){let Z=J.isExpanded();N(Q,Z),N(z,!Z)}else N(Q,!1),N(z,!1)}addInIcon(Q,z){let J=h(Q,this.beans,null);if(J)z.appendChild(J)}addGroupExpandIcon(Q){if(!Q.columnGroup.isExpandable()){let{agOpened:z,agClosed:J}=this;N(z,!1),N(J,!1)}}setupLabel(Q){let{displayName:z,columnGroup:J}=Q,{innerHeaderGroupComponent:Z,isLoadingInnerComponent:$}=this,X=Z||$;if(T(z)&&!X)this.agLabel.textContent=ZJ(z);if(!J.getColGroupDef()?.suppressStickyLabel)this.createManagedBean(new U3(this.getGui(),J))}destroy(){if(super.destroy(),this.innerHeaderGroupComponent)this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0}},E3={moduleName:"ColumnHeaderComp",version:p,userComponents:{agColumnHeader:_3},icons:{menu:"menu",menuAlt:"menu-alt"}},K3={moduleName:"ColumnGroupHeaderComp",version:p,userComponents:{agColumnGroupHeader:B3},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},L3=class extends j{constructor(){super(...arguments);this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(Q){if(this.scrollGoingDown=Q>=this.lastScrollTop,Q===0)this.scrollGoingDown=!0;this.lastScrollTop=Q}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){if(this.active===!1)R(92)}createTask(Q,z,J,Z,$=!1){this.verify();let X=J;if(Z&&this.batchFrameworkComps)X="f1";let Y={task:Q,index:z,createOrder:++this.taskCount,deferred:$};this.addTaskToList(this[X],Y),this.schedule()}addTaskToList(Q,z){Q.list.push(z),Q.sorted=!1}sortTaskList(Q){if(Q.sorted)return;let z=this.scrollGoingDown?1:-1;Q.list.sort((J,Z)=>{if(J.deferred!==Z.deferred)return J.deferred?-1:1;if(J.index!==Z.index)return z*(Z.index-J.index);return Z.createOrder-J.createOrder}),Q.sorted=!0}addDestroyTask(Q){this.verify(),this.destroyTasks.push(Q),this.schedule()}executeFrame(Q){let{p1:z,p2:J,f1:Z,destroyTasks:$,beans:X}=this,{ctrlsSvc:Y,frameworkOverrides:G}=X,q=z.list,H=J.list,_=Z.list,U=Date.now(),W=0,B=Q<=0,E=Y.getScrollFeature();while(B||W{while(B||W{};else if($.length)L=$.pop();else break;L()}W=Date.now()-U}if(q.length||H.length||_.length||$.length)this.requestFrame();else this.ticking=!1}flushAllFrames(){if(!this.active)return;this.executeFrame(-1)}schedule(){if(!this.active)return;if(!this.ticking)this.ticking=!0,this.requestFrame()}requestFrame(){let Q=this.executeFrame.bind(this,60);YQ(this.beans,Q)}isQueueEmpty(){return!this.ticking}},F3={moduleName:"AnimationFrame",version:p,beans:[L3]},D3=class extends j{constructor(){super(...arguments);this.beanName="iconSvc"}createIconNoSpan(Q,z){return h(Q,this.beans,z?.column)}},M3=(Q,z,J)=>z||Q&&J,k3=class extends j{constructor(){super(...arguments);this.beanName="touchSvc"}mockBodyContextMenu(Q,z){this.mockContextMenu(Q,Q.eBodyViewport,z)}mockHeaderContextMenu(Q,z){this.mockContextMenu(Q,Q.eGui,z)}mockRowContextMenu(Q){if(!bz())return;let z=(J,Z,$)=>{let{rowCtrl:X,cellCtrl:Y}=Q.getControlsForEventTarget($?.target??null);if(Y?.column)Y.dispatchCellContextMenuEvent($??null);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,$,X,Y)};this.mockContextMenu(Q,Q.element,z)}handleCellDoubleClick(Q,z){if((()=>{if(!bz()||a2("dblclick"))return!1;let Z=Date.now(),$=Z-Q.lastIPadMouseClickEvent<200;return Q.lastIPadMouseClickEvent=Z,$})())return Q.onCellDoubleClicked(z),z.preventDefault(),!0;return!1}setupForHeader(Q){let{gos:z,sortSvc:J,menuSvc:Z}=this.beans;if(z.get("suppressTouch"))return;let{params:$,eMenu:X,eFilterButton:Y}=Q,G=new h0(Q.getGui(),!0);Q.addDestroyFunc(()=>G.destroy());let q=Q.shouldSuppressMenuHide(),H=q&&T(X)&&$.enableMenu,_=!!Z?.isHeaderContextMenuEnabled($.column),U=M3($.enableMenu,_,U0(z)),W=G;if(H)W=new h0(X,!0),Q.addDestroyFunc(()=>W.destroy());let B=(E)=>$.showColumnMenuAfterMouseClick(E.touchStart);if(H&&$.enableMenu)Q.addManagedListeners(W,{tap:B});if(U)Q.addManagedListeners(G,{longTap:B});if($.enableSorting){let E=(K)=>{let L=K.touchStart.target;if(q&&(X?.contains(L)||Y?.contains(L)))return;J?.progressSort($.column,!1,"uiColumnSorted")};Q.addManagedListeners(G,{tap:E})}if($.enableFilterButton&&Y){let E=new h0(Y,!0);Q.addManagedListeners(E,{tap:()=>$.showFilter(Y)}),Q.addDestroyFunc(()=>E.destroy())}}setupForHeaderGroup(Q){let z=Q.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(z.columnGroup.getProvidedColumnGroup())){let J=new h0(z.eGridHeader,!0),Z=($)=>z.showColumnMenuAfterMouseClick($.touchStart);Q.addManagedListeners(J,{longTap:Z}),Q.addDestroyFunc(()=>J.destroy())}}setupForHeaderGroupElement(Q,z,J){let Z=new h0(z,!0);Q.addManagedListeners(Z,{tap:J}),Q.addDestroyFunc(()=>Z.destroy())}mockContextMenu(Q,z,J){if(!bz())return;let Z=new h0(z),$=(X)=>{if(!n1(this.beans,X.touchEvent))return;J(void 0,X.touchStart,X.touchEvent)};Q.addManagedListeners(Z,{longTap:$}),Q.addDestroyFunc(()=>Z.destroy())}},V3={moduleName:"Touch",version:p,beans:[k3]},f3=class extends j{constructor(){super(...arguments);this.beanName="cellNavigation"}wireBeans(Q){this.rowSpanSvc=Q.rowSpanSvc}getNextCellToFocus(Q,z,J=!1){if(J)return this.getNextCellToFocusWithCtrlPressed(Q,z);return this.getNextCellToFocusWithoutCtrlPressed(Q,z)}getNextCellToFocusWithCtrlPressed(Q,z){let J=Q===V.UP,Z=Q===V.DOWN,$=Q===V.LEFT,X,Y,{pageBounds:G,gos:q,visibleCols:H,pinnedRowModel:_}=this.beans,{rowPinned:U}=z;if(J||Z){if(U&&_)if(J)Y=0;else Y=U==="top"?_.getPinnedTopRowCount()-1:_.getPinnedBottomRowCount()-1;else Y=J?G.getFirstRow():G.getLastRow();X=z.column}else{let W=q.get("enableRtl");Y=z.rowIndex,X=($!==W?H.allCols:[...H.allCols].reverse()).find((E)=>!v0(E)&&this.isCellGoodToFocusOn({rowIndex:Y,rowPinned:null,column:E}))}return X?{rowIndex:Y,rowPinned:U,column:X}:null}getNextCellToFocusWithoutCtrlPressed(Q,z){let J=z,Z=!1;while(!Z){switch(Q){case V.UP:J=this.getCellAbove(J);break;case V.DOWN:J=this.getCellBelow(J);break;case V.RIGHT:J=this.gos.get("enableRtl")?this.getCellToLeft(J):this.getCellToRight(J);break;case V.LEFT:J=this.gos.get("enableRtl")?this.getCellToRight(J):this.getCellToLeft(J);break;default:J=null,R(8,{key:Q});break}if(J)Z=this.isCellGoodToFocusOn(J);else Z=!0}return J}isCellGoodToFocusOn(Q){let z=Q.column,J,{pinnedRowModel:Z,rowModel:$}=this.beans;switch(Q.rowPinned){case"top":J=Z?.getPinnedTopRow(Q.rowIndex);break;case"bottom":J=Z?.getPinnedBottomRow(Q.rowIndex);break;default:J=$.getRow(Q.rowIndex);break}if(!J)return!1;return!this.isSuppressNavigable(z,J)}getCellToLeft(Q){if(!Q)return null;let z=this.beans.visibleCols.getColBefore(Q.column);if(!z)return null;return{rowIndex:Q.rowIndex,column:z,rowPinned:Q.rowPinned}}getCellToRight(Q){if(!Q)return null;let z=this.beans.visibleCols.getColAfter(Q.column);if(!z)return null;return{rowIndex:Q.rowIndex,column:z,rowPinned:Q.rowPinned}}getCellBelow(Q){if(!Q)return null;let z=this.rowSpanSvc?.getCellEnd(Q)??Q,J=L0(this.beans,z,!0);if(J)return{rowIndex:J.rowIndex,column:Q.column,rowPinned:J.rowPinned};return null}getCellAbove(Q){if(!Q)return null;let z=this.rowSpanSvc?.getCellStart(Q)??Q,J=m0(this.beans,{rowIndex:z.rowIndex,rowPinned:z.rowPinned},!0);if(J)return{rowIndex:J.rowIndex,column:Q.column,rowPinned:J.rowPinned};return null}getNextTabbedCell(Q,z){if(z)return this.getNextTabbedCellBackwards(Q);return this.getNextTabbedCellForwards(Q)}getNextTabbedCellForwards(Q){let{visibleCols:z,pagination:J}=this.beans,Z=z.allCols,$=Q.rowIndex,X=Q.rowPinned,Y=z.getColAfter(Q.column);if(!Y){Y=Z[0];let G=L0(this.beans,Q,!0);if(n(G))return null;if(!G.rowPinned&&!(J?.isRowInPage(G.rowIndex)??!0))return null;$=G?G.rowIndex:null,X=G?G.rowPinned:null}return{rowIndex:$,column:Y,rowPinned:X}}getNextTabbedCellBackwards(Q){let{beans:z}=this,{visibleCols:J,pagination:Z}=z,$=J.allCols,X=Q.rowIndex,Y=Q.rowPinned,G=J.getColBefore(Q.column);if(!G){G=b($);let q=m0(z,{rowIndex:Q.rowIndex,rowPinned:Q.rowPinned},!0);if(n(q))return null;if(!q.rowPinned&&!(Z?.isRowInPage(q.rowIndex)??!0))return null;X=q?q.rowIndex:null,Y=q?q.rowPinned:null}return{rowIndex:X,column:G,rowPinned:Y}}isSuppressNavigable(Q,z){let{suppressNavigable:J}=Q.colDef;if(typeof J==="boolean")return J;if(typeof J==="function"){let Z=Q.createColumnFunctionCallbackParams(z);return J(Z)}return!1}};function A3(Q){return Q.focusSvc.getFocusedCell()}function j3(Q){return Q.focusSvc.clearFocusedCell()}function R3(Q,z,J,Z){Q.focusSvc.setFocusedCell({rowIndex:z,column:J,rowPinned:Z,forceBrowserFocus:!0})}function S3(Q,z){return Q.navigation?.tabToNextCell(!1,z)??!1}function O3(Q,z){return Q.navigation?.tabToNextCell(!0,z)??!1}function P3(Q,z,J=!1){let Z=Q.headerNavigation?.getHeaderPositionForColumn(z,J);if(!Z)return;Q.focusSvc.focusHeaderPosition({headerPosition:Z})}function mQ(Q){let z=Q;return z?.getFrameworkComponentInstance!=null?z.getFrameworkComponentInstance():Q}var T3=class extends j{constructor(){super(...arguments);this.beanName="editModelSvc",this.edits=new Map,this.cellValidations=new m$,this.rowValidations=new c$,this.suspendEdits=!1}suspend(Q){this.suspendEdits=Q}removeEdits({rowNode:Q,column:z}){if(!this.hasEdits({rowNode:Q})||!Q)return;let J=this.getEditRow(Q);if(z)J.delete(z);else J.clear();if(J.size===0)this.edits.delete(Q)}getEditRow(Q,z={}){if(this.suspendEdits)return;if(this.edits.size===0)return;let J=Q&&this.edits.get(Q);if(J)return J;if(z.checkSiblings){let Z=Q.pinnedSibling;if(Z)return this.getEditRow(Z)}return}getEditRowDataValue(Q,{checkSiblings:z}={}){if(!Q||this.edits.size===0)return;let J=this.getEditRow(Q),Z=Q.pinnedSibling,$=z&&Z&&this.getEditRow(Z);if(!J&&!$)return;let X={...Q.data},Y=(G,q)=>G.forEach(({editorValue:H,pendingValue:_},U)=>{let W=H===void 0?_:H;if(W!==P0)q[U.getColId()]=W});if(J)Y(J,X);if($)Y($,X);return X}getEdit(Q={},z){let{rowNode:J,column:Z}=Q,$=this.edits;if(this.suspendEdits||$.size===0||!J||!Z)return;let X=$.get(J)?.get(Z);if(X)return X;if(z?.checkSiblings){let Y=J.pinnedSibling;if(Y)return $.get(Y)?.get(Z)}return}getEditMap(Q=!0){if(this.suspendEdits||this.edits.size===0)return new Map;if(!Q)return this.edits;let z=new Map;return this.edits.forEach((J,Z)=>{let $=new Map;J.forEach(({editorState:X,...Y},G)=>$.set(G,{...Y})),z.set(Z,$)}),z}setEditMap(Q){this.edits.clear(),Q.forEach((z,J)=>{let Z=new Map;z.forEach(($,X)=>Z.set(X,{...$})),this.edits.set(J,Z)})}setEdit(Q,z){let J=this.edits;if(J.size===0||!J.has(Q.rowNode))J.set(Q.rowNode,new Map);let Z=this.getEdit(Q),$={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...Z,...z};return this.getEditRow(Q.rowNode).set(Q.column,$),$}clearEditValue(Q){let{rowNode:z,column:J}=Q;if(!z)return;let Z=(X)=>{X.editorValue=void 0,X.pendingValue=X.sourceValue,X.state="changed"};if(!J){this.getEditRow(z)?.forEach(Z);return}let $=this.getEdit(Q);if($)Z($)}getState(Q){if(this.suspendEdits)return;return this.getEdit(Q)?.state}getEditPositions(Q){if(this.suspendEdits||(Q??this.edits).size===0)return[];let z=[];return(Q??this.edits).forEach((J,Z)=>{for(let $ of J.keys()){let{editorState:X,...Y}=J.get($);z.push({rowNode:Z,column:$,...Y})}}),z}hasRowEdits(Q,z){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;return!!this.getEditRow(Q,z)}hasEdits(Q={},z={}){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;let{rowNode:J,column:Z}=Q,{withOpenEditor:$}=z;if(J){let X=this.getEditRow(J,z);if(!X)return!1;if(Z){if($)return this.getEdit(Q)?.state==="editing";return X.has(Z)}if(X.size!==0){if($)return Array.from(X.values()).some(({state:Y})=>Y==="editing");return!0}return!1}if($)return this.getEditPositions().some(({state:X})=>X==="editing");return this.edits.size>0}start(Q){let z=this.getEditRow(Q.rowNode)??new Map,{rowNode:J,column:Z}=Q;if(Z&&!z.has(Z))z.set(Z,{editorValue:void 0,pendingValue:P0,sourceValue:this.beans.valueSvc.getValue(Z,J,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}});this.edits.set(J,z)}stop(Q,z,J){if(!this.hasEdits(Q))return;if(z){let Z=this.getEditRow(Q.rowNode)?.get(Q.column);if(Z&&(Z.pendingValue===P0||Z.pendingValue===Z.sourceValue))this.removeEdits(Q);else if(Z&&J)Z.editorValue=void 0}else this.removeEdits(Q)}clear(){for(let Q of this.edits.values())Q.clear();this.edits.clear()}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(Q){this.cellValidations=Q}setRowValidationModel(Q){this.rowValidations=Q}destroy(){super.destroy(),this.clear()}},m$=class{constructor(){this.cellValidations=new Map}getCellValidation(Q){let{rowNode:z,column:J}=Q||{};return this.cellValidations?.get(z)?.get(J)}hasCellValidation(Q){if(!Q?.rowNode||!Q.column)return this.cellValidations.size>0;return!!this.getCellValidation(Q)}setCellValidation(Q,z){let{rowNode:J,column:Z}=Q;if(!this.cellValidations.has(J))this.cellValidations.set(J,new Map);this.cellValidations.get(J).set(Z,z)}clearCellValidation(Q){let{rowNode:z,column:J}=Q;this.cellValidations.get(z)?.delete(J)}setCellValidationMap(Q){this.cellValidations=Q}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},c$=class{constructor(){this.rowValidations=new Map}getRowValidation(Q){let{rowNode:z}=Q||{};return this.rowValidations.get(z)}hasRowValidation(Q){if(!Q?.rowNode)return this.rowValidations.size>0;return!!this.getRowValidation(Q)}setRowValidation({rowNode:Q},z){this.rowValidations.set(Q,z)}clearRowValidation({rowNode:Q}){this.rowValidations.delete(Q)}setRowValidationMap(Q){this.rowValidations=Q}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}};function BZ(Q,z={}){let{rowIndex:J,rowId:Z,rowCtrl:$,rowPinned:X}=z;if($)return $;let{rowModel:Y,rowRenderer:G}=Q,{rowNode:q}=z;if(!q){if(Z)q=GH(Q,Z,X);else if(J!=null)q=Y.getRow(J)}return q?G.getRowCtrlByNode(q):void 0}function s(Q,z={}){let{cellCtrl:J,colId:Z,columnId:$,column:X}=z;if(J)return J;let Y=Q.colModel.getCol(Z??$??L5(X)),G=z.rowCtrl??BZ(Q,z),q=G?.getCellCtrl(Y)??void 0;if(q)return q;let H=z.rowNode??G?.rowNode;if(H)return Q.rowRenderer.getCellCtrls([H],[Y])?.[0];return}function l7(Q){let{editSvc:z}=Q;if(z?.isBatchEditing())Qz(Q,{persist:!0}),eQ(Q);else z?.stopEditing(void 0,{source:"api"})}function v3(Q,z,J){let{gos:Z,popupSvc:$}=z;if(!Z.get("stopEditingWhenCellsLoseFocus"))return;let X=(Y)=>{let G=Y.relatedTarget;if(q5(G)===null){l7(z);return}let q=J.some((H)=>H.contains(G))&&Z.isElementInThisInstance(G);if(!q)q=!!$&&($.getActivePopups().some((H)=>H.contains(G))||$.isElementWithinCustomPopup(G));if(!q)l7(z)};for(let Y of J)Q.addManagedElementListeners(Y,{focusout:X})}function L5(Q){if(!Q)return;if(typeof Q==="string")return Q;return Q.getColId()}var P0=Symbol("unedited"),I3=(Q,z={})=>{let J=Q.rowRenderer.getCellCtrls(z.rowNodes,z.columns),Z=Array(J.length),$=0;for(let X=0,Y=J.length;X0)z.set(J,$)}return z}function gz(Q,z,J){let{key:Z,event:$,cellStartedEdit:X,silent:Y}=J??{},{editModelSvc:G,gos:q,userCompFactory:H}=Q,_=s(Q,z),U=_?.comp?.getCellEditor(),W=i$(Q,z,Z,X&&!Y),B=G?.getEdit(z),E=W.value??B?.sourceValue;if(U){G?.setEdit(z,{editorValue:F1(Q,E,!0,z.column),state:"editing"}),U.refresh?.(W);return}let K=z.column.getColDef(),L=P9(H,K,W);if(!L)return;let{popupFromSelector:F,popupPositionFromSelector:D}=L,M=F??!!K.cellEditorPopup,k=D??K.cellEditorPopupPosition;if(n$(L.params,$),!_)return;let{rangeFeature:f,rowCtrl:A,comp:O,onEditorAttachedFuncs:v}=_;G?.setEdit(z,{editorValue:F1(Q,E,!0,z.column),state:"editing",editorState:{cellStartedEditing:void 0,cellStoppedEditing:void 0}}),_.editCompDetails=L,v.push(()=>f?.unsetComp()),O?.setEditDetails(L,M,k,q.get("reactiveCustomComponents")),A?.refreshRow({suppressFlash:!0}),y3(Q,z,$,E,Y)}function y3(Q,z,J,Z,$){let{editSvc:X,editModelSvc:Y}=Q,G=Y?.getEdit(z);if(!$&&G?.state==="editing"&&!G?.editorState?.cellStartedEditing)X?.dispatchCellEvent(z,J,"cellEditingStarted",{value:Z}),Y?.setEdit(z,{editorState:{cellStartedEditing:!0}})}function p$(Q,z,J){let Z={editorValueExists:!1};if(A6(Q)){if((z.getValidationErrors?.()?.length??0)>0)return Z}if(J?.isCancelling)return Z;if(J?.isStopping){let X=z?.isCancelAfterEnd?.();if(X)return{...Z,isCancelAfterEnd:X}}return{editorValue:z.getValue(),editorValueExists:!0}}function i$(Q,z,J,Z){let{valueSvc:$,gos:X,editSvc:Y}=Q,G=Q.gos.get("enableGroupEdit"),q=s(Q,z),H=z.rowNode?.rowIndex??void 0,_=Y?.isBatchEditing(),U=Q.colModel.getCol(z.column.getId()),{rowNode:W,column:B}=z,E=q.comp?.getCellEditor(),K=Y?.getCellDataValue(z),L=K===void 0?E?p$(Q,E)?.editorValue:void 0:K,F=L===P0?$.getValueForDisplay({column:U,node:W,from:"edit"})?.value:L,D=G?L:F;if(B.isAllowFormula()&&Q.formula?.isFormula(D))D=Q.formula?.normaliseFormula(D,!0)??D;return y(X,{value:D,eventKey:J??null,column:B,colDef:B.getColDef(),rowIndex:H,node:W,data:W.data,cellStartedEdit:!!Z,onKeyDown:q?.onKeyDown.bind(q),stopEditing:(M)=>{Y.stopEditing(z,{source:_?"ui":"api",suppressNavigateAfterEdit:M}),QJ(Q,z,{})},eGridCell:q?.eGui,parseValue:(M)=>$.parseValue(U,W,M,q?.value),formatValue:q?.formatValue.bind(q),validate:()=>{Y?.validateEdit()}})}function x1(Q,z){let{editModelSvc:J}=Q;J?.getEditMap().forEach((Z,$)=>{Z.forEach((X,Y)=>{if(!z&&(X.state==="editing"||X.pendingValue===P0))return;if(!BQ(X)&&(X.state!=="editing"||z))J?.removeEdits({rowNode:$,column:Y})})})}function x3(Q,z){let J=z.comp?.getCellEditor();if(!J?.refresh)return;let{eventKey:Z,cellStartedEdit:$}=z.editCompDetails.params,{column:X}=z,Y=i$(Q,z,Z,$),G=X.getColDef(),q=P9(Q.userCompFactory,G,Y);J.refresh(n$(q.params,Z))}function n$(Q,z){if(z instanceof KeyboardEvent&&Q.column.getColDef().cellEditor==="agNumberCellEditor")Q.suppressPreventDefault=["-","+",".","e"].includes(z?.key??"")||Q.suppressPreventDefault;else z?.preventDefault?.();return Q}function Qz(Q,z){for(let J of Q.editModelSvc?.getEditPositions()??[]){let Z=s(Q,J);if(!Z)continue;let $=Z.comp?.getCellEditor();if(!$)continue;let{editorValue:X,editorValueExists:Y,isCancelAfterEnd:G}=p$(Q,$,z);if(G){let{cellStartedEditing:q,cellStoppedEditing:H}=Q.editModelSvc?.getEdit(J)?.editorState||{};Q.editModelSvc?.setEdit(J,{editorState:{isCancelAfterEnd:G,cellStartedEditing:q,cellStoppedEditing:H}})}z1(Q,J,X,void 0,!Y,z)}}function z1(Q,z,J,Z,$,X){let{editModelSvc:Y,valueSvc:G}=Q;if(!Y)return;let{rowNode:q,column:H}=z;if(!(q&&H))return;let _=Y.getEdit(z);if(_?.sourceValue===void 0){let U=_?F1(Q,_.editorValue,!1,H):P0,W={sourceValue:G.getValue(H,q,"data"),pendingValue:U};if(X?.persist)W.state="changed";_=Y.setEdit(z,W)}if(Y.setEdit(z,{editorValue:$?F1(Q,_.sourceValue,!0,H):J}),X?.persist)w3(Q,z)}function F1(Q,z,J,Z){let{formula:$}=Q;if(Z.isAllowFormula()&&$?.isFormula(z))return $?.normaliseFormula(z,J)??z;return z}function w3(Q,z){let{editModelSvc:J}=Q,Z=J?.getEdit(z),X={pendingValue:F1(Q,Z?.editorValue,!1,z.column)};if(!Z?.editorState?.cellStoppedEditing&&Z?.state!=="editing")X.state="changed";J?.setEdit(z,X)}function eQ(Q,z,J={}){if(!z)z=Q.editModelSvc?.getEditPositions();if(z)for(let Z of z)QJ(Q,Z,J)}function QJ(Q,z,J,Z=s(Q,z)){let $=Q.editModelSvc,X=$?.getEdit(z),Y;if(X&&X.state!=="editing"&&X.editorState?.cellStoppedEditing)Y=X.state;else Y="changed";if(!Z){if(X)$?.setEdit(z,{state:Y});return}let G=Z.comp,q=G?.getCellEditor();if(G&&!q){if(Z?.refreshCell(),X){$?.setEdit(z,{state:Y});let _=Q.gos.get("enableGroupEdit")?a7(X,J?.cancel):{valueChanged:!1,newValue:void 0,oldValue:X.sourceValue};o7(Q,z,_,J)}return}if(A6(Q)){let _=X&&q?.getValidationErrors?.(),U=$?.getCellValidationModel();if(_?.length)U?.setCellValidation(z,{errorMessages:_});else U?.clearCellValidation(z)}if(X)$?.setEdit(z,{state:Y});G?.setEditDetails(),G?.refreshEditStyles(!1,!1),Z?.refreshCell({force:!0,suppressFlash:!0});let H=$?.getEdit(z);if(H&&H.state!=="editing"){let _=J?.cancel,U=Q.gos.get("enableGroupEdit")?a7(H,_):N3(H,X,_);o7(Q,z,U,J)}}function a7(Q,z){let{sourceValue:J,pendingValue:Z}=Q,$;if(!z&&Z!==P0)$=Z;return{valueChanged:!z&&BQ(Q),newValue:$,oldValue:J,value:J}}function N3(Q,z,J){if(J||Q.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:Q.sourceValue};let Z=Q.editorValue;if(Z==null||Z===P0)Z=z?.pendingValue;if(Z===P0)Z=void 0;return{valueChanged:BQ(Q),newValue:Z,oldValue:Q.sourceValue}}function o7(Q,z,J,{silent:Z,event:$}={}){let{editSvc:X,editModelSvc:Y}=Q,G=Y?.getEdit(z),{editorState:q}=G||{},{isCancelBeforeStart:H,cellStartedEditing:_,cellStoppedEditing:U}=q||{};if(!Z&&!H&&_&&!U)X?.dispatchCellEvent(z,$,"cellEditingStopped",J),Y?.setEdit(z,{editorState:{cellStoppedEditing:!0}})}function g3(Q){if(!Q)return!1;for(let z=0,J=Q.length;z0,M=D?L.join(". "):"";if(S8(F,D),D)Z.announceValue(`${H} ${L}`,"editorValidation");if(F instanceof HTMLInputElement)F.setCustomValidity(M);else F.classList.toggle("invalid",D)}if(L?.length>0)J.setCellValidation({rowNode:E,column:K},{errorMessages:L});_.add(U.rowCtrl)}if(Qz(Q,{persist:!1}),X?.setCellValidationModel(J),G){let U=u3(Q);X?.setRowValidationModel(U)}for(let U of _.values()){U.rowEditStyleFeature?.applyRowStyles();for(let W of U.getAllCellCtrls())W.tooltipFeature?.refreshTooltip(!0),W.editorTooltipFeature?.refreshTooltip(!0),W.editStyleFeature?.applyCellStyles?.()}}var u3=(Q)=>{let z=new c$,J=Q.gos.get("getFullRowEditValidationErrors"),Z=Q.editModelSvc?.getEditMap();if(!Z)return z;for(let $ of Z.keys()){let X=Z.get($);if(!X)continue;let Y=[],{rowIndex:G,rowPinned:q}=$;for(let _ of X.keys()){let U=X.get(_);if(!U)continue;let{editorValue:W,pendingValue:B,sourceValue:E}=U,K=W??(B===P0?void 0:B)??E;Y.push({column:_,colId:_.getColId(),rowIndex:G,rowPinned:q,oldValue:E,newValue:K})}let H=J?.({editorsState:Y})??[];if(H.length>0)z.setRowValidation({rowNode:$},{errorMessages:H})}return z};function m3(Q){Yz(Q,!0);let z=Q.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!z)return null;let J=[];return z.forEach((Z,$)=>{Z.forEach(({errorMessages:X},Y)=>{J.push({column:Y,rowIndex:$.rowIndex,rowPinned:$.rowPinned,messages:X??null})})}),J}function iZ(Q){return!!(Q.rowPinned&&Q.pinnedSibling)}function t0(Q,z,J,Z){let $=z==="top";if(!J)return t0(Q,z,$?Q.getPinnedTopRow(0):Q.getPinnedBottomRow(0),Z);if(!Z){let q=$?Q.getPinnedTopRowCount():Q.getPinnedBottomRowCount();return t0(Q,z,J,$?Q.getPinnedTopRow(q-1):Q.getPinnedBottomRow(q-1))}let X=!1,Y=!1,G=[];return Q.forEachPinnedRow(z,(q)=>{if(q===J&&!X){X=!0,G.push(q);return}if(X&&q===Z){Y=!0,G.push(q);return}if(X&&!Y)G.push(q)}),G}function c3(Q,z,J,{rowNode:Z,column:$},X){return y(Q.gos,{type:J,node:Z,data:Z.data,value:X,column:$,colDef:$.getColDef(),rowPinned:Z.rowPinned,event:z,rowIndex:Z.rowIndex})}function p3(Q,z=!1){if(Q===V.DELETE)return!0;if(!z&&Q===V.BACKSPACE)return C9();return!1}var i3=class extends j{constructor(Q,z,J,Z){super();this.cellCtrl=Q,this.rowNode=J,this.rowCtrl=Z,this.beans=z}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(Q){let z=Q.key;if(z===V.ENTER&&v0(this.cellCtrl.column)&&this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition,Q))return;switch(z){case V.ENTER:this.onEnterKeyDown(Q);break;case V.F2:this.onF2KeyDown(Q);break;case V.ESCAPE:this.onEscapeKeyDown(Q);break;case V.TAB:this.onTabKeyDown(Q);break;case V.BACKSPACE:case V.DELETE:this.onBackspaceOrDeleteKeyDown(z,Q);break;case V.DOWN:case V.UP:case V.RIGHT:case V.LEFT:this.onNavigationKeyDown(Q,z);break}}onNavigationKeyDown(Q,z){let{cellCtrl:J,beans:Z}=this;if(Z.editSvc?.isEditing(J,{withOpenEditor:!0}))return;if(Q.shiftKey&&J.isRangeSelectionEnabled())this.onShiftRangeSelect(Q);else{let $=J.getFocusedCellPosition();Z.navigation?.navigateToNextCell(Q,z,$,!0)}Q.preventDefault()}onShiftRangeSelect(Q){let{rangeSvc:z,navigation:J}=this.beans;if(!z)return;let Z=z.extendLatestRangeInDirection(Q);if(!Z)return;if(Q.key===V.LEFT||Q.key===V.RIGHT)J?.ensureColumnVisible(Z.column);else J?.ensureRowVisible(Z.rowIndex)}onTabKeyDown(Q){this.beans.navigation?.onTabKeyDown(this.cellCtrl,Q)}onBackspaceOrDeleteKeyDown(Q,z){let{cellCtrl:J,beans:Z,rowNode:$}=this,{gos:X,rangeSvc:Y,eventSvc:G,editSvc:q}=Z;if(G.dispatchEvent({type:"keyShortcutChangedCellStart"}),p3(Q,X.get("enableCellEditingOnBackspace"))&&!q?.isEditing(J,{withOpenEditor:!0})){if(Y&&u0(X))Y.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(J.isCellEditable()){let H=Z.valueSvc.getDeleteValue(J.column,$);$.setDataValue(J.column,H,"cellClear")}}else if(!q?.isEditing(J,{withOpenEditor:!0}))Z.editSvc?.startEditing(J,{startedEdit:!0,event:z});G.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(Q){let{cellCtrl:z,beans:J}=this,{editSvc:Z,navigation:$}=J,X=Z?.isEditing(z,{withOpenEditor:!0}),Y=z.rowNode,G=Z?.isRowEditing(Y,{withOpenEditor:!0}),q=(H)=>{if(Z?.startEditing(H,{startedEdit:!0,event:Q,source:"edit"}))Q.preventDefault()};if(X||G){if(this.isCtrlEnter(Q)){Z?.applyBulkEdit(z,J?.rangeSvc?.getCellRanges()||[]);return}if(Yz(J),Z?.checkNavWithValidation(void 0,Q)==="block-stop")return;if(Z?.isEditing(z,{withOpenEditor:!0}))Z?.stopEditing(z,{event:Q,source:"edit"});else if(G&&!z.isCellEditable())Z?.stopEditing({rowNode:Y},{event:Q,source:"edit"});else q(z)}else if(J.gos.get("enterNavigatesVertically")){let H=Q.shiftKey?V.UP:V.DOWN;$?.navigateToNextCell(null,H,z.cellPosition,!1)}else{if(Z?.hasValidationErrors())return;if(Z?.hasValidationErrors(z))Z.revertSingleCellEdit(z,!0);q(z)}}isCtrlEnter(Q){return(Q.ctrlKey||Q.metaKey)&&Q.key===V.ENTER}onF2KeyDown(Q){let{cellCtrl:z,beans:{editSvc:J}}=this;if(J?.isEditing()){if(Yz(this.beans),J?.checkNavWithValidation(void 0,Q)==="block-stop")return}J?.startEditing(z,{startedEdit:!0,event:Q})}onEscapeKeyDown(Q){let{cellCtrl:z,beans:{editSvc:J}}=this;if(J?.checkNavWithValidation(z,Q)==="block-stop")J.revertSingleCellEdit(z);setTimeout(()=>{J?.stopEditing(z,{event:Q,cancel:!0})})}processCharacter(Q){let J=Q.target!==this.eGui,{beans:{editSvc:Z},cellCtrl:$}=this;if(J)return;if(Z?.isEditing($,{withOpenEditor:!0}))return;if(Q.key===V.SPACE)this.onSpaceKeyDown(Q);else if(Z?.isCellEditable($,"ui")){if(Z?.hasValidationErrors()&&!Z?.hasValidationErrors($))return;if(Z?.startEditing($,{startedEdit:!0,event:Q,source:"api",editable:!0}),!$.editCompDetails?.params?.suppressPreventDefault)Q.preventDefault()}}onSpaceKeyDown(Q){let{gos:z,editSvc:J}=this.beans,{rowNode:Z}=this.cellCtrl;if(!J?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&hQ(z))this.beans.selectionSvc?.handleSelectionEvent(Q,Z,"spaceKey");Q.preventDefault()}},n3=class extends j{constructor(Q,z,J){super();this.cellCtrl=Q,this.column=J,this.beans=z}onMouseEvent(Q,z){if(zQ(z))return;switch(Q){case"click":this.onCellClicked(z);break;case"pointerdown":case"mousedown":case"touchstart":this.onMouseDown(z);break;case"dblclick":this.onCellDoubleClicked(z);break;case"mouseout":this.onMouseOut(z);break;case"mouseover":this.onMouseOver(z);break}}onCellClicked(Q){if(this.beans.touchSvc?.handleCellDoubleClick(this,Q))return;let{eventSvc:z,rangeSvc:J,editSvc:Z,editModelSvc:$,frameworkOverrides:X,gos:Y}=this.beans,G=Q.ctrlKey||Q.metaKey,{cellCtrl:q}=this,{column:H,cellPosition:_,rowNode:U}=q,W=rJ(Y,H,U,Q);if(J&&G&&!W){if(J.getCellRangeCount(_)>1)J.intersectLastRange(!0)}let B=q.createEvent(Q,"cellClicked");B.isEventHandlingSuppressed=W,z.dispatchEvent(B);let E=H.getColDef();if(E.onCellClicked)window.setTimeout(()=>{X.wrapOutgoing(()=>{E.onCellClicked(B)})},0);if(W)return;if($?.getState(q)!=="editing"){let K=Z?.isEditing(),L=Z?.isRangeSelectionEnabledWhileEditing(),F=$?.getCellValidationModel().getCellValidationMap().size??0,D=$?.getRowValidationModel().getRowValidationMap().size??0;if(K&&(L||F>0||D>0))return;if(Z?.shouldStartEditing(q,Q))Z?.startEditing(q,{event:Q});else if(Z?.shouldStopEditing(q,Q))if(this.beans.gos.get("editType")==="fullRow")Z?.stopEditing(q,{event:Q,source:"edit"});else Z?.stopEditing(void 0,{event:Q,source:"edit"})}}onCellDoubleClicked(Q){let{column:z,beans:J,cellCtrl:Z}=this,{eventSvc:$,frameworkOverrides:X,editSvc:Y,editModelSvc:G,gos:q}=J,H=rJ(q,Z.column,Z.rowNode,Q),_=z.getColDef(),U=Z.createEvent(Q,"cellDoubleClicked");if(U.isEventHandlingSuppressed=H,$.dispatchEvent(U),typeof _.onCellDoubleClicked==="function")window.setTimeout(()=>{X.wrapOutgoing(()=>{_.onCellDoubleClicked(U)})},0);if(H)return;if(Y?.shouldStartEditing(Z,Q)&&G?.getState(Z)!=="editing"){let W=Y?.isEditing(),B=Y?.isRangeSelectionEnabledWhileEditing(),E=G?.getCellValidationModel().getCellValidationMap().size??0,K=G?.getRowValidationModel().getRowValidationMap().size??0;if(W&&(B||E>0||K>0))return;Y?.startEditing(Z,{event:Q})}}onMouseDown(Q){let{shiftKey:z}=Q,J=Q.target,{cellCtrl:Z,beans:$}=this,{eventSvc:X,rangeSvc:Y,rowNumbersSvc:G,focusSvc:q,gos:H,editSvc:_}=$,{column:U,rowNode:W,cellPosition:B}=Z,E=rJ(H,U,W,Q),K=()=>{let M=Z.createEvent(Q,"cellMouseDown");M.isEventHandlingSuppressed=E,X.dispatchEvent(M)};if(E){K();return}if(this.isRightClickInExistingRange(Q))return;let L=Y&&!Y.isEmpty(),F=this.containsWidget(J),D=v0(U);if(G&&D&&!G.handleMouseDownOnCell(B,Q))return;if(!z||!L){let M=_?.isEditing(Z),f=H.get("enableCellTextSelection")&&Q.defaultPrevented,A=(cz()||f)&&!M&&!w1(J)&&!F;Z.focusCell(A,Q)}if(z&&L&&!q.isCellFocused(B)){Q.preventDefault();let M=q.getFocusedCell();if(M){let{column:k,rowIndex:f,rowPinned:A}=M,O=!!_?.isRangeSelectionEnabledWhileEditing?.();if(_?.isEditing(M)&&!O)_?.stopEditing(M);if(!O)q.setFocusedCell({column:k,rowIndex:f,rowPinned:A,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:Q})}}if(F)return;Y?.handleCellMouseDown(Q,B),K()}isRightClickInExistingRange(Q){let{rangeSvc:z}=this.beans;if(z){let J=z.isCellInAnyRange(this.cellCtrl.cellPosition),Z=u5(this.beans,Q);if(J&&Z)return!0}return!1}containsWidget(Q){return vz(Q,"ag-selection-checkbox",3)||vz(Q,"ag-drag-handle",3)}onMouseOut(Q){if(this.mouseStayingInsideCell(Q))return;let{eventSvc:z,colHover:J}=this.beans;z.dispatchEvent(this.cellCtrl.createEvent(Q,"cellMouseOut")),J?.clearMouseOver()}onMouseOver(Q){if(this.mouseStayingInsideCell(Q))return;let{eventSvc:z,colHover:J}=this.beans;z.dispatchEvent(this.cellCtrl.createEvent(Q,"cellMouseOver")),J?.setMouseOver([this.column])}mouseStayingInsideCell(Q){if(!Q.target||!Q.relatedTarget)return!1;let z=this.cellCtrl.eGui,J=z.contains(Q.target),Z=z.contains(Q.relatedTarget);return J&&Z}},d3=class extends j{constructor(Q,z){super();this.cellCtrl=Q,this.beans=z,this.column=Q.column,this.rowNode=Q.rowNode}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.eSetLeft=this.cellCtrl.getRootElement(),this.eContent=this.cellCtrl.eGui;let Q=this.cellCtrl.getCellSpan();if(!Q)this.setupColSpan(),this.setupRowSpan();if(this.onLeftChanged(),this.onWidthChanged(),!Q)this._legacyApplyRowSpan();if(Q){let z=this.refreshSpanHeight.bind(this,Q);z(),this.addManagedListeners(this.beans.eventSvc,{paginationChanged:z,recalculateRowBounds:z,pinnedHeightChanged:z})}}refreshSpanHeight(Q){let z=Q.getCellHeight();if(z!=null)this.eContent.style.height=`${z}px`}onNewColumnsLoaded(){let Q=this.column.getRowSpan(this.rowNode);if(this.rowSpan===Q)return;this.rowSpan=Q,this._legacyApplyRowSpan(!0)}onDisplayColumnsChanged(){let Q=this.getColSpanningList();if(!X0(this.colsSpanning,Q))this.colsSpanning=Q,this.onWidthChanged(),this.onLeftChanged()}setupColSpan(){if(this.column.getColDef().colSpan==null)return;this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)})}onWidthChanged(){if(!this.eContent)return;let Q=this.getCellWidth();this.eContent.style.width=`${Q}px`}getCellWidth(){if(!this.colsSpanning)return this.column.getActualWidth();return this.colsSpanning.reduce((Q,z)=>Q+z.getActualWidth(),0)}getColSpanningList(){let{column:Q,rowNode:z}=this,J=Q.getColSpan(z),Z=[];if(J===1)Z.push(Q);else{let $=Q,X=Q.getPinned();for(let Y=0;$&&Ythis.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(Z,Y),this.refreshFirstAndLastStyles(),this.checkFormulaError(),this.refreshAriaRowIndex(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(Q),this.editStyleFeature?.setComp(Q),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(Q),this.rowResizeFeature?.refreshRowResizer();let G=X?this.isCellEditable():void 0,q=!G&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(G||q)this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:G});else this.showValue(!1,!0);if(this.onCompAttachedFuncs.length){for(let H of this.onCompAttachedFuncs)H();this.onCompAttachedFuncs=[]}}checkFormulaError(){let Q=!!this.beans.formula?.getFormulaError(this.column,this.rowNode);this.eGui.classList.toggle("formula-error",Q)}setupAutoHeight(Q,z){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,Q,z)??!1}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){let Q=this.column.getColDef();return Q.cellRenderer!=null||Q.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){let{beans:Q,column:z}=this,{userCompFactory:J,ctrlsSvc:Z,eventSvc:$}=Q,X=z.getColDef(),Y=this.createCellRendererParams();Y.deferRender=!0;let G=M7(J,X,Y);if(Z.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let q,H=new g((U)=>{q=U}),[_]=this.addManagedListeners($,{bodyScrollEnd:()=>{q(),_()}});return{loadingComp:G,onReady:H}}return{loadingComp:G,onReady:g.resolve()}}showValue(Q,z){let{beans:J,column:Z,rowNode:$,rangeFeature:X}=this,{userCompFactory:Y}=J,G=this.getValueToDisplay(),q,H=$.stub&&$.groupData?.[Z.getId()]==null,_=Z.getColDef();if(H||this.isCellRenderer()){let U=this.createCellRendererParams();if(!H||v0(Z))q=o1(Y,_,U);else q=M7(Y,_,U)}if(!q&&!H&&J.findSvc?.isMatch($,Z)){let U=this.createCellRendererParams();q=o1(Y,{...Z.getColDef(),cellRenderer:"agFindCellRenderer"},U)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing($,{checkSiblings:!0})){let U=this.editSvc.prepDetailsDuringBatch(this,{compDetails:q,valueToDisplay:G});if(U){if(U.compDetails)q=U.compDetails;else if(U.valueToDisplay)G=U.valueToDisplay}}if(this.comp.setRenderDetails(q,G,Q),this.customRowDragComp?.refreshVisibility(),!z&&X)YQ(J,()=>X?.refreshRangeStyleAndHandle());this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){let Q=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(Q),!0),this.includeRowDrag=this.isIncludeControl(Q.rowDrag),this.includeDndSource=this.isIncludeControl(Q.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){let z=this.column.getColDef().cellRenderer==="agCheckboxCellRenderer",J="";if(z)J=" ag-allow-overflow";return`ag-cell-value${J}`}isIncludeControl(Q,z=!1){return(this.rowNode.rowPinned==null||z&&iZ(this.rowNode))&&!!Q}isCheckboxSelection(Q){let{rowSelection:z,groupDisplayType:J}=this.beans.gridOptions,Z=E1(z),$=IQ(this.column);if(J==="custom"&&Z!=="selectionColumn"&&$)return!1;return Q.checkboxSelection||$&&typeof z==="object"&&Jz(z)}refreshShouldDestroy(){let Q=this.column.getColDef(),z=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(Q),!0),J=this.includeRowDrag!=this.isIncludeControl(Q.rowDrag),Z=this.includeDndSource!=this.isIncludeControl(Q.dndSource),$=this.isAutoHeight!=this.column.isAutoHeight();return z||J||Z||$}onPopupEditorClosed(Q){let{editSvc:z}=this.beans;if(!z?.isEditing(this,{withOpenEditor:!0}))return;let J=Q instanceof KeyboardEvent,Z=Q instanceof MouseEvent,$=J&&Q.key===V.ESCAPE;if(z.stopEditing(this,{source:z.isBatchEditing()?"ui":"api",cancel:$,event:J||Z?Q:void 0}),$)this.focusCell(!0,Q)}stopEditing(Q=!1){let{editSvc:z}=this.beans;return z?.stopEditing(this,{cancel:Q,source:z?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){let{value:Q,valueFormatted:z,column:J,rowNode:Z,comp:$,eGui:X,beans:{valueSvc:Y,gos:G,editSvc:q}}=this;return y(G,{value:Q,valueFormatted:z,getValue:()=>Y.getValueForDisplay({column:J,node:Z,from:"edit"}).value,setValue:(_)=>q?.setDataValue({rowNode:Z,column:J},_)||Z.setDataValue(J,_),formatValue:this.formatValue.bind(this),data:Z.data,node:Z,pinned:J.getPinned(),colDef:J.getColDef(),column:J,refreshCell:this.refreshCell.bind(this),eGridCell:X,eParentOfValue:$.getParentOfValue(),registerRowDragger:(_,U,W,B)=>this.registerRowDragger(_,U,B),setTooltip:(_,U)=>{if(G.assertModuleRegistered("Tooltip",3),this.tooltipFeature)this.disableTooltipFeature();this.enableTooltipFeature(_,U),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(Q){if(Q.column===this.column)this.refreshCell()}refreshOrDestroyCell(Q){if(this.refreshShouldDestroy())this.rowCtrl?.recreateCell(this);else this.refreshCell(Q);if(this.hasEdit&&this.editCompDetails){let{editSvc:z,comp:J}=this;if(!J?.getCellEditor()&&z.isEditing(this,{withOpenEditor:!0}))z.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(Q){let{editStyleFeature:z,customStyleFeature:J,rowCtrl:{rowEditStyleFeature:Z},beans:{cellFlashSvc:$,filterManager:X},column:Y,comp:G,suppressRefreshCell:q,tooltipFeature:H}=this;if(q)return;let{field:_,valueGetter:U,showRowGroup:W,enableCellChangeFlash:B}=Y.getColDef(),E=_==null&&U==null&&W==null,K=Q?.newData??!1,L=E||Q&&(Q.force||K),F=!!G,D=this.updateAndFormatValue(F),M=L||D;if(!F)return;if(M){this.showValue(!!K,!1);let k=X?.isSuppressFlashingCellsBecauseFiltering();if(!Q?.suppressFlash&&!k&&B)$?.flashCell(this);z?.applyCellStyles?.(),J?.applyUserStyles(),J?.applyClassesFromColDef(),Z?.applyRowStyles(),this.checkFormulaError()}H?.refreshTooltip(),J?.applyCellClassRules()}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(Q){return this.callValueFormatter(Q)??Q}callValueFormatter(Q){return this.beans.valueSvc.formatValue(this.column,this.rowNode,Q)}updateAndFormatValue(Q){let z=this.value,J=this.valueFormatted,{value:Z,valueFormatted:$}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});if(this.value=Z,this.valueFormatted=$,Q)return!this.valuesAreEqual(z,this.value)||this.valueFormatted!=J;return!0}valuesAreEqual(Q,z){let J=this.column.getColDef();return J.equals?J.equals(Q,z):Q===z}addDomData(Q){let z=this.eGui;wz(this.beans.gos,z,HZ,this),Q.addDestroyFunc(()=>wz(this.beans.gos,z,HZ,null))}createEvent(Q,z){let{rowNode:J,column:Z,value:$,beans:X}=this;return c3(X,Q,z,{rowNode:J,column:Z},$)}processCharacter(Q){this.keyboardListener?.processCharacter(Q)}onKeyDown(Q){this.keyboardListener?.onKeyDown(Q)}onMouseEvent(Q,z){this.mouseListener?.onMouseEvent(Q,z)}getColSpanningList(){return this.positionFeature?.getColSpanningList()??[]}onLeftChanged(){if(!this.comp)return;this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){if(!this.eGui)return;this.refreshAriaColIndex(),this.refreshFirstAndLastStyles()}refreshFirstAndLastStyles(){let{comp:Q,column:z,beans:J}=this;t9(Q,z,J.visibleCols)}refreshAriaColIndex(){let Q=this.beans.visibleCols.getAriaColIndex(this.column);v8(this.eGui,Q)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){let{rowIndex:Q,rowPinned:z}=this.cellPosition;return{rowIndex:Q,rowPinned:z}}updateRangeBordersIfRangeCount(){if(!this.comp)return;this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){if(!this.comp)return;this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.rangeFeature!=null}focusCell(Q=!1,z){let J=this.editSvc?.allowedFocusTargetOnValidation(this);if(J&&J!==this)return;this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:Q,sourceEvent:z})}restoreFocus(Q=!1){let{beans:{editSvc:z,focusSvc:J},comp:Z}=this;if(!Z||z?.isEditing(this)||!this.isCellFocused()||!J.shouldTakeFocus())return;let $=()=>{if(!this.isAlive())return;let X=Z.getFocusableElement();if(this.isCellFocused())X.focus({preventScroll:!0})};if(Q){setTimeout($,0);return}$()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(Q){let z=this.eGui;if(!z)return;Pz(z,"tabindex",Q?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;let Q=this.column.isFirstRightPinned();this.comp.toggleCss(a3,Q)}onLastLeftPinnedChanged(){if(!this.comp)return;let Q=this.column.isLastLeftPinned();this.comp.toggleCss(o3,Q)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){let Q=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=Q),Q}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(Q){let{beans:z}=this;if(qZ(z))return;if(!this.comp){if(Q)this.focusEventWhileNotReady=Q;return}let J=this.isCellFocused(),Z=z.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss(l3,J),J&&(Q?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let $=this.comp.getFocusableElement();if(Z){let Y=EQ($,null,!0);if(Y.length)$=Y[0]}let X=Q?Q.preventScrollOnBrowserFocus:!0;$.focus({preventScroll:X}),JG(z,$)}if(J&&this.focusEventWhileNotReady)this.focusEventWhileNotReady=null;if(J&&Q)this.rowCtrl.announceDescription()}createCellPosition(){let{rowIndex:Q,rowPinned:z}=this.rowNode;this.cellPosition={rowIndex:Q,rowPinned:RQ(z),column:this.column}}applyStaticCssClasses(){let{comp:Q}=this;Q.toggleCss(t3,!0),Q.toggleCss(e3,!0);let z=this.column.isAutoHeight()==!0;Q.toggleCss(r3,z),Q.toggleCss(s3,!z)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){if(!this.comp)return;if(this.column.isTooltipEnabled())this.disableTooltipFeature(),this.enableTooltipFeature();else this.disableTooltipFeature();if(this.setWrapText(),this.editSvc?.isEditing(this))this.editSvc?.handleColDefChanged(this);else this.refreshOrDestroyCell({force:!0,suppressFlash:!0})}setWrapText(){let Q=this.column.getColDef().wrapText==!0;this.comp.toggleCss(QE,Q)}dispatchCellContextMenuEvent(Q){let z=this.column.getColDef(),J=this.createEvent(Q,"cellContextMenu"),{beans:Z}=this;if(Z.eventSvc.dispatchEvent(J),z.onCellContextMenu)window.setTimeout(()=>{Z.frameworkOverrides.wrapOutgoing(()=>{z.onCellContextMenu(J)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){if(this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.isCellFocused()&&this.hasBrowserFocus())this.beans.focusSvc.attemptToRecoverFocus();super.destroy()}hasBrowserFocus(){return this.eGui?.contains(d(this.beans))??!1}createSelectionCheckbox(){let Q=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(!Q)return;return this.beans.context.createBean(Q),Q.init({rowNode:this.rowNode,column:this.column}),Q}createDndSource(){let Q=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);if(Q)this.beans.context.createBean(Q);return Q}registerRowDragger(Q,z,J){if(this.customRowDragComp){this.customRowDragComp.setDragElement(Q,z);return}let Z=this.createRowDragComp(Q,z,J);if(Z)this.customRowDragComp=Z,this.addDestroyFunc(()=>{this.beans.context.destroyBean(Z),this.customRowDragComp=null}),Z.refreshVisibility()}createRowDragComp(Q,z,J){let Z=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,Q,z,J);if(!Z)return;return this.beans.context.createBean(Z),Z}cellEditorAttached(){for(let Q of this.onEditorAttachedFuncs)Q();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(Q){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!v0(this.column)||!this.eGui)return;let{ariaRowIndex:Q}=this.rowCtrl;if(Q!=null)eJ(this.eGui,Q)}getRootElement(){return this.eGui}};function d$(Q,z,J,Z,$,X){if(J==null&&z==null)return;let Y={},G={},q=(H,_)=>{for(let U of H.split(" ")){if(U.trim()=="")continue;_(U)}};if(J){let H=Object.keys(J);for(let _=0;_{if(B)Y[E]=!0;else G[E]=!0})}}if(z&&X)for(let H of Object.keys(z))q(H,(_)=>{if(!Y[_])G[_]=!0});if(X)Object.keys(G).forEach(X);Object.keys(Y).forEach($)}function e7(Q){if(Q.group)return Q.level;let z=Q.parent;return z?z.level+1:0}var JE=0,F5=class extends j{constructor(Q,z,J,Z,$){super();this.rowNode=Q,this.useAnimationFrameForCreate=Z,this.printLayout=$,this.focusEventWhileNotReady=null,this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.ariaRowIndex=null,this.businessKey=null,this.beans=z,this.gos=z.gos,this.paginationPage=z.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=Q.id+"-"+JE++,this.rowId=W0(Q.id),this.initRowBusinessKey(),this.rowFocused=z.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=e7(this.rowNode),this.setRowType(),this.setAnimateFlags(J),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=z.editSvc?.createRowStyleFeature(this),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!=="function")return;let Q=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=W0(Q)}updateGui(Q,z){if(Q==="left")this.leftGui=z;else if(Q==="right")this.rightGui=z;else if(Q==="fullWidth")this.fullWidthGui=z;else this.centerGui=z}setComp(Q,z,J,Z){let{context:$,rowRenderer:X}=this.beans;Z=BJ(this,$,Z);let Y={rowComp:Q,element:z,containerType:J,compBean:Z};this.allRowGuis.push(Y),this.updateGui(J,Y),this.initialiseRowComp(Y);let G=this.rowNode,q=this.rowType==="FullWidthLoading"||G.stub,H=!G.data&&this.beans.rowModel.getType()==="infinite";if(!q&&!H&&!G.rowPinned)X.dispatchFirstDataRenderedEvent();this.setupFocus()}unsetComp(Q){this.allRowGuis=this.allRowGuis.filter((z)=>z.containerType!==Q),this.updateGui(Q,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(Q){let z=Q?"none":"";for(let J of this.allRowGuis)J.element.style.display=z}initialiseRowComp(Q){let z=this.gos;if(this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(Q),this.onRowHeightChanged(Q),this.updateRowIndexes(Q),this.setFocusedClasses(Q),this.setStylesFromGridOptions(!1,Q),hQ(z)&&this.rowNode.selectable)this.onRowSelected(Q);this.updateColumnLists(!this.useAnimationFrameForCreate);let J=Q.rowComp,Z=this.getInitialRowClasses(Q.containerType);for(let $ of Z)J.toggleCss($,!0);if(this.executeSlideAndFadeAnimations(Q),this.rowNode.group)w0(Q.element,!!this.rowNode.expanded);if(this.setRowCompRowId(J),this.setRowCompRowBusinessKey(J),wz(z,Q.element,_Z,this),Q.compBean.addDestroyFunc(()=>wz(z,Q.element,_Z,null)),this.useAnimationFrameForCreate)this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,Q),this.rowNode.rowIndex,"p2",!1);else this.addHoverFunctionality(Q);if(this.isFullWidth())this.setupFullWidth(Q);if(z.get("rowDragEntireRow"))this.addRowDraggerToRow(Q);if(this.useAnimationFrameForCreate)this.beans.animationFrameSvc.addDestroyTask(()=>{if(!this.isAlive())return;Q.rowComp.toggleCss("ag-after-created",!0)});this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(Q){if(this.businessKey==null)return;Q.setRowBusinessKey(this.businessKey)}setRowCompRowId(Q){let z=W0(this.rowNode.id);if(this.rowId=z,z==null)return;Q.setRowId(z)}executeSlideAndFadeAnimations(Q){let{containerType:z}=Q;if(this.slideInAnimation[z])e2(()=>{this.onTopChanged()}),this.slideInAnimation[z]=!1;if(this.fadeInAnimation[z])e2(()=>{Q.rowComp.toggleCss("ag-opacity-zero",!1)}),this.fadeInAnimation[z]=!1}addRowDraggerToRow(Q){let z=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,Q.element);if(!z)return;let J=this.createBean(z,this.beans.context);this.rowDragComps.push(J),Q.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter((Z)=>Z!==J),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean(J,this.beans.context)})}setupFullWidth(Q){let z=this.getPinnedForContainer(Q.containerType),J=this.createFullWidthCompDetails(Q.element,z);Q.rowComp.showFullWidth(J)}getFullWidthCellRenderers(){if(this.gos.get("embedFullWidthRows"))return this.allRowGuis.map((Q)=>Q?.rowComp?.getFullWidthCellRenderer());return[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){let Q=this.gos.getCallback("processRowPostCreate");if(!Q||!this.areAllContainersReady())return;let z={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};Q(z)}areAllContainersReady(){let{leftGui:Q,centerGui:z,rightGui:J,beans:{visibleCols:Z}}=this,$=!!Q||!Z.isPinningLeft(),X=!!z,Y=!!J||!Z.isPinningRight();return $&&X&&Y}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;let Q=this.beans.gos.getCallback("isFullWidthRow");return Q?Q({rowNode:this.rowNode}):!1}setRowType(){let{rowNode:Q,gos:z,beans:{colModel:J}}=this,Z=Q.stub&&!z.get("suppressServerSideFullWidthLoadingRow")&&!z.get("groupHideOpenParents"),$=this.isNodeFullWidthCell(),X=z.get("masterDetail")&&Q.detail,Y=J.isPivotMode(),G=G9(z,Q,Y);if(Z)this.rowType="FullWidthLoading";else if(X)this.rowType="FullWidthDetail";else if($)this.rowType="FullWidth";else if(G)this.rowType="FullWidthGroup";else this.rowType="Normal"}updateColumnLists(Q=!1,z=!1){if(this.isFullWidth())return;let{animationFrameSvc:J}=this.beans;if(!J?.active||Q||this.printLayout){this.updateColumnListsImpl(z);return}if(this.updateColumnListsPending)return;J.createTask(()=>{if(!this.active)return;this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0}getNewCellCtrl(Q){if(this.beans.rowSpanSvc?.isCellSpanning(Q,this.rowNode))return;return new u1(Q,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(Q){return!this.beans.rowSpanSvc?.isCellSpanning(Q.column,this.rowNode)}createCellCtrls(Q,z,J=null){let Z={list:[],map:{}},$=(H,_,U)=>{if(U!=null)Z.list.splice(U,0,_);else Z.list.push(_);Z.map[H]=_},X=[];for(let H of z){let _=H.getInstanceId(),U=Q.map[_];if(U&&!this.isCorrectCtrlForSpan(U))U.destroy(),U=void 0;if(!U)U=this.getNewCellCtrl(H);if(!U)continue;$(_,U)}for(let H of Q.list){let _=H.column.getInstanceId();if(Z.map[_]!=null)continue;if(!this.isCellEligibleToBeRemoved(H,J))X.push([_,H]);else H.destroy()}if(X.length)for(let[H,_]of X){let U=Z.list.findIndex((B)=>B.column.getLeft()>_.column.getLeft()),W=U===-1?void 0:Math.max(U-1,0);$(H,_,W)}let{focusSvc:Y,visibleCols:G}=this.beans,q=Y.getFocusedCell();if(q&&q.column.getPinned()==J){let H=q.column.getInstanceId();if(!Z.map[H]&&G.allCols.includes(q.column)){let U=this.createFocusedCellCtrl();if(U){let W=Z.list.findIndex((E)=>E.column.getLeft()>U.column.getLeft()),B=W===-1?void 0:Math.max(W-1,0);$(H,U,B)}}}return Z}createFocusedCellCtrl(){let{focusSvc:Q,rowSpanSvc:z}=this.beans,J=Q.getFocusedCell();if(!J)return;let Z=z?.getCellSpan(J.column,this.rowNode);if(Z){if(Z.firstNode!==this.rowNode||!Z.doesSpanContain(J))return}else if(!Q.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl(J.column)}updateColumnListsImpl(Q){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(Q)}setCellCtrls(Q){for(let z of this.allRowGuis){let J=this.getCellCtrlsForContainer(z.containerType);z.rowComp.setCellCtrls(J,Q)}}getCellCtrlsForContainer(Q){switch(Q){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){let Q=this.beans.colViewport,z=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,z.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{let J=Q.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,J);let Z=z.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,Z,"left");let $=z.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,$,"right")}}isCellEligibleToBeRemoved(Q,z){let{column:$}=Q;if($.getPinned()!=z)return!0;if(!this.isCorrectCtrlForSpan(Q))return!0;let{visibleCols:X,editSvc:Y}=this.beans,G=Y?.isEditing(Q),q=Q.isCellFocused();if(G||q)return X.allCols.indexOf($)>=0?!1:!0;return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||V0(this.gos,"print")}listenOnDomOrder(Q){let z=()=>{Q.rowComp.setDomOrder(this.getDomOrder())};Q.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],z)}setAnimateFlags(Q){if(this.rowNode.sticky||!Q)return;let z=T(this.rowNode.oldRowTop),{visibleCols:J}=this.beans,Z=J.isPinningLeft(),$=J.isPinningRight();if(z){let{slideInAnimation:X}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){X.fullWidth=!0;return}X.center=!0,X.left=Z,X.right=$}else{let{fadeInAnimation:X}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){X.fullWidth=!0;return}X.center=!0,X.left=Z,X.right=$}}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){let Q=(Y,G)=>{if(!Y)return!0;return Y.rowComp.refreshFullWidth(()=>{return this.createFullWidthCompDetails(Y.element,G).params})},z=Q(this.fullWidthGui,null),J=Q(this.centerGui,null),Z=Q(this.leftGui,"left"),$=Q(this.rightGui,"right");return z&&J&&Z&&$}addListeners(){let{beans:Q,gos:z,rowNode:J}=this,{expansionSvc:Z,eventSvc:$,context:X,rowSpanSvc:Y}=Q;if(this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...Z?.getRowExpandedListeners(this)??{}}),J.detail)this.addManagedListeners(J.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)});if(this.addManagedListeners(J,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners($,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),Y)this.addManagedListeners(Y,{spannedCellsUpdated:({pinned:G})=>{if(G&&!J.rowPinned)return;this.updateColumnLists()}});this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,X),this.tooltipFeature=this.destroyBean(this.tooltipFeature,X),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,X)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(z.get("rowDragEntireRow")){for(let q of this.allRowGuis)this.addRowDraggerToRow(q);return}this.rowDragComps=this.destroyBeans(this.rowDragComps,X)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{for(let Q of this.getAllCellCtrls())Q.onRowIndexChanged()},cellChanged:(Q)=>{for(let z of this.getAllCellCtrls())z.onCellChanged(Q)}})}onRowPinned(){for(let Q of this.allRowGuis)Q.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(Q){this.refreshRow({suppressFlash:!Q.update,newData:!Q.update})}refreshRow(Q){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){if(!this.refreshFullWidth())this.beans.rowRenderer.redrawRow(this.rowNode);return}for(let J of this.getAllCellCtrls())J.refreshCell(Q);for(let J of this.allRowGuis)this.setRowCompRowId(J.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(J.rowComp);this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.rowEditStyleFeature?.applyRowStyles(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){let Q=this.beans.rowDropHighlightSvc,z=Q?.row===this.rowNode?Q.position:"none",J=z==="above",Z=z==="inside",$=z==="below",X=z!=="none",Y=J||$,G=this.rowNode.uiLevel,q=Y&&G>0,H=q?G.toString():"0";for(let _ of this.allRowGuis){let U=_.rowComp;if(U.toggleCss("ag-row-highlight-above",J),U.toggleCss("ag-row-highlight-inside",Z),U.toggleCss("ag-row-highlight-below",$),U.toggleCss("ag-row-highlight-indent",q),X)_.element.style.setProperty("--ag-row-highlight-level",H);else _.element.style.removeProperty("--ag-row-highlight-level")}}postProcessRowDragging(){let Q=this.rowNode.dragging;for(let z of this.allRowGuis)z.rowComp.toggleCss("ag-row-dragging",Q)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:RQ(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(Q){let z=this.findFullWidthInfoForEvent(Q);if(!z)return;let{rowGui:J,column:Z}=z;if(J.element!==Q.target)return;let Y=this.rowNode,{focusSvc:G,navigation:q}=this.beans,H=G.getFocusedCell(),_={rowIndex:Y.rowIndex,rowPinned:Y.rowPinned,column:H?.column??Z};q?.navigateToNextCell(Q,Q.key,_,!0),Q.preventDefault()}onTabKeyDown(Q){if(Q.defaultPrevented||zQ(Q))return;let z=this.allRowGuis.find((G)=>G.element.contains(Q.target)),J=z?z.element:null,Z=J===Q.target,$=d(this.beans),X=!1;if(J&&$)X=J.contains($)&&$.classList.contains("ag-cell");let Y=null;if(!Z&&!X)Y=R0(this.beans,J,!1,Q.shiftKey);if(this.isFullWidth()&&Z||!Y)this.beans.navigation?.onTabKeyDown(this,Q)}getFullWidthElement(){if(this.fullWidthGui)return this.fullWidthGui.element;return null}getRowYPosition(){let Q=this.allRowGuis.find((z)=>f0(z.element))?.element;if(Q)return Q.getBoundingClientRect().top;return 0}onSuppressCellFocusChanged(Q){let z=this.isFullWidth()&&Q?void 0:this.gos.get("tabIndex");for(let J of this.allRowGuis)Pz(J.element,"tabindex",z)}setupFocus(){if(!this.isFullWidth())return;this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0)}restoreFullWidthFocus(Q=!1){let{focusSvc:z,editSvc:J}=this.beans;if(J?.isEditing(this))return;if(!z.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!z.shouldTakeFocus())return;let Z=this.getFullWidthRowGuiForFocus();if(!Z)return;let $=()=>{if(!this.isAlive())return;if(z.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))Z.element.focus({preventScroll:!0})};if(Q){setTimeout($,0);return}$()}getFullWidthRowGuiForFocus(Q){if(this.fullWidthGui)return this.fullWidthGui;let z=this.beans.focusSvc.getFocusedCell(),J=this.beans.colModel.getCol(Q?.column??z?.column);if(!J)return;let Z=J?.pinned;if(Z==="right")return this.rightGui;if(Z==="left")return this.leftGui;return this.centerGui}setFullWidthRowFocusedClass(Q,z){this.forEachGui(void 0,(J)=>{J.element.classList.toggle("ag-full-width-focus",z&&J===Q)})}onFullWidthRowFocused(Q){let{focusSvc:z}=this.beans;if(!(this.isFullWidth()&&z.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))){this.setFullWidthRowFocusedClass(void 0,!1);return}let Z=this.getFullWidthRowGuiForFocus(Q);if(!Z){if(Q)this.focusEventWhileNotReady=Q;this.setFullWidthRowFocusedClass(void 0,!1);return}if(this.setFullWidthRowFocusedClass(Z,!0),this.focusEventWhileNotReady=null,Q?.forceBrowserFocus)Z.element.focus({preventScroll:!0})}recreateCell(Q){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,Q),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,Q),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,Q),Q.destroy(),this.updateColumnLists()}removeCellCtrl(Q,z){let J={list:[],map:{}};for(let Z of Q.list){if(Z===z)continue;J.list.push(Z),J.map[Z.column.getInstanceId()]=Z}return J}onMouseEvent(Q,z){switch(Q){case"dblclick":this.onRowDblClick(z);break;case"click":this.onRowClick(z);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(z);break}}createRowEvent(Q,z){let{rowNode:J}=this;return y(this.gos,{type:Q,node:J,data:J.data,rowIndex:J.rowIndex,rowPinned:J.rowPinned,event:z})}createRowEventWithSource(Q,z){let J=this.createRowEvent(Q,z);return J.source=this,J}onRowDblClick(Q){if(zQ(Q))return;let z=this.createRowEventWithSource("rowDoubleClicked",Q);z.isEventHandlingSuppressed=this.isSuppressMouseEvent(Q),this.beans.eventSvc.dispatchEvent(z)}findFullWidthInfoForEvent(Q){if(!Q)return;let z=this.findFullWidthRowGui(Q.target),J=this.getColumnForFullWidth(z);if(!z||!J)return;return{rowGui:z,column:J}}findFullWidthRowGui(Q){return this.allRowGuis.find((z)=>z.element.contains(Q))}getColumnForFullWidth(Q){let{visibleCols:z}=this.beans;switch(Q?.containerType){case"center":return z.centerCols[0];case"left":return z.leftCols[0];case"right":return z.rightCols[0];default:return z.allCols[0]}}onRowMouseDown(Q){if(this.lastMouseDownOnDragger=vz(Q.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(Q))return;let{rangeSvc:z,focusSvc:J}=this.beans;z?.removeAllCellRanges();let Z=this.findFullWidthInfoForEvent(Q);if(!Z)return;let{rowGui:$,column:X}=Z,Y=$.element,G=Q.target,q=this.rowNode,H=Q.defaultPrevented||cz();if(Y&&Y.contains(G)&&w1(G))H=!1;J.setFocusedCell({rowIndex:q.rowIndex,column:X,rowPinned:q.rowPinned,forceBrowserFocus:H})}isSuppressMouseEvent(Q){let{gos:z,rowNode:J}=this;if(this.isFullWidth()){let $=this.findFullWidthRowGui(Q.target);return sH(z,$?.rowComp.getFullWidthCellRendererParams(),J,Q)}let Z=EJ(z,Q.target);return Z!=null&&rJ(z,Z.column,J,Q)}onRowClick(Q){if(zQ(Q)||this.lastMouseDownOnDragger)return;let J=this.isSuppressMouseEvent(Q),{eventSvc:Z,selectionSvc:$}=this.beans,X=this.createRowEventWithSource("rowClicked",Q);if(X.isEventHandlingSuppressed=J,Z.dispatchEvent(X),J)return;$?.handleSelectionEvent(Q,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(Q){if(this.rowType!=="FullWidthDetail")return;this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,Q)}createFullWidthCompDetails(Q,z){let{gos:J,rowNode:Z}=this,$=y(J,{fullWidth:!0,data:Z.data,node:Z,value:Z.key,valueFormatted:Z.key,eGridCell:Q,eParentOfValue:Q,pinned:z,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(Y,G,q,H)=>this.addFullWidthRowDragging(Y,G,q,H),setTooltip:(Y,G)=>{J.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(Y,G)}}),X=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return wq(X,$);case"FullWidthGroup":{let{value:Y,valueFormatted:G}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return $.value=Y,$.valueFormatted=G,xq(X,$)}case"FullWidthLoading":return yq(X,$);default:return bq(X,$)}}setupFullWidthRowTooltip(Q,z){if(!this.fullWidthGui)return;this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,Q,z)}addFullWidthRowDragging(Q,z,J="",Z){let{rowDragSvc:$,context:X}=this.beans;if(!$||!this.isFullWidth())return;let Y=$.createRowDragComp(()=>J,this.rowNode,void 0,Q,z,Z);this.createBean(Y,X),this.addDestroyFunc(()=>{this.destroyBean(Y,X)})}onUiLevelChanged(){let Q=e7(this.rowNode);if(this.rowLevel!=Q){let z="ag-row-level-"+Q,J="ag-row-level-"+this.rowLevel;for(let Z of this.allRowGuis)Z.rowComp.toggleCss(z,!0),Z.rowComp.toggleCss(J,!1)}this.rowLevel=Q}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){let Q=this.isFirstRowOnPage(),z=this.isLastRowOnPage();if(this.firstRowOnPage!==Q){this.firstRowOnPage=Q;for(let J of this.allRowGuis)J.rowComp.toggleCss("ag-row-first",Q)}if(this.lastRowOnPage!==z){this.lastRowOnPage=z;for(let J of this.allRowGuis)J.rowComp.toggleCss("ag-row-last",z)}}getAllCellCtrls(){if(this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){let Q=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(Q,this.rowNode),!Q.length)return;for(let z of Q)for(let J of this.allRowGuis)J.rowComp.toggleCss(z,!0)}postProcessRowClassRules(){this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,(Q)=>{for(let z of this.allRowGuis)z.rowComp.toggleCss(Q,!0)},(Q)=>{for(let z of this.allRowGuis)z.rowComp.toggleCss(Q,!1)})}setStylesFromGridOptions(Q,z){if(Q)this.rowStyles=this.processStylesFromGridOptions();this.forEachGui(z,(J)=>J.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(Q){if(Q==="left"||Q==="right")return Q;return null}getInitialRowClasses(Q){let z=this.getPinnedForContainer(Q),J=this.isFullWidth(),{rowNode:Z,beans:$}=this,X=[];if(X.push("ag-row"),X.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[Q])X.push("ag-opacity-zero");if(X.push(Z.rowIndex%2===0?"ag-row-even":"ag-row-odd"),Z.isRowPinned()){if(X.push("ag-row-pinned"),$.pinnedRowModel?.isManual())X.push("ag-row-pinned-manual")}if(!Z.isRowPinned()&&Z.pinnedSibling)X.push("ag-row-pinned-source");if(Z.isSelected())X.push("ag-row-selected");if(Z.footer)X.push("ag-row-footer");if(X.push("ag-row-level-"+this.rowLevel),Z.stub)X.push("ag-row-loading");if(J)X.push("ag-full-width-row");if($.expansionSvc?.addExpandedCss(X,Z),Z.dragging)X.push("ag-row-dragging");let{rowStyleSvc:Y}=$;if(Y)Y.processClassesFromGridOptions(X,Z),Y.preProcessRowClassRules(X,Z);if(X.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage())X.push("ag-row-first");if(this.isLastRowOnPage())X.push("ag-row-last");if(J){if(z==="left")X.push("ag-cell-last-left-pinned");if(z==="right")X.push("ag-cell-first-right-pinned")}return X}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(Q){this.beans.selectionSvc?.onRowCtrlSelected(this,(z)=>{if(z===this.centerGui||z===this.fullWidthGui)this.announceDescription()},Q)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(Q){if(!this.active)return;let{element:z,compBean:J}=Q,{rowNode:Z,beans:$,gos:X}=this;J.addManagedListeners(z,{pointerenter:(Y)=>{if(Y.pointerType==="mouse")Z.dispatchRowEvent("mouseEnter")},pointerleave:(Y)=>{if(Y.pointerType==="mouse")Z.dispatchRowEvent("mouseLeave")}}),J.addManagedListeners(Z,{mouseEnter:()=>{if(!$.dragSvc?.dragging&&!X.get("suppressRowHoverHighlight"))z.classList.add("ag-row-hover"),Z.setHovered(!0)},mouseLeave:()=>{this.resetHoveredStatus(z)}})}resetHoveredStatus(Q){let z=Q?[Q]:this.allRowGuis.map((J)=>J.element);for(let J of z)J.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(Q){let z=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),J=this.applyPaginationOffset(z.top,!0)-100,Z=this.applyPaginationOffset(z.bottom,!0)+100;return Math.min(Math.max(J,Q),Z)}forEachGui(Q,z){if(Q)z(Q);else for(let J of this.allRowGuis)z(J)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(Q){if(this.rowNode.rowHeight==null)return;let z=this.rowNode.rowHeight,J=this.beans.environment.getDefaultRowHeight(),$=$9(this.gos)?r1(this.beans,this.rowNode).height:void 0,X=$?`${Math.min(J,$)-2}px`:void 0;this.forEachGui(Q,(Y)=>{if(Y.element.style.height=`${z}px`,X)Y.element.style.setProperty("--ag-line-height",X)})}destroyFirstPass(Q=!1){this.active=!1;let{rowNode:z}=this;if(!Q&&_1(this.gos)&&!z.sticky)if(z.rowTop!=null){let $=this.roundRowTopToBounds(z.rowTop);this.setRowTop($)}else for(let $ of this.allRowGuis)$.rowComp.toggleCss("ag-opacity-zero",!0);if(this.fullWidthGui?.element.contains(d(this.beans)))this.beans.focusSvc.attemptToRecoverFocus();z.setHovered(!1);let J=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(J),this.beans.eventSvc.dispatchEvent(J),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;let Q=(z)=>{for(let J of z.list)J.destroy();return{list:[],map:{}}};this.centerCellCtrls=Q(this.centerCellCtrls),this.leftCellCtrls=Q(this.leftCellCtrls),this.rightCellCtrls=Q(this.rightCellCtrls)}setFocusedClasses(Q){this.forEachGui(Q,(z)=>{z.rowComp.toggleCss("ag-row-focus",this.rowFocused),z.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){let{focusSvc:Q}=this.beans,z=Q.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);if(z!==this.rowFocused)this.rowFocused=z,this.setFocusedClasses()}onPaginationChanged(){let Q=this.beans.pagination?.getCurrentPage()??0;if(this.paginationPage!==Q)this.paginationPage=Q,this.onTopChanged();this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(Q,z=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return Q;let J=this.beans.pageBounds.getPixelOffset();return Q+J*(z?1:-1)}setRowTop(Q){if(this.printLayout)return;if(T(Q)){let z=this.applyPaginationOffset(Q),$=`${this.rowNode.isRowPinned()||this.rowNode.sticky?z:this.beans.rowContainerHeight.getRealPixelPosition(z)}px`;this.setRowTopStyle($)}}getInitialRowTop(Q){return this.suppressRowTransform?this.getInitialRowTopShared(Q):void 0}getInitialTransform(Q){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(Q)})`}getInitialRowTopShared(Q){if(this.printLayout)return"";let z=this.rowNode,J;if(z.sticky)J=z.stickyRowTop;else{let Z=this.slideInAnimation[Q]?this.roundRowTopToBounds(z.oldRowTop):z.rowTop,$=this.applyPaginationOffset(Z);J=z.isRowPinned()?$:this.beans.rowContainerHeight.getRealPixelPosition($)}return J+"px"}setRowTopStyle(Q){for(let z of this.allRowGuis)if(this.suppressRowTransform)z.rowComp.setTop(Q);else z.rowComp.setTransform(`translateY(${Q})`)}getCellCtrl(Q,z=!1){let J=null;for(let Z of this.getAllCellCtrls())if(Z.column==Q)J=Z;if(J!=null||z)return J;for(let Z of this.getAllCellCtrls())if(Z?.getColSpanningList().indexOf(Q)>=0)J=Z;return J}onRowIndexChanged(){if(this.rowNode.rowIndex!=null)this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss()}updateRowIndexes(Q){let z=this.rowNode.getRowIndexString();if(z===null)return;let J=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),Z=this.rowNode.rowIndex%2===0,$=this.ariaRowIndex=J+this.rowNode.rowIndex+1;this.forEachGui(Q,(X)=>{X.rowComp.setRowIndex(z),X.rowComp.toggleCss("ag-row-even",Z),X.rowComp.toggleCss("ag-row-odd",!Z),eJ(X.element,$)})}},ZE=class extends j{constructor(){super();this.beanName="navigation",this.onPageDown=E7(this.onPageDown,100),this.onPageUp=E7(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(Q)=>{this.gridBodyCon=Q.gridBodyCtrl})}handlePageScrollingKey(Q,z=!1){let{key:J,altKey:Z}=Q,$=Q.ctrlKey||Q.metaKey,X=!!this.beans.rangeSvc&&Q.shiftKey,Y=U6(this.gos,Q),G=!1;switch(J){case V.PAGE_HOME:case V.PAGE_END:if(!$&&!Z)this.onHomeOrEndKey(J),G=!0;break;case V.LEFT:case V.RIGHT:case V.UP:case V.DOWN:if(!Y)return!1;if($&&!Z&&!X)this.onCtrlUpDownLeftRight(J,Y),G=!0;break;case V.PAGE_DOWN:case V.PAGE_UP:if(!$&&!Z)G=this.handlePageUpDown(J,Y,z);break}if(G)Q.preventDefault();return G}handlePageUpDown(Q,z,J){if(J)z=this.beans.focusSvc.getFocusedCell();if(!z)return!1;if(Q===V.PAGE_UP)this.onPageUp(z);else this.onPageDown(z);return!0}navigateTo({scrollIndex:Q,scrollType:z,scrollColumn:J,focusIndex:Z,focusColumn:$,isAsync:X,rowPinned:Y}){let{scrollFeature:G}=this.gridBodyCon;if(T(J)&&!J.isPinned())G.ensureColumnVisible(J);if(T(Q))G.ensureIndexVisible(Q,z);if(!X)G.ensureIndexVisible(Z);let{focusSvc:q}=this.beans;q.setFocusedCell({rowIndex:Z,column:$,rowPinned:Y,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:Z,rowPinned:Y,column:$})}onPageDown(Q){let z=this.beans,J=t2(z),Z=this.getViewportHeight(),{pageBounds:$,rowModel:X,rowAutoHeight:Y}=z,G=$.getPixelOffset(),q=J.top+Z,H=X.getRowIndexAtPixel(q+G);if(Y?.active)this.navigateToNextPageWithAutoHeight(Q,H);else this.navigateToNextPage(Q,H)}onPageUp(Q){let z=this.beans,J=t2(z),{pageBounds:Z,rowModel:$,rowAutoHeight:X}=z,Y=Z.getPixelOffset(),G=J.top,q=$.getRowIndexAtPixel(G+Y);if(X?.active)this.navigateToNextPageWithAutoHeight(Q,q,!0);else this.navigateToNextPage(Q,q,!0)}navigateToNextPage(Q,z,J=!1){let{pageBounds:Z,rowModel:$}=this.beans,X=this.getViewportHeight(),Y=Z.getFirstRow(),G=Z.getLastRow(),q=Z.getPixelOffset(),H=$.getRow(Q.rowIndex),_=J?H?.rowHeight-X-q:X-q,U=H?.rowTop+_,W=$.getRowIndexAtPixel(U+q);if(W===Q.rowIndex){let E=J?-1:1;z=W=Q.rowIndex+E}let B;if(J){if(B="bottom",WG)W=G;if(z>G)z=G}if(this.isRowTallerThanView($.getRow(W)))z=W,B="top";this.navigateTo({scrollIndex:z,scrollType:B,scrollColumn:null,focusIndex:W,focusColumn:Q.column})}navigateToNextPageWithAutoHeight(Q,z,J=!1){this.navigateTo({scrollIndex:z,scrollType:J?"bottom":"top",scrollColumn:null,focusIndex:z,focusColumn:Q.column}),setTimeout(()=>{let Z=this.getNextFocusIndexForAutoHeight(Q,J);this.navigateTo({scrollIndex:z,scrollType:J?"bottom":"top",scrollColumn:null,focusIndex:Z,focusColumn:Q.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(Q,z=!1){let J=z?-1:1,Z=this.getViewportHeight(),{pageBounds:$,rowModel:X}=this.beans,Y=$.getLastRow(),G=0,q=Q.rowIndex;while(q>=0&&q<=Y){let H=X.getRow(q);if(H){let _=H.rowHeight??0;if(G+_>Z)break;G+=_}q+=J}return Math.max(0,Math.min(q,Y))}getViewportHeight(){let Q=this.beans,z=t2(Q),J=this.beans.scrollVisibleSvc.getScrollbarWidth(),Z=z.bottom-z.top;if(Q.ctrlsSvc.get("center").isHorizontalScrollShowing())Z-=J;return Z}isRowTallerThanView(Q){if(!Q)return!1;let z=Q.rowHeight;if(typeof z!=="number")return!1;return z>this.getViewportHeight()}onCtrlUpDownLeftRight(Q,z){let J=this.beans.cellNavigation.getNextCellToFocus(Q,z,!0);if(!J)return;let Z=this.getNormalisedPosition(J),{rowIndex:$,rowPinned:X,column:Y}=Z??J,G=Y;this.navigateTo({scrollIndex:$,scrollType:null,scrollColumn:G,focusIndex:$,focusColumn:G,rowPinned:X})}onHomeOrEndKey(Q){let z=Q===V.PAGE_HOME,{visibleCols:J,pageBounds:Z,rowModel:$}=this.beans,X=J.allCols,Y=z?Z.getFirstRow():Z.getLastRow(),G=$.getRow(Y);if(!G)return;let q=(z?X:[...X].reverse()).find((H)=>!H.isSuppressNavigable(G)&&!v0(H));if(!q)return;this.navigateTo({scrollIndex:Y,scrollType:null,scrollColumn:q,focusIndex:Y,focusColumn:q})}onTabKeyDown(Q,z){let J=z.shiftKey,Z=this.tabToNextCellCommon(Q,J,z),$=this.beans,{ctrlsSvc:X,pageBounds:Y,focusSvc:G,gos:q}=$;if(Z!==!1){if(Z)z.preventDefault();else if(Z===null)X.get("gridCtrl").allowFocusForNextCoreContainer(J);return}if(J){let{rowIndex:H,rowPinned:_}=Q.getRowPosition();if(_?H===0:H===Y.getFirstRow())if(q.get("headerHeight")===0||_Q($))$Q($,!0,!0);else z.preventDefault(),G.focusPreviousFromFirstCell(z)}else{if(Q instanceof u1)Q.focusCell(!0);if(G.focusOverlay(!1)||$Q($,J))z.preventDefault()}}tabToNextCell(Q,z){let J=this.beans,{focusSvc:Z,rowRenderer:$}=J,X=Z.getFocusedCell();if(!X)return!1;let Y=e0(J,X);if(!Y){if(Y=$.getRowByPosition(X),!Y?.isFullWidth())return!1}return!!this.tabToNextCellCommon(Y,Q,z,"api")}tabToNextCellCommon(Q,z,J,Z="ui"){let{editSvc:$,focusSvc:X}=this.beans,Y=void 0,G=Q instanceof u1?Q:Q.getAllCellCtrls()?.[0];if($?.isEditing())Y=$?.moveToNextCell(G,z,J,Z);else Y=this.moveToNextCellNotEditing(Q,z,J);if(Y===null)return Y;return Y||!!X.focusedHeader}moveToNextCellNotEditing(Q,z,J){let Z=this.beans.visibleCols.allCols,$;if(Q instanceof F5){if($={...Q.getRowPosition(),column:z?Z[0]:b(Z)},this.gos.get("embedFullWidthRows")&&J){let Y=Q.findFullWidthInfoForEvent(J);if(Y)$.column=Y.column}}else $=Q.getFocusedCellPosition();let X=this.findNextCellToFocusOn($,{backwards:z,startEditing:!1});if(X===!1)return null;if(X instanceof u1)X.focusCell(!0);else if(X)return this.tryToFocusFullWidthRow(X,z);return T(X)}findNextCellToFocusOn(Q,{backwards:z,startEditing:J,skipToNextEditableCell:Z}){let $=Q,X=this.beans,{cellNavigation:Y,gos:G,focusSvc:q,rowRenderer:H}=X;while(!0){if(Q!==$)Q=$;if(!z)$=this.getLastCellOfColSpan($);$=Y.getNextTabbedCell($,z);let _=G.getCallback("tabToNextCell");if(T(_)){let E=_({backwards:z,editing:J,previousCellPosition:Q,nextCellPosition:$?$:null});if(E===!0)$=Q;else if(E===!1)return!1;else $={rowIndex:E.rowIndex,column:E.column,rowPinned:E.rowPinned}}if(!$)return null;if($.rowIndex<0){let B=l0(X);return q.focusHeaderPosition({headerPosition:{headerRowIndex:B+$.rowIndex,column:$.column},fromCell:!0}),null}let U=G.get("editType")==="fullRow";if(J&&(!U||Z)){if(!this.isCellEditable($))continue}this.ensureCellVisible($);let W=e0(X,$);if(!W){let B=H.getRowByPosition($);if(!B||!B.isFullWidth()||J)continue;return{...B.getRowPosition(),column:$?.column}}if(Y.isSuppressNavigable(W.column,W.rowNode))continue;return W.setFocusedCellPosition($),this.setRangeToCellIfSupported($),W}}isCellEditable(Q){let z=this.lookupRowNodeForCell(Q);if(z)return Q.column.isCellEditable(z);return!1}lookupRowNodeForCell({rowIndex:Q,rowPinned:z}){let{pinnedRowModel:J,rowModel:Z}=this.beans;if(z==="top")return J?.getPinnedTopRow(Q);if(z==="bottom")return J?.getPinnedBottomRow(Q);return Z.getRow(Q)}navigateToNextCell(Q,z,J,Z){let $=J,X=!1,Y=this.beans,{cellNavigation:G,focusSvc:q,gos:H}=Y;while($&&($===J||!this.isValidNavigateCell($))){if(H.get("enableRtl")){if(z===V.LEFT)$=this.getLastCellOfColSpan($)}else if(z===V.RIGHT)$=this.getLastCellOfColSpan($);$=G.getNextCellToFocus(z,$),X=n($)}if(X&&Q&&Q.key===V.UP)$={rowIndex:-1,rowPinned:null,column:J.column};if(Z){let U=H.getCallback("navigateToNextCell");if(T(U)){let B=U({key:z,previousCellPosition:J,nextCellPosition:$?$:null,event:Q});if(T(B))$={rowPinned:B.rowPinned,rowIndex:B.rowIndex,column:B.column};else $=null}}if(!$)return;if($.rowIndex<0){let U=l0(Y);q.focusHeaderPosition({headerPosition:{headerRowIndex:U+$.rowIndex,column:$.column??J.column},event:Q||void 0,fromCell:!0});return}let _=this.getNormalisedPosition($);if(_)this.focusPosition(_);else this.tryToFocusFullWidthRow($)}getNormalisedPosition(Q){if(!!this.beans.spannedRowRenderer?.getCellByPosition(Q))return Q;this.ensureCellVisible(Q);let J=e0(this.beans,Q);if(!J)return null;return Q=J.getFocusedCellPosition(),this.ensureCellVisible(Q),Q}tryToFocusFullWidthRow(Q,z){let{visibleCols:J,rowRenderer:Z,focusSvc:$,eventSvc:X}=this.beans,Y=J.allCols;if(!Z.getRowByPosition(Q)?.isFullWidth())return!1;let q=$.getFocusedCell(),H={rowIndex:Q.rowIndex,rowPinned:Q.rowPinned,column:Q.column||(z?b(Y):Y[0])};this.focusPosition(H);let _=z==null?q!=null&&q0(H,q):z;return X.dispatchEvent({type:"fullWidthRowFocused",rowIndex:H.rowIndex,rowPinned:H.rowPinned,column:H.column,isFullWidthCell:!0,fromBelow:_}),!0}focusPosition(Q){let{focusSvc:z}=this.beans;z.setFocusedCell({rowIndex:Q.rowIndex,column:Q.column,rowPinned:Q.rowPinned,forceBrowserFocus:!0}),this.setRangeToCellIfSupported(Q)}setRangeToCellIfSupported(Q){if(v0(Q.column))return;this.beans.rangeSvc?.setRangeToCell(Q)}isValidNavigateCell(Q){return!!M0(this.beans,Q)}getLastCellOfColSpan(Q){let z=e0(this.beans,Q);if(!z)return Q;let J=z.getColSpanningList();if(J.length===1)return Q;return{rowIndex:Q.rowIndex,column:b(J),rowPinned:Q.rowPinned}}ensureCellVisible(Q){let z=k1(this.gos),J=this.beans.rowModel.getRow(Q.rowIndex),Z=z&&J?.sticky,{scrollFeature:$}=this.gridBodyCon;if(!Z&&n(Q.rowPinned))$.ensureIndexVisible(Q.rowIndex);if(!Q.column.isPinned())$.ensureColumnVisible(Q.column)}ensureColumnVisible(Q){let z=this.gridBodyCon.scrollFeature;if(!Q.isPinned())z.ensureColumnVisible(Q)}ensureRowVisible(Q){this.gridBodyCon.scrollFeature.ensureIndexVisible(Q)}};function t2(Q){return Q.ctrlsSvc.getScrollFeature().getVScrollPosition()}var iz={moduleName:"KeyboardNavigation",version:p,beans:[ZE,f3,yB],apiFunctions:{getFocusedCell:A3,clearFocusedCell:j3,setFocusedCell:R3,setFocusedHeader:P3,tabToNextCell:S3,tabToPreviousCell:O3}},$E=class extends j{constructor(){super(...arguments);this.beanName="pageBoundsListener"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(Q){this.calculatePages(),this.eventSvc.dispatchEvent({type:"paginationChanged",animate:Q?.animate??!1,newData:Q?.newData??!1,newPage:Q?.newPage??!1,newPageSize:Q?.newPageSize??!1,keepRenderedRows:Q?.keepRenderedRows??!1})}calculatePages(){let{pageBounds:Q,pagination:z,rowModel:J}=this.beans;if(z)z.calculatePages();else Q.calculateBounds(0,J.getRowCount()-1)}},XE=class extends j{constructor(){super(...arguments);this.beanName="pageBounds",this.pixelOffset=0}getFirstRow(){return this.topRowBounds?.rowIndex??-1}getLastRow(){return this.bottomRowBounds?.rowIndex??-1}getCurrentPageHeight(){let{topRowBounds:Q,bottomRowBounds:z}=this;if(!Q||!z)return 0;return Math.max(z.rowTop+z.rowHeight-Q.rowTop,0)}getCurrentPagePixelRange(){let{topRowBounds:Q,bottomRowBounds:z}=this,J=Q?.rowTop??0,Z=z?z.rowTop+z.rowHeight:0;return{pageFirstPixel:J,pageLastPixel:Z}}calculateBounds(Q,z){let{rowModel:J}=this.beans,Z=J.getRowBounds(Q);if(Z)Z.rowIndex=Q;this.topRowBounds=Z;let $=J.getRowBounds(z);if($)$.rowIndex=z;this.bottomRowBounds=$,this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){let Q=this.topRowBounds?.rowTop??0;if(this.pixelOffset===Q)return;this.pixelOffset=Q,this.eventSvc.dispatchEvent({type:"paginationPixelOffsetChanged"})}},YE=".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}",GE=class extends j{constructor(Q,z){super();this.isLeft=Q,this.elements=z,this.getWidth=Q?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[`${this.isLeft?"left":"right"}PinnedWidthChanged`]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){let Q=this.getWidth(),z=Q>0;for(let J of this.elements)if(J)N(J,z),SQ(J,Q)}},qE=class extends j{constructor(){super(...arguments);this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(z)=>{this.gridBodyCtrl=z.gridBodyCtrl});let Q=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:Q,displayedColumnsWidthChanged:Q}),this.addManagedPropertyListener("domLayout",Q)}checkContainerWidths(){let{gos:Q,visibleCols:z,eventSvc:J}=this.beans,Z=V0(Q,"print"),$=Z?0:z.getColsLeftWidth(),X=Z?0:z.getDisplayedColumnsRightWidth();if($!=this.leftWidth)this.leftWidth=$,J.dispatchEvent({type:"leftPinnedWidthChanged"});if(X!=this.rightWidth)this.rightWidth=X,J.dispatchEvent({type:"rightPinnedWidthChanged"})}keepPinnedColumnsNarrowerThanViewport(){let Q=this.gridBodyCtrl.eBodyViewport,z=xz(Q);if(z<=50)return;let J=this.getPinnedColumnsOverflowingViewport(z-50),Z=this.gos.getCallback("processUnpinnedColumns"),{columns:$,hasLockedPinned:X}=J,Y=$;if(!Y.length&&!X)return;if(Z)Y=Z({columns:Y,viewportWidth:z});if(!Y?.length)return;Y=Y.filter((G)=>!v0(G)),this.setColsPinned(Y,null,"viewportSizeFeature")}createPinnedWidthFeature(Q,...z){return new GE(Q,z)}setColsPinned(Q,z,J){let{colModel:Z,colAnimation:$,visibleCols:X,gos:Y}=this.beans;if(!Z.cols)return;if(!Q?.length)return;if(V0(Y,"print")){R(37);return}$?.start();let G;if(z===!0||z==="left")G="left";else if(z==="right")G="right";else G=null;let q=[];for(let H of Q){if(!H)continue;let _=Z.getCol(H);if(!_)continue;if(_.getPinned()!==G)this.setColPinned(_,G),q.push(_)}if(q.length)X.refresh(J),D$(this.eventSvc,q,J);$?.finish()}initCol(Q){let{pinned:z,initialPinned:J}=Q.colDef;if(z!==void 0)this.setColPinned(Q,z);else this.setColPinned(Q,J)}setColPinned(Q,z){if(z===!0||z==="left")Q.pinned="left";else if(z==="right")Q.pinned="right";else Q.pinned=null;Q.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(Q){let{scrollVisibleSvc:z}=this.beans;if(Q.pinned==null)return;let J=Q.pinned==="left",Z=Q.pinned==="right";Q.hidden=!0;let $=()=>{let X=J?this.leftWidth:this.rightWidth;if(X==null)return;let Y=X==0,G=Q.hidden!==Y,q=this.gos.get("enableRtl"),H=z.getScrollbarWidth(),U=z.verticalScrollShowing&&(q&&J||!q&&Z)?X+H:X;if(Q.comp.setPinnedContainerWidth(`${U}px`),Q.comp.setDisplayed(!Y),G)Q.hidden=Y,Q.refresh()};Q.addManagedEventListeners({leftPinnedWidthChanged:$,rightPinnedWidthChanged:$,scrollVisibilityChanged:$,scrollbarWidthChanged:$})}getHeaderResizeDiff(Q,z){if(z.getPinned()){let{leftWidth:Z,rightWidth:$}=this,X=xz(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-50;if(Z+$+Q>X)if(X>Z+$)Q=X-Z-$;else return 0}return Q}getPinnedColumnsOverflowingViewport(Q){let z=this.rightWidth??0,J=this.leftWidth??0,Z=z+J,$=!1;if(Z0){if(q0){let B=Y[H++];if(B.colDef.lockPinned){$=!0;continue}W-=B.getActualWidth(),U.push(B)}}return{columns:U,hasLockedPinned:$}}},HE={moduleName:"PinnedColumn",version:p,beans:[qE],css:[YE]},_E=class extends j0{constructor(){super();this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.lastAnnouncement="",this.updateAnnouncement=gQ(this,this.updateAnnouncement.bind(this),200)}postConstruct(){let Q=this.beans,z=Y0(Q),J=this.descriptionContainer=z.createElement("div");J.classList.add("ag-aria-description-container"),R8(J,"polite"),p4(J,"additions text"),c4(J,!0),Q.eRootDiv.appendChild(J)}announceValue(Q,z){this.pendingAnnouncements.set(z,Q),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;let Q=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.handleAnnouncementUpdate(Q)},50)}handleAnnouncementUpdate(Q){if(!this.isAlive()||!this.descriptionContainer)return;let z=Q;if(z==null||z.replace(/[ .]/g,"")==""){this.lastAnnouncement="";return}if(this.lastAnnouncement===z)z=`${z}​`;this.lastAnnouncement=z,this.descriptionContainer.textContent=z}destroy(){super.destroy();let{descriptionContainer:Q}=this;if(Q)z0(Q),Q.remove();this.descriptionContainer=null,this.pendingAnnouncements.clear()}},UE=class extends _E{},WE={moduleName:"Aria",version:p,beans:[UE]},BE=":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}",Q8="ag-delay-render",EE=class extends j{constructor(){super(...arguments);this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=new Set}hideColumns(Q){if(this.alreadyRevealed||this.requesters.has(Q))return;if(this.requesters.add(Q),!this.hideRequested)this.beans.ctrlsSvc.whenReady(this,(z)=>{z.gridBodyCtrl.eGridBody.classList.add(Q8)}),this.hideRequested=!0}revealColumns(Q){if(this.alreadyRevealed||!this.isAlive())return;if(this.requesters.delete(Q),this.requesters.size>0)return;let{renderStatus:z,ctrlsSvc:J}=this.beans;if(z){if(!z.areHeaderCellsRendered()&&this.timesRetried<5){this.timesRetried++,setTimeout(()=>this.revealColumns(Q));return}this.timesRetried=0}J.getGridBodyCtrl().eGridBody.classList.remove(Q8),this.alreadyRevealed=!0}},KE={moduleName:"ColumnDelayRender",version:p,beans:[EE],css:[BE]},nZ=class extends x{constructor(){super()}},LE={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},FE=class extends nZ{constructor(){super(...arguments);this.eExportingIcon=S,this.eExportingText=S}init(Q){let{beans:z}=this;this.setTemplate(LE);let J=h("overlayExporting",z,null);if(J)this.eExportingIcon.appendChild(J);let Z=Q.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=Z,z.ariaAnnounce.announceValue(Z,"overlay")}},DE={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},ME=class extends nZ{constructor(){super(...arguments);this.eLoadingIcon=S,this.eLoadingText=S}init(Q){let{beans:z,gos:J}=this,Z=RQ(J.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(Z??DE),!Z){let $=h("overlayLoading",z,null);if($)this.eLoadingIcon.appendChild($);let X=Q.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=X,z.ariaAnnounce.announceValue(X,"overlay")}}},kE={tag:"span",cls:"ag-overlay-no-matching-rows-center"},VE=class extends nZ{init(Q){let{beans:z}=this;this.setTemplate(kE);let J=Q.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=J,z.ariaAnnounce.announceValue(J,"overlay")}},fE={tag:"span",cls:"ag-overlay-no-rows-center"},AE=class extends nZ{init(Q){let{beans:z,gos:J}=this,Z=RQ(J.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(Z??fE),!Z){let $=Q.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=$,z.ariaAnnounce.announceValue($,"overlay")}}};function jE(Q){Q.overlays?.showLoadingOverlay()}function RE(Q){Q.overlays?.showNoRowsOverlay()}function SE(Q){Q.overlays?.hideOverlay()}var OE=".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}",PE={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},t$=class extends x{constructor(){super(PE);this.eOverlayWrapper=S,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(OE)}handleKeyDown(Q){if(Q.key!==V.TAB||Q.defaultPrevented||zQ(Q))return;let{beans:z,eOverlayWrapper:J}=this;if(J&&R0(z,J,!1,Q.shiftKey))return;let $=!1;if(Q.shiftKey)$=z.focusSvc.focusGridView({column:b(z.visibleCols.allCols),backwards:!0,canFocusOverlay:!1});else $=$Q(z,!1);if($)Q.preventDefault()}updateLayoutClasses(Q,z){let J=this.eOverlayWrapper;if(!J)return;let Z=J.classList,{AUTO_HEIGHT:$,NORMAL:X,PRINT:Y}=UQ;Z.toggle($,z.autoHeight),Z.toggle(X,z.normal),Z.toggle(Y,z.print)}postConstruct(){this.createManagedBean(new G6(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(Q){let z=this.eOverlayWrapper?.classList;if(!z){this.activeCssClass=null;return}if(this.activeCssClass)z.toggle(this.activeCssClass,!1);this.activeCssClass=Q,z.toggle(Q,!0)}showOverlay(Q,z,J){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=Q,this.overlayExclusive=J,!Q)return this.refreshWrapperPadding(),g.resolve();if(this.setWrapperTypeClass(z),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),J&&this.isGridFocused()){let Z=d(this.beans);if(Z&&!hz(this.beans))this.elToFocusAfter=Z}return Q.then((Z)=>{let $=this.eOverlayWrapper;if(!$){this.destroyBean(Z);return}if(this.activePromise!==Q){if(this.activeOverlay!==Z)this.destroyBean(Z),Z=null;return}if(this.activePromise=null,!Z)return;if(this.activeOverlay!==Z)$.appendChild(Z.getGui()),this.activeOverlay=Z;if(J&&this.isGridFocused())D0($)}),Q}refreshWrapperPadding(){if(!this.eOverlayWrapper){this.oldWrapperPadding=null;return}let Q=!!this.activeOverlay||!!this.activePromise,z=0;if(Q&&!this.overlayExclusive)z=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0;if(z!==this.oldWrapperPadding)this.oldWrapperPadding=z,this.eOverlayWrapper.style.setProperty("padding-top",`${z}px`)}destroyActiveOverlay(){this.activePromise=null;let Q=this.activeOverlay;if(!Q){this.overlayExclusive=!1,this.elToFocusAfter=null,this.refreshWrapperPadding();return}let z=this.elToFocusAfter;if(this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,z&&!this.isGridFocused())z=null;this.destroyBean(Q);let J=this.eOverlayWrapper;if(J)z0(J);z?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){let Q=d(this.beans);return!!Q&&this.beans.eGridDiv.contains(Q)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},TE={selector:"AG-OVERLAY-WRAPPER",component:t$},vE=["refresh"],DJ=(Q)=>({name:Q,optionalMethods:vE}),Oz={id:"agLoadingOverlay",overlayType:"loading",comp:DJ("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:(Q)=>{let z=Q.get("loading");return z===!1||Q.get("suppressLoadingOverlay")===!0&&z!==!0}},Y1={id:"agNoRowsOverlay",overlayType:"noRows",comp:DJ("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:(Q)=>Q.get("suppressNoRowsOverlay")},j6={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:DJ("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},EZ={id:"agExportingOverlay",overlayType:"exporting",comp:DJ("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},aJ={id:"activeOverlay",comp:DJ("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},IE=(Q)=>{if(!Q)return null;return{agLoadingOverlay:Oz,agNoRowsOverlay:Y1,agNoMatchingRowsOverlay:j6,agExportingOverlay:EZ}[Q]??aJ},CE=(Q)=>{if(!Q)return null;return{loading:Oz,noRows:Y1,noMatchingRows:j6,exporting:EZ}[Q]},bE=class extends j{constructor(){super(...arguments);this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.newColumnsLoadedCleanup=null}postConstruct(){let Q=this.gos;this.showInitialOverlay=o(Q);let z=()=>{if(this.userForcedNoRows)return;this.updateOverlay(!1)},[J,Z,$,X]=this.addManagedEventListeners({newColumnsLoaded:z,rowCountReady:()=>{this.disableInitialOverlay(),z(),Z()},rowDataUpdated:z,modelUpdated:z});this.newColumnsLoadedCleanup=J,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],(Y)=>this.onPropChange(new Set(Y.changeSet?.properties)))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(Q,z){if(!this.isAlive())return;if(!z)this.eWrapper=Q;else if(this.eWrapper===Q)this.eWrapper=void 0;this.updateOverlay(!1)}isVisible(){return!!this.currentDef}showLoadingOverlay(){this.showInitialOverlay=!1;let Q=this.gos;if(!this.eWrapper||Q.get("activeOverlay"))return;if(this.isDisabled(Oz))return;let z=Q.get("loading");if(!z&&z!==void 0)return;this.doShowOverlay(Oz)}showNoRowsOverlay(){this.showInitialOverlay=!1;let Q=this.gos;if(!this.eWrapper||Q.get("activeOverlay")||Q.get("loading")||this.isDisabled(Y1))return;this.userForcedNoRows=!0,this.doShowOverlay(Y1)}async showExportOverlay(Q){let{gos:z,beans:J}=this;if(!this.eWrapper||z.get("activeOverlay")||z.get("loading")||this.isDisabled(EZ)||this.userForcedNoRows&&this.currentDef===Y1){Q();return}let Z=this.getDesiredDefWithOverride(EZ);if(!Z){Q();return}this.exportsInProgress++,this.focusedCell=J.focusSvc.getFocusedCell(),await this.doShowOverlay(Z),await new Promise((X)=>setTimeout(()=>X()));let $=Date.now();try{Q()}finally{let X=Date.now()-$,Y=Math.max(0,300-X),G=()=>{if(this.exportsInProgress--,this.exportsInProgress===0)this.updateOverlay(!1),HH(J,this.focusedCell),this.focusedCell=null};if(Y>0)setTimeout(()=>G(),Y);else G()}}hideOverlay(){let Q=this.gos;this.showInitialOverlay=!1;let z=this.userForcedNoRows;if(this.userForcedNoRows=!1,Q.get("loading")){R(99);return}if(Q.get("activeOverlay")){R(296);return}if(this.currentDef===j6){R(297);return}if(this.doHideOverlay(),z){if(this.getOverlayDef()!==Y1)this.updateOverlay(!1)}}getOverlayWrapperSelector(){return TE}getOverlayWrapperCompClass(){return t$}onPropChange(Q){let z=Q.has("activeOverlay");if(z||Q.has("loading")){if(this.updateOverlay(z))return}let J=this.currentDef,Z=this.eWrapper?.activeOverlay;if(Z&&J){let $=Q.has("activeOverlayParams");if(J===aJ){if($)Z.refresh?.(this.makeCompParams(!0))}else{let X=J.paramsKey;if(Q.has("overlayComponentParams")||X&&Q.has(X))Z.refresh?.(this.makeCompParams(!1,X,J.overlayType))}}}updateOverlay(Q){let z=this.eWrapper;if(!z)return this.currentDef=null,!1;let J=this.getDesiredDefWithOverride(),Z=this.currentDef,$=J===aJ&&Q;if(J!==Z){if(!J)return this.disableInitialOverlay(),this.doHideOverlay();return this.doShowOverlay(J),!0}if($&&J)return z.hideOverlay(),this.doShowOverlay(J),!0;if(!J)this.disableInitialOverlay();return!1}getDesiredDefWithOverride(Q){let{gos:z}=this,J=IE(z.get("activeOverlay"));if(!J){if(J=Q??this.getOverlayDef(),J&&this.isDisabled(J))J=null}return J}getOverlayDef(){let{gos:Q,beans:z}=this,{rowModel:J}=z,Z=Q.get("loading");if(Z!==void 0){if(this.disableInitialOverlay(),Z)return Oz}else if(this.showInitialOverlay){if(!this.isDisabled(Oz)&&(!Q.get("columnDefs")||!Q.get("rowData")))return Oz;this.disableInitialOverlay()}else this.disableInitialOverlay();let X=J.getOverlayType();return CE(X)}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(Q){let{gos:z,beans:J}=this,{userCompFactory:Z}=J;this.currentDef=Q;let $=Q!==aJ,X=!!Q.exclusive;this.exclusive=X;let Y;if(Q.paramsKey&&z.get(Q.paramsKey)||Q.compKey&&z.get(Q.compKey))Y=Q.paramsKey;let G=void 0;if($){if(z.get("overlayComponent")||z.get("overlayComponentSelector"))G=Z.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,Q.paramsKey,Q.overlayType))}G??(G=Z.getCompDetailsFromGridOptions(Q.comp,$?Q.id:void 0,this.makeCompParams(!$,Y,Q.overlayType),!1));let q=G?.newAgStackInstance()??null,H=this.eWrapper?this.eWrapper.showOverlay(q,Q.wrapperCls,X):g.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(X),H}makeCompParams(Q,z,J){let{gos:Z}=this,$=Q?Z.get("activeOverlayParams"):{...Z.get("overlayComponentParams"),...z&&Z.get(z)||null,overlayType:J};return y(Z,$??{})}doHideOverlay(){let Q=!1;if(this.currentDef)this.currentDef=null,Q=!0;this.exclusive=!1;let z=this.eWrapper;if(z)z.hideOverlay(),z.refreshWrapperPadding(),this.setExclusive(!1);return Q}setExclusive(Q){if(this.oldExclusive!==Q)this.oldExclusive=Q,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"})}isDisabled(Q){let{gos:z}=this;return Q.overlayType&&z.get("suppressOverlays")?.includes(Q.overlayType)||Q.isSuppressed?.(z)===!0}},yE={moduleName:"Overlay",version:p,userComponents:{agLoadingOverlay:ME,agNoRowsOverlay:AE,agNoMatchingRowsOverlay:VE,agExportingOverlay:FE},apiFunctions:{showLoadingOverlay:jE,showNoRowsOverlay:RE,hideOverlay:SE},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[bE]},xE=class extends j{constructor(){super(...arguments);this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=mq(),d1(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;let Q=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,z=this.getUiBodyHeight();if(Q!==this.scrollY||z!==this.uiBodyHeight)this.scrollY=Q,this.uiBodyHeight=z,this.calculateOffset()}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;let Q=this.scrollY/this.maxScrollY,z=Q*this.pixelsToShave;d1(this.gos,`RowContainerHeightService - Div Stretch Offset = ${z} (${this.pixelsToShave} * ${Q})`),this.setDivStretchOffset(z)}setUiContainerHeight(Q){if(Q!==this.uiContainerHeight)this.uiContainerHeight=Q,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"})}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(Q){let z=typeof Q==="number"?Math.floor(Q):null;if(this.divStretchOffset===z)return;this.divStretchOffset=z,this.eventSvc.dispatchEvent({type:"heightScaleChanged"})}setModelHeight(Q){if(this.modelHeight=Q,this.stretching=Q!=null&&this.maxDivHeight>0&&Q>this.maxDivHeight,this.stretching)this.calculateOffset();else this.clearOffset()}getRealPixelPosition(Q){return Q-this.divStretchOffset}getUiBodyHeight(){let Q=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return Q.bottom-Q.top}getScrollPositionForPixel(Q){if(this.pixelsToShave<=0)return Q;let z=this.modelHeight-this.getUiBodyHeight(),J=Q/z;return this.maxScrollY*J}},wE=400,NE=class extends j{constructor(){super(...arguments);this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{let Q=()=>{for(let X of this.getAllCellCtrls())X.onCellSelectionChanged()},z=()=>{for(let X of this.getAllCellCtrls())X.updateRangeBordersIfRangeCount()},J=()=>{this.eventSvc.addListener("cellSelectionChanged",Q),this.eventSvc.addListener("columnMoved",z),this.eventSvc.addListener("columnPinned",z),this.eventSvc.addListener("columnVisible",z)},Z=()=>{this.eventSvc.removeListener("cellSelectionChanged",Q),this.eventSvc.removeListener("columnMoved",z),this.eventSvc.removeListener("columnPinned",z),this.eventSvc.removeListener("columnVisible",z)};if(this.addDestroyFunc(()=>Z()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(u0(this.gos))J();else Z()}),u0(this.gos))J()}}wireBeans(Q){this.pageBounds=Q.pageBounds,this.colModel=Q.colModel,this.pinnedRowModel=Q.pinnedRowModel,this.rowModel=Q.rowModel,this.focusSvc=Q.focusSvc,this.rowContainerHeight=Q.rowContainerHeight,this.ctrlsSvc=Q.ctrlsSvc,this.editSvc=Q.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,(Q)=>{this.gridBodyCtrl=Q.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",(Z)=>this.onSuppressCellFocusChanged(Z.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:Z,previousValue:$})=>{if(!$&&Z||$&&!Z)this.redrawRows()});let{stickyRowSvc:Q,gos:z,showRowGroupCols:J}=this.beans;if(J)this.addManagedPropertyListener("showOpenedGroup",()=>{let Z=J.columns;if(Z.length)this.refreshCells({columns:Z,force:!0})});if(Q)this.stickyRowFeature=Q.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{let Z=this.gridBodyCtrl;Z.setStickyTopHeight(0),Z.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=V0(z,"print"),this.embedFullWidthRows=this.printLayout||z.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){let Q=this.getKeepDetailRowsCount(),z=Q!=null?Q:3;this.cachedRowCtrls=new gE(z)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){let Q=Object.values(this.rowCtrlsByRowIndex),z=Object.values(this.zombieRowCtrls),J=this.cachedRowCtrls?.getEntries()??[];if(z.length>0||J.length>0)this.allRowCtrls=[...Q,...z,...J];else this.allRowCtrls=Q}isCellBeingRendered(Q,z){let J=this.rowCtrlsByRowIndex[Q];if(!z||!J)return!!J;if(J.isFullWidth())return!0;return!!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:Q,column:z,rowPinned:null})||!!J.getCellCtrl(z)||!J.isRowRendered()}updateCellFocus(Q){for(let z of this.getAllCellCtrls())z.onCellFocused(Q);for(let z of this.getFullWidthRowCtrls())z.onFullWidthRowFocused(Q)}onCellFocusChanged(Q){if(Q?.rowIndex!=null&&!Q.rowPinned){let z=this.beans.colModel.getCol(Q.column)??void 0;if(!this.isCellBeingRendered(Q.rowIndex,z))this.redraw()}this.updateCellFocus(Q)}onSuppressCellFocusChanged(Q){for(let z of this.getAllCellCtrls())z.onSuppressCellFocusChanged(Q);for(let z of this.getFullWidthRowCtrls())z.onSuppressCellFocusChanged(Q)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:(Q)=>this.onCellFocusChanged(Q),cellFocusCleared:()=>this.updateCellFocus(),flashCells:(Q)=>{let{cellFlashSvc:z}=this.beans;if(z)for(let J of this.getAllCellCtrls())z.onFlashCells(J,Q)},columnHoverChanged:()=>{for(let Q of this.getAllCellCtrls())Q.onColumnHover()},displayedColumnsChanged:()=>{for(let Q of this.getAllCellCtrls())Q.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(let Q of this.getAllCellCtrls())Q.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(let Q of this.destroyFuncsForColumnListeners)Q();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();let Q=this.colModel.getCols();for(let z of Q){let J=(q)=>{for(let H of this.getAllCellCtrls())if(H.column===z)q(H)},Z=()=>{J((q)=>q.onLeftChanged())},$=()=>{J((q)=>q.onWidthChanged())},X=()=>{J((q)=>q.onFirstRightPinnedChanged())},Y=()=>{J((q)=>q.onLastLeftPinnedChanged())},G=()=>{J((q)=>q.onColDefChanged())};z.__addEventListener("leftChanged",Z),z.__addEventListener("widthChanged",$),z.__addEventListener("firstRightPinnedChanged",X),z.__addEventListener("lastLeftPinnedChanged",Y),z.__addEventListener("colDefChanged",G),this.destroyFuncsForColumnListeners.push(()=>{z.__removeEventListener("leftChanged",Z),z.__removeEventListener("widthChanged",$),z.__removeEventListener("firstRightPinnedChanged",X),z.__removeEventListener("lastLeftPinnedChanged",Y),z.__removeEventListener("colDefChanged",G)})}}onDomLayoutChanged(){let Q=V0(this.gos,"print"),z=Q||this.gos.get("embedFullWidthRows"),J=z!==this.embedFullWidthRows||this.printLayout!==Q;if(this.printLayout=Q,this.embedFullWidthRows=z,J)this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;let Q=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(Q)}onPageLoaded(Q){let z={recycleRows:Q.keepRenderedRows,animate:Q.animate,newData:Q.newData,newPage:Q.newPage,onlyBody:!0};this.redrawAfterModelUpdate(z)}getAllCellsNotSpanningForColumn(Q){let z=[];for(let J of this.getAllRowCtrls()){let Z=J.getCellCtrl(Q,!0)?.eGui;if(Z)z.push(Z)}return z}refreshFloatingRowComps(Q=!0){this.refreshFloatingRows(this.topRowCtrls,"top",Q),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",Q)}refreshFloatingRows(Q,z,J){let{pinnedRowModel:Z,beans:$,printLayout:X}=this,Y=Object.fromEntries(Q.map((q)=>[q.rowNode.id,q]));Z?.forEachPinnedRow(z,(q,H)=>{let _=Q[H];if(_&&Z.getPinnedRowById(_.rowNode.id,z)===void 0)_.destroyFirstPass(),_.destroySecondPass();if(q.id in Y&&J)Q[H]=Y[q.id],delete Y[q.id];else Q[H]=new F5(q,$,!1,!1,X)});let G=(z==="top"?Z?.getPinnedTopRowCount():Z?.getPinnedBottomRowCount())??0;Q.length=G}onPinnedRowDataChanged(){let Q={recycleRows:!0};this.redrawAfterModelUpdate(Q)}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(Q,z=!1){if(Q.sticky)this.stickyRowFeature?.refreshStickyNode(Q);else if(this.cachedRowCtrls?.has(Q)){this.cachedRowCtrls.removeRow(Q);return}else{let J=(Z)=>{let $=Z[Q.rowIndex];if(!$)return;if($.rowNode!==Q)return;$.destroyFirstPass(),$.destroySecondPass(),Z[Q.rowIndex]=this.createRowCon(Q,!1,!1)};switch(Q.rowPinned){case"top":J(this.topRowCtrls);break;case"bottom":J(this.bottomRowCtrls);break;default:J(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}if(!z)this.dispatchDisplayedRowsChanged(!1)}redrawRows(Q){let{editSvc:z}=this.beans;if(z?.isEditing())if(z.isBatchEditing())z.cleanupEditors();else z.stopEditing(void 0,{source:"api"});if(Q!=null){for(let Z of Q??[])this.redrawRow(Z,!0);this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}redrawAfterModelUpdate(Q={}){this.getLockOnRefresh();let z=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(Q);let J=!Q.domLayoutChanged&&!!Q.recycleRows,Z=Q.animate&&_1(this.gos),$=J?this.getRowsToRecycle():null;if(!J)this.removeAllRowComps();this.workOutFirstAndLastRowsToRender();let{stickyRowFeature:X,gos:Y}=this;if(X){X.checkStickyRows();let G=X.extraTopHeight+X.extraBottomHeight;if(G)this.updateContainerHeights(G)}if(this.recycleRows($,Z),this.gridBodyCtrl.updateRowCount(),!Q.onlyBody)this.refreshFloatingRowComps(Y.get("enableRowPinning")?J:void 0);if(this.dispatchDisplayedRowsChanged(),z!=null)this.restoreFocusedCell(z);this.releaseLockOnRefresh()}scrollToTopIfNewData(Q){let z=Q.newData||Q.newPage,J=this.gos.get("suppressScrollOnNewData");if(z&&!J)this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets()}updateContainerHeights(Q=0){let{rowContainerHeight:z}=this;if(this.printLayout){z.setModelHeight(null);return}let J=this.pageBounds.getCurrentPageHeight();if(J===0)J=1;z.setModelHeight(J+Q)}getLockOnRefresh(){if(this.refreshInProgress)throw Error(QQ(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(Q){if(!Q)return;let z=this.beans.focusSvc,J=this.findPositionToFocus(Q);if(!J){z.focusHeaderPosition({headerPosition:{headerRowIndex:l0(this.beans)-1,column:Q.column}});return}if(Q.rowIndex!==J.rowIndex||Q.rowPinned!=J.rowPinned){z.setFocusedCell({...J,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0});return}if(!z.doesRowOrCellHaveBrowserFocus())this.updateCellFocus(y(this.gos,{...J,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}findPositionToFocus(Q){let{pagination:z,pageBounds:J}=this.beans,Z=Q;if(Z.rowPinned==null&&z&&J&&!z.isRowInPage(Z.rowIndex))Z={rowPinned:null,rowIndex:J.getFirstRow()};while(Z){if(Z.rowPinned==null&&J){if(Z.rowIndexJ.getLastRow())Z={rowPinned:null,rowIndex:J.getLastRow()}}let $=this.getRowByPosition(Z);if($?.isAlive())return{...$.getRowPosition(),column:Q.column};Z=m0(this.beans,Z)}return null}getAllCellCtrls(){let Q=[],z=this.getAllRowCtrls(),J=z.length;for(let Z=0;Z{let $=Z.rowNode;return J8($,z)})}getCellCtrls(Q,z){let J;if(T(z))J={},z.forEach(($)=>{let X=this.colModel.getCol($);if(T(X))J[X.getId()]=!0});let Z=[];for(let $ of this.getRowCtrls(Q))for(let X of $.getAllCellCtrls()){let Y=X.column.getId();if(J&&!J[Y])continue;Z.push(X)}return Z}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(Q=!1){let z=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(z,Q),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){let Q=[];for(let J of Object.keys(this.rowCtrlsByRowIndex))if(this.rowCtrlsByRowIndex[J].rowNode.id==null)Q.push(J);this.removeRowCtrls(Q);let z={};for(let J of Object.values(this.rowCtrlsByRowIndex)){let Z=J.rowNode;z[Z.id]=J}return this.rowCtrlsByRowIndex={},z}removeRowCtrls(Q,z=!1){for(let J of Q){let Z=this.rowCtrlsByRowIndex[J];if(Z)Z.destroyFirstPass(z),Z.destroySecondPass();delete this.rowCtrlsByRowIndex[J]}}onBodyScroll(Q){if(Q.direction!=="vertical")return;this.redraw({afterScroll:!0})}redraw(Q={}){let{focusSvc:z,animationFrameSvc:J}=this.beans,{afterScroll:Z}=Q,$,X=this.stickyRowFeature;if(X)$=z?.getFocusCellToUseAfterRefresh()||void 0;let Y=this.firstRenderedRow,G=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let q=!1;if(X){q=X.checkStickyRows();let _=X.extraTopHeight+X.extraBottomHeight;if(_)this.updateContainerHeights(_)}let H=this.firstRenderedRow!==Y||this.lastRenderedRow!==G;if(Z&&!q&&!H)return;if(this.getLockOnRefresh(),this.recycleRows(null,!1,Z),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(Z&&!q),$!=null){let _=z?.getFocusCellToUseAfterRefresh();if($!=null&&_==null)J?.flushAllFrames(),this.restoreFocusedCell($)}}removeRowCompsNotToDraw(Q,z){let J={};for(let X of Q)J[X]=!0;let $=Object.keys(this.rowCtrlsByRowIndex).filter((X)=>!J[X]);this.removeRowCtrls($,z)}calculateIndexesToDraw(Q){let z=[];for(let Y=this.firstRenderedRow;Y<=this.lastRenderedRow;Y++)z.push(Y);let J=this.beans.pagination,Z=this.beans.focusSvc?.getFocusedCell()?.rowIndex;if(Z!=null&&(Zthis.lastRenderedRow)&&(!J||J.isRowInPage(Z))&&Z{let G=Y.rowNode.rowIndex;if(G==null||G===Z)return;if(Gthis.lastRenderedRow){if(this.doNotUnVirtualiseRow(Y))z.push(G)}};for(let Y of Object.values(this.rowCtrlsByRowIndex))$(Y);if(Q)for(let Y of Object.values(Q))$(Y);z.sort((Y,G)=>Y-G);let X=[];for(let Y=0;Y{this.destroyRowCtrls(Q,z),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()});else this.destroyRowCtrls(Q,z)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(Q=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:Q})}onDisplayedColumnsChanged(){let{visibleCols:Q}=this.beans,z=Q.isPinningLeft(),J=Q.isPinningRight();if(this.pinningLeft!==z||J!==this.pinningRight){if(this.pinningLeft=z,this.pinningRight=J,this.embedFullWidthRows)this.redrawFullWidthEmbeddedRows()}}redrawFullWidthEmbeddedRows(){let Q=[];for(let z of this.getFullWidthRowCtrls()){let J=z.rowNode.rowIndex;Q.push(J.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(Q),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(Q){let z=z8(Q);return this.getAllRowCtrls().filter((J)=>{if(!J.isFullWidth())return!1;let Z=J.rowNode;if(z!=null&&!J8(Z,z))return!1;return!0})}createOrUpdateRowCtrl(Q,z,J,Z){let $,X=this.rowCtrlsByRowIndex[Q];if(!X){if($=this.rowModel.getRow(Q),T($)&&T(z)&&z[$.id]&&$.alreadyRendered)X=z[$.id],z[$.id]=null}if(!X){if(!$)$=this.rowModel.getRow(Q);if(T($))X=this.createRowCon($,J,Z);else return}if($)$.alreadyRendered=!0;this.rowCtrlsByRowIndex[Q]=X}destroyRowCtrls(Q,z){let J=[];if(Q)for(let Z of Object.values(Q)){if(!Z)continue;if(this.cachedRowCtrls&&Z.isCacheable()){this.cachedRowCtrls.addRow(Z);continue}if(Z.destroyFirstPass(!z),z){let $=Z.instanceId;this.zombieRowCtrls[$]=Z,J.push(()=>{Z.destroySecondPass(),delete this.zombieRowCtrls[$]})}else Z.destroySecondPass()}if(z)J.push(()=>{if(this.isAlive())this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),window.setTimeout(()=>{for(let Z of J)Z()},wE)}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){let Q=this.getRowBuffer(),z=X9(this.beans);return Q*z}workOutFirstAndLastRowsToRender(){let{rowContainerHeight:Q,pageBounds:z,rowModel:J}=this;Q.updateOffset();let Z,$;if(!J.isRowsToRender())Z=0,$=-1;else if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),Z=z.getFirstRow(),$=z.getLastRow();else{let _=this.getRowBufferInPixels(),U=this.ctrlsSvc.getScrollFeature(),W=this.gos.get("suppressRowVirtualisation"),B=!1,E,K;do{let k=z.getPixelOffset(),{pageFirstPixel:f,pageLastPixel:A}=z.getCurrentPagePixelRange(),O=Q.divStretchOffset,v=U.getVScrollPosition(),I=v.top,C=v.bottom;if(W)E=f+O,K=A+O;else E=Math.max(I+k-_,f)+O,K=Math.min(C+k+_,A)+O;this.firstVisibleVPixel=Math.max(I+k,f)+O,this.lastVisibleVPixel=Math.min(C+k,A)+O,B=this.ensureAllRowsInRangeHaveHeightsCalculated(E,K)}while(B);let L=J.getRowIndexAtPixel(E),F=J.getRowIndexAtPixel(K),D=z.getFirstRow(),M=z.getLastRow();if(LM)F=M;Z=L,$=F}let X=V0(this.gos,"normal"),Y=this.gos.get("suppressMaxRenderedRowRestriction"),G=Math.max(this.getRowBuffer(),500);if(X&&!Y){if($-Z>G)$=Z+G}let q=Z!==this.firstRenderedRow,H=$!==this.lastRenderedRow;if(q||H)this.firstRenderedRow=Z,this.lastRenderedRow=$,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:Z,lastRow:$})}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0,YQ(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})})}ensureAllRowsInRangeHaveHeightsCalculated(Q,z){let J=this.pinnedRowModel?.ensureRowHeightsValid(),Z=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:$,rowModel:X}=this,Y=X.ensureRowHeightsValid(Q,z,$.getFirstRow(),$.getLastRow());if(Y||Z)this.eventSvc.dispatchEvent({type:"recalculateRowBounds"});if(Z||Y||J)return this.updateContainerHeights(),!0;return!1}doNotUnVirtualiseRow(Q){let Z=Q.rowNode,$=this.focusSvc.isRowFocused(Z.rowIndex,Z.rowPinned),X=this.editSvc?.isEditing(Q),Y=Z.detail;if(!($||X||Y))return!1;return this.isRowPresent(Z)?!0:!1}isRowPresent(Q){if(!this.rowModel.isRowPresent(Q))return!1;return this.beans.pagination?.isRowInPage(Q.rowIndex)??!0}createRowCon(Q,z,J){let Z=this.cachedRowCtrls?.getRow(Q)??null;if(Z)return Z;let $=J&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new F5(Q,this.beans,z,$,this.printLayout)}getRenderedNodes(){let Q=Object.values(this.rowCtrlsByRowIndex).map((Z)=>Z.rowNode),z=this.getStickyTopRowCtrls().map((Z)=>Z.rowNode),J=this.getStickyBottomRowCtrls().map((Z)=>Z.rowNode);return[...z,...Q,...J]}getRowByPosition(Q){let z,{rowIndex:J}=Q;switch(Q.rowPinned){case"top":z=this.topRowCtrls[J];break;case"bottom":z=this.bottomRowCtrls[J];break;default:if(z=this.rowCtrlsByRowIndex[J],!z){if(z=this.getStickyTopRowCtrls().find((Z)=>Z.rowNode.rowIndex===J)||null,!z)z=this.getStickyBottomRowCtrls().find((Z)=>Z.rowNode.rowIndex===J)||null}break}return z}isRangeInRenderedViewport(Q,z){if(Q==null||z==null)return!1;let Z=Q>this.lastRenderedRow;return!(zthis.maxCount){let z=this.entriesList[0];z.destroyFirstPass(),z.destroySecondPass(),this.removeFromCache(z)}}getRow(Q){if(Q?.id==null)return null;let z=this.entriesMap[Q.id];if(!z)return null;return this.removeFromCache(z),z.setCached(!1),z.rowNode!=Q?null:z}has(Q){return this.entriesMap[Q.id]!=null}removeRow(Q){let z=Q.id,J=this.entriesMap[z];delete this.entriesMap[z],$0(this.entriesList,J)}removeFromCache(Q){let z=Q.rowNode.id;delete this.entriesMap[z],$0(this.entriesList,Q)}getEntries(){return this.entriesList}};function z8(Q){if(!Q)return;let z={top:{},bottom:{},normal:{}};for(let J of Q){let Z=J.id;switch(J.rowPinned){case"top":z.top[Z]=J;break;case"bottom":z.bottom[Z]=J;break;default:z.normal[Z]=J;break}}return z}function J8(Q,z){let J=Q.id;switch(Q.rowPinned){case"top":return z.top[J]!=null;case"bottom":return z.bottom[J]!=null;default:return z.normal[J]!=null}}var hE=class extends j{constructor(){super(...arguments);this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=o(this.gos)?pz:uE,this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],this.updateOptions.bind(this));let Q=this.updatePivotModeState.bind(this);this.addManagedEventListeners({columnPivotModeChanged:Q,columnPivotChanged:Q}),this.updateOptions(),Q()}updateOptions(){this.accentedSort=!!this.gos.get("accentedSort"),this.primaryColumnsSortGroups=WQ(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(Q,z){return Q.sort((J,Z)=>this.compareRowNodes(z,J,Z))}compareRowNodes(Q,z,J){if(z===J)return 0;let Z=this.accentedSort;for(let $=0,X=Q.length;${if(Q.data)return Q;let z=Q.childrenAfterGroup;while(z?.length){let J=z[0];if(J.data)return J;z=J.childrenAfterGroup}},Z8=(Q)=>{if(!Q)return Q;if(typeof Q==="bigint")return Q<0n?-Q:Q;let z=Number(Q);return isNaN(z)?Q:Math.abs(z)};function mE(Q){Q.sortSvc?.onSortChanged("api")}var jz=(Q,z)=>({tag:"span",ref:`eSort${Q}`,cls:`ag-sort-indicator-icon ag-sort-${z} ag-hidden`,attrs:{"aria-hidden":"true"}}),cE={tag:"span",cls:"ag-sort-indicator-container",children:[jz("Order","order"),jz("Asc","ascending-icon"),jz("Desc","descending-icon"),jz("Mixed","mixed-icon"),jz("AbsoluteAsc","absolute-ascending-icon"),jz("AbsoluteDesc","absolute-descending-icon"),jz("None","none-icon")]},R6=class extends x{constructor(Q){super();if(this.eSortOrder=S,this.eSortAsc=S,this.eSortDesc=S,this.eSortMixed=S,this.eSortNone=S,this.eSortAbsoluteAsc=S,this.eSortAbsoluteDesc=S,!Q)this.setTemplate(cE)}attachCustomElements(Q,z,J,Z,$,X,Y){this.eSortOrder=Q,this.eSortAsc=z,this.eSortDesc=J,this.eSortMixed=Z,this.eSortNone=$,this.eSortAbsoluteAsc=X,this.eSortAbsoluteDesc=Y}setupSort(Q,z=!1,J){if(this.column=Q,this.suppressOrder=z,this.getSortDefOverride=J,this.setupMultiSortIndicator(),!Q.isSortable()&&!Q.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,Q),this.addInIcon("sortDescending",this.eSortDesc,Q),this.addInIcon("sortUnSort",this.eSortNone,Q),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,Q),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,Q);let Z=this.updateIcons.bind(this),$=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",Z),this.addManagedEventListeners({newColumnsLoaded:Z,sortChanged:$,columnRowGroupChanged:$}),this.onSortChanged()}addInIcon(Q,z,J){if(z==null)return;let Z=h(Q,this.beans,J);if(Z)z.appendChild(Z)}onSortChanged(){if(this.updateIcons(),!this.suppressOrder)this.updateSortOrder()}updateIcons(){let{eSortAsc:Q,eSortDesc:z,eSortAbsoluteAsc:J,eSortAbsoluteDesc:Z,eSortNone:$,column:X,gos:Y,beans:G}=this,q=c5(X,G,this.getSortDefOverride),H=q.isDefaultSortAllowed,_=q.isAbsoluteSortAllowed,{isAbsoluteSort:U,isDefaultSort:W,isAscending:B,isDescending:E,direction:K}=q;if(Q)N(Q,B&&W&&H,{skipAriaHidden:!0});if(z)N(z,E&&W&&H,{skipAriaHidden:!0});if($){let L=!X.getColDef().unSortIcon&&!Y.get("unSortIcon");N($,!L&&!K,{skipAriaHidden:!0})}if(J)N(J,B&&U&&_,{skipAriaHidden:!0});if(Z)N(Z,E&&U&&_,{skipAriaHidden:!0})}setupMultiSortIndicator(){let{eSortMixed:Q,column:z,gos:J}=this;this.addInIcon("sortUnSort",Q,z);let Z=z.getColDef().showRowGroup;if(WQ(J)&&Z)this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator()}updateMultiSortIndicator(){let{eSortMixed:Q,beans:z,column:J}=this;if(Q){let Z=z.sortSvc.getDisplaySortForColumn(J)?.direction==="mixed";N(Q,Z,{skipAriaHidden:!0})}}updateSortOrder(){let{eSortOrder:Q,column:z,beans:{sortSvc:J}}=this;if(!Q)return;let Z=J.getColumnsWithSortingOrdered(),$=J.getDisplaySortIndexForColumn(z)??-1,X=Z.some((G)=>J.getDisplaySortIndexForColumn(G)??!1),Y=$>=0&&X;if(N(Q,Y,{skipAriaHidden:!0}),$>=0)Q.textContent=($+1).toString();else z0(Q)}refresh(){this.onSortChanged()}},pE={selector:"AG-SORT-INDICATOR",component:R6},iE=class extends j{constructor(){super(...arguments);this.beanName="sortSvc"}progressSort(Q,z,J){let Z=this.getNextSortDirection(Q);this.setSortForColumn(Q,Z,z,J)}progressSortFromEvent(Q,z){let Z=this.gos.get("multiSortKey")==="ctrl"?z.ctrlKey||z.metaKey:z.shiftKey;this.progressSort(Q,Z,"uiColumnSorted")}setSortForColumn(Q,z,J,Z){let{gos:$,showRowGroupCols:X}=this.beans,Y=WQ($),G=[Q];if(Y){if(Q.getColDef().showRowGroup){let U=X?.getSourceColumnsForGroupColumn?.(Q)?.filter((W)=>W.isSortable());if(U)G=[Q,...U]}}for(let _ of G)this.setColSort(_,z,Z);let q=(J||$.get("alwaysMultiSort"))&&!$.get("suppressMultiSort"),H=[];if(!q){let _=this.clearSortBarTheseColumns(G,Z);H.push(..._)}this.updateSortIndex(Q),H.push(...G),this.dispatchSortChangedEvents(Z,H)}updateSortIndex(Q){let{gos:z,colModel:J,showRowGroupCols:Z}=this.beans,$=WQ(z),X=Z?.getShowRowGroupCol(Q.getId()),Y=$?X||Q:Q,G=this.getColumnsWithSortingOrdered();J.forAllCols((_)=>this.setColSortIndex(_,null));let q=G.filter((_)=>{if($&&_.getColDef().showRowGroup)return!1;return _!==Y});(Y.getSortDef()?[...q,Y]:q).forEach((_,U)=>this.setColSortIndex(_,U))}onSortChanged(Q,z){this.dispatchSortChangedEvents(Q,z)}isSortActive(){let Q=!1;return this.beans.colModel.forAllCols((z)=>{if(z.getSortDef())return Q=!0,!0}),Q}dispatchSortChangedEvents(Q,z){let J={type:"sortChanged",source:Q};if(z)J.columns=z;this.eventSvc.dispatchEvent(J)}clearSortBarTheseColumns(Q,z){let J=[];return this.beans.colModel.forAllCols((Z)=>{if(!Q.includes(Z)){if(Z.getSortDef())J.push(Z);this.setColSort(Z,void 0,z)}}),J}getNextSortDirection(Q,z){let J=Q.getSortingOrder(),Z=z===void 0?Q.getSortDef():a0(z),X=J.findIndex((Y)=>tJ(Y,Z))+1;if(X>=J.length)X=0;return a0(J[X])}getIndexedSortMap(){let{gos:Q,colModel:z,showRowGroupCols:J,rowGroupColsSvc:Z}=this.beans,$=[];if(z.forAllCols((H)=>{if(H.getSortDef())$.push(H)}),z.isPivotMode()){let H=WQ(Q);$=$.filter((_)=>{let U=!!_.getAggFunc(),W=!_.isPrimary(),B=H?J?.getShowRowGroupCol(_.getId()):_.getColDef().showRowGroup;return U||W||B})}let X=Z?.columns.filter((H)=>!!H.getSortDef())??[],Y={};$.forEach((H,_)=>Y[H.getId()]=_),$.sort((H,_)=>{let U=H.getSortIndex(),W=_.getSortIndex();if(U!=null&&W!=null)return U-W;else if(U==null&&W==null){let B=Y[H.getId()],E=Y[_.getId()];return B>E?1:-1}else if(W==null)return-1;else return 1});let G=WQ(Q)&&!!X.length;if(G)$=[...new Set($.map((H)=>J?.getShowRowGroupCol(H.getId())??H))];let q=new Map;if($.forEach((H,_)=>q.set(H,_)),G)for(let H of X){let _=J.getShowRowGroupCol(H.getId());q.set(H,q.get(_))}return q}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,Q],[,z])=>Q-z).map(([Q])=>Q)}collectSortItems(Q=!1){let z=[],J=this.getColumnsWithSortingOrdered();for(let Z of J){let $=Z.getSortDef()?.direction;if(!$)continue;let X=LQ(Z.getSortDef()?.type),Y={sort:$,type:X};if(Q)Y.colId=Z.getId();else Y.column=Z;z.push(Y)}return z}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(Q){let z=WQ(this.gos),J=!!Q.getColDef().showRowGroup;return z&&J}getDisplaySortForColumn(Q){let z=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(Q);if(!this.canColumnDisplayMixedSort(Q)||!z?.length)return Q.getSortDef();let Z=Q.getColDef().field!=null||!!Q.getColDef().valueGetter?[Q,...z]:z,$=Z[0].getSortDef();if(!Z.every((Y)=>tJ(Y.getSortDef(),$)))return{type:LQ(Q.getSortDef()?.type),direction:"mixed"};return $}getDisplaySortIndexForColumn(Q){return this.getIndexedSortMap().get(Q)}setupHeader(Q,z){let J=()=>{let{type:Z,direction:$}=a0(z.getSortDef());if(Q.toggleCss("ag-header-cell-sorted-asc",$==="asc"),Q.toggleCss("ag-header-cell-sorted-desc",$==="desc"),Q.toggleCss("ag-header-cell-sorted-abs-asc",Z==="absolute"&&$==="asc"),Q.toggleCss("ag-header-cell-sorted-abs-desc",Z==="absolute"&&$==="desc"),Q.toggleCss("ag-header-cell-sorted-none",!$),z.getColDef().showRowGroup){let G=!this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(z)?.every((q)=>$==q.getSortDef()?.direction);Q.toggleCss("ag-header-cell-sorted-mixed",G)}};Q.addManagedEventListeners({sortChanged:J,columnPinned:J,columnRowGroupChanged:J,displayedColumnsChanged:J})}initCol(Q){let{sortIndex:z,initialSortIndex:J}=Q.colDef,Z=A9(Q.colDef);if(Z)Q.setSortDef(Z,!0);if(z!==void 0){if(z!==null)Q.sortIndex=z}else if(J!==null)Q.sortIndex=J}updateColSort(Q,z,J){if(z===void 0)return;this.setColSort(Q,a0(z),J)}setColSort(Q,z,J){if(!tJ(Q.getSortDef(),z))Q.setSortDef(a0(z),z===void 0),Q.dispatchColEvent("sortChanged",J);Q.dispatchStateUpdatedEvent("sort")}setColSortIndex(Q,z){Q.sortIndex=z,Q.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(Q){return new R6(Q)}getSortIndicatorSelector(){return pE}},r$={moduleName:"Sort",version:p,beans:[iE,hE],apiFunctions:{onSortChanged:mE},userComponents:{agSortIndicator:R6},icons:{sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc"}},nE=class extends j{constructor(){super(...arguments);this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",(Q)=>this.setColumnDefs(Q))}start(){this.beans.ctrlsSvc.whenReady(this,()=>{let Q=this.gos.get("columnDefs");if(Q)this.setColumnsAndData(Q);else this.waitingForColumns=!0;this.gridReady()})}setColumnsAndData(Q){let{colModel:z,rowModel:J}=this.beans;z.setColumnDefs(Q??[],"gridInitializing"),J.start()}gridReady(){let{eventSvc:Q,gos:z}=this;Q.dispatchEvent({type:"gridReady"}),d1(z,`initialised successfully, enterprise = ${z.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(Q){let z=this.gos.get("columnDefs");if(!z)return;if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(z);return}this.beans.colModel.setColumnDefs(z,Xz(Q.source))}};var dE="paste",tE=class extends j{constructor(){super(...arguments);this.beanName="changeDetectionSvc",this.deferredDepth=0,this.batchedPath=null,this.batchedNodes=null}destroy(){super.destroy(),this.batchedPath=null,this.batchedNodes=null}postConstruct(){this.csrm=o5(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(this.deferredDepth===0)return;if(--this.deferredDepth>0)return;let Q=this.batchedPath,z=this.batchedNodes;if(this.batchedPath=null,this.batchedNodes=null,Q)this.csrm?.doAggregate(Q);let{rowRenderer:J}=this.beans;if(z)for(let Z of z)$8(J,Z);if(Q){let Z=Q.getSortedRows();for(let $=0,X=Z.length;${let{sibling:J,pinnedSibling:Z}=z;Q.refreshRowByNode(z),Q.refreshRowByNode(J),Q.refreshRowByNode(Z),Q.refreshRowByNode(J?.pinnedSibling),Q.refreshRowByNode(Z?.sibling)},rE=class extends j{constructor(){super(...arguments);this.beanName="expressionSvc",this.cache={}}evaluate(Q,z){if(typeof Q==="string")return this.evaluateExpression(Q,z);else e(15,{expression:Q})}evaluateExpression(Q,z){try{return this.createExpressionFunction(Q)(z.value,z.context,z.oldValue,z.newValue,z.value,z.node,z.data,z.colDef,z.rowIndex,z.api,z.getValue,z.column,z.columnGroup)}catch(J){return e(16,{expression:Q,params:z,e:J}),null}}createExpressionFunction(Q){let z=this.cache;if(z[Q])return z[Q];let J=this.createFunctionBody(Q),Z=Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",J);return z[Q]=Z,Z}createFunctionBody(Q){if(Q.includes("return"))return Q;else return"return "+Q+";"}};var sE={moduleName:"Expression",version:p,beans:[rE]},lE={moduleName:"ChangeDetection",version:p,beans:[tE]};var aE=class extends j{constructor(){super(...arguments);this.beanName="valueSvc",this.initialised=!1,this.isSsrm=!1}wireBeans(Q){this.expressionSvc=Q.expressionSvc,this.colModel=Q.colModel,this.valueCache=Q.valueCache,this.dataTypeSvc=Q.dataTypeSvc,this.editSvc=Q.editSvc,this.formulaDataSvc=Q.formulaDataSvc,this.rowGroupColsSvc=Q.rowGroupColsSvc}postConstruct(){if(!this.initialised)this.init()}init(){let{gos:Q,valueCache:z}=this;this.executeValueGetter=z?this.executeValueGetterWithValueCache.bind(this):this.executeValueGetterWithoutValueCache.bind(this),this.isSsrm=Hz(Q),this.cellExpressions=Q.get("enableCellExpressions"),this.isTreeData=Q.get("treeData"),this.initialised=!0;let J=(Z)=>this.callColumnCellValueChangedHandler(Z);this.eventSvc.addListener("cellValueChanged",J,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",J,!0)),this.addManagedPropertyListener("treeData",(Z)=>this.isTreeData=Z.currentValue)}getValueForDisplay(Q){let z=this.beans,J=Q.column,Z=Q.node,$=z.showRowGroupColValueSvc,X=!J&&Z.group,Y=J?.colDef.showRowGroup,G=!this.isTreeData||Z.footer;if($&&G&&(X||Y)){let W=$.getGroupValue(Z,J,this.displayIgnoresAggData(Z));if(W==null)return{value:null,valueFormatted:null};return{value:W.value,valueFormatted:Q.includeValueFormatted?$.formatAndPrefixGroupColValue(W,J,Q.exporting):null}}if(!J)return{value:Z.key,valueFormatted:null};let q=this.getValue(J,Z,Q.from,this.displayIgnoresAggData(Z)),H=q,_=z.formula;if(J.isAllowFormula()&&_?.isFormula(q))if(Q.useRawFormula)q=_.normaliseFormula(q,!0),H=_.resolveValue(J,Z);else q=_.resolveValue(J,Z),H=q;let U=Q.includeValueFormatted&&!(Q.exporting&&J.colDef.useValueFormatterForExport===!1);return{value:q,valueFormatted:U?this.formatValue(J,Z,H):null}}getValue(Q,z,J,Z=!1){if(!this.initialised)this.init();if(!z)return;let $=Q.colDef,X=z.group;if(!X){let q=$.pivotValueColumn;if(q)Q=q}let Y=this.editSvc?.getPendingEditValue(z,Q,J);if(Y!==void 0)return Y;let G=this.resolveValue(Q,z,Z,X);if(G===void 0){if(X){let q=$.showRowGroup;if(typeof q==="string"){let H=this.rowGroupColsSvc?.getColumnIndex(q);if(H!=null&&H>z.level)return null}}return}if(this.cellExpressions&&oJ(G)){let q=G.substring(1);G=this.executeValueGetter(q,z.data,Q,z)}return G}displayIgnoresAggData(Q){if(!Q.group||Q.footer||Q.level===-1)return!1;if(!Q.sibling||this.gos.get("groupSuppressBlankHeader"))return!1;if(Q.leafGroup&&this.colModel.isPivotMode())return!1;return!!Q.expanded}resolveValue(Q,z,J,Z){let{colDef:$,colId:X}=Q,Y=!Z&&this.formulaDataSvc;if(Y&&Y.hasDataSource()&&$.allowFormula===!0){let D=Y.getFormula({column:Q,rowNode:z});if(oJ(D))return D}let G=Z&&!J?z.aggData:void 0,q=this.isTreeData;if(q&&G?.[X]!==void 0)return G[X];let H=z.data,_=$.field,U=$.valueGetter;if(q){if(U)return this.executeValueGetter(U,H,Q,z);if(_&&H)return h1(H,_,Q.isFieldContainsDots())}let W=z.groupData;if(W&&X in W)return W[X];if(G?.[X]!==void 0)return G[X];let B=$.showRowGroup,E=typeof B!=="string"||!Z,K=this.isSsrm,L=K&&J&&!!$.aggFunc;if(U&&!L)return E?this.executeValueGetter(U,H,Q,z):void 0;if(K&&z.footer&&z.field&&(B===!0||B===z.field))return h1(H,z.field,Q.isFieldContainsDots());if(_&&H&&!L)return E?h1(H,_,Q.isFieldContainsDots()):void 0;return}parseValue(Q,z,J,Z){let $=Q.getColDef();if($.allowFormula&&this.beans.formula?.isFormula(J))return J;let X=$.valueParser;if(T(X)){let Y=y(this.gos,{node:z,data:z?.data,oldValue:Z,newValue:J,colDef:$,column:Q});if(typeof X==="function")return X(Y);return this.expressionSvc?.evaluate(X,Y)}return J}getDeleteValue(Q,z){if(T(Q.getColDef().valueParser))return this.parseValue(Q,z,"",this.getValueForDisplay({column:Q,node:z,from:"edit"}).value)??null;return null}formatValue(Q,z,J,Z,$=!0){let{expressionSvc:X}=this.beans,Y=null,G,q=Q.getColDef();if(Z)G=Z;else if($)G=q.valueFormatter;if(G){let H=z?z.data:null,_=y(this.gos,{value:J,node:z,data:H,colDef:q,column:Q});if(typeof G==="function")Y=G(_);else Y=X?X.evaluate(G,_):null}else if(q.refData)return q.refData[J]||"";if(Y==null&&Array.isArray(J))Y=J.join(", ");return Y}setValue(Q,z,J,Z){let $=z.getColDef();if(!Q.data&&this.canCreateRowNodeData(Q,$))Q.data={};if(!this.isSetValueSupported(z,Q,J,$))return!1;let X=this.getValue(z,Q,"data"),Y=y(this.gos,{node:Q,data:Q.data,oldValue:X,newValue:J,colDef:$,column:z}),G=!1;if(Q.data){let H=this.handleExternalFormulaChange({column:z,eventSource:Z,newValue:J,setterParams:Y,rowNode:Q});if(H!==null)return H;G=this.computeValueChange({column:z,rowNode:Q,newValue:J,params:Y,rowData:Q.data,valueSetter:$.valueSetter,field:$.field})??!0}let q=this.beans.changeDetectionSvc;q?.beginDeferred();try{if(Q.group){let H=this.beans.rowGroupingEditValueSvc?.setGroupDataValue(Q,z,J,X,Z,G||J!==X);if(H!==void 0){if(!G&&!H)return!1;return this.finishValueChange(Q,z,Y,Z,J)}}if(!G)return!1;return this.finishValueChange(Q,z,Y,Z)}finally{q?.endDeferred()}}canCreateRowNodeData(Q,z){if(!Q.group)return!0;if(z.groupRowValueSetter!=null||z.groupRowEditable!=null)return!1;if(z.pivotValueColumn)return!1;return!0}finishValueChange(Q,z,J,Z,$){Q.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();let X=$===void 0?this.getValue(z,Q,"data"):$;if(this.dispatchCellValueChangedEvent(Q,J,X,Z),Q.pinnedSibling)this.dispatchCellValueChangedEvent(Q.pinnedSibling,J,X,Z);return!0}isSetValueSupported(Q,z,J,Z){let{field:$,valueSetter:X}=Z,Y=this.beans.formula,G=Q.isAllowFormula()&&Y?.isFormula(J),q=!!this.formulaDataSvc?.hasDataSource();if(n($)&&n(X)&&!(q&&G)){if(z.group&&(Z.groupRowValueSetter||Z.groupRowEditable))return!0;return R(17),!1}if(this.dataTypeSvc&&!this.dataTypeSvc.checkType(Q,J))return R(135),!1;return!0}handleExternalFormulaChange(Q){let{column:z,rowNode:J,newValue:Z,eventSource:$,setterParams:X}=Q,Y=this.beans.formula,G=this.formulaDataSvc;if(!G?.hasDataSource()||!z.isAllowFormula())return null;let q=Y?.isFormula(Z),H=G.getFormula({column:z,rowNode:J});if(q){if(H===Z)return!1;G.setFormula({column:z,rowNode:J,formula:Z});let U=Y?.resolveValue(z,J),W=z.getColDef();if(T(W.valueSetter)||!n(W.field)){let B={...X,newValue:U};this.computeValueChange({column:z,rowNode:J,newValue:U,params:B,rowData:J.data,valueSetter:W.valueSetter,field:W.field})}return this.finishValueChange(J,z,X,$)}if(H!==void 0)G.setFormula({column:z,rowNode:J,formula:void 0});return null}computeValueChange(Q){let{valueSetter:z,params:J,rowData:Z,field:$,column:X,newValue:Y}=Q;if(T(z)){if(typeof z==="function")return z(J);return this.expressionSvc?.evaluate(z,J)}return!!Z&&this.setValueUsingField(Z,$,Y,X.isFieldContainsDots())}dispatchCellValueChangedEvent(Q,z,J,Z){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:Q.rowIndex,rowPinned:Q.rowPinned,column:z.column,colDef:z.colDef,data:Q.data,node:Q,oldValue:z.oldValue,newValue:J,newRawValue:z.newValue,value:J,source:Z})}callColumnCellValueChangedHandler(Q){let z=Q.colDef.onCellValueChanged;if(typeof z==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>{z(Q)})}setValueUsingField(Q,z,J,Z){if(!z)return!1;let $=!1;if(!Z){if($=Q[z]===J,!$)Q[z]=J}else{let X=z.split("."),Y=Q;while(X.length>0&&Y){let G=X.shift();if(X.length===0){if($=Y[G]===J,!$)Y[G]=J}else Y=Y[G]}}return!$}executeValueGetterWithValueCache(Q,z,J,Z){let $=J.getColId(),X=this.valueCache.getValue(Z,$);if(X!==void 0)return X;let Y=this.executeValueGetterWithoutValueCache(Q,z,J,Z);return this.valueCache.setValue(Z,$,Y),Y}executeValueGetterWithoutValueCache(Q,z,J,Z){let $=y(this.gos,{data:z,node:Z,column:J,colDef:J.getColDef(),getValue:(Y)=>this.getValueCallback(Z,Y)}),X;if(typeof Q==="function")X=Q($);else X=this.expressionSvc?.evaluate(Q,$);return X}getValueCallback(Q,z){let J=this.colModel.getColDefCol(z);if(J)return this.getValue(J,Q,"data");return null}getKeyForNode(Q,z){let J=this.getValue(Q,z,"data"),Z=Q.getColDef().keyCreator,$=J;if(Z){let X=y(this.gos,{value:J,colDef:Q.getColDef(),column:Q,node:z,data:z.data});$=Z(X)}if(typeof $==="string"||$==null)return $;if($=String($),$==="[object Object]")R(121);return $}},oE={moduleName:"CommunityCore",version:p,beans:[hB,S_,KW,Wq,xE,IU,bB,Y3,wU,XE,$E,NE,aE,NB,IB,gB,FW,nE,qW,HW,D3],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:O_,destroy:P_,isDestroyed:T_,getGridOption:v_,setGridOption:I_,updateGridOptions:q$,isModuleRegistered:C_},dependsOn:[YW,FJ,LU,r$,E3,E6,K3,yE,lE,F3,iz,HE,WE,V3,WW,GW,sE,tU,KE]};function D5(Q){let{inputValue:z,allSuggestions:J,hideIrrelevant:Z,filterByPercentageOfBestMatch:$}=Q,X=(J??[]).map((q,H)=>({value:q,relevance:eE(z,q),idx:H}));if(X.sort((q,H)=>q.relevance-H.relevance),Z)X=X.filter((q)=>q.relevance0&&$&&$>0){let H=X[0].relevance*$;X=X.filter((_)=>H-_.relevance<0)}let Y=[],G=[];for(let q of X)Y.push(q.value),G.push(q.idx);return{values:Y,indices:G}}function eE(Q,z){let J=Q.length,Z=z.length;if(Z===0)return J?J:0;let $=Q.toLocaleLowerCase(),X=z.toLocaleLowerCase(),Y;if(Q.length1&&E>1){let F=Q[U-2],D=$[U-2],M=z[E-2],k=X[E-2];if(D===k){if(H++,F===M)H++}}if(U<_)H++;q[E]=G[E-1]}Y=G,G=q,q=Y}return G[Z]/(H+1)}var s$={AdvancedFilter:1,AiToolkit:1,AllEnterprise:1,BatchEdit:1,CellSelection:1,Clipboard:1,ColumnMenu:1,ColumnsToolPanel:1,ContextMenu:1,ExcelExport:1,FiltersToolPanel:1,Find:1,GridCharts:1,IntegratedCharts:1,GroupFilter:1,MasterDetail:1,Menu:1,MultiFilter:1,NewFiltersToolPanel:1,Pivot:1,RangeSelection:1,RichSelect:1,RowNumbers:1,RowGrouping:1,RowGroupingEdit:1,RowGroupingPanel:1,ServerSideRowModelApi:1,ServerSideRowModel:1,SetFilter:1,SideBar:1,Sparklines:1,StatusBar:1,TreeData:1,ViewportRowModel:1,Formula:1},r2=["TextFilter","NumberFilter","BigIntFilter","DateFilter","SetFilter","MultiFilter","GroupFilter","CustomFilter"],QK={EditCore:["TextEditor","NumberEditor","DateEditor","CheckboxEditor","LargeTextEditor","SelectEditor","RichSelect","CustomEditor"],CheckboxCellRenderer:["AllCommunity"],ClientSideRowModelHierarchy:["RowGrouping","Pivot","TreeData"],ColumnFilter:r2,ColumnGroupHeaderComp:["AllCommunity"],ColumnGroup:["AllCommunity"],ColumnHeaderComp:["AllCommunity"],ColumnMove:["AllCommunity"],ColumnResize:["AllCommunity"],CommunityCore:["AllCommunity"],CsrmSsrmSharedApi:["ClientSideRowModelApi","ServerSideRowModelApi"],RowModelSharedApi:["ClientSideRowModelApi","ServerSideRowModelApi"],EnterpriseCore:["AllEnterprise"],FilterCore:[...r2,"QuickFilter","ExternalFilter","AdvancedFilter"],GroupCellRenderer:["RowGrouping","Pivot","TreeData","MasterDetail","ServerSideRowModel"],KeyboardNavigation:["AllCommunity"],LoadingCellRenderer:["ServerSideRowModel"],MenuCore:["ColumnMenu","ContextMenu"],MenuItem:["ColumnMenu","ContextMenu","MultiFilter","IntegratedCharts","ColumnsToolPanel"],Overlay:["AllCommunity"],PinnedColumn:["AllCommunity"],SharedAggregation:["RowGrouping","Pivot","TreeData","ServerSideRowModel"],SharedDragAndDrop:["AllCommunity"],SharedMasterDetail:["MasterDetail","ServerSideRowModel"],SharedMenu:[...r2,"ColumnMenu","ContextMenu"],SharedPivot:["Pivot","ServerSideRowModel"],SharedRowGrouping:["RowGrouping","ServerSideRowModel"],SharedRowSelection:["RowSelection","ServerSideRowModel"],SkeletonCellRenderer:["ServerSideRowModel"],Sort:["AllCommunity"],SsrmInfiniteSharedApi:["InfiniteRowModel","ServerSideRowModelApi"],SharedTreeData:["TreeData","ServerSideRowModel"]},zK={InfiniteRowModel:"infinite",ClientSideRowModelApi:"clientSide",ClientSideRowModel:"clientSide",ServerSideRowModelApi:"serverSide",ServerSideRowModel:"serverSide",ViewportRowModel:"viewport"};function JK(Q,z){let J=[];for(let Z of Array.isArray(Q)?Q:[Q]){let $=QK[Z];if($)for(let X of $){let Y=zK[X];if(!Y||Y===z)J.push(X)}else J.push(Z)}return J}var l$=()=>`No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule: import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community'; ModuleRegistry.registerModules([ AllCommunityModule ]); - `,h3=(_)=>{let f=_.map((z)=>`import { ${f$(z)} } from '${S5[z]?"ag-grid-enterprise":"ag-grid-community"}';`);if(_.some((z)=>z==="IntegratedCharts"||z==="Sparklines"))f.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';");return`import { ModuleRegistry } from 'ag-grid-community'; -${f.join(` + `,ZK=(Q)=>{let z=Q.map((Z)=>`import { ${m1(Z)} } from '${s$[Z]?"ag-grid-enterprise":"ag-grid-community"}';`);if(Q.some((Z)=>Z==="IntegratedCharts"||Z==="Sparklines"))z.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';");return`import { ModuleRegistry } from 'ag-grid-community'; +${z.join(` `)} -ModuleRegistry.registerModules([ ${_.map((z)=>f$(z,!0)).join(", ")} ]); +ModuleRegistry.registerModules([ ${Q.map((Z)=>m1(Z,!0)).join(", ")} ]); -For more info see: ${k1}/modules/`};function f$(_,f=!1){if(f&&(_==="IntegratedCharts"||_==="Sparklines"))return`${_}Module.with(AgChartsEnterpriseModule)`;return`${_}Module`}function u3(_,f){let $=f.filter((J)=>J==="IntegratedCharts"||J==="Sparklines"),z="";if(!globalThis?.agCharts&&$.length>0)z=`Unable to use ${_} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise. -`;else if(f.some((J)=>S5[J]))z=z+`Unable to use ${_} as that requires the ag-grid-enterprise script to be included. -`;return z}function R5({moduleName:_,rowModelType:f}){return`To use the ${_}Module you must set the gridOption "rowModelType='${f}'"`}var y9=({reasonOrId:_,moduleName:f,gridScoped:$,gridId:z,rowModelType:Q,additionalText:J,isUmd:q})=>{let X=g3(f,Q),Y=typeof _==="string"?_:p3[_];if(q)return u3(Y,X);let Z=X.filter((U)=>U==="IntegratedCharts"||U==="Sparklines"),G=Z.length>0?`${Z.map((U)=>f$(U)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`${`Unable to use ${Y} as ${X.length>1?"one of "+X.map((U)=>f$(U)).join(", "):f$(X[0])} is not registered${$?" for gridId: "+z:""}. ${G} Check if you have registered the module: +For more info see: ${H1}/modules/`};function m1(Q,z=!1){if(z&&(Q==="IntegratedCharts"||Q==="Sparklines"))return`${Q}Module.with(AgChartsEnterpriseModule)`;return`${Q}Module`}function $K(Q,z){let J=z.filter((X)=>X==="IntegratedCharts"||X==="Sparklines"),Z="";if(!globalThis?.agCharts&&J.length>0)Z=`Unable to use ${Q} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise. +`;else if(z.some((X)=>s$[X]))Z=Z+`Unable to use ${Q} as that requires the ag-grid-enterprise script to be included. +`;return Z}function a$({moduleName:Q,rowModelType:z}){return`To use the ${Q}Module you must set the gridOption "rowModelType='${z}'"`}var X8=({reasonOrId:Q,moduleName:z,gridScoped:J,gridId:Z,rowModelType:$,additionalText:X,isUmd:Y})=>{let G=JK(z,$),q=typeof Q==="string"?Q:qK[Q];if(Y)return $K(q,G);let H=G.filter((W)=>W==="IntegratedCharts"||W==="Sparklines"),_=H.length>0?`${H.map((W)=>m1(W)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`${`Unable to use ${q} as ${G.length>1?"one of "+G.map((W)=>m1(W)).join(", "):m1(G[0])} is not registered${J?" for gridId: "+Z:""}. ${_} Check if you have registered the module: `} -${h3(X)}`+(J?` +${ZK(G)}`+(X?` -${J}`:"")},b9=(_)=>{return`${_} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'. +${X}`:"")},Y8=(Q)=>{return`${Q} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'. import { AgChartsEnterpriseModule } from 'ag-charts-enterprise'; import { ModuleRegistry } from 'ag-grid-community'; -import { ${_} } from 'ag-grid-enterprise'; +import { ${Q} } from 'ag-grid-enterprise'; -ModuleRegistry.registerModules([${_}.with(AgChartsEnterpriseModule)]); - `},i3=(_)=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${_}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,m3={1:()=>"`rowData` must be an array",2:({nodeId:_})=>`Duplicate node id '${_}' detected from getRowId callback, this could cause issues in your grid.`,3:()=>"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",4:({id:_})=>`Could not find row id=${_}, data item was not found for this id`,5:({data:_})=>["Could not find data item as object was not found.",_," Consider using getRowId to help the Grid find matching row data"],6:()=>"'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'",7:()=>"Pivoting is not supported with aligned grids as it may produce different columns in each grid.",8:({key:_})=>`Unknown key for navigation ${_}`,9:({variable:_})=>`No value for ${_?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${_?.defaultValue} will be used and updated when styles load.`,10:({eventType:_})=>`As of v33, the '${_}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,11:()=>"No gridOptions provided to createGrid",12:({colKey:_})=>["column ",_," not found"],13:()=>"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",14:({groupPrefix:_})=>`Row IDs cannot start with ${_}, this is a reserved prefix for AG Grid's row grouping feature.`,15:({expression:_})=>["value should be either a string or a function",_],16:({expression:_,params:f,e:$})=>["Processing of the expression failed","Expression = ",_,"Params = ",f,"Exception = ",$],17:()=>"you need either field or valueSetter set on colDef for editing to work",18:()=>"alignedGrids contains an undefined option.",19:()=>"alignedGrids - No api found on the linked grid.",20:()=>`You may want to configure via a callback to avoid setup race conditions: - "alignedGrids: () => [linkedGrid]"`,21:()=>"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",22:({key:_})=>`${_} is an initial property and cannot be updated.`,23:()=>"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",24:()=>"row height must be a number if not using standard row model",25:({id:_})=>["The getRowId callback must return a string. The ID ",_," is being cast to a string."],26:({fnName:_,preDestroyLink:f})=>{return`Grid API function ${_}() cannot be called as the grid has been destroyed. +ModuleRegistry.registerModules([${Q}.with(AgChartsEnterpriseModule)]); + `},XK=(Q)=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${Q}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,YK={1:()=>"`rowData` must be an array",2:({nodeId:Q})=>`Duplicate node id '${Q}' detected from getRowId callback, this could cause issues in your grid.`,3:()=>"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",4:({id:Q})=>`Could not find row id=${Q}, data item was not found for this id`,5:({data:Q})=>["Could not find data item as object was not found.",Q," Consider using getRowId to help the Grid find matching row data"],6:()=>"'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'",7:()=>"Pivoting is not supported with aligned grids as it may produce different columns in each grid.",8:({key:Q})=>`Unknown key for navigation ${Q}`,9:({variable:Q})=>`No value for ${Q?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${Q?.defaultValue} will be used and updated when styles load.`,10:({eventType:Q})=>`As of v33, the '${Q}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,11:()=>"No gridOptions provided to createGrid",12:({colKey:Q})=>["column ",Q," not found"],13:()=>"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",14:({groupPrefix:Q})=>`Row IDs cannot start with ${Q}, this is a reserved prefix for AG Grid's row grouping feature.`,15:({expression:Q})=>["value should be either a string or a function",Q],16:({expression:Q,params:z,e:J})=>["Processing of the expression failed","Expression = ",Q,"Params = ",z,"Exception = ",J],17:()=>"you need either field or valueSetter set on colDef for editing to work",18:()=>"alignedGrids contains an undefined option.",19:()=>"alignedGrids - No api found on the linked grid.",20:()=>`You may want to configure via a callback to avoid setup race conditions: + "alignedGrids: () => [linkedGrid]"`,21:()=>"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",22:({key:Q})=>`${Q} is an initial property and cannot be updated.`,23:()=>"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",24:()=>"row height must be a number if not using standard row model",25:({id:Q})=>["The getRowId callback must return a string. The ID ",Q," is being cast to a string."],26:({fnName:Q,preDestroyLink:z})=>{return`Grid API function ${Q}() cannot be called as the grid has been destroyed. Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. - To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${f}`},27:({fnName:_,module:f})=>`API function '${_}' not registered to module '${f}'`,28:()=>"setRowCount cannot be used while using row grouping.",29:()=>"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",30:({toIndex:_})=>["tried to insert columns in invalid location, toIndex = ",_,"remember that you should not count the moving columns when calculating the new index"],31:()=>"infinite loop in resizeColumnSets",32:()=>"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.",33:()=>"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.",34:({key:_})=>`the column type '${_}' is a default column type and cannot be overridden.`,35:()=>"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.",36:({t:_})=>"colDef.type '"+_+"' does not correspond to defined gridOptions.columnTypes",37:()=>"Changing the column pinning status is not allowed with domLayout='print'",38:({iconName:_})=>`provided icon '${_}' needs to be a string or a function`,39:()=>"Applying column order broke a group where columns should be married together. Applying new order has been discarded.",40:({e:_,method:f})=>`${_} -${i3(f)}`,41:()=>"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",42:()=>"Browser does not support document.execCommand('copy') for clipboard operations",43:({iconName:_})=>`As of v33, icon '${_}' is deprecated. Use the icon CSS name instead.`,44:()=>'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',45:({parentCellDataType:_})=>`The data type definition ${_} does not exist.`,46:()=>'The "baseDataType" property of a data type definition must match that of its parent.',47:({cellDataType:_})=>`Missing data type definition - "${_}"`,48:({property:_,inferred:f,colId:$})=>{let z=f?" (inferred)":"",Q=$?` for column "${$}"`:"";return`Cell data type is "object"${z} but no Value ${_} has been provided${Q}. Please either provide an object data type definition with a Value ${_}, or set: - - "colDef.value${_}"${f&&_==="Parser"?` - - "colDef.cellDataType = 'object'"`:""}`},49:({methodName:_})=>`Framework component is missing the method ${_}()`,50:({compName:_})=>`Could not find component ${_}, did you forget to configure this component?`,51:()=>"Export cancelled. Export is not allowed as per your configuration.",52:()=>"There is no `window` associated with the current `document`",53:()=>"unknown value type during csv conversion",54:()=>"Could not find document body, it is needed for drag and drop and context menu.",55:()=>"addRowDropZone - A container target needs to be provided",56:()=>"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",57:()=>"unable to show popup filter, filter instantiation failed",58:()=>"no values found for select cellEditor",59:()=>"cannot select pinned rows",60:()=>"cannot select node until it has finished loading",61:()=>"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",62:({colId:_})=>`setFilterModel() - no column found for colId: ${_}`,63:({colId:_})=>`setFilterModel() - unable to fully apply model, filtering disabled for colId: ${_}`,64:({colId:_})=>`setFilterModel() - unable to fully apply model, unable to create filter for colId: ${_}`,65:()=>"filter missing setModel method, which is needed for setFilterModel",66:()=>"filter API missing getModel method, which is needed for getFilterModel",67:()=>"Filter is missing isFilterActive() method",68:()=>"Column Filter API methods have been disabled as Advanced Filters are enabled.",69:({guiFromFilter:_})=>`getGui method from filter returned ${_}; it should be a DOM element.`,70:({newFilter:_})=>`Grid option quickFilterText only supports string inputs, received: ${typeof _}`,71:()=>"debounceMs is ignored when apply button is present",72:({keys:_})=>["ignoring FilterOptionDef as it doesn't contain one of ",_],73:()=>"invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'",74:()=>"no filter options for filter",75:()=>"Unknown button type specified",76:({filterModelType:_})=>['Unexpected type of filter "',_,'", it looks like the filter was configured with incorrect Filter Options'],77:()=>"Filter model is missing 'conditions'",78:()=>'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',79:()=>'"filterParams.maxNumConditions" must be greater than or equal to zero.',80:()=>'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',81:()=>'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',82:({param:_})=>`DateFilter ${_} is not a number`,83:()=>"DateFilter minValidYear should be <= maxValidYear",84:()=>"DateFilter minValidDate should be <= maxValidDate",85:()=>"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",86:()=>"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",87:()=>"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",88:({index:_})=>`Invalid row index for ensureIndexVisible: ${_}`,89:()=>"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)",90:()=>"datasource is missing getRows method",91:()=>"Filter is missing method doesFilterPass",92:()=>"AnimationFrameService called but animation frames are off",93:()=>"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",94:({paginationPageSizeOption:_,pageSizeSet:f,pageSizesSet:$,pageSizeOptions:z})=>`'paginationPageSize=${_}'${f?"":" (default value)"}, but ${_} is not included in${$?"":" the default"} paginationPageSizeSelector=[${z?.join(", ")}].`,95:({paginationPageSizeOption:_,paginationPageSizeSelector:f})=>`Either set '${f}' to an array that includes ${_} or to 'false' to disable the page size selector.`,96:({id:_,data:f})=>["Duplicate ID",_,"found for pinned row with data",f,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."],97:({colId:_})=>`cellEditor for column ${_} is missing getGui() method`,98:()=>"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",99:()=>"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",101:({propertyName:_,componentName:f,agGridDefaults:$,jsComps:z})=>{let Q=[],J=[...Object.keys($??[]).filter((X)=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(X)),...Object.keys(z??[]).filter((X)=>!!z[X])],q=i6({inputValue:f,allSuggestions:J,hideIrrelevant:!0,filterByPercentageOfBestMatch:0.8}).values;if(Q.push(`Could not find '${f}' component. It was configured as "${_}: '${f}'" but it wasn't found in the list of registered components. -`),q.length>0)Q.push(` Did you mean: [${q.slice(0,3)}]? -`);return Q.push("If using a custom component check it has been registered correctly."),Q},102:()=>"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",103:()=>"Invalid selection state. When using client-side row model, the state must conform to `string[]`.",104:({value:_,param:f})=>`Numeric value ${_} passed to ${f} param will be interpreted as ${_} seconds. If this is intentional use "${_}s" to silence this warning.`,105:({e:_})=>["chart rendering failed",_],106:()=>`Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${k1}/theming-migration/`,107:({key:_,value:f})=>`Invalid value for theme param ${_} - ${f}`,108:({e:_})=>["chart update failed",_],109:({inputValue:_,allSuggestions:f})=>{let $=i6({inputValue:_,allSuggestions:f,hideIrrelevant:!0,filterByPercentageOfBestMatch:0.8}).values;return[`Could not find '${_}' aggregate function. It was configured as "aggFunc: '${_}'" but it wasn't found in the list of registered aggregations.`,$.length>0?` Did you mean: [${$.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join(` -`)},110:()=>"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",111:()=>"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",113:()=>"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",114:({component:_})=>`Could not find component with name of ${_}. Is it in Vue.components?`,116:()=>"Invalid selection state. The state must conform to `IServerSideSelectionState`.",117:()=>"selectAll must be of boolean type.",118:()=>"Infinite scrolling must be enabled in order to set the row count.",119:()=>"Unable to instantiate filter",120:()=>"MultiFloatingFilterComp expects MultiFilter as its parent",121:()=>"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",122:()=>"could not find the document, document is empty",123:()=>"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",124:()=>"No active charts to update.",125:({chartId:_})=>`Unable to update chart. No active chart found with ID: ${_}.`,126:()=>"unable to restore chart as no chart model is provided",127:({allRange:_})=>`unable to create chart as ${_?"there are no columns in the grid":"no range is selected"}.`,128:({feature:_})=>`${_} is only available if using 'multiRow' selection mode.`,129:({feature:_,rowModel:f})=>`${_} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${f}.`,130:()=>'cannot multi select unless selection mode is "multiRow"',132:()=>"Row selection features are not available unless `rowSelection` is enabled.",133:({iconName:_})=>`icon '${_}' function should return back a string or a dom object`,134:({iconName:_})=>`Did not find icon '${_}'`,135:()=>"Data type of the new value does not match the cell data type of the column",136:()=>"Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.",137:({type:_,currentChartType:f})=>`Unable to update chart as a '${_}' update type is not permitted on a ${f}.`,138:({chartType:_})=>`invalid chart type supplied: ${_}`,139:({customThemeName:_})=>`a custom chart theme with the name ${_} has been supplied but not added to the 'chartThemes' list`,140:({name:_})=>`no stock theme exists with the name '${_}' and no custom chart theme with that name was supplied to 'customChartThemes'`,141:()=>"cross filtering with row grouping is not supported.",142:()=>"cross filtering is only supported in the client side row model.",143:({panel:_})=>`'${_}' is not a valid Chart Tool Panel name`,144:({type:_})=>`Invalid charts data panel group name supplied: '${_}'`,145:({group:_})=>`As of v32, only one charts customize panel group can be expanded at a time. '${_}' will not be expanded.`,146:({comp:_})=>`Unable to instantiate component '${_}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,147:({group:_})=>`Invalid charts customize panel group name supplied: '${_}'`,148:({group:_})=>`invalid chartGroupsDef config '${_}'`,149:({group:_,chartType:f})=>`invalid chartGroupsDef config '${_}.${f}'`,150:()=>"'seriesChartTypes' are required when the 'customCombo' chart type is specified.",151:({chartType:_})=>`invalid chartType '${_}' supplied in 'seriesChartTypes', converting to 'line' instead.`,152:({colId:_})=>`no 'seriesChartType' found for colId = '${_}', defaulting to 'line'.`,153:({chartDataType:_})=>`unexpected chartDataType value '${_}' supplied, instead use 'category', 'series' or 'excluded'`,154:({colId:_})=>`cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${_}`,155:({option:_})=>`'${_}' is not a valid Chart Toolbar Option`,156:({panel:_})=>`Invalid panel in chartToolPanelsDef.panels: '${_}'`,157:({unrecognisedGroupIds:_})=>["unable to find group(s) for supplied groupIds:",_],158:()=>"can not expand a column item that does not represent a column group header",159:()=>"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",160:()=>"Export cancelled. Export is not allowed as per your configuration.",161:()=>"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",162:({id:_,dataType:f})=>`Unrecognized data type for excel export [${_}.dataType=${f}]`,163:({featureName:_})=>`Excel table export does not work with ${_}. The exported Excel file will not contain any Excel tables. - Please turn off ${_} to enable Excel table exports.`,164:()=>"Unable to add data table to Excel sheet: A table already exists.",165:()=>"Unable to add data table to Excel sheet: Missing required parameters.",166:({unrecognisedGroupIds:_})=>["unable to find groups for these supplied groupIds:",_],167:({unrecognisedColIds:_})=>["unable to find columns for these supplied colIds:",_],168:()=>"detailCellRendererParams.template should be function or string",169:()=>'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',170:({providedStrategy:_})=>`invalid cellRendererParams.refreshStrategy = ${_} supplied, defaulting to refreshStrategy = 'rows'.`,171:()=>"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",172:()=>"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",173:({group:_})=>`invalid chartGroupsDef config '${_}'`,174:({group:_,chartType:f})=>`invalid chartGroupsDef config '${_}.${f}'`,175:({menuTabName:_,itemsToConsider:f})=>[`Trying to render an invalid menu item '${_}'. Check that your 'menuTabs' contains one of `,f],176:({key:_})=>`unknown menu item type ${_}`,177:()=>"valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.",178:({colId:_})=>`column ${_} is not visible`,179:()=>"totalValueGetter should be either a function or a string (expression)",180:()=>"agRichSelectCellEditor requires cellEditorParams.values to be set",181:()=>"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",182:()=>'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',183:()=>"Group Column Filter only works on group columns. Please use a different filter.",184:({parentGroupData:_,childNodeData:f})=>["duplicate group keys for row data, keys should be unique",[_,f]],185:({data:_})=>["getDataPath() should not return an empty path",[_]],186:({rowId:_,rowData:f,duplicateRowsData:$})=>["duplicate group keys for row data, keys should be unique",_,f,...$??[]],187:({rowId:_,firstData:f,secondData:$})=>[`Duplicate node id ${_}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,"first instance",f,"second instance",$],188:(_)=>`getRowId callback must be provided for Server Side Row Model ${_?.feature||"selection"} to work correctly.`,189:({startRow:_})=>`invalid value ${_} for startRow, the value should be >= 0`,190:({rowGroupId:_,data:f})=>["null and undefined values are not allowed for server side row model keys",_?`column = ${_}`:"","data is ",f],194:({method:_})=>`calling gridApi.${_}() is only possible when using rowModelType=\`clientSide\`.`,195:({justCurrentPage:_})=>`selecting just ${_?"current page":"filtered"} only works when gridOptions.rowModelType='clientSide'`,196:({key:_})=>`Provided ids must be of string type. Invalid id provided: ${_}`,197:()=>"`toggledNodes` must be an array of string ids.",199:()=>"getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.",200:y9,201:({rowModelType:_})=>`Could not find row model for rowModelType = ${_}`,202:()=>"`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.",203:()=>"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",204:()=>"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",205:({duplicateIdText:_})=>`Unable to display rows as duplicate row ids (${_}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,206:()=>"getRowId callback must be implemented for transactions to work. Transaction was ignored.",207:()=>'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',208:()=>"Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.",209:()=>`Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${k1}/filter-set-filter-list/#filter-value-types`,210:()=>"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",211:()=>"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",212:()=>"please review all your toolPanel components, it seems like at least one of them doesn't have an id",213:()=>"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",214:({key:_})=>`unable to lookup Tool Panel as invalid key supplied: ${_}`,215:({key:_,defaultByKey:f})=>`the key ${_} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(f??{}).join(",")}`,216:({name:_})=>`Missing component for '${_}'`,217:({invalidColIds:_})=>["unable to find grid columns for the supplied colDef(s):",_],218:({property:_,defaultOffset:f})=>`${_} must be a number, the value you provided is not a valid number. Using the default of ${f}px.`,219:({property:_})=>`Property ${_} does not exist on the target object.`,220:({lineDash:_})=>`'${_}' is not a valid 'lineDash' option.`,221:()=>"agAggregationComponent should only be used with the client and server side row model.",222:()=>"agFilteredRowCountComponent should only be used with the client side row model.",223:()=>"agSelectedRowCountComponent should only be used with the client and server side row model.",224:()=>"agTotalAndFilteredRowCountComponent should only be used with the client side row model.",225:()=>"agTotalRowCountComponent should only be used with the client side row model.",226:()=>"viewport is missing init method.",227:()=>"menu item icon must be DOM node or string",228:({menuItemOrString:_})=>`unrecognised menu item ${_}`,230:()=>"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",231:()=>"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",232:()=>"Using both rowData and v-model. rowData will be ignored.",233:({methodName:_})=>`Framework component is missing the method ${_}()`,234:()=>'Group Column Filter does not work with the colDef property "field". This property will be ignored.',235:()=>'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',236:()=>'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',237:()=>"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",238:()=>"setRowCount can only accept a positive row count.",239:()=>'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',240:({theme:_})=>`theme grid option must be a Theming API theme object or the string "legacy", received: ${_}`,243:()=>"Failed to deserialize state - each provided state object must be an object.",244:()=>"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",245:()=>"Failed to deserialize state - `toggledNodes` must be an array.",246:()=>"Failed to deserialize state - Every `toggledNode` requires an associated string id.",247:()=>`Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. -Please rebuild the selection state and reapply it.`,248:()=>"SetFloatingFilter expects SetFilter as its parent",249:()=>"Must supply a Value Formatter in Set Filter params when using a Key Creator",250:()=>"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",251:({chartType:_})=>`AG Grid: Unable to create chart as an invalid chartType = '${_}' was supplied.`,252:()=>`cannot get grid to draw rows when it is in the middle of drawing rows. + To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${z}`},27:({fnName:Q,module:z})=>`API function '${Q}' not registered to module '${z}'`,28:()=>"setRowCount cannot be used while using row grouping.",29:()=>"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",30:({toIndex:Q})=>["tried to insert columns in invalid location, toIndex = ",Q,"remember that you should not count the moving columns when calculating the new index"],31:()=>"infinite loop in resizeColumnSets",32:()=>"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.",33:()=>"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.",34:({key:Q})=>`the column type '${Q}' is a default column type and cannot be overridden.`,35:()=>"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.",36:({t:Q})=>"colDef.type '"+Q+"' does not correspond to defined gridOptions.columnTypes",37:()=>"Changing the column pinning status is not allowed with domLayout='print'",38:({iconName:Q})=>`provided icon '${Q}' needs to be a string or a function`,39:()=>"Applying column order broke a group where columns should be married together. Applying new order has been discarded.",40:({e:Q,method:z})=>`${Q} +${XK(z)}`,41:()=>"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",42:()=>"Browser does not support document.execCommand('copy') for clipboard operations",43:({iconName:Q})=>`As of v33, icon '${Q}' is deprecated. Use the icon CSS name instead.`,44:()=>'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',45:({parentCellDataType:Q})=>`The data type definition ${Q} does not exist.`,46:()=>'The "baseDataType" property of a data type definition must match that of its parent.',47:({cellDataType:Q})=>`Missing data type definition - "${Q}"`,48:({property:Q,inferred:z,colId:J})=>{let Z=z?" (inferred)":"",$=J?` for column "${J}"`:"";return`Cell data type is "object"${Z} but no Value ${Q} has been provided${$}. Please either provide an object data type definition with a Value ${Q}, or set: + - "colDef.value${Q}"${z&&Q==="Parser"?` + - "colDef.cellDataType = 'object'"`:""}`},49:({methodName:Q})=>`Framework component is missing the method ${Q}()`,50:({compName:Q})=>`Could not find component ${Q}, did you forget to configure this component?`,51:()=>"Export cancelled. Export is not allowed as per your configuration.",52:()=>"There is no `window` associated with the current `document`",53:()=>"unknown value type during csv conversion",54:()=>"Could not find document body, it is needed for drag and drop and context menu.",55:()=>"addRowDropZone - A container target needs to be provided",56:()=>"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",57:()=>"unable to show popup filter, filter instantiation failed",58:()=>"no values found for select cellEditor",59:()=>"cannot select pinned rows",60:()=>"cannot select node until it has finished loading",61:()=>"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",62:({colId:Q})=>`setFilterModel() - no column found for colId: ${Q}`,63:({colId:Q})=>`setFilterModel() - unable to fully apply model, filtering disabled for colId: ${Q}`,64:({colId:Q})=>`setFilterModel() - unable to fully apply model, unable to create filter for colId: ${Q}`,65:()=>"filter missing setModel method, which is needed for setFilterModel",66:()=>"filter API missing getModel method, which is needed for getFilterModel",67:()=>"Filter is missing isFilterActive() method",68:()=>"Column Filter API methods have been disabled as Advanced Filters are enabled.",69:({guiFromFilter:Q})=>`getGui method from filter returned ${Q}; it should be a DOM element.`,70:({newFilter:Q})=>`Grid option quickFilterText only supports string inputs, received: ${typeof Q}`,71:()=>"debounceMs is ignored when apply button is present",72:({keys:Q})=>["ignoring FilterOptionDef as it doesn't contain one of ",Q],73:()=>"invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'",74:()=>"no filter options for filter",75:()=>"Unknown button type specified",76:({filterModelType:Q})=>['Unexpected type of filter "',Q,'", it looks like the filter was configured with incorrect Filter Options'],77:()=>"Filter model is missing 'conditions'",78:()=>'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',79:()=>'"filterParams.maxNumConditions" must be greater than or equal to zero.',80:()=>'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',81:()=>'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',82:({param:Q})=>`DateFilter ${Q} is not a number`,83:()=>"DateFilter minValidYear should be <= maxValidYear",84:()=>"DateFilter minValidDate should be <= maxValidDate",85:()=>"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",86:()=>"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",87:()=>"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",88:({index:Q})=>`Invalid row index for ensureIndexVisible: ${Q}`,89:()=>"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)",90:()=>"datasource is missing getRows method",91:()=>"Filter is missing method doesFilterPass",92:()=>"AnimationFrameService called but animation frames are off",93:()=>"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",94:({paginationPageSizeOption:Q,pageSizeSet:z,pageSizesSet:J,pageSizeOptions:Z})=>`'paginationPageSize=${Q}'${z?"":" (default value)"}, but ${Q} is not included in${J?"":" the default"} paginationPageSizeSelector=[${Z?.join(", ")}].`,95:({paginationPageSizeOption:Q,paginationPageSizeSelector:z})=>`Either set '${z}' to an array that includes ${Q} or to 'false' to disable the page size selector.`,96:({id:Q,data:z})=>["Duplicate ID",Q,"found for pinned row with data",z,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."],97:({colId:Q})=>`cellEditor for column ${Q} is missing getGui() method`,98:()=>"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",99:()=>"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",101:({propertyName:Q,componentName:z,agGridDefaults:J,jsComps:Z})=>{let $=[],X=[...Object.keys(J??[]).filter((G)=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(G)),...Object.keys(Z??[]).filter((G)=>!!Z[G])],Y=D5({inputValue:z,allSuggestions:X,hideIrrelevant:!0,filterByPercentageOfBestMatch:0.8}).values;if($.push(`Could not find '${z}' component. It was configured as "${Q}: '${z}'" but it wasn't found in the list of registered components. +`),Y.length>0)$.push(` Did you mean: [${Y.slice(0,3)}]? +`);return $.push("If using a custom component check it has been registered correctly."),$},102:()=>"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",103:()=>"Invalid selection state. When using client-side row model, the state must conform to `string[]`.",104:({value:Q,param:z})=>`Numeric value ${Q} passed to ${z} param will be interpreted as ${Q} seconds. If this is intentional use "${Q}s" to silence this warning.`,105:({e:Q})=>["chart rendering failed",Q],106:()=>`Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${H1}/theming-migration/`,107:({key:Q,value:z})=>`Invalid value for theme param ${Q} - ${z}`,108:({e:Q})=>["chart update failed",Q],109:({inputValue:Q,allSuggestions:z})=>{let J=D5({inputValue:Q,allSuggestions:z,hideIrrelevant:!0,filterByPercentageOfBestMatch:0.8}).values;return[`Could not find '${Q}' aggregate function. It was configured as "aggFunc: '${Q}'" but it wasn't found in the list of registered aggregations.`,J.length>0?` Did you mean: [${J.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join(` +`)},110:()=>"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",111:()=>"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",113:()=>"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",114:({component:Q})=>`Could not find component with name of ${Q}. Is it in Vue.components?`,116:()=>"Invalid selection state. The state must conform to `IServerSideSelectionState`.",117:()=>"selectAll must be of boolean type.",118:()=>"Infinite scrolling must be enabled in order to set the row count.",119:()=>"Unable to instantiate filter",120:()=>"MultiFloatingFilterComp expects MultiFilter as its parent",121:()=>"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",122:()=>"could not find the document, document is empty",123:()=>"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",124:()=>"No active charts to update.",125:({chartId:Q})=>`Unable to update chart. No active chart found with ID: ${Q}.`,126:()=>"unable to restore chart as no chart model is provided",127:({allRange:Q})=>`unable to create chart as ${Q?"there are no columns in the grid":"no range is selected"}.`,128:({feature:Q})=>`${Q} is only available if using 'multiRow' selection mode.`,129:({feature:Q,rowModel:z})=>`${Q} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${z}.`,130:()=>'cannot multi select unless selection mode is "multiRow"',132:()=>"Row selection features are not available unless `rowSelection` is enabled.",133:({iconName:Q})=>`icon '${Q}' function should return back a string or a dom object`,134:({iconName:Q})=>`Did not find icon '${Q}'`,135:()=>"Data type of the new value does not match the cell data type of the column",136:()=>"Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.",137:({type:Q,currentChartType:z})=>`Unable to update chart as a '${Q}' update type is not permitted on a ${z}.`,138:({chartType:Q})=>`invalid chart type supplied: ${Q}`,139:({customThemeName:Q})=>`a custom chart theme with the name ${Q} has been supplied but not added to the 'chartThemes' list`,140:({name:Q})=>`no stock theme exists with the name '${Q}' and no custom chart theme with that name was supplied to 'customChartThemes'`,141:()=>"cross filtering with row grouping is not supported.",142:()=>"cross filtering is only supported in the client side row model.",143:({panel:Q})=>`'${Q}' is not a valid Chart Tool Panel name`,144:({type:Q})=>`Invalid charts data panel group name supplied: '${Q}'`,145:({group:Q})=>`As of v32, only one charts customize panel group can be expanded at a time. '${Q}' will not be expanded.`,146:({comp:Q})=>`Unable to instantiate component '${Q}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,147:({group:Q})=>`Invalid charts customize panel group name supplied: '${Q}'`,148:({group:Q})=>`invalid chartGroupsDef config '${Q}'`,149:({group:Q,chartType:z})=>`invalid chartGroupsDef config '${Q}.${z}'`,150:()=>"'seriesChartTypes' are required when the 'customCombo' chart type is specified.",151:({chartType:Q})=>`invalid chartType '${Q}' supplied in 'seriesChartTypes', converting to 'line' instead.`,152:({colId:Q})=>`no 'seriesChartType' found for colId = '${Q}', defaulting to 'line'.`,153:({chartDataType:Q})=>`unexpected chartDataType value '${Q}' supplied, instead use 'category', 'series' or 'excluded'`,154:({colId:Q})=>`cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${Q}`,155:({option:Q})=>`'${Q}' is not a valid Chart Toolbar Option`,156:({panel:Q})=>`Invalid panel in chartToolPanelsDef.panels: '${Q}'`,157:({unrecognisedGroupIds:Q})=>["unable to find group(s) for supplied groupIds:",Q],158:()=>"can not expand a column item that does not represent a column group header",159:()=>"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",160:()=>"Export cancelled. Export is not allowed as per your configuration.",161:()=>"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",162:({id:Q,dataType:z})=>`Unrecognized data type for excel export [${Q}.dataType=${z}]`,163:({featureName:Q})=>`Excel table export does not work with ${Q}. The exported Excel file will not contain any Excel tables. + Please turn off ${Q} to enable Excel table exports.`,164:()=>"Unable to add data table to Excel sheet: A table already exists.",165:()=>"Unable to add data table to Excel sheet: Missing required parameters.",166:({unrecognisedGroupIds:Q})=>["unable to find groups for these supplied groupIds:",Q],167:({unrecognisedColIds:Q})=>["unable to find columns for these supplied colIds:",Q],168:()=>"detailCellRendererParams.template should be function or string",169:()=>'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',170:({providedStrategy:Q})=>`invalid cellRendererParams.refreshStrategy = ${Q} supplied, defaulting to refreshStrategy = 'rows'.`,171:()=>"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",172:()=>"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",173:({group:Q})=>`invalid chartGroupsDef config '${Q}'`,174:({group:Q,chartType:z})=>`invalid chartGroupsDef config '${Q}.${z}'`,175:({menuTabName:Q,itemsToConsider:z})=>[`Trying to render an invalid menu item '${Q}'. Check that your 'menuTabs' contains one of `,z],176:({key:Q})=>`unknown menu item type ${Q}`,177:()=>"valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.",178:({colId:Q})=>`column ${Q} is not visible`,179:()=>"totalValueGetter should be either a function or a string (expression)",180:()=>"agRichSelectCellEditor requires cellEditorParams.values to be set",181:()=>"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",182:()=>'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',183:()=>"Group Column Filter only works on group columns. Please use a different filter.",184:({parentGroupData:Q,childNodeData:z})=>["duplicate group keys for row data, keys should be unique",[Q,z]],185:({data:Q})=>["getDataPath() should not return an empty path",[Q]],186:({rowId:Q,rowData:z,duplicateRowsData:J})=>["duplicate group keys for row data, keys should be unique",Q,z,...J??[]],187:({rowId:Q,firstData:z,secondData:J})=>[`Duplicate node id ${Q}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,"first instance",z,"second instance",J],188:(Q)=>`getRowId callback must be provided for Server Side Row Model ${Q?.feature||"selection"} to work correctly.`,189:({startRow:Q})=>`invalid value ${Q} for startRow, the value should be >= 0`,190:({rowGroupId:Q,data:z})=>["null and undefined values are not allowed for server side row model keys",Q?`column = ${Q}`:"","data is ",z],194:({method:Q})=>`calling gridApi.${Q}() is only possible when using rowModelType=\`clientSide\`.`,195:({justCurrentPage:Q})=>`selecting just ${Q?"current page":"filtered"} only works when gridOptions.rowModelType='clientSide'`,196:({key:Q})=>`Provided ids must be of string type. Invalid id provided: ${Q}`,197:()=>"`toggledNodes` must be an array of string ids.",199:()=>"getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.",200:X8,201:({rowModelType:Q})=>`Could not find row model for rowModelType = ${Q}`,202:()=>"`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.",203:()=>"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",204:()=>"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",205:({duplicateIdText:Q})=>`Unable to display rows as duplicate row ids (${Q}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,206:()=>"getRowId callback must be implemented for transactions to work. Transaction was ignored.",207:()=>'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',208:()=>"Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.",209:()=>`Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${H1}/filter-set-filter-list/#filter-value-types`,210:()=>"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",211:()=>"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",212:()=>"please review all your toolPanel components, it seems like at least one of them doesn't have an id",213:()=>"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",214:({key:Q})=>`unable to lookup Tool Panel as invalid key supplied: ${Q}`,215:({key:Q,defaultByKey:z})=>`the key ${Q} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(z??{}).join(",")}`,216:({name:Q})=>`Missing component for '${Q}'`,217:({invalidColIds:Q})=>["unable to find grid columns for the supplied colDef(s):",Q],218:({property:Q,defaultOffset:z})=>`${Q} must be a number, the value you provided is not a valid number. Using the default of ${z}px.`,219:({property:Q})=>`Property ${Q} does not exist on the target object.`,220:({lineDash:Q})=>`'${Q}' is not a valid 'lineDash' option.`,221:()=>"agAggregationComponent should only be used with the client and server side row model.",222:()=>"agFilteredRowCountComponent should only be used with the client side row model.",223:()=>"agSelectedRowCountComponent should only be used with the client and server side row model.",224:()=>"agTotalAndFilteredRowCountComponent should only be used with the client side row model.",225:()=>"agTotalRowCountComponent should only be used with the client side row model.",226:()=>"viewport is missing init method.",227:()=>"menu item icon must be DOM node or string",228:({menuItemOrString:Q})=>`unrecognised menu item ${Q}`,230:()=>"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",231:()=>"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",232:()=>"Using both rowData and v-model. rowData will be ignored.",233:({methodName:Q})=>`Framework component is missing the method ${Q}()`,234:()=>'Group Column Filter does not work with the colDef property "field". This property will be ignored.',235:()=>'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',236:()=>'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',237:()=>"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",238:()=>"setRowCount can only accept a positive row count.",239:()=>'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',240:({theme:Q})=>`theme grid option must be a Theming API theme object or the string "legacy", received: ${Q}`,243:()=>"Failed to deserialize state - each provided state object must be an object.",244:()=>"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",245:()=>"Failed to deserialize state - `toggledNodes` must be an array.",246:()=>"Failed to deserialize state - Every `toggledNode` requires an associated string id.",247:()=>`Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. +Please rebuild the selection state and reapply it.`,248:()=>"SetFloatingFilter expects SetFilter as its parent",249:()=>"Must supply a Value Formatter in Set Filter params when using a Key Creator",250:()=>"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",251:({chartType:Q})=>`AG Grid: Unable to create chart as an invalid chartType = '${Q}' was supplied.`,252:()=>`cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). -To see what part of your code that caused the refresh check this stacktrace.`,253:({version:_})=>["Illegal version string: ",_],254:()=>"Cannot create chart: no chart themes available.",255:({point:_})=>`Lone surrogate U+${_?.toString(16).toUpperCase()} is not a scalar value`,256:()=>"Unable to initialise. See validation error, or load ValidationModule if missing.",257:()=>b9("IntegratedChartsModule"),258:()=>b9("SparklinesModule"),259:({part:_})=>`the argument to theme.withPart must be a Theming API part object, received: ${_}`,260:({propName:_,compName:f,gridScoped:$,gridId:z,rowModelType:Q})=>y9({reasonOrId:`AG Grid '${_}' component: ${f}`,moduleName:j1[f],gridId:z,gridScoped:$,rowModelType:Q}),261:()=>"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",262:()=>'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',263:()=>'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',264:()=>'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',265:({colId:_})=>`Unable to infer chart data type for column '${_}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${k1}/integrated-charts-range-chart#coldefchartdatatype .`,266:()=>'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',267:()=>"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",268:()=>"Transactions aren't supported with tree data when using treeDataChildrenField",269:()=>"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",270:({id:_,parentId:f})=>`Cycle detected for row with id='${_}' and parent id='${f}'. Resetting the parent for row with id='${_}' and showing it as a root-level node.`,271:({id:_,parentId:f})=>`Parent row not found for row with id='${_}' and parent id='${f}'. Showing row with id='${_}' as a root-level node.`,272:()=>A5(),273:({providedId:_,usedId:f})=>`Provided column id '${_}' was already in use, ensure all column and group ids are unique. Using '${f}' instead.`,274:({prop:_})=>{let f=`Since v33, ${_} has been deprecated.`;switch(_){case"maxComponentCreationTimeMs":f+=" This property is no longer required and so will be removed in a future version.";break;case"setGridApi":f+=" This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api ";break;case"children":f+=" For multiple versions AgGridReact does not support children.";break}return f},275:R5,276:()=>"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",277:({colId:_})=>`'enableFilterHandlers' is set to true, but column '${_}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,278:({colId:_})=>`Unable to create filter handler for column '${_}'`,279:(_)=>{},280:({colId:_})=>`'name' must be provided for custom filter components for column '${_}`,281:({colId:_})=>`Filter for column '${_}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,282:()=>"New filter tool panel requires `enableFilterHandlers: true`.",283:()=>"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",284:()=>"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",285:()=>"As of v34, use (`api.getColumnFilterModel()`) instead.",286:()=>"As of v34, use (`api.setColumnFilterModel()`) instead.",287:()=>"`api.doFilterAction()` requires `enableFilterHandlers = true",288:()=>"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",289:({rowModelType:_})=>`Row Model '${_}' is not supported with Batch Editing`,290:({rowIndex:_,rowPinned:f})=>`Row with index '${_}' and pinned state '${f}' not found`,291:()=>"License Key being set multiple times with different values. This can result in an incorrect license key being used,",292:({colId:_})=>`The Multi Filter for column '${_}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,293:()=>"The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.",294:()=>"When using the `agRichSelectCellEditor` setting `filterListAsync = true` requires `allowTyping = true` and the `values()` callback must return a Promise of filtered values.",295:({blockedService:_})=>`colDef.allowFormula is not supported with ${_}. Formulas has been turned off.`,296:()=>"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.",297:()=>'`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.',298:()=>"Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates."};function c3(_,f){let $=m3[_];if(!$)return[`Missing error text for error id ${_}!`];let z=$(f),J=` -See ${Pq(_,f)}`;return Array.isArray(z)?z.concat(J):[z,J]}var p3={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},n3=class{constructor(_="javascript"){this.frameworkName=_,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.wrapIncoming=(f)=>f(),this.wrapOutgoing=(f)=>f(),this.baseDocLink=`${Dq}/${this.frameworkName}-data-grid`,E7(this.baseDocLink)}frameworkComponent(_){return null}isFrameworkComponent(_){return!1}getDocLink(_){return this.baseDocLink+(_?"/"+_:"")}},C9=new WeakMap,w9=new WeakMap;function b$(_,f,$){if(!f)return e(11),{};let z=$,Q;if(!z?.setThemeOnGridDiv){let q=z_({tag:"div"});q.style.height="100%",_.appendChild(q),_=q,Q=()=>_.remove()}return new t3().create(_,f,(q)=>{let X=new qE(_);q.createBean(X)},void 0,$,Q)}var d3=1,t3=class{create(_,f,$,z,Q,J){let q=zJ.applyGlobalGridOptions(f),X=q.gridId??String(d3++),Y=this.getRegisteredModules(Q,X,q.rowModelType),Z=this.createBeansList(q.rowModelType,Y,X),G=this.createProvidedBeans(_,q,Q);if(!Z)return;let H=new g8({providedBeanInstances:G,beanClasses:Z,id:X,beanInitComparator:i8,beanDestroyComparator:m8,derivedBeans:[h8],destroyCallback:()=>{w9.delete(W),C9.delete(_),q7(X),J?.()}});this.registerModuleFeatures(H,Y),$(H),H.getBean("syncSvc").start(),z?.(H);let W=H.getBean("gridApi");return C9.set(_,W),w9.set(W,_),W}getRegisteredModules(_,f,$){return X$(C3,void 0,!0),_?.modules?.forEach((z)=>X$(z,f)),X7(f,x9($))}registerModuleFeatures(_,f){let $=_.getBean("registry"),z=_.getBean("apiFunctionSvc");for(let Q of f){$.registerModule(Q);let J=Q.apiFunctions;if(J){let q=Object.keys(J);for(let X of q)z?.addFunction(X,J[X])}}}createProvidedBeans(_,f,$){let z=$?$.frameworkOverrides:null;if(n(z))z=new n3;let Q={gridOptions:f,eGridDiv:_,eRootDiv:_,globalListener:$?$.globalListener:null,globalSyncListener:$?$.globalSyncListener:null,frameworkOverrides:z,withinStudio:$?.withinStudio};if($?.providedBeanInstances)Object.assign(Q,$.providedBeanInstances);return Q}createBeansList(_,f,$){let z={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},Q=x9(_),J=z[Q];if(!J){r1(201,{rowModelType:Q},`Unknown rowModelType ${Q}.`);return}if(!Z7()){r1(272,void 0,A5());return}if(!_){let X=Object.entries(z).filter(([Y,Z])=>A6(Z,$,Y));if(X.length==1){let[Y,Z]=X[0];if(Y!==Q){let G={moduleName:Z,rowModelType:Y};r1(275,G,R5(G));return}}}if(!A6(J,$,Q)){let X=JJ(),Y=`rowModelType = '${Q}'`,Z=X?`Unable to use ${Y} as that requires the ag-grid-enterprise script to be included. -`:`Missing module ${J}Module for rowModelType ${Q}.`;r1(200,{reasonOrId:Y,moduleName:J,gridScoped:QJ(),gridId:$,rowModelType:Q,isUmd:X},Z);return}let q=new Set;for(let X of f)for(let Y of X.beans??[])q.add(Y);return Array.from(q)}};function x9(_){return _??"clientSide"}function r3(_,f,$="auto"){_.frameworkOverrides.wrapIncoming(()=>_.ctrlsSvc.getScrollFeature().ensureColumnVisible(f,$),"ensureVisible")}function l3(_,f,$){_.frameworkOverrides.wrapIncoming(()=>_.ctrlsSvc.getScrollFeature().ensureIndexVisible(f,$),"ensureVisible")}var j5=(_,f)=>{for(let $=0,z=_.length;${if($!=null){let J=$.getSortedRows();for(let q=0,X=J.length;q{let Z=X.level+1;for(let G=0,E=Y.length;G{if(!E&&E!==void 0){let D=L.sourceRowIndex;E=D<=U,U=D}if(L.data!==F){if(L.updateData(F),!q.has(L))X.add(L);if(!L.selectable&&L.isSelected())Z.push(L)}},B=(L,F,D)=>{for(let M=0,k=F.length;M0;if(K){let L=$._leafs??($._leafs=[]);if(E===void 0)fK(L,Y,J);else if(_K(L,Y))J.reordered=!0}if(K||H||X.size)_.rowDataUpdated=!0,this.deselect(Z)}deleteUnusedNodes(_,{removals:f},$,z){let Q=this.rootNode._leafs;for(let J=0,q=Q.length;J0}updateRowData(_,f,$){if(this.dispatchRowDataUpdateStarted(_.add),this.beans.groupStage?.getNestedDataGetter())return j(268),{remove:[],update:[],add:[]};let z=[],Q=V6(this.gos),J=this.executeRemove(Q,_,f,z,$),q=this.executeUpdate(Q,_,f,z),X=this.executeAdd(_,f);return this.deselect(z),{remove:J,update:q,add:X}}executeRemove(_,{remove:f},{adds:$,updates:z,removals:Q},J,q){let X=this.rootNode._leafs,Y=X?.length,Z=f?.length;if(!Z||!Y)return[];let G=0,E=Y,U=0,H=Array(Z);for(let W=0;WU)U=K;if(H[G++]=B,!this.destroyNode(B,q))continue;if(B.isSelected())J.push(B);if(!$.delete(B))z.delete(B),Q.push(B)}if(H.length=G,G)e3(X,E,U);return H}executeUpdate(_,{update:f},{adds:$,updates:z},Q){let J=f?.length;if(!J)return[];let q=Array(J),X=0;for(let Y=0;Y=Y;--E){let H=z[E];H.sourceRowIndex=U,z[U--]=H}f.reordered=!0}z.length=X;let Z=Array(q),G=f.adds;for(let E=0;E=$||Number.isNaN(f))return $;f=Math.ceil(f);let z=this.gos;if(f>0&&z.get("treeData")&&z.get("getDataPath"))f=a3(_,f);return f}},a3=(_,f)=>{for(let $=0,z=_.length;${if(_.group=!0,_.level=-1,_._expanded=!0,_.id="ROOT_NODE_ID",_._leafs?.length!==0)_._leafs=[];let f=[],$=[],z=[],Q=[];_.childrenAfterGroup=f,_.childrenAfterSort=$,_.childrenAfterAggFilter=z,_.childrenAfterFilter=Q;let J=_.sibling;if(J)J.childrenAfterGroup=f,J.childrenAfterSort=$,J.childrenAfterAggFilter=z,J.childrenAfterFilter=Q,J.childrenMapped=_.childrenMapped;return _.updateHasChildren(),_},o3=(_,f)=>{if(_)for(let $=0,z=_.length;${f=Math.max(0,f);for(let z=f,Q=_.length;z{let $=f.size;_.length=$;let z=0,Q=!1,J=!1;for(let q of f){let X=q.sourceRowIndex;if(X===z)J||(J=Q);else{if(X>=0)J=!0;else Q=!0;q.sourceRowIndex=z,_[z]=q}++z}return J},fK=(_,f,{adds:$})=>{let z=_.length,Q=f.size;if(Q>z)_.length=Q;let J=0;for(let q=0;q{if(z.hasChildren())if(_&&!Q)z.childrenAfterFilter=z.childrenAfterGroup.filter((J)=>{let q=J.childrenAfterFilter&&J.childrenAfterFilter.length>0,X=J.data&&this.filterManager.doesRowPassFilter({rowNode:J});return q||X});else z.childrenAfterFilter=z.childrenAfterGroup;else z.childrenAfterFilter=z.childrenAfterGroup;m6(z)};if(this.doingTreeDataFiltering()){let z=(Q,J)=>{if(Q.childrenAfterGroup)for(let q=0;q$(Q,!1);R_(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,f,z)}}softFilter(_,f){let $=(Q)=>{if(Q.childrenAfterFilter=Q.childrenAfterGroup,Q.hasChildren())for(let J of Q.childrenAfterGroup)J.softFiltered=_&&!(J.data&&this.filterManager.doesRowPassFilter({rowNode:J}));m6(Q)},z=this.beans.rowModel;R_(z.rootNode,z.hierarchical,f,$)}doingTreeDataFiltering(){let{gos:_}=this;return!!this.beans.groupStage?.treeData&&!_.get("excludeChildrenWhenTreeDataFiltering")}},zK=4,QK=(_,f,$,z,Q)=>{let{childrenAfterSort:J,childrenAfterAggFilter:q}=f;if(!q)return J&&J.length>0?J:[];let X=q.length;if(X<=1){if(J?.length===X&&(X===0||J[0]===q[0]))return J;return q.slice()}if(!J||X<=zK)return _.doFullSortInPlace(q.slice(),Q);let Y=new Map,{updates:Z,adds:G}=$,E=[];for(let H=0;H_.compareRowNodes(Q,H,W)||~Y.get(H)-~Y.get(W)),U===X)return E;return JK(_,Q,E,J,Y,X)},JK=(_,f,$,z,Q,J)=>{let q=Array(J),X=0,Y=$[X],Z,G=-1,E=0,U=0,H=$.length,W=z.length;while(!0){if(G<0){if(E>=W)break;if(Z=z[E++],G=Q.get(Z)??-1,G<0)continue}if((_.compareRowNodes(f,Y,Z)||~Q.get(Y)-G)<0){if(q[U++]=Y,++X>=H)break;Y=$[X]}else q[U++]=Z,G=-1}while(X=0)q[U++]=B}return q},qK=(_,f,$)=>{let z=0;$.length=f.size;for(let Q=0,J=_.length;Q{let{childrenAfterSort:f,sibling:$}=_;if($)$.childrenAfterSort=f;if(!f)return;for(let z=0,Q=f.length-1;z<=Q;z++){let J=f[z],q=z===0,X=z===Q;if(J.firstChild!==q)J.firstChild=q,J.dispatchRowEvent("firstChildChanged");if(J.lastChild!==X)J.lastChild=X,J.dispatchRowEvent("lastChildChanged");if(J.childIndex!==z)J.childIndex=z,J.dispatchRowEvent("childIndexChanged")}},XK=class extends A{constructor(){super(...arguments);this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(_,f){let $=this.beans.sortSvc.getSortOptions(),z=$.length>0&&!!f&&this.gos.get("deltaSort"),{gos:Q,colModel:J,rowGroupColsSvc:q,rowNodeSorter:X,rowRenderer:Y,showRowGroupCols:Z}=this.beans,G=Q.get("groupMaintainOrder"),E=J.getCols().some((F)=>F.isRowGroupActive()),U=q?.columns,H=J.isPivotMode(),W=Q.getCallback("postSortRows"),B=!1,K,L=(F)=>{let D=H&&F.leafGroup,M=G&&E&&!F.leafGroup;if(M)K??(K=this.shouldSortContainsGroupCols($)),M&&(M=!K);let k=null;if(M){let R=!1;if(U){let O=F.level+1;if(O{let{childrenAfterSort:f,childrenAfterAggFilter:$}=_,z=f?.length,Q=$?.length;if(!z||!Q)return null;let J=Array(Q),q=new Set;for(let Y=0;Y{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:$,columnRowGroupChanged:$,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:()=>this.refreshModel({step:"pivot"}),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),stylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){let{beans:_,stagesRefreshProps:f}=this,$=[_.groupStage,_.filterStage,_.pivotStage,_.aggStage,_.sortStage,_.filterAggStage,_.flattenStage].filter((z)=>!!z);this.stages=$;for(let z=$.length-1;z>=0;--z){let Q=$[z];for(let J of Q.refreshProps)f.set(J,z)}this.addManagedPropertyListeners([...f.keys(),"rowData"],(z)=>{let Q=z.changeSet?.properties;if(Q)this.onPropChange(Q)}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){if(this.started=!0,this.rowNodesCountReady)this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0});else this.setInitialData()}setInitialData(){if(this.gos.get("rowData"))this.onPropChange(["rowData"])}ensureRowHeightsValid(_,f,$,z){let Q,J=!1;do{Q=!1;let q=this.getRowIndexAtPixel(_),X=this.getRowIndexAtPixel(f),Y=Math.max(q,$),Z=Math.min(X,z);for(let G=Y;G<=Z;G++){let E=this.getRow(G);if(E.rowHeightEstimated){let U=Y$(this.beans,E);E.setRowHeight(U.height),Q=!0,J=!0}}if(Q)this.setRowTopAndRowIndex()}while(Q);return J}onPropChange(_){let{nodeManager:f,gos:$,beans:z}=this,Q=z.groupStage;if(!f)return;let J=new Set(_),q=Q?.onPropChange(J),X;if(J.has("rowData"))X=$.get("rowData");else if(q)X=Q?.extractData();if(X&&!Array.isArray(X))X=null,j(1);let Y={step:"nothing",changedProps:J};if(X){let G=!q&&!this.isEmpty()&&X.length>0&&$.exists("getRowId")&&!$.get("resetRowDataOnUpdate");if(this.refreshingData=!0,G)Y.keepRenderedRows=!0,Y.animate=!$.get("suppressAnimationFrame"),Y.changedRowNodes=new R1,f.setImmutableRowData(Y,X);else Y.rowDataUpdated=!0,Y.newData=!0,f.setNewRowData(X),this.rowNodesCountReady=!0}let Z=Y.rowDataUpdated?"group":this.getRefreshedStage(_);if(Z)Y.step=Z,this.refreshModel(Y)}getRefreshedStage(_){let{stages:f,stagesRefreshProps:$}=this;if(!f)return null;let z=f.length,Q=z;for(let J=0,q=_.length;J{if(J?.id!=null&&!f.has(J.id))J.clearRowTopAndRowIndex()},z=(J)=>{$(J),$(J.detailNode),$(J.sibling);let q=J.childrenAfterGroup;if(!J.hasChildren()||!q)return;if(_&&J.level!==-1&&!J.expanded)return;for(let X=0,Y=q.length;X{let Z=J[Y];if(this.gos.get("groupHideOpenParents"))while(Z.expanded&&Z.childrenAfterSort&&Z.childrenAfterSort.length>0)Z=Z.childrenAfterSort[0];return Z.rowIndex},X=f.footerSvc;if(X)return X?.getTopDisplayIndex(z,_,J,q);return q(_)}getTopLevelIndexFromDisplayedIndex(_){let{rootNode:f,rowsToDisplay:$}=this;if(!f||!$.length||$[0]===f)return _;let Q=this.getRow(_);if(Q.footer)Q=Q.sibling;let J=Q.parent;while(J&&J!==f)Q=J,J=Q.parent;let q=f.childrenAfterSort?.indexOf(Q)??-1;return q>=0?q:_}getRowBounds(_){let f=this.rowsToDisplay[_];return f?{rowTop:f.rowTop,rowHeight:f.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:S1(this.gos)})}onFilterChanged({afterDataChange:_,columns:f}){if(!_){let z=f.length===0||f.some((Q)=>Q.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:z,keepRenderedRows:!0,animate:S1(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:S1(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}isSuppressModelUpdateAfterUpdateTransaction(_){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;let{changedRowNodes:f,newData:$,rowDataUpdated:z}=_;if(!f||$||!z)return!1;if(f.removals.length||f.adds.size)return!1;return!0}reMapRows(){if(this.refreshingModel||this.refreshingData){this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,this.noAnimate=!0;return}this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(_){let{nodeManager:f,eventSvc:$,started:z}=this;if(!f)return;let Q=!!_.rowDataUpdated;if(z&&Q)$.dispatchEvent({type:"rowDataUpdated"});if(this.deferRefresh(_)){this.setPendingRefreshFlags(_),this.rowDataUpdatedPending||(this.rowDataUpdatedPending=Q);return}if(this.rowDataUpdatedPending)this.rowDataUpdatedPending=!1,_.step="group";this.updateRefreshParams(_);let J=!1;this.refreshingModel=!0;try{this.executeRefresh(_,Q),J=!0}finally{if(this.refreshingData=!1,this.refreshingModel=!1,!J)this.setPendingRefreshFlags(_)}this.clearPendingRefreshFlags(),$.dispatchEvent({type:"modelUpdated",animate:_.animate,keepRenderedRows:_.keepRenderedRows,newData:_.newData,newPage:!1,keepUndoRedoStack:_.keepUndoRedoStack})}executeRefresh(_,f){let{beans:$,rootNode:z}=this;if($.masterDetailSvc?.refreshModel(_),f&&_.step!=="group")$.colFilter?.refreshModel();let Q=_.changedPath;if(Q?.addRow(z),_.step==="group")this.doGrouping(z,_),Q??(Q=_.changedPath);switch(Q??(Q=$.changedPathFactory?.ensureRowsPath(_,z)),_.step){case"group":case"filter":this.doFilter(Q);case"pivot":if(this.doPivot(Q))Q=void 0,_.changedPath=void 0;case"aggregate":this.doAggregate(Q);case"filter_aggregates":this.doFilterAggregates(Q);case"sort":this.doSort(Q,_.changedRowNodes);case"map":this.doRowsToDisplay()}let J=new Set;this.setRowTopAndRowIndex(J),this.clearRowTopAndRowIndex(Q,J),this.updateRefreshParams(_)}deferRefresh(_){if(this.refreshingModel)return!0;if(this.beans.colModel.changeEventsDispatching)return!0;if(this.isSuppressModelUpdateAfterUpdateTransaction(_)){if(this.started)this.refreshingData=!1;return!0}if(!this.started)return!0;return!1}setPendingRefreshFlags(_){this.pendingNewData||(this.pendingNewData=!!_.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!_.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!_.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!_.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(_){_.newData=this.pendingNewData||!!_.newData,_.keepRenderedRows=!this.noKeepRenderedRows&&!!_.keepRenderedRows,_.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!_.keepUndoRedoStack,_.animate=!this.noAnimate&&!!_.animate}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getOverlayType(){let{beans:_,gos:f}=this;if(this.rootNode?._leafs?.length){if(_.filterManager?.isAnyFilterPresent()&&this.getRowCount()===0)return"noMatchingRows"}else if(this.rowCountReady||(f.get("rowData")?.length??0)==0)return"noRows";return null}getNodesInRangeForSelection(_,f){let $=!1,z=!1,Q=[],J=G$(this.gos);return this.forEachNodeAfterFilterAndSort((q)=>{if(z)return;if($){if(q===f||q===_){if(z=!0,J&&q.group){O5(Q,q);return}}}if(!$){if(q!==f&&q!==_)return;if($=!0,f===_)z=!0}if(!q.group||!J)Q.push(q)}),Q}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(_){return this.rowsToDisplay[_]}getFormulaRow(_){return this.formulaRows[_]}isRowPresent(_){return this.rowsToDisplay.indexOf(_)>=0}getRowIndexAtPixel(_){let f=this.rowsToDisplay,$=f.length;if(this.isEmpty()||$===0)return-1;let z=0,Q=$-1;if(_<=0)return 0;if(f[Q].rowTop<=_)return Q;let q=-1,X=-1;while(!0){let Y=Math.floor((z+Q)/2),Z=f[Y];if(this.isRowInPixel(Z,_))return Y;if(Z.rowTop<_)z=Y+1;else if(Z.rowTop>_)Q=Y-1;if(q===z&&X===Q)return Y;q=z,X=Q}}isRowInPixel(_,f){let $=_.rowTop,z=$+_.rowHeight;return $<=f&&z>f}forEachLeafNode(_){let f=this.rootNode?._leafs;if(f)for(let $=0,z=f.length;$$.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(_,f=!1){this.depthFirstSearchRowNodes(_,f,($)=>$.childrenAfterSort)}forEachPivotNode(_,f,$){let{colModel:z,rowGroupColsSvc:Q}=this.beans;if(!z.isPivotMode())return;if(!Q?.columns.length){_(this.rootNode,0);return}let J=$?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(_,f,(q)=>!q.leafGroup?q[J]:null)}depthFirstSearchRowNodes(_,f=!1,$=(J)=>J.childrenAfterGroup,z=this.rootNode,Q=0){let J=Q;if(!z)return J;let q=z===this.rootNode;if(!q)_(z,J++);if(z.hasChildren()&&!z.footer){let X=q||this.hierarchical?$(z):null;if(X){let Y=this.beans.footerSvc;J=Y?.addTotalRows(J,z,_,f,q,"top")??J;for(let Z of X)J=this.depthFirstSearchRowNodes(_,f,$,Z,J);return Y?.addTotalRows(J,z,_,f,q,"bottom")??J}}return J}doAggregate(_){if(this.rootNode)this.beans.aggStage?.execute(_)}doFilterAggregates(_){let f=this.rootNode,$=this.beans.filterAggStage;if($&&this.hierarchical){$.execute(_);return}f.childrenAfterAggFilter=f.childrenAfterFilter;let z=f.sibling;if(z)z.childrenAfterAggFilter=f.childrenAfterFilter}doSort(_,f){let $=this.beans.sortStage;if($){$.execute(_,f);return}R_(this.rootNode,this.hierarchical,_,(z)=>{z.childrenAfterSort=z.childrenAfterAggFilter.slice(0),V5(z)})}doGrouping(_,f){let z=this.beans.groupStage?.execute(f);if(z===void 0){let Q=_._leafs;_.childrenAfterGroup=Q,_.updateHasChildren();let J=_.sibling;if(J)J.childrenAfterGroup=Q}if(z||f.rowDataUpdated)this.beans.colFilter?.refreshModel();if(!this.rowCountReady&&this.rowNodesCountReady)this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"})}doFilter(_){let f=this.beans.filterStage;if(f){f.execute(_);return}R_(this.rootNode,this.hierarchical,_,($)=>{$.childrenAfterFilter=$.childrenAfterGroup,m6($)})}doPivot(_){return this.beans.pivotStage?.execute(_)??!1}getRowNode(_){let f=this.nodeManager?.getRowNode(_);if(typeof f==="object")return f;return this.beans.groupStage?.getNonLeaf(_)}batchUpdateRowData(_,f){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];let $=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),$)}this.asyncTransactions.push({rowDataTransaction:_,callback:f})}flushAsyncTransactions(){let _=this.asyncTransactionsTimer;if(_)clearTimeout(_),this.executeBatchUpdateRowData()}executeBatchUpdateRowData(){let{nodeManager:_,beans:f,eventSvc:$,asyncTransactions:z}=this;if(!_)return;f.valueCache?.onDataChanged();let Q=[],J=[],q=new R1,X=!this.gos.get("suppressAnimationFrame");for(let{rowDataTransaction:Y,callback:Z}of z??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;let G=_.updateRowData(Y,q,X);if(Q.push(G),Z)J.push(Z.bind(null,G))}if(this.commitTransactions(q,X),J.length>0)setTimeout(()=>{for(let Y=0,Z=J.length;Y0)$.dispatchEvent({type:"asyncTransactionsFlushed",results:Q});this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(_){let f=this.nodeManager;if(!f)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;let $=new R1,z=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;let Q=f.updateRowData(_,$,z);return this.commitTransactions($,z),Q}commitTransactions(_,f){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:f,changedRowNodes:_})}doRowsToDisplay(){let{rootNode:_,beans:f}=this;if(f.formula?.active){let Q=_?.childrenAfterSort??[];this.formulaRows=Q,this.rowsToDisplay=Q.filter((J)=>!J.softFiltered);for(let J of this.rowsToDisplay)J.setUiLevel(0);return}let $=f.flattenStage;if($){this.rowsToDisplay=$.execute();return}let z=this.rootNode.childrenAfterSort??[];for(let Q of z)Q.setUiLevel(0);this.rowsToDisplay=z}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){let _=this.rootNode;if(!_)return;let f=this.resetRowHeightsForAllRowNodes();_.setRowHeight(_.rowHeight,!0);let $=_.sibling;if($?.setRowHeight($.rowHeight,!0),f)this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let _=!1;return this.forEachNode((f)=>{f.setRowHeight(f.rowHeight,!0);let $=f.detailNode;$?.setRowHeight($.rowHeight,!0);let z=f.sibling;z?.setRowHeight(z.rowHeight,!0),_=!0}),_}onGridStylesChanges(_){if(_.rowHeightChanged&&!this.beans.rowAutoHeight?.active)this.resetRowHeights()}onGridReady(){if(!this.started)this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},O5=(_,f)=>{let $=f.childrenAfterGroup;if($)for(let z=0,Q=$.length;zthis.onFirstDataRendered(f)});let Q=_.get("rowData");$=Q!=null&&Q.length>0&&o(_)}if($)this.beans.colDelayRenderSvc?.hideColumns(z)}}autoSizeCols(_){let{eventSvc:f,visibleCols:$,colModel:z}=this.beans;t1(this.beans,!0),this.innerAutoSizeCols(_).then((Q)=>{let J=(G)=>P1(f,Array.from(G),!0,"autosizeColumns");if(!_.scaleUpToFitGridWidth)return t1(this.beans,!1),J(Q);let q=g9(this.beans),X=(G)=>$.leftCols.some((E)=>b0(E,G)),Y=(G)=>$.rightCols.some((E)=>b0(E,G)),Z=_.colKeys.filter((G)=>{return!z.getCol(G)?.getColDef().suppressAutoSize&&!I_(G)&&!X(G)&&!Y(G)});this.sizeColumnsToFit(q,_.source,!0,{defaultMaxWidth:_.defaultMaxWidth,defaultMinWidth:_.defaultMinWidth,columnLimits:_.columnLimits?.map((G)=>({...G,key:G.colId})),colKeys:Z,onlyScaleUp:!0,animate:!1}),t1(this.beans,!1),J(Q)})}innerAutoSizeCols(_){return new Promise((f,$)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(_).then(f,$));let{colKeys:z,skipHeader:Q,skipHeaderGroups:J,stopAtGroup:q,defaultMaxWidth:X,defaultMinWidth:Y,columnLimits:Z=[],source:G="api"}=_,{animationFrameSvc:E,renderStatus:U,colModel:H,autoWidthCalc:W,visibleCols:B}=this.beans;if(E?.flushAllFrames(),this.timesDelayed<5&&U&&(!U.areHeaderCellsRendered()||!U.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{if(this.isAlive())this.innerAutoSizeCols(_).then(f,$)});return}this.timesDelayed=0;let K=new Set,L=-1,F=Object.fromEntries(Z.map(({colId:k,...R})=>[k,R])),D=Q??this.gos.get("skipHeaderOnAutoSize"),M=J??D;while(L!==0){L=0;let k=[];for(let R of z){if(!R||k$(R))continue;let O=H.getCol(R);if(!O||K.has(O)||O.getColDef().suppressAutoSize)continue;let I=W.getPreferredWidthForColumn(O,D);if(I>0){let T=F[O.colId]??{};T.minWidth??(T.minWidth=Y),T.maxWidth??(T.maxWidth=X);let y=WK(O,I,T);O.setActualWidth(y,G),K.add(O),L++}k.push(O)}if(k.length)B.refresh(G)}if(!M)this.autoSizeColumnGroupsByColumns(z,G,q);f(K)})}autoSizeColumn(_,f,$){this.autoSizeCols({colKeys:[_],skipHeader:$,skipHeaderGroups:!0,source:f})}autoSizeColumnGroupsByColumns(_,f,$){let{colModel:z,ctrlsSvc:Q}=this.beans,J=new Set,q=z.getColsForKeys(_);for(let Y of q){let Z=Y.getParent();while(Z&&Z!=$){if(!Z.isPadding())J.add(Z);Z=Z.getParent()}}let X;for(let Y of J){for(let Z of Q.getHeaderRowContainerCtrls())if(X=Z.getHeaderCtrlForColumn(Y),X)break;X?.resizeLeafColumnsToFit(f)}}autoSizeAllColumns(_){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(_));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,..._})}addColumnAutosizeListeners(_,f){let $=this.gos.get("skipHeaderOnAutoSize"),z=()=>{this.autoSizeColumn(f,"uiColumnResized",$)};_.addEventListener("dblclick",z);let Q=new u_(_);return Q.addEventListener("doubleTap",z),()=>{_.removeEventListener("dblclick",z),Q.destroy()}}addColumnGroupResize(_,f,$){let z=this.gos.get("skipHeaderOnAutoSize"),Q=()=>{let J=[],q=f.getDisplayedLeafColumns();for(let X of q)if(!X.getColDef().suppressAutoSize)J.push(X.getColId());if(J.length>0)this.autoSizeCols({colKeys:J,skipHeader:z,stopAtGroup:f,source:"uiColumnResized"});$()};return _.addEventListener("dblclick",Q),()=>_.removeEventListener("dblclick",Q)}sizeColumnsToFitGridBody(_,f){if(!this.isAlive())return;let $=g9(this.beans);if($>0){this.sizeColumnsToFit($,"sizeColumnsToFit",!1,_);return}if(f===void 0)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(_,100)},0);else if(f===100)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(_,500)},100);else if(f===500)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(_,-1)},500);else j(29)}sizeColumnsToFit(_,f="sizeColumnsToFit",$,z){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(_,f,$,z));return}let{beans:Q}=this,J=z?.animate??!0;if(J)t1(Q,!0);let q={};for(let{key:L,...F}of z?.columnLimits??[])q[typeof L==="string"?L:L.getColId()]=F;let X=Q.visibleCols.allCols;if(_<=0||!X.length)return;let Y=m0(X);if(z?.onlyScaleUp&&Y>_)return;if(_===Y){if(X.every((F)=>{if(F.colDef.suppressSizeToFit)return!0;let D=q?.[F.getId()],M=D?.minWidth??z?.defaultMinWidth,k=D?.maxWidth??z?.defaultMaxWidth,R=F.getActualWidth();return(M==null||R>=M)&&(k==null||R<=k)}))return}let G=[],E=[];for(let L of X){let F=z?.colKeys?.some((D)=>b0(L,D))??!0;if(L.getColDef().suppressSizeToFit||!F)E.push(L);else G.push(L)}let U=G.slice(0),H=!1,W=(L)=>{Q_(G,L),E.push(L)},B={};for(let L of G){if(z?.onlyScaleUp)B[L.getColId()]=L.getActualWidth();L.resetActualWidth(f);let F=q?.[L.getId()],D=F?.minWidth??z?.defaultMinWidth??-1/0,M=F?.maxWidth??z?.defaultMaxWidth??1/0,k=L.getActualWidth(),R=Math.max(Math.min(k,M),D);if(R!=k)L.setActualWidth(R,f,!0)}while(!H){H=!0;let L=_-m0(E);if(L<=0)for(let F of G){let D=q?.[F.getId()]?.minWidth??z?.defaultMinWidth??F.minWidth;F.setActualWidth(D,f,!0)}else{let F=L/m0(G),D=L;for(let M=G.length-1;M>=0;M--){let k=G[M],R=k.getColId(),O=B[R],I=q?.[R],T=I?.minWidth??z?.defaultMinWidth??O,y=I?.maxWidth??z?.defaultMaxWidth,i=Math.max(T??-1/0,k.getMinWidth()),x=Math.min(y??1/0,k.getMaxWidth()),a=Math.round(k.getActualWidth()*F);if(ax)a=x,W(k),H=!1;else if(M===0)a=D;k.setActualWidth(a,f,!0),D-=a}}}for(let L of U)L.fireColumnWidthChangedEvent(f);let K=Q.visibleCols;if(K.setLeftValues(f),K.updateBodyWidths(),$)return;if(P1(this.eventSvc,U,!0,f),J)t1(Q,!1)}applyAutosizeStrategy(){let{gos:_,colDelayRenderSvc:f}=this.beans,$=_.get("autoSizeStrategy");if($?.type!=="fitGridWidth"&&$?.type!=="fitProvidedWidth")return;setTimeout(()=>{if(!this.isAlive())return;let z=$.type;if(z==="fitGridWidth"){let{columnLimits:Q,defaultMinWidth:J,defaultMaxWidth:q}=$,X=Q?.map(({colId:Y,minWidth:Z,maxWidth:G})=>({key:Y,minWidth:Z,maxWidth:G}));this.sizeColumnsToFitGridBody({defaultMinWidth:J,defaultMaxWidth:q,columnLimits:X})}else if(z==="fitProvidedWidth")this.sizeColumnsToFit($.width,"sizeColumnsToFit");f?.revealColumns(z)})}onFirstDataRendered({colIds:_,...f}){setTimeout(()=>{if(!this.isAlive())return;let $="autosizeColumns";if(_)this.autoSizeCols({...f,source:$,colKeys:_});else this.autoSizeAllColumns({...f,source:$});this.beans.colDelayRenderSvc?.revealColumns(f.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(let _ of this.resizeOperationQueue)_();this.resizeOperationQueue=[]}pushResizeOperation(_){this.resizeOperationQueue.push(_)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function WK(_,f,$={}){let z=$.minWidth??_.getMinWidth();if(fQ)f=Q;return f}function g9({ctrlsSvc:_,scrollVisibleSvc:f}){let $=_.getGridBodyCtrl(),Q=$.isVerticalScrollShowing()?f.getScrollbarWidth():0;return df($.eGridBody)-Q}var h9="ag-animate-autosize";function t1({ctrlsSvc:_,gos:f},$){if(!f.get("animateColumnResizing")||f.get("enableRtl")||!_.isAlive())return;let z=_.getGridBodyCtrl().eGridBody.classList;if($)z.add(h9);else z.remove(h9)}var T5={moduleName:"ColumnAutoSize",version:c,beans:[HK],apiFunctions:{sizeColumnsToFit:EK,autoSizeColumns:v5,autoSizeAllColumns:UK},dependsOn:[cX],css:[GK]};var BK=class extends A{constructor(){super(...arguments);this.beanName="gridSerializer"}wireBeans(_){this.visibleCols=_.visibleCols,this.colModel=_.colModel,this.rowModel=_.rowModel,this.pinnedRowModel=_.pinnedRowModel}serialize(_,f={}){let{allColumns:$,columnKeys:z,skipRowGroups:Q,exportRowNumbers:J}=f,q=this.getColumnsToExport({allColumns:$,skipRowGroups:Q,columnKeys:z,exportRowNumbers:J});return[this.prepareSession(q),this.prependContent(f),this.exportColumnGroups(f,q),this.exportHeaders(f,q),this.processPinnedTopRows(f,q),this.processRows(f,q),this.processPinnedBottomRows(f,q),this.appendContent(f)].reduce((X,Y)=>Y(X),_).parse()}processRow(_,f,$,z){let Q=f.shouldRowBeSkipped||(()=>!1),q=f.rowPositions!=null||!!f.onlySelected,X=this.gos.get("groupHideOpenParents")&&!q,Y=this.colModel.isPivotMode()?z.leafGroup:!z.group,Z=!!z.footer,G=z.allChildrenCount===1&&z.childrenAfterGroup?.length===1&&M7(this.gos,z);if(!Y&&!Z&&(f.skipRowGroups||G||X)||f.onlySelected&&!z.isSelected()||f.skipPinnedTop&&z.rowPinned==="top"||f.skipPinnedBottom&&z.rowPinned==="bottom"||z.stub)return;if(z.level===-1&&!Y&&!Z)return;if(Q(C(this.gos,{node:z})))return;let H=_.onNewBodyRow(z);if($.forEach((W,B)=>{H.onColumn(W,B,z)}),f.getCustomContentBelowRow){let W=f.getCustomContentBelowRow(C(this.gos,{node:z}));if(W)_.addCustomContent(W)}}appendContent(_){return(f)=>{let $=_.appendContent;if($)f.addCustomContent($);return f}}prependContent(_){return(f)=>{let $=_.prependContent;if($)f.addCustomContent($);return f}}prepareSession(_){return(f)=>{return f.prepare(_),f}}exportColumnGroups(_,f){return($)=>{if(!_.skipColumnGroupHeaders){let z=new tX,{colGroupSvc:Q}=this.beans,J=Q?Q.createColumnGroups({columns:f,idCreator:z,pinned:null,isStandaloneStructure:!0}):f;this.recursivelyAddHeaderGroups(J,$,_.processGroupHeaderCallback)}return $}}exportHeaders(_,f){return($)=>{if(!_.skipColumnHeaders){let z=$.onNewHeaderRow();f.forEach((Q,J)=>{z.onColumn(Q,J,void 0)})}return $}}processPinnedTopRows(_,f){return($)=>{let z=this.processRow.bind(this,$,_,f);if(_.rowPositions)_.rowPositions.filter((Q)=>Q.rowPinned==="top").sort((Q,J)=>Q.rowIndex-J.rowIndex).map((Q)=>this.pinnedRowModel?.getPinnedTopRow(Q.rowIndex)).forEach(z);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("top",z);return $}}processRows(_,f){return($)=>{let z=this.rowModel,Q=o(this.gos,z),J=Kf(this.gos,z),q=!Q&&_.onlySelected,X=this.processRow.bind(this,$,_,f),{exportedRows:Y="filteredAndSorted"}=_;if(_.rowPositions)_.rowPositions.filter((Z)=>Z.rowPinned==null).sort((Z,G)=>Z.rowIndex-G.rowIndex).map((Z)=>z.getRow(Z.rowIndex)).forEach(X);else if(this.colModel.isPivotMode())if(Q)z.forEachPivotNode(X,!0,Y==="filteredAndSorted");else if(J)z.forEachNodeAfterFilterAndSort(X,!0);else z.forEachNode(X);else if(_.onlySelectedAllPages||q){let Z=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(Z),Z.forEach(X)}else if(Y==="all")z.forEachNode(X);else if(Q||J)z.forEachNodeAfterFilterAndSort(X,!0);else z.forEachNode(X);return $}}replicateSortedOrder(_){let{sortSvc:f,rowNodeSorter:$}=this.beans;if(!f||!$)return;let z=f.getSortOptions(),Q=(J,q)=>{if(J.rowIndex!=null&&q.rowIndex!=null)return J.rowIndex-q.rowIndex;if(J.level===q.level){if(J.parent?.id===q.parent?.id)return $.compareRowNodes(z,J,q)||(J.rowIndex??-1)-(q.rowIndex??-1);return Q(J.parent,q.parent)}if(J.level>q.level)return Q(J.parent,q);return Q(J,q.parent)};_.sort(Q)}processPinnedBottomRows(_,f){return($)=>{let z=this.processRow.bind(this,$,_,f);if(_.rowPositions)_.rowPositions.filter((Q)=>Q.rowPinned==="bottom").sort((Q,J)=>Q.rowIndex-J.rowIndex).map((Q)=>this.pinnedRowModel?.getPinnedBottomRow(Q.rowIndex)).forEach(z);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("bottom",z);return $}}getColumnsToExport(_){let{allColumns:f=!1,skipRowGroups:$=!1,exportRowNumbers:z=!1,columnKeys:Q}=_,{colModel:J,gos:q,visibleCols:X}=this,Y=J.isPivotMode(),Z=(U)=>{if(x0(U))return!1;return!I_(U)||z};if(Q?.length)return J.getColsForKeys(Q).filter(Z);let G=q.get("treeData"),E=[];if(f&&!Y)E=J.getCols();else E=X.allCols;return E=E.filter((U)=>Z(U)&&($&&!G?!of(U):!0)),E}recursivelyAddHeaderGroups(_,f,$){let z=[];for(let Q of _){let J=Q;if(!J.getChildren)continue;for(let q of J.getChildren()??[])z.push(q)}if(_.length>0&&G_(_[0]))this.doAddHeaderHeader(f,_,$);if(z&&z.length>0)this.recursivelyAddHeaderGroups(z,f,$)}doAddHeaderHeader(_,f,$){let z=_.onNewHeaderGroupingRow(),Q=0;for(let J of f){let q=J,X;if($)X=$(C(this.gos,{columnGroup:q}));else X=this.beans.colNames.getDisplayNameForColumnGroup(q,"header");let Z=(q.isExpandable()?q.getLeafColumns():[]).reduce((G,E,U,H)=>{let W=b(G);if(E.getColumnGroupShow()!=="open"){if(W&&W[1]==null)W[1]=U-1}else if(!W||W[1]!=null)W=[U],G.push(W);if(U===H.length-1&&W&&W[1]==null)W[1]=U;return G},[]);z.onColumn(q,X||"",Q++,q.getLeafColumns().length-1,Z)}}},lJ={moduleName:"SharedExport",version:c,beans:[BK]},sJ=class extends A{getFileName(_){let f=this.getDefaultFileExtension();if(!_?.length)_=this.getDefaultFileName();return _.includes(".")?_:`${_}.${f}`}getData(_){return this.beans.gridSerializer.serialize(this.createSerializingSession(_),_)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}};function GQ(_,f){let $=document.defaultView||window;if(!$){j(52);return}let z=document.createElement("a"),Q=$.URL.createObjectURL(f);z.setAttribute("href",Q),z.setAttribute("download",_),z.style.display="none",document.body.appendChild(z),z.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:$})),z.remove(),$.setTimeout(()=>{$.URL.revokeObjectURL(Q)},0)}var aJ=class{constructor(_){this.valueFrom="data";let{colModel:f,rowGroupColsSvc:$,colNames:z,valueSvc:Q,gos:J,processCellCallback:q,processHeaderCallback:X,processGroupHeaderCallback:Y,processRowGroupCallback:Z,valueFrom:G}=_;if(this.colModel=f,this.rowGroupColsSvc=$,this.colNames=z,this.valueSvc=Q,this.gos=J,this.processCellCallback=q,this.processHeaderCallback=X,this.processGroupHeaderCallback=Y,this.processRowGroupCallback=Z,G)this.valueFrom=G}prepare(_){}extractHeaderValue(_){return this.getHeaderName(this.processHeaderCallback,_)??""}extractRowCellValue(_){let{column:f,node:$,currentColumnIndex:z,accumulatedRowIndex:Q,type:J,useRawFormula:q}=_,X=z===0&&Cq(this.gos,$,this.colModel.isPivotMode());if(this.processRowGroupCallback&&(this.gos.get("treeData")||$.group)&&(f.isRowGroupDisplayed($.rowGroupColumn?.getColId()??"")||X))return{value:this.processRowGroupCallback(C(this.gos,{column:f,node:$}))??""};if(this.processCellCallback)return{value:this.processCellCallback(C(this.gos,{accumulatedRowIndex:Q,column:f,node:$,value:this.valueSvc.getValueForDisplay({column:f,node:$,from:this.valueFrom}).value,type:J,parseValue:(W)=>this.valueSvc.parseValue(f,$,W,this.valueSvc.getValue(f,$,this.valueFrom)),formatValue:(W)=>this.valueSvc.formatValue(f,$,W)??W}))??""};let Y=this.gos.get("treeData"),Z=this.valueSvc,G=$.level===-1&&$.footer,E=f.colDef.showRowGroup===!0&&($.group||Y);if(!G&&(X||E)){let W="",B=$;while(B&&B.level!==-1){let{value:K,valueFormatted:L}=Z.getValueForDisplay({column:X?void 0:f,node:B,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});W=` -> ${L??K??""}${W}`,B=B.parent}return{value:W,valueFormatted:W}}let{value:U,valueFormatted:H}=Z.getValueForDisplay({column:f,node:$,includeValueFormatted:!0,exporting:!0,useRawFormula:q,from:this.valueFrom});return{value:U??"",valueFormatted:H}}getHeaderName(_,f){if(_)return _(C(this.gos,{column:f}));return this.colNames.getDisplayNameForColumn(f,"csv",!0)}},u9=`\r -`,KK=class extends aJ{constructor(_){super(_);this.config=_,this.isFirstLine=!0,this.result="";let{suppressQuotes:f,columnSeparator:$}=_;this.suppressQuotes=f,this.columnSeparator=$}addCustomContent(_){if(!_)return;if(typeof _==="string"){if(!/^\s*\n/.test(_))this.beginNewLine();_=_.replace(/\r?\n/g,u9),this.result+=_}else _.forEach((f)=>{this.beginNewLine(),f.forEach(($,z)=>{if(z!==0)this.result+=this.columnSeparator;if(this.result+=this.putInQuotes($.data.value||""),$.mergeAcross)this.appendEmptyCells($.mergeAcross)})})}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(_,f,$,z){if($!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(f),this.appendEmptyCells(z)}appendEmptyCells(_){for(let f=1;f<=_;f++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(_,f){if(f!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(this.extractHeaderValue(_))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(_,f,$){if(f!=0)this.result+=this.columnSeparator;let z=this.extractRowCellValue({column:_,node:$,currentColumnIndex:f,accumulatedRowIndex:f,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(z.valueFormatted??z.value)}putInQuotes(_){if(this.suppressQuotes)return _;if(_===null||_===void 0)return'""';let f;if(typeof _==="string")f=_;else if(typeof _.toString==="function")f=_.toString();else j(53),f="";return'"'+f.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){if(!this.isFirstLine)this.result+=u9;this.isFirstLine=!1}},LK=class extends sJ{constructor(){super(...arguments);this.beanName="csvCreator"}getMergedParams(_){let f=this.gos.get("defaultCsvExportParams");return Object.assign({},f,_)}export(_){if(this.isExportSuppressed()){j(51);return}let f=()=>{let z=this.getMergedParams(_),Q=this.getData(z),J=new Blob(["\uFEFF",Q],{type:"text/plain"}),q=z.fileName,X=typeof q==="function"?q(C(this.gos,{})):q;GQ(this.getFileName(X),J)},{overlays:$}=this.beans;if($)$.showExportOverlay(f);else f()}exportDataAsCsv(_){this.export(_)}getDataAsCsv(_,f=!1){let $=f?Object.assign({},_):this.getMergedParams(_);return this.getData($)}getDefaultFileExtension(){return"csv"}createSerializingSession(_){let{colModel:f,colNames:$,rowGroupColsSvc:z,valueSvc:Q,gos:J}=this.beans,{processCellCallback:q,processHeaderCallback:X,processGroupHeaderCallback:Y,processRowGroupCallback:Z,suppressQuotes:G,columnSeparator:E,valueFrom:U}=_;return new KK({colModel:f,colNames:$,valueSvc:Q,gos:J,processCellCallback:q||void 0,processHeaderCallback:X||void 0,processGroupHeaderCallback:Y||void 0,processRowGroupCallback:Z||void 0,suppressQuotes:G||!1,columnSeparator:E||",",rowGroupColsSvc:z,valueFrom:U})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function FK(_,f){return _.csvCreator?.getDataAsCsv(f)}function DK(_,f){_.csvCreator?.exportDataAsCsv(f)}var I5={moduleName:"CsvExport",version:c,beans:[LK],apiFunctions:{getDataAsCsv:FK,exportDataAsCsv:DK},dependsOn:[lJ]},y5=class extends j_{constructor(_,f){super();if(this.ctrl=_,f)this.beans=f}postConstruct(){this.refreshTooltip()}setBrowserTooltip(_,f){let z=this.ctrl.getGui();if(!z)return;if(_!=null&&(_!=""||f))z.setAttribute("title",_);else z.removeAttribute("title")}updateTooltipText(){let{getTooltipValue:_}=this.ctrl;if(_)this.tooltip=_()}createTooltipFeatureIfNeeded(){if(this.tooltipManager==null){let _=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);if(_)this.tooltipManager=this.createBean(_,this.beans.context)}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(_){this.tooltip=_,this.refreshTooltip()}refreshTooltip(_){if(this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips)this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context);else this.setBrowserTooltip(_?"":null,_),this.createTooltipFeatureIfNeeded()}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},MK=1000,kK=1000,i9=100,m9,Jz=!1,SK=class extends j_{constructor(_,f){super();this.tooltipCtrl=_,this.getTooltipValue=f,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(_){this.popupSvc=_.popupSvc}postConstruct(){if(this.gos.get("tooltipInteraction"))this.interactionEnabled=!0;this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");let _=this.tooltipCtrl.getGui();if(this.tooltipTrigger===0)this.addManagedListeners(_,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)});if(this.tooltipTrigger===1)this.addManagedListeners(_,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)});if(this.addManagedListeners(_,{mousemove:this.onMouseMove.bind(this)}),!this.interactionEnabled)this.addManagedListeners(_,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(_){let f=this.gos.get(_);return Math.max(200,f)}getTooltipDelay(_){return this.tooltipCtrl[`getTooltip${_}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${_}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){let _=this.gos.get("tooltipTrigger");if(!_||_==="hover")return 0;return 1}onMouseEnter(_){if(this.interactionEnabled&&this.interactiveTooltipTimeoutId)this.unlockService(),this.startHideTimeout();if(pf())return;if(Jz)this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(_)},i9);else this.prepareToShowTooltip(_)}onMouseMove(_){if(this.lastMouseEvent)this.lastMouseEvent=_;if(this.tooltipMouseTrack&&this.state===2&&this.tooltipComp)this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){if(this.interactionEnabled)this.lockService();else this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(_){let f=_.relatedTarget,$=this.tooltipCtrl.getGui(),z=this.tooltipComp?.getGui();if(this.isInteractingWithTooltip||$.contains(f)||this.interactionEnabled&&z?.contains(f))return;this.setToDoNothing()}onKeyDown(){if(this.isInteractingWithTooltip)this.isInteractingWithTooltip=!1;this.setToDoNothing()}prepareToShowTooltip(_){if(this.state!=0||Jz)return;let f=0;if(_)f=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show");this.lastMouseEvent=_||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),f),this.state=1}isLastTooltipHiddenRecently(){return Date.now()-m9this.hideTooltip(!0),...f.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;let z=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp($,z)}hideTooltip(_){if(!_&&this.isInteractingWithTooltip)return;if(this.tooltipComp)this.destroyTooltipComp(),m9=Date.now();if(this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),_)this.isInteractingWithTooltip=!1;this.setToDoNothing(!0)}newTooltipComponentCallback(_,f){if(this.state!==2||this.tooltipInstanceCount!==_){this.destroyBean(f);return}let z=f.getGui();if(this.tooltipComp=f,!z.classList.contains("ag-tooltip"))z.classList.add("ag-tooltip-custom");if(this.tooltipTrigger===0)z.classList.add("ag-tooltip-animate");if(this.interactionEnabled)z.classList.add("ag-tooltip-interactive");let Q=this.getLocaleTextFunc(),J=this.popupSvc?.addPopup({eChild:z,ariaLabel:Q("ariaLabelTooltip","Tooltip")});if(J)this.tooltipPopupDestroyFunc=J.hideFunc;if(this.positionTooltip(),this.tooltipTrigger===1){let q=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:q}),this.setEventHandlers(q)}if(this.interactionEnabled){if([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(z,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(q_(this.beans),{keydown:(q)=>{if(!z.contains(q?.target))this.onKeyDown()}}),this.tooltipTrigger===1)[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(z,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)})}this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:z,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){if(this.isTooltipFocused())return;this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){let _=this.tooltipComp?.getGui(),f=d(this.beans);return!!_&&_.contains(f)}onTooltipFocusOut(_){let f=this.tooltipCtrl.getGui();if(this.isTooltipFocused())return;if(this.isInteractingWithTooltip=!1,f.contains(_.relatedTarget))this.startHideTimeout();else this.hideTooltip()}positionTooltip(){let _={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};if(this.lastMouseEvent)this.popupSvc?.positionPopupUnderMouseEvent({..._,mouseEvent:this.lastMouseEvent});else this.popupSvc?.positionPopupByComponent({..._,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");let _=this.tooltipPopupDestroyFunc,f=this.tooltipComp,$=this.tooltipTrigger===0?kK:0;window.setTimeout(()=>{_(),this.destroyBean(f)},$),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(let _ of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])if(_)_();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Jz=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},i9)}unlockService(){Jz=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){if(!this.showTooltipTimeoutId)return;window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0}clearHideTimeout(){if(!this.hideTooltipTimeoutId)return;window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0}clearInteractiveTimeout(){if(!this.interactiveTooltipTimeoutId)return;window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}},AK=class extends y5{constructor(_,f,$){super(_,$);this.highlightTracker=f,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",({currentValue:_})=>{this.setTooltipMode(_)}),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(_){if(this.tooltipMode!==1)return;if(_.highlighted)this.attemptToShowTooltip();else this.attemptToHideTooltip()}setTooltipMode(_="focus"){this.tooltipMode=_==="focus"?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},RK=class extends MJ{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(_){let{value:f}=_,$=this.getGui();$.textContent=L$(f);let z=_.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();$.classList.add(`ag-${z}-tooltip`)}},jK=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",qz=0,VK=200,OK=class extends j_{constructor(){super(...arguments);this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){let _=this.gos.get("popupParent");if(_)return _;return this.getDefaultPopupParent()}positionPopupUnderMouseEvent(_){let{ePopup:f,nudgeX:$,nudgeY:z,skipObserver:Q}=_;this.positionPopup({ePopup:f,nudgeX:$,nudgeY:z,keepWithinBounds:!0,skipObserver:Q,updatePosition:()=>this.calculatePointerAlign(_.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(_.additionalParams,_.type,_.ePopup,null,_.mouseEvent)})}calculatePointerAlign(_){let f=this.getParentRect();return{x:_.clientX-f.left,y:_.clientY-f.top}}positionPopupByComponent(_){let{ePopup:f,nudgeX:$,nudgeY:z,keepWithinBounds:Q,eventSource:J,alignSide:q="left",position:X="over",type:Y}=_,Z=J.getBoundingClientRect(),G=this.getParentRect();this.setAlignedTo(J,f);let E=()=>{let U=Z.left-G.left;if(q==="right")U-=f.offsetWidth-Z.width;let H;if(X==="over")H=Z.top-G.top,this.setAlignedStyles(f,"over");else if(this.setAlignedStyles(f,"under"),this.shouldRenderUnderOrAbove(f,Z,G,_.nudgeY||0)==="under")H=Z.top-G.top+Z.height;else H=Z.top-f.offsetHeight-(z||0)*2-G.top;return{x:U,y:H}};this.positionPopup({ePopup:f,nudgeX:$,nudgeY:z,keepWithinBounds:Q,updatePosition:E,postProcessCallback:()=>this.callPostProcessPopup(_.additionalParams,Y,f,J,null)})}positionPopupForMenu(_){let{eventSource:f,ePopup:$,event:z}=_,Q=f.getBoundingClientRect(),J=this.getParentRect();this.setAlignedTo(f,$);let q=!1,X=()=>{let Y=this.keepXYWithinBounds($,Q.top-J.top,0),Z=$.clientWidth>0?$.clientWidth:200;if(!q)$.style.minWidth=`${Z}px`,q=!0;let E=J.right-J.left-Z,U;if(this.gos.get("enableRtl")){if(U=W(),U<0)U=H(),this.setAlignedStyles($,"left");if(U>E)U=0,this.setAlignedStyles($,"right")}else{if(U=H(),U>E)U=W(),this.setAlignedStyles($,"right");if(U<0)U=0,this.setAlignedStyles($,"left")}return{x:U,y:Y};function H(){return Q.right-J.left-2}function W(){return Q.left-J.left-Z}};this.positionPopup({ePopup:$,keepWithinBounds:!0,updatePosition:X,postProcessCallback:()=>this.callPostProcessPopup(_.additionalParams,"subMenu",$,f,z instanceof MouseEvent?z:void 0)})}shouldRenderUnderOrAbove(_,f,$,z){let Q=$.bottom-f.bottom,J=f.top-$.top,q=_.offsetHeight+z;if(Q>q)return"under";if(J>q||J>Q)return"above";return"under"}setAlignedStyles(_,f){let $=this.getPopupIndex(_);if($===-1)return;let z=this.popupList[$],{alignedToElement:Q}=z;if(!Q)return;let J=["right","left","over","above","under"];for(let q of J)Q.classList.remove(`ag-has-popup-positioned-${q}`),_.classList.remove(`ag-popup-positioned-${q}`);if(!f)return;Q.classList.add(`ag-has-popup-positioned-${f}`),_.classList.add(`ag-popup-positioned-${f}`)}setAlignedTo(_,f){let $=this.getPopupIndex(f);if($!==-1){let z=this.popupList[$];z.alignedToElement=_}}positionPopup(_){let{ePopup:f,keepWithinBounds:$,nudgeX:z,nudgeY:Q,skipObserver:J,updatePosition:q}=_,X={width:0,height:0},Y=(Z=!1)=>{let{x:G,y:E}=q();if(Z&&f.clientWidth===X.width&&f.clientHeight===X.height)return;if(X.width=f.clientWidth,X.height=f.clientHeight,z)G+=z;if(Q)E+=Q;if($)G=this.keepXYWithinBounds(f,G,1),E=this.keepXYWithinBounds(f,E,0);if(f.style.left=`${G}px`,f.style.top=`${E}px`,_.postProcessCallback)_.postProcessCallback()};if(Y(),!J){let Z=S0(this.beans,f,()=>Y(!0));setTimeout(()=>Z(),VK)}}getParentRect(){let _=q_(this.beans),f=this.getPopupParent();if(f===_.body)f=_.documentElement;else if(getComputedStyle(f).position==="static")f=f.offsetParent;return Gq(f)}keepXYWithinBounds(_,f,$){let z=$===0,Q=z?"clientHeight":"clientWidth",J=z?"top":"left",q=z?"height":"width",X=z?"scrollTop":"scrollLeft",Y=q_(this.beans),Z=Y.documentElement,G=this.getPopupParent(),E=_.getBoundingClientRect(),U=G.getBoundingClientRect(),H=Y.documentElement.getBoundingClientRect(),W=G===Y.body,B=Math.ceil(E[q]),L=W?(z?Yq:Zq)(Z)+Z[X]:G[Q];if(W)L-=Math.abs(H[J]-U[J]);let F=L-B;return Math.min(Math.max(f,0),Math.max(F,0))}addPopup(_){let{eChild:f,ariaLabel:$,ariaOwns:z,alwaysOnTop:Q,positionCallback:J,anchorToElement:q}=_,X=this.getPopupIndex(f);if(X!==-1)return{hideFunc:this.popupList[X].hideFunc};this.initialisePopupPosition(f);let Y=this.createPopupWrapper(f,!!Q,$,z),Z=this.addEventListenersToPopup({..._,wrapperEl:Y});if(J)J();return this.addPopupToPopupList(f,Y,Z,q),{hideFunc:Z}}initialisePopupPosition(_){let $=this.getPopupParent().getBoundingClientRect();if(!v(_.style.top))_.style.top=`${$.top*-1}px`;if(!v(_.style.left))_.style.left=`${$.left*-1}px`}createPopupWrapper(_,f,$,z){let Q=this.getPopupParent(),{environment:J,gos:q}=this.beans,X=B_({tag:"div"});if(J.applyThemeClasses(X),X.classList.add("ag-popup"),_.classList.add(q.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),!_.hasAttribute("role"))Z_(_,"dialog");if($)W_(_,$);else if(z)_.id||(_.id=`popup-component-${qz}`),h2(z,_.id);if(X.appendChild(_),Q.appendChild(X),f)this.setAlwaysOnTop(_,!0);else this.bringPopupToFront(_);return X}addEventListenersToPopup(_){let f=this.beans,$=q_(f),{wrapperEl:z,eChild:Q,closedCallback:J,afterGuiAttached:q,closeOnEsc:X,modal:Y,ariaOwns:Z}=_,G=!1,E=(B)=>{if(!z.contains(d(f)))return;if(B.key===S.ESCAPE&&!this.isStopPropagation(B))W({keyboardEvent:B})},U=(B)=>W({mouseEvent:B}),H=(B)=>W({touchEvent:B}),W=(B={})=>{let{mouseEvent:K,touchEvent:L,keyboardEvent:F,forceHide:D}=B;if(!D&&(this.isEventFromCurrentPopup({mouseEvent:K,touchEvent:L},Q)||G))return;if(G=!0,z.remove(),$.removeEventListener("keydown",E),$.removeEventListener("mousedown",U),$.removeEventListener("touchstart",H),$.removeEventListener("contextmenu",U),this.eventSvc.removeListener("dragStarted",U),J)J(K||L||F);this.removePopupFromPopupList(Q,Z)};if(q)q({hidePopup:W});return window.setTimeout(()=>{if(X)$.addEventListener("keydown",E);if(Y)$.addEventListener("mousedown",U),this.eventSvc.addListener("dragStarted",U),$.addEventListener("touchstart",H),$.addEventListener("contextmenu",U)},0),W}addPopupToPopupList(_,f,$,z){if(this.popupList.push({element:_,wrapper:f,hideFunc:$,instanceId:qz,isAnchored:!!z}),z)this.setPopupPositionRelatedToElement(_,z);qz=qz+1}getPopupIndex(_){return this.popupList.findIndex((f)=>f.element===_)}setPopupPositionRelatedToElement(_,f){let $=this.getPopupIndex(_);if($===-1)return;let z=this.popupList[$];if(z.stopAnchoringPromise)z.stopAnchoringPromise.then((J)=>J&&J());if(z.stopAnchoringPromise=void 0,z.isAnchored=!1,!f)return;let Q=this.keepPopupPositionedRelativeTo({element:f,ePopup:_,hidePopup:z.hideFunc});return z.stopAnchoringPromise=Q,z.isAnchored=!0,Q}removePopupFromPopupList(_,f){if(this.setAlignedStyles(_,null),this.setPopupPositionRelatedToElement(_,null),f)h2(f,null);this.popupList=this.popupList.filter(($)=>$.element!==_)}keepPopupPositionedRelativeTo(_){let f=this.getPopupParent(),$=f.getBoundingClientRect(),{element:z,ePopup:Q}=_,J=z.getBoundingClientRect(),q=(E)=>Number.parseInt(E.substring(0,E.length-1),10),X=(E,U)=>{let H=$[E]-J[E],W=q(Q.style[E]);return{initialDiff:H,lastDiff:H,initial:W,last:W,direction:U}},Y=X("top",0),Z=X("left",1),G=this.beans.frameworkOverrides;return new g((E)=>{G.wrapIncoming(()=>{n7(()=>{let U=f.getBoundingClientRect(),H=z.getBoundingClientRect();if(H.top==0&&H.left==0&&H.height==0&&H.width==0){_.hidePopup();return}let B=(K,L)=>{let F=q(Q.style[L]);if(K.last!==F)K.initial=F,K.last=F;let D=U[L]-H[L];if(D!=K.lastDiff){let M=this.keepXYWithinBounds(Q,K.initial+K.initialDiff-D,K.direction);Q.style[L]=`${M}px`,K.last=M}K.lastDiff=D};B(Y,"top"),B(Z,"left")},200).then((U)=>{E(()=>{if(U!=null)window.clearInterval(U)})})},"popupPositioning")})}isEventFromCurrentPopup(_,f){let{mouseEvent:$,touchEvent:z}=_,Q=$?$:z;if(!Q)return!1;let J=this.getPopupIndex(f);if(J===-1)return!1;for(let q=J;q_.element)}hasAnchoredPopup(){return this.popupList.some((_)=>_.isAnchored)}isStopPropagation(_){return z0(_)}},$1={moduleName:"Popup",version:c,beans:[PK]};function bz(_){return _.get("tooltipShowMode")==="whenTruncated"}function EQ(_,f){return bz(_)?Q$(f):void 0}var vK=(_,f)=>{let $=_;if(typeof $.getTranslatedMessage==="function")return $.getTranslatedMessage(f);return _.message},c6=(_,f,$)=>{let{editModelSvc:z}=_,Q=z?.getCellValidationModel()?.getCellValidation(f)?.errorMessages,J=z?.getRowValidationModel().getRowValidation(f)?.errorMessages,q=Q||J;return q?.length?q.join($("tooltipValidationErrorSeparator",". ")):void 0},TK=(_,f)=>{if(!bz(_.gos))return;if(f.isCellRenderer()){let z=f.column.getColDef();if(!(!!z.showRowGroup||z.cellRenderer==="agGroupCellRenderer"))return;return Q$(()=>{let J=f.eGui;return J.querySelector(".ag-group-value")||J.querySelector(".ag-cell-value")||J})}return Q$(()=>{let z=f.eGui;return z.children.length===0?z:z.querySelector(".ag-cell-value")})},IK=(_,f,$)=>{let{editSvc:z}=_,{column:Q}=f,J=TK(_,f),q=()=>{if(z?.isEditing(f))return!1;if(!J)return!0;if(!Q.isTooltipEnabled())return!1;return J()};return{shouldDisplayDefault:q,shouldDisplayColumnTooltip:q,shouldDisplayCustomTooltip:$??q}},yK=({beans:_,ctrl:f,value:$,displayFunctions:z,translate:Q})=>{let{editSvc:J,formula:q,gos:X}=_,{column:Y,rowNode:Z}=f;if(q?.active&&Y.isAllowFormula()){let K=q.getFormulaError(Y,Z);if(K)return{value:vK(K,Q),location:"cellFormula",shouldDisplay:()=>!!q?.getFormulaError(Y,Z)}}if(!J?.isEditing(f)){let K=c6(_,f,Q);if(K)return{value:K,location:"cellEditor",shouldDisplay:()=>!J?.isEditing(f)&&!!c6(_,f,Q)}}let{shouldDisplayCustomTooltip:E,shouldDisplayColumnTooltip:U}=z;if($!=null)return{value:$,location:"cell",shouldDisplay:E};let H=Y.getColDef(),W=Z.data;if(H.tooltipField&&v(W))return{value:e1(W,H.tooltipField,Y.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:U};let B=H.tooltipValueGetter;if(B)return{value:B(C(X,{location:"cell",colDef:Y.getColDef(),column:Y,rowIndex:f.cellPosition.rowIndex,node:Z,data:Z.data,value:f.value,valueFormatted:f.valueFormatted})),location:"cell",shouldDisplay:U};return null},bK=class extends A{constructor(){super(...arguments);this.beanName="tooltipSvc"}setupHeaderTooltip(_,f,$,z){if(_)f.destroyBean(_);let Q=this.gos,J=bz(Q),{column:q,eGui:X}=f,Y=q.getColDef();if(!z&&J&&!Y.headerComponent)z=Q$(()=>X.querySelector(".ag-header-cell-text"));let Z="header",G="header",E=this.beans.colNames.getDisplayNameForColumn(q,G,!0),U=$??E,H={getGui:()=>X,getLocation:()=>Z,getTooltipValue:()=>$??Y?.headerTooltipValueGetter?.(C(Q,{location:Z,colDef:Y,column:q,value:U,valueFormatted:E}))??Y?.headerTooltip,shouldDisplayTooltip:z,getAdditionalParams:()=>({column:q,colDef:q.getColDef()})},W=this.createTooltipFeature(H);if(W)W=f.createBean(W),f.setRefreshFunction("tooltip",()=>W.refreshTooltip());return W}setupHeaderGroupTooltip(_,f,$,z){if(_)f.destroyBean(_);let Q=this.gos,J=bz(Q),{column:q,eGui:X}=f,Y=q.getColGroupDef();if(!z&&J&&!Y?.headerGroupComponent)z=Q$(()=>X.querySelector(".ag-header-group-text"));let Z="headerGroup",G="header",E=this.beans.colNames.getDisplayNameForColumnGroup(q,G),U=$??E,H={getGui:()=>X,getLocation:()=>Z,getTooltipValue:()=>$??Y?.headerTooltipValueGetter?.(C(Q,{location:Z,colDef:Y,column:q,value:U,valueFormatted:E}))??Y?.headerTooltip,shouldDisplayTooltip:z,getAdditionalParams:()=>{let B={column:q};if(Y)B.colDef=Y;return B}},W=this.createTooltipFeature(H);return W?f.createBean(W):W}enableCellTooltipFeature(_,f,$){let{beans:z}=this,{column:Q,rowNode:J}=_,q=IK(z,_,$),X=this.getLocaleTextFunc(),Y=null,Z=()=>{return Y=yK({beans:z,ctrl:_,value:f,displayFunctions:q,translate:X}),Y},E={getGui:()=>_.eGui,getLocation:()=>Y?.location??"cell",getTooltipValue:()=>Z()?.value,shouldDisplayTooltip:()=>{let U=Y??Z();if(!U)return!1;return U.shouldDisplay?U.shouldDisplay():!0},getAdditionalParams:()=>({column:Q,colDef:Q.getColDef(),rowIndex:_.cellPosition.rowIndex,node:J,data:J.data,valueFormatted:_.valueFormatted})};return this.createTooltipFeature(E,z)}setupFullWidthRowTooltip(_,f,$,z){let Q={getGui:()=>f.getFullWidthElement(),getTooltipValue:()=>$,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:z},J=this.beans,q=J.context;if(_)f.destroyBean(_,q);let X=this.createTooltipFeature(Q,J);if(!X)return;return f.createBean(X,q)}setupCellEditorTooltip(_,f){let{beans:$}=this,{context:z}=$,Q=f.getValidationElement?.(!0)||!f.isPopup?.()&&_.eGui;if(!Q)return;let J={getGui:()=>Q,getTooltipValue:()=>c6($,_,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{let{editModelSvc:X}=$,Y=X?.getRowValidationModel()?.getRowValidationMap(),Z=X?.getCellValidationModel()?.getCellValidationMap(),G=!!Y&&Y.size>0,E=!!Z&&Z.size>0;return G||E}},q=this.createTooltipFeature(J,$);if(!q)return;return _.createBean(q,z)}initCol(_){let{colDef:f}=_;_.tooltipEnabled=v(f.tooltipField)||v(f.tooltipValueGetter)||v(f.tooltipComponent)}createTooltipFeature(_,f){return this.beans.registry.createDynamicBean("tooltipFeature",!1,_,f)}},CK=class extends SK{createTooltipComp(_,f){D8(this.beans.userCompFactory,_)?.newAgStackInstance().then(f)}setEventHandlers(_){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:_})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},wK={moduleName:"Tooltip",version:c,beans:[bK],dynamicBeans:{tooltipFeature:y5,highlightTooltipFeature:AK,tooltipStateManager:CK},userComponents:{agTooltipComponent:RK},dependsOn:[$1],css:[jK]};var xK=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}";var NK=class extends aX{constructor(_,f="ag-text-field",$="text"){super(_,f,$)}postConstruct(){if(super.postConstruct(),this.config.allowedCharPattern)this.preventDisallowedCharacters()}setValue(_,f){let $=this.eInput;if($.value!==_)$.value=v(_)?_:"";return super.setValue(_,f)}setStartValue(_){this.setValue(_,!0)}setCustomValidity(_){let f=this.eInput,$=_.length>0;if(f.setCustomValidity(_),$)f.reportValidity();e9(f,$)}preventDisallowedCharacters(){let _=new RegExp(`[${this.config.allowedCharPattern}]`),f=($)=>{if(!VX($))return;if($.key&&!_.test($.key))$.preventDefault()};this.addManagedListeners(this.eInput,{keydown:f,paste:($)=>{if($.clipboardData?.getData("text")?.split("").some((Q)=>!_.test(Q)))$.preventDefault()}})}},oJ={selector:"AG-INPUT-TEXT-FIELD",component:NK};var gK=class extends v8{constructor(_){super();this.cellEditorInput=_,this.eEditor=V}initialiseEditor(_){let{cellEditorInput:f}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[f.getTemplate()]},f.getAgComponents());let{eEditor:$}=this,{cellStartedEdit:z,eventKey:Q,suppressPreventDefault:J}=_;$.getInputElement().setAttribute("title",""),f.init($,_);let q,X=!0;if(z){if(this.focusAfterAttached=!0,Q===S.BACKSPACE||Q===S.DELETE)q="";else if(Q&&Q.length===1)if(J)X=!1;else q=Q;else if(q=f.getStartValue(),Q!==S.F2)this.highlightAllOnFocus=!0}else this.focusAfterAttached=!1,q=f.getStartValue();if(X&&q!=null)$.setStartValue(q);this.addGuiEventListener("keydown",(Y)=>{let{key:Z}=Y;if(Z===S.PAGE_UP||Z===S.PAGE_DOWN)Y.preventDefault()})}afterGuiAttached(){let _=this.getLocaleTextFunc(),f=this.eEditor;if(f.setInputAriaLabel(_("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;if(!ef())f.getFocusableElement().focus();let $=f.getInputElement();if(this.highlightAllOnFocus)$.select();else this.cellEditorInput.setCaret?.()}focusIn(){let{eEditor:_}=this,f=_.getFocusableElement(),$=_.getInputElement();f.focus(),$.select()}getValue(){return this.cellEditorInput.getValue()}agSetEditValue(_){this.params.value=_;let f=this.cellEditorInput.getStartValue();this.eEditor.setStartValue(f??null)}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}};var hK={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},uK=class{constructor(_){this.getLocaleTextFunc=_}getTemplate(){return hK}getAgComponents(){return[oJ]}init(_,f){this.eEditor=_,this.params=f;let $=f.maxLength;if($!=null)_.setMaxLength($)}getValidationErrors(){let{params:_}=this,{maxLength:f,getValidationErrors:$}=_,z=this.getValue(),Q=this.getLocaleTextFunc(),J=[];if(f!=null&&typeof z==="string"&&z.length>f)J.push(Q("maxLengthValidation",`Must be ${f} characters or fewer.`,[String(f)]));if(!J.length)J=null;if($)return $({value:z,cellEditorParams:_,internalErrors:J});return J}getValue(){let{eEditor:_,params:f}=this,$=_.getValue();if(!v($)&&!v(f.value))return f.value;return f.parseValue($)}getStartValue(){let _=this.params;return _.useFormatter||_.column.getColDef().refData?_.formatValue(_.value):_.value}setCaret(){if(ef())this.eEditor.getInputElement().focus({preventScroll:!0});let _=this.eEditor,f=_.getValue(),$=v(f)&&f.length||0;if($)_.getInputElement().setSelectionRange($,$)}},c9=class extends gK{constructor(){super(new uK(()=>this.getLocaleTextFunc()))}};function iK(_,f){return _.editModelSvc?.getEditRowDataValue(f,{checkSiblings:!0})}function mK(_){let f=_.editModelSvc?.getEditMap(),$=[];return f?.forEach((z,Q)=>{let{rowIndex:J,rowPinned:q}=Q;z.forEach((X,Y)=>{let{editorValue:Z,pendingValue:G,sourceValue:E,state:U}=X,H=L0(X),W=Z??G;if(W===v_)W=void 0;let B={newValue:W,oldValue:E,state:U,column:Y,colId:Y.getColId(),colKey:Y.getColId(),rowIndex:J,rowPinned:q},K=U==="editing";if(K||!K&&H)$.push(B)})}),$}function cK(_,f=!1){let{editSvc:$}=_;if($?.isBatchEditing()){if(f){for(let z of _.editModelSvc?.getEditPositions()??[])if(z.state==="editing")$.revertSingleCellEdit(z)}else Xf(_,{persist:!0});qf(_,void 0,{cancel:f})}else $?.stopEditing(void 0,{cancel:f,source:"edit",forceStop:!f,forceCancel:f})}function pK(_,f){let $=l(_,f);return!!_.editSvc?.isEditing($)}function nK(_,f){let{key:$,colKey:z,rowIndex:Q,rowPinned:J}=f,{editSvc:q,colModel:X}=_,Y=X.getCol(z);if(!Y){j(12,{colKey:z});return}let G=D_(_,{rowIndex:Q,rowPinned:J||null,column:Y});if(!G){j(290,{rowIndex:Q,rowPinned:J});return}if(!q?.isCellEditable({rowNode:G,column:Y},"api"))return;if(J==null)l3(_,Q);r3(_,z),q?.startEditing({rowNode:G,column:Y},{event:$?new KeyboardEvent("keydown",{key:$}):void 0,source:"api",editable:!0})}function dK(_){return _.editSvc?.validateEdit()||null}var tK={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},rK=class extends MJ{constructor(_){super(tK);this.params=_}postConstruct(){tf(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){let _=this.getGui(),f=this.params,$=(z)=>{if(!b6(this.gos,z,f.node,f.column,!0))f.onKeyDown(z)};this.addManagedElementListeners(_,{keydown:$})}};function lK(_,{column:f},$,z,Q="ui"){if($ instanceof KeyboardEvent&&($.key===S.TAB||$.key===S.ENTER||$.key===S.F2||$.key===S.BACKSPACE&&z))return!0;if($?.shiftKey&&_.rangeSvc?.getCellRanges().length!=0)return!1;let q=f?.getColDef(),X=sK(_.gos,q),Y=$?.type;if(Y==="click"&&$?.detail===1&&X===1)return!0;if(Y==="dblclick"&&$?.detail===2&&X===2)return!0;if(Q==="api")return!!z;return!1}function sK(_,f){if(_.get("suppressClickEdit")===!0)return 0;if(_.get("singleClickEdit")===!0)return 1;if(f?.singleClickEdit)return 1;return 2}function F6(_,f){return _.editModelSvc?.hasEdits(f,{withOpenEditor:!0})??!1}function p6(_,f){let{column:$,rowNode:z}=f,Q=$.getColDef();if(!z)return F6(_,f);let J=Q.editable;if(z.group&&Q.groupRowEditable!=null){if(_.rowGroupingEditValueSvc?.isGroupCellEditable(z,$))return!0;return F6(_,f)}if($.isColumnFunc(z,J))return!0;return F6(_,f)}function aK(_,f,$="ui"){let z=p6(_,f);if(z||$==="ui")return z;let{rowNode:Q,column:J}=f;for(let q of _.colModel.getCols())if(q!==J&&p6(_,{rowNode:Q,column:q}))return!0;return!1}var Cz=(_,f=!1)=>{if(_!==void 0)return L0(_)||f&&_.state==="editing"};function b5(_,f,$=!1){return Cz(_.editModelSvc?.getEdit(f),$)}var C5=(_,f,$)=>{if(!_)return;for(let z=0,Q=_.length;z{let Y={rowNode:z,column:X};return b5($,Y,!0)||w5($,Y)||x5($,Y)});this.applyStyle(J,q);return}this.applyStyle(J)}applyStyle(_=!1,f=!1){let $=!!this.editSvc?.isBatchEditing(),z=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:Q})=>{Q.toggleCss("ag-row-editing",z&&f),Q.toggleCss("ag-row-batch-edit",z&&f&&$),Q.toggleCss("ag-row-inline-editing",f),Q.toggleCss("ag-row-not-inline-editing",!f),Q.toggleCss("ag-row-editing-invalid",z&&f&&_)})}},_L=({rowModel:_,pinnedRowModel:f,editModelSvc:$},z)=>{let Q=new Set;_.forEachNode((J)=>z.has(J)&&Q.add(J)),f?.forEachPinnedRow("top",(J)=>z.has(J)&&Q.add(J)),f?.forEachPinnedRow("bottom",(J)=>z.has(J)&&Q.add(J));for(let J of z)if(!Q.has(J))$.removeEdits({rowNode:J});return Q},fL=({editModelSvc:_},f,$)=>{for(let z of f)_?.getEditRow(z)?.forEach((Q,J)=>!$.has(J)&&_.removeEdits({rowNode:z,column:J}))},$L=(_)=>()=>{let f=new Set(_.colModel.getCols()),$=_.editModelSvc.getEditMap(!0),z=new Set($.keys());fL(_,_L(_,z),f)},zL=new Set(["undo","redo","paste","bulk","rangeSvc"]),QL=new Set(["ui","api"]),N5={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},JL=new Set(Object.keys(N5)),qL=new Set(["paste","rangeSvc","cellClear","redo","undo"]),D6={cancel:!0,source:"api"},XL={cancel:!1,source:"api"},wf={checkSiblings:!0},zf={force:!0,suppressFlash:!0},YL={force:!0},ZL=class extends A{constructor(){super(...arguments);this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){let{beans:_}=this;this.model=_.editModelSvc,this.valueSvc=_.valueSvc,this.rangeSvc=_.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:z})=>{this.stopEditing(void 0,D6),this.createStrategy(z)});let f=$L(_),$=()=>{let z=this.model.getCellValidationModel().getCellValidationMap().size>0,Q=this.model.getRowValidationModel().getRowValidationMap().size>0;if(z||Q)this.stopEditing(void 0,D6);else if(this.isEditing())if(this.batch)qf(_,this.model.getEditPositions());else this.stopEditing(void 0,XL);return!1};this.addManagedEventListeners({columnPinned:f,columnVisible:f,columnRowGroupChanged:f,rowExpansionStateChanged:f,pinnedRowsChanged:f,displayedRowsChanged:f,sortChanged:$,filterChanged:$,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){if(this.batch)return;this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,D6)}stopBatchEditing(_){if(!this.batch)return;if(_)this.stopEditing(void 0,_);if(this.batchStartDispatched)this.dispatchBatchStopped(new Map,!1);this.batch=!1,this.batchStartDispatched=!1}ensureBatchStarted(){if(!this.batch||this.batchStartDispatched)return;this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map)}createStrategy(_){let{beans:f,gos:$,strategy:z}=this,Q=p9($,_);if(z){if(z.beanName===Q)return z;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(f.registry.createDynamicBean(Q,!0))}destroyStrategy(){if(!this.strategy)return;this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy)}shouldStartEditing(_,f,$,z="ui"){let Q=lK(this.beans,_,f,$,z);if(Q)this.strategy??(this.strategy=this.createStrategy());return Q}shouldStopEditing(_,f,$="ui"){return this.strategy?.shouldStop(_,f,$)??null}shouldCancelEditing(_,f,$="ui"){return this.strategy?.shouldCancel(_,f,$)??null}validateEdit(){return AB(this.beans)}isEditing(_,f){return this.model.hasEdits(_??void 0,f??wf)}isRowEditing(_,f){return!!_&&this.model.hasRowEdits(_,f)}enableRangeSelectionWhileEditing(){if(this.beans.rangeSvc&&this.gos.get("cellSelection"))this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(_,f){let{startedEdit:$=!0,event:z=null,source:Q="ui",ignoreEventKey:J=!1,silent:q}=f;if(this.strategy??(this.strategy=this.createStrategy()),!(f.editable??this.isCellEditable(_,"api")))return;let Y=l(this.beans,_);if(Y&&!Y.comp){f.editable=void 0,Y.onCompAttachedFuncs.push(()=>this.startEditing(_,f));return}let Z=this.shouldStartEditing(_,z,$,Q);if(Z===!1&&Q!=="api"){if(this.isEditing(_))this.stopEditing();return}if(!this.batch&&this.shouldStopEditing(_,void 0,Q)&&!f.continueEditing)this.stopEditing(void 0,{source:Q});if(Z)this.ensureBatchStarted();this.strategy.start({position:_,event:z,source:Q,ignoreEventKey:J,startedEdit:$,silent:q})}stopEditing(_,f){let $=this.prepareStopContext(_,f);if(!$)return!1;this.stopping=!0;let z=!1,{edits:Q}=$;try{let J=this.processStopRequest($);return z||(z=J.res),Q=J.edits,this.finishStopEditing({...$,edits:Q,params:f,position:_,res:z}),z}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(_,f){let{event:$=null,cancel:z=!1,source:Q="ui",forceCancel:J=!1,forceStop:q=!1,commit:X=!1}=f||{};if(JL.has(Q)&&this.batch){if(_?.rowNode&&_?.column)this.bulkRefreshCell(_);return null}let Y=this.committing?N5[Q]:Q;if(!(this.committing||this.isEditing(_)||this.batch&&this.model.hasEdits(_,wf))||!this.strategy||this.stopping)return null;let G=l(this.beans,_);if(G)G.onEditorAttachedFuncs=[];let E=!z&&(!!this.shouldStopEditing(_,$,Y)||(this.committing||Q==="paste")&&!this.batch)||q,U=z&&!!this.shouldCancelEditing(_,$,Y)||J;return{cancel:z,cellCtrl:G,edits:this.model.getEditMap(!0),event:$??null,forceCancel:J,forceStop:q,commit:X,position:_,source:Q,treatAsSource:Y,willCancel:U,willStop:E}}processStopRequest(_){let{event:f,position:$,willCancel:z,willStop:Q}=_;if(Q||z)return this.handleStopOrCancel(_);if(this.shouldHandleMidBatchKey(f,$))return{res:!1,edits:this.handleMidBatchKey(f,$,_)};if(Xf(this.beans,{persist:!0}),this.batch)this.strategy?.cleanupEditors($);return{res:!1,edits:this.model.getEditMap()}}handleStopOrCancel(_){let{beans:f,model:$}=this,{cancel:z,commit:Q,edits:J,event:q,source:X,willCancel:Y,willStop:Z}=_,G=!this.batch||!Y;Xf(f,{persist:G,isCancelling:Y||z,isStopping:Z});let E=$.getEditMap(),H=!Y&&(!this.batch||Q)?this.processEdits(E,X):[];if(z)this.strategy?.stopCancelled(_.forceCancel);else this.strategy?.stopCommitted(q,Q);this.clearValidationIfNoOpenEditors();for(let W of H)$.clearEditValue(W);this.bulkRefreshMap(J);for(let W of $.getEditPositions(E)){let B=l(f,W),K=L0(W);B?.refreshCell({force:!0,suppressFlash:!K})}return{res:Z,edits:E}}shouldHandleMidBatchKey(_,f){return _ instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(f)&&this.isEditing(f,{withOpenEditor:!0})}handleMidBatchKey(_,f,$){let{beans:z,model:Q}=this,{cellCtrl:J,edits:q}=$,{key:X}=_,Y=X===S.ENTER,Z=X===S.ESCAPE,G=X===S.TAB;if(Y||G||Z){if(Y||G)Xf(z,{persist:!0});else if(Z&&J){let{rowNode:E,column:U}=J;if(this.batch&&E&&U){let H={rowNode:E,column:U};qf(z,[H],{silent:!0}),this.model.stop(H,!0,!0),l(z,H)?.refreshCell(zf)}else this.revertSingleCellEdit(J)}if(this.batch)this.strategy?.cleanupEditors();else qf(z,Q.getEditPositions(),{event:_,cancel:Z});return _.preventDefault(),this.bulkRefreshMap(q,{suppressFlash:!0}),Q.getEditMap()}return q}finishStopEditing({cellCtrl:_,edits:f,params:$,position:z,res:Q,commit:J,forceCancel:q,willCancel:X,willStop:Y}){let Z=this.beans;if(Q&&z){if(!this.batch||J)this.model.removeEdits(z)}this.navigateAfterEdit($,_?.cellPosition),l1(Z),this.clearValidationIfNoOpenEditors();let{rowRenderer:G,formula:E}=Z;if(X)G.refreshRows({rowNodes:Array.from(f.keys())});if(this.batch){if(E)E.refreshFormulas(!0);else G.refreshRows({suppressFlash:!0,force:!0});let U=Y&&J;if(U||X&&q)this.dispatchBatchStopped(f,U)}}dispatchBatchStopped(_,f){let $;if(f){if($=BB(_),$.size>0)this.ensureBatchStarted()}if(this.batchStartDispatched)this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",$??new Map)}clearValidationIfNoOpenEditors(){if(!this.model.hasEdits(void 0,{withOpenEditor:!0}))this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()}navigateAfterEdit(_,f){if(!_||!f)return;let{event:$,suppressNavigateAfterEdit:z}=_;if(!($ instanceof KeyboardEvent)||z)return;let{key:J,shiftKey:q}=$,X=this.gos.get("enterNavigatesVerticallyAfterEdit");if(J!==S.ENTER||!X)return;let Y=q?S.UP:S.DOWN;this.beans.navigation?.navigateToNextCell(null,Y,f,!1)}processEdits(_,f){let $=Array.from(_.keys()),z=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,Q=[],{changeDetectionSvc:J}=this.beans;J?.beginDeferred();try{for(let q of $){let X=_.get(q);for(let Y of X.keys()){let Z=X.get(Y),G={rowNode:q,column:Y};if(L0(Z)&&!z){let E=l(this.beans,G);if(!this.setNodeDataValue(q,Y,Z.pendingValue,E,f))Q.push(G)}}}}finally{J?.endDeferred()}return Q}setNodeDataValue(_,f,$,z,Q="edit"){let J=QL.has(Q)?"edit":Q;if(z)z.suppressRefreshCell=!0;this.committing=!0;try{return _.setDataValue(f,$,J)}finally{if(this.committing=!1,z)z.suppressRefreshCell=!1}}syncEditAfterCommit(_,f){let $=this.model.getEdit(_);if($&&$.state!=="editing")if(f)this.beans.editModelSvc?.setEdit(_,{sourceValue:$.pendingValue});else this.model.clearEditValue(_)}setEditMap(_,f){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(_,f),this.bulkRefreshMap(_);let $=zf;if(f?.forceRefreshOfEditCellsOnly)$={...GL(_),...zf};this.beans.rowRenderer.refreshCells($)}dispatchEditValuesChanged({rowNode:_,column:f},$={}){if(!_||!f||!$)return;let{pendingValue:z,sourceValue:Q}=$,{rowIndex:J,rowPinned:q,data:X}=_;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:_,rowIndex:J,rowPinned:q,column:f,source:"api",data:X,newValue:z,oldValue:Q,value:z,colDef:f.getColDef()})}bulkRefreshCell(_,f){if(o(this.gos,this.beans.rowModel))this.refCell(_,this.model.getEdit(_),f)}bulkRefreshMap(_,f){if(o(this.gos,this.beans.rowModel))_.forEach(($,z)=>{for(let Q of $.keys())this.refCell({rowNode:z,column:Q},$.get(Q),f)})}refCell({rowNode:_,column:f},$,z={}){let{beans:Q,gos:J}=this,q=new Set([_]),X=new Set,Y=_.pinnedSibling;if(Y)q.add(Y);let Z=_.sibling;if(Z)X.add(Z);let G=_.parent;while(G){if(G.sibling?.footer&&J.get("groupTotalRow"))X.add(G.sibling);else if(!G.parent&&G.sibling&&J.get("grandTotalRow"))X.add(G.sibling);else X.add(G);G=G.parent}for(let E of q)this.dispatchEditValuesChanged({rowNode:E,column:f},$);for(let E of q)l(Q,{rowNode:E,column:f})?.refreshCell(z);for(let E of X){let U=l(Q,{rowNode:E,column:f});if(U){if(U.refreshCell(z),!z.force&&this.batch)U.editStyleFeature?.applyCellStyles?.()}}}stopAllEditing(_=!1,f="ui"){if(this.isEditing())this.stopEditing(void 0,{cancel:_,source:f})}isCellEditable(_,f="ui"){let{gos:$,beans:z}=this,Q=_.rowNode;if(Q.group&&_.column.getColDef().groupRowEditable==null){if($.get("treeData")){if(!Q.data&&!$.get("enableGroupEdit"))return!1}else if(!$.get("enableGroupEdit"))return!1}let J=p9($)==="fullRow"?aK(z,_,f):p6(z,_);if(J)this.strategy??(this.strategy=this.createStrategy());return J}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(_,f,$=!0){if(this.hasValidationErrors(_)){let z=l(this.beans,_);if(this.cellEditingInvalidCommitBlocks()){if(f?.preventDefault?.(),$){if(z&&!z.hasBrowserFocus())z.focusCell();z?.comp?.getCellEditor()?.focusIn?.()}return"block-stop"}if(z)this.revertSingleCellEdit(z);return"revert-continue"}return"continue"}revertSingleCellEdit(_,f=!1){let $=l(this.beans,_);if(!$?.comp?.getCellEditor())return;if(qf(this.beans,[_],{silent:!0}),this.model.clearEditValue(_),lf(this.beans,_,{silent:!0}),Hf(this.beans),$?.refreshCell(zf),!f)return;$?.focusCell(),$?.comp?.getCellEditor()?.focusIn?.()}hasValidationErrors(_){Hf(this.beans);let f=l(this.beans,_);if(f)f.refreshCell(zf),f.rowCtrl.rowEditStyleFeature?.applyRowStyles();let $=!1;if(_?.rowNode){if($||($=this.model.getRowValidationModel().hasRowValidation({rowNode:_.rowNode})),_.column)$||($=this.model.getCellValidationModel().hasCellValidation({rowNode:_.rowNode,column:_.column}))}else $||($=this.model.getCellValidationModel().getCellValidationMap().size>0),$||($=this.model.getRowValidationModel().getRowValidationMap().size>0);return $}moveToNextCell(_,f,$,z="ui"){let Q,J=this.isEditing(),q=J&&this.checkNavWithValidation(void 0,$)==="block-stop";if(_ instanceof _$&&J)Q=this.strategy?.moveToNextEditingCell(_,f,$,z,q);if(Q===null)return Q;if(Q=Q||!!this.beans.focusSvc.focusedHeader,Q===!1&&!q)this.stopEditing();return Q}getPendingEditValue(_,f,$){if($==="data")return;if($==="batch"&&!this.batch)return;let z=this.model.getEdit({rowNode:_,column:f},wf);if(!z)return;if(this.stopping&&!this.batch&&!z.editorState?.cellStartedEditing)return;if($==="edit"){let J=z.editorValue;if(J!=null&&J!==v_)return J}let Q=z.pendingValue;if(Q!==v_)return Q;return}getCellDataValue(_){let f=this.model.getEdit(_,wf);if(f){let $=f.pendingValue;if($!==v_)return $;let z=f.sourceValue;if(z!=null)return z}return this.valueSvc.getValue(_.column,_.rowNode,"data")}addStopEditingWhenGridLosesFocus(_){UB(this,this.beans,_)}createPopupEditorWrapper(_){return new rK(_)}batchResetToSourceValue(_){if(!this.batch)return!1;let f=this.model.getEdit(_);if(!f)return!1;let{pendingValue:$,sourceValue:z,state:Q}=f;if($===z)return!1;if(Q==="editing")return!1;return this.dispatchEditValuesChanged(_,{...f,pendingValue:z}),this.beans.editModelSvc?.removeEdits(_),l(this.beans,_)?.refreshCell(zf),!0}setDataValue(_,f,$){try{let z=this.batch,Q=this.isEditing(z?void 0:_);if((!Q||this.committing)&&!z&&!qL.has($))return;if(!Q&&!z&&$==="paste")return;if($==="batch"&&!z)return;if($==="edit"){if(Q&&this.applyEditorValue(_,f))return!0;if(!z)return}if(this.strategy??(this.strategy=this.createStrategy()),$==="batch"||$==="edit")return this.applyDirectValue(_,f,$);let J=this.beans,q;if(z)q="ui";else if(this.committing)q=$??"api";else q="api";if(!$||zL.has($))return this.applyDirectValue(_,f,$);let X=this.applyExistingEdit(_,f,$,q);if(X!==void 0)return X;return H1(J,_,f,$,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(_,{source:q,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}applyExistingEdit(_,f,$,z){let Q=this.model.getEdit(_);if(!Q)return;if(Q.pendingValue===f)return!1;if(Q.sourceValue!==f)return H1(this.beans,_,f,$,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(_,{source:z,suppressNavigateAfterEdit:!0}),!0;return this.beans.editModelSvc?.removeEdits(_),this.ensureBatchStarted(),this.dispatchEditValuesChanged(_,{...Q,pendingValue:f}),!0}applyEditorValue(_,f){let $=this.beans,z=l($,_),Q=z?.comp?.getCellEditor();if(!z||!Q)return!1;if(H1($,_,f,"edit",void 0,{persist:!0}),z.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in Q)return Q.agSetEditValue(f),!0;if(Q.refresh&&z.editCompDetails)return Q.refresh({...z.editCompDetails.params,value:f}),!0;if(z.hasBrowserFocus())z.onEditorAttachedFuncs.push(()=>{let q=l(this.beans,_);q?.focusCell(!0),q?.comp?.getCellEditor()?.focusIn?.()});return qf($,[_],{silent:!0,cancel:!0}),lf($,_,{silent:!0}),Hf($),l($,_)?.refreshCell(zf),!0}applyDirectValue(_,f,$){let z=this.beans;if(this.batch){if($==="batch"&&l(z,_)?.comp?.getCellEditor()){let{editModelSvc:q,valueSvc:X}=z,{rowNode:Y,column:Z}=_;if(q?.getEdit(_)?.sourceValue===void 0)q?.setEdit(_,{sourceValue:X.getValue(Z,Y,"data")});q?.setEdit(_,{pendingValue:f})}else if(H1(z,_,f,$,void 0,{persist:!0}),$!=="batch")this.cleanupEditors();return l1(z),this.ensureBatchStarted(),this.bulkRefreshCell(_),!0}H1(z,_,f,$,void 0,{persist:!0});let Q=l(z,_),J=this.setNodeDataValue(_.rowNode,_.column,f,Q,$);return this.syncEditAfterCommit(_,J),l1(z),l(z,_)?.refreshCell(J?YL:zf),J}handleColDefChanged(_){LB(this.beans,_)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(_,f){let{model:$}=this;if(!this.batch)return;if(!$.hasRowEdits(_.rowNode,wf))return;let{rowNode:Q}=_,{compDetails:J,valueToDisplay:q}=f;if(J){let{params:X}=J;return X.data=$.getEditRowDataValue(Q,wf),{compDetails:J}}return{valueToDisplay:q}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(_,f,$,z){this.strategy?.dispatchCellEvent(_,f,$,z)}dispatchBatchEvent(_,f){this.eventSvc.dispatchEvent(this.createBatchEditEvent(_,f))}createBatchEditEvent(_,f){return C(this.gos,{type:_,..._==="batchEditingStopped"?{changes:this.toEventChangeList(f)}:{}})}toEventChangeList(_){return this.model.getEditPositions(_).map((f)=>({rowIndex:f.rowNode.rowIndex,rowPinned:f.rowNode.rowPinned,columnId:f.column.getColId(),newValue:f.pendingValue,oldValue:f.sourceValue}))}applyBulkEdit({rowNode:_,column:f},$){if(!$||$.length===0)return;let{beans:z,rangeSvc:Q,valueSvc:J}=this,{formula:q}=z;Xf(z,{persist:!0});let X=this.model.getEditMap(!0),Y=X.get(_)?.get(f)?.pendingValue,Z=!1;if(!this.batch)this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),Z=!0;let G=q?.isFormula(Y)??!1;$.forEach((U)=>{let H=U.columns.some((W)=>W?.isAllowFormula());if(Q?.forEachRowInRange(U,(W)=>{let B=D_(z,W);if(B===void 0)return;let K=X.get(B)??new Map,L=Y;for(let F of U.columns){if(!F)continue;let D=!!G&&F.isAllowFormula();if(this.isCellEditable({rowNode:B,column:F},"api")){let M=J.getValue(F,B,"data",!0),k=J.parseValue(F,B??null,L,M);if(Number.isNaN(k))k=null;K.set(F,{editorValue:void 0,pendingValue:k,sourceValue:M,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}if(D)L=q?.updateFormulaByOffset({value:L,columnDelta:1})}if(K.size>0)X.set(B,K);if(G&&H)Y=q?.updateFormulaByOffset({value:Y,rowDelta:1})}),this.setEditMap(X),this.batch){this.cleanupEditors(),l1(z),this.ensureBatchStarted();return}this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{if(this.committing=!1,Z)this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(X)})}});let E=l(z,{rowNode:_,column:f});if(E)E.focusCell(!0)}createCellStyleFeature(_){return new oK(_,this.beans)}createRowStyleFeature(_){return new eK(_,this.beans)}setEditingCells(_,f){let{beans:$}=this,{colModel:z,valueSvc:Q}=$,J=new Map;for(let{colId:q,column:X,colKey:Y,rowIndex:Z,rowPinned:G,newValue:E,state:U}of _){let H=q?z.getCol(q):Y?z.getCol(Y):X;if(!H)continue;let W=D_($,{rowIndex:Z,rowPinned:G});if(!W)continue;let B=Q.getValue(H,W,"data",!0);if(!f?.forceRefreshOfEditCellsOnly&&!L0({pendingValue:E,sourceValue:B})&&U!=="editing")continue;let K=J.get(W);if(!K)K=new Map,J.set(W,K);if(E===void 0)E=v_;K.set(H,{editorValue:void 0,pendingValue:E,sourceValue:B,state:U??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(J,f)}onCellFocused(_){let f=l(this.beans,_);if(!f||!this.isEditing(f,wf))return;let $=this.model.getEdit(f);if(!$||!L0($))return;let Q=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(Q,"pendingChange")}allowedFocusTargetOnValidation(_){return l(this.beans,_)}};function GL(_){return{rowNodes:_?Array.from(_.keys()):void 0,columns:_?[...new Set(Array.from(_.values()).flatMap((f)=>Array.from(f.keys())))]:void 0}}function p9(_,f){return f??_.get("editType")??"singleCell"}var g5=class extends A{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(_){this.model.clearEditValue(_)}onCellFocusChanged(_){let f,$=_.previousParams,{editSvc:z,beans:Q}=this,J=_.type==="cellFocused"?_.sourceEvent:null;if($)f=l(Q,$);let{gos:q,editModelSvc:X}=Q,Y=_.type==="cellFocusCleared";if(z.isEditing(void 0,{withOpenEditor:!0})){let{column:Z,rowIndex:G,rowPinned:E}=_,U={column:Z,rowNode:D_(Q,{rowIndex:G,rowPinned:E})},H=q.get("invalidEditValueMode")==="block";if(H)return;let W=!H,B=!!X?.getCellValidationModel().hasCellValidation(U),K=W&&B;if(!($||Y?z.stopEditing(void 0,{cancel:K,source:Y&&W?"api":void 0,event:J}):!0))if(z.isBatchEditing())z.cleanupEditors();else z.stopEditing(void 0,{source:"api"})}f?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(_){let f=this.editSvc.isBatchEditing()&&!_;for(let $ of this.model.getEditPositions())W$(this.beans,$,{cancel:!0},l(this.beans,$)),this.model.stop($,f,!0);return!0}stopCommitted(_,f){let $=this.model.getEditPositions(),z={all:[],pass:[],fail:[]};for(let q of $)if(z.all.push(q),(this.model.getCellValidationModel().getCellValidation(q)?.errorMessages?.length??0)>0)z.fail.push(q);else z.pass.push(q);let Q=this.processValidationResults(z),J=this.editSvc.isBatchEditing()&&!f;for(let q of Q.destroy)W$(this.beans,q,{event:_},l(this.beans,q)),this.model.stop(q,J,!1);for(let q of Q.keep){let X=l(this.beans,q);if(!this.editSvc.cellEditingInvalidCommitBlocks()&&X)this.editSvc.revertSingleCellEdit(X)}return!0}cleanupEditors({rowNode:_}={},f){Xf(this.beans,{persist:!1});let $=this.model.getEditPositions(),z=[];if(_){for(let Q of $)if(Q.rowNode!==_)z.push(Q)}else for(let Q of $)z.push(Q);qf(this.beans,z),l1(this.beans,f)}setFocusOutOnEditor(_){_.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(_){let f=_.comp,$=f?.getCellEditor();if($?.focusIn)$.focusIn();else{let z=this.beans.gos.get("editType")==="fullRow";_.focusCell(z),_.onEditorAttachedFuncs.push(()=>f?.getCellEditor()?.focusIn?.())}}setupEditors(_){let{event:f,ignoreEventKey:$=!1,startedEdit:z,position:Q,cells:J=this.model.getEditPositions()}=_,q=f instanceof KeyboardEvent&&!$&&f.key||void 0;WB(this.beans,J,Q,q,f,z)}dispatchCellEvent(_,f,$,z){let Q=l(this.beans,_);if(Q)this.eventSvc.dispatchEvent({...Q.createEvent(f??null,$),...z})}dispatchRowEvent(_,f,$){if($)return;let z=Iz(this.beans,_);if(z)this.eventSvc.dispatchEvent(z.createRowEvent(f))}shouldStop(_,f,$="ui"){let z=this.editSvc.isBatchEditing();if(z&&$==="api")return!0;if(z&&($==="ui"||$==="edit"))return!1;if($==="api")return!0;if(f instanceof KeyboardEvent&&!z)return f.key===S.ENTER;return null}shouldCancel(_,f,$="ui"){let z=this.editSvc.isBatchEditing();if(f instanceof KeyboardEvent&&!z){if(f.key===S.ESCAPE)return!0}if(z&&$==="api")return!0;if($==="api")return!0;return!1}setEditMap(_,f){if(!f?.update)this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});let $=[];if(_.forEach((z,Q)=>{z.forEach((J,q)=>{if(J.state==="editing")$.push({...J,rowNode:Q,column:q})})}),f?.update)_=new Map([...this.model.getEditMap(),..._]);if(this.model?.setEditMap(_),$.length>0){let z=$.at(-1),Q=z.pendingValue===v_?void 0:z.pendingValue;this.start({position:z,event:new KeyboardEvent("keydown",{key:Q}),source:"api"});let J=l(this.beans,z);if(J)this.setFocusInOnEditor(J)}}destroy(){this.cleanupEditors(),super.destroy()}},EL=class extends g5{constructor(){super(...arguments);this.beanName="fullRow",this.startedRows=new Set}shouldStop(_,f,$="ui"){let{rowNode:z,beans:Q}=this,{rowNode:J}=_||{};if(!Iz(Q,{rowNode:z}))return!0;let X=super.shouldStop({rowNode:z},f,$);if(X!==null)return X;if(!z)return!1;return J!==z}midBatchInputsAllowed({rowNode:_}){if(!_)return!1;return this.model.hasEdits({rowNode:_})}clearEdits(_){this.model.clearEditValue(_)}start(_){let{position:f,silent:$,startedEdit:z,event:Q,ignoreEventKey:J}=_,{rowNode:q}=f,{beans:X,model:Y,startedRows:Z}=this;if(this.rowNode!==q)super.cleanupEditors(f);let G=X.visibleCols.allCols,E=[],U=[];for(let H of G)if(H.isCellEditable(q))U.push(H);if(U.length==0)return;if(!Z.has(q))this.dispatchRowEvent({rowNode:q},"rowEditingStarted",$),Z.add(q);for(let H of U){let W={rowNode:q,column:H};E.push(W),Y.start(W)}this.rowNode=q,this.setupEditors({cells:E,position:f,startedEdit:z,event:Q,ignoreEventKey:J})}processValidationResults(_){if(_.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:_.all};return{destroy:_.all,keep:[]}}stopCancelled(_){let{rowNode:f,model:$}=this;if(f&&!$.hasRowEdits(f))return!1;return super.stopCancelled(_),this.cleanupEditors({rowNode:f},!0),this.rowNode=void 0,!0}stopCommitted(_,f){let{rowNode:$,beans:z,model:Q,editSvc:J}=this;if($&&!Q.hasRowEdits($))return!1;let q=[];if(Q.getEditMap().forEach((X,Y)=>{if(!X||X.size===0)return;for(let Z of X.values())if(L0(Z)){q.push(Y);break}}),Hf(z),J.checkNavWithValidation({rowNode:$})==="block-stop")return!1;if(super.stopCommitted(_,f),f||!J.isBatchEditing())for(let X of q)this.dispatchRowEvent({rowNode:X},"rowValueChanged");return this.cleanupEditors({rowNode:$},!0),this.rowNode=void 0,!0}onCellFocusChanged(_){let{rowIndex:f}=_,$=_.previousParams;if($?.rowIndex===f||_.sourceEvent instanceof KeyboardEvent)return;let{beans:z,gos:Q,model:J}=this;if(z.editSvc?.isRangeSelectionEnabledWhileEditing())return;let q=l(z,$);if(Q.get("invalidEditValueMode")==="block"&&q&&(J.getCellValidationModel().getCellValidation(q)||J.getRowValidationModel().getRowValidation(q)))return;super.onCellFocusChanged(_)}cleanupEditors(_={},f){super.cleanupEditors(_,f);let{startedRows:$}=this;for(let z of $)this.dispatchRowEvent({rowNode:z},"rowEditingStopped"),this.destroyEditorsForRow(z);$.clear()}destroyEditorsForRow(_){let f=Iz(this.beans,{rowNode:_});if(!f)return;let $={};for(let z of f.getAllCellCtrls())if(z.comp?.getCellEditor())W$(this.beans,z,$,z)}moveToNextEditingCell(_,f,$,z="ui",Q=!1){let{beans:J,model:q,gos:X,editSvc:Y}=this,Z=_.cellPosition,G;q.suspend(!0);try{G=J.navigation?.findNextCellToFocusOn(Z,{backwards:f,startEditing:!0,skipToNextEditableCell:!1})}finally{q.suspend(!1)}if(G===!1)return null;if(G==null)return!1;let E=G.cellPosition,U=_.isCellEditable(),H=G.isCellEditable(),W=E&&Z.rowIndex===E.rowIndex&&Z.rowPinned===E.rowPinned;if(U)this.setFocusOutOnEditor(_);this.restoreEditors();let B=X.get("suppressStartEditOnTab");if(H&&!Q)if(B)G.focusCell(!0,$);else{if(!G.comp?.getCellEditor())lf(J,G,{event:$,cellStartedEdit:!0});this.setFocusInOnEditor(G),G.focusCell(!1,$)}else{if(H&&Q)this.setFocusInOnEditor(G);G.focusCell(!0,$)}if(!W&&!Q){if(Y?.stopEditing({rowNode:_.rowNode},{event:$,forceStop:!0}),Y?.isRowEditing(_.rowNode,{withOpenEditor:!0}))this.cleanupEditors(G,!0);if(B)G.focusCell(!0,$);else Y.startEditing(G,{startedEdit:!0,event:$,source:z,ignoreEventKey:!0,editable:H||void 0})}return _.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){let{beans:_,model:f}=this;f.getEditMap().forEach(($,z)=>$.forEach(({state:Q},J)=>{if(Q!=="editing")return;let q=l(_,{rowNode:z,column:J});if(q&&!q.comp?.getCellEditor())lf(_,q,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}},UL=class extends g5{constructor(){super(...arguments);this.beanName="singleCell"}shouldStop(_,f,$="ui"){let z=super.shouldStop(_,f,$);if(z!==null)return z;let Q=_?.rowNode,J=_?.column,q=this.rowNode,X=this.column;if((!q||!X)&&Q&&J)return null;if(q!==Q||X!==J)return!0;if(!q&&!X)return this.model.hasEdits(void 0,{withOpenEditor:!0});return!1}midBatchInputsAllowed(_){return this.model.hasEdits(_)}start(_){let{position:f,startedEdit:$,event:z,ignoreEventKey:Q}=_;if(this.rowNode!==f.rowNode||this.column!==f.column)super.cleanupEditors();this.rowNode=f.rowNode,this.column=f.column,this.model.start(f),this.setupEditors({cells:[f],position:f,startedEdit:$,event:z,ignoreEventKey:Q})}dispatchRowEvent(_,f,$){}processValidationResults(_){if(_.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:_.all};return{destroy:_.all,keep:[]}}stopCancelled(_){return super.stopCancelled(_),this.clearPosition()}stopCommitted(_,f){return super.stopCommitted(_,f),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(_){let{colModel:f,editSvc:$}=this.beans,{rowIndex:z,column:Q,rowPinned:J}=_,q=D_(this.beans,{rowIndex:z,rowPinned:J}),X=h6(Q),Y=f.getCol(X),Z=_.previousParams;if(Z){let G=h6(Z.column);if(Z?.rowIndex===z&&G===X&&Z?.rowPinned===J)return}if(_.type=="cellFocused"&&($?.isRangeSelectionEnabledWhileEditing()||$?.isEditing({rowNode:q,column:Y},{withOpenEditor:!0})))return;super.onCellFocusChanged(_)}moveToNextEditingCell(_,f,$,z="ui",Q=!1){let J=this.beans.focusSvc.getFocusedCell();if(J)_=f0(this.beans,J)??_;let q=_.cellPosition,X,Y=this.beans.gos.get("editType")==="fullRow";if(Y)this.model.suspend(!0);if(!Q)_.eGui.focus(),this.editSvc?.stopEditing(_,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:$});try{X=this.beans.navigation?.findNextCellToFocusOn(q,{backwards:f,startEditing:!0})}finally{if(Y)this.model.suspend(!1)}if(X===!1)return null;if(X==null)return!1;let Z=X.cellPosition,G=_.isCellEditable(),E=X.isCellEditable(),U=Z&&q.rowIndex===Z.rowIndex&&q.rowPinned===Z.rowPinned;if(G&&!Q)this.setFocusOutOnEditor(_);let H=this.gos.get("suppressStartEditOnTab"),W=!1;if(!U&&!Q)if(super.cleanupEditors(X,!0),H)X.focusCell(!0,$);else W=!0,this.editSvc.startEditing(X,{startedEdit:!0,event:$,source:z,ignoreEventKey:!0,editable:E});if(E&&!Q){if(X.focusCell(!1,$),H)X.focusCell(!0,$);else if(!X.comp?.getCellEditor()){if(!W){let B=this.editSvc?.isEditing(X,{withOpenEditor:!0});lf(this.beans,X,{event:$,cellStartedEdit:!0,silent:B})}this.setFocusInOnEditor(X),this.cleanupEditors(X)}}else{if(E&&Q)this.setFocusInOnEditor(X);X.focusCell(!0,$)}return _.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},HL={moduleName:"EditCore",version:c,beans:[EB,ZL],apiFunctions:{getEditingCells:mK,getEditRowValues:iK,getCellEditorInstances:HB,startEditingCell:nK,stopEditing:cK,isEditing:pK,validateEdit:dK},dynamicBeans:{singleCell:UL,fullRow:EL},dependsOn:[$1,wK],css:[xK]};var h5={moduleName:"TextEditor",version:c,userComponents:{agCellEditor:c9,agTextCellEditor:c9},dependsOn:[HL]};var u5={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},WL=new Set(Object.values(u5));function Qf(_,f){let $=_.filterUi;if(!$)return null;if($.created)return $.promise;if(f)return null;let z=$.create($.refreshed),Q=$;return Q.created=!0,Q.promise=z,z}function UQ(_,f,$,z,Q,J,q){return f.refresh?.({...$,model:z,source:J,additionalEventAttributes:q}),_().then((X)=>{if(X){let{filter:Y,filterParams:Z}=X;w1(Y,Z,z,Q,J,q)}})}function w1(_,f,$,z,Q,J){_?.refresh?.({...f,model:$,state:z,source:Q,additionalEventAttributes:J})}function i5(_,f,$,z){let Q=_();if(Q?.created)Q.promise.then((J)=>{let q=f();w1(J,Q.filterParams,q,$()??{model:q},"ui",z)})}function wz(_){let f,$=!1,z,{action:Q,filterParams:J,getFilterUi:q,getModel:X,getState:Y,updateState:Z,updateModel:G,processModelToApply:E}=_;switch(Q){case"apply":{let U=Y();if(z=U?.model??null,E)z=E(z);f={state:U?.state,model:z},$=!0;break}case"clear":{if(f={model:null},!J?.buttons?.includes("apply"))$=!0,z=null;break}case"reset":{f={model:null},$=!0,z=null;break}case"cancel":{f={model:X()};break}}if(Z(f),$)G(z);else i5(q,X,Y,{fromAction:Q})}function L_(_,f){return _[f]??null}var BL=class extends vJ{constructor(){super(...arguments);this.iconCreated=!1}wireComp(_,f,$,z,Q){this.comp=_;let J=O$(this,this.beans.context,Q);this.eButtonShowMainFilter=$,this.eFloatingFilterBody=z,this.setGui(f,J),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(J),this.setupLeft(J),this.setupHover(J),this.setupFocus(J),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(J),this.setupUi(),J.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(J);let q=()=>this.onColDefChanged(J);J.addManagedListeners(this.column,{colDefChanged:q}),J.addManagedEventListeners({filterSwitched:({column:X})=>{if(X===this.column)q()}}),J.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){let{column:_,beans:f}=this,$=_.colDef;return C(f.gos,{colDef:$,column:_,floatingFilter:!0})}setupActive(){let _=this.column.getColDef(),f=!!_.filter,$=!!_.floatingFilter;this.active=f&&$}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;let _=h("filter",this.beans,this.column);if(_)this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(_)}setupFocus(_){_.createManagedBean(new t0(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){let _=this.getLocaleTextFunc();W_(this.eButtonShowMainFilter,_("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(_){let{beans:f}=this;if(d(f)===this.eGui)return;let Q=V_(f,this.eGui,null,_.shiftKey);if(Q){f.headerNavigation?.scrollToColumn(this.column),_.preventDefault(),Q.focus();return}let J=this.findNextColumnWithFloatingFilter(_.shiftKey);if(!J)return;if(f.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:J},event:_}))_.preventDefault()}findNextColumnWithFloatingFilter(_){let f=this.beans.visibleCols,$=this.column;do if($=_?f.getColBefore($):f.getColAfter($),!$)break;while(!$.getColDef().filter||!$.getColDef().floatingFilter);return $}handleKeyDown(_){super.handleKeyDown(_);let f=this.getWrapperHasFocus();switch(_.key){case S.UP:case S.DOWN:case S.LEFT:case S.RIGHT:if(f)return;n_(_);case S.ENTER:if(f){if(F_(this.eGui))_.preventDefault()}break;case S.ESCAPE:if(!f)this.eGui.focus()}}onFocusIn(_){if(this.eGui.contains(_.relatedTarget))return;let $=!!_.relatedTarget&&!_.relatedTarget.classList.contains("ag-floating-filter"),z=!!_.relatedTarget&&uf(_.relatedTarget,"ag-floating-filter");if($&&z&&_.target===this.eGui){let Q=this.lastFocusEvent,J=!!(Q&&Q.key===S.TAB);if(Q&&J){let q=Q.shiftKey;F_(this.eGui,q)}}this.focusThis()}setupHover(_){this.beans.colHover?.addHeaderFilterColumnHoverListener(_,this.comp,this.column,this.eGui)}setupLeft(_){let f=new PJ(this.column,this.eGui,this.beans);_.createManagedBean(f)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!E_(this.gos)}setupUserComp(){if(!this.active)return;let _=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());if(_)this.setCompDetails(_)}setCompDetails(_){this.userCompDetails=_,this.comp.setCompDetails(_)}showParentFilter(){let _=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:_,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(_){if(!this.active)return;let{beans:{colFilter:f},column:$,gos:z}=this,Q=(J)=>{if(J?.source==="filterDestroyed"&&(!this.isAlive()||!f?.isAlive()))return;let q=this.comp.getFloatingFilterComp();if(!q)return;q.then((X)=>{if(X){if(z.get("enableFilterHandlers")){let G=J,E="filter";if(G?.afterFloatingFilter)E="ui";else if(G?.afterDataChange)E="dataChanged";else if(J?.source==="api")E="api";this.updateFloatingFilterParams(this.userCompDetails,E);return}let Y=f?.getCurrentFloatingFilterParentModel($),Z=J?{...J,columns:J.columns??[],source:J.source==="api"?"api":"columnFilter"}:null;X.onParentModelChanged(Y,Z)}})};if([this.destroySyncListener]=_.addManagedListeners($,{filterChanged:Q}),f?.isFilterActive($))Q(null)}setupWidth(_){let f=()=>{let $=`${this.column.getActualWidth()}px`;this.comp.setWidth($)};_.addManagedListeners(this.column,{widthChanged:f}),f()}setupFilterChangedListener(_){if(this.active)[this.destroyFilterChangedListener]=_.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton()}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){let _=!!this.beans.filterManager?.isFilterAllowed(this.column);if(this.comp.setButtonWrapperDisplayed(_),this.highlightFilterButtonWhenActive&&_)this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(_){let f=this.active;this.setupActive();let $=!f&&this.active;if(f&&!this.active)this.destroySyncListener(),this.destroyFilterChangedListener();let z=this.beans.colFilter,Q=this.active?z?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,J=this.comp.getFloatingFilterComp();if(!J||!Q)this.updateCompDetails(_,Q,$);else J.then((q)=>{if(!q||z?.areFilterCompsDifferent(this.userCompDetails??null,Q))this.updateCompDetails(_,Q,$);else this.updateFloatingFilterParams(Q,"colDef")})}updateCompDetails(_,f,$){if(!this.isAlive())return;if(this.setCompDetails(f),this.setupFilterButton(),this.setupUi(),$)this.setupSyncWithFilter(_),this.setupFilterChangedListener(_)}updateFloatingFilterParams(_,f){if(!_)return;let $=_.params;this.comp.getFloatingFilterComp()?.then((z)=>{if(typeof z?.refresh==="function"){if(this.gos.get("enableFilterHandlers"))$={...$,model:L_(this.beans.colFilter?.model??{},this.column.getColId()),source:f};z.refresh($)}})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function KL(_,f){let $=_.colModel.getCol(f);if(!$){e(12,{colKey:f});return}_.menuSvc?.showColumnMenu({column:$,positionBy:"auto"})}function LL(_){_.menuSvc?.hidePopupMenu()}var FL=class extends A{constructor(){super(...arguments);this.beanName="menuSvc"}postConstruct(){let{enterpriseMenuFactory:_,filterMenuFactory:f}=this.beans;this.activeMenuFactory=_??f}showColumnMenu(_){this.showColumnMenuCommon(this.activeMenuFactory,_,"columnMenu")}showFilterMenu(_){this.showColumnMenuCommon(n9(this.beans),_,_.containerType,!0)}showHeaderContextMenu(_,f,$){this.activeMenuFactory?.showMenuAfterContextMenuEvent(_,f,$)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){n9(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(_){let{suppressHeaderMenuButton:f}=_.getColDef();return!f&&!!this.activeMenuFactory?.isMenuEnabled(_)&&(E_(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(_){return!_.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(_)}isHeaderContextMenuEnabled(_){return!(_&&Q0(_)?_.getColDef():_?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){let _=!this.isSuppressMenuHide();return!(pf()&&_)}isHeaderFilterButtonEnabled(_){return this.isFilterMenuInHeaderEnabled(_)&&!E_(this.gos)&&!this.isFloatingFilterButtonDisplayed(_)}isFilterMenuItemEnabled(_){return!!this.beans.filterManager?.isFilterAllowed(_)&&!E_(this.gos)&&!this.isFilterMenuInHeaderEnabled(_)&&!this.isFloatingFilterButtonDisplayed(_)}isFloatingFilterButtonEnabled(_){return!_.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(_){return!!_.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(_)}isSuppressMenuHide(){let _=this.gos,f=_.get("suppressMenuHide");if(E_(_))return _.exists("suppressMenuHide")?f:!1;return f}showColumnMenuCommon(_,f,$,z){let{positionBy:Q,onClosedCallback:J}=f,q=f.column;if(Q==="button"){let{buttonElement:X}=f;_?.showMenuAfterButtonClick(q,X,$,J,z)}else if(Q==="mouse"){let{mouseEvent:X}=f;_?.showMenuAfterMouseEvent(q,X,$,J,z)}else if(q){let X=this.beans,Y=X.ctrlsSvc;Y.getScrollFeature().ensureColumnVisible(q,"auto"),Y0(X,()=>{let Z=Y.getHeaderRowContainerCtrl(q.getPinned())?.getHeaderCtrlForColumn(q);if(Z)_?.showMenuAfterButtonClick(q,Z.getAnchorElementForMenu(z),$,J,z)})}}};function B$(_,f,$){if(_.menuVisible!==f)_.menuVisible=f,_.dispatchColEvent("menuVisibleChanged",$)}function n9(_){let{enterpriseMenuFactory:f,filterMenuFactory:$,gos:z}=_;return f&&E_(z)?f:$}var eJ={moduleName:"SharedMenu",version:c,beans:[FL],apiFunctions:{showColumnMenu:KL,hidePopupMenu:LL}},DL=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function ML(_){let f=_.filterManager;return!!f?.isColumnFilterPresent()||!!f?.isAggregateFilterPresent()}function kL(_,f){return _.filterManager?.getColumnFilterInstance(f)??Promise.resolve(void 0)}function SL(_,f){let $=_.colModel.getColDefCol(f);if($)return _.colFilter?.destroyFilter($,"api")}function AL(_,f){_.frameworkOverrides.wrapIncoming(()=>_.filterManager?.setFilterModel(f))}function RL(_){return _.filterManager?.getFilterModel()??{}}function jL(_,f,$){let{gos:z,colModel:Q,colFilter:J}=_;if($&&!z.get("enableFilterHandlers"))j(288),$=!1;let q=Q.getColDefCol(f);return q?J?.getModelForColumn(q,$)??null:null}function VL(_,f,$){return _.filterManager?.setColumnFilterModel(f,$)??Promise.resolve()}function OL(_,f){let $=_.colModel.getCol(f);if(!$){e(12,{colKey:f});return}_.menuSvc?.showFilterMenu({column:$,containerType:"columnFilter",positionBy:"auto"})}function PL(_){_.menuSvc?.hideFilterMenu()}function vL(_,f){let $=_.colModel.getCol(f);if(!$){e(12,{colKey:f});return}return _.colFilter?.getHandler($,!0)}function TL(_,f){let{colModel:$,colFilter:z,gos:Q}=_;if(!Q.get("enableFilterHandlers")){j(287);return}let{colId:J,action:q}=f;if(J){let X=$.getColById(J);if(X)z?.updateModel(X,q)}else z?.updateAllModels(q)}var d9={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},t9=["january","february","march","april","may","june","july","august","september","october","november","december"];function IL(_,f){if(_==null)return-1;if(f==null)return 1;return Number.parseFloat(_)-Number.parseFloat(f)}function yL(_,f){if(_==null)return-1;if(f==null)return 1;let $=Bf(_),z=Bf(f);if($!=null&&z!=null){if($===z)return 0;return $>z?1:-1}return String(_).localeCompare(String(f))}function r9(_){return _ instanceof Date&&!isNaN(_.getTime())}var n6={number:()=>{return},bigint:()=>{return},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(_,f)=>f,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(_,f)=>f===!1,numberOfInputs:0}]}),date:()=>({isValidDate:r9}),dateString:({dataTypeDefinition:_})=>({comparator:(f,$)=>{let z=_.dateParser($);if($==null||zf)return 1;return 0},isValidDate:(f)=>typeof f==="string"&&r9(_.dateParser(f))}),dateTime:(_)=>n6.date(_),dateTimeString:(_)=>n6.dateString(_),object:()=>{return},text:()=>{return}},d6={number:()=>({comparator:IL}),bigint:()=>({comparator:yL}),boolean:({t:_})=>({valueFormatter:(f)=>v(f.value)?_(String(f.value),f.value?"True":"False"):_("blanks","(Blanks)")}),date:({formatValue:_,t:f})=>({valueFormatter:($)=>{let z=_($);return v(z)?z:f("blanks","(Blanks)")},treeList:!0,treeListFormatter:($,z)=>{if($==="NaN")return f("invalidDate","Invalid Date");if(z===1&&$!=null){let Q=t9[Number($)-1];return f(Q,d9[Q])}return $??f("blanks","(Blanks)")},treeListPathGetter:($)=>K1($,!1)}),dateString:({formatValue:_,dataTypeDefinition:f,t:$})=>({valueFormatter:(z)=>{let Q=_(z);return v(Q)?Q:$("blanks","(Blanks)")},treeList:!0,treeListPathGetter:(z)=>K1(f.dateParser(z??void 0),!1),treeListFormatter:(z,Q)=>{if(Q===1&&z!=null){let J=t9[Number(z)-1];return $(J,d9[J])}return z??$("blanks","(Blanks)")}}),dateTime:(_)=>{let f=d6.date(_);return f.treeListPathGetter=K1,f},dateTimeString(_){let f=_.dataTypeDefinition.dateParser,$=d6.dateString(_);return $.treeListPathGetter=(z)=>K1(f(z??void 0)),$},object:({formatValue:_,t:f})=>({valueFormatter:($)=>{let z=_($);return v(z)?z:f("blanks","(Blanks)")}}),text:()=>{return}};function _2(_,f,$,z,Q,J,q){let X=f,Y=$,Z=_==="agSetColumnFilter";if(!Y&&z.baseDataType==="object"&&!Z)Y=({column:H,node:W})=>Q({column:H,node:W,value:J.valueSvc.getValue(H,W,"data")});let E=(Z?d6:n6)[z.baseDataType],U=E({dataTypeDefinition:z,formatValue:Q,t:q});return X=typeof f==="object"?{...U,...f}:U,{filterParams:X,filterValueGetter:Y}}var bL={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},CL={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function f2(_,f=!1){return(f?CL:bL)[_??"text"]}function $2(_,f,$){if(f==null)return null;let z=null,{compName:Q,jsComp:J,fwComp:q}=$X(_,f);if(Q)z={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[Q];else if(J==null&&q==null&&f.filter===!0)z=$();return z}var wL={filterHandler:()=>({doesFilterPass:()=>!0})};function l9(_,f,$,z){if(!_.isPrimary())return!0;let J=!$;if(!_.isValueActive()||!J)return!1;if(f)return!0;return z}var xL=class extends A{constructor(){super(...arguments);this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...u5},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));let _=this.gos,f={..._.get("initialState")?.filter?.filterModel??{}};if(this.initialModel=f,this.model={...f},!_.get("enableFilterHandlers"))delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(_,f="api",$){let{colModel:z,dataTypeSvc:Q,filterManager:J}=this.beans;if(Q?.isPendingInference){this.modelUpdates.push({model:_,source:f});return}let q=[],X=this.getModel(!0);if(_){let Y=new Set(Object.keys(_));this.allColumnFilters.forEach((Z,G)=>{let E=_[G];q.push(this.setModelOnFilterWrapper(Z,E)),Y.delete(G)}),Y.forEach((Z)=>{let G=z.getColDefCol(Z)||z.getCol(Z);if(!G){j(62,{colId:Z});return}if(!G.isFilterAllowed()){j(63,{colId:Z});return}let E=this.getOrCreateFilterWrapper(G,!0);if(!E){j(64,{colId:Z});return}q.push(this.setModelOnFilterWrapper(E,_[Z],!0))})}else this.model={},this.allColumnFilters.forEach((Y)=>{q.push(this.setModelOnFilterWrapper(Y,null))});g.all(q).then(()=>{let Y=this.getModel(!0),Z=[];if(this.allColumnFilters.forEach((G,E)=>{let U=X?X[E]:null,H=Y?Y[E]:null;if(!xz(U,H))Z.push(G.column)}),Z.length>0)J?.onFilterChanged({columns:Z,source:f});else if($)this.updateActive("filterChanged")})}getModel(_){let f={},{allColumnFilters:$,initialModel:z,beans:{colModel:Q}}=this;if($.forEach((J,q)=>{let X=this.getModelFromFilterWrapper(J);if(v(X))f[q]=X}),!_)for(let J of Object.keys(z)){let q=z[J];if(v(q)&&!$.has(J)&&Q.getCol(J)?.isFilterAllowed())f[J]=q}return f}setState(_,f,$="api"){if(this.state.clear(),f)for(let z of Object.keys(f)){let Q=f[z];this.state.set(z,{model:L_(this.model,z),state:Q})}this.setModel(_,$,!0)}getState(){let _=this.state;if(!_.size)return;let f={},$=!1;return _.forEach((z,Q)=>{let J=z.state;if(J!=null)$=!0,f[Q]=J}),$?f:void 0}getModelFromFilterWrapper(_){let $=_.column.getColId();if(_.isHandler)return L_(this.model,$);let z=_.filter;if(z){if(typeof z.getModel!=="function")return j(66),null;return z.getModel()}return L_(this.initialModel,$)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};let{allColumnFilters:_}=this;if(_.size)return _.forEach((f)=>this.disposeFilterWrapper(f,"advancedFilterEnabled")),!0;return!1}updateActiveFilters(){let _=(Y)=>{if(!Y)return!1;if(!Y.isFilterActive)return j(67),!1;return Y.isFilterActive()},{colModel:f,gos:$}=this.beans,z=!!C0($),Q=[],J=[],q=(Y,Z,G)=>{if(Z)if(l9(Y,f.isPivotMode(),f.isPivotActive(),z))Q.push(G);else J.push(G)},X=[];return this.allColumnFilters.forEach((Y)=>{let Z=Y.column,G=Z.getColId();if(Y.isHandler)X.push(g.resolve().then(()=>{q(Z,this.isHandlerActive(Z),{colId:G,isHandler:!0,handler:Y.handler,handlerParams:Y.handlerParams})}));else{let E=Qf(Y);if(E)X.push(E.then((U)=>{q(Z,_(U),{colId:G,isHandler:!1,comp:U})}))}}),g.all(X).then(()=>{this.activeAggregateFilters=Q,this.activeColumnFilters=J})}updateFilterFlagInColumns(_,f){let $=[];return this.allColumnFilters.forEach((z)=>{let Q=z.column;if(z.isHandler)$.push(g.resolve().then(()=>{this.setColFilterActive(Q,this.isHandlerActive(Q),_,f)}));else{let J=Qf(z);if(J)$.push(J.then((q)=>{this.setColFilterActive(Q,q.isFilterActive(),_,f)}))}}),this.beans.groupFilter?.updateFilterFlags(_,f),g.all($)}doFiltersPass(_,f,$){let{data:z,aggData:Q}=_,J=$?this.activeAggregateFilters:this.activeColumnFilters,q=$?Q:z,X=this.model;for(let Y=0;Y{if(this.isAlive())$?.onFilterChanged(_)};if(f.isRefreshInProgress())setTimeout(z,0);else z()}updateBeforeFilterChanged(_={}){let{column:f,additionalEventAttributes:$}=_,z=f?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",$).then(()=>{this.allColumnFilters.forEach((Q)=>{let{column:J,isHandler:q}=Q;if(z===J.getColId())return;if(q)Q.handler.onAnyFilterChanged?.();Qf(Q,q)?.then((X)=>{if(typeof X?.onAnyFilterChanged==="function")X.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(_){let f=[];this.allColumnFilters.forEach(($)=>{let z=$.isHandler;if(z)$.handler.onNewRowsLoaded?.();let Q=Qf($,z);if(Q)f.push(Q.then((J)=>{J.onNewRowsLoaded?.()}))}),g.all(f).then(()=>this.updateActive(_,{afterDataChange:!0}))}updateActive(_,f){this.updateFilterFlagInColumns(_,f).then(()=>this.updateActiveFilters())}createGetValue(_,f){let{filterValueSvc:$,colModel:z}=this.beans;return(Q,J)=>{let q=J?z.getCol(J):_;return q?$.getValue(q,Q,f):void 0}}isFilterActive(_){let f=this.cachedFilter(_);if(f?.isHandler)return this.isHandlerActive(_);let $=f?.filter;if($)return $.isFilterActive();return L_(this.initialModel,_.getColId())!=null}isHandlerActive(_){let f=v(L_(this.model,_.getColId()));if(f)return f;let $=this.beans.groupFilter;return $?.isGroupFilter(_)?$.isFilterActive(_):!1}getOrCreateFilterUi(_){let f=this.getOrCreateFilterWrapper(_,!0);return f?Qf(f):null}getFilterUiForDisplay(_){let f=this.getOrCreateFilterWrapper(_,!0);if(!f)return null;let $=Qf(f);if(!$)return null;return $.then((z)=>({comp:z,params:f.filterUi.filterParams,isHandler:f.isHandler}))}getHandler(_,f){let $=this.getOrCreateFilterWrapper(_,f);return $?.isHandler?$.handler:void 0}getOrCreateFilterWrapper(_,f){if(!_.isFilterAllowed())return;let $=this.cachedFilter(_);if(!$&&f)$=this.createFilterWrapper(_),this.setColumnFilterWrapper(_,$);return $}cachedFilter(_){return this.allColumnFilters.get(_.getColId())}getDefaultFilter(_,f=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(_),f)}getDefaultFilterFromDataType(_,f=!1){if(V7(this.gos))return f?"agSetColumnFloatingFilter":"agSetColumnFilter";return f2(_(),f)}getDefaultFloatingFilter(_){return this.getDefaultFilter(_,!0)}createFilterComp(_,f,$,z,Q,J){let q=()=>{let Z=this.createFilterCompParams(_,Q,J),G=z(Z,Q);return BJ(this.beans.userCompFactory,f,G,$)},X=q();if(!X)return null;return{compDetails:X,createFilterUi:(Z)=>{return(Z?q():X).newAgStackInstance()}}}createFilterInstance(_,f,$,z){let Q=this.beans.selectableFilter;if(Q?.isSelectable(f))f=Q.getFilterDef(_,f);let{handler:J,handlerParams:q,handlerGenerator:X}=this.createHandler(_,f,$)??{},Y=this.createFilterComp(_,f,$,z,!!J,"init");if(!Y)return{compDetails:null,createFilterUi:null,handler:J,handlerGenerator:X,handlerParams:q};let{compDetails:Z,createFilterUi:G}=Y;if(this.isGlobalButtons){if(!Z.params?.buttons?.length)j(281,{colId:_.getColId()})}return{compDetails:Z,handler:J,handlerGenerator:X,handlerParams:q,createFilterUi:G}}createBaseFilterParams(_,f){let{filterManager:$,rowModel:z}=this.beans;return C(this.gos,{column:_,colDef:_.getColDef(),getValue:this.createGetValue(_),doesRowPassOtherFilter:f?()=>!0:(Q)=>$?.doesRowPassOtherFilters(_.getColId(),Q)??!0,rowModel:z})}createFilterCompParams(_,f,$,z){let Q=this.filterChangedCallbackFactory(_),J=this.createBaseFilterParams(_,z);if(J.filterChangedCallback=Q,J.filterModifiedCallback=z?()=>{}:(q)=>this.filterModified(_,q),f){let q=J,X=_.getColId(),Y=L_(this.model,X);q.model=Y,q.state=this.state.get(X)??{model:Y},q.onModelChange=(Z,G)=>{this.updateStoredModel(X,Z),this.refreshHandlerAndUi(_,Z,"ui",!1,G).then(()=>{Q({...G,source:"columnFilter"})})},q.onStateChange=(Z)=>{this.updateState(_,Z),this.updateOrRefreshFilterUi(_)},q.onAction=(Z,G,E)=>{this.updateModel(_,Z,G),this.dispatchLocalEvent({type:"filterAction",column:_,action:Z,event:E})},q.getHandler=()=>this.getHandler(_,!0),q.onUiChange=(Z)=>this.filterUiChanged(_,Z),q.source=$}return J}createFilterUiForHandler(_,f){return f?{created:!1,create:f,filterParams:_.params,compDetails:_}:null}createFilterUiLegacy(_,f,$){let z=f(),Q={created:!0,create:f,filterParams:_.params,compDetails:_,promise:z};return z.then($),Q}createFilterWrapper(_){let{compDetails:f,handler:$,handlerGenerator:z,handlerParams:Q,createFilterUi:J}=this.createFilterInstance(_,_.getColDef(),this.getDefaultFilter(_),(X)=>X),q=_.getColId();if($)return delete this.initialModel[q],$.init?.({...Q,source:"init",model:L_(this.model,q)}),{column:_,isHandler:!0,handler:$,handlerGenerator:z,handlerParams:Q,filterUi:this.createFilterUiForHandler(f,J)};if(J){let X={column:_,filterUi:null,isHandler:!1};return X.filterUi=this.createFilterUiLegacy(f,J,(Y)=>{X.filter=Y??void 0}),X}return{column:_,filterUi:null,isHandler:!1}}createHandlerFunc(_,f,$){let{gos:z,frameworkOverrides:Q,registry:J}=this.beans,q,X=(H)=>{let W=H.filter;if(eq(W)){let B=W.handler;if(B)return B;if(q=W.doesFilterPass,q)return()=>({doesFilterPass:q});return}return typeof W==="string"?W:void 0},Y=z.get("enableFilterHandlers"),Z=Y?X(f):void 0,G=(H)=>()=>this.createBean(J.createDynamicBean(H,!0)),E,U;if(typeof Z==="string"){let H=z.get("filterHandlers")?.[Z];if(H!=null)E=H;else if(WL.has(Z))E=G(Z),U=Z}else E=Z;if(!E){let H,{compName:W,jsComp:B,fwComp:K}=$X(Q,f);if(W)H=W;else if(B==null&&K==null&&f.filter===!0)H=$;if(U=this.handlerMap[H],U)E=G(U)}if(!E){if(!Y)return;if(o(z))j(277,{colId:_.getColId()});return wL}return{filterHandler:E,handlerNameOrCallback:q??U}}createHandler(_,f,$){let z=this.createHandlerFunc(_,f,$);if(!z)return;let Q=rQ(this.beans.userCompFactory,f,this.createFilterCompParams(_,!0,"init")),{handlerNameOrCallback:J,filterHandler:q}=z,{handler:X,handlerParams:Y}=this.createHandlerFromFunc(_,q,Q);return{handler:X,handlerParams:Y,handlerGenerator:J??q}}createHandlerFromFunc(_,f,$){let z=_.getColDef(),Q=f(C(this.gos,{column:_,colDef:z})),J=this.createHandlerParams(_,$);return{handler:Q,handlerParams:J}}createHandlerParams(_,f){let $=_.getColDef(),z=_.getColId(),Q=this.filterChangedCallbackFactory(_);return C(this.gos,{colDef:$,column:_,getValue:this.createGetValue(_),doesRowPassOtherFilter:(J)=>this.beans.filterManager?.doesRowPassOtherFilters(z,J)??!0,onModelChange:(J,q)=>{this.updateStoredModel(z,J),this.refreshHandlerAndUi(_,J,"handler",!1,q).then(()=>{Q({...q,source:"columnFilter"})})},onModelAsStringChange:()=>{_.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:_})},filterParams:f})}onColumnsChanged(){let _=[],{colModel:f,filterManager:$,groupFilter:z}=this.beans;this.allColumnFilters.forEach((J,q)=>{let X;if(J.column.isPrimary())X=f.getColDefCol(q);else X=f.getCol(q);if(X&&X===J.column)return;_.push(J.column),this.disposeFilterWrapper(J,"columnChanged"),this.disposeColumnListener(q)});let Q=z&&_.every((J)=>z.isGroupFilter(J));if(_.length>0&&!Q)$?.onFilterChanged({columns:_,source:"api"})}isFilterAllowed(_){if(!_.isFilterAllowed())return!1;let $=this.beans.groupFilter;if($?.isGroupFilter(_))return $.isFilterAllowed(_);return!0}getFloatingFilterCompDetails(_,f){let{userCompFactory:$,frameworkOverrides:z,selectableFilter:Q,gos:J}=this.beans,q=(H)=>{this.getOrCreateFilterUi(_)?.then((B)=>{H(d0(B))})},X=_.getColDef(),Y=Q?.isSelectable(X)?Q.getFilterDef(_,X):X,Z=$2(z,Y,()=>this.getDefaultFloatingFilter(_))??"agReadOnlyFloatingFilter",G=J.get("enableFilterHandlers"),E=rQ($,Y,this.createFilterCompParams(_,G,"init",!0)),U=C(J,{column:_,filterParams:E,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(_),parentFilterInstance:q,showParentFilter:f});if(G){let H=U,W=_.getColId(),B=this.filterChangedCallbackFactory(_);H.onUiChange=(K)=>this.floatingFilterUiChanged(_,K),H.model=L_(this.model,W),H.onModelChange=(K,L)=>{this.updateStoredModel(W,K),this.refreshHandlerAndUi(_,K,"floating",!0,L).then(()=>{B({...L,source:"columnFilter"})})},H.getHandler=()=>this.getHandler(_,!0),H.source="init"}return KJ($,X,U,Z)}getCurrentFloatingFilterParentModel(_){return this.getModelFromFilterWrapper(this.cachedFilter(_)??{column:_})}destroyFilterUi(_,f,$,z){if(_.isHandler){let J=f.getColId();delete this.initialModel[J],this.state.delete(J);let q=_.filterUi,X=this.createFilterUiForHandler($,z);_.filterUi=X;let Y=this.eventSvc;if(q?.created)q.promise.then((Z)=>{this.destroyBean(Z),Y.dispatchEvent({type:"filterDestroyed",source:"paramsUpdated",column:f})});else Y.dispatchEvent({type:"filterHandlerDestroyed",source:"paramsUpdated",column:f})}else this.destroyFilter(f,"paramsUpdated")}destroyFilter(_,f="api"){let $=_.getColId(),z=this.allColumnFilters.get($);if(this.disposeColumnListener($),delete this.initialModel[$],z)this.disposeFilterWrapper(z,f).then((Q)=>{if(Q&&this.isAlive())this.beans.filterManager?.onFilterChanged({columns:[_],source:"api"})})}disposeColumnListener(_){let f=this.allColumnListeners.get(_);if(f)this.allColumnListeners.delete(_),f()}disposeFilterWrapper(_,f){let $=!1,{column:z,isHandler:Q,filterUi:J}=_,q=z.getColId();if(Q)$=this.isHandlerActive(z),this.destroyBean(_.handler),delete this.model[q],this.state.delete(q);let X=()=>{this.setColFilterActive(z,!1,"filterDestroyed"),this.allColumnFilters.delete(q),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:f,column:z})};if(J)if(J.created)return J.promise.then((Y)=>{return $=Q?$:!!Y?.isFilterActive(),this.destroyBean(Y),X(),$});else X();return g.resolve($)}filterChangedCallbackFactory(_){return(f)=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:f,columns:[_],column:_,source:f?.source??"columnFilter"})}}filterParamsChanged(_,f="api"){let $=this.allColumnFilters.get(_);if(!$)return;let z=this.beans,Q=$.column,J=Q.getColDef(),q=Q.isFilterAllowed(),X=this.getDefaultFilter(Q),Y=z.selectableFilter,Z=Y?.isSelectable(J)?Y.getFilterDef(Q,J):J,G=q?this.createHandlerFunc(Q,Z,this.getDefaultFilter(Q)):void 0,E=!!G,U=$.isHandler;if(U!=E){this.destroyFilter(Q,"paramsUpdated");return}let{compDetails:H,createFilterUi:W}=(q?this.createFilterComp(Q,Z,X,(K)=>K,E,"colDef"):null)??{compDetails:null,createFilterUi:null},B=H?.params??rQ(z.userCompFactory,Z,this.createFilterCompParams(Q,E,"colDef"));if(U){let K=G?.handlerNameOrCallback??G?.filterHandler,L=L_(this.model,_);if($.handlerGenerator!=K){let F=$.handler,{handler:D,handlerParams:M}=this.createHandlerFromFunc(Q,G.filterHandler,B);if($.handler=D,$.handlerParams=M,$.handlerGenerator=K,delete this.model[_],D.init?.({...M,source:"init",model:null}),this.destroyBean(F),L!=null)this.beans.filterManager?.onFilterChanged({columns:[Q],source:f})}else{let F=this.createHandlerParams(Q,H?.params);$.handlerParams=F,$.handler.refresh?.({...F,source:"colDef",model:L})}}if(this.areFilterCompsDifferent($.filterUi?.compDetails??null,H)||!$.filterUi||!H){this.destroyFilterUi($,Q,H,W);return}$.filterUi.filterParams=B,Qf($,U)?.then((K)=>{if((K?.refresh?K.refresh(B):!0)===!1)this.destroyFilterUi($,Q,H,W);else this.dispatchLocalEvent({type:"filterParamsChanged",column:Q,params:B})})}refreshHandlerAndUi(_,f,$,z,Q){let J=this.cachedFilter(_);if(!J){if(z)this.getOrCreateFilterWrapper(_,!0);return g.resolve()}if(!J.isHandler)return g.resolve();let{filterUi:q,handler:X,handlerParams:Y}=J;return UQ(()=>{if(q){let{created:Z,filterParams:G}=q;if(Z)return q.promise.then((E)=>{return E?{filter:E,filterParams:G}:void 0});else q.refreshed=!0}return g.resolve(void 0)},X,Y,f,this.state.get(_.getColId())??{model:f},$,Q)}setColumnFilterWrapper(_,f){let $=_.getColId();this.allColumnFilters.set($,f),this.allColumnListeners.set($,this.addManagedListeners(_,{colDefChanged:()=>this.filterParamsChanged($)})[0])}areFilterCompsDifferent(_,f){if(!f||!_)return!0;let{componentClass:$}=_,{componentClass:z}=f;return!($===z||$?.render&&z?.render&&$.render===z.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some((f)=>f.getColDef().floatingFilter)}getFilterInstance(_){let f=this.beans.colModel.getColDefCol(_);if(!f)return Promise.resolve(void 0);let $=this.getOrCreateFilterUi(f);if(!$)return Promise.resolve(null);return new Promise((z)=>{$.then((Q)=>{z(d0(Q))})})}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:_,source:f})=>this.setModel(_,f)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:_,model:f,resolve:$})=>{this.setModelForColumn(_,f).then(()=>$())}),this.columnModelUpdates=[]}getModelForColumn(_,f){if(f){let{state:z,model:Q}=this,J=_.getColId(),q=z.get(J);if(q)return q.model??null;return L_(Q,J)}let $=this.cachedFilter(_);return $?this.getModelFromFilterWrapper($):null}setModelForColumn(_,f){if(this.beans.dataTypeSvc?.isPendingInference){let $=()=>{},z=new Promise((Q)=>{$=Q});return this.columnModelUpdates.push({key:_,model:f,resolve:$}),z}return new Promise(($)=>{this.setModelForColumnLegacy(_,f).then((z)=>$(z))})}getStateForColumn(_){return this.state.get(_)??{model:L_(this.model,_)}}setModelForColumnLegacy(_,f){let $=this.beans.colModel.getColDefCol(_),z=$?this.getOrCreateFilterWrapper($,!0):null;return z?this.setModelOnFilterWrapper(z,f):g.resolve()}setColDefPropsForDataType(_,f,$){let z=_.filter,Q=z===!0?this.getDefaultFilterFromDataType(()=>f.baseDataType):z;if(typeof Q!=="string")return;let J,q,X=this.beans,{filterParams:Y,filterValueGetter:Z}=_;if(Q==="agMultiColumnFilter")({filterParams:J,filterValueGetter:q}=X.multiFilter?.getParamsForDataType(Y,Z,f,$)??{});else({filterParams:J,filterValueGetter:q}=_2(Q,Y,Z,f,$,X,this.getLocaleTextFunc()));if(_.filterParams=J,q)_.filterValueGetter=q}setColFilterActive(_,f,$,z){if(_.filterActive!==f)_.filterActive=f,_.dispatchColEvent("filterActiveChanged",$);_.dispatchColEvent("filterChanged",$,z)}setModelOnFilterWrapper(_,f,$){return new g((z)=>{if(_.isHandler){let J=_.column,q=J.getColId(),X=this.model[q];if(this.updateStoredModel(q,f),$&&f===X){z();return}this.refreshHandlerAndUi(J,f,"api").then(()=>z());return}let Q=Qf(_);if(Q){Q.then((J)=>{if(typeof J?.setModel!=="function"){j(65),z();return}(J.setModel(f)||g.resolve()).then(()=>z())});return}z()})}updateStoredModel(_,f){if(v(f))this.model[_]=f;else delete this.model[_];let $=this.state.get(_),z={model:f,state:$?.state};this.state.set(_,z)}filterModified(_,f){this.getOrCreateFilterUi(_)?.then(($)=>{this.eventSvc.dispatchEvent({type:"filterModified",column:_,filterInstance:$,...f})})}filterUiChanged(_,f){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"filterUiChanged",column:_,...f})}floatingFilterUiChanged(_,f){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:_,...f})}updateModel(_,f,$){let z=_.getColId(),Q=this.cachedFilter(_),J=()=>Q?.filterUi;wz({action:f,filterParams:Q?.filterUi?.filterParams,getFilterUi:J,getModel:()=>L_(this.model,z),getState:()=>this.state.get(z),updateState:(q)=>this.updateState(_,q),updateModel:(q)=>J()?.filterParams?.onModelChange(q,{...$,fromAction:f}),processModelToApply:Q?.isHandler?Q.handler.processModelToApply?.bind(Q.handler):void 0})}updateAllModels(_,f){let $=[];if(this.allColumnFilters.forEach((z,Q)=>{let J=this.beans.colModel.getColDefCol(Q);if(J)wz({action:_,filterParams:z.filterUi?.filterParams,getFilterUi:()=>z.filterUi,getModel:()=>L_(this.model,Q),getState:()=>this.state.get(Q),updateState:(q)=>this.updateState(J,q),updateModel:(q)=>{this.updateStoredModel(Q,q),this.dispatchLocalEvent({type:"filterAction",column:J,action:_}),$.push(this.refreshHandlerAndUi(J,q,"ui"))},processModelToApply:z?.isHandler?z.handler.processModelToApply?.bind(z.handler):void 0})}),$.length)g.all($).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:f,columns:[]})})}updateOrRefreshFilterUi(_){let f=_.getColId();i5(()=>this.cachedFilter(_)?.filterUi,()=>L_(this.model,f),()=>this.state.get(f))}updateState(_,f){this.state.set(_.getColId(),f),this.dispatchLocalEvent({type:"filterStateChanged",column:_,state:f})}canApplyAll(){let{state:_,model:f,activeFilterComps:$}=this;for(let Q of $)if(Q.source==="COLUMN_MENU")return!1;let z=!1;for(let Q of _.keys()){let J=_.get(Q);if(J.valid===!1)return!1;if((J.model??null)!==L_(f,Q))z=!0}return z}hasUnappliedModel(_){let{model:f,state:$}=this;return($.get(_)?.model??null)!==L_(f,_)}setGlobalButtons(_){this.isGlobalButtons=_,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:_})}shouldKeepStateOnDetach(_,f){if(f==="newFiltersToolPanel")return!0;let $=this.beans.filterPanelSvc;if($?.isActive)return!!$.getState(_.getColId());return!1}onPivotModeChanged(_){let{colModel:f,pivotColsSvc:$}=this.beans,z=!!C0(this.gos),Q=_.currentValue,J=Q?this.activeColumnFilters:this.activeAggregateFilters,q=Q?this.activeAggregateFilters:this.activeColumnFilters,X=[];for(let Y of J){let Z=f.getColById(Y.colId),G=Q&&!!$?.columns.length;if(Z&&Q===l9(Z,Q,G,z))q.push(Y),X.push(Y)}K$(J,X)}destroy(){super.destroy(),this.allColumnFilters.forEach((_)=>this.disposeFilterWrapper(_,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function NL(_){return!!_.filterManager?.isAnyFilterPresent()}function gL(_,f="api"){_.filterManager?.onFilterChanged({source:f})}var hL=class extends A{constructor(){super(...arguments);this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(_){this.quickFilter=_.quickFilter,this.advancedFilter=_.advancedFilter,this.colFilter=_.colFilter}postConstruct(){let _=this.refreshFiltersForAggregations.bind(this),f=this.updateAdvFilterColumns.bind(this);if(this.addManagedEventListeners({columnValueChanged:_,columnPivotChanged:_,columnPivotModeChanged:_,newColumnsLoaded:f,columnVisible:f,advancedFilterEnabledChanged:({enabled:z})=>this.onAdvFilterEnabledChanged(z),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter)this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});let{gos:$}=this;this.alwaysPassFilter=$.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=$.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){let _=this.gos.getCallback("isExternalFilterPresent");return typeof _==="function"&&_({})}doesExternalFilterPass(_){let f=this.gos.get("doesExternalFilterPass");return typeof f==="function"&&f(_)}setFilterState(_,f,$="api"){if(this.isAdvFilterEnabled())return;this.colFilter?.setState(_,f,$)}setFilterModel(_,f="api",$){if(this.isAdvFilterEnabled()){if(!$)this.warnAdvFilters();return}this.colFilter?.setModel(_,f)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(_){if(_){if(this.colFilter?.disableFilters())this.onFilterChanged({source:"advancedFilter"})}else if(this.advancedFilter?.isFilterPresent())this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"})}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){if(C0(this.gos)&&this.isAnyFilterPresent())this.onFilterChanged()}onFilterChanged(_={}){let{source:f,additionalEventAttributes:$,columns:z=[]}=_;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(_):g.resolve()).then(()=>{let Q={source:f,type:"filterChanged",columns:z};if($)H_(Q,$);this.eventSvc.dispatchEvent(Q),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!C0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(_,f){return this.doesRowPassFilter({rowNode:f,colIdToSkip:_})}doesRowPassAggregateFilters(_){let{rowNode:f}=_;if(this.alwaysPassFilter?.(f))return!0;if(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(f))return!1;if(this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(f,_.colIdToSkip,!0))return!1;return!0}doesRowPassFilter(_){let{rowNode:f}=_;if(this.alwaysPassFilter?.(f))return!0;if(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(f))return!1;if(this.externalFilterPresent&&!this.doesExternalFilterPass(f))return!1;if(this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(f,_.colIdToSkip))return!1;if(this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(f))return!1;return!0}isFilterAllowed(_){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.isFilterAllowed(_)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(_,f="api"){if(!this.isAdvFilterEnabled())return;if(this.beans.dataTypeSvc?.isPendingInference){this.advFilterModelUpdateQueue.push(_);return}this.advancedFilter.setModel(_??null),this.onFilterChanged({source:f})}toggleAdvFilterBuilder(_,f){if(!this.isAdvFilterEnabled())return;this.advancedFilter.getCtrl().toggleFilterBuilder({source:f,force:_})}updateAdvFilterColumns(){if(!this.isAdvFilterEnabled())return;if(this.advancedFilter.updateValidity())this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(_){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve(void 0);return this.colFilter?.getFilterInstance(_)??Promise.resolve(void 0)}warnAdvFilters(){j(68)}setupAdvFilterHeaderComp(_){this.advancedFilter?.getCtrl().setupHeaderComp(_)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(let _ of this.advFilterModelUpdateQueue)this.setAdvFilterModel(_);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(_,f){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve();return this.colFilter?.setModelForColumn(_,f)??Promise.resolve()}};function uL(_){return{tag:"div",cls:_}}var z2=class extends w{constructor(_){let{className:f="ag-filter-apply-panel"}=_??{};super(uL(f));this.listeners=[],this.validationMessage=null,this.className=f}updateButtons(_,f){let $=this.buttons;if(this.buttons=_,$===_)return;let z=this.getGui();f_(z);let Q;this.destroyListeners();let J=document.createDocumentFragment(),q=this.className,X=({type:Z,label:G})=>{let E=(L)=>{this.dispatchLocalEvent({type:Z,event:L})};if(!["apply","clear","reset","cancel"].includes(Z))j(75);let U=Z==="apply",W=z_({tag:"button",attrs:{type:U&&f?"submit":"button"},ref:`${Z}FilterButton`,cls:`ag-button ag-standard-button ${q}-button${U?" "+q+"-apply-button":""}`,children:G});if(this.activateTabIndex([W]),U)Q=W;let B=(L)=>{if(L.key===S.ENTER)L.preventDefault(),E(L)},K=this.listeners;W.addEventListener("click",E),K.push(()=>W.removeEventListener("click",E)),W.addEventListener("keydown",B),K.push(()=>W.removeEventListener("keydown",B)),J.append(W)};for(let Z of _)X(Z);this.eApply=Q;let Y=this.validationTooltipFeature;if(Q&&!Y)this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1000}));else if(!Q&&Y)this.validationTooltipFeature=this.destroyBean(Y);z.append(J)}getApplyButton(){return this.eApply}updateValidity(_,f=null){let $=this.eApply;if(!$)return;o6($,!_),this.validationMessage=f,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage)}destroyListeners(){for(let _ of this.listeners)_();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}};var Q2=class extends w{constructor(_,f,$,z,Q,J){super();this.column=_,this.wrapper=f,this.eventParent=$,this.updateModel=z,this.isGlobalButtons=Q,this.enableGlobalButtonCheck=J,this.hidePopup=null,this.applyActive=!1}postConstruct(){let{comp:_,params:f}=this.wrapper,$=f,z=$.useForm,Q=z?"form":"div";if(this.setTemplate({tag:Q,cls:"ag-filter-wrapper"}),z)this.addManagedElementListeners(this.getGui(),{submit:(J)=>{J?.preventDefault()},keydown:this.handleKeyDown.bind(this)});this.appendChild(_.getGui()),this.params=$,this.resetButtonsPanel($),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:J,params:q})=>{if(J===this.column)this.resetButtonsPanel(q,this.params)},filterStateChanged:({column:J,state:q})=>{if(J===this.column)this.eButtons?.updateValidity(q.valid!==!1)},filterAction:({column:J,action:q,event:X})=>{if(J===this.column)this.afterAction(q,X)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:J})=>{if(J!==this.isGlobalButtons){this.isGlobalButtons=J;let q=this.params;this.resetButtonsPanel(q,q,!0)}}}:void 0})}afterGuiAttached(_){if(_)this.hidePopup=_.hidePopup}resetButtonsPanel(_,f,$){let{buttons:z,readOnly:Q}=f??{},{buttons:J,readOnly:q,useForm:X}=_;if(!$&&Q===q&&xz(z,J))return;let Y=J&&J.length>0&&!_.readOnly&&!this.isGlobalButtons,Z=this.eButtons;if(Y){let G=J.map((E)=>{let U=`${E}Filter`;return{type:E,label:GX(this,U)}});if(this.applyActive=V$(this.params),!Z){Z=this.createBean(new z2),this.appendChild(Z.getGui());let E=this.column,U=(H)=>({event:W})=>{this.updateModel(E,H,{fromButtons:!0}),this.afterAction(H,W)};Z?.addManagedListeners(Z,{apply:U("apply"),clear:U("clear"),reset:U("reset"),cancel:U("cancel")}),this.eButtons=Z}Z.updateButtons(G,X)}else if(this.applyActive=!1,Z)T_(Z.getGui()),this.eButtons=this.destroyBean(Z)}close(_){let f=this.hidePopup;if(!f)return;let $=_,z=$?.key,Q;if(z===S.ENTER||z===S.SPACE)Q={keyboardEvent:$};f(Q),this.hidePopup=null}afterAction(_,f){let{params:$,applyActive:z}=this,Q=$?.closeOnApply;switch(_){case"apply":{if(f?.preventDefault(),Q&&z)this.close(f);break}case"reset":{if(Q&&z)this.close();break}case"cancel":{if(Q)this.close(f);break}}}handleKeyDown(_){if(!_.defaultPrevented&&_.key===S.ENTER&&this.applyActive)this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",_)}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},iL=":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}",mL={tag:"div",cls:"ag-filter"},J2=class extends w{constructor(_,f,$){super(mL);this.column=_,this.source=f,this.enableGlobalButtonCheck=$,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return this.wrapper!=null}getFilter(){return this.wrapper?.then((_)=>_.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??g.resolve()}afterGuiAttached(_){this.afterGuiAttachedParams=_,this.wrapper?.then((f)=>{this.comp?.afterGuiAttached(_),f?.comp?.afterGuiAttached?.(_)})}afterGuiDetached(){this.wrapper?.then((_)=>{_?.comp?.afterGuiDetached?.()})}createFilter(_){let{column:f,source:$,beans:{colFilter:z}}=this,Q=z.getFilterUiForDisplay(f)??null;this.wrapper=Q,Q?.then((J)=>{if(!J)return;let{isHandler:q,comp:X}=J,Y;if(q){let Z=!!this.enableGlobalButtonCheck,G=this.createBean(new Q2(f,J,z,z.updateModel.bind(z),Z&&z.isGlobalButtons,Z));this.comp=G,Y=G.getGui()}else if(this.registerCSS(iL),Y=X.getGui(),!v(Y))j(69,{guiFromFilter:Y});if(this.appendChild(Y),_)this.eventSvc.dispatchEvent({type:"filterOpened",column:f,source:$,eGui:this.getGui()});else X.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(_){let{source:f,column:$}=_;if((f==="api"||f==="paramsUpdated")&&$.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column))f_(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter()}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},cL=class extends A{constructor(){super(...arguments);this.beanName="filterMenuFactory"}wireBeans(_){this.popupSvc=_.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(_,f,$,z){if(_&&!_.isColumn)return;this.showPopup(_,(Q)=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:_},type:$,mouseEvent:f,ePopup:Q})},$,f.target,E_(this.gos),z)}showMenuAfterButtonClick(_,f,$,z){if(_&&!_.isColumn)return;let Q=-1,J="left",q=E_(this.gos);if(!q&&this.gos.get("enableRtl"))Q=1,J="right";let X=q?void 0:4*Q,Y=q?void 0:4;this.showPopup(_,(Z)=>{this.popupSvc?.positionPopupByComponent({type:$,eventSource:f,ePopup:Z,nudgeX:X,nudgeY:Y,alignSide:J,keepWithinBounds:!0,position:"under",additionalParams:{column:_}})},$,f,q,z)}showPopup(_,f,$,z,Q,J){let q=_?this.createBean(new J2(_,"COLUMN_MENU")):void 0;if(this.activeMenu=q,!q?.hasFilter()||!_){e(57);return}let X=z_({tag:"div",cls:`ag-menu${!Q?" ag-filter-menu":""}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(X,{keydown:(B)=>this.trapFocusWithin(B,X)}),X.appendChild(q?.getGui());let Y,Z=()=>q?.afterGuiDetached(),G=YJ(this.gos)?z??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,E=(B)=>{B$(_,!1,"contextMenu");let K=B instanceof KeyboardEvent;if(this.tabListener)this.tabListener=this.tabListener();if(K&&z&&A_(z))ez(z)?.focus({preventScroll:!0});Z(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,$,_),J?.()},U=this.getLocaleTextFunc(),H=Q&&$!=="columnFilter"?U("ariaLabelColumnMenu","Column Menu"):U("ariaLabelColumnFilter","Column Filter"),W=this.popupSvc?.addPopup({modal:!0,eChild:X,closeOnEsc:!0,closedCallback:E,positionCallback:()=>f(X),anchorToElement:G,ariaLabel:H});if(W)this.hidePopup=Y=W.hideFunc;q.afterInit().then(()=>{f(X),q.afterGuiAttached({container:$,hidePopup:Y})}),B$(_,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,$,_)}trapFocusWithin(_,f){if(_.key!==S.TAB||_.defaultPrevented||V_(this.beans,f,!1,_.shiftKey))return;_.preventDefault(),F_(f,_.shiftKey)}dispatchVisibleChangedEvent(_,f,$){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:_,switchingTab:!1,key:f,column:$??null,columnGroup:null})}isMenuEnabled(_){return _.isFilterAllowed()&&(_.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},pL=class extends A{constructor(){super(...arguments);this.beanName="filterValueSvc"}getValue(_,f,$){if(!f)return;let z=_.getColDef(),{selectableFilter:Q,valueSvc:J,formula:q}=this.beans,X=$??Q?.getFilterValueGetter(_.getColId())??z.filterValueGetter;if(X)return this.executeFilterValueGetter(X,f.data,_,f,z);let Y=J.getValue(_,f,"data");if(_.isAllowFormula()&&q?.isFormula(Y))return q.resolveValue(_,f);return Y}executeFilterValueGetter(_,f,$,z,Q){let{expressionSvc:J,valueSvc:q}=this.beans,X=C(this.gos,{data:f,node:z,column:$,colDef:Q,getValue:q.getValueCallback.bind(q,z)});if(typeof _==="function")return _(X);return J?.evaluate(_,X)}};function nL(_){return!!_.quickFilter?.isFilterPresent()}function dL(_){return _.quickFilter?.getText()}function tL(_){_.quickFilter?.resetCache()}var rL=class extends A{constructor(){super(...arguments);this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){let _=this.resetCache.bind(this),f=this.gos;this.addManagedEventListeners({columnPivotModeChanged:_,newColumnsLoaded:_,columnRowGroupChanged:_,columnVisible:()=>{if(!f.get("includeHiddenColumnsInQuickFilter"))this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",($)=>this.setFilter($.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(f.get("quickFilterText")),this.parser=f.get("quickFilterParser"),this.matcher=f.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){let{autoColSvc:_,colModel:f,gos:$,pivotResultCols:z}=this.beans,Q=f.isPivotMode(),J=_?.getColumns(),q=f.getColDefCols(),X=(Q&&!$.get("applyQuickFilterBeforePivotOrAgg")?z?.getPivotResultCols()?.list:q)??[];if(J)X=X.concat(J);this.colsToUse=$.get("includeHiddenColumnsInQuickFilter")?X:X.filter((Y)=>Y.isVisible()||Y.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(_){let f=this.gos.get("cacheQuickFilter");if(this.matcher)return this.doesRowPassMatcher(f,_);return this.quickFilterParts.every(($)=>f?this.doesRowPassCache(_,$):this.doesRowPassNoCache(_,$))}resetCache(){this.beans.rowModel.forEachNode((_)=>_.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){let{quickFilter:_,parser:f}=this;if(_)this.quickFilterParts=f?f(_):_.split(" ");else this.quickFilterParts=null}parseFilter(_){if(!v(_))return null;return _.toUpperCase()}setFilter(_){if(_!=null&&typeof _!=="string"){j(70,{newFilter:_});return}let f=this.parseFilter(_);if(this.quickFilter!==f)this.quickFilter=f,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}setParserAndMatcher(){let _=this.gos.get("quickFilterParser"),f=this.gos.get("quickFilterMatcher"),$=_!==this.parser||f!==this.matcher;if(this.parser=_,this.matcher=f,$)this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}onColumnConfigChanged(){if(this.refreshCols(),this.resetCache(),this.isFilterPresent())this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(_,f){return this.colsToUse.some(($)=>{let z=this.getTextForColumn($,_);return v(z)&&z.includes(f)})}doesRowPassCache(_,f){return this.checkGenerateAggText(_),_.quickFilterAggregateText.includes(f)}doesRowPassMatcher(_,f){let $;if(_)this.checkGenerateAggText(f),$=f.quickFilterAggregateText;else $=this.getAggText(f);let{quickFilterParts:z,matcher:Q}=this;return Q(z,$)}checkGenerateAggText(_){if(!_.quickFilterAggregateText)_.quickFilterAggregateText=this.getAggText(_)}getTextForColumn(_,f){let $=this.beans.filterValueSvc.getValue(_,f),z=_.getColDef();if(z.getQuickFilterText){let Q=C(this.gos,{value:$,node:f,data:f.data,column:_,colDef:z});$=z.getQuickFilterText(Q)}return v($)?$.toString().toUpperCase():null}getAggText(_){let f=[];for(let $ of this.colsToUse){let z=this.getTextForColumn($,_);if(v(z))f.push(z)}return f.join(` -`)}},lL={moduleName:"ClientSideRowModelFilter",version:c,rowModels:["clientSide"],beans:[$K]},m5={moduleName:"FilterCore",version:c,beans:[hL],apiFunctions:{isAnyFilterPresent:NL,onFilterChanged:gL},css:[DL],dependsOn:[lL]},c5={moduleName:"FilterValue",version:c,beans:[pL]},p5={moduleName:"ColumnFilter",version:c,beans:[xL,cL],dynamicBeans:{headerFilterCellCtrl:BL},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:ML,getColumnFilterInstance:kL,destroyFilter:SL,setFilterModel:AL,getFilterModel:RL,getColumnFilterModel:jL,setColumnFilterModel:VL,showColumnFilter:OL,hideColumnFilter:PL,getColumnFilterHandler:vL,doFilterAction:TL},dependsOn:[m5,$1,c5,eJ]};var sL={moduleName:"QuickFilterCore",version:c,rowModels:["clientSide"],beans:[rL],dependsOn:[m5,c5]},n5={moduleName:"QuickFilter",version:c,apiFunctions:{isQuickFilterPresent:nL,getQuickFilter:dL,resetQuickFilter:tL},dependsOn:[sL]};var aL=class extends A{constructor(){super(...arguments);this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(_,f){let $=this.wrapSvc?.wrap(_,f)??f,z=!Wz.has(_),Q=z?this.asyncListeners:this.syncListeners;if(!Q.has(_))Q.set(_,new Set);Q.get(_).add($),this.eventSvc.addListener(_,$,z)}removeListener(_,f){let $=this.wrapSvc?.unwrap(_,f)??f,Q=!!this.asyncListeners.get(_)?.delete($);if(!Q)this.syncListeners.get(_)?.delete($);this.eventSvc.removeListener(_,$,Q)}addGlobalListener(_){let f=this.wrapSvc?.wrapGlobal(_)??_,$=(J,q)=>{if(Wz.has(J))f(J,q)},z=(J,q)=>{if(!Wz.has(J))f(J,q)};this.globalListenerPairs.set(_,{syncListener:$,asyncListener:z});let Q=this.eventSvc;Q.addGlobalListener($,!1),Q.addGlobalListener(z,!0)}removeGlobalListener(_){let{eventSvc:f,wrapSvc:$,globalListenerPairs:z}=this,Q=$?.unwrapGlobal(_)??_;if(z.has(Q)){let{syncListener:q,asyncListener:X}=z.get(Q);f.removeGlobalListener(q,!1),f.removeGlobalListener(X,!0),z.delete(_)}else this.syncGlobalListeners.delete(Q),f.removeGlobalListener(Q,!1)}destroyEventListeners(_,f){_.forEach(($,z)=>{$.forEach((Q)=>this.eventSvc.removeListener(z,Q,f)),$.clear()}),_.clear()}destroyGlobalListeners(_,f){for(let $ of _)this.eventSvc.removeGlobalListener($,f);_.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);let{globalListenerPairs:_,eventSvc:f}=this;_.forEach(({syncListener:$,asyncListener:z})=>{f.removeGlobalListener($,!1),f.removeGlobalListener(z,!0)}),_.clear()}};function oL(_,f,$){_.apiEventSvc?.addListener(f,$)}function eL(_,f,$){_.apiEventSvc?.removeListener(f,$)}function _F(_,f){_.apiEventSvc?.addGlobalListener(f)}function fF(_,f){_.apiEventSvc?.removeGlobalListener(f)}var d5={moduleName:"EventApi",version:c,apiFunctions:{addEventListener:oL,addGlobalListener:_F,removeEventListener:eL,removeGlobalListener:fF},beans:[aL]};function A0(_,f){if(typeof _!=="number")return"";let $=f(),z=$("thousandSeparator",","),Q=$("decimalSeparator",".");return _.toString().replace(".",Q).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${z}`)}var $F="↑",zF="↓",QF={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},JF=class extends w{constructor(){super(QF);this.eValue=V,this.eDelta=V,this.refreshCount=0}init(_){this.refresh(_,!0)}showDelta(_,f){let $=Math.abs(f),z=_.formatValue($),Q=v(z)?z:$,J=f>=0,q=this.eDelta;if(J)q.textContent=$F+Q;else q.textContent=zF+Q;q.classList.toggle("ag-value-change-delta-up",J),q.classList.toggle("ag-value-change-delta-down",!J)}setTimerToRemoveDelta(){this.refreshCount++;let _=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(_===this.refreshCount)this.hideDeltaValue()},2000)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),f_(this.eDelta)}refresh(_,f=!1){let{value:$,valueFormatted:z}=_,{eValue:Q,lastValue:J,beans:q}=this;if($===J)return!1;if(v(z))Q.textContent=z;else if(v($))Q.textContent=$;else f_(Q);if(q.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;let X=$&&typeof $==="object"&&"toNumber"in $?$.toNumber():$,Y=J&&typeof J==="object"&&"toNumber"in J?J.toNumber():J;if(X===Y)return!1;if(typeof X==="number"&&typeof Y==="number"){let Z=X-Y;this.showDelta(_,Z)}if(J)Q.classList.add("ag-value-change-value-highlight");if(!f)this.setTimerToRemoveDelta();return this.lastValue=$,!0}},qF=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",XF={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},YF=class extends w{constructor(){super(XF);this.eCurrent=V,this.refreshCount=0,this.registerCSS(qF)}init(_){this.refresh(_,!0)}addSlideAnimation(){this.refreshCount++;let _=this.refreshCount;this.ePrevious?.remove();let{beans:f,eCurrent:$}=this,z=z_({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=z,z.textContent=$.textContent,this.getGui().insertBefore(z,$),f.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(_!==this.refreshCount)return;this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{if(_!==this.refreshCount)return;this.ePrevious?.remove(),this.ePrevious=null},3000)})}refresh(_,f=!1){let $=_.value;if(n($))$="";if($===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if(!f)this.addSlideAnimation();this.lastValue=$;let z=this.eCurrent;if(v(_.valueFormatted))z.textContent=_.valueFormatted;else if(v(_.value))z.textContent=$;else f_(z);return!0}},ZF=class extends A{constructor(){super(...arguments);this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(_,f,$=this.beans.gos.get("cellFlashDuration"),z=this.beans.gos.get("cellFadeDuration")){let Q=this.animations[f];Q.delete(_);let J=Date.now(),q=J+$,X=J+$+z,Y={phase:"flash",flashEndTime:q,fadeEndTime:X};Q.set(_,Y);let Z=`ag-cell-${f}`,G=`${Z}-animation`,{comp:E,eGui:{style:U}}=_;if(E.toggleCss(Z,!0),E.toggleCss(G,!1),U.removeProperty("transition"),U.removeProperty("transition-delay"),this.nextAnimationTime&&q+15{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),$)}),this.nextAnimationTime=q}advanceAnimations(){let _=Date.now(),f=null;for(let $ of Object.keys(this.animations)){let z=this.animations[$],Q=`ag-cell-${$}`,J=`${Q}-animation`;for(let[q,X]of z){if(!q.isAlive()||!q.comp){z.delete(q);continue}let{phase:Y,flashEndTime:Z,fadeEndTime:G}=X,E=Y==="flash"?Z:G;if(!(_+15>=E)){f=Math.min(E,f??1/0);continue}let{comp:H,eGui:{style:W}}=q;switch(Y){case"flash":H.toggleCss(Q,!1),H.toggleCss(J,!0),W.transition=`background-color ${G-Z}ms`,W.transitionDelay=`${Z-_}ms`,f=Math.min(G,f??1/0),X.phase="fade";break;case"fade":H.toggleCss(Q,!1),H.toggleCss(J,!1),W.removeProperty("transition"),W.removeProperty("transition-delay"),z.delete(q);break}}}if(f==null)this.nextAnimationTime=null,this.nextAnimationCycle=null;else if(f)this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),f-_),this.nextAnimationTime=f}onFlashCells(_,f){if(!_.comp)return;let $=g0(_.cellPosition);if(f.cells[$])this.animateCell(_,"highlight")}flashCell(_,f){this.animateCell(_,"data-changed",f?.flashDuration,f?.fadeDuration)}destroy(){for(let _ of Object.keys(this.animations))this.animations[_].clear()}};function GF(_,f={}){let{cellFlashSvc:$}=_;if(!$)return;_.frameworkOverrides.wrapIncoming(()=>{for(let z of _.rowRenderer.getCellCtrls(f.rowNodes,f.columns))$.flashCell(z,f)})}var t5={moduleName:"HighlightChanges",version:c,beans:[ZF],userComponents:{agAnimateShowChangeCellRenderer:JF,agAnimateSlideCellRenderer:YF},apiFunctions:{flashCells:GF}};var EF=class extends A{constructor(){super(...arguments);this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",(_)=>{this.onSelectionOptionsChanged(_.currentValue,_.previousValue,Uf(_.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(_){let f=this.columns;if(f==null)return;_.list=f.list.concat(_.list),_.tree=f.tree.concat(_.tree),A$(_)}createColumns(_,f){let $=()=>{J0(this.beans,this.columns?.tree),this.columns=null},z=_.treeDepth,J=(this.columns?.treeDepth??-1)==z,q=this.generateSelectionCols();if(S$(q,this.columns?.list??[])&&J)return;$();let{colGroupSvc:Y}=this.beans,Z=Y?.findDepth(_.tree)??0,G=Y?.balanceTreeForAutoCols(q,Z)??[];this.columns={list:q,tree:G,treeDepth:Z,map:{}},f((U)=>{if(!U)return null;let H=U.filter((W)=>!x0(W));return[...q,...H]})}updateColumns(_){let f=Uf(_.source),{beans:$}=this;for(let z of this.columns?.list??[]){let Q=this.createSelectionColDef(_.currentValue);z.setColDef(Q,null,f),d_($,{state:[HJ(Q,z.colId)]},f)}}getColumn(_){return this.columns?.list.find((f)=>b0(f,_))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){let{gos:_,beans:f}=this,$=_.get("rowSelection");if(typeof $!=="object"||!p0(_))return!1;let z=(f.autoColSvc?.getColumns()?.length??0)>0;if($.checkboxLocation==="autoGroupColumn"&&z)return!1;let Q=!!Zf($),J=Gz($);return Q||J}createSelectionColDef(_){let{gos:f}=this,$=_??f.get("selectionColumnDef"),z=f.get("enableRtl"),{rowSpan:Q,spanRows:J,...q}=$??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:z?"right":"left",comparator(X,Y,Z,G){let E=Z.isSelected(),U=G.isSelected();return E===U?0:E?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...q,colId:tq,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];let _=this.createSelectionColDef(),f=_.colId;this.gos.validateColDef(_,f,!0);let $=new Z0(_,null,f,!1);return this.createBean($),[$]}onSelectionOptionsChanged(_,f,$){let z=f&&typeof f!=="string"?Zf(f):void 0,Q=_&&typeof _!=="string"?Zf(_):void 0,J=z!==Q,q=f&&typeof f!=="string"?Gz(f):void 0,X=_&&typeof _!=="string"?Gz(_):void 0,Y=q!==X,Z=V1(_),G=V1(f);if(J||Y||Z!==G)this.beans.colModel.refreshAll($)}destroy(){J0(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(_,f,$){if(!this.columns?.list.length)return;let z=_.length+f.length+$.length;if(z===0)return;let Q=this.columns.list[0];if(!Q.isVisible())return;let J=()=>{let Y;switch(Q.pinned){case"left":case!0:Y=_;break;case"right":Y=$;break;default:Y=f}if(Y)Q_(Y,Q)};if((this.beans.rowNumbersSvc?.getColumn(rq)?2:1)===z)J()}},UF=':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}';function HF(_,f){if(!f.nodes.every((q)=>{if(q.rowPinned&&!YQ(q))return j(59),!1;if(q.id===void 0)return j(60),!1;return!0}))return;let{nodes:z,source:Q,newValue:J}=f;_.selectionSvc?.setNodesSelected({nodes:z,source:Q??"api",newValue:J})}function WF(_,f,$="apiSelectAll"){_.selectionSvc?.selectAllRowNodes({source:$,selectAll:f})}function BF(_,f,$="apiSelectAll"){_.selectionSvc?.deselectAllRowNodes({source:$,selectAll:f})}function KF(_,f="apiSelectAllFiltered"){_.selectionSvc?.selectAllRowNodes({source:f,selectAll:"filtered"})}function LF(_,f="apiSelectAllFiltered"){_.selectionSvc?.deselectAllRowNodes({source:f,selectAll:"filtered"})}function FF(_,f="apiSelectAllCurrentPage"){_.selectionSvc?.selectAllRowNodes({source:f,selectAll:"currentPage"})}function DF(_,f="apiSelectAllCurrentPage"){_.selectionSvc?.deselectAllRowNodes({source:f,selectAll:"currentPage"})}function MF(_){return _.selectionSvc?.getSelectedNodes()??[]}function kF(_){return _.selectionSvc?.getSelectedRows()??[]}var SF={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},AF=class extends w{constructor(){super(SF,[h0]);this.eCheckbox=V}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){let _=this.getLocaleTextFunc(),{rowNode:f,eCheckbox:$}=this,z=f.isSelected(),Q=s6(_,z),[J,q]=f.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],X=_(J,q);$.setValue(z,!0),$.setInputAriaLabel(`${X} (${Q})`)}init(_){if(this.rowNode=_.rowNode,this.column=_.column,this.overrides=_.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:n_,click:(z)=>{if(n_(z),this.eCheckbox.isDisabled())return;this.beans.selectionSvc?.handleSelectionEvent(z,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:z,previousValue:Q})=>{let J=typeof z==="object"?tQ(z):void 0,q=typeof Q==="object"?tQ(Q):void 0;if(J!==q)this.onSelectableChanged()}),O6(this.gos)||typeof this.getIsVisible()==="function"){let z=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:z}),this.addManagedListeners(this.rowNode,{dataChanged:z,cellChanged:z}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){let{column:_,rowNode:f,overrides:$,gos:z}=this,Q=f.selectable,J=this.getIsVisible(),q=void 0;if(typeof J==="function"){let E=$?.callbackParams;if(!_)q=J({...E,node:f,data:f.data});else{let U=_.createColumnFunctionCallbackParams(f);q=J({...E,...U})}}else q=J??!1;let X=Q&&!q||!Q&&q,Y=Q||q,Z=z.get("rowSelection"),G=Z&&typeof Z!=="string"?!tQ(Z):!!_?.getColDef().showDisabledCheckboxes;if(this.setVisible(Y&&(X?G:!0)),this.setDisplayed(Y&&(X?G:!0)),Y)this.eCheckbox.setDisabled(X);if($?.removeHidden)this.setDisplayed(Y)}getIsVisible(){let _=this.overrides;if(_)return _.isVisible;let f=this.gos.get("rowSelection");if(f&&typeof f!=="string")return Zf(f);return this.column?.getColDef()?.checkboxSelection}},RF=class{constructor(_,f){this.rowModel=_,this.pinnedRowModel=f,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(_){this.rootId=_.id,this.endId=null,this.cachedRange.length=0}setEndRange(_){this.endId=_.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){let _=this.getRoot(),f=this.getEnd();if(_==null||f==null)return this.cachedRange;this.cachedRange=this.getNodesInRange(_,f)??[]}return this.cachedRange}isInRange(_){if(this.rootId===null)return!1;return this.getRange().some((f)=>f.id===_.id)}getRoot(_){if(this.rootId)return this.getRowNode(this.rootId);if(_)return this.setRoot(_),_}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(_){let f,{rowModel:$,pinnedRowModel:z}=this;if(f??(f=$.getRowNode(_)),z?.isManual())f??(f=z.getPinnedRowById(_,"top")),f??(f=z.getPinnedRowById(_,"bottom"));return f}truncate(_){let f=this.getRange();if(f.length===0)return{keep:[],discard:[]};let $=f[0].id===this.rootId,z=f.findIndex((Q)=>Q.id===_.id);if(z>-1){let Q=f.slice(0,z),J=f.slice(z+1);return this.setEndRange(_),$?{keep:Q,discard:J}:{keep:J,discard:Q}}else return{keep:f,discard:[]}}extend(_,f=!1){let $=this.getRoot();if($==null){let Q=this.getRange().slice();if(f)_.depthFirstSearch((J)=>!J.group&&Q.push(J));return Q.push(_),this.setRoot(_),{keep:Q,discard:[]}}let z=this.getNodesInRange($,_);if(!z)return this.setRoot(_),{keep:[_],discard:[]};if(z.find((Q)=>Q.id===this.endId))return this.setEndRange(_),{keep:this.getRange(),discard:[]};else{let Q=this.getRange().slice();return this.setEndRange(_),{keep:this.getRange(),discard:Q}}}getNodesInRange(_,f){let{pinnedRowModel:$,rowModel:z}=this;if(!$?.isManual())return z.getNodesInRangeForSelection(_,f);if(_.rowPinned==="top"&&!f.rowPinned)return l_($,"top",_,void 0).concat(z.getNodesInRangeForSelection(z.getRow(0),f)??[]);if(_.rowPinned==="bottom"&&!f.rowPinned){let Q=l_($,"bottom",void 0,_),J=z.getRowCount(),q=z.getRow(J-1);return(z.getNodesInRangeForSelection(f,q)??[]).concat(Q)}if(!_.rowPinned&&!f.rowPinned)return z.getNodesInRangeForSelection(_,f);if(_.rowPinned==="top"&&f.rowPinned==="top")return l_($,"top",_,f);if(_.rowPinned==="bottom"&&f.rowPinned==="top"){let Q=l_($,"top",f,void 0),J=l_($,"bottom",void 0,_),q=z.getRow(0),X=z.getRow(z.getRowCount()-1);return Q.concat(z.getNodesInRangeForSelection(q,X)??[]).concat(J)}if(!_.rowPinned&&f.rowPinned==="top")return l_($,"top",f,void 0).concat(z.getNodesInRangeForSelection(z.getRow(0),_)??[]);if(_.rowPinned==="top"&&f.rowPinned==="bottom"){let Q=l_($,"top",_,void 0),J=l_($,"bottom",void 0,f),q=z.getRow(0),X=z.getRow(z.getRowCount()-1);return Q.concat(z.getNodesInRangeForSelection(q,X)??[]).concat(J)}if(_.rowPinned==="bottom"&&f.rowPinned==="bottom")return l_($,"bottom",_,f);if(!_.rowPinned&&f.rowPinned==="bottom"){let Q=l_($,"bottom",void 0,f),J=z.getRow(z.getRowCount());return(z.getNodesInRangeForSelection(_,J)??[]).concat(Q)}return null}},jF=class extends A{constructor(_){super();this.column=_,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(_){let f=this.cbSelectAll;if(f.isDisplayed()&&!f.getGui().contains(d(this.beans)))_.preventDefault(),f.setValue(!f.getValue())}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(_){this.headerCellCtrl=_;let f=this.createManagedBean(new gJ);this.cbSelectAll=f,f.addCss("ag-header-select-all"),Z_(f.getGui(),"presentation"),this.showOrHideSelectAll();let $=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:$,paginationChanged:$,modelUpdated:$}),this.addManagedPropertyListener("rowSelection",({currentValue:z,previousValue:Q})=>{let J=(q)=>typeof q==="string"||!q||q.mode==="singleRow"?void 0:q.selectAll;if(J(z)!==J(Q))this.showOrHideSelectAll();this.updateStateOfCheckbox()}),this.addManagedListeners(f,{fieldValueChanged:this.onCbSelectAll.bind(this)}),f.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(_){if(!this.isAlive())return;this.showOrHideSelectAll(_.source==="uiColumnMoved")}showOrHideSelectAll(_=!1){let f=this.isCheckboxSelection();if(this.cbSelectAllVisible=f,this.cbSelectAll.setDisplayed(f),f)this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox();this.refreshSelectAllLabel(_)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;let _=this.getSelectAllMode(),f=this.beans.selectionSvc,$=this.cbSelectAll,z=f.getSelectAllState(_);$.setValue(z);let Q=f.hasNodesToSelect(_);$.setDisabled(!Q),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(_=!1){let f=this.getLocaleTextFunc(),{headerCellCtrl:$,cbSelectAll:z,cbSelectAllVisible:Q}=this,J=z.getValue(),q=s6(f,J),X=f("ariaRowSelectAll","Press Space to toggle all rows selection");if($.setAriaDescriptionProperty("selectAll",Q?`${X} (${q})`:null),z.setInputAriaLabel(f("ariaHeaderSelection","Column with Header Selection")),!_)$.announceAriaDescription()}checkSelectionType(_){if(!Z$(this.gos))return j(128,{feature:_}),!1;return!0}checkRightRowModelType(_){let{gos:f,rowModel:$}=this.beans;if(!(o(f)||Kf(f)))return j(129,{feature:_,rowModel:$.getType()}),!1;return!0}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;let _=this.cbSelectAll.getValue(),f=this.getSelectAllMode(),$="uiSelectAll";if(f==="currentPage")$="uiSelectAllCurrentPage";else if(f==="filtered")$="uiSelectAllFiltered";let z={source:$,selectAll:f},Q=this.beans.selectionSvc;if(_)Q.selectAllRowNodes(z);else Q.deselectAllRowNodes(z)}isCheckboxSelection(){let{column:_,gos:f,beans:$}=this,J=typeof f.get("rowSelection")==="object"?"headerCheckbox":"headerCheckboxSelection";return r5($,_)&&this.checkRightRowModelType(J)&&this.checkSelectionType(J)}getSelectAllMode(){let _=gq(this.gos,!1);if(_)return _;let{headerCheckboxSelectionCurrentPageOnly:f,headerCheckboxSelectionFilteredOnly:$}=this.column.getColDef();if(f)return"currentPage";if($)return"filtered";return"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function r5({gos:_,selectionColSvc:f},$){let z=_.get("rowSelection"),Q=$.getColDef(),{headerCheckboxSelection:J}=Q,q=!1;if(typeof z==="object"){let Y=x0($),Z=of($);if(V1(z)==="autoGroupColumn"&&Z||Y&&f?.isSelectionColumnEnabled())q=Gz(z)}else if(typeof J==="function")q=J(C(_,{column:$,colDef:Q}));else q=!!J;return q}var VF=class extends A{postConstruct(){let{gos:_,beans:f}=this;this.selectionCtx=new RF(f.rowModel,f.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{let $=O6(_);if($!==this.isRowSelectable)this.isRowSelectable=$,this.updateSelectable()}),this.isRowSelectable=O6(_),this.addManagedEventListeners({cellValueChanged:($)=>this.updateRowSelectable($.node),rowNodeDataChanged:($)=>this.updateRowSelectable($.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new AF}createSelectAllFeature(_){if(r5(this.beans,_))return new jF(_)}isMultiSelect(){return Z$(this.gos)}onRowCtrlSelected(_,f,$){let z=!!_.rowNode.isSelected();_.forEachGui($,(Q)=>{Q.rowComp.toggleCss("ag-row-selected",z);let J=Q.element;if(l6(J,z),J.contains(d(this.beans)))f(Q)})}announceAriaRowSelection(_){if(this.isRowSelectionBlocked(_))return;let f=_.isSelected(),$=this.beans.editSvc?.isEditing({rowNode:_});if(!_.selectable||$)return;let Q=this.getLocaleTextFunc()(f?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${f?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(Q,"rowSelection")}isRowSelectionBlocked(_){return!_.selectable||_.rowPinned&&!YQ(_)||!p0(this.gos)}updateRowSelectable(_,f){let $=_.rowPinned&&_.pinnedSibling?_.pinnedSibling.selectable:this.isRowSelectable?.(_)??!0;return this.setRowSelectable(_,$,f),$}setRowSelectable(_,f,$){if(_.selectable!==f){if(_.selectable=f,_.dispatchRowEvent("selectableChanged"),$)return;if(G$(this.gos)){let Q=this.calculateSelectedFromChildren(_);this.setNodesSelected({nodes:[_],newValue:Q??!1,source:"selectableChanged"});return}if(_.isSelected()&&!_.selectable)this.setNodesSelected({nodes:[_],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(_){let f=!1,$=!1;if(!_.childrenAfterGroup?.length)return _.selectable?_.__selected:null;for(let z=0;z<_.childrenAfterGroup.length;z++){let Q=_.childrenAfterGroup[z],J=Q.isSelected();if(!Q.selectable){let q=this.calculateSelectedFromChildren(Q);if(q===null)continue;J=q}switch(J){case!0:f=!0;break;case!1:$=!0;break;default:return}}if(f&&$)return;if(f)return!0;if($)return!1;if(!_.selectable)return null;return _.__selected}selectRowNode(_,f,$,z="api"){if(f&&_.destroyed)return!1;let Q=!_.selectable&&f,J=_.__selected===f;if(Q||J)return!1;_.__selected=f,_.dispatchRowEvent("rowSelected");let q=_.sibling;if(q&&q.footer&&q.__localEventService)q.dispatchRowEvent("rowSelected");let X=_.pinnedSibling;if(X?.rowPinned&&X.__localEventService)X.dispatchRowEvent("rowSelected");return this.eventSvc.dispatchEvent({...SJ(_,this.gos,"rowSelected"),event:$||null,source:z}),!0}isCellCheckboxSelection(_,f){let $=this.gos.get("rowSelection");if($&&typeof $!=="string"){let z=x0(_)&&Zf($);return _.isColumnFunc(f,z)}else return _.isColumnFunc(f,_.colDef.checkboxSelection)}inferNodeSelections(_,f,$,z){let{gos:Q,selectionCtx:J}=this,q=_.isSelected(),X=G$(Q),Y=S7(Q),Z=A7(Q),G=this.isMultiSelect(),E=z==="rowClicked";if(E&&!(Y||Z))return null;if(f&&$&&G){let U=J.getRoot();if(!U)return null;else if(!U.isSelected()){let H=J.extend(_,X);return{select:[],deselect:H.keep,reset:!1}}else{let H=J.isInRange(_)?J.truncate(_):J.extend(_,X);return{deselect:H.discard,select:H.keep,reset:!1}}}else if(f&&G){let U=J.selectAll?this.beans.rowModel.getRow(0):void 0,H=J.getRoot(U),W=J.isInRange(_)?J.truncate(_):J.extend(_,X);return{select:W.keep,deselect:W.discard,reset:J.selectAll||!!(H&&!H.isSelected())}}else if($){if(E){let U=!q;if(U&&!Y||!U&&!Z)return null;return J.setRoot(_),{node:_,newValue:U,clearSelection:!1}}return J.setRoot(_),{node:_,newValue:!q,clearSelection:!G}}else{J.setRoot(_);let U=R7(Q),H=Sz(Q)==="filteredDescendants",W=E&&(!U||!Y);if(H&&q===void 0&&o(Q))return{node:_,newValue:!1,checkFilteredNodes:!0,clearSelection:!G||W};if(E){let B=q?!U:Y;if(B===q&&!W||B&&!Y||!B&&!Z)return null;return{node:_,newValue:B,clearSelection:!G||W,keepDescendants:_.group&&X}}return{node:_,newValue:!q,clearSelection:!G||W}}}},OF=class extends VF{constructor(){super(...arguments);this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();let{gos:_}=this;this.mode=kz(_),this.groupSelectsDescendants=G$(_),this.groupSelectsFiltered=Sz(_)==="filteredDescendants",this.masterSelectsDetail=n2(_)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{let f=G$(_),$=kz(_),z=Sz(_)==="filteredDescendants";if(this.masterSelectsDetail=n2(_)==="detail",f!==this.groupSelectsDescendants||z!==this.groupSelectsFiltered||$!==this.mode)this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=f,this.groupSelectsFiltered=z,this.mode=$}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(_,f,$){if(this.isRowSelectionBlocked(f))return 0;let z=this.inferNodeSelections(f,_.shiftKey,_.metaKey||_.ctrlKey,$);if(z==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in z){if(z.reset)this.resetNodes();else this.selectRange(z.deselect,!1,$);return this.selectRange(z.select,!0,$)}else{let Q=z.checkFilteredNodes?s5(z.node):z.newValue;return this.setNodesSelected({nodes:[z.node],newValue:Q,clearSelection:z.clearSelection,keepDescendants:z.keepDescendants,event:_,source:$})}}setNodesSelected({newValue:_,clearSelection:f,suppressFinishActions:$,nodes:z,event:Q,source:J,keepDescendants:q=!1}){if(z.length===0)return 0;let{gos:X}=this;if(!p0(X)&&_)return j(132),0;if(z.length>1&&!this.isMultiSelect())return j(130),0;let Y=0;for(let Z=0;Z0)this.updateGroupsFromChildrenSelections(J),this.dispatchSelectionChanged(J)}return Y}selectRange(_,f,$){let z=0;if(_.forEach((Q)=>{let J=Q.primaryRow;if(J.group&&this.groupSelectsDescendants)return;if(this.selectRowNode(J,f,void 0,$))z++}),z>0)this.updateGroupsFromChildrenSelections($),this.dispatchSelectionChanged($);return z}selectChildren(_,f,$){let z=this.groupSelectsFiltered?_.childrenAfterAggFilter:_.childrenAfterGroup;if(!z)return 0;return this.setNodesSelected({newValue:f,clearSelection:!1,suppressFinishActions:!0,source:$,nodes:z})}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){let _=[];return this.selectedNodes.forEach((f)=>f.data&&_.push(f.data)),_}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(_){let f=new Map;this.selectedNodes.forEach(($,z)=>{if(_($))f.set(z,$)}),this.selectedNodes=f}updateGroupsFromChildrenSelections(_,f){if(!this.groupSelectsDescendants)return!1;let{gos:$,rowModel:z}=this.beans;if(!o($,z))return!1;let Q=z.rootNode;if(!Q)return!1;let J=!1,q=(X)=>{if(X!==Q){let Y=this.calculateSelectedFromChildren(X);J=this.selectRowNode(X,Y===null?!1:Y,void 0,_)||J}};return R_(Q,this.beans.rowModel.hierarchical,f,q),J}clearOtherNodes(_,f,$){let z=new Map,Q=0;return this.selectedNodes.forEach((J)=>{let q=J.id==_.id;if((f?!vF(_,J):!0)&&!q){let Y=this.selectedNodes.get(J.id);if(Q+=this.setNodesSelected({nodes:[Y],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:$}),this.groupSelectsDescendants&&J.parent)z.set(J.parent.id,J.parent)}}),z.forEach((J)=>{let q=this.calculateSelectedFromChildren(J);this.selectRowNode(J,q===null?!1:q,void 0,$)}),Q}onRowSelected(_){let f=_.node;if(this.groupSelectsDescendants&&f.group)return;if(f.isSelected())this.selectedNodes.set(f.id,f);else this.selectedNodes.delete(f.id)}syncInRowNode(_,f){this.syncInOldRowNode(_,f),this.syncInNewRowNode(_)}createDaemonNode(_){if(!_.id)return;let f=new Df(this.beans);return f.id=_.id,f.data=_.data,f.__selected=_.__selected,f.level=_.level,f}syncInOldRowNode(_,f){if(f&&_.id!==f.id){if(this.selectedNodes.get(f.id)==_)this.selectedNodes.set(f.id,f)}}syncInNewRowNode(_){if(this.selectedNodes.has(_.id))_.__selected=!0,this.selectedNodes.set(_.id,_);else _.__selected=!1}reset(_){let f=this.getSelectionCount();if(this.resetNodes(),f)this.dispatchSelectionChanged(_)}resetNodes(){this.selectedNodes.forEach((_)=>{this.selectRowNode(_,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){let{gos:_,rowModel:f}=this.beans;if(!o(_,f))return;let $=f.getTopLevelNodes();if($===null)return;let z=[];function Q(J){for(let q=0,X=J.length;q{let q=this.selectRowNode(J.primaryRow,!1,void 0,_);z||(z=q)};if(f==="currentPage"||f==="filtered"){if(!$){e(102);return}this.getNodesToSelect(f).forEach(Q)}else this.selectedNodes.forEach(Q),this.reset(_);if(this.selectionCtx.selectAll=!1,$&&this.groupSelectsDescendants){let J=this.updateGroupsFromChildrenSelections(_);z||(z=J)}if(z)this.dispatchSelectionChanged(_)}getSelectedCounts(_){let f=0,$=0;return this.getNodesToSelect(_).forEach((z)=>{if(this.groupSelectsDescendants&&z.group)return;if(z.isSelected())f++;else if(z.selectable)$++}),{selectedCount:f,notSelectedCount:$}}getSelectAllState(_){let{selectedCount:f,notSelectedCount:$}=this.getSelectedCounts(_);return l5(f,$)??null}hasNodesToSelect(_){return this.getNodesToSelect(_).filter((f)=>f.selectable).length>0}getNodesToSelect(_){if(!this.canSelectAll())return[];let f=[],$=(Q)=>f.push(Q);if(_==="currentPage")return this.forEachNodeOnPage((Q)=>{if(!Q.group){$(Q);return}if(!Q.footer&&!Q.expanded){let J=(q)=>{$(q);let X=q.childrenAfterFilter;if(X)for(let Y=0,Z=X.length;Y{let X=this.selectRowNode(q.primaryRow,!0,void 0,z);J||(J=X)}),$.selectAll=!0,o(f)&&this.groupSelectsDescendants){let q=this.updateGroupsFromChildrenSelections(z);J||(J=q)}if(J)this.dispatchSelectionChanged(z)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(_,f,$){if(!_)_=[];if(!Array.isArray(_)){e(103);return}let z=new Set(_),Q=[];if(this.beans.rowModel.forEachNode((J)=>{if(z.has(J.id))Q.push(J)}),$)this.resetNodes();this.setNodesSelected({newValue:!0,nodes:Q,source:f})}canSelectAll(){return o(this.beans.gos)}updateSelectable(_){let{gos:f,rowModel:$}=this.beans;if(!p0(f))return;let z="selectableChanged",Q=o(f)&&this.groupSelectsDescendants,J=[];if(Q){let q=$.rootNode;if(q)R_(q,$.hierarchical,_,(X)=>{let Y=!1;for(let Z of X.childrenAfterGroup)if(Y||(Y=Z.selectable),!Z.group&&!this.updateRowSelectable(Z,!0)&&Z.isSelected())J.push(Z);this.setRowSelectable(X,Y,!0)})}else $.forEachNode((q)=>{if(!this.updateRowSelectable(q,!0)&&q.isSelected())J.push(q)});if(J.length)this.setNodesSelected({nodes:J,newValue:!1,source:z});if(!_&&Q)this.updateGroupsFromChildrenSelections?.(z)}updateSelectableAfterGrouping(_){if(this.updateSelectable(_),this.groupSelectsDescendants){if(this.updateGroupsFromChildrenSelections?.("rowGroupChanged",_))this.dispatchSelectionChanged("rowGroupChanged")}}refreshMasterNodeState(_,f){if(!this.masterSelectsDetail)return;let $=_.detailNode?.detailGridInfo?.api;if(!$)return;let z=PF($);if(_.isSelected()!==z){if(this.selectRowNode(_,z,f,"masterDetail"))this.dispatchSelectionChanged("masterDetail")}if(!z)this.detailSelection.set(_.id,new Set($.getSelectedNodes().map((J)=>J.id)))}setDetailSelectionState(_,f,$){if(!this.masterSelectsDetail)return;if(!Z$(f)){j(269);return}switch(_.isSelected()){case!0:{$.selectAll();break}case!1:{$.deselectAll();break}case void 0:{let z=this.detailSelection.get(_.id);if(z){let Q=[];for(let J of z){let q=$.getRowNode(J);if(q)Q.push(q)}$.setNodesSelected({nodes:Q,newValue:!0,source:"masterDetail"})}break}default:break}}dispatchSelectionChanged(_){this.eventSvc.dispatchEvent({type:"selectionChanged",source:_,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function PF(_){let f=0,$=0;return _.forEachNode((z)=>{if(z.isSelected())f++;else if(z.selectable)$++}),l5(f,$)}function l5(_,f){if(_===0&&f===0)return!1;if(_>0&&f>0)return;return _>0}function vF(_,f){let $=f.parent;while($){if($===_)return!0;$=$.parent}return!1}function s5(_){let f=_.isSelected()===!1,$=_.childrenAfterFilter?.some(s5)??!1;return f||$}var TF={moduleName:"SharedRowSelection",version:c,beans:[EF],css:[UF],apiFunctions:{setNodesSelected:HF,selectAll:WF,deselectAll:BF,selectAllFiltered:KF,deselectAllFiltered:LF,selectAllOnCurrentPage:FF,deselectAllOnCurrentPage:DF,getSelectedNodes:MF,getSelectedRows:kF}},a5={moduleName:"RowSelection",version:c,rowModels:["clientSide","infinite","viewport"],beans:[OF],dependsOn:[TF]},IF=class extends A{constructor(_,f){super();this.cellCtrl=_,this.staticClasses=[],this.beans=f,this.column=_.column}setComp(_){this.cellComp=_,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){let{column:_,cellComp:f}=this,$=_.colDef,z=$.cellClassRules,Q=this.getCellClassParams(_,$);D5(this.beans.expressionSvc,z===this.cellClassRules?void 0:this.cellClassRules,z,Q,(J)=>f.toggleCss(J,!0),(J)=>f.toggleCss(J,!1)),this.cellClassRules=z}applyUserStyles(){let _=this.column,f=_.colDef,$=f.cellStyle;if(!$)return;let z;if(typeof $==="function"){let Q=this.getCellClassParams(_,f);z=$(Q)}else z=$;if(z)this.cellComp.setUserStyles(z)}applyClassesFromColDef(){let{column:_,cellComp:f}=this,$=_.colDef,z=this.getCellClassParams(_,$);for(let J of this.staticClasses)f.toggleCss(J,!1);let Q=this.beans.cellStyles.getStaticCellClasses($,z);this.staticClasses=Q;for(let J of Q)f.toggleCss(J,!0)}getCellClassParams(_,f){let{value:$,rowNode:z}=this.cellCtrl;return C(this.beans.gos,{value:$,data:z.data,node:z,colDef:f,column:_,rowIndex:z.rowIndex})}},yF=class extends A{constructor(){super(...arguments);this.beanName="cellStyles"}processAllCellClasses(_,f,$,z){D5(this.beans.expressionSvc,void 0,_.cellClassRules,f,$,z),this.processStaticCellClasses(_,f,$)}getStaticCellClasses(_,f){let{cellClass:$}=_;if(!$)return[];let z;if(typeof $==="function")z=$(f);else z=$;if(typeof z==="string")z=[z];return z||[]}createCellCustomStyleFeature(_){return new IF(_,this.beans)}processStaticCellClasses(_,f,$){this.getStaticCellClasses(_,f).forEach((Q)=>{$(Q)})}},o5={moduleName:"CellStyle",version:c,beans:[yF]};var bF={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,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,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,overlayComponent:!0,suppressOverlays:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,groupLockGroupColumns:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!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,renderingMode:!0,columnMenu:!0,suppressSetFilterByDefault:!0,getDataPath:!0,enableCellSpan:!0,enableFilterHandlers:!0,filterHandlers:!0},h_="clientSide",b_="serverSide",U1="infinite",CF={onGroupExpandedOrCollapsed:[h_],refreshClientSideRowModel:[h_],isRowDataEmpty:[h_],forEachLeafNode:[h_],forEachNodeAfterFilter:[h_],forEachNodeAfterFilterAndSort:[h_],resetRowHeights:[h_,b_],applyTransaction:[h_],applyTransactionAsync:[h_],flushAsyncTransactions:[h_],getBestCostNodeSelection:[h_],getServerSideSelectionState:[b_],setServerSideSelectionState:[b_],applyServerSideTransaction:[b_],applyServerSideTransactionAsync:[b_],applyServerSideRowData:[b_],retryServerSideLoads:[b_],flushServerSideAsyncTransactions:[b_],refreshServerSide:[b_],getServerSideGroupLevelState:[b_],refreshInfiniteCache:[U1],purgeInfiniteCache:[U1],getInfiniteRowCount:[U1],isLastRowIndexKnown:[U1,b_],expandAll:[h_,b_],collapseAll:[h_,b_],onRowHeightChanged:[h_,b_],setRowCount:[U1,b_],getCacheBlockState:[U1,b_]},wF={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};function xF(_,f,$){let z=wF[_];if(z){let{version:J,new:q,old:X,message:Y}=z,Z=X??_;return(...G)=>{let E=q?`Please use ${q} instead. `:"";return Yf(`Since ${J} api.${Z} is deprecated. ${E}${Y??""}`),f.apply(f,G)}}let Q=CF[_];if(Q)return(...J)=>{let q=$.rowModel.getType();if(!Q.includes(q)){M1(`api.${_} can only be called when gridOptions.rowModelType is ${Q.join(" or ")}`);return}return f.apply(f,J)};return f}var NF={detailCellRendererCtrl:"SharedMasterDetail",dndSourceComp:"DragAndDrop",fillHandle:"CellSelection",groupCellRendererCtrl:"GroupCellRenderer",headerFilterCellCtrl:"ColumnFilter",headerGroupCellCtrl:"ColumnGroup",rangeHandle:"CellSelection",tooltipFeature:"Tooltip",highlightTooltipFeature:"Tooltip",tooltipStateManager:"Tooltip",groupStrategy:"RowGrouping",treeGroupStrategy:"TreeData",rowNumberRowResizer:"RowNumbers",singleCell:"EditCore",fullRow:"EditCore",agSetColumnFilterHandler:"SetFilter",agMultiColumnFilterHandler:"MultiFilter",agGroupColumnFilterHandler:"GroupFilter",agNumberColumnFilterHandler:"NumberFilter",agBigIntColumnFilterHandler:"BigIntFilter",agDateColumnFilterHandler:"DateFilter",agTextColumnFilterHandler:"TextFilter"},gF={expanded:1,contracted:1,"tree-closed":1,"tree-open":1,"tree-indeterminate":1,pin:1,"eye-slash":1,arrows:1,left:1,right:1,group:1,aggregation:1,pivot:1,"not-allowed":1,chart:1,cross:1,cancel:1,tick:1,first:1,previous:1,next:1,last:1,linked:1,unlinked:1,"color-picker":1,loading:1,menu:1,"menu-alt":1,filter:1,"filter-add":1,columns:1,maximize:1,minimize:1,copy:1,cut:1,paste:1,grip:1,save:1,csv:1,excel:1,"small-down":1,"small-left":1,"small-right":1,"small-up":1,asc:1,desc:1,aasc:1,adesc:1,none:1,up:1,down:1,plus:1,minus:1,settings:1,"checkbox-checked":1,"checkbox-indeterminate":1,"checkbox-unchecked":1,"radio-button-on":1,"radio-button-off":1,eye:1,"column-arrow":1,"un-pin":1,"pinned-top":1,"pinned-bottom":1,"chevron-up":1,"chevron-down":1,"chevron-left":1,"chevron-right":1,edit:1},hF={chart:"MenuCore",cancel:"EnterpriseCore",first:"Pagination",previous:"Pagination",next:"Pagination",last:"Pagination",linked:"IntegratedCharts",loadingMenuItems:"MenuCore",unlinked:"IntegratedCharts",menu:"ColumnHeaderComp",legacyMenu:"ColumnMenu",filter:"ColumnFilter",filterActive:"ColumnFilter",filterAdd:"NewFiltersToolPanel",filterCardCollapse:"NewFiltersToolPanel",filterCardExpand:"NewFiltersToolPanel",filterCardEditing:"NewFiltersToolPanel",filterTab:"ColumnMenu",filtersToolPanel:"FiltersToolPanel",columns:["MenuCore"],columnsToolPanel:["ColumnsToolPanel"],maximize:"EnterpriseCore",minimize:"EnterpriseCore",save:"MenuCore",columnGroupOpened:"ColumnGroupHeaderComp",columnGroupClosed:"ColumnGroupHeaderComp",accordionOpen:"EnterpriseCore",accordionClosed:"EnterpriseCore",accordionIndeterminate:"EnterpriseCore",columnSelectClosed:["ColumnsToolPanel","ColumnMenu"],columnSelectOpen:["ColumnsToolPanel","ColumnMenu"],columnSelectIndeterminate:["ColumnsToolPanel","ColumnMenu"],columnMovePin:"SharedDragAndDrop",columnMoveHide:"SharedDragAndDrop",columnMoveMove:"SharedDragAndDrop",columnMoveLeft:"SharedDragAndDrop",columnMoveRight:"SharedDragAndDrop",columnMoveGroup:"SharedDragAndDrop",columnMoveValue:"SharedDragAndDrop",columnMovePivot:"SharedDragAndDrop",dropNotAllowed:"SharedDragAndDrop",ensureColumnVisible:["ColumnsToolPanel","ColumnMenu"],groupContracted:"GroupCellRenderer",groupExpanded:"GroupCellRenderer",setFilterGroupClosed:"SetFilter",setFilterGroupOpen:"SetFilter",setFilterGroupIndeterminate:"SetFilter",setFilterLoading:"SetFilter",close:"EnterpriseCore",check:"MenuItem",colorPicker:"CommunityCore",groupLoading:"LoadingCellRenderer",overlayLoading:"Overlay",overlayExporting:"Overlay",menuAlt:"ColumnHeaderComp",menuPin:"MenuCore",menuValue:"MenuCore",menuAddRowGroup:["MenuCore","ColumnsToolPanel"],menuRemoveRowGroup:["MenuCore","ColumnsToolPanel"],clipboardCopy:"MenuCore",clipboardCut:"MenuCore",clipboardPaste:"MenuCore",pivotPanel:["ColumnsToolPanel","RowGroupingPanel"],rowGroupPanel:["ColumnsToolPanel","RowGroupingPanel"],valuePanel:"ColumnsToolPanel",columnDrag:"EnterpriseCore",rowDrag:["RowDrag","DragAndDrop"],csvExport:"MenuCore",excelExport:"MenuCore",smallDown:"CommunityCore",selectOpen:"CommunityCore",richSelectOpen:"RichSelect",richSelectRemove:"RichSelect",richSelectLoading:"RichSelect",smallLeft:"CommunityCore",smallRight:"CommunityCore",subMenuOpen:"MenuItem",subMenuOpenRtl:"MenuItem",panelDelimiter:"RowGroupingPanel",panelDelimiterRtl:"RowGroupingPanel",smallUp:"CommunityCore",sortAscending:["MenuCore","Sort"],sortDescending:["MenuCore","Sort"],sortAbsoluteAscending:["MenuCore","Sort"],sortAbsoluteDescending:["MenuCore","Sort"],sortUnSort:["MenuCore","Sort"],advancedFilterBuilder:"AdvancedFilter",advancedFilterBuilderDrag:"AdvancedFilter",advancedFilterBuilderInvalid:"AdvancedFilter",advancedFilterBuilderMoveUp:"AdvancedFilter",advancedFilterBuilderMoveDown:"AdvancedFilter",advancedFilterBuilderAdd:"AdvancedFilter",advancedFilterBuilderRemove:"AdvancedFilter",advancedFilterBuilderSelectOpen:"AdvancedFilter",chartsMenu:"IntegratedCharts",chartsMenuEdit:"IntegratedCharts",chartsMenuAdvancedSettings:"IntegratedCharts",chartsMenuAdd:"IntegratedCharts",chartsColorPicker:"IntegratedCharts",chartsThemePrevious:"IntegratedCharts",chartsThemeNext:"IntegratedCharts",chartsDownload:"IntegratedCharts",checkboxChecked:"CommunityCore",checkboxIndeterminate:"CommunityCore",checkboxUnchecked:"CommunityCore",radioButtonOn:"CommunityCore",radioButtonOff:"CommunityCore",rowPin:"PinnedRow",rowUnpin:"PinnedRow",rowPinBottom:"PinnedRow",rowPinTop:"PinnedRow"},uF=new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),iF=class extends A{constructor(){super(...arguments);this.beanName="validation"}wireBeans(_){this.gridOptions=_.gridOptions,G7(c3)}warnOnInitialPropertyUpdate(_,f){if(_==="api"&&bF[f])j(22,{key:f})}processGridOptions(_){this.processOptions(_,hW())}validateApiFunction(_,f){return xF(_,f,this.beans)}missingUserComponent(_,f,$,z){let Q=j1[f];if(Q)this.gos.assertModuleRegistered(Q,`AG Grid '${_}' component: ${f}`);else j(101,{propertyName:_,componentName:f,agGridDefaults:$,jsComps:z})}missingDynamicBean(_){let f=NF[_];return f?$0(200,{...this.gos.getModuleErrorParams(),moduleName:f,reasonOrId:_}):void 0}checkRowEvents(_){if(cF.has(_))j(10,{eventType:_})}validateIcon(_){if(uF.has(_))j(43,{iconName:_});if(gF[_])return;let f=hF[_];if(f){e(200,{reasonOrId:`icon '${_}'`,moduleName:f,gridScoped:QJ(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."});return}j(134,{iconName:_})}isProvidedUserComp(_){return!!j1[_]}validateColDef(_){this.processOptions(_,PW())}processOptions(_,f){let{validations:$,deprecations:z,allProperties:Q,propertyExceptions:J,objectName:q,docsUrl:X}=f;if(Q&&this.gridOptions.suppressPropertyNamesCheck!==!0)this.checkProperties(_,[...J??[],...Object.keys(z)],Q,q,X);let Y=new Set;if(Object.keys(_).forEach((G)=>{let E=z[G];if(E){let{message:F,version:D}=E;Y.add(`As of v${D}, ${String(G)} is deprecated. ${F??""}`)}let U=_[G];if(U==null||U===!1)return;let H=$[G];if(!H)return;let{dependencies:W,validate:B,supportedRowModels:K,expectedType:L}=H;if(L){let F=typeof U;if(F!==L){Y.add(`${String(G)} should be of type '${L}' but received '${F}' (${U}).`);return}}if(K){let F=this.gridOptions.rowModelType??"clientSide";if(!K.includes(F)){Y.add(`${String(G)} is not supported with the '${F}' row model. It is only valid with: ${K.join(", ")}.`);return}}if(W){let F=this.checkForRequiredDependencies(G,W,_);if(F){Y.add(F);return}}if(B){let F=B(_,this.gridOptions,this.beans);if(F){Y.add(F);return}}}),Y.size>0)for(let G of Y)Yf(G)}checkForRequiredDependencies(_,f,$){let Q=Object.entries(f).filter(([J,q])=>{let X=$[J];return!q.required.includes(X)});if(Q.length===0)return null;return Q.map(([J,q])=>`'${String(_)}' requires '${J}' to be one of [${q.required.map((X)=>{if(X===null)return"null";else if(X===void 0)return"undefined";return X}).join(", ")}]. ${q.reason??""}`).join(` - `)}checkProperties(_,f,$,z,Q){let J=["__ob__","__v_skip","__metadata__"],q=mF(Object.getOwnPropertyNames(_),[...J,...f,...$],$),X=Object.keys(q);for(let Y of X){let Z=q[Y],G=`invalid ${z} property '${Y}' did you mean any of these: ${Z.slice(0,8).join(", ")}.`;if($.includes("context"))G+=` -If you are trying to annotate ${z} with application data, use the '${z}.context' property instead.`;Yf(G)}if(X.length>0&&Q){let Y=this.beans.frameworkOverrides.getDocLink(Q);Yf(`to see all the valid ${z} properties please check: ${Y}`)}}};function mF(_,f,$){let z={},Q=_.filter((J)=>!f.some((q)=>q===J));if(Q.length>0)for(let J of Q)z[J]=i6({inputValue:J,allSuggestions:$}).values;return z}var cF=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),e5={moduleName:"Validation",version:c,beans:[iF]};var x1=class extends A{constructor(){super(...arguments);this.dispatchColumnChangedEvent=dX,this.columns=[],this.columnIndexMap={},this.updateIndexMap=()=>{this.columnIndexMap={},this.columns.forEach((_,f)=>this.columnIndexMap[_.getId()]=f)}}wireBeans(_){this.colModel=_.colModel,this.aggFuncSvc=_.aggFuncSvc,this.visibleCols=_.visibleCols,this.groupHierarchCols=_.groupHierarchyColSvc}sortColumns(_){let{groupHierarchCols:f}=this;this.columns.sort(($,z)=>f?.compareVirtualColumns($,z)??_($,z)),this.updateIndexMap()}setColumns(_,f){this.setColList(_,this.columns,this.eventName,!0,!0,this.columnProcessors.set,f)}addColumns(_,f){this.updateColList(_,this.columns,!0,!0,this.columnProcessors.add,this.eventName,f)}removeColumns(_,f){this.updateColList(_,this.columns,!1,!0,this.columnProcessors.remove,this.eventName,f)}getColumnIndex(_){return this.columnIndexMap[_]}setColList(_=[],f,$,z,Q,J,q){let X=this.colModel.getCols();if(!X||X.length===0)return;let Y=new Map;f.forEach((G,E)=>Y.set(G,E)),f.length=0;for(let G of _){let E=this.colModel.getColDefCol(G);if(E)f.push(E)}f.forEach((G,E)=>{let U=Y.get(G);if(U===void 0){Y.set(G,0);return}if(z&&U!==E)return;Y.delete(G)}),this.updateIndexMap();let Z=this.colModel.getColDefCols();for(let G of Z??[]){let E=f.indexOf(G)>=0;J(G,E,q)}if(Q)this.colModel.refreshCols(!1,q);this.visibleCols.refresh(q),this.dispatchColumnChangedEvent(this.eventSvc,$,[...Y.keys()],q)}updateColList(_=[],f,$,z,Q,J,q){if(!_||_.length===0)return;let X=!1,Y=new Set;for(let G of _){if(!G)continue;let E=this.colModel.getColDefCol(G);if(!E)continue;if(Y.add(E),$){if(f.indexOf(E)>=0)continue;f.push(E)}else{let U=f.indexOf(E);if(U<0)continue;for(let H=U+1;H=0;else if(K)if(T)R=D;else if(y)R=k!=null&&k>=0;else R=!1;else R=$.indexOf(B)>=0;if(R)if(K?M!=null||k!=null:M!=null)z.push(B);else Q.push(B)}let E=(B)=>{let K=B.getColDef();return q(K)??X(K)};z.sort((B,K)=>E(B)-E(K));let U=[],H=this.groupHierarchCols,W=(B)=>{if(H)H.expandColumnInto(U,B);else U.push(B)};z.forEach(W);for(let B of $)if(Q.indexOf(B)>=0)W(B);for(let B of Q)if(U.indexOf(B)<0)W(B);for(let B of $)if(U.indexOf(B)<0)J(B,!1,_);for(let B of U)if($.indexOf(B)<0)J(B,!0,_);return this.columns=U,this.updateIndexMap(),this.columns}restoreColumnOrder(_,f){let $=this.columns,z=this.colModel.getColDefCols();if(!$.length||!z)return _;let Q=Object.keys(f),J=new Set(Q),q=new Set(Q),X=new Set($.map((D)=>{let M=D.getColId();return q.delete(M),M}).concat(Q)),Y=[],Z={},G=0;for(let D=0;D{let M=Z[D];for(let k=H;k>>32-Q,$)}ff(_,f,$,z,Q,J,q){return this.cmn(f&$|~f&z,_,f,Q,J,q)}gg(_,f,$,z,Q,J,q){return this.cmn(f&z|$&~z,_,f,Q,J,q)}hh(_,f,$,z,Q,J,q){return this.cmn(f^$^z,_,f,Q,J,q)}ii(_,f,$,z,Q,J,q){return this.cmn($^(f|~z),_,f,Q,J,q)}md51(_){let f=_.length,$=[1732584193,-271733879,-1732584194,271733878],z;for(z=64;z<=_.length;z+=64)this.md5cycle($,this.md5blk(_.substring(z-64,z)));_=_.substring(z-64);let Q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(z=0;z<_.length;z++)Q[z>>2]|=_.charCodeAt(z)<<(z%4<<3);if(Q[z>>2]|=128<<(z%4<<3),z>55){this.md5cycle($,Q);for(z=0;z<16;z++)Q[z]=0}return Q[14]=f*8,this.md5cycle($,Q),$}md5blk(_){let f=[];for(let $=0;$<64;$+=4)f[$>>2]=_.charCodeAt($)+(_.charCodeAt($+1)<<8)+(_.charCodeAt($+2)<<16)+(_.charCodeAt($+3)<<24);return f}rhex(_){let f="0123456789abcdef".split(""),$="",z=0;for(;z<4;z++)$+=f[_>>z*8+4&15]+f[_>>z*8&15];return $}hex(_){for(let f=0;f<_.length;f++)_[f]=this.rhex(_[f]);return _.join("")}md5(_){return this.hex(this.md51(_))}add32(_,f){return this.ieCompatibility?this.add32Compat(_,f):this.add32Std(_,f)}add32Std(_,f){return _+f&4294967295}add32Compat(_,f){let $=(_&65535)+(f&65535);return(_>>16)+(f>>16)+($>>16)<<16|$&65535}},HQ={"01":"GRID","02":"CHARTS","0102":"BOTH"};var gY=class _{constructor(f){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=f,this.md5=new nF,this.md5.init()}validateLicense(){let f=this.getLicenseDetails(_.licenseKey),$=`AG Grid ${f.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,z=f.suppliedLicenseType===void 0?"":`AG ${f.suppliedLicenseType==="BOTH"?"Grid and AG Charts":f.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(f.missing){if(!this.isWebsiteUrl()||this.isForceWatermark())this.outputMissingLicenseKey($)}else if(f.expired){let Q=_.getGridReleaseDate(),J=_.formatDate(Q);this.outputExpiredKey(f.expiry,J,$,z)}else if(!f.valid)this.outputInvalidLicenseKey(!!f.incorrectLicenseType,$,z);else if(f.isTrial&&f.trialExpired)this.outputExpiredTrialKey(f.expiry,$,z)}static extractExpiry(f){let $=f.substring(f.lastIndexOf("_")+1,f.length);return new Date(parseInt(_.decode($),10))}static extractLicenseComponents(f){let $=f.replace(/[\u200B-\u200D\uFEFF]/g,"");if($=$.replace(/\r?\n|\r/g,""),f.length<=32)return{md5:null,license:f,version:null,isTrial:null};let z=$.length-32,Q=$.substring(z),J=$.substring(0,z),[q,X,Y]=_.extractBracketedInformation($);return{md5:Q,license:J,version:q,isTrial:X,type:Y}}getLicenseDetails(f){let $=_.chartsLicenseManager?"BOTH":"GRID";if(!f?.length)return{licenseKey:f,valid:!1,missing:!0,currentLicenseType:$};let z=_.getGridReleaseDate(),{md5:Q,license:J,version:q,isTrial:X,type:Y}=_.extractLicenseComponents(f),Z=Q===this.md5.md5(J)&&!f.includes("For_Trialing_ag-Grid_Only"),G=void 0,E=void 0,U=null,H=!1,W=void 0;function B(){G=UU,q){case"legacy":case"2":{if(X)B();break}case"3":if(!Y?.length)Z=!1;else if(W=Y,Y!==HQ["01"]&&Y!==HQ["0102"]||$==="BOTH"&&W!=="BOTH")Z=!1,H=!0;else if(X)B()}}if(!Z)return{licenseKey:f,valid:Z,incorrectLicenseType:H,currentLicenseType:$,suppliedLicenseType:W};return{licenseKey:f,valid:Z,expiry:_.formatDate(U),expired:E,version:q,isTrial:X,trialExpired:G,incorrectLicenseType:H,currentLicenseType:$,suppliedLicenseType:W}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){let $=(this.document.defaultView||window).location,{hostname:z=""}=$;return z}isForceWatermark(){let $=(this.document.defaultView||window).location,{pathname:z}=$;return z?z.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(f){let $=["January","February","March","April","May","June","July","August","September","October","November","December"],z=f.getDate(),Q=f.getMonth(),J=f.getFullYear();return z+" "+$[Q]+" "+J}static getGridReleaseDate(){return new Date(parseInt(_.decode(_.RELEASE_INFORMATION),10))}static decode(f){let z="",Q,J,q,X,Y,Z,G,E=0,U=f.replace(/[^A-Za-z0-9+/=]/g,"");while(E>4,J=(Y&15)<<4|Z>>2,q=(Z&3)<<6|G,z=z+String.fromCharCode(Q),Z!=64)z=z+String.fromCharCode(J);if(G!=64)z=z+String.fromCharCode(q)}return z=_.utf8_decode(z),z}static utf8_decode(f){f=f.replace(/rn/g,"n");let $="";for(let z=0;z127&&Q<2048)$+=String.fromCharCode(Q>>6|192),$+=String.fromCharCode(Q&63|128);else $+=String.fromCharCode(Q>>12|224),$+=String.fromCharCode(Q>>6&63|128),$+=String.fromCharCode(Q&63|128)}return $}static setChartsLicenseManager(f){this.chartsLicenseManager=f,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(f){if(v(this.licenseKey)&&this.licenseKey!==f)vq(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used.");this.licenseKey=f,this.chartsLicenseManager?.setLicenseKey(f,!0)}static extractBracketedInformation(f){if(!f.includes("["))return["legacy",!1,void 0];let $=f.match(/\[(.*?)\]/g).map((X)=>X.replace("[","").replace("]",""));if(!$||$.length===0)return["legacy",!1,void 0];let z=$.filter((X)=>X==="TRIAL").length===1,Q=$.filter((X)=>X.indexOf("v")===0)[0],J=Q?Q.replace("v",""):"legacy",q=HQ[$.filter((X)=>HQ[X])[0]];return[J,z,q]}centerPadAndOutput(f){let $=this.totalMessageLength-f.length}padAndOutput(f,$="*",z=""){}outputInvalidLicenseKey(f,$,z){}outputExpiredTrialKey(f,$,z){}outputMissingLicenseKey(f){}outputExpiredKey(f,$,z,Q){}};gY.RELEASE_INFORMATION="MTc3NDQyNTc0Nzc3NQ==";var WQ=gY,dF='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',tF={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},rF=class extends w{constructor(){super(tF);this.eLicenseTextRef=V,this.registerCSS(dF)}wireBeans(_){this.licenseManager=_.licenseManager}postConstruct(){let _=this.shouldDisplayWatermark();if(this.setDisplayed(_),_)this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5000)}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},lF={selector:"AG-WATERMARK",component:rF},fY=class extends A{constructor(){super(...arguments);this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){let _=this.beans;if(_.withinStudio)this.licenseManager={isDisplayWatermark:()=>!1,getWatermarkMessage:()=>""};else{let f=new WQ(q_(_));this.licenseManager=f,f.validateLicense()}}static getLicenseDetails(_){return new WQ(null).getLicenseDetails(_)}getWatermarkSelector(){return lF}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(_){WQ.setLicenseKey(_)}static setChartsLicenseManager(_){WQ.setChartsLicenseManager(_)}},sF=9525,$Y={"0":1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},BQ=`\r -`;function zY(_,f,$){if(!f&&f!==""&&f!==0)return"";let z=f;if(typeof f==="boolean"){if($)z=$(f)}return` ${_}="${z}"`}function aF(_={}){let z=["version"];if(!_.version)_.version="1.0";if(_.encoding)z.push("encoding");if(_.standalone)z.push("standalone");return``${J}="${_[J]}"`).join(" ")} ?>`}function hY(_,f){let $="";if(_.properties){if(_.properties.prefixedAttributes)_.properties.prefixedAttributes.forEach((Q)=>{for(let J of Object.keys(Q.map))$+=zY(Q.prefix+J,Q.map[J],f)});if(_.properties.rawMap)for(let Q of Object.keys(_.properties.rawMap))$+=zY(Q,_.properties.rawMap[Q],f)}let z="<"+_.name+$;if(!_.children&&_.textNode==null)return z+"/>"+BQ;if(_.textNode!=null)return z+">"+_.textNode+""+BQ;if(z+=">"+BQ,_.children)for(let Q of _.children)z+=hY(Q,f);return z+""+BQ}var oF=(_)=>{return Math.round(_*96/72)},N1=(_)=>{return Math.ceil(_*sF)},eF=(_)=>{if(_===void 0)return;let $=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(_||"Automatic");return Math.max($,0)},MQ=(_,f)=>{if(!f)return;let $;if(typeof f==="number")$=f;else $=f({rowIndex:_});return $},_D=(_,f)=>{let{colSpan:$,column:z}=_.position;if(!_.width)return;if($){let Q=f.slice(z-1,z+$-1),J=0;for(let q=0;q{let{rowSpan:$,row:z}=_.position;if(!_.height)return;if($){let Q=0,J=0;for(let q=z;q{let $=aF({encoding:"UTF-8",standalone:"yes"}),z=hY(_);if(f)return z;return`${$}${z}`},Y1=(_)=>{let z=String.fromCharCode,Q=Math.floor(_/26),J=_%26;if(!Q||_===26)return z(65+_-1);if(!J)return Y1(Q-1)+"Z";if(Q<26)return z(65+Q-1)+z(65+J-1);return Y1(Q)+z(65+J-1)},$D=(_)=>{return _.replaceAll(` -`,"_x000a_")},jQ=(_)=>{if(_==null)return null;let f="";for(let $=0;$<_.length;$++){let z=_.charCodeAt($);if(z>=0&&z<=31&&z!==10){let q=`_x${z.toString(16).toUpperCase().padStart(4,"0")}_`;f+=q}else f+=_[$]}return f},zD=(_)=>{let f=[];for(let $ of _.keys()){let z=$.toString(),Q={name:"t",textNode:U_(jQ(z))};if(z.trim().length!==z.length)Q.properties={rawMap:{"xml:space":"preserve"}};f.push({name:"si",children:[Q]})}return f},QD=class extends aJ{constructor(_){super(_);this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=_.formulaSvc,this.config=Object.assign({},_),this.workbook=_.workbook,this.stylesByIds={};for(let $ of this.config.baseExcelStyles)this.stylesByIds[$.id]=$;let f={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[f.id]=f,this.excelStyles=[...this.config.baseExcelStyles,f]}addCustomContent(_){for(let f of _){let $=this.rows.length+1,z;if(!this.config.suppressRowOutline&&f.outlineLevel!=null)z=f.outlineLevel;let Q={height:MQ($,f.height||this.config.rowHeight),cells:(f.cells||[]).map((J,q)=>{let X=this.addImage($,this.columnsToExport[q],J.data?.value),Y=null;if(J.styleId)Y=typeof J.styleId==="string"?[J.styleId]:J.styleId;let Z=this.getStyleId(Y);if(X)return this.createCell(Z,this.getDataTypeForValue(X.value),X.value==null?"":X.value);let G=J.data?.value??"",E=this.getDataTypeForValue(G);if(J.mergeAcross)return this.createMergedCell(Z,E,G,J.mergeAcross);return this.createCell(Z,E,G)}),outlineLevel:z};if(f.collapsed!=null)Q.collapsed=f.collapsed;if(f.hidden!=null)Q.hidden=f.hidden;this.rows.push(Q)}}onNewHeaderGroupingRow(){let _=[],{freezeRows:f,headerRowHeight:$}=this.config;if(this.rows.push({cells:_,height:MQ(this.rows.length+1,$)}),f)this.frozenRowCount++;return{onColumn:(z,Q,J,q,X)=>{let Y=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${Q}`,columnGroup:z});_.push({...this.createMergedCell(this.getStyleId(Y),this.getDataTypeForValue("string"),Q,q),collapsibleRanges:X})}}}onNewHeaderRow(){let{freezeRows:_,headerRowHeight:f}=this.config;if(_)this.frozenRowCount++;return this.onNewRow(this.onNewHeaderColumn,f)}onNewBodyRow(_){let{freezeRows:f,rowHeight:$}=this.config;if(!this.skipFrozenRows)if(f==="headersAndPinnedRows"&&_?.rowPinned==="top")this.frozenRowCount++;else if(typeof f==="function")if(f(C(this.gos,{node:_})))this.frozenRowCount++;else this.skipFrozenRows=!0;else this.skipFrozenRows=!0;let z=this.onNewRow(this.onNewBodyColumn,$);if(_)this.addRowOutlineIfNecessary(_);return z}prepare(_){super.prepare(_),this.columnsToExport=[..._],this.cols=_.map((f,$)=>this.convertColumnToExcel(f,$))}parse(){let _=this.rows.reduce(($,z)=>Math.max($,z.cells.length),0);while(this.cols.length<_)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));let f=this.createWorksheet();return this.addWorksheetToWorkbook(f)}createWorksheet(){let{sheetName:_}=this.config,f;if(_!=null){let $=typeof _==="function"?_(C(this.gos,{})):_;f=String($).substring(0,31)}else f="ag-grid";return{name:f,table:{columns:this.cols,rows:this.rows}}}addRowOutlineIfNecessary(_){let{gos:f,suppressRowOutline:$,rowGroupExpandState:z="expanded"}=this.config;if(f.get("groupHideOpenParents")||$||_.level==null)return;let J=_.footer?1:0,q=b(this.rows);if(_.uiLevel==null||_.level===_.uiLevel){let Y=Math.min(_.level+J,7);q.outlineLevel=Y}if(z==="expanded")return;let X=z==="collapsed";if(_.isExpandable()){let Y=!X&&_.expanded;q.collapsed=!Y}q.hidden=!!_.parent&&_.parent.level!==-1&&(X||this.isAnyParentCollapsed(_.parent))}isAnyParentCollapsed(_){while(_&&_.level!==-1){if(!_.expanded)return!0;_=_.parent}return!1}convertColumnToExcel(_,f){let $=this.config.columnWidth,Q=(_?this.extractHeaderValue(_):void 0)??"",J=_?_.isFilterAllowed():!1;if($){if(typeof $==="number")return{width:$,displayName:Q,filterAllowed:J};return{width:$({column:_,index:f}),displayName:Q,filterAllowed:J}}if(_)return{width:Math.max(_.getActualWidth(),75),displayName:Q,filterAllowed:J};return{displayName:Q,filterAllowed:J}}onNewHeaderColumn(_,f){return($)=>{let z=this.extractHeaderValue($),Q=this.config.styleLinker({rowType:"HEADER",rowIndex:_,value:z,column:$});f.push(this.createCell(this.getStyleId(Q),this.getDataTypeForValue("string"),z))}}onNewBodyColumn(_,f){let $=0,{freezeColumns:z,rightToLeft:Q}=this.config;return(J,q,X)=>{if($>0){$-=1;return}if(!this.skipFrozenColumns){let K=J.getPinned();if(z==="pinned"&&K&&(K===!0||K==="left")!==Q)this.frozenColumnCount++;else if(typeof z==="function"&&z(C(this.gos,{column:J})))this.frozenColumnCount++;else this.skipFrozenColumns=!0}let{value:Y,valueFormatted:Z}=this.extractRowCellValue({column:J,node:X,currentColumnIndex:q,accumulatedRowIndex:_,type:"excel",useRawFormula:!0}),G=Y,E=typeof G==="bigint"?G.toString():G,U=this.config.styleLinker({rowType:"BODY",rowIndex:_,value:G,column:J,node:X}),H=this.getStyleId(U),W=J.getColSpan(X),B=this.addImage(_,J,E);if(B)f.push(this.createCell(H,this.getDataTypeForValue(B.value),B.value==null?"":B.value));else if(W>1)$=W-1,f.push(this.createMergedCell(H,this.getDataTypeForValue(G),E,W-1));else{let K=J.isAllowFormula()&&this.formulaSvc?.isFormula(E),L=this.createCell(H,K?"f":this.getDataTypeForValue(G),K?this.formulaSvc?.updateFormulaByOffset({value:E,rowDelta:_-(X.formulaRowIndex+1),useRefFormat:!1}):E,Z);f.push(L)}}}onNewRow(_,f){let $=[];return this.rows.push({cells:$,height:MQ(this.rows.length+1,f)}),{onColumn:_.bind(this,this.rows.length,$)()}}addWorksheetToWorkbook(_){let{excelStyles:f,config:$}=this;if(this.mapSharedStrings(_),this.frozenColumnCount)$.frozenColumnCount=this.frozenColumnCount;if(this.frozenRowCount)$.frozenRowCount=this.frozenRowCount;return this.workbook.addWorksheet(f,_,$)}mapSharedStrings(_){let f;for(let $ of _.table.rows)for(let z of $.cells){let Q=z.data;if(!Q||Q.type!=="s")continue;let J=Q.value;if(J==null)continue;if(J===""){f??(f=this.workbook.getStringPosition("").toString()),Q.value=f;continue}Q.value=this.workbook.getStringPosition(String(J)).toString()}}getDataTypeForValue(_){if(_===void 0)return"empty";let f="s";try{if(this.isNumerical(_))f="n"}catch($){}return f}getTypeFromStyle(_,f){if(this.isFormula(f))return"f";if(_?.dataType)switch(_.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:j(162,{id:_.id,dataType:_.dataType})}return null}addImage(_,f,$){if(!this.config.addImageToCell)return;let z=this.config.addImageToCell(_,f,$);if(!z)return;return this.workbook.addBodyImageToMap(z.image,_,f,this.columnsToExport,this.config.rowHeight),z}createCell(_,f,$,z){let Q=this.getStyleById(_);if(!Q?.dataType&&f==="s"&&z!=null)$=z;let J=this.getTypeFromStyle(Q,$)||f,{value:q,escaped:X}=this.getCellValue(J,$),Y=[];if(Q)Y.push(_);if(X)Y.push("_quotePrefix");return _=this.getStyleId(Y)||void 0,{styleId:_,data:{type:J,value:q}}}createMergedCell(_,f,$,z){let Q=$==null?"":$;return{styleId:this.getStyleById(_)?_:void 0,data:{type:f,value:f==="s"?String(Q):$},mergeAcross:z}}getCellValue(_,f){let $=!1;if(f==null||_==="s"&&f==="")return{value:"",escaped:!1};if(_==="s"){if(f=String(f),f[0]==="'")$=!0,f=f.slice(1)}else if(_==="f")f=this.addXlfnPrefix(f).slice(1);else if(_==="n"){let z=Number(f);if(isNaN(z))f="";else if(f!=="")f=z.toString()}return{value:f,escaped:$}}addXlfnPrefix(_){if(!_)return _;let f=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return _.replace(f,($,z,Q,J)=>`${z}_xlfn.${Q}${J}`)}getStyleId(_){if(!_?.length)return null;let f=_.filter((z)=>this.stylesByIds[z]!=null);if(!f.length)return null;if(f.length===1)return f[0];let $=f.join("-");if(!this.mixedStyles[$])this.addNewMixedStyle(f);return this.mixedStyles[$].excelID}addNewMixedStyle(_){this.mixedStyleCounter+=1;let f=`mixedStyle${this.mixedStyleCounter}`,$={};for(let Q of _){let J=this.stylesByIds[Q];if(J)H_($,J,!0,!0)}$.id=f;let z=_.join("-");this.mixedStyles[z]={excelID:f,key:z,result:$},this.excelStyles.push($),this.stylesByIds[f]=$}isFormula(_){if(_==null)return!1;let f=String(_);return this.config.autoConvertFormulas&&Kz(f)}isNumerical(_){if(typeof _==="bigint")return!1;return isFinite(_)&&_!==""&&!isNaN(parseFloat(_))}getStyleById(_){if(_==null)return null;return this.stylesByIds[_]||null}},JD={getTemplate(_){let{name:f,ContentType:$,Extension:z,PartName:Q}=_;return{name:f,properties:{rawMap:{Extension:z,PartName:Q,ContentType:$}}}}},qD=JD,bQ=(_)=>_==="jpg"?"jpeg":_,XD={getTemplate({sheetLen:_,hasCustomProperties:f}){let $=Array(_).fill(void 0).map((E,U)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${U+1}.xml`})),z=vf.size,Q=a0.size,J={};i1.forEach((E)=>{J[bQ(E.type)]=!0});let q=Array(z).fill(void 0).map((E,U)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${U+1}.xml`})),X=[];i0.forEach(({name:E})=>{X.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${E}.xml`})});let Y=f?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],Z=Object.keys(J).map((E)=>({name:"Default",ContentType:`image/${E}`,Extension:E}));if(Q)Z.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});let G=[...Z,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...$,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...q,...X,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...Y].map((E)=>qD.getTemplate(E));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:G}}},YD=XD,ZD={getTemplate(_){let $=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:_},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:$},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:$}]}}},GD=ZD,ED="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",UD=(_)=>{return Object.keys(_).filter(($)=>$&&_[$]!=null).map(($,z)=>({name:"property",properties:{rawMap:{fmtid:ED,pid:(z+2).toString(),name:U_($)??""}},children:[{name:"vt:lpwstr",textNode:U_(jQ(String(_[$])))??""}]}))},HD={getTemplate(_){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:UD(_)}}},WD=HD,QY=(_,f)=>({name:`xdr:${_}`,children:[{name:"xdr:col",textNode:f.col.toString()},{name:"xdr:colOff",textNode:f.offsetX.toString()},{name:"xdr:row",textNode:f.row.toString()},{name:"xdr:rowOff",textNode:f.offsetY.toString()}]}),BD=(_)=>{let f=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(_.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":f.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:f}},KD=(_,f)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:f,name:_.id,descr:_.altText!=null?_.altText:void 0}},children:[BD(_)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),JY=(_)=>{if(!_.saturation&&!_.tint)return;let f=[];if(_.saturation)f.push({name:"a:satMod",properties:{rawMap:{val:_.saturation*1000}}});if(_.tint)f.push({name:"a:tint",properties:{rawMap:{val:_.tint*1000}}});return f},LD=(_,f)=>{return{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:_.color}},children:JY(_)},{name:"a:srgbClr",properties:{rawMap:{val:f.color}},children:JY(f)}]}},FD=(_,f)=>{let $;if(_.transparency){let z=Math.min(Math.max(_.transparency,0),100);$=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(z*1000)}}}]}if(_.recolor){if(!$)$=[];switch(_.recolor.toLocaleLowerCase()){case"grayscale":$.push({name:"a:grayscl"});break;case"sepia":$.push(LD({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":$.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${f}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:$},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},DD=(_,f)=>{let $={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:f.width,cy:f.height}}}]};if(_.rotation){let J=_.rotation;$.properties={rawMap:{rot:Math.min(Math.max(J,0),360)*60000}}}return{name:"xdr:spPr",children:[$,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},MD=(_)=>{_.fitCell=!!_.fitCell||!_.width||!_.height;let{position:f={},fitCell:$,width:z=0,height:Q=0,totalHeight:J,totalWidth:q}=_,{offsetX:X=0,offsetY:Y=0,row:Z=1,rowSpan:G=1,column:E=1,colSpan:U=1}=f;return{from:{row:Z-1,col:E-1,offsetX:N1(X),offsetY:N1(Y)},to:{row:Z-1+($?1:G-1),col:E-1+($?1:U-1),offsetX:N1(z+X),offsetY:N1(Q+Y)},height:N1(J||Q),width:N1(q||z)}},kD=(_,f,$,z)=>{return{name:"xdr:pic",children:[KD(_,f+1),FD(_,$+1),DD(_,z)]}},SD={getTemplate(_){let{sheetIndex:f}=_,$=vf.get(f),z=m1.get(f),Q=$.map((J,q)=>{let X=MD(J);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[QY("from",X.from),QY("to",X.to),kD(J,q,z.get(J.id).index,X),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:Q}}},AD=SD,RD={getTemplate(_){let{Id:f,Type:$,Target:z}=_;return{name:"Relationship",properties:{rawMap:{Id:f,Type:$,Target:z}}}}},jD=RD,VD={getTemplate(_){let f=_.map(($)=>jD.getTemplate($));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:f}}},n$=VD,OD={getTemplate(_){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:_.size,uniqueCount:_.size}},children:zD(_)}}},PD=OD,vD=(_)=>{switch(_){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},TD={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},ID=["Dashed","DashDot","DashDotDot"],yD={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},bD={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},CD={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},wD=(_)=>{if(!_)return"none";return yD[_]||_},Of=(_)=>{if(_==null)return _;if(_.charAt(0)==="#")_=_.substring(1);return _.length===6?"FF"+_:_},KQ=(_,f)=>{if(!_)return"thin";let $=vD(f);if(_==="Continuous")return $;let z=TD[_];if($==="medium"&&ID.some((Q)=>Q===z))return`medium${z}`;return`${z.charAt(0).toLowerCase()}${z.substring(1)}`},xD=(_)=>{return bD[_]||"general"},ND=(_)=>{return CD[_]||void 0},C$=(_)=>{return{name:"color",properties:{rawMap:{rgb:Of(_||"#000000")}}}},gD={getTemplate(_){let{left:f,right:$,top:z,bottom:Q,diagonal:J}=_,q=f?[C$(f.color)]:void 0,X=$?[C$($.color)]:void 0,Y=z?[C$(z.color)]:void 0,Z=Q?[C$(Q.color)]:void 0,G=J?[C$(J.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:f?.style}},children:q},{name:"right",properties:{rawMap:{style:$?.style}},children:X},{name:"top",properties:{rawMap:{style:z?.style}},children:Y},{name:"bottom",properties:{rawMap:{style:Q?.style}},children:Z},{name:"diagonal",properties:{rawMap:{style:J?.style}},children:G}]}}},hD=gD,uD={getTemplate(_){return{name:"borders",properties:{rawMap:{count:_.length}},children:_.map((f)=>hD.getTemplate(f))}}},iD=uD,mD=(_)=>{let $=["Context","LeftToRight","RightToLeft"].indexOf(_);return Math.max($,0)},cD={getTemplate(_){let{horizontal:f,indent:$,readingOrder:z,rotate:Q,shrinkToFit:J,vertical:q,wrapText:X}=_;return{name:"alignment",properties:{rawMap:{horizontal:f&&xD(f),indent:$,readingOrder:z&&mD(z),textRotation:Q,shrinkToFit:J,vertical:q&&ND(q),wrapText:X}}}}},pD=cD,nD={getTemplate(_){let f=_.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:_.hideFormula===!0?1:0,locked:f}}}}},dD=nD,tD={getTemplate(_){let{alignment:f,borderId:$,fillId:z,fontId:Q,numFmtId:J,protection:q,quotePrefix:X,xfId:Y}=_,Z=[];if(f)Z.push(pD.getTemplate(f));if(q)Z.push(dD.getTemplate(q));return{name:"xf",properties:{rawMap:{applyAlignment:f?1:void 0,applyProtection:q?1:void 0,applyBorder:$?1:void 0,applyFill:z?1:void 0,borderId:$,fillId:z,applyFont:Q?1:void 0,fontId:Q,applyNumberFormat:J?1:void 0,numFmtId:J,quotePrefix:X?1:void 0,xfId:Y}},children:Z.length?Z:void 0}}},uY=tD,rD={getTemplate(_){return{name:"cellStyleXfs",properties:{rawMap:{count:_.length}},children:_.map((f)=>uY.getTemplate(f))}}},lD=rD,sD={getTemplate(_){let{builtinId:f,name:$,xfId:z}=_;return{name:"cellStyle",properties:{rawMap:{builtinId:f,name:$,xfId:z}}}}},aD=sD,oD={getTemplate(_){return{name:"cellStyles",properties:{rawMap:{count:_.length}},children:_.map((f)=>aD.getTemplate(f))}}},eD=oD,_M={getTemplate(_){return{name:"cellXfs",properties:{rawMap:{count:_.length}},children:_.map((f)=>uY.getTemplate(f))}}},fM=_M,$M={getTemplate(_){let{patternType:f,fgTheme:$,fgTint:z,fgRgb:Q,bgRgb:J,bgIndexed:q}=_,X={name:"patternFill",properties:{rawMap:{patternType:f}}};if($||z||Q)X.children=[{name:"fgColor",properties:{rawMap:{theme:$,tint:z,rgb:Q}}}];if(q||J){if(!X.children)X.children=[];X.children.push({name:"bgColor",properties:{rawMap:{indexed:q,rgb:J}}})}return{name:"fill",children:[X]}}},zM=$M,QM={getTemplate(_){return{name:"fills",properties:{rawMap:{count:_.length}},children:_.map((f)=>zM.getTemplate(f))}}},JM=QM,qM={getTemplate(_){let{size:f,colorTheme:$,color:z="FF000000",fontName:Q="Calibri",family:J,scheme:q,italic:X,bold:Y,strikeThrough:Z,outline:G,shadow:E,underline:U,verticalAlign:H}=_,W=[{name:"sz",properties:{rawMap:{val:f}}},{name:"color",properties:{rawMap:{theme:$,rgb:z}}},{name:"name",properties:{rawMap:{val:Q}}}];if(J)W.push({name:"family",properties:{rawMap:{val:J}}});if(q)W.push({name:"scheme",properties:{rawMap:{val:q}}});if(X)W.push({name:"i"});if(Y)W.push({name:"b"});if(Z)W.push({name:"strike"});if(G)W.push({name:"outline"});if(E)W.push({name:"shadow"});if(U)W.push({name:"u",properties:{rawMap:{val:U}}});if(H)W.push({name:"vertAlign",properties:{rawMap:{val:H}}});return{name:"font",children:W}}},XM=qM,YM={getTemplate(_){return{name:"fonts",properties:{rawMap:{count:_.length}},children:_.map((f)=>XM.getTemplate(f))}}},ZM=YM;function GM(_){let f=_.split(/(\[[^\]]*\])/);for(let $=0;$UM.getTemplate(f))}}},WM=HM,VQ,g1,N$,g$,h$,iY,OQ,mY,D2,cY=(_,f)=>{if(_.includes("mixedStyle")&&f>1)_+=`_${f}`;return _},pY=()=>{VQ={base:0},g1=[],N$=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],g$=[{patternType:"none"},{patternType:"gray125"}],h$=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],iY=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],OQ=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],mY=[{builtinId:0,name:"Normal",xfId:0}]},BM=(_)=>{let f=wD(_.pattern),$=Of(_.color),z=Of(_.patternColor),Q=g$.findIndex((J)=>{let{patternType:q,fgRgb:X,bgRgb:Y}=J;return!(q!=f||X!=$||Y!=z)});if(Q===-1)Q=g$.length,g$.push({patternType:f,fgRgb:$,bgRgb:z});return Q},KM=(_)=>{if($Y[_])return $Y[_];let f=g1.findIndex(($)=>$.formatCode===_);if(f===-1)f=g1.length+164,g1.push({formatCode:_,numFmtId:f});else f=g1[f].numFmtId;return f},LM=(_)=>{let{borderBottom:f,borderTop:$,borderLeft:z,borderRight:Q}=_,J,q,X,Y,Z,G,E,U;if(z)X=KQ(z.lineStyle,z.weight),E=Of(z.color);if(Q)Y=KQ(Q.lineStyle,Q.weight),U=Of(Q.color);if(f)J=KQ(f.lineStyle,f.weight),Z=Of(f.color);if($)q=KQ($.lineStyle,$.weight),G=Of($.color);let H=h$.findIndex((W)=>{let{left:B,right:K,top:L,bottom:F}=W;if(!B&&(X||E))return!1;if(!K&&(Y||U))return!1;if(!L&&(q||G))return!1;if(!F&&(J||Z))return!1;let{style:D,color:M}=B||{},{style:k,color:R}=K||{},{style:O,color:I}=L||{},{style:T,color:y}=F||{};if(D!=X||M!=E)return!1;if(k!=Y||R!=U)return!1;if(O!=q||I!=G)return!1;if(T!=J||y!=Z)return!1;return!0});if(H===-1)H=h$.length,h$.push({left:{style:X,color:E},right:{style:Y,color:U},top:{style:q,color:G},bottom:{style:J,color:Z},diagonal:{style:void 0,color:void 0}});return H},FM=(_)=>{let{fontName:f="Calibri",color:$,size:z,bold:Q,italic:J,outline:q,shadow:X,strikeThrough:Y,underline:Z,family:G,verticalAlign:E}=_,U=Of($),H=eF(G),W=Z?Z.toLocaleLowerCase():void 0,B=E?E.toLocaleLowerCase():void 0,K=N$.findIndex((L)=>{return!(L.fontName!=f||L.color!=U||L.size!=z||L.bold!=Q||L.italic!=J||L.outline!=q||L.shadow!=X||L.strikeThrough!=Y||L.underline!=W||L.verticalAlign!=B||L.family!=H)});if(K===-1)K=N$.length,N$.push({fontName:f,color:U,size:z,bold:Q,italic:J,outline:q,shadow:X,strikeThrough:Y,underline:W,verticalAlign:B,family:H!=null?H.toString():void 0});return K},DM=(_)=>{let{alignment:f,borders:$,font:z,interior:Q,numberFormat:J,protection:q,quotePrefix:X}=_,{id:Y}=_,Z=0,G=0,E=0,U=0;if(!Y)return;if(Y=cY(Y,D2),VQ[Y]!=null)return;if(Q)Z=BM(Q);if($)G=LM($);if(z)E=FM(z);if(J)U=KM(J.format);VQ[Y]=OQ.length,OQ.push({alignment:f,borderId:G||0,fillId:Z||0,fontId:E||0,numFmtId:U||0,protection:q,quotePrefix:X,xfId:0})},MM={getTemplate(_){let f=WM.getTemplate(g1),$=ZM.getTemplate(N$.map((Y)=>({...Y,size:Y.size!=null?Y.size:_}))),z=JM.getTemplate(g$),Q=iD.getTemplate(h$),J=lD.getTemplate(iY),q=fM.getTemplate(OQ),X=eD.getTemplate(mY);return pY(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[f,$,z,Q,J,q,X,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},kM=(_,f)=>{return VQ[cY(_,f)]||0},SM=(_,f)=>{if(D2=f,D2===1)pY();_.forEach(DM)},AM=MM,RM={getTemplate(_,f){let{name:$,columns:z,rowRange:Q,displayName:J,showRowStripes:q,showColumnStripes:X,showFilterButtons:Y,highlightFirstColumn:Z,highlightLastColumn:G}=_||{},E=!Q||Q[0]-Q[1]===0;if(!_||!$||!Array.isArray(z)||!z.length||E)return{name:"table"};let U=z.map((F,D)=>({name:"filterColumn",properties:{rawMap:{colId:D.toString(),hiddenButton:Y[D]?0:1}}})),H=`A${Q[0]}`,W=`${Y1(z.length)}${Q[1]}`,B=`${H}:${W}`,K=`${f+1}`,L=f?`${J}_${K}`:J;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:L,displayName:L,ref:B,totalsRowShown:0,id:K}},children:[{name:"autoFilter",properties:{rawMap:{ref:B}},children:U},{name:"tableColumns",properties:{rawMap:{count:z.length}},children:z.map((F,D)=>({name:"tableColumn",properties:{rawMap:{id:(D+1).toString(),name:U_($D(F)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:Z?1:0,showLastColumn:G?1:0,showRowStripes:q?1:0,showColumnStripes:X?1:0}}}]}}},jM=RM,E0=(_)=>{let[f,$,z,Q]=_;return{name:`a:${f}`,children:[{name:`a:${$}`,properties:{rawMap:{val:z,lastClr:Q}}}]}},VM={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[E0(["dk1","sysClr","windowText","000000"]),E0(["lt1","sysClr","window","FFFFFF"]),E0(["dk2","srgbClr","44546A"]),E0(["lt2","srgbClr","E7E6E6"]),E0(["accent1","srgbClr","4472C4"]),E0(["accent2","srgbClr","ED7D31"]),E0(["accent3","srgbClr","A5A5A5"]),E0(["accent4","srgbClr","FFC000"]),E0(["accent5","srgbClr","5B9BD5"]),E0(["accent6","srgbClr","70AD47"]),E0(["hlink","srgbClr","0563C1"]),E0(["folHlink","srgbClr","954F72"])]}}},OM=VM,P=(_)=>{let[f,$,z,Q]=_;return{name:`a:${f}`,properties:{rawMap:{script:z,typeface:$,panose:Q}}}},PM={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[P(["latin","Calibri Light",void 0,"020F0302020204030204"]),P(["ea",""]),P(["cs",""]),P(["font","游ゴシック Light","Jpan"]),P(["font","맑은 고딕","Hang"]),P(["font","等线 Light","Hans"]),P(["font","新細明體","Hant"]),P(["font","Times New Roman","Arab"]),P(["font","Times New Roman","Hebr"]),P(["font","Tahoma","Thai"]),P(["font","Nyala","Ethi"]),P(["font","Vrinda","Beng"]),P(["font","Shruti","Gujr"]),P(["font","MoolBoran","Khmr"]),P(["font","Tunga","Knda"]),P(["font","Raavi","Guru"]),P(["font","Euphemia","Cans"]),P(["font","Plantagenet Cherokee","Cher"]),P(["font","Microsoft Yi Baiti","Yiii"]),P(["font","Microsoft Himalaya","Tibt"]),P(["font","MV Boli","Thaa"]),P(["font","Mangal","Deva"]),P(["font","Gautami","Telu"]),P(["font","Latha","Taml"]),P(["font","Estrangelo Edessa","Syrc"]),P(["font","Kalinga","Orya"]),P(["font","Kartika","Mlym"]),P(["font","DokChampa","Laoo"]),P(["font","Iskoola Pota","Sinh"]),P(["font","Mongolian Baiti","Mong"]),P(["font","Times New Roman","Viet"]),P(["font","Microsoft Uighur","Uigh"]),P(["font","Sylfaen","Geor"]),P(["font","Arial","Armn"]),P(["font","Leelawadee UI","Bugi"]),P(["font","Microsoft JhengHei","Bopo"]),P(["font","Javanese Text","Java"]),P(["font","Segoe UI","Lisu"]),P(["font","Myanmar Text","Mymr"]),P(["font","Ebrima","Nkoo"]),P(["font","Nirmala UI","Olck"]),P(["font","Ebrima","Osma"]),P(["font","Phagspa","Phag"]),P(["font","Estrangelo Edessa","Syrn"]),P(["font","Estrangelo Edessa","Syrj"]),P(["font","Estrangelo Edessa","Syre"]),P(["font","Nirmala UI","Sora"]),P(["font","Microsoft Tai Le","Tale"]),P(["font","Microsoft New Tai Lue","Talu"]),P(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[P(["latin","Calibri",void 0,"020F0502020204030204"]),P(["ea",""]),P(["cs",""]),P(["font","游ゴシック","Jpan"]),P(["font","맑은 고딕","Hang"]),P(["font","等线","Hans"]),P(["font","新細明體","Hant"]),P(["font","Arial","Arab"]),P(["font","Arial","Hebr"]),P(["font","Tahoma","Thai"]),P(["font","Nyala","Ethi"]),P(["font","Vrinda","Beng"]),P(["font","Shruti","Gujr"]),P(["font","DaunPenh","Khmr"]),P(["font","Tunga","Knda"]),P(["font","Raavi","Guru"]),P(["font","Euphemia","Cans"]),P(["font","Plantagenet Cherokee","Cher"]),P(["font","Microsoft Yi Baiti","Yiii"]),P(["font","Microsoft Himalaya","Tibt"]),P(["font","MV Boli","Thaa"]),P(["font","Mangal","Deva"]),P(["font","Gautami","Telu"]),P(["font","Latha","Taml"]),P(["font","Estrangelo Edessa","Syrc"]),P(["font","Kalinga","Orya"]),P(["font","Kartika","Mlym"]),P(["font","DokChampa","Laoo"]),P(["font","Iskoola Pota","Sinh"]),P(["font","Mongolian Baiti","Mong"]),P(["font","Arial","Viet"]),P(["font","Microsoft Uighur","Uigh"]),P(["font","Sylfaen","Geor"]),P(["font","Arial","Armn"]),P(["font","Leelawadee UI","Bugi"]),P(["font","Microsoft JhengHei","Bopo"]),P(["font","Javanese Text","Java"]),P(["font","Segoe UI","Lisu"]),P(["font","Myanmar Text","Mymr"]),P(["font","Ebrima","Nkoo"]),P(["font","Nirmala UI","Olck"]),P(["font","Ebrima","Osma"]),P(["font","Phagspa","Phag"]),P(["font","Estrangelo Edessa","Syrn"]),P(["font","Estrangelo Edessa","Syrj"]),P(["font","Estrangelo Edessa","Syre"]),P(["font","Nirmala UI","Sora"]),P(["font","Microsoft Tai Le","Tale"]),P(["font","Microsoft New Tai Lue","Talu"]),P(["font","Ebrima","Tfng"])]}]}}},vM=PM,u0=(_,f,$)=>({name:`a:${_}`,properties:{rawMap:{val:f}},children:$}),X2=(_)=>{let[f,$,z,Q,J,q]=_,X=[];if(X.push(u0("satMod",z)),Q)X.push(u0("lumMod",Q));if(J)X.push(u0("tint",J));if(q)X.push(u0("shade",q));return{name:"a:gs",properties:{rawMap:{pos:f}},children:[{name:"a:schemeClr",properties:{rawMap:{val:$}},children:X}]}},PQ=(_,f)=>({name:"a:solidFill",children:[u0("schemeClr",_,f)]}),M2=(_)=>{let[f,$,z,Q,J]=_,[q,X]=J;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:f}},children:[{name:"a:gsLst",children:[X2($),X2(z),X2(Q)]},{name:"a:lin",properties:{rawMap:{ang:q,scaled:X}}}]}},Y2=(_)=>{let[f,$,z,Q]=_;return{name:"a:ln",properties:{rawMap:{w:f,cap:$,cmpd:z,algn:Q}},children:[PQ("phClr"),u0("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},Z2=(_)=>{let f=[];if(_){let[$,z,Q,J,q]=_;f.push({name:"a:outerShdw",properties:{rawMap:{blurRad:$,dist:z,dir:Q,algn:J,rotWithShape:q}},children:[u0("srgbClr","000000",[u0("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},f.length?{children:f}:{})]}},TM=()=>({name:"a:fillStyleLst",children:[PQ("phClr"),M2(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),M2(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),IM=()=>({name:"a:lnStyleLst",children:[Y2(["6350","flat","sng","ctr"]),Y2(["12700","flat","sng","ctr"]),Y2(["19050","flat","sng","ctr"])]}),yM=()=>({name:"a:effectStyleLst",children:[Z2(),Z2(),Z2(["57150","19050","5400000","ctr","0"])]}),bM=()=>({name:"a:bgFillStyleLst",children:[PQ("phClr"),PQ("phClr",[u0("tint","95000"),u0("satMod","170000")]),M2(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),CM={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[TM(),IM(),yM(),bM()]}}},wM=CM,xM={getTemplate(){return{name:"a:themeElements",children:[OM.getTemplate(),vM.getTemplate(),wM.getTemplate()]}}},NM=xM,gM={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[NM.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},hM=gM,uM=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),iM=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),mM=(_)=>({name:"v:formulas",children:_.map((f)=>({name:"v:f",properties:{rawMap:{eqn:f}}}))}),cM=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),nY=(_)=>{let{aspectratio:f,rotation:$}=_||{},z={};if(f)z.aspectratio="t";if($)z.rotation="t";return{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:z}}};function pM(_,f,$,z,Q){return(_-f)/($-f)*(Q-z)+z}var nM=(_,f)=>{let $,{recolor:z,brightness:Q,contrast:J,id:q}=_;if(z){if($={},z==="Washout"||z==="Grayscale")$.gain="19661f",$.blacklevel="22938f";if(z==="Black & White"||z==="Grayscale"){if($.grayscale="t",z==="Black & White")$.bilevel="t"}}if(!z||z==="Grayscale"){if(!$)$={};if(J!=null&&J!==50){let X="1";if(J>=0){if(J<50)X=String(J/50);else if(J<100)X=String(50/(100-J));else if(J===100)X="2147483647f"}$.gain=X}if(Q!=null&&Q!==50)$.blacklevel=pM(Q,0,100,-0.5,0.5).toString()}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${f}`,title:q}}],rawMap:$}}},dM=()=>{let _=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[iM(),mM(_),cM(),nY({aspectratio:!0})]}},qY=(_)=>Math.floor((_??0)*0.74999943307122),tM=(_,f)=>{let{width:$=0,height:z=0,altText:Q}=_,J=qY($),q=qY(z);return{name:"v:shape",properties:{rawMap:{id:_.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${J}pt; height: ${q}pt; z-index: ${f+1}`,type:"#_x0000_t75",alt:Q}},children:[nM(_,f+1),nY({rotation:!0})]}},rM={getTemplate(_){let f=a0.get(_.sheetIndex)||[],$=[uM(),dM(),...f.map((z,Q)=>tM(z,Q))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:$}}},lM=rM,sM={getTemplate(_,f){let $=(f+1).toString();return{name:"sheet",properties:{rawMap:{name:_,sheetId:$,"r:id":`rId${$}`}}}}},aM=sM,oM={getTemplate(_){return{name:"sheets",children:_.map((f,$)=>aM.getTemplate(f,$))}}},eM=oM,_k={getTemplate(_,f){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:f}}}]},eM.getTemplate(_)]}}},fk=_k,$k=(_)=>Math.ceil((_-12)/7+1),zk={getTemplate(_){let{min:f,max:$,outlineLevel:z,s:Q,width:J,hidden:q,bestFit:X}=_,Y=1,Z="0";if(J>1)Y=$k(J),Z="1";return{name:"col",properties:{rawMap:{min:f,max:$,outlineLevel:z!=null?z:void 0,width:Y,style:Q,hidden:q?"1":"0",bestFit:X?"1":"0",customWidth:Z}}}}},Qk=zk,Jk={getTemplate(_){return{name:"mergeCell",properties:{rawMap:{ref:_}}}}},qk=Jk,Xk=(_)=>{let f=_.charAt(0).toLowerCase();return f==="s"?"inlineStr":f},Yk={getTemplate(_,f,$){let{ref:z,data:Q,styleId:J}=_,{type:q,value:X}=Q||{type:"empty",value:null},Y=q;if(q==="f")Y="str";else if(q.charAt(0)===q.charAt(0).toUpperCase())Y=Xk(q);let Z={name:"c",properties:{rawMap:{r:z,t:Y==="empty"?void 0:Y,s:J?kM(J,$):void 0}}};if(Y==="empty")return Z;let G;if(Y==="str"&&q==="f")G=[{name:"f",textNode:U_(jQ(X))}];else if(Y==="inlineStr")G=[{name:"is",children:[{name:"t",textNode:U_(jQ(X))}]}];else G=[{name:"v",textNode:X}];return Object.assign({},Z,{children:G})}},Zk=Yk,Gk=(_,f)=>{let $=[],z=0;for(let Q=0;Q<_.length;Q++){let J=_[Q];if(J.mergeAcross)$.push({pos:Q,excelPos:z}),z+=J.mergeAcross;z++}if($.length)for(let Q=$.length-1;Q>=0;Q--){let J=[],q=_[$[Q].pos];for(let X=1;X<=q.mergeAcross;X++)J.push({ref:`${Y1($[Q].excelPos+1+X)}${f+1}`,styleId:q.styleId,data:{type:"empty",value:null}});if(J.length)_.splice($[Q].pos+1,0,...J)}},Ek=(_)=>_.data?.value!==""||_.styleId!==void 0,Uk={getTemplate(_,f,$){let{collapsed:z,hidden:Q,height:J,outlineLevel:q,cells:X=[]}=_;Gk(X,f);let Y=X.filter(Ek).map((Z,G)=>Zk.getTemplate(Z,G,$));return{name:"row",properties:{rawMap:{r:f+1,collapsed:z?"1":"0",hidden:Q?"1":"0",ht:J,customHeight:J!=null?"1":"0",spans:"1:1",outlineLevel:q||void 0}},children:Y}}},Hk=Uk,Wk=(_,f,$)=>{let z=[],Q=[];_.forEach((X,Y)=>{let Z=X.cells,G=0,E;Z.forEach((U,H)=>{let W=H+G+1,B=Y1(W),K=Y+1;if(U.mergeAcross){G+=U.mergeAcross;let F=Y1(H+G+1);z.push(`${B}${K}:${F}${K}`)}if(!f[W-1])f[W-1]={};let{collapsibleRanges:L}=U;if(L)L.forEach((F)=>{Q.push([W+F[0],W+F[1]])});E=f[W-1],E.min=W,E.max=W,U.ref=`${B}${K}`})}),Q.sort((X,Y)=>{if(X[0]!==Y[0])return X[0]-Y[0];return Y[1]-X[1]});let J=new Map,q=new Map;return Q.filter((X)=>{let Y=X.toString();if(J.get(Y))return!1;return J.set(Y,!0),!0}).forEach((X)=>{let Y=f.find((G)=>G.min==X[0]&&G.max==X[1]),Z=q.get(X[0]);f.push({min:X[0],max:X[1],outlineLevel:$?void 0:Z||1,width:(Y||{width:100}).width}),q.set(X[0],(Z||0)+1)}),z},Bk=(_)=>{if(!_||_!=="Portrait"&&_!=="Landscape")return"portrait";return _.toLocaleLowerCase()},Kk=(_)=>{if(_==null)return 1;let $=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(_);return $===-1?1:$+1},Lk=(_)=>{let f={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(let $ of Object.keys(f))_=_.replace($,f[$]);return _},Fk=(_)=>{if(_==="Center")return"C";if(_==="Right")return"R";return"L"},Dk=(_,f)=>{if(!f)return _;if(_+="&"",_+=f.fontName||"Calibri",f.bold!==f.italic)_+=f.bold?",Bold":",Italic";else if(f.bold)_+=",Bold Italic";else _+=",Regular";if(_+=""",f.size)_+=`&${f.size}`;if(f.strikeThrough)_+="&S";if(f.underline)_+=`&${f.underline==="Double"?"E":"U"}`;if(f.color)_+=`&K${f.color.replace("#","").toUpperCase()}`;return _},Mk=(_,f,$)=>_.reduce((z,Q,J)=>{let q=Fk(Q.position),X=Dk(`${z}&${q}`,Q.font),Y=["Left","Center","Right"];if(!Q.position)Q.position=Y[J];let{image:Z}=Q;if(Q.value==="&[Picture]"&&Z){let G=`${q}${f}${$}`;dY(Z,G)}return`${X}${U_(Lk(Q.value))}`},""),kk=(_)=>{let f=["all","first","even"],$=[];return f.forEach((z)=>{let Q=_[z],J=z==="all"?"odd":z;if(!Q)return;for(let q of Object.keys(Q)){let X=Q[q],Y=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,Z=q[0].toUpperCase();if(X){let G=z==="all"?"":z.toUpperCase();$.push({name:`${J}${Y}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:Mk(X,Z,G)})}}}),$},Sk=(_)=>{return(f)=>{if(_.length)f.children.push({name:"cols",children:_.map(($)=>Qk.getTemplate($))});return f}},Ak=(_,f)=>{return($)=>{if(_.length)$.children.push({name:"sheetData",children:_.map((z,Q)=>Hk.getTemplate(z,Q,f))});return $}},Rk=(_)=>{let f=_.length;if(!f)return"";let $=Array(f+1);$[0]=f;for(let Q=1;Q<=f;Q++)$[Q]=_.charCodeAt(Q-1)&255;let z=0;for(let Q=$.length-1;Q>=0;Q--){let J=$[Q],q=(z&16384)===0?0:1,X=z<<1&32767;z=(q|X)^J}return(z^52811).toString(16).toUpperCase().padStart(4,"0")},jk=(_)=>{return(f)=>{if(!_)return f;let $=typeof _==="boolean"?{}:_,z={sheet:1},Q=$.password?Rk($.password):"";if(Q)z.password=Q;let J={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(J).forEach((q)=>{let X=$[q];if(X==null||X===J[q])return;z[q]=X?0:1}),f.children.push({name:"sheetProtection",properties:{rawMap:z}}),f}},Vk=(_)=>{return(f)=>{if(_.length)f.children.push({name:"mergeCells",properties:{rawMap:{count:_.length}},children:_.map(($)=>qk.getTemplate($))});return f}},Ok=(_)=>{return(f)=>{let{top:$=0.75,right:z=0.7,bottom:Q=0.75,left:J=0.7,header:q=0.3,footer:X=0.3}=_;return f.children.push({name:"pageMargins",properties:{rawMap:{bottom:Q,footer:X,header:q,left:J,right:z,top:$}}}),f}},Pk=(_)=>{return(f)=>{if(_)f.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:Bk(_.orientation),paperSize:Kk(_.pageSize)}}});return f}},vk=(_)=>{return(f)=>{if(!_)return f;let $=_.first!=null?1:0,z=_.even!=null?1:0;return f.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:$,differentOddEven:z}},children:kk(_)}),f}},Tk=(_)=>{return(f)=>{if(_)f.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++f.rIdCounter}`}}}]});return f}},Ik=(_)=>{return(f)=>{if(vf.get(_)?.length)f.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++f.rIdCounter}`}}});return f}},yk=(_)=>{return(f)=>{if(a0.get(_))f.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++f.rIdCounter}`}}});return f}},bk=(_=0,f=0)=>{let $=_>0||f>0;return $?[{name:"pane",properties:{rawMap:{state:$?"frozen":void 0,topLeftCell:$?`${Y1(_+1)}${f+1}`:void 0,xSplit:_===0?void 0:_,ySplit:f===0?void 0:f}}}]:void 0},Ck=(_=!1,f,$)=>{return(z)=>{return z.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:_===!0?"1":"0",workbookViewId:"0"}},children:bk(f,$)}]}),z}},wk=()=>{return(_)=>{return _.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),_}},xk=(_)=>{return(f)=>{let $=_.reduce((z,Q)=>{if(Q.outlineLevel&&Q.outlineLevel>z)return Q.outlineLevel;return z},0);return f.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:$?$:void 0}}}),f}},Nk={getTemplate(_){let{worksheet:f,currentSheet:$,config:z}=_,{margins:Q={},pageSetup:J,headerFooterConfig:q,suppressColumnOutline:X,rightToLeft:Y,frozenRowCount:Z,frozenColumnCount:G,protectSheet:E}=z,{table:U}=f,{rows:H,columns:W}=U,B=W?.length?Wk(H,W,!!X):[],K=i0.get($),{children:L}=[wk(),Ck(Y,G,Z),xk(H),Sk(W),Ak(H,$+1),jk(E),Vk(B),Ok(Q),Pk(J),vk(q),Ik($),yk($),Tk(K)].reduce((F,D)=>D(F),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:L}}},gk=Nk,J1=new Map,t_=[],q1=[],X1=new Map,Pf=new Map,vf=new Map,a0=new Map,i1=new Map,m1=new Map,i0=new Map,hk="AG-GRID-TABLE",j2="SINGLE_SHEET";function uk(){return j2}function ik(_){j2=_}function mk(_,f,$){tk(f),SM(_,t_.length);let z=Object.assign({},$);if($.exportAsExcelTable&&$.pivotModeActive)j(163,{featureName:"pivot mode"}),z.exportAsExcelTable=!1;nk(f,z);let Q=ES(f,z);return US(Q),Q}function ck(_){return _.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function pk(_,f){if(i0.has(_)){j(164);return}i0.set(_,f)}function nk(_,f){let{exportAsExcelTable:$,prependContent:z,appendContent:Q,headerRowCount:J=0}=f;if(!$)return;let q=typeof $==="boolean"?{}:$,{name:X,showColumnStripes:Y,showRowStripes:Z,showFilterButton:G,highlightFirstColumn:E,highlightLastColumn:U}=q,H=ck(X||hk),W=t_.length-1,{table:B}=_,{rows:K,columns:L}=B,F=z?z.length:0,D=Q?Q.length:0,M=K.length,k=L.length,R=[],O=[];for(let I=0;IJ.id===_.id))Q.push(_)}function dk(_,f,$,z,Q){let J=t_.length,{row:q,column:X}=_.position||{},Y=_;if(z){if(f!=null&&$!=null&&(!q||!X)){if(!_.position)_.position={};_.position=Object.assign({},_.position,{row:f,column:z.indexOf($)+1})}_D(Y,z),fD(Y,Q)}tY({imageToAdd:Y,idx:J});let Z=m1.get(J);if(!Z)Z=new Map,m1.set(J,Z);let G=vf.get(J);if(!G)vf.set(J,[Y]);else G.push(Y);if(!Z.get(_.id))Z.set(_.id,{index:Z.size,type:_.imageType})}function tY(_){let{imageToAdd:f,idx:$}=_,z=Pf.get(f.id);if(z){let Q=z.find((J)=>J.sheetId===$);if(Q)Q.image.push(f);else z.push({sheetId:$,image:[f]})}else Pf.set(f.id,[{sheetId:$,image:[f]}]),i1.set(f.id,{type:f.imageType,index:i1.size})}function tk(_){let f=U_(_.name)||"",$="";while(t_.indexOf(`${f}${$}`)!==-1)if($==="")$="_1";else $=`_${parseInt($.slice(1),10)+1}`;_.name=`${f}${$}`,t_.push(_.name)}function rk(_){if(J1.has(_))return J1.get(_);return J1.set(_,J1.size),J1.size-1}function lk(){J1.clear(),Pf.clear(),vf.clear(),a0.clear(),i1.clear(),m1.clear(),i0.clear(),t_=[],q1=[],X1=new Map,j2="SINGLE_SHEET"}function sk(_){return w_(fk.getTemplate(t_,_))}function ak(_){return w_(AM.getTemplate(_))}function ok(){return w_(PD.getTemplate(J1))}function ek(_){return w_(GD.getTemplate(_))}function _S(_){return w_(WD.getTemplate(_))}function fS(_,f){return w_(YD.getTemplate({sheetLen:_,hasCustomProperties:f}))}function $S(_){let f=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];if(_)f.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});let $=n$.getTemplate(f);return w_($)}function zS(){return w_(hM.getTemplate())}function QS(_,f){return w_(jM.getTemplate(_,f))}function JS(_){let f=Array(_).fill(void 0).map((z,Q)=>({Id:`rId${Q+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${Q+1}.xml`})),$=n$.getTemplate([...f,{Id:`rId${_+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${_+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${_+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return w_($)}function qS(_){return w_(AD.getTemplate({sheetIndex:_}))}function XS(_){let f=m1.get(_)||[],$=[];for(let[z,Q]of f){let{index:J,type:q}=Q;$.push({Id:`rId${J+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${i1.get(z).index+1}.${bQ(q)}`})}return w_(n$.getTemplate($))}function YS(_){return w_(lM.getTemplate({sheetIndex:_}),!0)}function ZS(_){let f=a0.get(_)||[],$=[];for(let z=0;z{if(!_.size)return;let $=new Map;f.forEach((z,Q)=>{if(_.has(z))$.set(Q,_.get(z))}),_.clear(),$.forEach((z,Q)=>_.set(Q,z))},US=(_)=>{let f=X1.get(_)??[];f.push(t_.length-1),X1.set(_,f),q1.push(_)},HS=(_)=>{let f=new Map(X1),$=[];for(let z of _){let Q=f.get(z);if(!Q?.length)return null;let J=Q.shift();$.push(J),f.set(z,Q)}return $},WS=(_)=>{if(!_.length||q1.length===0)return null;let f=new Set,$=[];for(let z of _){let Q=q1.findIndex((J,q)=>!f.has(q)&&J===z);if(Q===-1)return null;f.add(Q),$.push(Q)}return $},BS=(_)=>{let f=new Map;_.forEach(($,z)=>f.set($,z)),t_=_.map(($)=>t_[$]),q1=_.map(($)=>q1[$]),LQ(vf,_),LQ(a0,_),LQ(i0,_),LQ(m1,_),Pf.forEach(($)=>{$.forEach((z)=>{let Q=f.get(z.sheetId);if(Q!=null)z.sheetId=Q})}),X1=new Map,q1.forEach(($,z)=>{let Q=X1.get($)??[];Q.push(z),X1.set($,Q)})},KS=(_)=>{if(_.length<=1)return;let f=HS(_)??WS(_);if(!f)return;BS(f)},V2=class{getStringPosition(_){return rk(_)}addBodyImageToMap(_,f,$,z,Q){dk(_,f,$,z,Q)}addHeaderFooterImageToMap(_,f){dY(_,f)}addWorksheet(_,f,$){return mk(_,f,$)}syncOrderWithSheetData(_){KS(_)}reset(){lk()}setFactoryMode(_){ik(_)}getFactoryMode(){return uk()}getSheetNames(){return[...t_]}},LS=async(_)=>{let f=0,$=[],z=new WritableStream({write:(q)=>{$.push(q),f+=q.length}}),Q=new ReadableStream({start:(q)=>{let X=new FileReader;X.onload=(Y)=>{if(Y.target?.result)q.enqueue(Y.target.result);q.close()},X.readAsArrayBuffer(_)}}),J=new window.CompressionStream("deflate-raw");return await Q.pipeThrough(J).pipeTo(z),{size:f,content:new Blob($)}},FS=async(_)=>{let f=new Blob([_]),{size:$,content:z}=await LS(f),Q=new Uint8Array(await z.arrayBuffer());return{size:$,content:Q}},DS=(_)=>{let f=_.getHours();return f<<=6,f=f|_.getMinutes(),f<<=5,f=f|_.getSeconds()/2,f},MS=(_)=>{let f=_.getFullYear()-1980;return f<<=4,f=f|_.getMonth()+1,f<<=5,f=f|_.getDate(),f};function C_(_,f){let $="";for(let z=0;z>>=8;return $}var XY=(_)=>{if(!_.length)return 0;let f=-1,$=0,z=0,Q=0;for(let J=0;J<_.length;J++)$=_[J],z=(f^$)&255,Q=kS[z],f=f>>>8^Q;return f^-1},YY=(_)=>{if(!_.length)return 0;if(typeof _==="string")return XY(new TextEncoder().encode(_));return XY(_)},kS=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function SS(_){let f=String.fromCharCode;function $(E){let U=[];if(!E)return[];let H=E.length,W=0,B,K;while(W=55296&&B<=56319&&W=55296&&E<=57343)throw Error($0(255,{point:E}))}function Q(E,U){return f(E>>U&63|128)}function J(E){if((E&4294967168)==0)return f(E);let U="";if((E&4294965248)==0)U=f(E>>6&31|192);else if((E&4294901760)==0)z(E),U=f(E>>12&15|224),U+=Q(E,6);else if((E&4292870144)==0)U=f(E>>18&7|240),U+=Q(E,12),U+=Q(E,6);return U+=f(E&63|128),U}let q=$(_),X=q.length,Y=-1,Z,G="";while(++Y{let{content:q,path:X,created:Y}=_,Z=DS(Y),G=MS(Y),E=YY(Q),U=J!==void 0?J:z,H=SS(X),W=H!==X,B="";if(W){let D=C_(1,1)+C_(YY(H),4)+H;B="up"+C_(D.length,2)+D}let K="\x14\x00"+(W?"\x00\b":"\x00\x00")+C_(f?8:0,2)+C_(Z,2)+C_(G,2)+C_(U?E:0,4)+C_(J??z,4)+C_(z,4)+C_(H.length,2)+C_(B.length,2),L="PK\x03\x04"+K+H+B,F="PK\x01\x02\x14\x00"+K+"\x00\x00\x00\x00\x00\x00"+(q?"\x00\x00\x00\x00":"\x10\x00\x00\x00")+C_($,4)+H+B;return{localFileHeader:Uint8Array.from(L,(D)=>D.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(F,(D)=>D.charCodeAt(0))}},lY=(_)=>{let f;if(typeof _==="string"){let $=atob(_.split(";base64,")[1]);f=Uint8Array.from($,(z)=>z.charCodeAt(0))}else f=_;return{size:f.length,content:f}},AS=async(_)=>{let{content:f}=_,{size:$,content:z}=!f?{size:0,content:Uint8Array.from([])}:lY(f),Q,J,q=!1;if(_.type==="file"&&z&&$>0){let Y=await FS(z);Q=Y.content,J=Y.size,q=!0}return{rawContent:z,rawSize:$,deflatedContent:Q,deflatedSize:J,isCompressed:q}},RS=(_,f)=>{let{content:$}=_,{content:z}=!$?{content:Uint8Array.from([])}:lY($);return{...rY(_,!1,f,z.length,z,void 0),content:z,isCompressed:!1}},jS=(_,f,$)=>{let z="PK\x05\x06\x00\x00\x00\x00"+C_(_,2)+C_(_,2)+C_(f,4)+C_($,4)+"\x00\x00";return Uint8Array.from(z,(Q)=>Q.charCodeAt(0))},sY=class{constructor(){this.folders=[],this.files=[]}addFolders(_){_.forEach(this.addFolder.bind(this))}addFolder(_){this.folders.push({path:_,created:new Date,isBase64:!1,type:"folder"})}addFile(_,f,$=!1){this.files.push({path:_,created:new Date,content:$?f:new TextEncoder().encode(f),isBase64:$,type:"file"})}async getZipFile(_="application/zip"){let f=await this.buildCompressedFileStream();return this.clearStream(),new Blob([f],{type:_})}getUncompressedZipFile(_="application/zip"){let f=this.buildFileStream();return this.clearStream(),new Blob([f],{type:_})}clearStream(){this.folders=[],this.files=[]}packageFiles(_){let f=0,$=0;for(let Z of _){let{localFileHeader:G,centralDirectoryHeader:E,content:U}=Z;f+=G.length+U.length,$+=E.length}let z=new Uint8Array(f),Q=new Uint8Array($),J=0,q=0;for(let Z of _){let{localFileHeader:G,centralDirectoryHeader:E,content:U}=Z;z.set(G,J),J+=G.length,z.set(U,J),J+=U.length,Q.set(E,q),q+=E.length}let X=jS(_.length,$,f),Y=new Uint8Array(z.length+Q.length+X.length);return Y.set(z),Y.set(Q,z.length),Y.set(X,z.length+Q.length),Y}async buildCompressedFileStream(){let _=[...this.folders,...this.files],f=await Promise.all(_.map(AS)),$=[],z=0;for(let Q=0;Q<_.length;Q++){let J=_[Q],{rawContent:q,rawSize:X,deflatedContent:Y,deflatedSize:Z,isCompressed:G}=f[Q],E=rY(J,G,z,X,q,Z),U=Y??q;$.push({...E,content:U,isCompressed:G}),z+=E.localFileHeader.length+U.length}return this.packageFiles($)}buildFileStream(){let _=[...this.folders,...this.files],f=[],$=0;for(let z of _){let Q=RS(z,$),{localFileHeader:J,content:q}=Q;f.push(Q),$+=J.length+q.length}return this.packageFiles(f)}},VS=(_)=>{if(_.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!Pf.size)return;_.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let f=0;Pf.forEach(($)=>{let z=$[0].image[0],{base64:Q,imageType:J}=z;_.addFile(`xl/media/image${++f}.${bQ(J)}`,Q,!0)})},OS=(_,f)=>{let $=0,z=0;for(let Q=0;Q0&&vf.has(Q),X=i0.size>0&&i0.get(Q),Y=Pf.size&&a0.has(Q);if(!q&&!X&&!Y)continue;let Z,G,E;if(q)PS(_,Q,$),G=$,$++;if(Y)vS(_,Q,z),E=z,z++;if(X)Z=X.name;let U=`xl/worksheets/_rels/sheet${Q+1}.xml.rels`;_.addFile(U,GS({tableName:Z,drawingIndex:G,vmlDrawingIndex:E}))}},PS=(_,f,$)=>{let Q=`xl/drawings/drawing${$+1}.xml`,J=`xl/drawings/_rels/drawing${$+1}.xml.rels`;_.addFile(J,XS(f)),_.addFile(Q,qS(f))},vS=(_,f,$)=>{let Q=`xl/drawings/vmlDrawing${$+1}.vml`,J=`xl/drawings/_rels/vmlDrawing${$+1}.vml.rels`;_.addFile(Q,YS(f)),_.addFile(J,ZS(f))},TS=(_)=>{let f=i0,$=Array.from(f.keys());for(let z=0;z<$.length;z++){let Q=$[z],J=f.get(Q);if(!J)continue;_.addFile(`xl/tables/${J.name}.xml`,QS(J,z))}},IS=(_,f,$,z,Q,J)=>{let q=!!J&&Object.keys(J).some((X)=>J[X]!=null);if(_.addFile("xl/workbook.xml",sk(Q)),_.addFile("xl/styles.xml",ak(f)),_.addFile("xl/sharedStrings.xml",ok()),_.addFile("xl/theme/theme1.xml",zS()),_.addFile("xl/_rels/workbook.xml.rels",JS(z)),_.addFile("docProps/core.xml",ek($)),q)_.addFile("docProps/custom.xml",_S(J));_.addFile("[Content_Types].xml",fS(z,q)),_.addFile("_rels/.rels",$S(q))},aY=(_,f,$={},z)=>{if(!f||f.length===0)return j(159),z.reset(),!1;z.syncOrderWithSheetData(f);let{fontSize:Q=11,author:J="AG Grid",activeTab:q=0,customMetadata:X}=$,Y=f.length,Z=Math.max(Math.min(q,Y-1),0);return VS(_),TS(_),OS(_,f),IS(_,Q,J,Y,Z,X),z.reset(),!0},ZY=(_,f=new V2)=>{let{data:$,fontSize:z,author:Q,activeSheetIndex:J,customMetadata:q}=_,X=_.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Y=new sY;if(!aY(Y,$,{author:Q,fontSize:z,activeTab:J,customMetadata:q},f))return Promise.resolve(void 0);return Y.getZipFile(X)},GY=(_,f=new V2)=>{let{data:$,fontSize:z,author:Q,activeSheetIndex:J,customMetadata:q}=_,X=_.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Y=new sY;if(!aY(Y,$,{author:Q,fontSize:z,activeTab:J,customMetadata:q},f))return;return Y.getUncompressedZipFile(X)};var yS=class extends sJ{constructor(){super(...arguments);this.beanName="excelCreator",this.workbook=new V2}getMergedParams(_){let f=this.gos.get("defaultExcelExportParams");return Object.assign({},f,_)}export(_){if(this.isExportSuppressed()){j(160);return}let f=()=>{let z=this.getMergedParams(_),Q=this.getData(z),{fontSize:J,author:q,mimeType:X,customMetadata:Y}=z,Z={data:[Q],fontSize:J,author:q,mimeType:X,customMetadata:Y};this.packageCompressedFile(Z).then((G)=>{if(G){let{fileName:E}=z,U=typeof E==="function"?E(C(this.gos,{})):E;GQ(this.getFileName(U),G)}})},{overlays:$}=this.beans;if($)$.showExportOverlay(f);else f()}exportDataAsExcel(_){this.export(_)}getDataAsExcel(_){let f=this.getMergedParams(_),$=this.getData(f),{fontSize:z,author:Q,mimeType:J,customMetadata:q}=f,X={data:[$],fontSize:z,author:Q,mimeType:J,customMetadata:q};return this.packageFile(X)}setFactoryMode(_){this.workbook.setFactoryMode(_)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(_){let f=this.getMergedParams(_);return this.getData(f)}getMultipleSheetsAsExcel(_){return GY(_,this.workbook)}exportMultipleSheetsAsExcel(_){ZY(_,this.workbook).then((f)=>{let{fileName:$="export.xlsx"}=_;if(f){let z=typeof $==="function"?$():$;GQ(z,f)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(_){let{colModel:f,colNames:$,rowGroupColsSvc:z,valueSvc:Q,formula:J,gos:q}=this.beans,X=q.get("excelStyles")||[],Y=this.createStyleLinker(X),Z={..._,colModel:f,colNames:$,rowGroupColsSvc:z,valueSvc:Q,formulaSvc:J,gos:q,suppressRowOutline:_.suppressRowOutline||_.skipRowGroups,headerRowHeight:_.headerRowHeight||_.rowHeight,baseExcelStyles:X,rightToLeft:_.rightToLeft??q.get("enableRtl"),styleLinker:Y,headerRowCount:LX(f),pivotModeActive:f.isPivotActive(),workbook:this.workbook};return new QD(Z)}createStyleLinker(_){let f=[],$=new Set,z=new Map;_.forEach((q,X)=>{f.push(q.id),$.add(q.id),z.set(q.id,X)});let{gos:Q,cellStyles:J}=this.beans;return(q)=>{let{rowType:X,rowIndex:Y,value:Z,column:G,columnGroup:E,node:U}=q,H=X==="HEADER",W=X==="HEADER_GROUPING",B=H?G:E,K=[];if(H||W){if(K.push("header"),W)K.push("headerGroup");if(B)K=K.concat($Q(B.getDefinition(),Q,G||null,E||null));return K}let L=["cell"];if(!f.length)return L;let F=G.getDefinition();return J?.processAllCellClasses(F,C(Q,{value:Z,data:U.data,node:U,colDef:F,column:G,rowIndex:Y}),(D)=>{if($.has(D))L.push(D)}),L.sort((D,M)=>{let k=z.get(D)??-1,R=z.get(M)??-1;return k===R?0:kthis.onFocusIn(_),onFocusOut:(_)=>this.onFocusOut(_),focusInnerElement:(_)=>this.focusInnerElement(_),onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.handleKeyDown(_)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(_){if(_.listItemHeightChanged)this.rowHeight=this.getItemHeight(),this.refresh()}refreshAriaProperties(){let f=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),$=this.eContainer;Z_($,this.model?.getRowCount()>0?this.ariaRole:"presentation"),W_($,f)}addResizeObserver(){let _=()=>Y0(this.beans,()=>this.drawVirtualRows()),f=S0(this.beans,this.getGui(),_);this.addDestroyFunc(f)}focusInnerElement(_){return this.focusRow(_?this.model.getRowCount()-1:0),!0}onFocusIn(_){let f=_.target;if(f.classList.contains("ag-virtual-list-item"))this.lastFocusedRowIndex=a9(f)-1}onFocusOut(_){if(!this.getFocusableElement().contains(_.relatedTarget))this.lastFocusedRowIndex=null}handleKeyDown(_){let{key:f,shiftKey:$}=_;switch(f){case S.UP:case S.DOWN:{let z=f===S.UP;if(_.preventDefault(),$)this.moveItem(z);else this.navigate(z)}break;case S.PAGE_HOME:case S.PAGE_END:case S.PAGE_UP:case S.PAGE_DOWN:if(this.navigateToPage(f)!==null)_.preventDefault();break}}onTabKeyDown(_){this.stopPropagationCallbacks?.stopPropagation(_),this.forceFocusOutOfContainer(_.shiftKey)}getNextRow(_){if(this.lastFocusedRowIndex==null)return;let f=this.lastFocusedRowIndex+(_?-1:1);if(f<0||f>=this.model.getRowCount())return;return f}moveItem(_){if(!this.moveItemCallback)return;let f=this.getComponentAt(this.lastFocusedRowIndex);if(!f)return;this.moveItemCallback(f,_)}navigate(_){let f=this.getNextRow(_);if(f===void 0)return;this.focusRow(f)}navigateToPage(_,f="focused"){let $=!1;if(f==="focused")f=this.getLastFocusedRow(),$=!0;let z=this.model.getRowCount()-1,Q=-1;if(_===S.PAGE_HOME)Q=0;else if(_===S.PAGE_END)Q=z;else if(_===S.PAGE_DOWN)Q=Math.min(f+this.pageSize,z);else if(_===S.PAGE_UP)Q=Math.max(f-this.pageSize,0);if(Q===-1)return null;if($)this.focusRow(Q);else this.ensureIndexVisible(Q);return Q}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(_){if(this.isScrolling)return;this.isScrolling=!0,this.ensureIndexVisible(_),Y0(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;let f=this.renderedRows.get(_);if(f)f.eDiv.focus()})}getComponentAt(_){let f=this.renderedRows.get(_);return f&&f.rowComponent}forEachRenderedRow(_){this.renderedRows.forEach((f,$)=>_(f.rowComponent,$))}getItemHeight(){if(!this.isHeightFromTheme)return this.rowHeight;return this.beans.environment.getDefaultListItemHeight()}ensureIndexVisible(_,f=!0){let $=this.model.getRowCount();if(typeof _!=="number"||_<0||_>=$)return!1;let z=_*this.rowHeight,Q=z+this.rowHeight,J=this.getGui(),q=J.scrollTop,X=J.offsetHeight,Y=q+X,Z=f?0:this.rowHeight,G=q>z+Z,E=Y{if(!this.isAlive())return;if(this.canSoftRefresh(_))this.drawVirtualRows(!0);else this.clearVirtualRows(),this.drawVirtualRows()})}awaitStable(_){if(this.awaitStableCallbacks.push(_),this.awaitStableCallbacks.length>1)return;let f=this.model.getRowCount();fJ(this,()=>this.eContainer.clientHeight>=f*this.rowHeight,()=>{if(!this.isAlive())return;let $=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(let z of $)z()})}canSoftRefresh(_){return!!(_&&this.renderedRows.size&&typeof this.model.areRowsEqual==="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((_,f)=>this.removeRow(f))}drawVirtualRows(_){if(!this.isAlive()||!this.model)return;let f=this.getGui(),$=f.scrollTop,z=$+f.offsetHeight;if($===z)this.clearVirtualRows();else{let Q=Math.floor($/this.rowHeight),J=Math.floor(z/this.rowHeight);this.pageSize=Math.floor((z-$)/this.rowHeight),this.ensureRowsRendered(Q,J,_)}}ensureRowsRendered(_,f,$){if(this.renderedRows.forEach((z,Q)=>{if((Q<_||Q>f)&&Q!==this.lastFocusedRowIndex)this.removeRow(Q)}),$)this.refreshRows();for(let z=_;z<=f;z++){if(this.renderedRows.has(z))continue;if(z=f.getRowCount())return;let{cssIdentifier:$,ariaRole:z,renderedRows:Q,eContainer:J}=this,q=f.getRow(_),X=z==="tree"?"treeitem":"option",Y=B_({tag:"div",cls:`ag-virtual-list-item ag-${$}-virtual-list-item`,role:X,attrs:{tabindex:"-1"}});hz(Y,f.getRowCount()),uz(Y,_+1);let Z=this.rowHeight;Y.style.height=`${Z}px`,Y.style.top=`${Z*_}px`;let G=this.componentCreator(q,Y);if(G.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=_),Y.appendChild(G.getGui()),Q.has(_-1))Q.get(_-1).eDiv.insertAdjacentElement("afterend",Y);else if(Q.has(_+1))Q.get(_+1).eDiv.insertAdjacentElement("beforebegin",Y);else J.appendChild(Y);Q.set(_,{rowComponent:G,eDiv:Y,value:q})}removeRow(_){let f=this.renderedRows.get(_);f.eDiv.remove(),this.destroyBean(f.rowComponent),this.renderedRows.delete(_)}refreshRows(){let _=this.model.getRowCount();this.renderedRows.forEach((f,$)=>{if($>=_)this.removeRow($);else{let z=this.model.getRow($);if(this.model.areRowsEqual?.(f.value,z))this.componentUpdater(z,f.rowComponent);else this.removeRow($)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(_){this.model=_}getAriaElement(){return this.eContainer}destroy(){if(!this.isAlive())return;this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy()}},xS='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',G2="ag-list-item-hovered",NS=class extends j_{constructor(_,f,$){super();this.comp=_,this.virtualList=f,this.params=$,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(xS,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(_){this.currentDragValue=this.params.getCurrentDragValue(_),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){let _={isInterestedIn:(f)=>f===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:(f)=>this.onDragging(f),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(_)}createAutoScrollService(){let _=this.virtualList.getGui();this.autoScrollService=new JQ({scrollContainer:_,scrollAxis:"y",getVerticalPosition:()=>_.scrollTop,setVerticalPosition:(f)=>_.scrollTop=f})}onDragging(_){if(!this.currentDragValue||this.moveBlocked)return;let f=this.getListDragItem(_),$=this.virtualList.getComponentAt(f.rowIndex);if(!$)return;let z=$.getGui().parentElement;if(this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===f.rowIndex&&this.lastHoveredListItem.position===f.position)return;this.autoScrollService.check(_.event),this.clearHoveredItems(),this.lastHoveredListItem=f,a6(z,G2),a6(z,`ag-item-highlight-${f.position}`)}getListDragItem(_){let f=this.virtualList.getGui(),$=Number.parseFloat(window.getComputedStyle(f).paddingTop),z=this.virtualList.getRowHeight(),Q=this.virtualList.getScrollTop(),J=Math.max(0,(_.y-$+Q)/z),q=this.params.getNumRows(this.comp)-1,X=Math.min(q,J)|0;return{rowIndex:X,position:Math.round(J)>J||J>q?"bottom":"top",component:this.virtualList.getComponentAt(X)}}onDragStop(){if(this.moveBlocked)return;this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties()}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){let _=this.virtualList.getGui();for(let f of _.querySelectorAll(`.${G2}`))for(let $ of[G2,"ag-item-highlight-top","ag-item-highlight-bottom"])f.classList.remove($);this.lastHoveredListItem=null}};var gS=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function hS(_){return _??(_=_||"default"),{tag:"div",cls:`ag-panel ag-${_}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${_}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${_}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${_}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${_}-panel-content-wrapper`}]}}var uS=class extends p_{constructor(_){super(hS(_.cssIdentifier));this.config=_,this.closable=!0,this.eContentWrapper=V,this.eTitleBar=V,this.eTitleBarButtons=V,this.eTitle=V,this.registerCSS(gS)}postConstruct(){let{component:_,closable:f,hideTitleBar:$,title:z,minWidth:Q=250,width:J,minHeight:q=250,height:X,centered:Y,popup:Z,x:G,y:E,postProcessPopupParams:U}=this.config,H=this.beans,W=this.createManagedBean(new LJ(this.getGui(),{minWidth:Q,width:J,minHeight:q,height:X,centered:Y,x:G,y:E,popup:Z,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=W;let B=this.getGui();if(_)this.setBodyComponent(_);if(!$){if(z)this.setTitle(z);this.setClosable(f!=null?f:this.closable)}else N(this.eTitleBar,!1);if(this.addManagedElementListeners(this.eTitleBar,{mousedown:(L)=>{if(B.contains(L.relatedTarget)||B.contains(d(H))||this.eTitleBarButtons.contains(L.target)){L.preventDefault();return}let F=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");if(F)F.focus()}}),Z&&W.isPositioned())return;if(this.renderComponent)this.renderComponent();let K;if(U){let{type:L,eventSource:F,mouseEvent:D}=U;K=()=>H.popupSvc?.callPostProcessPopup(U,L,B,F,D)}W.initialisePosition(K),this.eContentWrapper.style.height="0"}renderComponent(){let _=this.getGui();_.focus(),this.close=()=>{_.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(_){this.positionableFeature.setHeight(_)}getWidth(){return this.positionableFeature.getWidth()}setWidth(_){this.positionableFeature.setWidth(_)}setClosable(_){if(_!==this.closable)this.closable=_;if(_){let f=this.closeButtonComp=new p_({tag:"div",cls:"ag-button"});this.createBean(f);let $=f.getGui(),z=this.beans.iconSvc.createIconNoSpan("close",this.beans);z.classList.add("ag-panel-title-bar-button-icon"),$.appendChild(z),this.addTitleBarButton(f),f.addManagedElementListeners($,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp)this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}setBodyComponent(_){_.setParentComponent(this),this.eContentWrapper.appendChild(_.getGui())}addTitleBarButton(_,f){let $=this.eTitleBarButtons,z=$.children,Q=z.length;if(f==null)f=Q;f=Math.max(0,Math.min(f,Q)),_.addCss("ag-panel-title-bar-button");let J=_.getGui();if(f===0)$.prepend(J);else if(f===Q)$.append(J);else z[f-1].after(J);_.setParentComponent(this)}getBodyHeight(){return iz(this.eContentWrapper)}getBodyWidth(){return df(this.eContentWrapper)}setTitle(_){this.eTitle.innerText=_}onBtClose(){this.close()}destroy(){if(this.closeButtonComp)this.closeButtonComp=this.destroyBean(this.closeButtonComp);let _=this.getGui();if(_&&A_(_))this.close();super.destroy()}},iS=class extends uS{constructor(_,f){super({..._,popup:!0});this.callbacks=f,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(_){this.popupSvc=_.popupSvc}postConstruct(){let _=this.getGui(),{movable:f,resizable:$,maximizable:z,modal:Q}=this.config;if(this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new yJ(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(_)},onTabKeyDown:(J)=>{if(Q)return;let q=J.shiftKey,X=V_(this.beans,_,!1,q);if(!X||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(X)){if(this.callbacks?.focusNextContainer(this.beans,q))J.preventDefault()}}}),f)this.setMovable(f);if(z)this.setMaximizable(z);if($)this.setResizable($);if(!this.config.modal)this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(_){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(_)}renderComponent(){let _=this.getGui(),{alwaysOnTop:f,modal:$,title:z,afterGuiAttached:Q}=this.config,J=this.getLocaleTextFunc(),q=this.popupSvc?.addPopup({modal:$,eChild:_,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:f,ariaLabel:z||J("ariaLabelDialog","Dialog"),afterGuiAttached:Q});if(q)this.close=q.hideFunc}onClosed(_){this.destroy(),this.config.closedCallback?.(_)}setMaximized(_){if(this.isMaximizable&&_!==this.isMaximized)this.toggleMaximize()}toggleMaximize(){let _=this.positionableFeature.getPosition();if(this.isMaximized){let{x:f,y:$,width:z,height:Q}=this.lastPosition;this.setWidth(z),this.setHeight(Q),this.positionableFeature.offsetElement(f,$)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=_.x,this.lastPosition.y=_.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){N(this.maximizeIcon,!this.isMaximized),N(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(let _ of this.maximizeListeners)_();this.maximizeListeners.length=0}if(this.resizeListenerDestroy)this.resizeListenerDestroy(),this.resizeListenerDestroy=null}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(_){this.positionableFeature.setResizable(_)}setMovable(_){this.positionableFeature.setMovable(_,this.eTitleBar)}setMaximizable(_){if(!_){if(this.clearMaximizebleListeners(),this.maximizeButtonComp)this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0;return}let f=this.eTitleBar;if(!f||_===this.isMaximizable)return;this.isMaximizable=_;let $=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),$.addManagedElementListeners($.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton($,0),this.maximizeListeners.push(...this.addManagedElementListeners(f,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){let _=this.maximizeButtonComp=this.createBean(new p_({tag:"div",cls:"ag-dialog-button"})),f=_.getGui(),$=this.beans.iconSvc;return this.maximizeIcon=$.createIconNoSpan("maximize"),f.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=$.createIconNoSpan("minimize"),f.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),_}};var mS=class extends r0{constructor(_){super();this.setTemplateFromElement(_.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.handleKeyDown(_)})}handleKeyDown(_){if(_.key===S.ESCAPE)this.closePanel()}onTabKeyDown(_){if(_.defaultPrevented)return;this.closePanel(),_.preventDefault()}closePanel(){let _=this.parentComponent;_.closeSubMenu(),setTimeout(()=>_.getGui().focus(),0)}},k2=class extends j_{constructor(_){super();this.callbacks=_,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(_){let{menuItemDef:f,isAnotherSubMenuOpen:$,level:z,childComponent:Q,contextParams:J}=_;return this.params=_.menuItemDef,this.level=z,this.isAnotherSubMenuOpen=$,this.childComponent=Q,this.contextParams=J,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...f,level:z,isAnotherSubMenuOpen:$,openSubMenu:(q)=>this.openSubMenu(q),closeSubMenu:()=>this.closeSubMenu(),closeMenu:(q)=>this.closeMenu(q),updateTooltip:(q,X)=>this.refreshTooltip(q,X),onItemActivated:()=>this.onItemActivated()}).then((q)=>{if(!q)return;this.menuItemComp=q;let X=q.configureDefaults?.();if(X)this.configureDefaults(X===!0?void 0:X)})}addListeners(_,f){if(!f?.suppressClick)this.addManagedElementListeners(_,{click:($)=>this.onItemSelected($)});if(!f?.suppressKeyboardSelect)this.addManagedElementListeners(_,{keydown:($)=>{if($.key===S.ENTER||$.key===S.SPACE)$.preventDefault(),this.onItemSelected($)}});if(!f?.suppressMouseDown)this.addManagedElementListeners(_,{mousedown:($)=>{$.stopPropagation(),$.preventDefault()}});if(!f?.suppressMouseOver)this.addManagedElementListeners(_,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(_=!1,f){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;let $=z_({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=$;let z,Q=()=>{this.subMenuIsOpening=!1};if(this.childComponent){let Z=this.createBean(new mS(this.childComponent));Z.setParentComponent(this);let G=Z.getGui(),E="mouseenter",U=()=>this.cancelDeactivate();if(G.addEventListener(E,U),z=()=>{G.removeEventListener(E,U),this.destroyBean(Z)},$.appendChild(G),this.childComponent.afterGuiAttached)Q=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1}}else if(this.params.subMenu){let Z=this.createBean(new oY(this.level+1,this.contextParams,this.callbacks));if(Z.setParentComponent(this),Z.addMenuItems(this.params.subMenu),$.appendChild(Z.getGui()),this.addManagedListeners(Z,{closeMenu:(G)=>this.dispatchLocalEvent(G)}),Z.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),z=()=>this.destroyBean(Z),_)Q=()=>{Z.activateFirstItem(),this.subMenuIsOpening=!1}}let J=this.beans.popupSvc,q=()=>{let Z=this.eGui;J?.positionPopupForMenu({eventSource:Z,ePopup:$,event:f instanceof MouseEvent?f:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},X=this.getLocaleTextFunc(),Y=J?.addPopup({modal:!0,eChild:$,positionCallback:q,anchorToElement:this.eGui,ariaLabel:X("ariaLabelSubMenu","SubMenu"),afterGuiAttached:Q});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{if(Y)Y.hideFunc();this.subMenuIsOpen=!1,this.setAriaExpanded(!1),z(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(_){if(!this.suppressAria)N_(this.eGui,_)}closeSubMenu(){if(!this.hideSubMenu)return;this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1)}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(_,f){if(this.cancelActivate(),this.params.disabled&&!f)return;if(this.isActive=!0,!this.suppressRootStyles)this.eGui.classList.add(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!0),!this.suppressFocus)this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!f}));if(_&&this.params.subMenu)window.setTimeout(()=>{if(this.isAlive()&&this.isActive)this.openSubMenu()},300);this.onItemActivated()}deactivate(){if(this.cancelDeactivate(),!this.suppressRootStyles)this.eGui.classList.remove(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen)this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(_){this.parentComponent=_}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(_){if(this.menuItemComp.select?.(),this.params.action)this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams})));else this.openSubMenu(_&&_.type==="keydown",_);if(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)return;this.closeMenu(_)}closeMenu(_){let f={type:"closeMenu"};if(_)if(_ instanceof MouseEvent)f.mouseEvent=_;else f.keyboardEvent=_;this.dispatchLocalEvent(f)}onItemActivated(){let _={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(_)}cancelActivate(){if(this.activateTimeoutId)window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0}cancelDeactivate(){if(this.deactivateTimeoutId)window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0}onMouseEnter(){if(this.cancelDeactivate(),this.isAnotherSubMenuOpen())this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY);else this.activate(!0)}onMouseLeave(){if(this.cancelActivate(),this.isSubMenuOpen())this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY);else this.deactivate()}refreshRootElementGui(_){let f=this.menuItemComp.getGui(),{cssClassPrefix:$,params:{cssClasses:z,disabled:Q}}=this,J=this.menuItemComp.getRootElement?.();if(J){if(!_)f.classList.add("ag-menu-option-custom");f=J}if(this.suppressRootStyles=!!_,!this.suppressRootStyles){f.classList.add($);for(let q of z??[])f.classList.add(q);if(Q)f.classList.add(`${$}-disabled`)}return f}applyAriaProperties(_){let{params:{checked:f,subMenu:$,subMenuRole:z,disabled:Q}}=this,J=f!=null;if(Z_(_,J?"menuitemcheckbox":"menuitem"),$)qq(_,z??"menu");if(Q)fq(_,!0)}configureDefaults(_){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(_));return}let{suppressRootStyles:f,suppressTooltip:$,suppressAria:z,suppressTabIndex:Q,suppressFocus:J}=_||{},{params:{tooltip:q,disabled:X}}=this,Y=this.eGui=this.refreshRootElementGui(!!f);if(this.suppressAria=!!z,!z)this.applyAriaProperties(Y);if(!Q)Y.setAttribute("tabindex","-1");if(!$)this.refreshTooltip(q);if(!X)this.addListeners(Y,_);this.suppressFocus=!!J}refreshTooltip(_,f){if(this.tooltip=_,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!_||!this.menuItemComp)return;let $=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:f});if($)this.tooltipFeature=this.createBean($)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},oY=class extends r0{constructor(_=0,f,$){super({tag:"div",cls:"ag-menu-list",role:"menu"});this.level=_,this.menuActionParams=f,this.callbacks=$,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(_)=>this.onTabKeyDown(_),handleKeyDown:(_)=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(_)),onFocusIn:(_)=>this.handleFocusIn(_),onFocusOut:(_)=>this.handleFocusOut(_)})}onTabKeyDown(_){if(!this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed"))_.preventDefault();if(_.shiftKey)this.closeIfIsChild(_)}handleKeyDown(_){switch(_.key){case S.UP:case S.RIGHT:case S.DOWN:case S.LEFT:_.preventDefault(),this.handleNavKey(_.key);break;case S.ESCAPE:if(this.closeIfIsChild())this.callbacks.stopPropagationCallbacks.stopPropagation(_);break}}handleFocusIn(_){let f=_.relatedTarget;if(!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(f)&&(this.getGui().contains(f)||this.activeMenuItem?.getSubMenuGui()?.contains(f)))return;if(this.activeMenuItem)this.activeMenuItem.activate();else this.activateFirstItem()}handleFocusOut(_){let f=_.relatedTarget;if(!this.activeMenuItem||this.getGui().contains(f)||this.activeMenuItem.getSubMenuGui()?.contains(f))return;if(!this.activeMenuItem.isSubMenuOpening())this.activeMenuItem.deactivate()}clearActiveItem(){if(this.activeMenuItem)this.activeMenuItem.deactivate(),this.activeMenuItem=null}addMenuItems(_){if(_==null)return;g.all(_.map((f)=>{if(f==="separator")return g.resolve({eGui:this.createSeparator()});else if(typeof f==="string")return this.callbacks.warnNoItem?.(f),g.resolve({eGui:null});else return this.addItem(f)})).then((f)=>{for(let $ of f??[])if($?.eGui){if(this.appendChild($.eGui),$.comp)this.menuItems.push($.comp)}})}addItem(_){let f=this.createManagedBean(new k2(this.callbacks));return f.init({menuItemDef:_,isAnotherSubMenuOpen:()=>this.menuItems.some(($)=>$.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>{return f.setParentComponent(this),this.addManagedListeners(f,{closeMenu:($)=>{this.dispatchLocalEvent($)},menuItemActivated:($)=>{if(this.activeMenuItem&&this.activeMenuItem!==$.menuItem)this.activeMenuItem.deactivate();this.activeMenuItem=$.menuItem}}),{comp:f,eGui:f.getGui()}})}activateFirstItem(){let _=this.menuItems.filter((f)=>!f.isDisabled())[0];if(!_)return;_.activate()}createSeparator(){let _={tag:"div",cls:"ag-menu-separator-part"};return B_({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[_,_,_,_]})}handleNavKey(_){switch(_){case S.UP:case S.DOWN:{let $=this.findNextItem(_===S.UP);if($&&$!==this.activeMenuItem)$.activate(!1,!0);return}}let f=this.gos.get("enableRtl")?S.RIGHT:S.LEFT;if(_===f)this.closeIfIsChild();else this.openChild()}closeIfIsChild(_){let f=this.getParentComponent();if(f&&f instanceof k2){if(_)_.preventDefault();return f.closeSubMenu(),f.getGui().focus(),!0}return!1}openChild(){if(this.activeMenuItem)this.activeMenuItem.openSubMenu(!0)}findNextItem(_){let f=[...this.menuItems];if(!f.length)return;if(!this.activeMenuItem)return _?b(f):f[0];if(_)f.reverse();let $,z=!1;for(let Q of f){if(!z){if(Q===this.activeMenuItem)z=!0;continue}$=Q;break}if(z&&!$)return f[0];return $||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};var cS=class extends p_{constructor(_){super({tag:"div"});this.callbacks=_}init(_){this.params=_,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){let{checked:_,subMenu:f}=this.params,$=this.getGui();if(_)Qq($,_);if(f)N_($,!1)}addIcon(){if(this.params.isCompact)return;let _=B_({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:f,icon:$}=this.params;if(f)_.appendChild(this.beans.iconSvc.createIconNoSpan("check"));else if($)if(D$($))_.appendChild($);else if(typeof $==="string")_.innerHTML=$;else this.callbacks?.warnNoIcon?.();this.getGui().appendChild(_)}addName(){let _=B_({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(_)}addShortcut(){if(this.params.isCompact)return;let _=B_({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(_)}addSubMenu(){let _=B_({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),f=this.getGui();if(this.params.subMenu){let $=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";_.appendChild(this.beans.iconSvc.createIconNoSpan($))}f.appendChild(_)}getClassName(_){return`${this.cssClassPrefix}-${_}`}};function S2(_,f){if(!f)return null;let $=F0(_),z=$.indexOf(f);if(z===-1)return null;let Q=-1;for(let J=z-1;J>=0;J--)if($[J].classList.contains(o1.TAB_GUARD_TOP)){Q=J;break}if(Q<=0)return null;return $[Q-1]}function eY(_,f){if(!f)return!1;let $=_.querySelectorAll(`.${DJ}`);if(!$.length)return!1;for(let z=0;z<$.length;z++)if($[z].contains(f))return!0;return!1}function pS(_){return{tag:"div",cls:`ag-tabs ${_}`,children:[{tag:"div",ref:"eHeader"},{tag:"div",ref:"eBody",role:"presentation",cls:"ag-tabs-body"+_?` ${_}-body`:""}]}}var nS=class extends r0{constructor(_){super(pS(_.cssClass));this.eHeader=V,this.eBody=V,this.items=[],this.tabbedItemScrollMap=new Map,this.params=_}postConstruct(){if(this.setupHeader(),this.params.items)for(let _ of this.params.items)this.addItem(_);this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>this.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){let{enableCloseButton:_,cssClass:f}=this.params,$=(z,Q)=>{if(z.classList.add(`ag-tabs-${Q}`),f)z.classList.add(`${f}-${Q}`)};if(_)this.setupCloseButton($),this.eTabHeader=B_({tag:"div",role:"presentation"}),$(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader);else this.eTabHeader=this.eHeader;Z_(this.eTabHeader,"tablist"),$(this.eTabHeader,"header")}setupCloseButton(_){let f=B_({tag:"button"});_(f,"close-button");let $=this.beans.iconSvc.createIconNoSpan("close");W_(f,this.params.closeButtonAriaLabel),f.appendChild($),this.addManagedElementListeners(f,{click:()=>this.params.onCloseClicked?.()});let z=B_({tag:"div",role:"presentation"});_(z,"close-button-wrapper"),z.appendChild(f),this.eHeader.appendChild(z),this.eCloseButton=f}handleKeyDown(_){switch(_.key){case S.RIGHT:case S.LEFT:{if(!this.eTabHeader.contains(d(this.beans)))return;let f=_.key===S.RIGHT,$=this.gos.get("enableRtl"),z=this.items.indexOf(this.activeItem),Q=f!==$?Math.min(z+1,this.items.length-1):Math.max(z-1,0);if(z===Q)return;_.preventDefault();let J=this.items[Q];this.showItemWrapper(J),J.eHeaderButton.focus();break}case S.UP:case S.DOWN:_.stopPropagation();break}}onTabKeyDown(_){if(_.defaultPrevented)return;let{beans:f,eHeader:$,eBody:z,activeItem:Q,params:J}=this,{suppressTrapFocus:q,enableCloseButton:X}=J,Y=d(f),Z=_.target,G=_.shiftKey;if($.contains(Y)){if(_.preventDefault(),X&&G&&!this.eCloseButton?.contains(Y))this.eCloseButton?.focus();else if(q&&G)S2(q_(f).body,Z)?.focus();else this.focusBody(_.shiftKey);return}let E=null;if(eY(z,Z)){if(G)E=S2(z,Z);if(!E&&!q)E=Q.eHeaderButton}if(!E&&z.contains(Y)){if(E=V_(f,z,!1,G),!E){if(q&&!G)this.forceFocusOutOfContainer(G);else if(X&&!G)_.preventDefault(),this.eCloseButton?.focus();else _.preventDefault(),this.focusHeader();return}}if(E)_.preventDefault(),E.focus()}focusInnerElement(_){if(_)return this.focusBody(!0);else return this.focusHeader(),!0}focusHeader(_){this.activeItem.eHeaderButton.focus({preventScroll:_})}focusBody(_){return F_(this.eBody,_)}setAfterAttachedParams(_){this.afterAttachedParams=_}showFirstItem(){if(this.items.length>0)this.showItemWrapper(this.items[0])}addItem(_){let f=B_({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});f.appendChild(_.title),this.eTabHeader.appendChild(f),W_(f,_.titleLabel);let $={tabbedItem:_,eHeaderButton:f};this.items.push($),f.addEventListener("click",this.showItemWrapper.bind(this,$))}showItem(_){let f=this.items.find(($)=>$.tabbedItem===_);if(f)this.showItemWrapper(f)}showItemWrapper(_){let{tabbedItem:f,eHeaderButton:$}=_;if(this.params.onItemClicked?.({item:f}),this.activeItem===_){this.params.onActiveItemClicked?.();return}if(this.lastScrollListener)this.lastScrollListener=this.lastScrollListener();if(f_(this.eBody),f.bodyPromise.then((z)=>{this.eBody.appendChild(z);let Q=!b1();if(!this.params.suppressFocusBodyOnOpen)F_(this.eBody,!1,Q);if(f.afterAttachedCallback)f.afterAttachedCallback(this.afterAttachedParams);if(this.params.keepScrollPosition){let J=f.getScrollableContainer?.()||z;[this.lastScrollListener]=this.addManagedElementListeners(J,{scroll:()=>{this.tabbedItemScrollMap.set(f.name,J.scrollTop)}});let q=this.tabbedItemScrollMap.get(f.name);if(q!==void 0)setTimeout(()=>{J.scrollTop=q},0)}}),this.activeItem)this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.();$.classList.add("ag-tab-selected"),this.activeItem=_}},dS=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function tS(_){let f=_.cssIdentifier||"default",$=_.direction||"vertical";return{tag:"div",cls:`ag-group ag-${f}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${f}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${$} ag-${f}-group-container`}]}}var rS=class extends p_{constructor(_={}){super(tS(_),[h0]);this.params=_,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=V,this.cbGroupEnabled=V,this.eContainer=V,this.registerCSS(dS);let{enabled:f,items:$,suppressEnabledCheckbox:z,expanded:Q,suppressToggleExpandOnEnableChange:J,useToggle:q}=_;if(this.cssIdentifier=_.cssIdentifier||"default",this.enabled=f!=null?f:!0,this.items=$||[],this.useToggle=q??!1,this.alignItems=_.alignItems||"center",this.expanded=Q==null?!0:Q,z!=null)this.suppressEnabledCheckbox=z;if(J!=null)this.suppressToggleExpandOnEnableChange=J}postConstruct(){if(this.setupTitleBar(),this.items.length){let Q=this.items;this.items=[],this.addItems(Q)}let _=this.getLocaleTextFunc();if(this.cbGroupEnabled.setLabel(_("enabled","Enabled")),this.enabled)this.setEnabled(this.enabled,void 0,!0);this.setAlignItems(this.alignItems);let{onEnableChange:f,onExpandedChange:$,suppressOpenCloseIcons:z}=this.params;if(this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(z??!1),this.refreshChildDisplay(),N(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange((Q)=>{this.setEnabled(Q,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(Q)}),f!=null)this.onEnableChange(f);if($!=null)this.onExpandedChange($)}refreshChildDisplay(){N(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(_){if(this.alignItems!==_)this.removeCss(`ag-group-item-alignment-${this.alignItems}`);this.alignItems=_;let f=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(f),this}toggleGroupExpand(_,f){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)_=!0,f=!0;else if(_=_!=null?_:!this.expanded,this.expanded===_)return this;if(this.expanded=_,this.refreshChildDisplay(),N(this.eContainer,_),!f)this.dispatchLocalEvent({type:_?"expanded":"collapsed"});return this}addItems(_){for(let f of _)this.addItem(f)}prependItem(_){this.insertItem(_,!0)}addItem(_){this.insertItem(_,!1)}updateItems(_){let f=this.items,$=0;for(let z=0;z_(f.enabled)}),this}onExpandedChange(_){return this.addManagedListeners(this,{expanded:()=>_(!0),collapsed:()=>_(!1)}),this}hideEnabledCheckbox(_){return this.suppressEnabledCheckbox=_,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(_){return this.eTitleBar?.hideOpenCloseIcons(_),this}refreshDisabledStyles(){let _=!this.enabled;this.eContainer.classList.toggle("ag-disabled",_),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&_),this.eContainer.classList.toggle("ag-disabled-group-container",_)}setupTitleBar(){let _=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",_.getGui())}createDefaultTitleBar(){let _=this.createManagedBean(new sS(this.params));return this.eTitleBar=_,_.refreshOnExpand(this.expanded),this.addManagedListeners(_,{expandedChanged:(f)=>this.toggleGroupExpand(f.expanded)}),_}createToggleTitleBar(){let _=this.createManagedBean(new q2({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:(f)=>{this.setEnabled(f,!0),this.dispatchEnableChangeEvent(f)}}));return _.addCss("ag-group-title-bar"),_.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=_,this.toggleGroupExpand(this.enabled),_}},E2="ag-disabled-group-title-bar";function lS(_){let f=_.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${f}-group-title-bar ag-unselectable`,role:_.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${f}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${f}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${f}-group-title`}]}}var sS=class extends p_{constructor(_={}){super(lS(_));this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=V,this.eGroupClosedIcon=V,this.eTitle=V;let{title:f,suppressOpenCloseIcons:$,suppressKeyboardNavigation:z}=_;if(!!f&&f.length>0)this.title=f;if($!=null)this.suppressOpenCloseIcons=$;this.suppressKeyboardNavigation=z??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){let _=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(_.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(_.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:(f)=>{switch(f.key){case S.ENTER:case S.SPACE:f.preventDefault(),this.dispatchExpandChanged();break;case S.RIGHT:case S.LEFT:f.preventDefault(),this.dispatchExpandChanged(f.key===S.RIGHT);break}}})}refreshOnExpand(_){this.refreshAriaStatus(_),this.refreshOpenCloseIcons(_)}refreshAriaStatus(_){if(!this.suppressOpenCloseIcons)N_(this.getGui(),_)}refreshOpenCloseIcons(_){let f=!this.suppressOpenCloseIcons;N(this.eGroupOpenedIcon,f&&_),N(this.eGroupClosedIcon,f&&!_)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(_){let f={type:"expandedChanged",expanded:_};this.dispatchLocalEvent(f)}setTitle(_){let f=this.getGui(),$=!!_&&_.length>0;if(_=$?_:void 0,this.eTitle.textContent=_??"",N(f,$),_!==this.title)this.title=_;let z=f.classList.contains(E2);return this.refreshDisabledStyles(z),this}addWidget(_){return this.getGui().appendChild(_),this}hideOpenCloseIcons(_){if(this.suppressOpenCloseIcons=_,_)this.dispatchExpandChanged(!0);return this}refreshDisabledStyles(_){let f=this.getGui();if(_)f.classList.add(E2),f.removeAttribute("tabindex"),Z_(f,"presentation");else if(f.classList.remove(E2),typeof this.title==="string"&&!this.suppressKeyboardNavigation)this.activateTabIndex([f]),Z_(f,"group");else f.removeAttribute("tabindex"),Z_(f,"presentation")}};var $_="35.2.0",y_={moduleName:"EnterpriseCore",version:$_,beans:[fY],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:fY.setLicenseKey};var aS={stopPropagationCallbacks:Ff,focusNextContainer:(_,f)=>{return q0(_,f)},configureFocusableContainer:(_,f)=>{let $=_.ctrlsSvc.get("gridCtrl");$.addFocusableContainer(f),f.addDestroyFunc(()=>$.removeFocusableContainer(f))}},oS=class extends iS{constructor(_){super(_,aS)}getFocusableContainerName(){return"dialog"}};var _Z=class extends wS{constructor(_){super(Ff,_)}};var eS=class extends NS{};function _A(_){return _.sideBar?.comp.isDisplayed()??!1}function fA(_,f){_.sideBar?.comp.setDisplayed(f)}function $A(_,f){_.sideBar?.comp.setSideBarPosition(f)}function zA(_,f,$){_.sideBar?.comp.openToolPanel(f,"api",$)}function QA(_){_.sideBar?.comp.close("api")}function JA(_){return _.sideBar?.comp.openedItem()??null}function qA(_){_.sideBar?.comp.refresh()}function XA(_){return _.sideBar?.comp.isToolPanelShowing()??!1}function YA(_,f){let $=_.sideBar?.comp.getToolPanelInstance(f);return d0($)}function ZA(_){return _.sideBar?.comp.getDef()}var GA=`.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{ - /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}`,EA={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},UA=class extends w{constructor(_){super();this.toolPanelDef=_,this.eToggleButton=V,this.eIconWrapper=V,this.eLabel=V}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(EA,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){let _=this.toolPanelDef,f=this.getLocaleTextFunc()(_.labelKey,_.labelDefault);this.eLabel.textContent=f}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",h(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(_){this.toggleCss("ag-selected",_),N_(this.eToggleButton,_)}},HA={tag:"div",cls:"ag-side-buttons",role:"tablist"},WA=class extends w{constructor(){super(HA);this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(_){if(_.key!==S.TAB||!_.shiftKey)return;if(q0(this.beans,!0)){_.preventDefault();return}n_(_)}setActiveButton(_){for(let f of this.buttonComps)f.setSelected(_===f.getToolPanelId())}addButtonComp(_){let f=this.createBean(new UA(_));return this.buttonComps.push(f),this.appendChild(f),f.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:_.id})}),f}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),f_(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},BA={selector:"AG-SIDE-BAR-BUTTONS",component:WA},fZ={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},$Z={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},KA={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},u$={columns:fZ,filters:$Z,"filters-new":KA};function A2(_){if(!_)return;if(_===!0)return{toolPanels:[fZ,$Z],defaultToolPanel:"columns"};if(typeof _==="string")return A2([_]);if(Array.isArray(_)){let f=[];for(let $ of _){let z=u$[$];if(!z){j(215,{key:$,defaultByKey:u$});continue}f.push(z)}if(f.length===0)return;return{toolPanels:f,defaultToolPanel:f[0].id}}return{toolPanels:LA(_.toolPanels),defaultToolPanel:_.defaultToolPanel,hiddenByDefault:_.hiddenByDefault,position:_.position,hideButtons:_.hideButtons}}function LA(_){let f=[];if(!_)return f;return _.forEach(($)=>{let z=FA($);if(!z)return;f.push(z)}),f}function FA(_){if(typeof _!=="string")return _;if(u$[_])return u$[_];return j(215,{key:_,defaultByKey:u$}),null}var DA=class extends w{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"});this.minWidth=100,this.maxWidth=null}postConstruct(){let _=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(_),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(_,f,$){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:$,started:_,ended:f})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(_){return this.onResizing(_,!0)}onResizing(_,f=!1){let $=this.inverted?-1:1,z=Math.max(this.minWidth,Math.floor(this.startingWidth-_*$));if(this.maxWidth!=null)z=Math.min(this.maxWidth,z);this.elementToResize.style.setProperty("--ag-horizontal-size",`${z}px`),this.dispatchResizeEvent(!1,f,z)}};function MA(_,f,$){return _.getCompDetails(f,kA,void 0,$,!0)}var kA={name:"toolPanel",optionalMethods:["refresh","getState"]},SA={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},AA=class extends w{constructor(){super(SA);this.eContent=V,this.animationId=0,this.defParent=null}postConstruct(){let _=this.getGui(),f=this.resizeBar=this.createManagedBean(new DA);_.setAttribute("id",`ag-${this.getCompId()}`),f.elementToResize=_,this.appendChild(f)}getToolPanelId(){return this.toolPanelId}getDefParent(){return this.defParent}setDefParent(_){this.defParent=_}setToolPanelDef(_,f){let{id:$,minWidth:z,maxWidth:Q,width:J,parent:q}=_;if(this.toolPanelId=$,this.defParent=q??null,J)this.getGui().style.setProperty("--ag-side-bar-panel-width",`${J}px`);let X=MA(this.beans.userCompFactory,_,f);if(X==null)return!1;let Y=X.newAgStackInstance();this.params=X.params,Y.then(this.setToolPanelComponent.bind(this));let Z=this.resizeBar;if(z!=null)Z.minWidth=z;if(Q!=null)Z.maxWidth=Q;return!0}setToolPanelComponent(_){this.toolPanelCompInstance=_;let{eContent:f}=this;f.appendChild(_.getGui()),this.addDestroyFunc(()=>{this.destroyBean(_)})}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(_){let f=this.gos.get("enableRtl"),$=_==="left",z=f?$:!$;this.resizeBar.inverted=z}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(_){if(this.isDisplayed()===_)return;let f=++this.animationId,{eContent:$}=this,z=()=>{if(this.animationId===f)Q.classList.remove("ag-tool-panel-animating"),$.style.width="",Q.style.width=""},Q=this.getGui(),J=Q.offsetWidth;this.setDisplayed(_),Q.classList.add("ag-tool-panel-animating");let q=getComputedStyle(Q).transitionDuration;if(!parseFloat(q)){z();return}Q.style.transition="none",Q.style.width="",$.style.width=`${$.offsetWidth}px`,Q.style.width=`${J}px`;let X=Q.offsetWidth;Q.style.transition="",Q.style.width=_?"":"0";let Y=setTimeout(z,100);Q.addEventListener("transitionstart",()=>clearTimeout(Y),{once:!0}),Q.addEventListener("transitionend",z,{once:!0})}},RA={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},jA=class extends w{constructor(){super(RA,[BA]);this.sideBarButtons=V,this.toolPanelWrappers=[],this.registerCSS(GA)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));let{beans:_,gos:f}=this,{sideBar:$}=f.get("initialState")??{};this.setSideBarDef({sideBarDef:A2(f.get("sideBar")),sideBarState:$}),this.addManagedPropertyListener("sideBar",()=>this.setState()),_.sideBar.comp=this;let z=this.getFocusableElement();this.createManagedBean(new t0(z,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),Mf(_,this,z),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(_){if(_.defaultPrevented)return;let{beans:f,sideBarButtons:$}=this,z=this.getGui(),Q=$.getGui(),J=d(f),q=z.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),X=_.target,Y=_.shiftKey;if(!q){if(q0(f,Y,!0))return _.preventDefault(),!0;return KX(_),!1}if(Q.contains(J)){if(F_(q,Y))_.preventDefault();return}if(!Y)return;let Z=null;if(q.contains(J))Z=V_(f,q,void 0,!0);else if(eY(q,X))Z=S2(q,X);if(!Z)Z=Q.querySelector(".ag-selected button"),Z=A_(Z)?Z:null;if(Z&&Z!==_.target)_.preventDefault(),Z.focus()}handleKeyDown(_){let f=d(this.beans),$=this.sideBarButtons;if(!$.getGui().contains(f))return;let z=$.getGui(),Q=Array.prototype.slice.call(z.querySelectorAll(".ag-side-button")),J=Q.findIndex((Y)=>Y.contains(f)),q=null;switch(_.key){case S.LEFT:case S.UP:q=Math.max(0,J-1);break;case S.RIGHT:case S.DOWN:q=Math.min(J+1,Q.length-1);break}if(q===null)return;let X=Q[q].querySelector("button");if(X)X.focus(),_.preventDefault()}onToolPanelButtonClicked(_){let f=_.toolPanelId;if(this.openedItem()===f)this.openToolPanel(void 0,"sideBarButtonClicked");else this.openToolPanel(f,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:_,sideBarState:f,existingToolPanelWrappers:$}){if(this.setDisplayed(!1),this.sideBar=_,_)this.sideBarButtons.setDisplayed(!_.hideButtons);if(_?.toolPanels){let z=_.toolPanels;if(this.createToolPanelsAndSideButtons(z,f,$),!this.toolPanelWrappers.length)return;let Q=f?f.visible:!_.hiddenByDefault;if(this.setDisplayed(Q),this.setSideBarPosition(f?f.position:_.position),Q)if(f){let{openToolPanel:J}=f;if(J)this.openToolPanel(J,"sideBarInitializing")}else this.openToolPanel(_.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(_){if(!_)_="right";this.position=_;let f=_==="left",$=f?"right":"left";this.toggleCss("ag-side-bar-left",f),this.toggleCss("ag-side-bar-right",!f);for(let z of this.toolPanelWrappers)z.setResizerSizerSide($);return this.dispatchSideBarUpdated(),this}setDisplayed(_,f){super.setDisplayed(_,f),this.dispatchSideBarUpdated()}getState(){let _={};for(let f of this.toolPanelWrappers)_[f.getToolPanelId()]=f.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:_}}createToolPanelsAndSideButtons(_,f,$){for(let z of _)this.createToolPanelAndSideButton(z,f?.toolPanels?.[z.id],$?.[z.id])}validateDef(_){let{id:f,toolPanel:$}=_;if(f==null)return j(212),!1;if(EY($)){if(this.beans.filterManager?.isAdvFilterEnabled())return j(213),!1}return!0}createToolPanelAndSideButton(_,f,$){if(!this.validateDef(_)){this.destroyBean($);return}let z;if($)z=$,z.setDefParent(_.parent??null);else if(z=this.createBean(new AA),!z.setToolPanelDef(_,C(this.gos,{initialState:f,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;z.setDisplayed(!1),this.renderToolPanelUnderParent(z,_.parent),this.toolPanelWrappers.push(z);let Q=this.sideBarButtons.addButtonComp(_);Jq(Q.eToggleButton,z.getGui())}refresh(){for(let _ of this.toolPanelWrappers)_.refresh()}renderToolPanelUnderParent(_,f){let $=_.getGui();if(f)this.beans.environment.applyThemeClasses(f,["ag-external","ag-tool-panel-external"]),$.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let z=f??_.getDefParent()??this.getGui();if($.parentElement!==z)z.appendChild($)}getWrapper(_){return this.toolPanelWrappers.find((f)=>f.getToolPanelId()===_)}openToolPanel(_,f="api",$){let z=this.openedItem(),J=!!_&&!!z||f==="sideBarInitializing";for(let Y of this.toolPanelWrappers){let Z=_===Y.getToolPanelId();if(Z)this.renderToolPanelUnderParent(Y,$??null);if(J)Y.setDisplayed(Z);else Y.animateDisplayed(Z)}let q=this.openedItem();if(z!==q)this.sideBarButtons.setActiveButton(_),this.raiseToolPanelVisibleEvent(_,z??void 0,f)}getToolPanelInstance(_){let f=this.getWrapper(_);if(!f){j(214,{key:_});return}return f.getToolPanelInstance()}raiseToolPanelVisibleEvent(_,f,$){let z=!!_&&!!f,Q=this.eventSvc;if(f)Q.dispatchEvent({type:"toolPanelVisibleChanged",source:$,key:f,visible:!1,switchingToolPanel:z});if(_)Q.dispatchEvent({type:"toolPanelVisibleChanged",source:$,key:_,visible:!0,switchingToolPanel:z})}close(_="api"){this.openToolPanel(void 0,_)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let _=null;for(let f of this.toolPanelWrappers)if(f.isDisplayed())_=f.getToolPanelId();return _}setState(_){let f=A2(this.gos.get("sideBar")),$={};if(f&&this.sideBar)f.toolPanels?.forEach((z)=>{let{id:Q}=z;if(!Q)return;let J=this.sideBar.toolPanels?.find((Z)=>Z.id===Q);if(!J||z.toolPanel!==J.toolPanel)return;let q=this.getWrapper(Q);if(!q)return;let X=C(this.gos,{...z.toolPanelParams??{},initialState:_?.toolPanels?.[Q],onStateUpdated:()=>this.dispatchSideBarUpdated()});if(q.getToolPanelInstance()?.refresh(X)!==!0)return;this.toolPanelWrappers=this.toolPanelWrappers.filter((Z)=>Z!==q),T_(q.getGui()),$[Q]=q});this.clearDownUi(),this.setSideBarDef({sideBarDef:f,sideBarState:_,existingToolPanelWrappers:$})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(let _ of this.toolPanelWrappers)T_(_.getGui()),this.destroyBean(_);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){if(this.sideBar?.toolPanels?.some((f)=>EY(typeof f==="string"?f:f.toolPanel)))this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function EY(_){return _==="agFiltersToolPanel"||_==="agNewFiltersToolPanel"}var VA={selector:"AG-SIDE-BAR",component:jA},OA=class extends A{constructor(){super(...arguments);this.beanName="sideBar"}getSelector(){return VA}},O2={moduleName:"SideBar",version:$_,beans:[OA],apiFunctions:{isSideBarVisible:_A,setSideBarVisible:fA,setSideBarPosition:$A,openToolPanel:zA,closeToolPanel:QA,getOpenedToolPanel:JA,refreshToolPanel:qA,isToolPanelShowing:XA,getToolPanelInstance:YA,getSideBar:ZA},dependsOn:[y_,xJ]},PA='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',zZ=class extends cS{constructor(){super({warnNoIcon:()=>j(227)})}},P2={moduleName:"MenuItem",version:$_,userComponents:{agMenuItem:zZ},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[PA]},vA=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}",TA=300,IA={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},yA=class extends w{constructor(){super(IA,[h0,oJ]);this.eExpand=V,this.eSelect=V,this.eFilterTextField=V}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:(f)=>{if(f.key===S.SPACE)f.preventDefault(),this.onExpandClicked()}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});let _=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(_("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(_("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){let _=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(_),this.eSelect.toggleCss("ag-column-select-column-readonly",_)}init(_){this.params=_;let f=this.gos.get("functionsReadOnly");if(this.eSelect.setReadOnly(f),this.eSelect.toggleCss("ag-column-select-column-readonly",f),this.beans.colModel.ready)this.showOrHideOptions()}createExpandIcons(){let _=this.beans;this.eExpand.appendChild(this.eExpandChecked=h("columnSelectOpen",_)),this.eExpand.appendChild(this.eExpandUnchecked=h("columnSelectClosed",_)),this.eExpand.appendChild(this.eExpandIndeterminate=h("columnSelectIndeterminate",_)),this.setExpandState(0)}showOrHideOptions(){let _=this.params,f=!_.suppressColumnFilter,$=!_.suppressColumnSelectAll,z=!_.suppressColumnExpandAll,Q=!!this.beans.colModel.colDefCols?.treeDepth,J=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(J("searchOoo","Search...")),N(this.eFilterTextField.getGui(),f),N(this.eSelect.getGui(),$),N(this.eExpand,z&&Q)}onFilterTextChanged(){if(!this.onFilterTextChangedDebounced)this.onFilterTextChangedDebounced=c0(this,()=>{let _=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:_})},TA);this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(_){this.expandState=_,N(this.eExpandChecked,_===0),N(this.eExpandUnchecked,_===1),N(this.eExpandIndeterminate,_===2)}setSelectionState(_){this.selectState=_,this.eSelect.setValue(this.selectState)}},bA={selector:"AG-PRIMARY-COLS-HEADER",component:yA};function u1(_){return!!_&&typeof _.children<"u"}function Rf(_){return u1(_)?_.groupId:_.colId}function QZ(_,f,$){let z=(q,X)=>{let Z=q.children.map(Rf).includes(Rf(X)),G=b(q.children),E=G&&Rf(G)!==Rf(X);return Z&&E};if(!u1(_))return!0;let Q=_,J=$;if(z(Q,J))return Q.children.push(J),!0;if(Q.groupId===f){if(!Q.children.map(Rf).includes(Rf(J)))return Q.children.push(J),!0}for(let q=Q.children.length-1;q>=0;q--)if(QZ(Q.children[q],f,$))break;return!1}function JZ(_){let f=(Q,J)=>{return u1(Q)&&u1(J)&&Rf(Q)===Rf(J)},$=(Q,J)=>{if(!u1(J))return Q;let q=Q,X=J;if(X.children&&X.groupId){if(QZ(q,X.groupId,X.children[0]))return q}for(let Y of X.children)$(q,Y);return q},z=[];for(let Q=1;Q<=_.length;Q++){let J=_[Q-1],q=_[Q];if(f(J,q))_[Q]=$(J,q);else z.push(J)}return z}function CA(_,f){let $=[],z=(J,q)=>{if(u1(J)){let X=J,Y=typeof X.groupId<"u"?X.groupId:X.headerName,Z=new cf(X,Y,!1,q),G=[];for(let E of X.children){let U=z(E,q+1);if(U)G.push(U)}return Z.setChildren(G),Z}else{let X=J,Y=X.colId?X.colId:X.field,Z=_.getColDefCol(Y);if(!Z)$.push(X);return Z}},Q=[];for(let J of f){let q=z(J,0);if(q)Q.push(q)}if($.length>0)j(217,{invalidColIds:$});return Q}function wA(_,f){let $=qZ(NA(_)),z=JZ($);f(z)}function xA(_,f){let $=qZ(_),z=JZ($);f(z)}function qZ(_){let f=($,z)=>{let Q;if(X_($))if($.isPadding())Q=z;else{let q=Object.assign({},$.getColGroupDef());q.groupId=$.getGroupId(),q.children=[z],Q=q}else{let q=Object.assign({},$.getColDef());q.colId=$.getColId(),Q=q}let J=$.getOriginalParent();if(J)return f(J,Q);else return Q};return _.map(($)=>f($,$.getColDef()))}function NA(_){return _.getCols().filter((f)=>{let $=f.getColDef();return f.isPrimary()&&!$.showRowGroup})}var UY=class{constructor(_,f,$,z=!1,Q){if(this.displayName=_,this.depth=$,this.group=z,this.localEventService=new D0,z)this.columnGroup=f,this._expanded=Q,this.children=[];else this.column=f}get expanded(){return!!this._expanded}set expanded(_){if(_===this._expanded)return;this._expanded=_,this.localEventService.dispatchEvent({type:"expandedChanged"})}addEventListener(_,f){this.localEventService.addEventListener(_,f)}removeEventListener(_,f){this.localEventService.removeEventListener(_,f)}};function p(_){return!!_?.buttons?.includes("apply")}function g_(_,f){if(!p(f))return;let $=_.sideBar?.comp.openedItem();if(!$)return;_.sideBar?.comp.getToolPanelInstance($)?.refreshDeferredUi()}function XZ(_,f,$,z,Q){let J=gA(f);YZ(_,J,$,z,Q)}function YZ(_,f,$,z,Q){if(_.columnStateUpdateStrategy.getPivotMode(p(Q)))uA(_,f,$,z,Q);else hA(_,f,$,z,Q)}function gA(_){let f=[],$=(z)=>{for(let Q of z){if(!Q.passesFilter)continue;if(Q.group)$(Q.children);else f.push(Q.column)}};return $(_),f}function hA(_,f,$,z,Q){let J=_.columnStateUpdateStrategy,q=[];for(let X of f){if(X.getColDef().lockVisible)continue;if(J.isColumnVisibleInToolPanel(p(Q),X)!==$)q.push({colId:X.getId(),hide:!$})}J.applyColumnState(p(Q),q,z),g_(_,Q)}function uA(_,f,$,z,Q){iA(_,f,$,z,Q)}function iA(_,f,$,z,Q){let J=_.columnStateUpdateStrategy,q=[],Z=$?(G)=>{if(J.isColumnSelectedInPivotModeToolPanel(p(Q),G))return;if(G.isAllowValue()){let E=typeof G.getAggFunc()==="string"?G.getAggFunc():_.aggFuncSvc?.getDefaultAggFunc(G);q.push({colId:G.getId(),aggFunc:E})}else if(G.isAllowRowGroup())q.push({colId:G.getId(),rowGroup:!0});else if(G.isAllowPivot())q.push({colId:G.getId(),pivot:!0})}:(G)=>{if(J.isColumnSelectedInPivotModeToolPanel(p(Q),G))q.push({colId:G.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};f.forEach(Z),J.applyColumnState(p(Q),q,z),g_(_,Q)}function ZZ(_,f){let{columns:$,visibleState:z,pivotState:Q,eventType:J}=f,q=_.columnStateUpdateStrategy,X=q.getPivotMode(p(f)),Y=$.map((Z)=>{let G=Z.getColId();if(X){let E=Q?.[G];return{colId:G,pivot:E?.pivot,rowGroup:E?.rowGroup,aggFunc:E?.aggFunc}}else return{colId:G,hide:!z?.[G]}});q.applyColumnState(p(f),Y,J),g_(_,f)}function mA(_){return{pivot:_.isPivotActive(),rowGroup:_.isRowGroupActive(),aggFunc:_.isValueActive()?_.getAggFunc():void 0}}function GZ(_,f,$){if(!$)return mA(_);let z=f.getRowGroupColumns($).includes(_),Q=f.getPivotColumns($).includes(_),J=f.getValueColumns($).includes(_);return{pivot:Q,rowGroup:z,aggFunc:J?f.getColumnAggFunc($,_):void 0}}var EZ=(_,f)=>{if(!f)return[];let $=_;for(let z=0,Q=f.length;z{let z=_.aggData;if(z===f)return;if(_.aggData=f,_.__localEventService)cA(_,z,f,$)},HY=(_,f,$)=>{h1(_,f,$);let z=_.pinnedSibling;if(z)h1(z,f,$);let Q=_.sibling;if(Q){h1(Q,f,$);let J=Q.pinnedSibling;if(J)h1(J,f,$)}},cA=(_,f,$,z)=>{if(!$){if(!f)return;let q=Object.keys(f);for(let X=0,Y=q.length;X{if(!_)return;let z=_.group;if(z===$)return;if(_.group=$,_.updateHasChildren(),z&&!$)h1(_,null,f.colModel),_.setAllChildrenCount(null);f.selectionSvc?.updateRowSelectable(_),_.dispatchRowEvent("groupChanged")},UZ=(_,f,$)=>{WY(_,f,$),WY(_.pinnedSibling,f,$)},c$=(_,f)=>{let{gos:$,rowGroupColsSvc:z}=f;if(!z||!_)return!1;let Q=$.get("groupLockGroupColumns");if(!_.isRowGroupActive()||Q===0)return!1;if(Q===-1)return!0;let J=z.columns.findIndex((q)=>q.getColId()===_.getColId());return Q>J},i$=(_,f,$)=>{let Q=_(f,`${f==="groupBy"?"Group by":"Un-Group by"} ${$}`,[$]);if(Q.indexOf($)>=0)return Q;else return`${Q} ${$}`};function pA(_){let f=a_(_),$="getSelection"in f?f.getSelection():null,z=[];for(let Q=0;Q<($?.rangeCount??0);Q++){let J=$?.getRangeAt(Q);if(J)z.push(J)}return{selection:$,ranges:z}}function nA(_,f){if(!_.gos.get("enableCellTextSelection"))return f();if(!oz()&&!ef())return f();let{selection:z,ranges:Q}=pA(_);f(),z?.removeAllRanges();for(let J of Q)z?.addRange(J)}var dA={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},HZ={getMenuItemComp:(_,f,$)=>{return _.userCompFactory.getCompDetails(f,dA,"agMenuItem",C(_.gos,$),!0)?.newAgStackInstance()??g.resolve()},getPostProcessPopupParams:({column:_,node:f})=>({column:_,rowNode:f}),preserveRangesWhile:nA,stopPropagationCallbacks:Ff,warnNoItem:(_)=>{j(228,{menuItemOrString:_})}},tA=class extends k2{constructor(){super(HZ)}},WZ=class extends oY{constructor(_,f={column:null,node:null,value:null}){super(_,f,HZ)}},BZ=class extends w{constructor(_,f,$,z={}){super({tag:"div",cls:"ag-menu"});this.column=_,this.mouseEventOrTouch=f,this.parentEl=$,this.params=z,this.displayName=null}postConstruct(){let{column:_,beans:{colNames:f}}=this;this.initializeProperties(_);let $;if(Q0(_))$=f.getDisplayNameForColumn(_,"columnToolPanel");else $=f.getDisplayNameForProvidedColumnGroup(null,_,"columnToolPanel");if(this.displayName=$,this.buildMenuItemMap(),this.isActive()){let z=this.mouseEventOrTouch;if("preventDefault"in z)z.preventDefault();let Q=this.getMappedMenuItems();if(Q.length===0)return;this.displayContextMenu(Q)}}initializeProperties(_){let f=this.beans.columnStateUpdateStrategy,$;if(X_(_))$=_.getLeafColumns();else $=[_];this.columns=$;let z=f.getPivotMode(p(this.params));this.allowScrollIntoView=!z&&$.some(this.isColumnValidForScrollIntoView),this.allowGrouping=$.some((Q)=>Q.isPrimary()&&Q.isAllowRowGroup()),this.allowValues=$.some((Q)=>Q.isPrimary()&&Q.isAllowValue()),this.allowPivoting=z&&$.some((Q)=>Q.isPrimary()&&Q.isAllowPivot())}buildMenuItemMap(){let _=this.getLocaleTextFunc(),{beans:f,displayName:$}=this,z=this.beans.columnStateUpdateStrategy,Q=new Map;this.menuItemMap=Q;let J=p(this.params),q=z.getPivotMode(J),X=new Set(z.getRowGroupColumns(J).map((H)=>H.getColId())),Y=new Set(z.getValueColumns(J).map((H)=>H.getColId())),Z=new Set(z.getPivotColumns(J).map((H)=>H.getColId()));Q.set("scrollIntoView",{allowedFunction:(H)=>!H.isPinned()&&!q&&this.isColumnValidForScrollIntoView(H),activeFunction:()=>!1,activateLabel:()=>_("scrollColumnIntoView",`Scroll ${$} into View`,[$]),activateFunction:()=>{let H=this.columns.find(this.isColumnValidForScrollIntoView);if(H)this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(H)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});let G=(H)=>H.isPrimary()&&H.isAllowRowGroup()&&!c$(H,f);Q.set("rowGroup",{allowedFunction:G,activeFunction:(H)=>X.has(H.getColId()),activateLabel:()=>i$(_,"groupBy",$),deactivateLabel:()=>i$(_,"ungroupBy",$),activateFunction:()=>{let H=this.addColumnsToList(z.getRowGroupColumns(J),G);z.setRowGroupColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(z.getRowGroupColumns(J),G);z.setRowGroupColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});let E=(H)=>H.isPrimary()&&H.isAllowValue();Q.set("value",{allowedFunction:E,activeFunction:(H)=>Y.has(H.getColId()),activateLabel:()=>_("addToValues",`Add ${$} to values`,[$]),deactivateLabel:()=>_("removeFromValues",`Remove ${$} from values`,[$]),activateFunction:()=>{let H=this.addColumnsToList(z.getValueColumns(J),E);z.setValueColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(z.getValueColumns(J),E);z.setValueColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});let U=(H)=>q&&H.isPrimary()&&H.isAllowPivot();Q.set("pivot",{allowedFunction:U,activeFunction:(H)=>Z.has(H.getColId()),activateLabel:()=>_("addToLabels",`Add ${$} to labels`,[$]),deactivateLabel:()=>_("removeFromLabels",`Remove ${$} from labels`,[$]),activateFunction:()=>{let H=this.addColumnsToList(z.getPivotColumns(J),U);z.setPivotColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},deActivateFunction:()=>{let H=this.removeColumnsFromList(z.getPivotColumns(J),U);z.setPivotColumns(J,H,"toolPanelUi"),g_(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(_){if(!_.isVisible())return!1;let $=_.getParent();if(!$)return!0;return $.getDisplayedChildren()?.includes(_)??!0}addColumnsToList(_,f){return[..._].concat(this.columns.filter(($)=>f($)&&!_.includes($)))}removeColumnsFromList(_,f){return _.filter(($)=>!f($)||!this.columns.includes($))}displayContextMenu(_){let f=this.getGui(),$=this.createBean(new WZ),z=this.getLocaleTextFunc(),Q=()=>{};f.appendChild($.getGui()),$.addMenuItems(_),$.addManagedListeners($,{closeMenu:()=>{this.parentEl.focus(),Q()}});let J=this.beans.popupSvc,q=J.addPopup({modal:!0,eChild:f,closeOnEsc:!0,afterGuiAttached:()=>F_($.getGui()),ariaLabel:z("ariaLabelContextMenu","Context Menu"),closedCallback:(X)=>{if(X instanceof KeyboardEvent)this.parentEl.focus();this.destroyBean($)}});if(q)Q=q.hideFunc;J.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:f})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){let _=[],{menuItemMap:f,columns:$,displayName:z,beans:Q}=this;for(let J of f.values()){let q=$.some((Y)=>J.allowedFunction(Y)&&!J.activeFunction(Y)),X=$.some((Y)=>J.allowedFunction(Y)&&J.activeFunction(Y));if(q)_.push({name:J.activateLabel(z),icon:h(J.addIcon,Q,null),action:()=>J.activateFunction()});if(X&&J.removeIcon&&J.deactivateLabel)_.push({name:J.deactivateLabel(z),icon:h(J.removeIcon,Q,null),action:()=>J.deActivateFunction?.()})}return _}},rA={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},KZ=class extends w{constructor(_,f,$,z,Q){super();this.modelItem=_,this.allowDragging=f,this.eventType=$,this.focusWrapper=z,this.params=Q,this.cbSelect=V,this.eLabel=V,this.eGroupOpenedIcon=V,this.eGroupClosedIcon=V,this.eColumnGroupIcons=V,this.processingColumnStateChange=!1;let{columnGroup:J,depth:q,displayName:X}=_;this.columnGroup=J,this.columnDepth=q,this.displayName=X}postConstruct(){this.setTemplate(rA,[h0]);let{beans:_,cbSelect:f,eLabel:$,displayName:z,columnDepth:Q,modelItem:J,focusWrapper:q,columnGroup:X}=this,{registry:Y,gos:Z}=_,G=h("columnDrag",_);this.eDragHandle=G,G.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");let E=f.getGui(),U=f.getInputElement();E.after(G),U.setAttribute("tabindex","-1"),$.textContent=z??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+Q),this.getGui().style.setProperty("--ag-indentation-level",String(Q)),this.tooltipFeature=this.createOptionalManagedBean(Y.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:EQ(Z,()=>$)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners($,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(f,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(J,{expandedChanged:this.onExpandChanged.bind(this)});let H=new u_(this.getGui(),!1);this.addManagedListeners(H,{longTap:(B)=>this.onContextMenu(B.touchStart)}),this.addDestroyFunc(H.destroy.bind(H)),this.addManagedListeners(q,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();let W=zQ(X.getColGroupDef(),Z,null,X);for(let B of W)this.toggleCss(B,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){let _=this.columnGroup.getColGroupDef();if(!_)return;let f=()=>this.tooltipFeature?.setTooltipAndRefresh(_.headerTooltip);f(),this.addManagedEventListeners({newColumnsLoaded:f})}handleKeyDown(_){switch(_.key){case S.LEFT:_.preventDefault(),this.modelItem.expanded=!1;break;case S.RIGHT:_.preventDefault(),this.modelItem.expanded=!0;break;case S.SPACE:if(_.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(_){let{columnGroup:f,gos:$}=this;if($.get("functionsReadOnly"))return;let z=this.createBean(new BZ(f,_,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(z.isAlive())this.destroyBean(z)})}addVisibilityListenersToAllChildren(){let _=this.onColumnStateChanged.bind(this);for(let f of this.columnGroup.getLeafColumns())this.addManagedListeners(f,{visibleChanged:_,columnValueChanged:_,columnPivotChanged:_,columnRowGroupChanged:_})}setupDragging(){if(!this.allowDragging){N(this.eDragHandle,!1);return}let _=this.beans,{gos:f,eventSvc:$,dragAndDrop:z}=_,Q=!f.get("suppressDragLeaveHidesColumns"),J={type:G0.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>Q?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{Q=!f.get("suppressDragLeaveHidesColumns"),$.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{$.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(q)=>{if(Q)ZZ(_,{columns:this.columnGroup.getLeafColumns(),visibleState:q?.visibleState,pivotState:q?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{if(Q)this.onChangeCommon(!1)}};z.addDragSource(J,!0),this.addDestroyFunc(()=>z.removeDragSource(J))}createDragItem(){let _=this.columnGroup.getLeafColumns(),f={},$={},z=this.beans.columnStateUpdateStrategy,Q=p(this.params);for(let J of _){let q=J.getId();f[q]=J.isVisible(),$[q]=GZ(J,z,Q)}return{columns:_,visibleState:f,pivotState:$}}setupExpandContract(){let{beans:_,eGroupClosedIcon:f,eGroupOpenedIcon:$,eColumnGroupIcons:z}=this;f.appendChild(QQ("columnSelectClosed",_,null)),$.appendChild(QQ("columnSelectOpen",_,null));let Q=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(f,{click:Q}),this.addManagedElementListeners($,{click:Q});let J=new u_(z,!0);this.addManagedListeners(J,{tap:Q}),this.addDestroyFunc(J.destroy.bind(J))}onLabelClicked(){let _=!this.cbSelect.getValue();this.onChangeCommon(_)}onCheckboxChanged(_){this.onChangeCommon(_.selected)}getVisibleLeafColumns(){let _=[],f=($)=>{for(let z of $)if(z.passesFilter)if(z.group)f(z.children);else _.push(z.column)};return f(this.modelItem.children),_}onChangeCommon(_){if(this.refreshAriaLabel(),this.processingColumnStateChange)return;XZ(this.beans,this.modelItem.children,_,this.eventType,this.params)}refreshAriaLabel(){let{cbSelect:_,focusWrapper:f,displayName:$}=this,z=this.getLocaleTextFunc(),Q=z("ariaColumnGroup","Column Group"),J=_.getValue(),q=J===void 0?z("ariaIndeterminate","indeterminate"):J?z("ariaVisible","visible"):z("ariaHidden","hidden"),X=z("ariaToggleVisibility","Press SPACE to toggle visibility");W_(f,`${$} ${Q}`),_.setInputAriaLabel(`${X} (${q})`),Nz(f,_.getInputElement().id)}onColumnStateChanged(){let _=this.workOutSelectedValue(),f=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;let $=this.cbSelect;$.setValue(_),$.setReadOnly(f),this.toggleCss("ag-column-select-column-group-readonly",f),this.processingColumnStateChange=!1}workOutSelectedValue(){let f=this.beans.columnStateUpdateStrategy.getPivotMode(p(this.params)),$=this.getVisibleLeafColumns(),z=0,Q=0;for(let J of $)if(f||!J.getColDef().lockVisible)if(this.isColumnChecked(J))z++;else Q++;if(z>0&&Q>0)return;return z>0}workOutReadOnlyValue(){let _=this.beans.columnStateUpdateStrategy.getPivotMode(p(this.params)),f=0;for(let $ of this.columnGroup.getLeafColumns())if(_){if($.isAnyFunctionAllowed())f++}else if(!$.getColDef().lockVisible)f++;return f===0}isColumnChecked(_){let f=this.beans.columnStateUpdateStrategy;if(f.getPivotMode(p(this.params)))return f.isColumnSelectedInPivotModeToolPanel(p(this.params),_);return f.isColumnVisibleInToolPanel(p(this.params),_)}onExpandOrContractClicked(){let _=this.modelItem,f=_.expanded;_.expanded=!f}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){let _=this.modelItem.expanded;N(this.eGroupClosedIcon,!_),N(this.eGroupOpenedIcon,_)}refreshAriaExpanded(){N_(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(_){let f=this.cbSelect,$=f.getValue();if(!f.isReadOnly()&&(_&&!$||!_&&$))f.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(_){this.cbSelect.setValue(_,!0)}},U2=(_)=>{if(X_(_))return _.getLeafColumns();return _?[_]:[]},lA=(_,f,$,z)=>{if(!f||!_)return null;let Q=z.indexOf(f),J=$?Q:Q+1,q=sA(z,_,J);return J-q},sA=(_,f,$)=>{if(!f)return 0;let z=f[0],Q=f.length;if(_.indexOf(z)<$)return Q;return 0},BY=(_,f,$,z)=>{let Q=p(z);if(_.get("suppressMovableColumns")||f.columnStateUpdateStrategy.getPivotMode(Q))return!0;return!!$.find(({colDef:X})=>!!X.suppressMovable||!!X.lockPosition)},KY=(_,f,$,z)=>{if(!$)return;let{component:Q}=$,J=null,q=$.position==="top";if(Q instanceof KZ)J=Q.getColumns()[0],q=!0;else if(Q)J=Q.column;if(!J)return;let X=p(z),Y=X?_.columnStateUpdateStrategy.getPrimaryColumns(X):_.colModel.getCols(),Z=lA(f,J,q,Y);if(Z!=null)_.columnStateUpdateStrategy.moveColumns(X,f,Z,"toolPanelUi"),g_(_,z)},aA=(_)=>{return _.column},oA={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},eA=class extends w{constructor(_,f,$,z,Q){super();this.modelItem=_,this.allowDragging=f,this.groupsExist=$,this.focusWrapper=z,this.params=Q,this.eLabel=V,this.cbSelect=V,this.processingColumnStateChange=!1;let{column:J,depth:q,displayName:X}=_;this.column=J,this.columnDepth=q,this.displayName=X}postConstruct(){this.setTemplate(oA,[h0]);let{beans:_,cbSelect:f,displayName:$,eLabel:z,columnDepth:Q,groupsExist:J,column:q,gos:X,focusWrapper:Y}=this,Z=h("columnDrag",_);this.eDragHandle=Z,Z.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");let G=f.getGui(),E=f.getInputElement();if(G.after(Z),E.setAttribute("tabindex","-1"),z.textContent=$,J)this.addCss("ag-column-select-add-group-indent");this.addCss(`ag-column-select-indent-${Q}`),this.getGui().style.setProperty("--ag-indentation-level",String(Q)),this.tooltipFeature=this.createOptionalManagedBean(_.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:EQ(X,()=>z),getAdditionalParams:()=>({colDef:q.getColDef()})})),this.setupDragging();let U=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:U}),this.addManagedListeners(q,{columnValueChanged:U,columnPivotChanged:U,columnRowGroupChanged:U,visibleChanged:U}),this.addManagedListeners(Y,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});let H=new u_(Y);this.addManagedListeners(H,{longTap:(B)=>this.onContextMenu(B.touchStart)}),this.addDestroyFunc(H.destroy.bind(H)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(f,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(z,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();let W=zQ(q.getColDef(),X,q,null);for(let B of W)this.toggleCss(B,!0)}getColumn(){return this.column}setupTooltip(){let _=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);_(),this.addManagedEventListeners({newColumnsLoaded:_})}onContextMenu(_){let{column:f,gos:$}=this;if($.get("functionsReadOnly"))return;let z=this.createBean(new BZ(f,_,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(z.isAlive())this.destroyBean(z)})}handleKeyDown(_){if(_.key===S.SPACE){if(_.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected())}}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;let _=!this.cbSelect.getValue();this.onChangeCommon(_)}onCheckboxChanged(_){this.onChangeCommon(_.selected)}onChangeCommon(_){if(this.cbSelect.isReadOnly())return;if(this.refreshAriaLabel(),this.processingColumnStateChange)return;YZ(this.beans,[this.column],_,"toolPanelUi",this.params)}refreshAriaLabel(){let{cbSelect:_,focusWrapper:f,displayName:$}=this,z=this.getLocaleTextFunc(),Q=z("ariaColumn","Column"),J=_.getValue()?z("ariaVisible","visible"):z("ariaHidden","hidden"),q=z("ariaToggleVisibility","Press SPACE to toggle visibility");W_(f,`${$} ${Q}`),this.cbSelect.setInputAriaLabel(`${q} (${J})`),Nz(f,_.getInputElement().id)}setupDragging(){let _=this.eDragHandle;if(!this.allowDragging){N(_,!1);return}let f=this.beans,{gos:$,eventSvc:z,dragAndDrop:Q}=f;if(p(this.params))_.setAttribute("data-column-tool-panel-deferred","");let J=!$.get("suppressDragLeaveHidesColumns"),q={type:G0.ToolPanel,eElement:_,dragItemName:this.displayName,getDefaultIconName:()=>J&&!p(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{J=!$.get("suppressDragLeaveHidesColumns"),z.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{z.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(X)=>{if(J&&!p(this.params))ZZ(f,{columns:[this.column],visibleState:X?.visibleState,pivotState:X?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{if(J&&!p(this.params))this.onChangeCommon(!1)}};Q.addDragSource(q,!0),this.addDestroyFunc(()=>Q.removeDragSource(q))}createDragItem(){let _=this.column.getColId(),f={[_]:this.column.isVisible()},$=this.beans.columnStateUpdateStrategy,z={[_]:GZ(this.column,$,p(this.params))};return{columns:[this.column],visibleState:f,pivotState:z}}onColumnStateChanged(){this.processingColumnStateChange=!0;let _=this.beans.columnStateUpdateStrategy,f=_.getPivotMode(p(this.params));if(f){let Q=_.isColumnSelectedInPivotModeToolPanel(p(this.params),this.column);this.cbSelect.setValue(Q)}else this.cbSelect.setValue(_.isColumnVisibleInToolPanel(p(this.params),this.column));let $=!0,z=!0;if(f){let Q=this.gos.get("functionsReadOnly"),J=!this.column.isAnyFunctionAllowed();$=!Q&&!J,z=$}else{let{enableRowGroup:Q,enableValue:J,lockPosition:q,suppressMovable:X,lockVisible:Y}=this.column.getColDef(),Z=!!Q||!!J,G=!!q||!!X;$=!Y,z=Z||!G}this.cbSelect.setReadOnly(!$),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!z),this.toggleCss("ag-column-select-column-readonly",!z&&!$),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(_){let f=this.cbSelect;if(_!==f.getValue()){if(!f.isReadOnly())f.toggle()}}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(_){j(158)}},_R=class{constructor(_){this.items=_}getRowCount(){return this.items.length}getRow(_){return this.items[_]}},fR="ag-column-select-list",$R=class extends w{constructor(){super({tag:"div",cls:fR,role:"presentation"});this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(_){this.colModel=_.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(let _ of this.destroyColumnItemFuncs)_();this.destroyColumnItemFuncs=[]}init(_,f,$){this.params=_;let{suppressSyncLayoutWithGrid:z,contractColumnSelection:Q,suppressColumnMove:J}=_;if(this.allowDragging=f,this.eventType=$,!z)this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)});this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});let q=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:q,columnPivotModeChanged:q,columnRowGroupChanged:q,columnValueChanged:q,columnVisible:q,newColumnsLoaded:q}),this.expandGroupsByDefault=!Q;let X=J||z,Y=this.createManagedBean(new _Z({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(Z,G)=>{if(X)return;this.moveItems(Z,G)}}));if(this.virtualList=Y,this.appendChild(Y.getGui()),Y.setComponentCreator((Z,G)=>{return _q(G,Z.depth+1),this.createComponentFromItem(Z,G)}),this.colModel.ready)this.onColumnsChanged();if(X)return;this.createItemDragFeature()}createItemDragFeature(){let{gos:_,beans:f,virtualList:$}=this;this.createManagedBean(new eS(this,$,{dragSourceType:G0.ToolPanel,addListeners:(z,Q,J)=>{z.addManagedEventListeners({columnPanelItemDragStart:Q,columnPanelItemDragEnd:J})},getCurrentDragValue:(z)=>aA(z),isMoveBlocked:(z)=>BY(_,f,U2(z),this.params),getNumRows:(z)=>z.getDisplayedColsList().length,moveItem:(z,Q)=>KY(f,U2(z),Q,this.params)}))}moveItems(_,f){let{gos:$,beans:z}=this,{modelItem:Q}=_,{group:J,columnGroup:q,column:X,expanded:Y}=Q,Z=U2(J?q:X);if(BY($,z,Z,this.params))return;let G=this.displayedColsList.indexOf(Q),E=f?-1:1,U=0;if(f){let W=_.columnDepth>0?X.getParent()?.getChildren():null;if(W?.length&&X===W[0])U=-1}else if(J)U=Y?Q.children.length:0;let H=Math.min(Math.max(G+U+E,0),this.displayedColsList.length-1);this.skipRefocus=!0,KY(z,Z,{rowIndex:H,position:f?"top":"bottom",component:this.virtualList.getComponentAt(H)},this.params),this.focusRowIfAlive(H-U).then(()=>{this.skipRefocus=!1})}createComponentFromItem(_,f){let $=this.allowDragging;if(_.group){let Q=new KZ(_,$,this.eventType,f,this.params);return this.createBean(Q),Q}let z=new eA(_,$,this.groupsExist,f,this.params);return this.createBean(z),z}onColumnsChanged(){let _=this.params;if(!this.hasLoadedInitialState)this.hasLoadedInitialState=!0,this.isInitialState=!!_.initialState;let f=this.getExpandedStates(),$=this.colModel.isPivotMode(),z=p(_),Q=z&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(z);if((!_.suppressSyncLayoutWithGrid||z)&&!$||Q)this.buildTreeFromWhatGridIsDisplaying();else this.buildTreeFromProvidedColumnDefs();this.setExpandedStates(f),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){let _={};if(this.isInitialState){let{expandedGroupIds:f}=this.params.initialState;for(let $ of f)_[$]=!0;return _}if(!this.allColsTree)return{};return this.forEachItem((f)=>{if(!f.group)return;let $=f.columnGroup;if($)_[$.getId()]=f.expanded}),_}setExpandedStates(_){if(!this.allColsTree)return;let{isInitialState:f}=this;this.forEachItem(($)=>{if(!$.group)return;let z=$.columnGroup;if(z){let Q=_[z.getId()];if(Q!=null||f)$.expanded=!!Q}})}buildTreeFromWhatGridIsDisplaying(){let _=p(this.params);if(_&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(_)){let f=this.beans.columnStateUpdateStrategy.getPrimaryColumns(_);if(f.length>0){xA(f,this.setColumnLayout.bind(this));return}}if(this.params.suppressSyncLayoutWithGrid){this.buildTreeFromProvidedColumnDefs();return}wA(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(_){let f=CA(this.colModel,_);this.buildListModel(f),this.groupsExist=_.some(($)=>{return $&&typeof $.children<"u"}),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){let _=this.colModel;this.buildListModel(_.getColDefColTree()),this.groupsExist=!!_.colDefCols?.treeDepth}buildListModel(_){let f=this.onColumnExpanded.bind(this),$=(X)=>{X.addEventListener("expandedChanged",f);let Y=X.removeEventListener.bind(X,"expandedChanged",f);this.destroyColumnItemFuncs.push(Y)},z=this.beans.colNames,Q=(X,Y,Z)=>{for(let G of X)if(X_(G))J(G,Y,Z);else q(G,Y,Z)},J=(X,Y,Z)=>{if(X.getColGroupDef()?.suppressColumnsToolPanel)return;if(X.isPadding()){Q(X.getChildren(),Y,Z);return}let U=z.getDisplayNameForProvidedColumnGroup(null,X,"columnToolPanel"),H=new UY(U,X,Y,!0,this.expandGroupsByDefault);Z.push(H),$(H),Q(X.getChildren(),Y+1,H.children)},q=(X,Y,Z)=>{if(X.getColDef()?.suppressColumnsToolPanel)return;let E=z.getDisplayNameForColumn(X,"columnToolPanel");Z.push(new UY(E,X,Y))};this.destroyColumnTree(),Q(_,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];let _=(z)=>{if(!z.passesFilter)return;if(this.displayedColsList.push(z),z.group&&z.expanded)z.children.forEach(_)},f=this.virtualList;this.allColsTree.forEach(_),f.setModel(new _R(this.displayedColsList));let $=null;if(!this.skipRefocus)$=f.getLastFocusedRow();if(f.refresh(),$!=null)this.focusRowIfAlive($);this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){let _=this.getLocaleTextFunc(),f=_("ariaColumnPanelList","Column List"),$=_("columns","Columns"),z=this.displayedColsList.length;W_(this.virtualList.getAriaElement(),`${f} ${z} ${$}`)}focusRowIfAlive(_){if(_===-1)return Promise.resolve();return new Promise((f)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(_);f()},0)})}forEachItem(_){let f=(z)=>{for(let Q of z)if(_(Q),Q.group)f(Q.children)},$=this.allColsTree;if(!$)return;f($)}doSetExpandedAll(_){this.forEachItem((f)=>{if(f.group)f.expanded=_})}setGroupsExpanded(_,f){if(!f){this.doSetExpandedAll(_);return}let $=[];this.forEachItem((Q)=>{if(!Q.group)return;let J=Q.columnGroup.getId();if(f.indexOf(J)>=0)Q.expanded=_,$.push(J)});let z=f.filter((Q)=>!$.includes(Q));if(z.length>0)j(157,{unrecognisedGroupIds:z})}getExpandState(){let _=0,f=0;if(this.forEachItem(($)=>{if(!$.group)return;if($.expanded)_++;else f++}),_>0&&f>0)return 2;if(f>0)return 1;return 0}doSetSelectedAll(_){XZ(this.beans,this.allColsTree,_,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let _=0;_{if(Q.group)return;if(!Q.passesFilter)return;let J=Q.column,q=J.getColDef(),X;if(z){if(!J.isAllowPivot()&&!J.isAllowRowGroup()&&!J.isAllowValue())return;X=$.isColumnSelectedInPivotModeToolPanel(p(this.params),J)??!1}else{if(q.lockVisible)return;X=$.isColumnVisibleInToolPanel(p(this.params),J)??!1}if(X)_++;else f++}),_>0&&f>0)return;return!(_===0||f>0)}setFilterText(_){this.filterText=v(_)?_.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){let _=($)=>{if(!v(this.filterText))return!0;let z=$.displayName;return z==null||z.toLowerCase().indexOf(this.filterText)!==-1},f=($,z)=>{let Q=!1;if($.group){let q=_($);for(let X of $.children){let Y=f(X,q||z);if(Y)Q=Y}}let J=z||Q?!0:_($);return $.passesFilter=J,J};for(let $ of this.allColsTree)f($,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){let _=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:_})}fireSelectionChangedEvent(){if(!this.allColsTree)return;let _=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:_})}getExpandedGroups(){let _=[];if(!this.allColsTree)return _;return this.forEachItem((f)=>{if(f.group&&f.expanded)_.push(f.columnGroup.getId())}),_}},zR={selector:"AG-PRIMARY-COLS-LIST",component:$R},QR={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},LZ=class extends w{constructor(){super(QR,[bA,zR]);this.primaryColsHeaderPanel=V,this.primaryColsListPanel=V,this.registerCSS(vA)}init(_,f,$){let{primaryColsHeaderPanel:z,primaryColsListPanel:Q}=this;z.init(f);let{suppressColumnFilter:J,suppressColumnSelectAll:q}=f;if(f.suppressColumnExpandAll&&J&&q)z.setDisplayed(!1);this.addManagedListeners(Q,{groupExpanded:(Y)=>{z.setExpandState(Y.state),f.onStateUpdated()},selectionChanged:(Y)=>z.setSelectionState(Y.state)}),Q.init(f,_,$),this.addManagedListeners(z,{expandAll:Q.doSetExpandedAll.bind(Q,!0),collapseAll:Q.doSetExpandedAll.bind(Q,!1),selectAll:Q.doSetSelectedAll.bind(Q,!0),unselectAll:Q.doSetSelectedAll.bind(Q,!1),filterChanged:(Y)=>Q.setFilterText(Y.filterText)}),this.positionableFeature=this.createManagedBean(new j$(this.getGui(),{minHeight:100}))}toggleResizable(_){this.positionableFeature.setResizable(_?{bottom:!0}:!1)}expandGroups(_){this.primaryColsListPanel.setGroupsExpanded(!0,_)}collapseGroups(_){this.primaryColsListPanel.setGroupsExpanded(!1,_)}setColumnLayout(_){this.primaryColsListPanel.setColumnLayout(_)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},JR=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}",qR="ag-column-panel-deferred",XR=class extends w{constructor(){super({tag:"div",cls:"ag-column-panel"});this.initialised=!1,this.childDestroyFuncs=[],this.isDeferModeEnabled=!1,this.isCommitting=!1,this.onDeferredApply=()=>{this.isCommitting=!0;try{this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled)}finally{this.isCommitting=!1}this.deferredButtonsComp?.updateValidity(!1),this.lastKnownGridState=this.captureGridState()},this.onDeferredCancel=()=>{this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy(),this.lastKnownGridState=this.captureGridState()},this.onPivotModePanelValueChanged=()=>{this.refreshToolPanelLayouts(),this.setLastVisible(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))},this.onColumnEverythingChanged=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;let _=this.captureGridState();if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)){this.lastKnownGridState=_;return}let f=this.lastKnownGridState&&this.isGridStateEqual(this.lastKnownGridState,_);if(this.lastKnownGridState=_,!f)return;this.resetDeferredState()},this.onExternalGridChange=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))return;this.resetDeferredState(),this.lastKnownGridState=this.captureGridState()},this.registerCSS(JR)}wireBeans(_){this.colToolPanelFactory=_.colToolPanelFactory}setVisible(_){if(super.setDisplayed(_),_&&!this.initialised)this.init(this.params)}init(_){let $={...C(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),..._};this.params=$;let{childDestroyFuncs:z,colToolPanelFactory:Q,gos:J}=this,q=J.isModuleRegistered("SharedPivot"),X=q||J.isModuleRegistered("SharedRowGrouping");if(this.isDeferModeEnabled=p($),this.toggleCss(qR,this.isDeferModeEnabled),!$.suppressPivotMode&&Q&&q)this.pivotModePanel=Q.createPivotModePanel(this,z,$,this.onPivotModePanelValueChanged);let Y=this.createBean(new LZ);if(this.primaryColsPanel=Y,z.push(()=>this.destroyBean(this.primaryColsPanel)),Y.init(!0,$,"toolPanelUi"),Y.addCss("ag-column-panel-column-select"),this.appendChild(Y),Q){if(!$.suppressRowGroups&&X)this.rowGroupDropZonePanel=Q.createRowGroupPanel(this,z,$);if(!$.suppressValues&&X)this.valuesDropZonePanel=Q.createValuesPanel(this,z,$);if(!$.suppressPivots&&q)this.pivotDropZonePanel=Q.createPivotPanel(this,z,$);this.setLastVisible();let[Z]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});z.push(()=>Z())}if(this.isDeferModeEnabled){let Z=this.onExternalGridChange;z.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:Z,columnVisible:Z,columnRowGroupChanged:Z,columnValueChanged:Z,columnPivotChanged:Z,columnPivotModeChanged:Z,newColumnsLoaded:Z,...$.suppressSyncLayoutWithGrid?{}:{columnMoved:Z}}))}if($.buttons){if(!$.buttons.includes("apply"))j(298);if($.buttons.length)this.initDeferredButtons($.buttons)}this.initialised=!0}initDeferredButtons(_){let f=this.createBean(new z2({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=f,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});let $=this.getLocaleTextFunc(),z=_.map((Q)=>({type:Q,label:$(Q==="apply"?"applyColumnToolPanel":"cancelColumnToolPanel",Q==="apply"?"Apply":"Cancel")}));f.updateButtons(z),f.updateValidity(!1),f.addManagedListeners(f,{apply:this.onDeferredApply,cancel:this.onDeferredCancel}),this.appendChild(f)}resetDeferredState(){this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy()}captureGridState(){let{beans:_}=this,f=($)=>($??[]).map((z)=>z.getColId());return{rowGroupColIds:f(_.rowGroupColsSvc?.columns),valueColIds:f(_.valueColsSvc?.columns),pivotColIds:f(_.pivotColsSvc?.columns),pivotMode:_.colModel.isPivotMode(),columnOrder:_.colModel.getCols().map(($)=>$.getColId()),visibleColIds:_.colModel.getCols().filter(($)=>$.isVisible()).map(($)=>$.getColId()),sortState:_.colModel.getCols().filter(($)=>$.getSort()).map(($)=>`${$.getColId()}:${$.getSort()}:${$.getSortIndex()}`),aggFuncState:(_.valueColsSvc?.columns??[]).map(($)=>$.getAggFunc()),widthState:_.colModel.getCols().map(($)=>`${$.getColId()}:${$.getActualWidth()}`)}}isGridStateEqual(_,f){return J_(_.rowGroupColIds,f.rowGroupColIds)&&J_(_.valueColIds,f.valueColIds)&&J_(_.pivotColIds,f.pivotColIds)&&_.pivotMode===f.pivotMode&&J_(_.columnOrder,f.columnOrder)&&J_(_.visibleColIds,f.visibleColIds)&&J_(_.sortState,f.sortState)&&J_(_.aggFuncState,f.aggFuncState)&&J_(_.widthState,f.widthState)}refreshDeferredUi(){this.refreshToolPanelLayouts(),this.setLastVisible(),this.pivotModePanel?.refreshEditStrategy(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))}refreshToolPanelLayouts(){this.primaryColsPanel.syncLayoutWithGrid(),this.rowGroupDropZonePanel?.refreshGui(),this.valuesDropZonePanel?.refreshGui(),this.pivotDropZonePanel?.refresh()}setPivotModeSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.pivotModePanel=f.setPanelVisible(this.pivotModePanel,_,f.createPivotModePanel.bind(f,this,this.childDestroyFuncs,this.params,this.onPivotModePanelValueChanged,!0)),this.setLastVisible()}setRowGroupsSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.rowGroupDropZonePanel=f.setPanelVisible(this.rowGroupDropZonePanel,_,f.createRowGroupPanel.bind(f,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setValuesSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.valuesDropZonePanel=f.setPanelVisible(this.valuesDropZonePanel,_,f.createValuesPanel.bind(f,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setPivotSectionVisible(_){let f=this.colToolPanelFactory;if(!f)return;this.pivotDropZonePanel=f.setPanelVisible(this.pivotDropZonePanel,_,f.createPivotPanel.bind(f,this,this.childDestroyFuncs,this.params)),this.pivotDropZonePanel?.setDisplayed(_),this.setLastVisible()}setResizers(){for(let _ of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!_)continue;let f=_.getGui();_.toggleResizable(!f.classList.contains("ag-last-column-drop")&&!f.classList.contains("ag-hidden")&&!f.classList.contains("ag-last-visible-child"))}}setLastVisible(){let _=this.getGui(),f=Array.prototype.slice.call(_.querySelectorAll(".ag-column-drop"));for(let Q of f)Q.classList.remove("ag-last-column-drop");let $=_.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),z=b($);if(z)z.classList.add("ag-last-column-drop");this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!z),this.setResizers()}resetChildrenHeight(){let f=this.getGui().children;for(let $=0;$J.getGui().getBoundingClientRect()),Q=z.findIndex((J)=>this.horizontal?J.right>$&&J.left<$:J.top<$&&J.bottom>$);if(Q===-1){let J=this.gos.get("enableRtl");if(z.every((Y)=>$>(this.horizontal?Y.right:Y.bottom)))return J&&this.horizontal?0:this.childPillComponents.length;if(z.every((Y)=>$<(this.horizontal?Y.left:Y.top)))return J&&this.horizontal?this.childPillComponents.length:0;return this.insertIndex}if(this.insertIndex<=Q)return Q+1;return Q}checkDragStartedBySelf(_){if(this.state!=="notDragging")return;this.state="rearrangeItems",this.potentialDndItems=this.getItems(_.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(_),this.refreshGui()}onDragging(_){if(this.checkDragStartedBySelf(_),this.checkInsertIndex(_))this.refreshGui()}handleDragEnterEnd(_){}onDragEnter(_){let f=this.getItems(_.dragSource.getDragItem());this.state="newItemsIn";let $=f.filter((Q)=>this.isItemDroppable(Q,_)),z=$.every((Q)=>this.childPillComponents.map((J)=>J.getItem()).indexOf(Q)!==-1);if($.length===0)return;if(this.potentialDndItems=$,z){this.state="notDragging";return}this.handleDragEnterEnd(_),this.checkInsertIndex(_),this.refreshGui()}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(_){}onDragLeave(_){if(this.state==="rearrangeItems"){let f=this.getItems(_.dragSource.getDragItem());this.removeItems(f)}if(this.isPotentialDndItems())this.handleDragLeaveEnd(_),this.potentialDndItems=[],this.refreshGui();this.state="notDragging"}onDragCancel(_){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.handleDragLeaveEnd(_);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}onDragStop(){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.addItems(this.potentialDndItems);else this.rearrangeItems(this.potentialDndItems);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}removeItems(_){let f=this.getExistingItems().filter(($)=>!_.includes($));this.updateItems(f),this.refreshGui()}addItems(_){if(!_)return;let f=this.getExistingItems().slice(),$=_.filter((z)=>f.indexOf(z)<0);LY(f,$,this.insertIndex),this.updateItems(f),this.refreshGui()}addItem(_){this.insertIndex=this.getExistingItems().length,this.addItems([_])}rearrangeItems(_,f){let $;if(!f)$=this.getNonGhostItems().slice();else $=this.getExistingItems().filter((z)=>_.indexOf(z)===-1);if(LY($,_,this.insertIndex),J_($,this.getExistingItems()))return!1;return this.updateItems($),this.refreshGui(),!0}refreshGui(){let _=0;if(!this.horizontal)_=this.ePillDropList.scrollTop;let f=this.resizeEnabled,$=this.getFocusedItem(),{eGridDiv:z}=this.beans,Q=b1(),J=null;if(Q)J=V_(this.beans,z)??V_(this.beans,z,!1,!0);if(this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),_!==0)this.ePillDropList.scrollTop=_;if(f)this.toggleResizable(f);if(Q)this.restoreFocus($,J)}getFocusedItem(){let _=this.getGui(),f=d(this.beans);if(!_.contains(f))return-1;return Array.from(_.querySelectorAll(".ag-column-drop-cell")).indexOf(f)}focusItemAtIndex(_){let f=this.getGui(),z=Array.from(f.querySelectorAll(".ag-column-drop-cell"))[_];if(!z)return;z.focus({preventScroll:!0})}restoreFocus(_,f){let $=this.getGui(),z=Array.from($.querySelectorAll(".ag-column-drop-cell"));if(_===-1)return;if(z.length===0)f.focus();let Q=Math.min(z.length-1,_),J=z[Q];if(J)J.focus()}focusList(_){let f=_?this.childPillComponents.length-1:0;this.restoreFocus(f,this.getFocusableElement())}getNonGhostItems(){let _=this.getExistingItems();if(this.isPotentialDndItems())return _.filter((f)=>!this.potentialDndItems.includes(f));return _}addItemsToGui(){let f=this.getNonGhostItems().map(($)=>this.createItemComponent($,!1));if(this.isPotentialDndItems()){let $=this.potentialDndItems.map((z)=>this.createItemComponent(z,!0));if(this.insertIndex>=f.length)f.push(...$);else f.splice(this.insertIndex,0,...$)}this.appendChild(this.ePillDropList),f.forEach(($,z)=>{if(z>0)this.addArrow(this.ePillDropList);this.ePillDropList.appendChild($.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){let{childPillComponents:_,ePillDropList:f}=this,$=_.length;Z_(f,$===0?"presentation":"listbox");for(let z=0;z<$;z++){let J=_[z].getGui();uz(J,z+1),hz(J,$)}}createItemComponent(_,f){let $=this.createPillComponent(_,this.dropTarget,f,this.horizontal);if($.addEventListener("columnRemove",this.removeItems.bind(this,[_])),this.createBean($),this.guiDestroyFunctions.push(()=>this.destroyBean($)),!f)this.childPillComponents.push($);return $}addIconAndTitleToGui(){let{title:_,icon:f}=this.params;if(!_||!f)return;let $=z_({tag:"div"});if(gz($,!0),this.addElementClasses($,"title-bar"),this.addElementClasses(f,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),$.appendChild(f),!this.horizontal){let z=z_({tag:"span"});this.addElementClasses(z,"title"),z.textContent=_,$.appendChild(z)}this.appendChild($)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){let{emptyMessage:_}=this.params;if(!_||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;let f=z_({tag:"span"});f.textContent=_,this.addElementClasses(f,"empty-message"),this.ePillDropList.appendChild(f)}addArrow(_){if(this.horizontal){let f=this.gos.get("enableRtl"),$=h(f?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses($,"cell-separator"),_.appendChild($)}}},ER={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},UR=class extends w{constructor(_,f,$,z,Q){super();this.dragSourceDropTarget=_,this.ghost=f,this.horizontal=$,this.template=z,this.agComponents=Q,this.eText=V,this.eDragHandle=V,this.eButton=V}postConstruct(){this.setTemplate(this.template??ER,this.agComponents);let _=this.getGui(),{beans:f,eDragHandle:$,eText:z,eButton:Q}=this;if(this.addElementClasses(_),this.addElementClasses($,"drag-handle"),this.addElementClasses(z,"text"),this.addElementClasses(Q,"button"),$.appendChild(h("columnDrag",f)),Q.appendChild(h("cancel",f)),this.tooltipFeature=this.createOptionalManagedBean(f.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable())this.addDragSource();this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){let _=this.getLocaleTextFunc(),f=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(f,_),W_(this.getGui(),f.join(". "))}addAdditionalAriaInstructions(_,f){if(this.isRemovable()){let $=f("ariaDropZoneColumnComponentDescription","Press DELETE to remove");_.push($)}}setupTooltip(){let _=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());_(),this.addManagedEventListeners({newColumnsLoaded:_})}getDragSourceId(){return}getDefaultIconName(){return"notAllowed"}addDragSource(){let{beans:{dragAndDrop:_},eDragHandle:f}=this,$=this.createGetDragItem(),z=this.getDefaultIconName(),Q={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:f,getDefaultIconName:()=>z,getDragItem:$,dragItemName:this.getDisplayName()};_?.addDragSource(Q,!0),this.addDestroyFunc(()=>_?.removeDragSource(Q))}setupComponents(){if(this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost)this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){N(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();let _={type:"columnRemove"};this.addGuiEventListener("keydown",($)=>this.onKeyDown($)),this.addManagedElementListeners(this.eButton,{click:($)=>{this.dispatchLocalEvent(_),$.stopPropagation()}});let f=new u_(this.eButton);this.addManagedListeners(f,{tap:()=>this.dispatchLocalEvent(_)}),this.addDestroyFunc(f.destroy.bind(f))}onKeyDown(_){if(_.key===S.DELETE){if(this.isRemovable())_.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"})}}getDisplayValue(){return this.getDisplayName()}addElementClasses(_,f){f=f?`-${f}`:"";let $=this.horizontal?"horizontal":"vertical";_.classList.add(`ag-column-drop-cell${f}`,`ag-column-drop-${$}-cell${f}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},HR=class extends UR{constructor(_,f,$,z,Q,J){super(f,$,Q);this.column=_,this.dropZonePurpose=z,this.updateParams=J,this.eSortIndicator=V,this.popupShowing=!1,this.deferApply=p(J)}postConstruct(){let{sortSvc:_,colNames:f}=this.beans;if(this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},_?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},_)this.agComponents=[_.getSortIndicatorSelector()];if(this.displayName=f.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.deferApply)this.eDragHandle.setAttribute("data-column-tool-panel-deferred","");if(_)this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}});if(this.isGroupingZone())this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(_,f){let $=this.gos.get("rowGroupPanelSuppressSort"),z=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!z){let Q=f("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");_.push(Q)}if(this.isGroupingZone()&&this.column.isSortable()&&!$){let Q=f("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");_.push(Q)}super.addAdditionalAriaInstructions(_,f)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){let _=this.getLocaleTextFunc(),{name:f,aggFuncName:$}=this.getColumnAndAggFuncName(),z=_("ariaDropZoneColumnComponentAggFuncSeparator"," of "),Q={asc:_("ariaDropZoneColumnComponentSortAscending","ascending"),desc:_("ariaDropZoneColumnComponentSortDescending","descending")},J=this.getCurrentSortDirection(this.column),q=this.gos.get("rowGroupPanelSuppressSort");return[$&&`${$}${z}`,f,this.isGroupingZone()&&!q&&J&&`, ${Q[J]}`].filter((X)=>!!X).join("")}getColumnAndAggFuncName(){let _=this.displayName,f="";if(this.isAggregationZone()){let $=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),z=typeof $==="string"?$:"agg";f=this.getLocaleTextFunc()(z,z)}return{name:_,aggFuncName:f}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;let{gos:_,column:f,eSortIndicator:$}=this;if(!_.get("rowGroupPanelSuppressSort")){$.setupSort(f,!0,this.getSortDefOverride.bind(this));let z=(Q)=>{Q.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,f,Q),$.refresh(),this.setupAria(),g_(this.beans,this.updateParams)};this.addGuiEventListener("click",z),this.addGuiEventListener("keydown",(Q)=>{if(Q.key===S.ENTER&&this.isGroupingZone())z(Q)})}}getCurrentSortDirection(_){return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,_)?.direction??null}getSortDefOverride(){if(!this.deferApply)return;return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,this.column)}getDefaultIconName(){return"hide"}createGetDragItem(){let{column:_}=this;return()=>{let f={};return f[_.getId()]=_.isVisible(),{columns:[_],visibleState:f}}}setupComponents(){if(super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(_){if(super.onKeyDown(_),_.key===S.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))_.preventDefault(),this.onShowAggFuncSelection()}getDisplayValue(){let{name:_,aggFuncName:f}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${f}(${_})`:_}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;let{aggFuncSvc:_,popupSvc:f}=this.beans,$=new _Z({cssIdentifier:"select-agg-func"}),z=_.getFuncNames(this.column),Q=this.getGui(),J=$.getGui();$.setModel({getRow:function(H){return z[H]},getRowCount:function(){return z.length}}),this.createBean($);let q=z_({tag:"div",cls:"ag-select-agg-func-popup"});q.style.top="0px",q.style.left="0px",q.appendChild(J),q.style.width=`${Q.clientWidth}px`;let[X]=this.addManagedElementListeners(q,{focusout:(H)=>{if(!q.contains(H.relatedTarget)&&G)G.hideFunc()}}),Y=(H)=>{if(this.destroyBean($),this.popupShowing=!1,H?.key==="Escape")Q.focus();if(X)X()},Z=this.getLocaleTextFunc(),G=f.addPopup({modal:!0,eChild:q,closeOnEsc:!0,closedCallback:Y,ariaLabel:Z("ariaLabelAggregationFunction","Aggregation Function")});if(G)$.setComponentCreator(this.createAggSelect.bind(this,G.hideFunc));$.addGuiEventListener("keydown",(H)=>{if(H.key===S.ENTER||H.key===S.SPACE){let W=$.getLastFocusedRow();if(W==null)return;let B=$.getComponentAt(W);if(B)B.selectItem()}}),f.positionPopupByComponent({type:"aggFuncSelect",eventSource:Q,ePopup:q,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),$.refresh();let E=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),U=z.findIndex((H)=>H===E);if(U===-1)U=0;$.focusRow(U)}createAggSelect(_,f){let $=()=>{if(_(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,f,"toolPanelDragAndDrop"),this.column){let X=this.getGui().querySelector(".ag-column-drop-cell-text");if(X)X.textContent=this.getDisplayValue();this.setupAria()}g_(this.beans,this.updateParams)},z=this.getLocaleTextFunc(),Q=(f||"").toString(),J=z(Q,Q);return new WR($,J)}isGroupingAndLocked(){return this.isGroupingZone()&&c$(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return G0.ToolPanel}destroy(){super.destroy(),this.column=null}},WR=class extends w{constructor(_,f){super({tag:"div",cls:"ag-select-agg-func-item",children:f});this.selectItem=_,this.addGuiEventListener("click",this.selectItem)}},v2=class extends GR{constructor(_,f,$){super(_);this.dropZonePurpose=f,this.updateParams=$,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(_){super.init(_),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(_){return _.columns??[]}isInterestedIn(_,f){if(_===G0.HeaderCell)return!0;if(_!==G0.ToolPanel)return!1;if(!this.horizontal)return!0;return!f.hasAttribute("data-column-tool-panel-deferred")}minimumAllowedNewInsertIndex(){let{gos:_,rowGroupColsSvc:f}=this.beans,$=_.get("groupLockGroupColumns"),z=f?.columns.length??0;if($===-1)return z;return Math.min($,z)}showOrHideColumnOnExit(_){return this.isRowGroupPanel()&&tz(this.gos,!0)&&!_.fromNudge}handleDragEnterEnd(_){if(this.showOrHideColumnOnExit(_)){let z=_.dragSource.getDragItem().columns;this.setColumnsVisible(z,!1,"uiColumnDragged")}}handleDragLeaveEnd(_){if(this.showOrHideColumnOnExit(_)){let $=_.dragSource.getDragItem();this.setColumnsVisible($.columns,!0,"uiColumnDragged")}}setColumnsVisible(_,f,$){if(!_)return;if(p(this.updateParams))return;let z=_.filter((Q)=>!Q.getColDef().lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,z,f,$)}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(_,f,$,z){return new HR(_,f,$,this.dropZonePurpose,z,this.updateParams)}},BR=class extends v2{constructor(_,f){super(_,"pivot",f)}postConstruct(){let _=this.getLocaleTextFunc(),f=_("pivotColumnsEmptyMessage","Drag here to set column labels"),$=_("pivots","Column Labels");if(super.init({icon:h("pivotPanel",this.beans,null),emptyMessage:f,title:$}),this.horizontal)Mf(this.beans,this,this.getGui());this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){let _=this.beans.colModel,f=_.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(f);break;case"onlyWhenPivoting":{let $=_.isPivotActive();this.setDisplayed(f&&$);break}default:this.setDisplayed(!1);break}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(p(this.updateParams)))}isItemDroppable(_,f){if(this.gos.get("functionsReadOnly")||!_.isPrimary())return!1;let $=this.beans.columnStateUpdateStrategy.getPivotColumns(p(this.updateParams)).includes(_);return _.isAllowPivot()&&(!$||this.isSourceEventFromTarget(f))}updateItems(_){this.beans.columnStateUpdateStrategy.setPivotColumns(p(this.updateParams),_,"toolPanelUi"),g_(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(p(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},KR=class extends v2{constructor(_,f){super(_,"rowGroup",f)}postConstruct(){let _=this.getLocaleTextFunc(),f=_("rowGroupColumnsEmptyMessage","Drag here to set row groups"),$=_("groups","Row Groups");if(super.init({icon:h("rowGroupPanel",this.beans,null),emptyMessage:f,title:$}),this.horizontal)Mf(this.beans,this,this.getGui());this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(_,f){if(this.gos.get("functionsReadOnly")||!_.isPrimary()||_.colDef.showRowGroup)return!1;let $=this.beans.columnStateUpdateStrategy.getRowGroupColumns(p(this.updateParams)).includes(_);return _.isAllowRowGroup()&&(!$||this.isSourceEventFromTarget(f))}updateItems(_){this.beans.columnStateUpdateStrategy.setRowGroupColumns(p(this.updateParams),_,"toolPanelUi"),g_(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(p(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},LR=class extends v2{constructor(_,f){super(_,"aggregation",f)}postConstruct(){let _=this.getLocaleTextFunc(),f=_("valueColumnsEmptyMessage","Drag here to aggregate"),$=_("values","Values");super.init({icon:h("valuePanel",this.beans,null),emptyMessage:f,title:$}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(_,f){if(this.gos.get("functionsReadOnly")||!_.isPrimary())return!1;let $=this.beans.columnStateUpdateStrategy.getValueColumns(p(this.updateParams)).includes(_);return _.isAllowValue()&&(!$||this.isSourceEventFromTarget(f))}updateItems(_){this.beans.columnStateUpdateStrategy.setValueColumns(p(this.updateParams),_,"toolPanelUi"),g_(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(p(this.updateParams))}},FR={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},DR=class extends w{constructor(_,f){super();this.params=_,this.onPivotModeValueChanged=f,this.cbPivotMode=V}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(p(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(FR,[_Y]);let _=this.cbPivotMode;_.setValue(this.getCurrentPivotMode());let f=this.getLocaleTextFunc();_.setLabel(f("pivotMode","Pivot Mode"));let $=()=>{let Q=!!_.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(p(this.params),Q,"toolPanelUi"),this.onPivotModeValueChanged?.()},z=()=>{_.setValue(this.getCurrentPivotMode())};this.addManagedListeners(_,{fieldValueChanged:$}),this.addManagedEventListeners({newColumnsLoaded:z,columnPivotModeChanged:z})}},MR=class extends A{constructor(){super(...arguments);this.beanName="colToolPanelFactory"}setPanelVisible(_,f,$){if(_)_.setDisplayed(f);else if(f)_=$();return _}createRowGroupPanel(_,f,$){return this.createPanel(_,f,new KR(!1,$))}createValuesPanel(_,f,$){return this.createPanel(_,f,new LR(!1,$))}createPivotPanel(_,f,$){return this.createPanel(_,f,new BR(!1,$))}createPivotModePanel(_,f,$,z,Q){return this.createPanel(_,f,new DR($,z),Q)}createPanel(_,f,$,z){if($=_.createBean($),f.push(()=>_.destroyBean($)),z)_.prependChild($);else _.appendChild($);return $}},FY=()=>{},kR=class extends A{constructor(){super(...arguments);this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(_,f,$){this.getUpdateStrategy(_).applyColumnState(f,$)}commit(_){this.getUpdateStrategy(_).commit()}hasPendingChanges(_){return this.getUpdateStrategy(_).hasPendingChanges()}moveColumns(_,f,$,z){this.getUpdateStrategy(_).moveColumns(f,$,z)}reset(_){this.getUpdateStrategy(_).reset()}setColumnsVisible(_,f,$,z){this.getUpdateStrategy(_).setColumnsVisible(f,$,z)}isColumnVisibleInToolPanel(_,f){return this.getUpdateStrategy(_).isColumnVisibleInToolPanel(f)}setRowGroupColumns(_,f,$){this.getUpdateStrategy(_).setRowGroupColumns(f,$)}getRowGroupColumns(_){return this.getUpdateStrategy(_).getRowGroupColumns()}getPrimaryColumns(_){return this.getUpdateStrategy(_).getPrimaryColumns()}hasDeferredColumnOrder(_){return this.getUpdateStrategy(_).hasDeferredColumnOrder()}setValueColumns(_,f,$){this.getUpdateStrategy(_).setValueColumns(f,$)}getValueColumns(_){return this.getUpdateStrategy(_).getValueColumns()}setColumnAggFunc(_,f,$,z){this.getUpdateStrategy(_).setColumnAggFunc(f,$,z)}getColumnAggFunc(_,f){return this.getUpdateStrategy(_).getColumnAggFunc(f)}setPivotColumns(_,f,$){this.getUpdateStrategy(_).setPivotColumns(f,$)}getPivotColumns(_){return this.getUpdateStrategy(_).getPivotColumns()}setPivotMode(_,f,$){this.getUpdateStrategy(_).setPivotMode(f,$)}getPivotMode(_){return this.getUpdateStrategy(_).getPivotMode()}isColumnSelectedInPivotModeToolPanel(_,f){return this.getUpdateStrategy(_).isColumnSelectedInPivotModeToolPanel(f)}progressSortFromEvent(_,f,$){this.getUpdateStrategy(_).progressSortFromEvent(f,$)}getSortDef(_,f){return this.getUpdateStrategy(_).getSortDef(f)}getUpdateStrategy(_){return _?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new SR(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new AR(this.beans))}},SR=class{constructor(_){this.beans=_,this.lastPivotColIds=[],this.reset=FY,this.commit=FY,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(_,f){if(_.length===0)return;d_(this.beans,{state:_},f)}moveColumns(_,f,$){this.beans.colMoves?.moveColumns(_,f,$),RR(this.beans)}setColumnsVisible(_,f,$){let z=_.filter((Q)=>!Q.getColDef().lockVisible);this.beans.colModel.setColsVisible(z,f,$)}setRowGroupColumns(_,f){this.beans.rowGroupColsSvc?.setColumns(_,f)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return T2(this.beans)}setValueColumns(_,f){this.beans.valueColsSvc?.setColumns(_,f)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(_,f,$){this.beans.valueColsSvc?.setColumnAggFunc?.(_,f,$)}getColumnAggFunc(_){return _.getAggFunc()}setPivotColumns(_,f){this.lastPivotColIds=_.map(($)=>$.getColId()),this.beans.pivotColsSvc?.setColumns(_,f)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(_,f){let{colModel:$,gos:z,ctrlsSvc:Q}=this.beans;if(_===$.isPivotMode())return;let J=this.beans.pivotColsSvc?.columns.map((q)=>q.getColId())??[];if(J.length>0)this.lastPivotColIds=J;if(!_){let q=this.beans.colModel.getColDefCols()??[];d_(this.beans,{state:q.map((X)=>({colId:X.getColId(),pivot:!1,pivotIndex:null}))},f)}if(z.updateGridOptions({options:{pivotMode:_},source:f}),_&&this.lastPivotColIds.length>0)this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,f);for(let q of Q.getHeaderRowContainerCtrls())q.refresh()}progressSortFromEvent(_,f){this.beans.sortSvc?.progressSortFromEvent(_,f)}isColumnVisibleInToolPanel(_){return _.isVisible()}isColumnSelectedInPivotModeToolPanel(_){return _.isAnyFunctionActive()}getPivotMode(){return this.beans.colModel.isPivotMode()}getSortDef(_){return _.getSortDef()}},AR=class{constructor(_){this.beans=_,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){let{state:_,beans:f}=this,{columnState:$,columnOrder:z,rowGroup:Q,aggregation:J,pivot:q,pivotMode:X,sort:Y,aggFuncs:Z}=_,G=(E)=>(E??[]).map((U)=>U.getColId());if($)for(let[E,U]of $.patches){let H=f.colModel.getColDefCol(E);if(!H)continue;if(U.hide!==void 0&&U.hide!==!H.isVisible()||U.rowGroup!==void 0&&!!U.rowGroup!==H.isRowGroupActive()||U.pivot!==void 0&&!!U.pivot!==H.isPivotActive()||U.aggFunc!==void 0&&(U.aggFunc??null)!==(H.getAggFunc()??null))return!0}if(z&&!J_(z.colIds,W2(f)))return!0;if(Q&&!J_(Q.colIds,G(f.rowGroupColsSvc?.columns)))return!0;if(J&&!J_(J.colIds,G(f.valueColsSvc?.columns)))return!0;if(q&&!J_(q.colIds,G(f.pivotColsSvc?.columns)))return!0;if(X&&X.pivotMode!==f.colModel.isPivotMode())return!0;if(Y){for(let[E,U]of Y.sortDefsByColId){let H=f.colModel.getColDefCol(E);if(!H)continue;if((U?.direction??null)!==(H.getSortDef()?.direction??null))return!0}if(Y.baselineCleared){let E=T2(f);for(let U of E)if(!Y.sortDefsByColId.has(U.getColId())&&U.getSortDef()!==null)return!0}}if(Z)for(let[E,U]of Z.values){let H=f.colModel.getColDefCol(E);if(!H)continue;if(U!==H.getAggFunc())return!0}return!1}commit(){let{beans:_,state:f}=this,$=[];for(let Q of Object.keys(f)){let J=f[Q];if(J)$.push({type:Q,...J})}let z=$.sort((Q,J)=>Q.seq-J.seq);for(let Q of z)switch(Q.type){case"columnState":{d_(_,{state:[...Q.patches.values()]},Q.eventType);break}case"columnOrder":{let J=Q.colIds.map((q)=>_.colModel.getColDefCol(q)).filter((q)=>!!q&&p$(q));if(!_.colModel.isPivotMode())for(let q=0;qp$(E)),G=(Z>=0?Z:0)+q;if(Y[G]!==X)_.colMoves?.moveColumns([X],G,Q.eventType,!0)}FZ(_,J);break}case"rowGroup":{_.rowGroupColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"aggregation":{_.valueColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"pivot":{this.lastPivotColIds=Q.colIds,_.pivotColsSvc?.setColumns(Q.colIds,Q.eventType);break}case"pivotMode":{let{colModel:J,ctrlsSvc:q,gos:X,stateSvc:Y}=_;if(Q.pivotMode!==J.isPivotMode()){let Z=_.pivotColsSvc?.columns.map((U)=>U.getColId())??[];if(Z.length>0)this.lastPivotColIds=Z;let G=Y?.getState().pivot?.pivotColIds??Z,E=Q.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:G;if(Y?.setState({...Y.getState(),pivot:{pivotMode:Q.pivotMode,pivotColIds:E}},["pivot"]),!Q.pivotMode){let U=_.colModel.getColDefCols()??[];d_(_,{state:U.map((H)=>({colId:H.getColId(),pivot:!1,pivotIndex:null}))},Q.eventType)}if(X.updateGridOptions({options:{pivotMode:Q.pivotMode},source:Q.eventType}),Q.pivotMode&&E.length>0)_.pivotColsSvc?.setColumns(E,Q.eventType);for(let U of q.getHeaderRowContainerCtrls())U.refresh()}break}case"sort":{let J=[],q=0;for(let[X,Y]of Q.sortDefsByColId)J.push({colId:X,sort:Y?.direction??null,sortIndex:Y?.direction?q++:null,sortType:Y?.type??void 0});d_(_,{state:J,defaultState:Q.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},Q.eventType);break}case"aggFuncs":{for(let[J,q]of Q.values){let X=_.colModel.getColDefCol(J);if(!X)continue;_.valueColsSvc?.setColumnAggFunc?.(X,q,Q.eventType)}break}}this.reset()}applyColumnState(_,f){for(let z of _)B2(this.state,z);let $=kQ(this.state);$.seq=l0(this.sequence),this.sequence=$.seq,$.eventType=f}moveColumns(_,f,$){let z=new Set(_.map((Y)=>Y.getColId())),J=(this.state.columnOrder?.colIds??W2(this.beans)).filter((Y)=>!z.has(Y)),q=_.map((Y)=>Y.getColId()),X=l0(this.sequence);this.sequence=X,this.state.columnOrder={colIds:[...J.slice(0,f),...q,...J.slice(f)],eventType:$,seq:X}}setColumnsVisible(_,f,$){for(let Q of _){if(Q.getColDef().lockVisible)continue;B2(this.state,{colId:Q.getColId(),hide:!f})}let z=kQ(this.state);z.seq=l0(this.sequence),this.sequence=z.seq,z.eventType=$}setRowGroupColumns(_,f){K2(this.state,"rowGroup");let $=l0(this.sequence);this.sequence=$,this.state.rowGroup={colIds:_.map((z)=>z.getColId()),eventType:f,seq:$}}setValueColumns(_,f){K2(this.state,"aggFunc");let $=new Set((this.beans.valueColsSvc?.columns??[]).map((J)=>J.getColId())),z=DY(this.state);for(let J of _)if(!$.has(J.getColId())&&!z.values.has(J.getColId())){let q=J.getAggFunc(),X=q!=null?q:this.beans.aggFuncSvc?.getDefaultAggFunc(J);if(X!=null)z.values.set(J.getColId(),X)}let Q=l0(this.sequence);this.sequence=Q,z.seq=Q,z.eventType=f,this.state.aggregation={colIds:_.map((J)=>J.getColId()),eventType:f,seq:Q}}setColumnAggFunc(_,f,$){B2(this.state,{colId:_.getColId(),aggFunc:f});let z=kQ(this.state);z.seq=l0(this.sequence),this.sequence=z.seq,z.eventType=$;let Q=DY(this.state);Q.seq=z.seq,Q.eventType=$,Q.values.set(_.getColId(),f)}getColumnAggFunc(_){let f=_.getColId();if(this.state.aggFuncs?.values.has(f))return this.state.aggFuncs.values.get(f);return _.getAggFunc()}isColumnVisibleInToolPanel(_){let f=this.state.columnState?.patches.get(_.getColId());if(f?.hide!==void 0)return!f.hide;return _.isVisible()}isColumnSelectedInPivotModeToolPanel(_){let f=_.getColId(),$=this.state.columnState?.patches.get(f),z;if($?.rowGroup!==void 0)z=!!$.rowGroup;else if(this.state.rowGroup)z=this.state.rowGroup.colIds.includes(f);else z=_.isRowGroupActive();let Q;if($?.pivot!==void 0)Q=!!$.pivot;else if(this.state.pivot)Q=this.state.pivot.colIds.includes(f);else Q=_.isPivotActive();let J;if($?.aggFunc!==void 0)J=$.aggFunc!=null;else if(this.state.aggregation)J=this.state.aggregation.colIds.includes(f);else J=_.isValueActive();return z||Q||J}setPivotColumns(_,f){K2(this.state,"pivot");let $=l0(this.sequence);this.sequence=$,this.state.pivot={colIds:_.map((z)=>z.getColId()),eventType:f,seq:$}}setPivotMode(_,f){let $=l0(this.sequence);this.sequence=$,this.state.pivotMode={pivotMode:_,eventType:f,seq:$}}getRowGroupColumns(){return w$(this.beans,H2(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,(_)=>_.rowGroup==null?void 0:!!_.rowGroup))}getPrimaryColumns(){return w$(this.beans,this.state.columnOrder?.colIds??W2(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return w$(this.beans,H2(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,(_)=>_.aggFunc===void 0?void 0:_.aggFunc!=null))}getPivotColumns(){if(!this.getPivotMode())return[];let _=this.beans.pivotColsSvc?.columns,f=_?.length?_:w$(this.beans,this.lastPivotColIds);return w$(this.beans,H2(this.state.pivot?.colIds,f,this.state.columnState?.patches,($)=>$.pivot==null?void 0:!!$.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.isPivotMode()}getSortDef(_){let f=this.state.sort,$=_.getColId(),z=f?.sortDefsByColId;if(z?.has($))return z.get($)??null;if(f?.baselineCleared)return null;return _.getSortDef()}progressSortFromEvent(_,f){let $=this.state.sort??{sortDefsByColId:new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:z}=this.beans,Q=_.getColId(),J;if($.sortDefsByColId.has(Q))J=$.sortDefsByColId.get(Q);else if($.baselineCleared)J=null;else J=_.getSortDef();let q=z?.getNextSortDirection(_,J);if(!q)return;let{gos:X}=this.beans;if(!(((X.get("multiSortKey")==="ctrl"?f.ctrlKey||f.metaKey:f.shiftKey)||X.get("alwaysMultiSort"))&&!X.get("suppressMultiSort")))$.sortDefsByColId.clear(),$.baselineCleared=!0;$.sortDefsByColId.set(Q,q.direction?q:null),$.seq=l0(this.sequence),this.sequence=$.seq,this.state.sort=$}};function w$(_,f){if(!f)return[];return f.map(($)=>_.colModel.getColDefCol($)).filter(($)=>!!$)}function H2(_,f,$,z){let Q=[..._??f?.map((q)=>q.getColId())??[]];if(!$?.size)return Q;let J=new Set(Q);for(let[q,X]of $){let Y=z(X);if(Y===void 0)continue;if(Y){if(!J.has(q))Q.push(q),J.add(q);continue}if(!J.has(q))continue;J.delete(q);let Z=Q.indexOf(q);if(Z>=0)Q.splice(Z,1)}return Q}function RR(_){let f=_.colModel.getCols().filter(($)=>p$($)).map(($)=>_.colModel.getColDefCol($.getColId())).filter(($)=>!!$);FZ(_,f)}function FZ(_,f){let $=jR(_);if(!$)return;let z=new Set(f);$.list=[...f,...$.list.filter((Q)=>p$(Q)&&!z.has(Q))]}function W2(_){return T2(_).map((f)=>f.getColId())}function T2(_){return(_.colModel.getColDefCols()??_.colModel.getCols()).filter((f)=>p$(f))}function jR(_){let f=_.colModel.colDefCols,$=f?.list;if(!Array.isArray($))return;return f}function p$(_){if(!_.isPrimary())return!1;return!of(_)&&!k$(_)}function l0(_){return _+1}function B2(_,f){let $=kQ(_),z=$.patches.get(f.colId);$.patches.set(f.colId,z?{...z,...f}:f)}function K2(_,f){let $=_.columnState?.patches;if(!$?.size)return;for(let[z,Q]of $){if(!(f in Q))continue;let J={...Q};if(delete J[f],Object.keys(J).length===1){$.delete(z);continue}$.set(z,J)}}function kQ(_){let{columnState:f}=_;if(!f)f={patches:new Map,seq:0,eventType:"toolPanelUi"},_.columnState=f;return f}function DY(_){let{aggFuncs:f}=_;if(!f)f={values:new Map,seq:0,eventType:"toolPanelUi"},_.aggFuncs=f;return f}var VR=class extends A{constructor(){super(...arguments);this.beanName="columnStateUpdateStrategy"}applyColumnState(_,f,$){this.delegate("applyColumnState",_,f,$)}commit(_){this.delegate("commit",_)}hasPendingChanges(_){return this.delegate("hasPendingChanges",_)}moveColumns(_,f,$,z){this.delegate("moveColumns",_,f,$,z)}reset(_){this.delegate("reset",_)}setColumnsVisible(_,f,$,z){this.delegate("setColumnsVisible",_,f,$,z)}isColumnVisibleInToolPanel(_,f){return this.delegate("isColumnVisibleInToolPanel",_,f)}setRowGroupColumns(_,f,$){this.delegate("setRowGroupColumns",_,f,$)}getRowGroupColumns(_){return this.delegate("getRowGroupColumns",_)}getPrimaryColumns(_){return this.delegate("getPrimaryColumns",_)}hasDeferredColumnOrder(_){return this.delegate("hasDeferredColumnOrder",_)}setValueColumns(_,f,$){this.delegate("setValueColumns",_,f,$)}getValueColumns(_){return this.delegate("getValueColumns",_)}setColumnAggFunc(_,f,$,z){this.delegate("setColumnAggFunc",_,f,$,z)}getColumnAggFunc(_,f){return this.delegate("getColumnAggFunc",_,f)}setPivotColumns(_,f,$){this.delegate("setPivotColumns",_,f,$)}getPivotColumns(_){return this.delegate("getPivotColumns",_)}setPivotMode(_,f,$){this.delegate("setPivotMode",_,f,$)}getPivotMode(_){return this.delegate("getPivotMode",_)}isColumnSelectedInPivotModeToolPanel(_,f){return this.delegate("isColumnSelectedInPivotModeToolPanel",_,f)}progressSortFromEvent(_,f,$){this.delegate("progressSortFromEvent",_,f,$)}getSortDef(_,f){return this.delegate("getSortDef",_,f)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new kR))}delegate(_,...f){let $=this.getUpdateStrategy();return $[_].bind($)(...f)}},OR={moduleName:"SharedColumnStateUpdateStrategy",version:$_,beans:[VR],dependsOn:[y_]},DZ={moduleName:"ColumnsToolPanel",version:$_,beans:[MR],userComponents:{agColumnsToolPanel:XR},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[y_,OR,O2,I$,T$,$1,P2]},PR=class extends A{constructor(){super(...arguments);this.beanName="chartMenuItemMapper"}getChartItems(_){let f=this.beans,$=f.chartSvc,z=_==="pivotChart";if(!$)return null;let Q=this.getLocaleTextFunc.bind(this),J=z?new vR(f,$,Q):new TR(f,$,Q),q=$.isEnterprise(),X=J.getMenuItem();if(X?.subMenu&&!q){let Z=(G)=>({...G,subMenu:G.subMenu?.filter((E)=>!E._enterprise).map((E)=>Z(E))});X=Z(X)}let Y=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(Y)X=this.filterAndOrderChartMenu(X,Y,J.getConfigLookup());return this.cleanInternals(X)}cleanInternals(_){if(!_)return _;let f=($)=>{delete $?._key,delete $?._enterprise;for(let z of $?.subMenu??[])f(z);return $};return f(_)}buildLookup(_){let f={},$=(z)=>{if(f[z._key]=z,z.subMenu)for(let Q of z.subMenu)$(Q)};return $(_),f}filterAndOrderChartMenu(_,f,$){let z=this.buildLookup(_),Q={..._,subMenu:[]};for(let J of Object.keys(f)){let q=f[J],X=$[J];if(X===null)continue;if(X==null){j(173,{group:J});continue}let Y=z[X._key];if(Y)if(Y.subMenu){let Z=q.map((G)=>{let E=X[G];if(E==null){j(174,{group:J,chartType:G});return}return z[E]}).filter((G)=>G!==void 0);if(Z.length>0)Y.subMenu=Z,Q.subMenu?.push(Y)}else Q.subMenu?.push(Y)}if(Q.subMenu?.length==0)return null;return Q}},vR=class{constructor(_,f,$){this.beans=_,this.chartSvc=f,this.getLocaleTextFunc=$}getMenuItem(){let _=this.getLocaleTextFunc(),f=($,z,Q,J,q=!1)=>{return{name:_($,z+"‎"),action:()=>this.chartSvc.createPivotChart({chartType:Q}),_key:J,_enterprise:q}};return{name:_("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:_("columnChart","Column"),subMenu:[f("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),f("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),f("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:_("barChart","Bar"),subMenu:[f("groupedBar","Grouped","groupedBar","pivotGroupedBar"),f("stackedBar","Stacked","stackedBar","pivotStackedBar"),f("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:_("pieChart","Pie"),subMenu:[f("pie","Pie","pie","pivotPie"),f("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:_("lineChart","Line"),subMenu:[f("lineChart","Line","line","pivotLineChart"),f("stackedLine","Stacked","stackedLine","pivotStackedLine"),f("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:_("areaChart","Area"),subMenu:[f("areaChart","Area","area","pivotArea"),f("stackedArea","Stacked","stackedArea","pivotStackedArea"),f("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:_("xyChart","X Y (Scatter)"),subMenu:[f("scatter","Scatter","scatter","pivotScatter"),f("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:_("statisticalChart","Statistical"),subMenu:[f("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:_("hierarchicalChart","Hierarchical"),subMenu:[f("treemapChart","Treemap","treemap","pivotTreemap",!0),f("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:_("funnel","Funnel"),subMenu:[f("funnel","Funnel","funnel","pivotFunnel"),f("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),f("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:_("combinationChart","Combination"),subMenu:[f("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),f("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:h("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},TR=class{constructor(_,f,$){this.beans=_,this.chartSvc=f,this.getLocaleTextFunc=$}getMenuItem(){let _=this.getLocaleTextFunc(),f=($,z,Q,J,q=!1)=>{return{name:_($,z),action:()=>this.chartSvc.createChartFromCurrentRange(Q),_key:J,_enterprise:q}};return{name:_("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:_("columnChart","Column"),subMenu:[f("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),f("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),f("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:_("barChart","Bar"),subMenu:[f("groupedBar","Grouped","groupedBar","rangeGroupedBar"),f("stackedBar","Stacked","stackedBar","rangeStackedBar"),f("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:_("pieChart","Pie"),subMenu:[f("pie","Pie","pie","rangePie"),f("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:_("lineChart","Line"),subMenu:[f("lineChart","Line","line","rangeLineChart"),f("stackedLine","Stacked","stackedLine","rangeStackedLine"),f("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:_("areaChart","Area"),subMenu:[f("areaChart","Area","area","rangeArea"),f("stackedArea","Stacked","stackedArea","rangeStackedArea"),f("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:_("xyChart","X Y (Scatter)"),subMenu:[f("scatter","Scatter","scatter","rangeScatter"),f("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:_("polarChart","Polar"),subMenu:[f("radarLine","Radar Line","radarLine","rangeRadarLine"),f("radarArea","Radar Area","radarArea","rangeRadarArea"),f("nightingale","Nightingale","nightingale","rangeNightingale"),f("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),f("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:_("statisticalChart","Statistical"),subMenu:[f("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),f("histogramChart","Histogram","histogram","rangeHistogram",!1),f("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),f("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:_("hierarchicalChart","Hierarchical"),subMenu:[f("treemap","Treemap","treemap","rangeTreemap"),f("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:_("specializedChart","Specialized"),subMenu:[f("heatmap","Heatmap","heatmap","rangeHeatmap"),f("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:_("funnel","Funnel"),subMenu:[f("funnel","Funnel","funnel","rangeFunnel"),f("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),f("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:_("combinationChart","Combination"),subMenu:[f("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),f("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:h("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},IR=class extends A{constructor(){super(...arguments);this.beanName="colChooserFactory"}createColumnSelectPanel(_,f,$,z){let Q=_.createManagedBean(new LZ),J=z??f?.getColDef().columnChooserParams??{},{contractColumnSelection:q,suppressColumnExpandAll:X,suppressColumnFilter:Y,suppressColumnSelectAll:Z,suppressSyncLayoutWithGrid:G,columnLayout:E}=J;if(Q.init(!!$,C(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!q,suppressColumnExpandAll:!!X,suppressColumnFilter:!!Y,suppressColumnSelectAll:!!Z,suppressSyncLayoutWithGrid:!!E||!!G,onStateUpdated:()=>{}}),"columnMenu"),E)Q.setColumnLayout(E);return Q}showColumnChooser({column:_,chooserParams:f,eventSource:$,headerPosition:z}){this.hideActiveColumnChooser();let Q=this.createColumnSelectPanel(this,_,!0,f),J=this.getLocaleTextFunc(),q=this.beans,{visibleCols:X,focusSvc:Y,menuUtils:Z}=q,G=X.allCols.indexOf(_),E=_?Y.focusedHeader??z??null:null;this.activeColumnChooserDialog=this.createBean(new oS({title:J("chooseColumns","Choose Columns"),component:Q,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{V_(q,Q.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,_)},closedCallback:(U)=>{let H=this.activeColumnChooser.getGui();if(this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,_),_)Z.restoreFocusOnClose({column:_,headerPosition:E,columnIndex:G,eventSource:$},H,U,!0)},postProcessPopupParams:{type:"columnChooser",column:_,eventSource:$}})),this.activeColumnChooser=Q}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(_,f){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:_,switchingTab:!1,key:"columnChooser",column:f??null})}},yR={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function bR(_,f){let $=yR[f];if($)_.assertModuleRegistered($,`menu item '${f}'`)}var z1="separator";function MZ(_,f){if(!_)return;for(let $=_.length-2;$>=0;$--){let z=_[$]===f,Q=_[$+1]===f;if(z&&Q)_.splice($+1,1)}}var CR={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:(_)=>({type:M0(_.getSortDef()?.type),direction:null})}},wR=class extends A{constructor(){super(...arguments);this.beanName="menuItemMapper"}mapWithStockItems(_,f,$,z,Q){if(!_)return[];let J=[],q=this.getLocaleTextFunc(),{beans:X,gos:Y}=this,{pinnedCols:Z,colAutosize:G,aggFuncSvc:E,rowGroupColsSvc:U,colNames:H,colModel:W,clipboardSvc:B,expansionSvc:K,focusSvc:L,csvCreator:F,excelCreator:D,menuSvc:M,colChooserFactory:k,sortSvc:R,chartMenuItemMapper:O,valueColsSvc:I,pinnedRowModel:T}=X,y=(i,x,a,t)=>{switch(bR(Y,i),i){case"pinSubMenu":return Z&&x?{name:q("pinColumn","Pin Column"),icon:h("menuPin",X,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return Z&&x?{name:q("pinLeft","Pin Left"),action:()=>Z.setColsPinned([x],"left",t),checked:!!x&&x.isPinnedLeft()}:null;case"pinRight":return Z&&x?{name:q("pinRight","Pin Right"),action:()=>Z.setColsPinned([x],"right",t),checked:!!x&&x.isPinnedRight()}:null;case"clearPinned":return Z&&x?{name:q("noPin","No Pin"),action:()=>Z.setColsPinned([x],null,t),checked:!!x&&!x.isPinned()}:null;case"pinRowSubMenu":{let u=Y.get("enableRowPinning"),__=[],r=$?.rowPinned??$?.pinnedSibling?.rowPinned;if(r)__.push("unpinRow");if(u&&u!=="bottom"&&r!="top")__.push("pinTop");if(u&&u!=="top"&&r!="bottom")__.push("pinBottom");return T?.isManual()?{name:q("pinRow","Pin Row"),icon:h("rowPin",X,x),subMenu:__}:null}case"pinTop":return T?.isManual()?{name:q("pinTop","Pin to Top"),icon:h("rowPinTop",X,x),action:({node:u,column:__})=>u&&T.pinRow(u,"top",__)}:null;case"pinBottom":return T?.isManual()?{name:q("pinBottom","Pin to Bottom"),icon:h("rowPinBottom",X,x),action:({node:u,column:__})=>u&&T.pinRow(u,"bottom",__)}:null;case"unpinRow":return T?.isManual()?{name:q("unpinRow","Unpin Row"),icon:h("rowUnpin",X,x),action:({node:u,column:__})=>u&&T.pinRow(u,null,__)}:null;case"valueAggSubMenu":if(E&&I&&(x?.isPrimary()||x?.getColDef().pivotValueColumn))return{name:q("valueAggregation","Value Aggregation"),icon:h("menuValue",X,null),subMenu:xR(x,E,I,q),disabled:Y.get("functionsReadOnly")};else return null;case"autoSizeThis":return G?{name:q("autosizeThisColumn","Autosize This Column"),action:()=>x&&G.autoSizeColumn(x,t,Y.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return G?{name:q("autosizeAllColumns","Autosize All Columns"),action:()=>G.autoSizeAllColumns({source:t,skipHeader:Y.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return U?{name:i$(q,"groupBy",H.getDisplayNameForColumn(x,"header")),disabled:Y.get("functionsReadOnly")||x?.isRowGroupActive()||!x?.getColDef().enableRowGroup,action:()=>U.addColumns([x],t),icon:h("menuAddRowGroup",X,null)}:null;case"rowUnGroup":if(U&&Y.isModuleRegistered("SharedRowGrouping")){let u=x?.getColDef().showRowGroup,__=Y.get("groupLockGroupColumns"),r,O_,P_;if(u===!0)r=q("ungroupAll","Un-Group All"),O_=Y.get("functionsReadOnly")||__===-1||__>=(U.columns.length??0),P_=()=>U.setColumns(U.columns.slice(0,__),t);else if(typeof u==="string"){let M_=W.getColDefCol(u),Tf=M_!=null?H.getDisplayNameForColumn(M_,"header"):u;r=i$(q,"ungroupBy",Tf),O_=Y.get("functionsReadOnly")||c$(M_,X),P_=()=>{U.removeColumns([u],t)}}else r=i$(q,"ungroupBy",H.getDisplayNameForColumn(x,"header")),O_=Y.get("functionsReadOnly")||!x?.isRowGroupActive()||!x?.getColDef().enableRowGroup||c$(x,X),P_=()=>U.removeColumns([x],t);return{name:r,disabled:O_,action:P_,icon:h("menuRemoveRowGroup",X,null)}}else return null;case"resetColumns":return{name:q("resetColumns","Reset Columns"),action:()=>rX(X,t)};case"expandAll":return K?{name:q("expandAll","Expand All Row Groups"),action:()=>K.expandAll(!0)}:null;case"contractAll":return K?{name:q("collapseAll","Collapse All Row Groups"),action:()=>K.expandAll(!1)}:null;case"copy":return B?{name:q("copy","Copy"),shortcut:q("ctrlC","Ctrl+C"),icon:h("clipboardCopy",X,null),action:()=>B.copyToClipboard()}:null;case"copyWithHeaders":return B?{name:q("copyWithHeaders","Copy with Headers"),icon:h("clipboardCopy",X,null),action:()=>B.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return B?{name:q("copyWithGroupHeaders","Copy with Group Headers"),icon:h("clipboardCopy",X,null),action:()=>B.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(B){let u=L.getFocusedCell(),__=u?D_(X,u):null,r=__?u?.column.isCellEditable(__):!1;return{name:q("cut","Cut"),shortcut:q("ctrlX","Ctrl+X"),icon:h("clipboardCut",X,null),disabled:!r||Y.get("suppressCutToClipboard"),action:()=>B.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(B){let u=Y.get("suppressClipboardApi")||Y.get("suppressClipboardPaste")||!x||!$||!x.isCellEditable($)||x.isSuppressPaste($);return{name:q("paste","Paste"),shortcut:q("ctrlV","Ctrl+V"),icon:h("clipboardPaste",X,null),disabled:u,action:()=>B.pasteFromClipboard()}}else return null;case"export":{let u=[];if(!Y.get("suppressCsvExport")&&F)u.push("csvExport");if(!Y.get("suppressExcelExport")&&D)u.push("excelExport");return u.length?{name:q("export","Export"),subMenu:u,icon:h("save",X,null)}:null}case"csvExport":return F?{name:q("csvExport","CSV Export"),icon:h("csvExport",X,null),action:()=>F.exportDataAsCsv()}:null;case"excelExport":return D?{name:q("excelExport","Excel Export"),icon:h("excelExport",X,null),action:()=>D.exportDataAsExcel()}:null;case"separator":return i;case"pivotChart":case"chartRange":return O.getChartItems(i);case"columnFilter":return M&&x?{name:q("columnFilter","Column Filter"),icon:h("filter",X,null),action:()=>M.showFilterMenu({column:x,buttonElement:a(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{let u=L.focusedHeader;return k?{name:q("columnChooser","Choose Columns"),icon:h("columns",X,null),action:()=>k.showColumnChooser({column:x,eventSource:a(),headerPosition:u})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!R||!x)return null;let{fallback:u,getSortDef:__}=CR[i];return{name:q(i,u),icon:h(i,X,null),action:()=>R.setSortForColumn(x,__(x),!1,t)}}default:return j(176,{key:i}),null}};for(let i of _){let x;if(typeof i==="string")x=y(i,f,z,Q);else x={...i};if(!x)continue;let a=x,{subMenu:t}=a;if(t&&t instanceof Array)a.subMenu=this.mapWithStockItems(t,f,$,z,Q);if(x!=null)J.push(x)}return MZ(J,z1),J}};function xR(_,f,$,z){let Q;if(_.isPrimary())Q=_;else{let q=_.getColDef().pivotValueColumn;Q=v(q)?q:void 0}let J=[];if(Q){let q=Q.isValueActive(),X=f.getFuncNames(Q);J.push({name:z("noAggregation","None"),action:()=>{$.removeColumns([Q],"contextMenu"),$.setColumnAggFunc(Q,void 0,"contextMenu")},checked:!q});for(let Y of X)J.push({name:z(Y,f.getDefaultFuncLabel(Y)),action:()=>{$.setColumnAggFunc(Q,Y,"contextMenu"),$.addColumns([Q],"contextMenu")},checked:q&&Q.getAggFunc()===Y})}return J}var NR=class extends A{constructor(){super(...arguments);this.beanName="colMenuFactory"}createMenu(_,f,$,z){let Q=_.createManagedBean(new WZ(0,{column:$??null,node:null,value:null})),J=this.beans.menuItemMapper.mapWithStockItems(f,$??null,null,z,"columnMenu");return Q.addMenuItems(J),Q}getMenuItems(_=null,f=null){let $=this.getDefaultMenuOptions(_),z,Q=(_?.getColDef()??f?.getColGroupDef())?.mainMenuItems;if(Array.isArray(Q))z=Q;else if(typeof Q==="function")z=Q(C(this.gos,{column:_,columnGroup:f,defaultItems:$}));else{let J=this.gos.getCallback("getMainMenuItems");if(J)z=J({column:_,columnGroup:f,defaultItems:$});else z=$}return MZ(z,z1),z}getDefaultMenuOptions(_){let f=[],{beans:$,gos:z}=this,{colChooserFactory:Q,rowGroupColsSvc:J,colModel:q,expansionSvc:X,sortSvc:Y,menuSvc:Z,pinnedCols:G,aggFuncSvc:E,colAutosize:U}=$,H=E_(z),W=()=>{if(!H&&Q)f.push("columnChooser");f.push("resetColumns")};if(!_)return W(),f;let{colDef:B}=_,K=G&&!B.lockPinned,L=J?.columns.length??0,F=L>0,D=Lf(z),M=z.get("treeData"),k=_.isPrimary(),R=!k||E&&_.isAllowValue()&&(F||D||M);if(Y&&!H&&_.isSortable()){let{isDefaultSortAllowed:O,isAbsoluteSortAllowed:I,isAbsoluteSort:T,isDefaultSort:y,isAscending:i,isDescending:x,direction:a}=EJ(_,$);if(O&&!(i&&y))f.push("sortAscending");if(O&&!(x&&y))f.push("sortDescending");if(I&&!(i&&T))f.push("sortAbsoluteAscending");if(I&&!(x&&T))f.push("sortAbsoluteDescending");if(a)f.push("sortUnSort");f.push(z1)}if(Z?.isFilterMenuItemEnabled(_))f.push("columnFilter"),f.push(z1);if(K)f.push("pinSubMenu");if(R)f.push("valueAggSubMenu");if(K||R)f.push(z1);if(U){if(!B.suppressAutoSize)f.push("autoSizeThis");f.push("autoSizeAll"),f.push(z1)}if(J&&z.isModuleRegistered("SharedRowGrouping")){let O=f.length;if(B.showRowGroup)f.push("rowUnGroup");else if(_.isAllowRowGroup()&&k)if(_.isRowGroupActive()){if(!c$(_,$))f.push("rowUnGroup")}else f.push("rowGroup");if(f.length>O)f.push(z1)}if(W(),X&&(o(z)||z.get("ssrmExpandAllAffectsAllRows"))&&(M||L>(q.isPivotMode()?1:0)))f.push("expandAll"),f.push("contractAll");return f}};var jf="filterMenuTab",Vf="generalMenuTab",Q1="columnsMenuTab",SQ=[Vf,jf,Q1],gR=class extends A{constructor(){super(...arguments);this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(_,f,$,z,Q){let{column:J,columnGroup:q}=this.splitColumnOrGroup(_),X=Q?"filterMenuTab":void 0;this.showMenu(J,q,(Y)=>{let Z=Y.getGui();if(this.beans.popupSvc.positionPopupUnderMouseEvent({type:$,additionalParams:{column:J},mouseEvent:f,ePopup:Z}),X)Y.showTab?.(X);this.dispatchVisibleChangedEvent(!0,!1,J,q,X)},$,X,void 0,f.target,z)}splitColumnOrGroup(_){let f=_&&Q0(_);return{column:f?_:void 0,columnGroup:f?void 0:_}}showMenuAfterButtonClick(_,f,$,z,Q){let J=-1,q="left";if(this.gos.get("enableRtl"))J=1,q="right";let X=Q?"filterMenuTab":void 0,Y=X?[X]:void 0,Z=E_(this.gos),G=(Z?9:4)*J,E=Z?-23:4,{column:U,columnGroup:H}=this.splitColumnOrGroup(_);this.showMenu(U,H,(W)=>{let B=W.getGui();if(this.beans.popupSvc.positionPopupByComponent({type:$,additionalParams:{column:U},eventSource:f,ePopup:B,alignSide:q,nudgeX:G,nudgeY:E,position:"under",keepWithinBounds:!0}),X)W.showTab?.(X);this.dispatchVisibleChangedEvent(!0,!1,U,H,X)},$,X,Y,f,z)}showMenu(_,f,$,z,Q,J,q,X){let Y=this.getMenuParams(_,f,J,q);if(!Y)return;let{menu:Z,eMenuGui:G,anchorToElement:E,restoreFocusParams:U}=Y,H=[],{menuUtils:W,popupSvc:B}=this.beans;H.push((L)=>{let F=Z.getGui();if(this.destroyBean(Z),_)B$(_,!1,"contextMenu"),W.restoreFocusOnClose(U,F,L);X?.()});let K=this.getLocaleTextFunc();if(B.addPopup({modal:!0,eChild:G,closeOnEsc:!0,closedCallback:(L)=>{for(let F of H)F(L);this.dispatchVisibleChangedEvent(!1,!1,_,f,Q)},afterGuiAttached:(L)=>Z.afterGuiAttached(Object.assign({},{container:z},L)),positionCallback:Q?()=>$(Z):void 0,ariaLabel:K("ariaLabelColumnMenu","Column Menu")}),!Q)Z.showTabBasedOnPreviousSelection?.(),$(Z);if(YJ(this.gos)){let L=B.setPopupPositionRelatedToElement(G,E);if(L&&_)this.addStopAnchoring(L,_,H)}if(Z.addEventListener("tabSelected",(L)=>{this.dispatchVisibleChangedEvent(!1,!0,_),this.lastSelectedTab=L.key,this.dispatchVisibleChangedEvent(!0,!0,_)}),_)B$(_,!0,"contextMenu");this.activeMenu=Z,Z.addEventListener("destroyed",()=>{if(this.activeMenu===Z)this.activeMenu=null})}addStopAnchoring(_,f,$){_.then((z)=>{f.__addEventListener("leftChanged",z),f.__addEventListener("visibleChanged",z),$.push(()=>{f.__removeEventListener("leftChanged",z),f.__removeEventListener("visibleChanged",z)})})}getMenuParams(_,f,$,z){let{focusSvc:Q,visibleCols:J,ctrlsSvc:q}=this.beans,X={column:_,headerPosition:Q.focusedHeader,columnIndex:J.allCols.indexOf(_),eventSource:z},Y=this.createMenu(_,f,X,$,z);return Y?{menu:Y,eMenuGui:Y.getGui(),anchorToElement:z||q.getGridBodyCtrl().eGridBody,restoreFocusParams:X}:void 0}createMenu(_,f,$,z,Q){if(E_(this.gos))return this.createBean(new hR(_,$,this.lastSelectedTab,z,Q));else{let J=this.beans.colMenuFactory.getMenuItems(_,f);return J.length?this.createBean(new uR(J,_,$,Q)):void 0}}dispatchVisibleChangedEvent(_,f,$,z,Q){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:_,switchingTab:f,key:this.lastSelectedTab??Q??(E_(this.gos)?Vf:"columnMenu"),column:$??null,columnGroup:z??null})}isMenuEnabled(_){if(!E_(this.gos))return!0;let f=!this.beans.filterManager?.isFilterAllowed(_),$=_.getColDef().menuTabs??SQ;return(f&&$.includes(jf)?$.length-1:$.length)>0}showMenuAfterContextMenuEvent(_,f,$){this.beans.menuUtils.onContextMenu({mouseEvent:f,touchEvent:$,source:"ui",showMenuCallback:(z)=>{return this.showMenuAfterMouseEvent(_,z,"columnMenu"),!0}})}},hR=class extends A{constructor(_,f,$,z,Q){super();this.column=_,this.restoreFocusParams=f,this.initialSelection=$,this.restrictTo=z,this.sourceElement=Q,this.tabFactories={},this.includeChecks={};let{tabFactories:J,includeChecks:q}=this;J[Vf]=this.createMainPanel.bind(this),J[jf]=this.createFilterPanel.bind(this),J[Q1]=this.createColumnsPanel.bind(this),q[Vf]=()=>!0,q[jf]=()=>_?!!this.beans.filterManager?.isFilterAllowed(_):!1,q[Q1]=()=>!0}postConstruct(){let _=this.getTabsToCreate().map(($)=>this.createTab($)),f=new nS({items:_,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(f),this.mainMenuList?.setParentComponent(f),this.addDestroyFunc(()=>this.destroyBean(f))}getTabsToCreate(){if(this.restrictTo)return this.restrictTo;return(this.column?.getColDef().menuTabs??SQ).filter((_)=>this.isValidMenuTabItem(_)&&this.isNotSuppressed(_))}isValidMenuTabItem(_){let f=!0,$=SQ;if(this.restrictTo!=null)f=this.restrictTo.indexOf(_)>-1,$=this.restrictTo;if(f=f&&SQ.indexOf(_)>-1,!f)j(175,{menuTabName:_,itemsToConsider:$});return f}isNotSuppressed(_){return this.includeChecks[_]()}createTab(_){return this.tabFactories[_]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(_){let{tabItemColumns:f,tabbedLayout:$,tabItemFilter:z,tabItemGeneral:Q}=this;if(f&&_===Q1)$.showItem(f);else if(z&&_===jf)$.showItem(z);else if(Q&&_===Vf)$.showItem(Q);else $.showFirstItem()}onTabItemClicked(_){let f=null;switch(_.item){case this.tabItemColumns:f=Q1;break;case this.tabItemFilter:f=jf;break;case this.tabItemGeneral:f=Vf;break}if(f)this.activateTab(f)}activateTab(_){let f={type:"tabSelected",key:_};this.dispatchLocalEvent(f)}createMainPanel(){let{beans:_,column:f}=this,$=_.colMenuFactory,z=$.createMenu(this,$.getMenuItems(f),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=z,z.addEventListener("closeMenu",this.onHidePopup.bind(this));let Q={title:h("legacyMenu",_,f),titleLabel:Vf.replace("MenuTab",""),bodyPromise:g.resolve(z.getGui()),name:Vf};return this.tabItemGeneral=Q,Q}onHidePopup(_){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,_)}createFilterPanel(){let _=this.column?this.createBean(new J2(this.column,"COLUMN_MENU")):null;if(this.filterComp=_,!_?.hasFilter())e(119);let f=(z)=>_?.afterGuiAttached(z),$=()=>_?.afterGuiDetached();return this.tabItemFilter={title:h("filterTab",this.beans,this.column),titleLabel:jf.replace("MenuTab",""),bodyPromise:g.resolve(_?.getGui()),afterAttachedCallback:f,afterDetachedCallback:$,name:jf},this.tabItemFilter}createColumnsPanel(){let _=z_({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:f,column:$}=this,Q=f.colChooserFactory.createColumnSelectPanel(this,$).getGui();Q.classList.add("ag-menu-column-select"),_.appendChild(Q);let J={title:h("columns",f,$),titleLabel:Q1.replace("MenuTab",""),bodyPromise:g.resolve(_),name:Q1};return this.tabItemColumns=J,J}afterGuiAttached(_){let{container:f,hidePopup:$}=_;if(this.tabbedLayout.setAfterAttachedParams({container:f,hidePopup:$}),$)this.hidePopupFunc=$,this.addDestroyFunc($)}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},uR=class extends w{constructor(_,f,$,z){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"});this.menuItems=_,this.column=f,this.restoreFocusParams=$,this.sourceElement=z,this.eColumnMenu=V}postConstruct(){let _=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=_,_.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(_.getGui())}onHidePopup(_){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,_)}afterGuiAttached({hidePopup:_}){if(_)this.hidePopupFunc=_,this.addDestroyFunc(_);F_(this.mainMenuList.getGui())}};function iR(_,f){_.colChooserFactory?.showColumnChooser({chooserParams:f})}function mR(_){_.colChooserFactory?.hideActiveColumnChooser()}var cR=class extends A{constructor(){super(...arguments);this.beanName="menuUtils"}restoreFocusOnClose(_,f,$,z){let{eventSource:Q}=_,J=$ instanceof KeyboardEvent;if(!z&&!J||!Q)return;let q=d(this.beans);if(!f.contains(q)&&!sf(this.beans))return;this.focusHeaderCell(_)}closePopupAndRestoreFocusOnSelect(_,f,$){let z;if($?.keyboardEvent)z=$.keyboardEvent;_(z&&{keyboardEvent:z});let Q=this.beans,J=Q.focusSvc,q=J.getFocusedCell();if(sf(Q))if(q){let{rowIndex:X,rowPinned:Y,column:Z}=q;J.setFocusedCell({rowIndex:X,column:Z,rowPinned:Y,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(f)}onContextMenu(_){let{mouseEvent:f,touchEvent:$,showMenuCallback:z,source:Q}=_;if(!this.gos.get("allowContextMenuWithControlKey")){if(f&&(f.ctrlKey||f.metaKey))return}if(f)this.blockMiddleClickScrollsIfNeeded(f);if(Q==="ui"&&this.gos.get("suppressContextMenu"))return;let J=f??$.touches[0];if(z(J)){let q=f??$;if(q?.cancelable)q.preventDefault()}}async focusHeaderCell(_){let{column:f,columnIndex:$,headerPosition:z,eventSource:Q}=_,{visibleCols:J,headerNavigation:q,focusSvc:X}=this.beans,Y=await J.allCols.some((Z)=>Z===f);if(!this.isAlive())return;if(f?.isAlive()&&Y&&Q&&A_(Q)){let Z=ez(Q);if(Z)q?.scrollToColumn(f),Z.focus()}else if(z&&$!==-1){let Z=J.allCols,G=Z[$]||b(Z);if(G)X.focusHeaderPosition({headerPosition:{headerRowIndex:z.headerRowIndex,column:G}})}}blockMiddleClickScrollsIfNeeded(_){if(this.gos.get("suppressMiddleClickScrolls")&&_.which===2)_.preventDefault()}},pR={moduleName:"MenuCore",version:$_,beans:[wR,PR,cR],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[y_,$1,eJ,P2]},kZ={moduleName:"ColumnMenu",version:$_,beans:[gR,NR,IR],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:iR,hideColumnChooser:mR},dependsOn:[pR,T$,I$]};var nR=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function dR(_,f,$){return _.getCompDetails(f,tR,void 0,$,!0)}var tR={name:"statusPanel",optionalMethods:["refresh"]},rR={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},lR={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},sR=class extends w{constructor(){super(lR);this.updateQueued=!1,this.panelsPromise=g.resolve(),this.eStatusBarLeft=V,this.eStatusBarCenter=V,this.eStatusBarRight=V,this.compDestroyFunctions={},this.registerCSS(nR)}wireBeans(_){this.userCompFactory=_.userCompFactory,this.statusBarSvc=_.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),Mf(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){let _=this.gos,f=_.get("statusBar")?.statusPanels;if(!f)return f;return f.filter(($)=>{let{rowModels:z,warnArgs:Q}=rR[$.statusPanel]??{};if(!z)return!0;if(z.includes(_.get("rowModelType")))return!0;return j(...Q),!1})}processStatusPanels(_){let f=this.getValidPanels();if(f){let $=f.filter((J)=>J.align==="left"),z=f.filter((J)=>J.align==="center"),Q=f.filter((J)=>!J.align||J.align==="right");this.panelsPromise=g.all([this.createAndRenderComponents($,this.eStatusBarLeft,_),this.createAndRenderComponents(z,this.eStatusBarCenter,_),this.createAndRenderComponents(Q,this.eStatusBarRight,_)])}else this.setDisplayed(!1)}handleStatusBarChanged(){if(this.updateQueued)return;this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1})}updateStatusBar(){let _=this.getValidPanels(),f=Array.isArray(_)&&_.length>0;this.setDisplayed(f);let $=new Map;if(f)for(let z of _){let Q=z.key??z.statusPanel,J=this.statusBarSvc.getStatusPanel(Q);if(J?.refresh){let q=C(this.gos,{...z.statusPanelParams??{},key:Q});if(J.refresh(q))$.set(Q,J),delete this.compDestroyFunctions[Q],T_(J.getGui())}}if(this.resetStatusBar(),f)this.processStatusPanels($)}resetStatusBar(){f_(this.eStatusBarLeft),f_(this.eStatusBarCenter),f_(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(let _ of Object.values(this.compDestroyFunctions))_();this.compDestroyFunctions={}}createAndRenderComponents(_,f,$){let z=[];for(let Q of _){let J=Q.key||Q.statusPanel,q=$.get(J),X;if(q)X=g.resolve(q);else{let Y=dR(this.userCompFactory,Q,C(this.gos,{key:J}));if(Y==null)continue;X=Y.newAgStackInstance()}z.push({key:J,promise:X})}return g.all(z.map((Q)=>Q.promise)).then(()=>{for(let Q of z)Q.promise.then((J)=>{let q=()=>{this.destroyBean(J)};if(this.isAlive())this.statusBarSvc.registerStatusPanel(Q.key,J),f.appendChild(J.getGui()),this.compDestroyFunctions[Q.key]=q;else q()})})}},aR={selector:"AG-STATUS-BAR",component:sR},oR={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},": ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},eR=BigInt(Number.MIN_SAFE_INTEGER),_j=BigInt(Number.MAX_SAFE_INTEGER),d$=class extends w{constructor(){super(oR);this.eLabel=V,this.eValue=V}setLabel(_,f){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(_,f)}setValue(_,f){let $=null,z;if(typeof _==="bigint"){if(z=_,_>=eR&&_<=_j)$=Number(_)}else $=_;this.eValue.textContent=this.valueFormatter(C(this.gos,{value:$,bigintValue:z,totalRows:f,key:this.key}))}},fj={selector:"AG-NAME-VALUE",component:d$},SZ=(_)=>{let f=0;return _.forEachNodeAfterFilter(($)=>{if($.data)f++}),f},t$=(_)=>{let f=0;return _.forEachNode(($)=>{if($.data)f++}),f};function $j(_,f){if(typeof _!=="number")return"";return A0(Math.round(_*100)/100,f)}var zj={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},Qj=class extends w{constructor(){super(zj,[fj]);this.sumAggregationComp=V,this.countAggregationComp=V,this.minAggregationComp=V,this.maxAggregationComp=V,this.avgAggregationComp=V}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(_){this.refresh(_)}refresh(_){this.params=_;let f=_.valueFormatter??((z)=>{let{value:Q,bigintValue:J}=z;if(J!=null)return J.toString();return $j(Q,this.getLocaleTextFunc.bind(this))}),$=["avg","count","min","max","sum"];for(let z of $){let Q=this.getAllowedAggregationValueComponent(z);if(Q)Q.key=z,Q.valueFormatter=f.bind(this)}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(_,f,$){let z=this.getAllowedAggregationValueComponent(_),Q=t$(this.beans.rowModel);if(v(z)&&z)z.setValue(f,Q),z.setDisplayed($);else this.getAggregationValueComponent(_)?.setDisplayed(!1)}getAllowedAggregationValueComponent(_){let{aggFuncs:f}=this.params;if(!f||f.includes(_))return this.getAggregationValueComponent(_);return null}getAggregationValueComponent(_){let f=`${_}AggregationComp`;return this[f]}onCellSelectionChanged(){let _=this.beans,{rangeSvc:f,valueSvc:$}=_,z=f?.getCellRanges(),Q=0,J=0n,q=!1,X=!1,Y=0,Z=0,G=null,E=null,U=null,H=null,W=(T)=>{if(typeof T==="number"){if(Q+=T,G===null||TE)E=T;if(!Number.isInteger(T)||!Number.isSafeInteger(T))X=!0;else{let y=BigInt(T);if(J+=y,U===null||yH)H=y}}else{if(q=!0,J+=T,U===null||TH)H=T;let y=Number(T);if(Q+=y,G===null||yE)E=y}Z++},B={};if(z?.length&&f)for(let T=0;T{if(i===null)return;let u=g0({rowPinned:i.rowPinned,column:t,rowIndex:i.rowIndex});if(B[u])return;B[u]=!0;let __=D_(_,i);if(n(__))return;let r=$.getValue(t,__,"data");if(n(r)||r==="")return;if(Y++,typeof r==="object"&&"value"in r){if(r=r.value,r==="")return}if(typeof r==="string"){let O_=r.trim();if(O_==="")return;let P_=Number(O_);if(!Number.isFinite(P_))return;if(Q+P_>=Number.MAX_SAFE_INTEGER||Q+P_<=Number.MIN_SAFE_INTEGER||P_>=Number.MAX_SAFE_INTEGER||P_<=Number.MIN_SAFE_INTEGER){if(r=Bf(O_),r===null)r=P_}else r=P_}if(typeof r==="number"&&!isNaN(r)||typeof r==="bigint")W(r)}),i=K_(_,i)}}let K=Y>1,L=Z>1,F=q&&!X,D;if(F)D=J/BigInt(Z);else D=Q/Z;let M=L?F?J:Q:null,k=L?F?U:G:null,R=L?F?H:E:null,O=L?D:null,I=L;this.setAggregationComponentValue("count",Y,K),this.setAggregationComponentValue("sum",M,L),this.setAggregationComponentValue("min",k,L),this.setAggregationComponentValue("max",R,L),this.setAggregationComponentValue("avg",O,I)}},Jj=class extends d${postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);let _=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:_})}onDataChanged(){let{rowModel:_}=this.beans,f=t$(_),$=SZ(_);this.setValue($,f),this.setDisplayed(f!==$)}init(_){this.refresh(_),this.onDataChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f})=>A0(f,this.getLocaleTextFunc.bind(this)))}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}},qj=class extends d${postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");let _=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:_,selectionChanged:_})}onRowSelectionChanged(){let{selectionSvc:_,rowModel:f}=this.beans,$=_?.getSelectionCount()??0,z=t$(f);if(this.setValue($,z),$<0){this.setDisplayed(!0);return}this.setDisplayed($>0)}init(_){this.refresh(_),this.onRowSelectionChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f})=>{if(f==null||f>=0)return A0(f,this.getLocaleTextFunc.bind(this));return this.getLocaleTextFunc()("statusBarLastRowUnknown","?")})}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}},Xj=class extends d${postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let{rowModel:_}=this.beans,f=SZ(_),$=t$(_);this.setValue(f,$)}init(_){this.refresh(_),this.onDataChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f,totalRows:$})=>{let z=this.getLocaleTextFunc.bind(this),Q=A0(f,z),J=A0($??f,z);if(f===$)return Q;let q=z();return`${Q} ${q("of","of")} ${J}`})}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}},Yj=class extends d${postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let _=t$(this.beans.rowModel);this.setValue(_,_)}init(_){this.refresh(_),this.onDataChanged()}updateValueFormatter(_){this.valueFormatter=_??(({value:f})=>A0(f,this.getLocaleTextFunc.bind(this)))}refresh(_){let{key:f,valueFormatter:$}=_;return this.key=f,this.updateValueFormatter($),!0}};function Zj(_,f){let $=_.statusBarSvc?.getStatusPanel(f);return d0($)}var Gj=class extends A{constructor(){super();this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(_,f){this.comps.set(_,f)}unregisterStatusPanel(_){this.comps.delete(_)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(_){return this.comps.get(_)}destroy(){this.unregisterAllComponents(),super.destroy()}},AZ={moduleName:"StatusBar",version:$_,beans:[Gj],userComponents:{agAggregationComponent:Qj,agTotalRowCountComponent:Yj,agFilteredRowCountComponent:Jj,agTotalAndFilteredRowCountComponent:Xj,agSelectedRowCountComponent:qj},selectors:[aR],apiFunctions:{getStatusPanel:Zj},dependsOn:[y_,f1]};function RZ(_){if(_.excelCreator?.getFactoryMode()==="MULTI_SHEET")return j(161),!1;return!0}function Ej(_,f){if(RZ(_))return _.excelCreator?.getDataAsExcel(f);return}function Uj(_,f){if(RZ(_))_.excelCreator?.exportDataAsExcel(f)}function Hj(_,f){return _.excelCreator?.setFactoryMode("MULTI_SHEET"),_.excelCreator?.getSheetDataForExcel(f)}function Wj(_,f){return _.excelCreator?.getMultipleSheetsAsExcel(f)}function Bj(_,f){_.excelCreator?.exportMultipleSheetsAsExcel(f)}var jZ={moduleName:"ExcelExport",version:$_,beans:[yS],apiFunctions:{getDataAsExcel:Ej,exportDataAsExcel:Uj,getSheetDataForExcel:Hj,getMultipleSheetsAsExcel:Wj,exportMultipleSheetsAsExcel:Bj},dependsOn:[lJ,y_]};function CQ(_){let{filters:f}=_;return f&&f.length>0?f:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function vQ(_,f){if(_==null)return;for(let $=_.length-1;$>=0;$--)f(_[$],$)}function Kj(_,f){if(f.title!=null)return f.title;return _ instanceof _Q?_.getFilterTitle():"Filter"}function TQ(_,f,$,z){let Q=[],J=_?.filterModels;for(let q=0;qq==null)?null:{filterType:"multi",filterModels:Q}}function s0(_,f){return _?.filterModels?.[f]??null}function IQ(_,f,$,z){let Q=$.filterValueGetter;return Q?_.colFilter.createGetValue(f,Q):z}var VZ=class extends bJ{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"});this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:(_)=>this.onFocusIn(_)})}refreshGui(_){if(_===this.lastOpenedInContainer)return g.resolve();return this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),g.all(this.getFilterWrappers().map((f,$)=>{if(!f)return g.resolve(null);let z=this.getFilterFromWrapper(f),Q=this.getCompFromWrapper(f),J=this.filterDefs[$],q=Kj(z,J),X;if(J.display==="subMenu"&&_!=="toolPanel")X=this.insertFilterMenu(Q,z,q).then((Y)=>Y.getGui());else if(J.display==="subMenu"||J.display==="accordion"){let Y=this.insertFilterGroup(z,Q,q);X=g.resolve(Y.getGui())}else X=g.resolve(Q.getGui());return X})).then((f)=>{f.forEach(($,z)=>{if(!$)return;if(z>0)this.appendChild(z_({tag:"div",cls:"ag-filter-separator"}));this.appendChild($)}),this.filterGuis=f,this.lastOpenedInContainer=_})}destroyChildren(){for(let _ of this.guiDestroyFuncs)_();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(_,f,$){let z=_.getGui();Z_(z,"dialog");let Q=this.createBean(new tA),J={getGui:()=>_.getGui(),afterGuiAttached:(q)=>{if(_.afterGuiAttached?.(q),_!==f)f.afterGuiAttached?.(q)}};return Q.init({menuItemDef:{name:$,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:zZ,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:J,contextParams:{column:null,node:null,value:null}}).then(()=>{Q.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(Q)),this.addManagedListeners(Q,{menuItemActivated:(X)=>{if(this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==X.menuItem)this.lastActivatedMenuItem.deactivate();this.lastActivatedMenuItem=X.menuItem}});let q=Q.getGui();return Q.addManagedElementListeners(q,{keydown:(X)=>{let{key:Y}=X;switch(Y){case S.UP:case S.RIGHT:case S.DOWN:case S.LEFT:if(X.preventDefault(),Y===S.RIGHT)Q.openSubMenu(!0);break}},focusin:()=>Q.activate(),focusout:()=>{if(!Q.isSubMenuOpen()&&!Q.isSubMenuOpening())Q.deactivate()}}),Q})}insertFilterGroup(_,f,$){let z=this.createBean(new rS({title:$,cssIdentifier:"multi-filter"}));if(this.guiDestroyFuncs.push(()=>this.destroyBean(z)),z.addItem(f.getGui()),z.toggleGroupExpand(!1),_.afterGuiAttached)z.addManagedListeners(z,{expanded:()=>_.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})});return z}afterGuiAttached(_){let f;if(_)this.hidePopup=_.hidePopup,f=this.refreshGui(_.container);else this.hidePopup=void 0,f=g.resolve();let $=_?.suppressFocus;f.then(()=>{let{filterDefs:z,filterGuis:Q,beans:J}=this,q=this.getFilterWrappers(),X=!!$;if(z)vQ(z,(Z,G)=>{let E=G===0,U=Z.display&&Z.display!=="inline",H=$||!E||U,W={..._??{},suppressFocus:H},B=q[G],K=B?this.getFilterFromWrapper(B):void 0;if(B){let L=this.getCompFromWrapper(B);if(L!==K)L.afterGuiAttached(W)}if(K){if(this.executeFunctionIfExistsOnFilter(K,"afterGuiAttached",W),E&&!H)X=!0}if(!$&&E&&U){let L=Q[G];if(L){if(!F_(L))L.focus({preventScroll:!0});X=!0}}});let Y=d(J);if(!X&&(sf(J)||this.getGui().contains(Y)))this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",(_)=>this.executeOnWrapper(_,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",(_)=>this.executeOnWrapper(_,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(_,f){}executeFunctionIfExists(_,f){vQ(this.getFilterWrappers(),($)=>{if($)f?.($),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper($),_)})}executeFunctionIfExistsOnFilter(_,f,...$){let z=_[f];if(typeof z==="function")z.apply(_,$)}onFocusIn(_){let f=this.lastActivatedMenuItem;if(f!=null&&!f.getGui().contains(_.target))f.deactivate(),this.lastActivatedMenuItem=null}},OZ=class extends VZ{constructor(){super(...arguments);this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(_){this.params=_,this.filterDefs=CQ(_);let f=L_(this.beans.colFilter.model,_.column.getColId()),{filterChangedCallback:$}=_;this.filterChangedCallback=$;let z=this.filterDefs.map((Q,J)=>this.createFilter(Q,J,f));return new g((Q)=>{g.all(z).then((J)=>{this.wrappers=J,this.refreshGui("columnMenu").then(()=>{Q()})})}).then(()=>{for(let Q of this.afterFiltersReadyFuncs)Q();this.afterFiltersReadyFuncs.length=0})}refresh(_){return this.params=_,!0}isFilterActive(){return this.wrappers.some((_)=>{if(!_)return!1;let{filter:f,handler:$,model:z}=_;if($)return z!=null;return f.isFilterActive()})}getLastActiveFilterIndex(){let _=this.activeFilterIndices;return _.length>0?_[_.length-1]:null}doesFilterPass(_,f){return this.wrappers.every(($,z)=>{if(!$||f!=null&&z===f)return!0;let{handler:Q,filter:J,model:q}=$;if(Q)return q==null||Q.doesFilterPass({..._,model:q,handlerParams:$.handlerParams});return!J.isFilterActive()||J.doesFilterPass(_)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map((f)=>{if(!f)return null;let $=f.filter;if(typeof $.getModelFromUi==="function")return $.getModelFromUi();return null})}}getModel(){if(!this.isFilterActive())return null;return{filterType:this.filterType,filterModels:this.wrappers.map((f)=>{if(!f)return null;let{filter:$,handler:z,model:Q}=f;if(z)return Q;return $.isFilterActive()?$.getModel():null})}}setModel(_){let f=(z,Q)=>{return new g((J)=>{let q=z.setModel(Q);if(q)q.then(J);else J()})},$=[];return this.wrappers.forEach((z,Q)=>{if(!z)return;let J=s0(_,Q),{filter:q,filterParams:X,handler:Y,handlerParams:Z,state:G}=z;if(Y){let E={model:J,state:G?.state};z.state=E,z.model=J,$.push(UQ(()=>g.resolve({filter:q,filterParams:X}),Y,Z,J,E,"api").then(()=>{this.updateActiveListForHandler(Q,z.model)}))}else $.push(f(q,J).then(()=>{this.updateActiveListForFilter(Q,q)}))}),g.all($).then(()=>{})}applyModel(_="api"){let f=!1;for(let $ of this.wrappers)if($){let z=$.filter;if(z instanceof _Q)f=z.applyModel(_)||f}return f}getChildFilterInstance(_){return this.wrappers[_]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(let _ of this.wrappers)this.destroyBean(_?.filter),this.destroyBean(_?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(_){return _.filter}getCompFromWrapper(_){return _.comp}executeOnWrapper(_,f){_.handler?.[f]?.()}createFilter(_,f,$){let z=this.params.column,Q=null,J,q=this.beans,X=(H,W)=>{let B=this.wrappers[f];if(!B)return;let K={model:H,state:B.state?.state};B.state=K,B.model=H,UQ(()=>g.resolve({filter:B.filter,filterParams:B.filterParams}),B.handler,B.handlerParams,H,K,"ui").then(()=>{this.onHandlerModelChanged(f,B.model,W)})},{compDetails:Y,handler:Z,handlerParams:G,createFilterUi:E}=q.colFilter.createFilterInstance(z,_,"agTextColumnFilter",(H,W)=>{let B={...H,filterChangedCallback:W?()=>{}:(K)=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(f,K))},doesRowPassOtherFilter:(K)=>H.doesRowPassOtherFilter(K)&&this.doesFilterPass({node:K,data:K.data},f),getValue:IQ(q,z,_,H.getValue)};if(W)Q=s0($,f),J=this.updateDisplayParams(B,f,Q,()=>Y,()=>Z,X);return B});if(!E)return g.resolve(null);let U;if(Z){let{doesRowPassOtherFilter:H,getValue:W}=G;U={...G,onModelChange:X,doesRowPassOtherFilter:(B)=>H(B)&&this.doesFilterPass({node:B,data:B.data},f),getValue:IQ(q,z,_,W)},Z.init?.({...U,model:Q,source:"init"})}return E().then((H)=>{if(!Z)return{filter:H,comp:H};let W=Y?.params,B=J(H);return{filter:H,comp:B,filterParams:W,handler:Z,handlerParams:U,model:Q}})}updateDisplayParams(_,f,$,z,Q,J){let q=this.params.column,X=new D0;_.model=$,_.state={model:$},_.onModelChange=J,_.getHandler=Q;let Y=(G,E)=>{G.state=E,X.dispatchEvent({type:"filterStateChanged",column:q,state:E})};_.onStateChange=(G)=>{let E=this.wrappers[f];if(!E)return;Y(E,G),w1(E.filter,E.filterParams,E.model??null,G,"ui")};let Z=(G,E,U)=>{let H=this.wrappers[f];if(!H)return;let W=()=>H?.model??null;wz({action:E,filterParams:H.filterParams,getFilterUi:()=>{let B=g.resolve(H.filter);return{created:!0,filterParams:H.filterParams,compDetails:z(),create:()=>B,promise:B}},getModel:W,getState:()=>H?.state??{model:W()},updateState:(B)=>Y(H,B),updateModel:(B)=>H.filterParams?.onModelChange(B,U),processModelToApply:H.handler?.processModelToApply?.bind(H.handler)})};return _.onAction=(G,E,U)=>{Z(q,G,E),X.dispatchEvent({type:"filterAction",column:q,action:G,event:U})},(G)=>{let E=z()?.params;return this.createManagedBean(new Q2(q,{comp:G,params:E,isHandler:!0},X,Z,!1))}}executeWhenAllFiltersReady(_){if((this.wrappers?.length??0)>0)_();else this.afterFiltersReadyFuncs.push(_)}updateActiveListForFilter(_,f){this.updateActiveList(_,()=>f?.isFilterActive())}updateActiveListForHandler(_,f){this.updateActiveList(_,()=>f!=null)}updateActiveList(_,f){let $=this.activeFilterIndices;if(Q_(this.activeFilterIndices,_),f())$.push(_)}onFilterModelChanged(_,f){this.updateActiveListForFilter(_,this.wrappers[_]?.filter),this.filterChanged(_,f)}onHandlerModelChanged(_,f,$){this.updateActiveListForHandler(_,f),this.filterChanged(_,$)}filterChanged(_,f){this.filterChangedCallback(f),this.wrappers.forEach(($,z)=>{if(_===z||!$)return;let{filter:Q,handler:J}=$;if(J?.onAnyFilterChanged?.(),typeof Q.onAnyFilterChanged==="function")Q.onAnyFilterChanged()})}getModelAsString(_){if(!_?.filterModels?.length)return"";let f=this.getLastActiveFilterIndex()??0;return this.wrappers[f]?.filter?.getModelAsString?.(_.filterModels[f])??""}},Lj=class extends A{constructor(){super(...arguments);this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(_){this.params=_;let f=CQ(_.filterParams);this.filterDefs=f,f.forEach(($,z)=>{let Q=this.beans.colFilter.createHandler(_.column,$,"agTextColumnFilter");if(this.handlerWrappers.push(Q),!Q){j(278,{colId:_.column.getColId()});return}let{handler:J,handlerParams:q}=Q;J.init?.({...this.updateHandlerParams(q,z,!0),model:s0(_.model,z),source:"init"})}),this.resetActiveList(_.model)}refresh(_){this.params=_;let{model:f,source:$,filterParams:z}=_,Q=z?.filters;if(this.handlerWrappers.forEach((J,q)=>{if(J){let X=this.updateHandlerParams(_,q,!1,Q?.[q].filterParams);J.handlerParams=X,J.handler.refresh?.({...X,model:s0(f,q),source:$})}}),_.source!=="floating"&&_.source!=="ui")this.resetActiveList(_.model);if(_.additionalEventAttributes?.fromButtons)this.onAnyFilterChanged()}updateHandlerParams(_,f,$,z){let{onModelChange:Q,doesRowPassOtherFilter:J,getValue:q}=_,X={..._,onModelChange:(Y,Z)=>Q(TQ(this.params.model,this.handlerWrappers.length,Y,f),Z),doesRowPassOtherFilter:(Y)=>J(Y)&&this.doesFilterPass({node:Y,data:Y.data,model:this.params.model,handlerParams:X},f),getValue:IQ(this.beans,_.column,this.filterDefs[f],q),filterParams:this.updateFilterParams(_,$,z)};return X}updateFilterParams(_,f,$){let z=_.filterParams;if($?.buttons&&f)j(292,{colId:_.column.getColId()});let Q=$?{...z,...$}:z;if(!Q.buttons)return Q;if($)return delete Q.buttons,Q;let{buttons:J,...q}=Q;return q}doesFilterPass(_,f){let $=_.model?.filterModels;if($==null)return!0;return this.handlerWrappers.every((z,Q)=>{let J=$[Q];if(J==null||f!=null&&Q===f)return!0;let q=z?.handler;return!q||q.doesFilterPass({..._,model:J,handlerParams:z.handlerParams})})}resetActiveList(_){this.activeFilterIndices=[];let f=_?.filterModels;if(f==null)return;for(let $=0;$0?_[_.length-1]:null}getModelAsString(_,f){let $=f==="filterToolPanel",z=()=>$?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!_?.filterModels?.length)return z();let Q=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[Q]?.handler.getModelAsString?.(_.filterModels[Q],f)??z()}getHandler(_){return this.handlerWrappers[_]?.handler}onAnyFilterChanged(){vQ(this.handlerWrappers,(_)=>_?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){vQ(this.handlerWrappers,(_)=>_?.handler?.onNewRowsLoaded?.())}destroy(){for(let _ of this.handlerWrappers)this.destroyBean(_?.handler);this.handlerWrappers.length=0,super.destroy()}},Fj=class extends A{constructor(){super(...arguments);this.beanName="multiFilter"}getParamsForDataType(_,f,$,z){let Q=_?.filters,J=this.beans;if(!Q)Q=[{filter:f2($.baseDataType)},{filter:"agSetColumnFilter"}];let q=this.getLocaleTextFunc();return Q=Q.map((X)=>{let{filter:Y,filterParams:Z,filterValueGetter:G}=X;if(typeof Y!=="string")return X;let{filterParams:E,filterValueGetter:U}=_2(Y,Z,G??f,$,z,J,q);return{...X,filterParams:E,filterValueGetter:U}}),{filterParams:{..._,filters:Q}}}},PZ=class extends VZ{constructor(){super(...arguments);this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(_){this.params=_;let f=CQ(_).map((z)=>{if(z.filterParams?.buttons){j(292,{colId:_.column.getColId()});let Q={...z.filterParams};return delete Q.buttons,{...z,filterParams:Q}}return z});this.filterDefs=f,this.allState=_.state;let $=this.filterDefs.map((z,Q)=>this.createFilter(z,Q));return new g((z)=>{g.all($).then((Q)=>{this.filters=Q,this.refreshGui("columnMenu").then(()=>{z()})})})}refresh(_){let{model:f,state:$,source:z}=_;if(z==="colDef")return!1;this.params=_;let Q=this.filterParams;if($===this.allState)return!0;this.allState=$;let J=$.state;return this.filters.forEach((q,X)=>{let Y=s0(f,X),Z={state:J?.[X],model:s0($.model,X)};w1(q,Q[X],Y,Z,z)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(_){return this.filters[_]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(let _ of this.filters)this.destroyBean(_);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(_){return _}getCompFromWrapper(_){return _}createFilter(_,f){let $=this.beans.userCompFactory,z=this.updateParams(_,this.params,f),Q=BJ($,_,z,"agTextColumnFilter");if(!Q)return g.resolve(null);return this.filterParams[f]=Q.params,Q.newAgStackInstance()}updateParams(_,f,$){let{doesRowPassOtherFilter:z,model:Q,onModelChange:J,state:q,onStateChange:X,column:Y,source:Z,onAction:G,onUiChange:E,getValue:U}=f,H=s0(Q,$),W=q?{model:s0(q.model,$),state:q.state?.[$]}:{model:H},B=()=>{let L=this.getHandler();this.filters.forEach((F,D)=>{if($!==D)L.getHandler(D)?.onAnyFilterChanged?.(),F?.onAnyFilterChanged?.()})},K=this.beans.colFilter;return{...K.createBaseFilterParams(Y),..._,doesRowPassOtherFilter:(L)=>z(L)&&this.getHandler().doesFilterPass({node:L,data:L.data,model:this.params.model,handlerParams:K.getHandlerParams(Y)},$),model:H,state:W,onModelChange:(L,F)=>{let{filters:D,params:M}=this,k=TQ(M.model,D.length,L,$);this.updateActiveList($,L),J(k,F),B()},onStateChange:(L)=>this.onStateChange(X,$,L),getHandler:()=>this.getHandler().getHandler($),onAction:(L,F,D)=>{if(V$(f))return;let M=L==="apply"||L==="reset";if(M)this.updateActiveList($,s0(this.params.state.model,$));if(G(L,F,D),M)B()},onUiChange:E,source:Z,getValue:IQ(this.beans,Y,_,U)}}updateActiveList(_,f){this.getHandler().updateActiveList?.(_,f)}getHandler(){return this.params.getHandler()}onStateChange(_,f,$){let{model:z,state:Q,valid:J}=$,q=this.validity;q[f]=J;let X=this.allState,Y=TQ(X.model,this.filters.length,z,f),Z=q.every((U)=>U!==!1),G=[...X.state??[]];G[f]=Q;let E={state:G,model:Y,valid:Z};this.allState=E,_(E)}getModelAsString(_){return this.getHandler().getModelAsString?.(_)??""}},Dj={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},Mj=class extends w{constructor(){super(Dj);this.floatingFilters=[],this.compDetailsList=[]}init(_){this.params=_;let{compDetailsList:f}=this.getCompDetailsList(_);return this.setParams(f)}setParams(_){let f=[];return _.forEach(($)=>{let z=$?.newAgStackInstance();if(z!=null)this.compDetailsList.push($),f.push(z)}),g.all(f).then(($)=>{$.forEach((z,Q)=>{this.floatingFilters.push(z);let J=z.getGui();if(this.appendChild(J),Q>0)N(J,!1)})})}refresh(_){this.params=_;let{compDetailsList:f,floatingFilterParamsList:$}=this.getCompDetailsList(_);if(f.length===this.compDetailsList.length&&f.every((Q,J)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[J],Q))){if($.forEach((Q,J)=>{this.floatingFilters[J].refresh?.(Q)}),this.gos.get("enableFilterHandlers")){let Q=_;if(Q.model==null)this.floatingFilters.forEach((J,q)=>{N(J.getGui(),q===0)});else{let J=Q.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((q,X)=>{let Y=J==null?X===0:X===J;N(q.getGui(),Y)})}}}else f_(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(f)}getCompDetailsList(_){let f=[],$=[],z=_.filterParams,Q=_.currentParentModel,J=CQ(z);return J.forEach((q,X)=>{let Y={..._,parentFilterInstance:(G)=>{this.parentMultiFilterInstance((E)=>{let U=E.getChildFilterInstance(X);if(U==null)return;G(U)})},currentParentModel:()=>Q()?.filterModels?.[X]??null};if(this.gos.get("enableFilterHandlers")){let G=Y;G.model=G.model?.filterModels?.[X]??null;let{onModelChange:E,getHandler:U}=G;G.onModelChange=(H,W)=>E(TQ(this.params.model,J.length,H,X),W),G.getHandler=()=>{return U().getHandler(X)}}H_(Y.filterParams,q.filterParams);let Z=this.getCompDetails(q,Y);if(Z)f.push(Z),$.push(Y)}),{compDetailsList:f,floatingFilterParamsList:$}}onParentModelChanged(_,f){if(f?.afterFloatingFilter)return;this.parentMultiFilterInstance(($)=>{if(_==null)this.floatingFilters.forEach((z,Q)=>{z.onParentModelChanged(null,f),N(z.getGui(),Q===0)});else{let z=$.getLastActiveFilterIndex();this.floatingFilters.forEach((Q,J)=>{let q=_.filterModels.length>J?_.filterModels[J]:null;Q.onParentModelChanged(q,f);let X=z==null?J===0:J===z;N(Q.getGui(),X)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(_,f){let{colFilter:$,frameworkOverrides:z,userCompFactory:Q}=this.beans,J=$2(z,_,()=>$.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return KJ(Q,_,f,J)}parentMultiFilterInstance(_){this.params.parentFilterInstance((f)=>{if(!(f instanceof OZ||f instanceof PZ))e(120);_(f)})}},vZ={moduleName:"MultiFilter",version:$_,userComponents:{agMultiColumnFilter:{getComp:(_)=>_.gos.get("enableFilterHandlers")?{classImp:PZ,params:{useForm:!0}}:OZ},agMultiColumnFloatingFilter:Mj},beans:[Fj],dynamicBeans:{agMultiColumnFilterHandler:Lj},dependsOn:[y_,p5,P2]},kj=class extends A{constructor(){super(...arguments);this.beanName="aggColNameSvc"}getHeaderName(_,f){if(this.gos.get("suppressAggFuncInHeader"))return f;let{valueColsSvc:$,colModel:z,rowGroupColsSvc:Q}=this.beans,J=_.getColDef().pivotValueColumn,q=v(J),X=null,Y;if(q){let Z=$?.columns??[],G=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&Z.length===1,E=_.getColDef().pivotTotalColumnIds!==void 0;if(G&&!E)return f;X=J?J.getAggFunc():null,Y=!0}else{let Z=_.isValueActive(),G=Q?.columns.length!==0,E=z.isPivotMode()||G||this.gos.get("treeData");if(Z&&E)X=_.getAggFunc(),Y=!0;else Y=!1}if(Y){let Z=typeof X==="string"?X:"func";return`${this.getLocaleTextFunc()(Z,Z)}(${f})`}return f}},Sj={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Aj=class extends A{constructor(){super(...arguments);this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){if(this.initialised)return;this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs"))}initialiseWithDefaultAggregations(){let _=this.aggFuncsMap;_.sum=Rj,_.first=jj,_.last=Vj,_.min=Oj,_.max=Pj,_.count=Tj,_.avg=yj,this.initialised=!0}isAggFuncPossible(_,f){let z=this.getFuncNames(_).includes(f),Q=v(this.aggFuncsMap[f]);return z&&Q}getDefaultFuncLabel(_){return Sj[_]??_}getDefaultAggFunc(_){let f=_.getColDef().defaultAggFunc;if(v(f)&&this.isAggFuncPossible(_,f))return f;if(this.isAggFuncPossible(_,"sum"))return"sum";let $=this.getFuncNames(_);return $?.length?$[0]:null}addAggFuncs(_){if(this.init(),!_)return;for(let f of Object.keys(_))if(_[f])this.aggFuncsMap[f]=_[f]}getAggFunc(_){return this.init(),this.aggFuncsMap[_]}getFuncNames(_){let f=_.getColDef().allowedAggFuncs;return f==null?Object.keys(this.aggFuncsMap).sort():f}clear(){this.aggFuncsMap={}}};function Rj(_){let{values:f}=_,$=null;for(let z=0;z0?_.values[0]:null}function Vj(_){return _.values.length>0?b(_.values):null}function Oj(_){let{values:f}=_,$=null;for(let z=0;zQ))$=Q}return $}function Pj(_){let{values:f}=_,$=null;for(let z=0;z0)Q=$/(typeof $==="number"?z:BigInt(z));let J=_.rowNode?.aggData?.[_.column?.getColId()];if(J&&J.count===z&&J.value===Q)return J;let q=Object.create(Ij);return q.count=z,q.value=Q,q}var bj=class extends A{constructor(){super(...arguments);this.beanName="aggChildrenSvc"}getAggregatedChildren(_,f,$){if(!_?.group)return[];if(_.rowPinned){if(_=_.pinnedSibling,!_)return[]}let z=this.gos,Q=TZ(_,f,z);if(!$)return Q;let J=[];return IZ(Q,f,z,J),J}},TZ=(_,f,$)=>{let z=f?.colDef,Q=z?.pivotKeys;if(Q){if(_.leafGroup&&Q.length&&!z.pivotTotalColumnIds)return EZ(_.childrenMapped,Q);return _.childrenAfterFilter??_.childrenAfterGroup??[]}if(C0($)||$.get("suppressAggFilteredOnly"))return _.childrenAfterGroup??[];return _.childrenAfterFilter??_.childrenAfterGroup??[]},IZ=(_,f,$,z)=>{for(let Q=0,J=_.length;Q{HY(R,null,M)})}return}this.hadAgg=!0;let{colModel:J,aggFuncSvc:q}=$,X=f.get("alwaysAggregateAtRootLevel")||!!Lf(f)||J.isPivotMode(),Y=!C0(f)&&!f.get("suppressAggFilteredOnly"),Z=$.valueSvc,G=$.gridApi,E=$.gridOptions.context,U=Q??[],H=U.length,W=_?.kind==="cells"?_:void 0,B,K=Array(H);for(let M=0;M=0)B=W;K[M]={column:k,colId:k.colId,colDef:k.colDef,aggFunc:yZ(k.getAggFunc(),q,k),colSlot:R}}let L=uj(J,$.pivotResultCols,q),F=H>0?Array(H):null,D=$.rowModel;R_(D.rootNode,D.hierarchical,_,(M)=>{if(M.level===-1&&!X){h1(M,null,J);return}let k;if(z)k=z({nodes:M.childrenAfterFilter});else if(!F)k=null;else if(L)k=hj(M,L,Z,G,E);else k=gj(M,K,H,F,B,Y,Z,G,E);HY(M,k,J)})}},gj=(_,f,$,z,Q,J,q,X,Y)=>{let Z=(J?_.childrenAfterFilter:_.childrenAfterGroup)??[],G=Z.length,E=_.data,U=Object.create(null),H=Q?Q.getSlot(_):-1,W=H>=0?_.aggData:void 0,B=0;for(let K=0;K<$;++K){let L=f[K];if(H>=0&&!Q.hasCellBySlot(H,L.colSlot)){if(z[K]=null,W)U[L.colId]=W[L.colId]}else z[K]=Array(G),++B}if(B===0)return U;for(let K=0;K{let J=f.length,q=_.leafGroup,X=_.data,Y=_.childrenMapped,Z=_.childrenAfterFilter??[],G=Object.create(null),E,U;for(let H=0;H{if(typeof _==="function")return _;if(_==null)return null;let z=f.getAggFunc(_);if(typeof z!=="function")return j(109,{inputValue:_.toString(),allSuggestions:f.getFuncNames($)}),null;return z},uj=(_,f,$)=>{if(!_.isPivotActive())return null;let z=f?.getAggregationOrderedList();if(!z||z.length===0)return null;let Q=z.length,J=Array(Q),q=0;for(let X=0;X{let f=_.childrenAfterAggFilter,$=0;if(f){let Q=f.length;$=Q;for(let J=0;J=0?null:$;_.setAllChildrenCount(z),_.pinnedSibling?.setAllChildrenCount(z)},this.setAllChildrenCountGridGrouping=(_)=>{let f=_.childrenAfterAggFilter,$=0;for(let z=0,Q=f.length;z!W.node.group,Z=(W)=>W.node.leafGroup,G=C0(this.gos)||(J?Z:Y),E=X?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,U=(W,B=!1)=>{if(W.childrenAfterFilter){if(W.childrenAfterAggFilter=W.childrenAfterFilter,B){let K=W.childrenAfterAggFilter;for(let L=0,F=K.length;L{if(W.childrenAfterAggFilter=W.childrenAfterFilter?.filter((B)=>{if(G({node:B})){if(Q.doesRowPassAggregateFilters({rowNode:B}))return U(B,!0),!0}return B.childrenAfterAggFilter?.length})||null,W.hasChildren())E(W);else W.setAllChildrenCount(null),W.pinnedSibling?.setAllChildrenCount(null);if(W.sibling)W.sibling.childrenAfterAggFilter=W.childrenAfterAggFilter};R_(f.rootNode,f.hierarchical,_,q?H:U)}};function m$(_,f){if(_.sibling)return;let $=EX(_,f);$.footer=!0,$.setRowTop(null),$.setRowIndex(null),$.oldRowTop=null,$.id="rowGroupFooter_"+_.id,$.sibling=_,_.sibling=$}function mj(_){let f=_.sibling;if(!f)return;f._destroy(!1),_.sibling=void 0,f.sibling=void 0}var cj=class extends A{constructor(){super(...arguments);this.beanName="footerSvc"}addTotalRows(_,f,$,z,Q,J){let q=_;if(Q){let Z=z&&Lf(this.gos);if(pj(J,Z))m$(f,this.beans),$(f.sibling,q++);return q}let X=nz(this.gos);if((z&&X({node:f}))===J)m$(f,this.beans),$(f.sibling,q++);return q}getTopDisplayIndex(_,f,$,z){let Q=f;if(_[0].footer){if(f===0)return 0;Q-=1}let J=_[_.length-1],q=Q>=$.length;if(J.footer&&q)return J.rowIndex;return z(Q)}doesCellShowTotalPrefix(_,f){if(!_.footer||!f?.getColDef().showRowGroup)return!1;if(this.gos.get("treeData"))return!0;if(_.level===-1)return this.beans.showRowGroupCols?.columns[0]===f;return!!_.rowGroupColumn&&f?.isRowGroupDisplayed(_.rowGroupColumn.getId())}applyTotalPrefix(_,f,$,z){let Q=z.getColDef().cellRendererParams?.totalValueGetter;if(Q){let J=C(this.gos,{column:z,node:$,value:_,formattedValue:f});if(typeof Q==="function")return Q(J);if(typeof Q==="string")return this.beans.expressionSvc?.evaluate(Q,J);j(179)}if($.level===-1)return this.getLocaleTextFunc()("footerTotal","Total")+" ";return this.getTotalValue(f??_)??""}getTotalValue(_){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(_??"")}};function pj(_,f){switch(f){case"top":case"pinnedTop":return _==="top";case"bottom":case"pinnedBottom":return _==="bottom";default:return!1}}var bZ=class extends x1{constructor(){super(...arguments);this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(_,f,$)=>this.setValueActive(f,_,$),add:(_,f,$)=>this.setValueActive(!0,_,$),remove:(_,f,$)=>this.setValueActive(!1,_,$)},this.columnExtractors={setFlagFunc:(_,f,$)=>this.setColValueActive(_,f,$),getIndexFunc:()=>{return},getInitialIndexFunc:()=>{return},getValueFunc:(_)=>{let f=_.aggFunc;if(f===null||f==="")return null;if(f===void 0)return;return!!f},getInitialValueFunc:(_)=>{return _.initialAggFunc!=null&&_.initialAggFunc!=""}},this.modifyColumnsNoEventsCallbacks={addCol:(_)=>this.columns.push(_),removeCol:(_)=>Q_(this.columns,_)}}extractCols(_,f){this.columns=super.extractCols(_,f);for(let $ of this.columns){let z=$.getColDef();if(z.aggFunc!=null&&z.aggFunc!="")this.setColAggFunc($,z.aggFunc);else if(!$.getAggFunc())this.setColAggFunc($,z.initialAggFunc)}return this.columns}setColumnAggFunc(_,f,$){if(!_)return;let z=this.colModel.getColDefCol(_);if(!z)return;this.setColAggFunc(z,f),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[z],$)}syncColumnWithState(_,f,$){let z=$("aggFunc").value1;if(z!==void 0)if(typeof z==="string"){if(this.setColAggFunc(_,z),!_.isValueActive())this.setColValueActive(_,!0,f),this.modifyColumnsNoEventsCallbacks.addCol(_)}else{if(v(z))j(33);if(_.isValueActive())this.setColValueActive(_,!1,f),this.modifyColumnsNoEventsCallbacks.removeCol(_)}}setValueActive(_,f,$){if(_===f.isValueActive())return;if(this.setColValueActive(f,_,$),_&&!f.getAggFunc()&&this.aggFuncSvc){let z=this.aggFuncSvc.getDefaultAggFunc(f);this.setColAggFunc(f,z)}}setColAggFunc(_,f){_.aggFunc=f,_.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(_,f,$){if(_.aggregationActive!==f)_.aggregationActive=f,_.dispatchColEvent("columnValueChanged",$)}},CZ={moduleName:"SharedAggregation",version:$_,beans:[Aj,kj,cj,bZ],apiFunctions:{addAggFuncs:Cj,clearAggFuncs:wj,setColumnAggFunc:xj},dependsOn:[y_]},nj={moduleName:"Aggregation",version:$_,beans:[Nj,ij,bj],rowModels:["clientSide"],dependsOn:[CZ]},wZ=class extends x1{constructor(){super(...arguments);this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(_,f,$)=>this.setColPivotActive(_,f,$),add:(_,f,$)=>this.setColPivotActive(_,!0,$),remove:(_,f,$)=>this.setColPivotActive(_,!1,$)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(_,f,$)=>this.setColPivotActive(_,f,$),getIndexFunc:(_)=>_.pivotIndex,getInitialIndexFunc:(_)=>_.initialPivotIndex,getValueFunc:(_)=>_.pivot,getInitialValueFunc:(_)=>_.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:(_)=>{if(!this.columns.includes(_))this.columns.push(_)},removeCol:(_)=>Q_(this.columns,_)}}syncColumnWithState(_,f,$,z){let{value1:Q,value2:J}=$("pivot","pivotIndex");if(Q!==void 0||J!==void 0){if(typeof J==="number"||Q){if(!_.isPivotActive())this.setColPivotActive(_,!0,f),this.modifyColumnsNoEventsCallbacks.addCol(_);if(z&&typeof J==="number")z[_.getId()]=J}else if(_.isPivotActive())this.setColPivotActive(_,!1,f),this.modifyColumnsNoEventsCallbacks.removeCol(_)}}setColPivotActive(_,f,$){if(_.pivotActive!==f){if(_.pivotActive=f,f)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,_)?.forEach((Q)=>this.setColPivotActive(Q,f,$));_.dispatchColEvent("columnPivotChanged",$)}_.dispatchStateUpdatedEvent("pivot")}},dj=class extends x1{constructor(){super(...arguments);this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(_,f,$)=>this.setActive(f,_,$),add:(_,f,$)=>this.setActive(!0,_,$),remove:(_,f,$)=>this.setActive(!1,_,$)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(_,f,$)=>this.setColRowGroupActive(_,f,$),getIndexFunc:(_)=>_.rowGroupIndex,getInitialIndexFunc:(_)=>_.initialRowGroupIndex,getValueFunc:(_)=>_.rowGroup,getInitialValueFunc:(_)=>_.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:(_)=>{if(!this.columns.includes(_))this.columns.push(_)},removeCol:(_)=>Q_(this.columns,_)}}moveColumn(_,f,$){if(this.columns.length===0)return;let z=this.columns[_],Q=this.columns.slice(_,f);this.columns.splice(_,1),this.columns.splice(f,0,z),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:Q,column:Q.length===1?Q[0]:null,source:$})}syncColumnWithState(_,f,$,z){let{value1:Q,value2:J}=$("rowGroup","rowGroupIndex");if(Q!==void 0||J!==void 0){if(typeof J==="number"||Q){if(!_.isRowGroupActive())this.setColRowGroupActive(_,!0,f),this.modifyColumnsNoEventsCallbacks.addCol(_);if(z&&typeof J==="number")z[_.getId()]=J}else if(_.isRowGroupActive())this.setColRowGroupActive(_,!1,f),this.modifyColumnsNoEventsCallbacks.removeCol(_)}}setActive(_,f,$){if(_===f.isRowGroupActive())return;this.setColRowGroupActive(f,_,$);let z=this.beans.groupHierarchyColSvc?.getColumn(f);if(tz(this.gos,_)&&!z)this.colModel.setColsVisible([f],!_,$)}setColRowGroupActive(_,f,$){if(_.rowGroupActive!==f){if(_.rowGroupActive=f,f)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,_)?.forEach((Q)=>this.setColRowGroupActive(Q,f,$));_.dispatchColEvent("columnRowGroupChanged",$)}_.dispatchStateUpdatedEvent("rowGroup")}},tj=class extends A{constructor(){super(...arguments);this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this)),this.setupGroupHideColumnsUntilExpanded()}setupGroupHideColumnsUntilExpanded(){let _=()=>this.updateGroupColumnVisibility();this.addManagedEventListeners({modelUpdated:_}),this.addManagedPropertyListeners(["groupHideColumnsUntilExpanded","groupDisplayType","groupHideOpenParents"],_)}addColumns(_){let{columns:f}=this;if(f==null)return;_.list=f.list.concat(_.list),_.tree=f.tree.concat(_.tree),A$(_)}createColumns(_,f,$){let z=this.beans,{colModel:Q,gos:J,rowGroupColsSvc:q,colGroupSvc:X}=z,Y=Q.isPivotMode(),Z=dz(J,Y),G=Y?J.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),E=q?.columns,H=!(E&&E.length>0||J.get("treeData"))||G||Z,W=()=>{if(this.columns)J0(z,this.columns.tree),this.columns=null};if(H){W();return}let B=this.generateAutoCols(E),K=S$(B,this.columns?.list||null),L=_.treeDepth,D=(this.columns?this.columns.treeDepth:-1)==L;if(K&&D){let O=new Map(B.map((I)=>[I.getId(),I]));for(let I of this.columns?.list??[]){let T=O.get(I.getId());if(T)I.setColDef(T.getColDef(),null,$)}return}W();let M=X?.findDepth(_.tree)??0,k=X?.balanceTreeForAutoCols(B,M)??[];this.columns={list:B,tree:k,treeDepth:M,map:{}},f((O)=>{if(!O)return null;let I=O.filter((T)=>!of(T));return[...B,...I]})}updateColumns(_){let f=Uf(_.source);this.columns?.list.forEach(($,z)=>this.updateOneAutoCol($,z,f))}getColumn(_){return this.columns?.list.find((f)=>b0(f,_))??null}getColumns(){return this.columns?.list??null}generateAutoCols(_=[]){let f=[],{gos:$}=this,z=$.get("treeData"),Q=M$($);if(z&&Q)j(182),Q=!1;if(Q)_.forEach((J,q)=>{f.push(this.createOneAutoCol(J,q))});else f.push(this.createOneAutoCol());return f}isSuppressAutoCol(){let _=this.gos;if(_.get("groupDisplayType")==="custom")return!0;return _.get("treeDataDisplayType")==="custom"}createOneAutoCol(_,f){let $;if(_)$=`${af}-${_.getId()}`;else $=af;let z=this.createAutoColDef($,_,f);z.colId=$;let Q=new Z0(z,null,$,!0);return this.createBean(Q),Q}updateOneAutoCol(_,f,$){let z=_.getColDef(),Q=typeof z.showRowGroup=="string"?z.showRowGroup:void 0,J=this.beans,q=Q!=null?J.colModel.getColDefCol(Q):void 0,X=_.getId(),Y=this.createAutoColDef(X,q??void 0,f);_.setColDef(Y,null,$),d_(J,{state:[HJ(Y,X)]},$)}createAutoColDef(_,f,$){let z=this.createBaseColDef(f),Q=this.gos.get("autoGroupColumnDef");if(H_(z,Q),z=n0(this.beans,z,_,!0),Q?.groupRowEditable==null)z.groupRowEditable=void 0;if(Q?.groupRowValueSetter==null)z.groupRowValueSetter=void 0;if(!this.gos.get("treeData")){if(n(z.field)&&n(z.valueGetter)&&n(z.filterValueGetter)&&z.filter!=="agGroupColumnFilter")z.filter=!1}if($&&$>0)z.headerCheckboxSelection=!1;let J=K0(this.gos),q=z.valueGetter||z.field!=null;if(J&&!q)z.sortIndex=void 0,z.initialSort=void 0;return z}createBaseColDef(_){let f=this.gos.get("autoGroupColumnDef"),z={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:_?.getColId()??!0};if(!(f&&(f.cellRenderer||f.cellRendererSelector)))z.cellRenderer="agGroupCellRenderer";if(_)z.headerName=this.beans.colNames.getDisplayNameForColumn(_,"header")??void 0,z.headerValueGetter=_.colDef.headerValueGetter;return z}getDeepestExpandedLevel(_,f){let $=-1;if(!_)return $;for(let z of _){if(!z.group||!z.expanded)continue;if(z.level>$)$=z.level;if($>=f)return $;let Q=this.getDeepestExpandedLevel(z.childrenAfterGroup,f);if(Q>$)$=Q;if($>=f)return $}return $}updateGroupColumnVisibility(){let _=this.columns?.list;if(!_||_.length===0)return;let{gos:f,visibleCols:$,rowModel:z}=this.beans,Q=XJ(f),J=!1,q=(Y,Z)=>{if(Z!==Y.isVisible())Y.setVisible(Z,"api"),J=!0},X=()=>{for(let Y of _)q(Y,!0)};if(!Q)X();else if(_.length>1){let Y=_.length-2,Z=z?.rootNode?.childrenAfterGroup,G=this.getDeepestExpandedLevel(Z,Y);if(G>=Y)X();else for(let E=0;E<_.length-1;E++)q(_[E+1],G>=E)}if(J)$.refresh("api")}destroy(){J0(this.beans,this.columns?.tree),super.destroy()}},R2=null,MY=(_)=>{let f=R2,$=new Uint32Array(1<<32-Math.clz32(_|63));if(f)$.set(f);return R2=$,$},rj=(_,f,$,z)=>{let Q=f-z,J=$-1;if(Q===1){let Z=0;while(_[Z].level===J)++Z;if(Z0){let G=_[Z];_.copyWithin(1,0,Z),_[0]=G}return _}let q=Array(Q),X=0,Y=0;for(let Z=0;Z{let $=_[0].level+1,z=$,Q=0,J=$,q=R2;if(!q||$>=q.length)q=MY($);++q[$];for(let E=1;E$){if($=U,$>=q.length)q=MY($)}else if(U=0)return q.fill(0,z,$+1),_;let X=q[z],Y=q[$];if(X+Y===f)return q[z]=0,q[$]=0,rj(_,f,$,Y);let Z=0;for(let E=$;E>=z;--E){let U=q[E];q[E]=Z,Z+=U}let G=Array(f);for(let E=0;E{if(f===2){if(_[0].level<_[1].level){let $=_[0];_[0]=_[1],_[1]=$}return _}if(f>16)return lj(_,f);for(let $=1;$=0&&_[J].level=0)$.set(f,-1),f=f.parent;return}let z=this.rows;do $.set(f,-1),z.push(f),f=f.parent;while(f!=null&&!$.has(f));this.unsorted=!0}addCell(_,f){if(f==null){this.addRow(_);return}if(_==null)return;let $=this.slots,z=this.bits,Q=$.get(f)??this.ensureCol(f),J=$.get(_);if(J===void 0)J=this.ensureRow(_);else if(J<0)return;let q=Q<32?z:this.extraBits[(Q>>>5)-1],X=1<<(Q&31),Y=q[J];if((Y&X)!==0)return;q[J]=Y|X;let Z=_.parent;while(Z!=null){let G=$.get(Z);if(G<0)break;let E=q[G];if((E&X)!==0)break;q[G]=E|X,Z=Z.parent}}hasRow(_){return this.slots.has(_)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let _=xZ(this.rows);return this.rows=_,_}getSlot(_){return this.slots.get(_)??-1}hasCellBySlot(_,f){if(_<0)return!0;if(f<32)return f>=0&&(this.bits[_]&1<>>5)-1][_]&1<<(f&31))!==0}ensureRow(_){let f=this.slots,$=this.rows,z=this.bits,Q=this.extraBits,J=z.push(0),q=J-1;if(Q!==null)for(let Y=0,Z=Q.length;Y=32){let $=(f>>>5)-1,z=this.extraBits;if(z===null)z=[],this.extraBits=z;if($>=z.length)z.push(Array(this.bits.length).fill(0))}return f}},kY=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=new Set}addRow(_){let f=_;if(f==null)return;let $=this.rowSet;if($.has(f))return;let z=this.rows;do $.add(f),z.push(f),f=f.parent;while(f!=null&&!$.has(f));this.unsorted=!0}addCell(_,f){this.addRow(_)}hasRow(_){return this.rowSet.has(_)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let _=xZ(this.rows);return this.rows=_,_}},aj=class extends A{constructor(){super(...arguments);this.beanName="changedPathFactory"}newPath(_){return _?new sj:new kY}ensureRowsPath(_){let f=_.changedPath;if(!f&&_.changedRowNodes&&!_.newData){let $=this.beans.rowModel;if($.hierarchical)f=new kY,_.changedPath=f,f.addRow($.rootNode)}return f}},oj=class extends A{addExpandedCss(_,f){if(f.isExpandable())_.push("ag-row-group"),_.push(f.expanded?"ag-row-group-expanded":"ag-row-group-contracted")}getRowExpandedListeners(_){let{rowNode:f}=_,$=this.updateExpandedCss.bind(this,_,f);return{expandedChanged:$,hasChildrenChanged:$}}setExpanded(_,f,$,z){if(_.expanded===f)return;_._expanded=f,_.dispatchRowEvent("expandedChanged");let Q={...SJ(_,this.gos,"rowGroupOpened"),expanded:f,event:$||null};this.dispatchExpandedEvent(Q,z)}defaultExpanded(_){let $=this.beans.gos,z=_.level??0,Q=_.group&&$.get("isGroupOpenByDefault");if(!Q){let q=$.get("groupDefaultExpanded");return q===-1||z{let J=Q.rowComp;J.toggleCss("ag-row-group",$),J.toggleCss("ag-row-group-expanded",$&&z),J.toggleCss("ag-row-group-contracted",$&&!z),N_(Q.element,$&&z)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},ej=class extends oj{constructor(){super(...arguments);this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(_){let f=new Set(_.expandedRowGroupIds);this.beans.rowModel.forEachNode(($)=>{let z=$.id;if(!z)return;$._expanded=f.has(z)}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(_=!1){let f=[],$=[];return this.beans.rowModel.forEachNode((z)=>{let Q=z.id;if(!Q)return;if(z.expanded)f.push(Q);else if(_&&z.isExpandable())$.push(Q)}),{expandedRowGroupIds:f,collapsedRowGroupIds:$}}getExpansionState(){return this.getInternalExpansionState()}isExpanded(_){if(_.footer)return!!_._expanded;if(!(_.group||_.master)||_.leafGroup&&this.beans.colModel.isPivotMode())return!1;let f=_._expanded;if(f===null)f=this.defaultExpanded(_)??!1,_._expanded=f;return!!f}resetExpansion(){let{rowModel:_}=this.beans;_.forEachNode((f)=>{if(!f.group&&!f.master)return;f._expanded=null}),this.onGroupExpandedOrCollapsed()}expandAll(_){let{gos:f,rowModel:$,colModel:z,eventSvc:Q}=this.beans,J=f.get("treeData"),q=z.isPivotActive(),X=(Z)=>{if(!Z)return;for(let G of Z){let E=()=>{G._expanded=_,X(G.childrenAfterGroup)};if(G.master){E();continue}if(J){if(v(G.childrenAfterGroup))E();continue}if(q){if(!G.leafGroup)E();continue}if(G.group)E()}},Y=$.rootNode;if(Y)X(Y.childrenAfterGroup);this.onGroupExpandedOrCollapsed(),Q.dispatchEvent({type:"expandOrCollapseAll",source:_?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(_){let f=this.getInternalExpansionState(!0),$=f.collapsedRowGroupIds.length===0;if(f.expandedRowGroupIds.length===0===$)return;return $?_.expandAll():_.collapseAll()}dispatchExpandedEvent(_,f){if((this.events??(this.events=[])).push(_),f){this.dispatchExpandedEvents();return}let $=this.dispatchExpandedDebounced;if(!$){if(!this.isAlive())return;$=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=$}$()}dispatchExpandedEvents(){let{eventSvc:_,rowRenderer:f}=this.beans,$=this.events,z=$?.length;if(!z)return;this.events=null;let Q=Array(z);for(let J=0;Jwindow.setTimeout(_,0);let $=!1;return()=>{if(!f.active){window.setTimeout(_,0);return}if($)return;$=!0,f.addDestroyTask(()=>{$=!1,_()})}}};function _V(_){let f=_.get("groupHideParentOfSingleChild");if(!f){if(f=_.get("groupRemoveSingleChildren"),!f&&_.get("groupRemoveLowestSingleChildren"))f="leafGroupsOnly"}return{groupHideParentOfSingleChild:f,isGroupMultiAutoColumn:M$(_),hideOpenParents:_.get("groupHideOpenParents"),grandTotalRow:Lf(_),groupTotalRow:nz(_)}}function fV(_,f,$){return _.groupHideParentOfSingleChild===!0&&$&&f.childrenAfterGroup.length===1}function $V(_,f,$){return _.groupHideParentOfSingleChild==="leafGroupsOnly"&&$&&f.leafGroup&&f.childrenAfterGroup.length===1}function zV(_,f,$,z,Q,J){if(z&&!$)return!1;if(Q||J)return!1;if(!_.hideOpenParents)return!0;if(f.master||f.level===-1)return!0;if(!(z&&f.leafGroup)&&f.expanded)return!1;return!0}var QV=class extends A{constructor(){super(...arguments);this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){let{beans:_,gos:f}=this,$=[],z=_.rowModel.rootNode;if(!z)return $;let Q=_.colModel.isPivotMode(),J=Q&&z.leafGroup&&z.aggData,q=J?[z]:z.childrenAfterSort,X=_V(f);this.recursivelyAddToRowsToDisplay(X,q,$,Q,0);let Y=$.length>0,Z=X.grandTotalRow;if(!J&&Y&&Z)if(m$(z,_),Z==="pinnedBottom"||Z==="pinnedTop")this.beans.pinnedRowModel?.setGrandTotalPinned(Z==="pinnedBottom"?"bottom":"top");else{let E=Z==="top";this.addRowNodeToRowsToDisplay(X,z.sibling,$,0,E)}return $}recursivelyAddToRowsToDisplay(_,f,$,z,Q){if(!f?.length)return;let J=this.beans.masterDetailSvc;for(let q=0;qthis.onCsrmCellChange(_),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(_){if(!_.rowDragManaged||!_.sameGrid)return!1;if(!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()}initDraggingGroups(_){let f=new Map,$=(z)=>{let Q=z.childrenAfterGroup;if(Q){if(f.has(z))return;let J=Q.slice();f.set(z,J);for(let q of J)$(q)}};for(let z of _.rows)if(z.group)$(z);this.draggingGroups=f}canSetParent(_){if(!_.sameGrid)return!1;if(this.beans.groupStage?.treeData)return!0;if(_.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length}canDropRow(_,f){if(this.beans.groupStage?.treeData)return!qV(_,f.newParent);let{position:$,target:z,newParent:Q,rootNode:J}=f,q=_.parent;if(_.group&&(AY(_,z)||AY(_,Q)))return!1;if($==="inside")return!0;if(Q&&Q!==q)return Q!==J||q===J;let X=Q??z?.parent??J;if(X!==q)return!1;let Y=_.group?_.level:q.level??-1,Z=-1;if(z)Z=z.group?z.level:z.parent?.level??-1;else if(X)Z=X.level;if(Y>=0&&Z>=0&&Z!==Y)return!1;return!0}fixRowsDrop(_,f,$,z){let Q=!!this.beans.groupStage?.treeData;if(_.treeData=Q,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!Q)return;if(!this.draggingGroups&&this.isGroupingDrop(_)&&!_.suppressMoveWhenRowDragging)this.initDraggingGroups(_);let q=_.target,X=null,Y=!1,Z=_.rootNode,G=this.beans.rowModel,E=this.canStartGroup(q,Q);this.updateDropTarget(_,$,E);let U=this.beans.pageBounds?.getLastRow?.()??G.getRowCount()-1;if(f){if(!q||z>=0.5&&q.rowIndex===U)X=Z;else if(_.moved&&q&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(_))X=q;if(!X)X=q?.parent??Z}if(!$&&q&&E&&!(q.group&&q.expanded))this.startDropGroupDelay(q);if(X){if(q&&X===q&&X!==Z){let H=X.expanded?UX(G,1,q):null;if(H?.parent===X)q=H,z=-0.5;else Y=!0}if(q&&!Y){let H=q;while(H&&H!==Z&&H!==X)q=H,H=H.parent}}_.target=q,_.newParent=X,_.yDelta=z,_.inside=Y}clearNewSameParent(_,f){let $=_.newParent;if($&&(!f||XV(_.rows,$)))_.newParent=null}updateDropTarget(_,f,$){let z=$?_.target:null;if(this.dropGroupTarget&&this.dropGroupTarget!==z)this.resetDragGroup();if(!z?.childrenAfterSort?.length)return;if(f&&this.dropGroupThrottled&&!z.expanded&&z.isExpandable?.())z.setExpanded(!0,void 0,!0);if(this.canDropInTarget(z,_))this.dropGroupThrottled=!0,this.dropGroupTarget=z}canDropInTarget(_,f){if(_.expanded)return!0;if(!_.group)return!1;if(f.pointerPos==="inside")return!0;if(f.treeData)return!1;let $=f.rows,z=_.level;for(let Q=0,J=$.length;Q{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},f)}resetDragGroup(){if(this.dropGroupTimer!==null)window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null;this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(_){if(_)this.draggingGroups=null;this.resetDragGroup()}shouldDropTargetBeParent({target:_,rows:f,pointerPos:$,treeData:z}){if(!_||$==="none")return!1;if($==="inside")return!0;if(!z&&_.group&&!_.expanded)return!0;if($==="above")return!1;let Q=this.beans.rowModel,q=_.rowIndex+1,X;do X=Q.getRow(q++);while(X?.footer);let Y=this.draggingGroups?.get(_)??_.childrenAfterGroup;if(X&&X.parent===_&&Y?.length){let Z=new Set(f);for(let G=0,E=Y.length;G{if(Z.has(F))return;if(Z.add(F),U??(U=this.newGroupValues(J)),this.setRowGroup(F,U))E.add(F)},W=(F)=>{let D=this.draggingGroups?.get(F)??F.childrenAfterGroup,M=D?.length;if(M)for(let k=0;k=0)H(R);else W(R)}};for(let F of _.rows)if(F.group)W(F);else{let D=F.sourceRowIndex>=0&&!F.destroyed?F:this.csrmFirstLeaf(F);if(D)H(D)}let B=$==="inside"?"above":$,K=$==="inside"?this.findFirstLeafForParent(J,Z)??z:z,L=!1;if(Z.size&&B!=="none")L=gX(Q._leafs,Z,K,B==="above");if(!E.size&&!L)return!1;G.reordered=L;for(let F of Z)G.updates.add(F);if(this.csrmRefresh(G),Y)Y.focusCell();else q.clearFocusedCell();return!0}canStartGroup(_,f){if(!_||_.level<0||_.footer||_.detail)return!1;if(_.group)return!0;return f}flushGroupEdits(){let _=this.pendingEditRefresh;if(_)this.pendingEditRefresh=null,this.csrmRefresh(_)}csrmRefresh(_){let f=this.beans.rowModel;if(!f.rootNode)return;f.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:_})}newGroupValues(_){let f=this.beans.rowGroupColsSvc?.columns??[],$=Array(f.length),z=-1,Q=_;while(Q&&Q.level>=0){let J=f[Q.level];if(J){let q=J.getColId(),X=Q.level;if($[X]=Q.groupData?.[q]??Q.key??void 0,X>z)z=X}Q=Q.parent}return{values:$,columns:f,maxLevel:z}}setRowGroup(_,{values:f,columns:$,maxLevel:z}){if(z<0)return!1;let{valueSvc:Q,changeDetectionSvc:J}=this.beans,q=!1;J?.beginDeferred();try{for(let X=0;X<$.length;++X){let Y=$[X];if(!Y||X>z)continue;let Z=f[X],G=Q.getValue(Y,_,"data");if(G===Z||G==null&&Z==null)continue;let E=Z,U=Q.parseValue(Y,_,Z,G);if(U!==void 0)E=U;if(_.setDataValue(Y,E,"rowDrag"))q=!0}}finally{J?.endDeferred()}return q}onCsrmCellChange(_){let{column:f,node:$,source:z}=_;if(!this.gos.get("refreshAfterGroupEdit"))return;if(z==="rowDrag")return;if(!f?.isRowGroupActive())return;if($.group||!$.data)return;if(this.beans.editSvc?.isBatchEditing()){let J=this.pendingEditRefresh;if(!J)J=SY(),this.pendingEditRefresh=J;J.updates.add($)}else{let J=SY();J.updates.add($),this.csrmRefresh(J)}}csrmFirstLeaf(_){if(!_)return null;let f=this.draggingGroups,$=f?.get(_)??_.childrenAfterGroup;while($?.length){let z=$[0];if(z.sourceRowIndex>=0){if(!z.destroyed)return z;return this.firstAliveChildLeaf(z)}$=f?.get(z)??z.childrenAfterGroup}return _1(_)}firstAliveChildLeaf(_){let f=this.draggingGroups?.get(_)??_.childrenAfterGroup;if(f){for(let $ of f)if($.sourceRowIndex>=0&&!$.destroyed)return $}return null}findFirstLeafForParent(_,f){if(!_)return null;let $=this.draggingGroups?.get(_)??_?.childrenAfterGroup;if(!$)return null;for(let z=0,Q=$.length;z=0&&!f.has(J))return J;let q=this.findFirstLeafForParent(J,f);if(q!==null)return q}return null}},SY=()=>{let _=new R1;return _.reordered=!0,_},AY=(_,f)=>{if(!_||!f)return!1;let $=f;while($){if($===_)return!0;$=$.parent}return!1},qV=(_,f)=>{if(!f||_.parent===f)return!1;let $=f,z=_.id;while($){if($===_)return!0;if(z!=null&&$.id===z)return!0;$=$.parent}return!1},XV=(_,f)=>{for(let $=0,z=_.length;$this.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.columnsInvalidated=!0,this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(_){return this.strategy?.nonLeafsById?.get(_)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(_){let f=this.gos,$=this.strategy?.nestedDataGetter;if(_.has("treeData"))this.gosTreeData=f.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0;return this.strategy?.onPropChange?.(_),this.getNestedDataGetter()!==$}extractData(){let _=this.beans.rowModel.rootNode,f=this.nested?_?.childrenAfterGroup:_?._leafs;if(!f)return this.gos.get("rowData")??[];let $=f.length,z=Array($),Q=0;for(let J=0;J<$;++J){let q=f[J].data;if(q!=null)z[Q++]=q}return z.length=Q,z}execute(_){let f=this.beans,$=f.rowModel,z=$.rootNode;if(!z)return!1;let Q=this.getStrategy(),J=!!Q?.nestedDataGetter,q=this.needReset;if(this.nested=J,q)this.needReset=!1,f.rowDragSvc?.cancelRowDrag(),_.animate=!1,GV(z,!J,f);if(!Q){$.hierarchical=!1;return}return $.hierarchical=!0,f.changedPathFactory?.ensureRowsPath(_,z),Q.execute(z,_)||q}loadLeafs(_){return _.footer?ZV(_):yQ(_)}loadGroupData(_){let f=this.getStrategy();if(f)return f.loadGroupData(_);return _._groupData=null,null}clearNonLeafs(){this.strategy?.clearNonLeafs()}getWantedStrategyType(){if(this.isAlive()){if(this.gosTreeData)return"tree";if(this.hasRowGrouping&&(this.beans.rowGroupColsSvc?.columns?.length||this.pivotMode))return"group"}return"none"}getStrategy(){let _=this.strategy,f=this.beans.colModel.isPivotMode();if(f!==this.pivotMode)this.pivotMode=f,this.columnsInvalidated=!0;if(_!==void 0&&!this.columnsInvalidated&&this.isAlive())return _;this.columnsInvalidated=!1;let $=this.getWantedStrategyType();if($===this.strategyType){if(_!==void 0)return _;return this.strategy=null,null}if(_)this.strategy=this.destroyBean(_),this.needReset=!0;if(this.strategyType=$,this.treeData=$==="tree",this.grouping=$==="group",$==="none")return this.strategy=null,null;let z=$==="tree"?"treeGroupStrategy":"groupStrategy";return _=this.beans.registry.createDynamicBean(z,!1)??null,this.strategy=_&&this.createBean(_),_}},ZV=(_)=>{let f=_.sibling;if(!f)return null;let $=f._leafs;if($!==void 0)return $;return yQ(f)},yQ=(_)=>{let f=_.childrenAfterGroup,$=f?.length;if(_._leafs=null,!$)return null;let z,Q=$===1?f[0]:null;if(Q?.group&&Q.sourceRowIndex<0){if(z=Q._leafs,z===void 0)z=yQ(Q)}else if(_.leafGroup)z=f;else{z=[];for(let J=0;J<$;++J){let q=f[J];if(q.sourceRowIndex>=0)z.push(q);if(!q.group)continue;let X=q._leafs;if(X===void 0)X=yQ(q);if(X)for(let Y=0,Z=X.length;Y{let{_leafs:z,sibling:Q}=_;if(_.treeNodeFlags=0,_.childrenAfterGroup=z,_.childrenMapped=null,_._groupData=void 0,_.aggData=null,Q)Q.childrenAfterGroup=_.childrenAfterGroup,Q.childrenAfterAggFilter=_.childrenAfterAggFilter,Q.childrenAfterFilter=_.childrenAfterFilter,Q.childrenAfterSort=_.childrenAfterSort,Q.childrenMapped=null,Q._groupData=void 0,Q.aggData=null;for(let J=0,q=z.length??0;J{_.key=null,_.treeNodeFlags=0,_.allChildrenCount=null,_.childrenAfterGroup=null,_.childrenAfterAggFilter=null,_.childrenAfterFilter=null,_.childrenAfterSort=null,_.childrenMapped=null,_.level=0,_._groupData=void 0};function jY(_,f,$){let z=_,Q=z.level-f.level;if(Q<=0)return!1;if(!$.get("groupHideOpenParents"))return!1;for(let q=0;q{let{rowDragSvc:f}=this.beans;if(!this.params.rowDrag||!f)return;let $=f.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean($),this.eGui.insertAdjacentElement("afterbegin",$.getGui())};this.setupExpand(),_(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){let _=this.params.colDef?.cellAriaRole,f=this.params.column?.getColDef().cellAriaRole;return _||f||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;let{visibleCols:_}=this.beans,f=this.params.pinned==="left",$=this.params.pinned==="right",z=!f&&!$;if(this.gos.get("enableRtl")){if(_.isPinningLeft())return!$;return!z}if(_.isPinningLeft())return!f;return!z}addGroupValue(){let{params:{value:_,valueFormatted:f}}=this,$=this.getInnerCompDetails();this.comp.setInnerRenderer($,f??_??null)}setupExpand(){let{colModel:_}=this.beans,{eGridCell:f,suppressDoubleClickExpand:$}=this.params,z=(Y,Z)=>{let G=h(Y,this.beans,null);if(G)Z.appendChild(G),this.addDestroyFunc(()=>G.remove())};z("groupExpanded",this.eExpanded),z("groupContracted",this.eContracted);let Q=this.comp,J=()=>{if(!this.isExpandable())return;let Z=!!this.displayedNode.expanded;Q.setExpandedDisplayed(Z),Q.setContractedDisplayed(!Z),N_(f,Z)},q=()=>{let Y=this.isExpandable();Q.toggleCss("ag-cell-expandable",Y),Q.toggleCss("ag-row-group",Y);let Z=!Y&&_.isPivotMode();Q.toggleCss("ag-pivot-leaf-group",Z);let G=!_.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);Q.toggleCss("ag-row-group-leaf-indent",!Y&&G);let E=this.getChildCount(),U=E>0?`(${E})`:"";if(Q.setChildCount(U),!Y)Q.setExpandedDisplayed(!1),Q.setContractedDisplayed(!1),$q(f);else J()};(()=>{if(!$&&!this.isGroupCellEditable(this.displayedNode))this.addManagedListeners(f,{dblclick:this.onCellDblClicked.bind(this)});this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(f,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:q,masterChanged:q,groupChanged:q,hasChildrenChanged:q,expandedChanged:J})})(),q()}getInnerCompDetails(){let{userCompFactory:_,findSvc:f}=this.beans,$=this.params;if($.fullWidth){let Y=this.gos.get("groupRowRendererParams"),Z=R$(_,Y,$);if(Z)return Z;if(f?.isMatch($.node,null))return R$(_,{...Y,innerRenderer:"agFindCellRenderer"},$);return}let z=(Y)=>Y&&Y.componentClass==this.compClass,Q=R$(_,$,$);if(Q&&!z(Q))return Q;let{displayedNode:{rowGroupColumn:J}}=this,q=J?.colDef,X=J&&$.column?.isRowGroupDisplayed(J.getId());if(q&&X){let Y=U$(_,q,$);if(Y)if(z(Y)){if(q?.cellRendererParams?.innerRenderer)return R$(_,q.cellRendererParams,$)}else return Y}if(f?.isMatch($.node,$.column))return U$(_,{...q??$.colDef,cellRenderer:"agFindCellRenderer"},$)}getChildCount(){let{column:_,suppressCount:f}=this.params;if(f)return 0;let{allChildrenCount:$,rowGroupColumn:z}=this.displayedNode;if(!(($??0)>0&&(!z||!_||_?.isRowGroupDisplayed(z.getId()))))return 0;if(this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!jY(this.node,this.displayedNode,this.gos))return 0;return $??0}isExpandable(){let{node:_,column:f,colDef:$}=this.params;if(!this.displayedNode.isExpandable())return!1;if(_.rowPinned)return!1;if(!f)return!0;if(_.hasChildren()&&$){let{showRowGroup:J}=$;if(!J)return!1;if(J===!0)return!0}if(_===this.displayedNode){if(_.rowGroupColumn){if(f?.isRowGroupDisplayed(_.rowGroupColumn.getId()))return!0}if(_.master)return $?.showRowGroup===!0||$?.showRowGroup==null;return!1}return jY(this.node,this.displayedNode,this.gos)}setupIndent(){let{suppressPadding:_,node:f,colDef:$}=this.params;if(_)return;let z=()=>{let Q=f.uiLevel;if($&&$.showRowGroup!==!0)Q=0;let J="ag-row-group-indent-"+Q;if(J===this.indentClass)return;if(this.indentClass)this.comp.toggleCss(this.indentClass,!1);this.indentClass=J,this.comp.toggleCss(J,!0),this.eGui.style.setProperty("--ag-indentation-level",String(Q))};this.addManagedListeners(f,{uiLevelChanged:z.bind(this)}),z()}setupCheckbox(){let{node:_}=this.params;if(!(!_.footer&&!_.rowPinned&&!_.detail))return;this.addManagedPropertyListener("rowSelection",({currentValue:$,previousValue:z})=>{let Q=typeof $==="object"?$:void 0,J=typeof z==="object"?z:void 0;if(Q?.checkboxLocation!==J?.checkboxLocation)this.destroyCheckbox(),this.addCheckbox()}),this.addCheckbox()}addCheckbox(){let{selectionSvc:_}=this.beans;if(!_||!p0(this.gos))return;let{node:f,column:$}=this.params,z=this.gos.get("rowSelection"),Q=V1(z);if(Q==="selectionColumn")return;if(Q==="autoGroupColumn"){let Z=$?.getColDef().showRowGroup!=null,G=!$&&f.group;if(!(Z||G))return}let J=typeof z==="object"?Zf(z):this.params.checkbox;if(!(typeof J==="function"||J===!0))return;if(typeof $?.getColDef().showRowGroup==="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}let Y=_.createCheckboxSelectionComponent();this.cbComp=Y,this.createBean(Y),Y.init({rowNode:f,column:$,overrides:{isVisible:J,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(Y.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}isGroupCellEditable(_){let f=this.params.column;return!!f&&(!!f.getColDef().groupRowEditable||this.gos.get("enableGroupEdit"))&&f.isCellEditable(_)}onExpandClicked(_){if(z0(_))return;n_(_),this.onExpandOrContract(_)}onKeyDown(_){if(_.key!==S.ENTER||this.params.suppressEnterExpand)return;if(this.isGroupCellEditable(this.params.node))return;this.onExpandOrContract(_)}onCellDblClicked(_){if(z0(_))return;if(!(mz(this.eExpanded,_)||mz(this.eContracted,_)))this.onExpandOrContract(_)}onExpandOrContract(_){if(!this.isExpandable())return;let f=this.displayedNode,$=!f.expanded;if(!$&&f.sticky)this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(f.rowTop-f.stickyRowTop);f.setExpanded($,_)}destroy(){super.destroy(),this.destroyCheckbox()}},EV={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},VY=class extends w{constructor(){super(EV);this.eExpanded=V,this.eContracted=V,this.eCheckbox=V,this.eValue=V,this.eChildCount=V}init(_){let f={setInnerRenderer:(J,q)=>this.setRenderDetails(J,q),setChildCount:(J)=>this.eChildCount.textContent=J,toggleCss:(J,q)=>this.toggleCss(J,q),setContractedDisplayed:(J)=>N(this.eContracted,J),setExpandedDisplayed:(J)=>N(this.eExpanded,J),setCheckboxVisible:(J)=>this.eCheckbox.classList.toggle("ag-invisible",!J),setCheckboxSpacing:(J)=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",J)},$=this.createManagedBean(new NZ),z=!_.colDef,Q=this.getGui();if($.init(f,Q,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,_),z)Z_(Q,$.getCellAriaRole())}setRenderDetails(_,f){if(_)_.newAgStackInstance().then(($)=>{if(!$)return;let z=()=>this.destroyBean($);if(this.isAlive())this.eValue.appendChild($.getGui()),this.addDestroyFunc(z);else z()});else this.eValue.innerText=f}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},UV=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}",HV=class extends A{constructor(){super(...arguments);this.beanName="showRowGroupColValueSvc"}getGroupValue(_,f,$){if(!f){if(!_.group)return null;return{displayedNode:_,value:_.groupValue}}let z=this.beans.valueSvc,Q=f.colDef.showRowGroup;if(!Q)return null;if(_.level===-1&&_.footer)return{displayedNode:_,value:null};if(typeof Q==="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex(Q)??-1)>_.level)return null;let X=this.getDisplayedNode(_,f,!0);if(X)return{displayedNode:X,value:z.getValue(f,X,"data",$)}}let J=z.getValue(f,_,"data",$);if(J==null){let q=this.getDisplayedNode(_,f);if(q)return{displayedNode:q,value:z.getValue(f,q,"data",$)}}return{displayedNode:_,value:J}}formatAndPrefixGroupColValue(_,f,$=!1){let z=this.formatGroupColValue(_,f,$),{value:Q,displayedNode:J}=_,q=this.beans.footerSvc;if(q?.doesCellShowTotalPrefix(J,f))return q.applyTotalPrefix(Q,z,J,f);if(J.footer&&J.level===-1)return null;return z}formatGroupColValue(_,f,$=!1){let z=this.beans.valueSvc,{displayedNode:Q,value:J}=_,q=Q.rowGroupColumn,X=Q.group&&!f;if(q&&(X||f?.isRowGroupDisplayed(q.colId))){if($&&q.colDef.useValueFormatterForExport===!1)return null;let Z=z.formatValue(q,Q,J);if(Z==null&&Q.key==="")return this.getLocaleTextFunc()("blanks","(Blanks)");return Z}if(!f||Q.group)return null;if($&&f.colDef.useValueFormatterForExport===!1)return null;return z.formatValue(f,Q,J)}getDisplayedNode(_,f,$=!1){let z=this.gos,Q=z.get("groupHideOpenParents"),J=z.get("showOpenedGroup")&&!$;if(!Q&&!J)return;let q=f.colDef.showRowGroup;if(q===!0){if(_.group)return;return _.parent??void 0}let X=_;while(X&&X.rowGroupColumn?.getId()!=q){let Y=X===X.parent?.getFirstChild();if(!J&&!Y)return;X=X.parent}if(X===_)return;return X??void 0}},WV=class extends A{constructor(){super(...arguments);this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){let{colModel:_,rowGroupColsSvc:f}=this.beans,$=this.columns,z=this.colsSet,Q=this.colsMap;Q.clear();let J=$.length,q=0,X=!1,Y=_.getCols();for(let Z=0,G=Y.length;Z=J||!z.has(E)),$[q++]=E}if(X||(X=q!==J),X){$.length=q,z.clear();for(let Z=0;Z{this.gridBodyCtrl=_.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(_){if(this.extraTopHeight===_)return;this.extraTopHeight=_,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:_})}setOffsetBottom(_){if(this.extraBottomHeight===_)return;this.extraBottomHeight=_}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(_){return this.isClientSide?LV(_):KV(_)}getFirstPixelOfGroup(_){if(_.footer)return _.sibling.rowTop+_.sibling.rowHeight-1;if(_.hasChildren())return _.rowTop-1;return 0}updateStickyRows(_){let f=_==="top",$=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(_,new Set,$);let z=new Set,{rowModel:Q,rowRenderer:J,pinnedRowModel:q,pageBounds:X,rowContainerHeight:Y}=this.beans,{pageFirstPixel:Z,pageLastPixel:G}=X.getCurrentPagePixelRange(),E=f?J.firstVisibleVPixel-this.extraTopHeight:J.lastVisibleVPixel-this.extraTopHeight,U=Y.divStretchOffset??0,H=Z+U,W=G+U,B=(D)=>{if(z.add(D),f){let M=this.getLastPixelOfGroup(D),k=E+$+D.rowHeight;if(Mk)D.stickyRowTop=$-(M-k);else D.stickyRowTop=$}$=0,z.forEach((M)=>{let k=M.stickyRowTop+M.rowHeight;if(${if(!D.displayed)return!1;if(D.footer){if(K===!0)return!1;if(K==="grand"&&D.level===-1)return!1;if(K==="group"&&D.level>-1)return!1;let M=D.sibling.rowIndex?D.sibling.rowIndex+1===D.rowIndex:!1;if(_==="bottom"&&M)return!1;if(D.level===-1&&q?.getGrandTotalPinned())return!1;return!z.has(D)}if(D.isExpandable()){if(L===!0)return!1;if(_==="bottom")return!1;return!z.has(D)&&!!D.expanded}return!1};for(let D=0;D<100;D++){let M=E+$;if(!f)M=E-$;if(f&&MW)M=W;let k=Q.getRowIndexAtPixel(M),R=Q.getRow(k);if(R==null)break;let I=this.getStickyAncestors(R).find((y)=>(f?y.rowIndexk)&&F(y));if(I){B(I);continue}if((f?R.rowTopM)&&F(R)){B(R);continue}break}if(!f)z.forEach((D)=>{D.stickyRowTop=$-(D.stickyRowTop+D.rowHeight)});return this.refreshNodesAndContainerHeight(_,z,$)}areFooterRowsStickySuppressed(){let _=this.gos.get("suppressStickyTotalRow");if(_===!0)return!0;let f=_==="group",$=_==="grand";if(f&&$)return!0;if($)return"grand";if(f)return"group";return!1}canRowsBeSticky(){let _=y1(this.gos),f=this.areFooterRowsStickySuppressed(),$=this.gos.get("suppressGroupRowsSticky");return _&&(!f||!$)}getStickyAncestors(_){let f=[],$=_.footer?_.sibling:_.parent;while($){if($.sibling)f.push($.sibling);f.push($),$=$.parent}return f.reverse()}checkStickyRows(){let _=this.updateStickyRows("top"),f=this.updateStickyRows("bottom");return _||f}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(_){let f=new Set;if(this.stickyTopRowCtrls.some(($)=>$.rowNode===_)){for(let $=0;${if(X.has(H))return;H.sticky=!0,Y.push(this.createRowCon(H,!1,!1))});let Z=!!Y.length||q.length!==Q.length;if(z){if(this.topContainerHeight!==$)this.topContainerHeight=$,this.gridBodyCtrl.setStickyTopHeight($),Z=!0}else if(this.bottomContainerHeight!==$)this.bottomContainerHeight=$,this.gridBodyCtrl.setStickyBottomHeight($),Z=!0;this.destroyRowCtrls(J,!1);let G=[...q,...Y];if(G.sort((H,W)=>W.rowNode.rowIndex-H.rowNode.rowIndex),!z)G.reverse();for(let H of G)H.setRowTop(H.rowNode.stickyRowTop);let E=this.beans.pageBounds,U=0;if(z){for(let H of f)if(H.rowIndexthis.topContainerHeight)U=this.topContainerHeight;this.setOffsetTop(U)}else{for(let H of f)if(H.rowIndex>E.getLastRow())U+=H.rowHeight;if(U>this.bottomContainerHeight)U=this.bottomContainerHeight;this.setOffsetBottom(U)}if(!Z)return!1;if(z)this.stickyTopRowCtrls=G;else this.stickyBottomRowCtrls=G;return!0}ensureRowHeightsValid(){let _=!1,f=($)=>{let z=$.rowNode;if(z.rowHeightEstimated){let Q=Y$(this.beans,z);z.setRowHeight(Q.height),_=!0}};return this.stickyTopRowCtrls.forEach(f),this.stickyBottomRowCtrls.forEach(f),_}};function KV(_){if(_.isExpandable()||_.footer){if(_.master&&_.detailNode)return _.detailNode.rowTop+_.detailNode.rowHeight;if(!_.sibling||Math.abs(_.sibling.rowIndex-_.rowIndex)===1){let $=_.childStore?.getStoreBounds();if(_.footer)$=_.sibling.childStore?.getStoreBounds();return($?.heightPx??0)+($?.topPx??0)}if(_.footer)return _.rowTop+_.rowHeight;return _.sibling.rowTop+_.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function LV(_){if(_.isExpandable()||_.footer){if(_.footer&&_.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!_.sibling||Math.abs(_.sibling.rowIndex-_.rowIndex)===1){let z=_.footer?_.sibling:_;while(z.isExpandable()&&z.expanded)if(z.master&&z.detailNode)z=z.detailNode;else if(z.childrenAfterSort){if(z.childrenAfterSort.length===0)break;z=b(z.childrenAfterSort)}return z.rowTop+z.rowHeight}if(_.footer)return _.rowTop+_.rowHeight;return _.sibling.rowTop+_.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var FV=class extends A{constructor(){super(...arguments);this.beanName="stickyRowSvc"}createStickyRowFeature(_,f,$){let z=this.gos;if(y1(z)&&o(z)||Kf(z))return _.createManagedBean(new BV(f,$));return}},gZ={moduleName:"GroupCellRenderer",version:$_,userComponents:{agGroupRowRenderer:VY,agGroupCellRenderer:VY},dynamicBeans:{groupCellRendererCtrl:NZ},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[UV],dependsOn:[y_]},DV={moduleName:"GroupColumn",version:$_,beans:[tj,WV,HV,dj,wZ,bZ],dependsOn:[y_,gZ]},hZ={moduleName:"ChangedPath",version:$_,beans:[aj],dependsOn:[y_]},wQ={moduleName:"ClientSideRowModelHierarchy",version:$_,rowModels:["clientSide"],beans:[YV,QV,ej],dependsOn:[y_,hZ]},uZ={moduleName:"StickyRow",version:$_,beans:[FV]},MV={moduleName:"GroupEdit",version:$_,beans:[JV],dependsOn:[y_,wQ]},kV=({valueSvc:_,dataTypeSvc:f},$,z)=>{let Q=_.getValue($,z,"data"),J=null;if(Q instanceof Date)J=Q;else if(typeof Q==="string")J=(f?.getDateParserFunction($)??H$)(Q)??null;return J},Sf=(_,f,$,z)=>(Q)=>{let J=kV(_,f,Q.node),q=K1(J);if(!q)return null;return z?.(q[$])??q[$]},Af=({colNames:_},f,$)=>(z)=>{let Q=_.getDisplayNameForColumn(f,z.location);if(Q)return`${Q} (${$})`;return""},SV=Object.fromEntries(uJ.map((_)=>[_,_.toLowerCase()])),AV=(_)=>{let f=uJ[Number.parseInt(_,10)-1]??_,$=SV[f]??_;return{month:f,localeKey:$}};function OY(_){return _.groupHierarchy??_.rowGroupingHierarchy}var RV=class extends A{constructor(){super(...arguments);this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(_){let f=this.columns;if(f==null)return;_.list=f.list.filter(($)=>!_.list.some((z)=>z.getColId()===$.getColId())).concat(_.list),_.tree=f.tree.filter(($)=>!_.tree.some((z)=>z.getId()===$.getId())).concat(_.tree),A$(_)}createColumns(_){let f=new WeakMap,$=new WeakMap,z=this.createGroupHierarchyColumns(_,f,$);if(S$(z,this.columns?.list??[]))return;J0(this.beans,this.columns?.tree),this.columns=null;let{colGroupSvc:J}=this.beans,q=J?.findDepth(_.tree)??0,X=J?.balanceTreeForAutoCols(z,q)??[];this.columns={list:z,tree:X,treeDepth:q,map:{}},this.sourceColumnMap=f,this.inverseColumnMap=$}updateColumns(_){}getColumn(_){return this.columns?.list.find((f)=>b0(f,_))??null}getColumns(){return this.columns?.list??null}expandColumnInto(_,f){let $=this.getVirtualColumnsForColumn(f).concat(f);for(let z of $)if(!_.some((Q)=>b0(Q,z)||Q.getColId()===z.getColId()))_.push(z)}compareVirtualColumns(_,f){let $=this.inverseColumnMap.get(_),z=this.inverseColumnMap.get(f);if($&&$===z){let Q=this.sourceColumnMap.get($)??[];return Q?.indexOf(_)-Q?.indexOf(f)}if(this.sourceColumnMap.get(_)?.includes(f))return 1;if(this.sourceColumnMap.get(f)?.includes(_))return-1;return null}insertVirtualColumnsForCol(_,f){let $=this.getVirtualColumnsForColumn(f);if(!$)return[];let z=_.indexOf(f);if(z<0)z=_.length-1;return K$(_,$),_.splice(z,0,...$),$}getVirtualColumnsForColumn(_){if(this.isGroupHierarchyColsEnabledForCol(_))return this.sourceColumnMap.get(_)??[];return[]}isGroupHierarchyColsEnabled(_){return _.list.some((f)=>this.isGroupHierarchyColsEnabledForCol(f))}isGroupHierarchyColsEnabledForCol(_){let f=_.getColDef();return!!(OY(f)&&(f.rowGroup||f.enableRowGroup||f.rowGroupIndex!=null||f.pivot||f.enablePivot||f.pivotIndex!=null))}createGroupHierarchyColDefs(_){let f=[],$=_.getColDef(),z=OY($);if(!z)return f;if(!this.isGroupHierarchyColsEnabledForCol(_))return f;for(let Q of z){let J=null;if(typeof Q==="string")J=this.createColDefForPart(Q,_,$);else J=Q;if(J)f.push(J)}return f}createGroupHierarchyColumns(_,f,$){if(!this.isGroupHierarchyColsEnabled(_))return[];let z=[];for(let Q of _.list)for(let J of this.createGroupHierarchyColDefs(Q)){let q=J.colId;this.gos.validateColDef(J,q,!0);let X=new Z0(J,null,q,!0);this.createBean(X),z.push(X),jV(f,Q,X),$.set(X,Q)}return z}createColDefForPart(_,f,$){let{beans:z,gos:Q}=this,J=`${lq}-${f.getColId()}-${_}`,q={enableRowGroup:$.enableRowGroup,rowGroup:$.rowGroup,enablePivot:$.enablePivot,hide:!0,editable:!1},X=Q.get("groupHierarchyConfig")??{};if(_ in X){let E={...q,...X[_]};return E.colId??(E.colId=J),n0(z,E,E.colId,!0)}let Y=n0(z,{colId:J,...q},J,!0),Z=this.getLocaleTextFunc(),G=(E,U)=>Z?.(E,U)??U;switch(_){case"year":return{...Y,headerValueGetter:Af(z,f,G(_,"Year")),valueGetter:Sf(z,f,0)};case"quarter":return{...Y,headerValueGetter:Af(z,f,G(_,"Quarter")),valueGetter:Sf(z,f,1,(E)=>(Math.floor(Number(E)/4)+1).toString())};case"month":return{...Y,headerValueGetter:Af(z,f,G(_,"Month")),valueGetter:Sf(z,f,1)};case"formattedMonth":return{...Y,headerValueGetter:Af(z,f,G("month","Month")),valueGetter:Sf(z,f,1,(E)=>{let U=AV(E);return G(U.localeKey,U.month)})};case"day":return{...Y,headerValueGetter:Af(z,f,G(_,"Day")),valueGetter:Sf(z,f,2)};case"hour":return{...Y,headerValueGetter:Af(z,f,G(_,"Hour")),valueGetter:Sf(z,f,3)};case"minute":return{...Y,headerValueGetter:Af(z,f,G(_,"Minute")),valueGetter:Sf(z,f,4)};case"second":return{...Y,headerValueGetter:Af(z,f,G(_,"Second")),valueGetter:Sf(z,f,5)};default:return null}}};function jV(_,f,$){let z=_.get(f);_.set(f,(z??[]).concat($))}var VV={moduleName:"GroupHierarchy",version:$_,beans:[RV],dependsOn:[hZ]};var OV=(_,f)=>{if(!_){f.length=0;return}let $=_.length;f.length=$;for(let z=0;z<$;z++){let Q=_[z],J=Q.getColDef();f[z]={col:Q,field:J.field,type:J.type,keyCreator:J.keyCreator,valueGetter:J.valueGetter}}},PV=(_,f)=>{let $=_.length;if($!==f?.length)return!0;for(let z=0;z<$;z++){let Q=_[z],J=f[z];if(Q.col!==J)return!0;let q=J.getColDef();if(Q.field!==q.field||Q.type!==q.type||Q.valueGetter!==q.valueGetter||Q.keyCreator!==q.keyCreator)return!0}return!1};function vV(_){if(!_)return!1;let f=_.length;if(f<2)return!1;let $=!1;for(let z=1;z0){$=!0;break}if(!$)return!1;return _.sort(PY),!0}function PY(_,f){let $=_.sourceRowIndex,z=f.sourceRowIndex,Q=$>=0,J=z>=0,q=Q&&J,X=!Q&&!J;if(q)return $-z;if(X)return _.__objectId-f.__objectId;if(Q)return 1;return-1}var TV=class extends A{constructor(){super(...arguments);this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){let _=this.nonLeafsById;for(let f of _.values())f._destroy(!1);_.clear()}loadGroupData(_){if(!_.group)return _._groupData=null,null;let f=_.rowGroupColumn,{valueSvc:$,showRowGroupCols:z}=this.beans,Q={};if(_._groupData=Q,!f)return Q;let J=_1(_),q=f.getId();if(!z)return Q;let X=z.columns;for(let Y=0,Z=X.length;Y{let z=$.childrenAfterGroup,Q=z?.length;if(!Q)return;let J=Array(Q),q=0,X=!1,Y;for(let Z=0;Z1)}}if(Q.size)for(let Y of Q){this.insertOneNode(_,Y);let Z=Y.parent;f?.addRow(Z),J||(J=(Z?.childrenAfterGroup?.length??0)>1)}if(X.size)vY(X),this.removeEmptyGroups(X,q);if(J)this.sortChildren(_,f)}sortChildren(_,f){R_(_,!0,void 0,($)=>{if(vV($.childrenAfterGroup))f?.addRow($)})}orderGroups(_){let f=this.gos.getCallback("initialGroupOrderComparator");if(!f)return;let $=this.beans,z=$.gridApi,Q=$.gridOptions.context,J=(X,Y)=>f({api:z,context:Q,nodeA:X,nodeB:Y}),q=(X)=>{let Y=X.childrenAfterGroup,Z=Y?.length;if(!Z||X.leafGroup)return;if(Z>1)Y.sort(J);for(let G=0,E=Z;G=0;--X){let{col:Y}=q[X],Z=$.getKeyForNode(Y,f);if(Z==null||Z===""){if(!z)continue;Z=""}if(!Q?.parent||Q.key!==Z){J=!0;break}Q=Q.parent}if(J||(J=!!Q?.parent),!J)return!1;return this.removeFromParent(f),this.insertOneNode(_,f),f.setData(f.data),!0}groupShouldBeRemoved(_){let f=this.getChildrenMappedKey(_.key,_.rowGroupColumn),$=_.parent?.childrenMapped;if($?!$[f]:!0)return!1;return!!_.group&&(_.childrenAfterGroup?.length??0)===0}removeEmptyGroups(_,f){let $=this.beans.selectionSvc,z,Q=Array.from(_),J=this.nonLeafsById;do{_.clear();for(let q=0;q=X-1,B=this.createGroup($,Z,E,H,W,f);this.addToParent(B,$),$=B}if(!$.group)j(184,{parentGroupData:$.data,childNodeData:f.data});f.parent=$,f.level=$.level+1,$.childrenAfterGroup.push(f),$.updateHasChildren(),AQ($)}createGroup(_,f,$,z,Q,J){let q=f.col,X=(_.level>=0?_.id+"-":"row-group-")+(q.getColId()+"-"+$),Y=this.nonLeafsById,Z=Y.get(X),G=!0;if(Z){if(Z.childrenAfterGroup!==null)return Z._expanded??(Z._expanded=null),Z;G=!1,AQ(Z)}else Z=new Df(this.beans),Z.group=!0,Z.key=$,Z.id=X,Z.aggData=null,Y.set(X,Z);let E=(B)=>{B.childrenAfterGroup=U,B.childrenMapped=H,B.parent=_,B.level=z,B.rowGroupIndex=z,B.leafGroup=Q},U=[],H={};if(E(Z),Z.field=f.field??null,Z.rowGroupColumn=q,Z.groupValue=this.beans.valueSvc.getValue(q,J,"data"),Z._expanded??(Z._expanded=null),G)return Z.setAllChildrenCount(0),Z.updateHasChildren(),Z;let W=Z.sibling;if(W)E(W);return Z.dispatchRowEvent("hasChildrenChanged"),Z}getChildrenMappedKey(_,f){return f?f.getId()+"-"+_:_}onShowRowGroupColsSetChanged(){let{rowModel:_,valueSvc:f}=this.beans;for(let z of this.nonLeafsById.values()){z._groupData=void 0;let Q=z.rowGroupColumn,J=Q&&_1(z);z.groupValue=J&&f.getValue(Q,J,"data")}let $=_.rootNode?._leafs;if($)for(let z=0,Q=$.length;z{for(let f of _){let $=f?.childrenAfterGroup;if(!$)continue;let z=$.length,Q=0;for(let J=0;J{while(_._leafs!==void 0){let f=_.parent;if(!f)break;_._leafs=void 0,_=f}};function IV(_,f){_.rowGroupColsSvc?.setColumns(f,"api")}function yV(_,f){_.rowGroupColsSvc?.removeColumns(f,"api")}function bV(_,f){_.rowGroupColsSvc?.addColumns(f,"api")}function CV(_,f,$){_.rowGroupColsSvc?.moveColumn?.(f,$,"api")}function wV(_){return _.rowGroupColsSvc?.columns??[]}var iZ={moduleName:"SharedRowGrouping",version:$_,apiFunctions:{setRowGroupColumns:IV,removeRowGroupColumns:yV,addRowGroupColumns:bV,getRowGroupColumns:wV,moveRowGroupColumn:CV},dependsOn:[y_,CZ,DV,uZ,VV]},xV={moduleName:"RowGrouping",version:$_,dynamicBeans:{groupStrategy:TV},rowModels:["clientSide"],dependsOn:[iZ,nj,wQ,MV]};function NV(_,f){_.clipboardSvc?.copyToClipboard(f)}function gV(_,f){_.clipboardSvc?.cutToClipboard(f)}function hV(_,f){_.clipboardSvc?.copySelectedRowsToClipboard(f)}function uV(_,f){_.clipboardSvc?.copySelectedRangeToClipboard(f)}function iV(_){_.clipboardSvc?.copyRangeDown()}function mV(_){_.clipboardSvc?.pasteFromClipboard()}var FQ="paste",L2="dragCopy",F2="clipboard";function cV(_,f=","){let $=[],z=(J)=>J==="\r"||J===` -`,Q=!1;if(_==="")return[[""]];for(let J=0,q=0,X=0;X<_.length;X++){let Y=_[X-1],Z=_[X],G=_[X+1],E=()=>{if(!$[J])$[J]=[];if(!$[J][q])$[J][q]=""};if(E(),Z==='"'){if(Q)if(G==='"')$[J][q]+='"',X++;else Q=!1;else if(Y===void 0||Y===f||z(Y))Q=!0}if(!Q&&Z!=='"'){if(Z===f){q++,E();continue}else if(z(Z)){if(q=0,J++,E(),Z==="\r"&&G===` -`)X++;continue}}$[J][q]+=Z}return $}var pV=class extends A{constructor(){super(...arguments);this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){let{gos:_,rowModel:f,ctrlsSvc:$}=this.beans;if(o(_,f))this.clientSideRowModel=f;$.whenReady(this,(z)=>{this.gridCtrl=z.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){if(!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText)navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((f)=>{j(40,{e:f,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()});else this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let _=!1,f=($)=>{let z=Date.now();if(z-this.lastPasteOperationTime<50)_=!0,$.preventDefault();this.lastPasteOperationTime=z};this.executeOnTempElement(($)=>{$.addEventListener("paste",f),$.focus({preventScroll:!0})},($)=>{let z=$.value;if(!_)this.processClipboardData(z);else this.refocusLastFocusedCell();$.removeEventListener("paste",f)})}refocusLastFocusedCell(){let{focusSvc:_}=this.beans,f=_.getFocusedCell();if(f)_.setFocusedCell({rowIndex:f.rowIndex,column:f.column,rowPinned:f.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){let _=this.gos.get("clipboardDelimiter");return v(_)?_:"\t"}processClipboardData(_){if(_==null)return;let f=cV(_,this.getClipboardDelimiter()),$=this.gos.getCallback("processDataFromClipboard");if($)f=$({data:f});if(f==null)return;if(this.gos.get("suppressLastEmptyLineOnPaste"))this.removeLastLineIfBlank(f);let{rangeSvc:z,editSvc:Q}=this.beans,J=(q,X,Y,Z)=>{if(z?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(f))this.pasteIntoActiveRange(f,q,X,Z);else this.pasteStartingFromFocusedCell(f,q,X,Y,Z);Q?.stopEditing(void 0,{source:FQ})};this.doPasteOperation(J)}doPasteOperation(_){let{eventSvc:$,focusSvc:z,rowRenderer:Q,gos:J}=this.beans;$.dispatchEvent({type:"pasteStart",source:"clipboard"});let{clientSideRowModel:q}=this,X=q?.rootNode,Y=X&&this.beans.changedPathFactory?.newPath(J.get("aggregateOnlyChangedColumns")),Z={},G=[],E=z.getFocusedCell();_(Z,G,E,Y);let U=G.slice();if(Y)q.doAggregate(Y),R_(X,q.hierarchical,Y,(H)=>{U.push(H)});Q.refreshCells({rowNodes:U}),this.dispatchFlashCells(Z),this.fireRowChanged(G),this.refocusLastFocusedCell(),$.dispatchEvent({type:"pasteEnd",source:"clipboard"})}getPreProcessRangeCallback(_){return(f)=>{let{rangeSvc:$}=this.beans;if(!$)return;let{rowDiff:z,colDiff:Q}=this.getAdjustedRangeDimensionForPaste(f,_);if(z!==0)$.extendRangeRowCountBy(f,z);if(Q!==0)$.extendRangeColumnCountBy(f,Q)}}getAdjustedRangeDimensionForPaste(_,f){let $=this.beans.rangeSvc,z=f.length,Q=$.getRangeRowCount(_),J=Q>=z&&Q%z===0,q=f[0].length,X=_.columns.length,Y=X>=q&&X%q===0;return{rowDiff:J?0:z-Q,colDiff:Y?0:q-X}}pasteIntoActiveRange(_,f,$,z){let Q=0,J=0,q=(X,Y,Z,G)=>{if(G-Q>=_.length){if(G%_.length!==0)return;Q+=J,J=0}let U=_[G-Q];$.push(Y);let H=this.gos.getCallback("processCellFromClipboard"),W=Z.columns,B=W.findIndex(x0);if(B!==-1)W.splice(B,1);for(let K=0;K=U.length)F=K%U.length;let D=this.processCell(Y,L,U[F],L2,H,!0);Y.setDataValue(L,D,FQ),z?.addCell(Y.parent,L.getId());let{rowIndex:M,rowPinned:k}=X,R=g0({rowIndex:M,column:L,rowPinned:k});f[R]=!0}J++};this.iterateActiveRanges(q,!1,this.getPreProcessRangeCallback(_))}getDisplayedColumnsStartingAt(_){let f=_,$=[],{visibleCols:z}=this.beans;while(f&&k$(f))f=z.getColAfter(f);while(f!=null)$.push(f),f=z.getColAfter(f);return $}pasteStartingFromFocusedCell(_,f,$,z,Q){if(!z)return;let J={rowIndex:z.rowIndex,rowPinned:z.rowPinned},q=this.getDisplayedColumnsStartingAt(z.column);if(this.isPasteSingleValueIntoRange(_))this.pasteSingleValueIntoRange(_,$,f,Q);else this.pasteMultipleValues(_,J,$,q,f,F2,Q)}isPasteSingleValueIntoRange(_){let f=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(_)&&!!f&&!f.isEmpty()}pasteSingleValueIntoRange(_,f,$,z){let Q=_[0][0],J=(q,X,Y)=>{f.push(X),Y.columns.forEach((Z)=>this.updateCellValue(X,Z,Q,$,F2,z))};this.iterateActiveRanges(J)}hasOnlyOneValueToPaste(_){return _.length===1&&_[0].length===1}copyRangeDown(){let{rangeSvc:_,gos:f,formula:$,valueSvc:z}=this.beans;if(!_||_.isEmpty())return;let Q=[],J=(q,X,Y,Z)=>{let G=f.getCallback("processCellForClipboard"),E=f.getCallback("processCellFromClipboard"),U=(H,W,B)=>{let{columns:K}=B;if(!Q.length)K.forEach((L)=>{let F=this.processCell(W,L,z.getValue(L,W,"batch"),L2,G,!1,!0);Q.push(F)});else X.push(W),K.forEach((L,F)=>{if(!L.isCellEditable(W)||L.isSuppressPaste(W))return;if(L.isAllowFormula()&&$?.isFormula(Q[F]))Q[F]=$?.updateFormulaByOffset({value:Q[F],rowDelta:1});let M=this.processCell(W,L,Q[F],L2,E,!0);W.setDataValue(L,M,FQ),Z?.addCell(W.parent,L.getId());let{rowIndex:k,rowPinned:R}=H,O=g0({rowIndex:k,column:L,rowPinned:R});q[O]=!0})};this.iterateActiveRanges(U,!0)};this.doPasteOperation(J)}removeLastLineIfBlank(_){let f=b(_);if(f&&f.length===1&&f[0]===""){if(_.length===1)return;Q_(_,f)}}fireRowChanged(_){if(this.gos.get("editType")!=="fullRow")return;for(let f of _)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:f,data:f.data,rowIndex:f.rowIndex,rowPinned:f.rowPinned})}shouldSkipPasteRow(_,f,$){if(_.detail||_.footer)return!0;if($&&_.group){for(let z of f)if(z.isCellEditable(_))return!1;return!0}return!1}pasteMultipleValues(_,f,$,z,Q,J,q){let X=f,Y=this.beans,{gos:Z}=Y,G=this.clientSideRowModel!=null&&!Z.get("enableGroupEdit")&&!Z.get("treeData"),E=()=>{while(X){let U=D_(Y,X);if(X=K_(Y,{rowPinned:X.rowPinned,rowIndex:X.rowIndex}),U!=null&&!this.shouldSkipPasteRow(U,z,G))return U}return null};for(let U of _){let H=E();if(!H)continue;U.forEach((W,B)=>this.updateCellValue(H,z[B],W,Q,J,q)),$.push(H)}}updateCellValue(_,f,$,z,Q,J){if(!_||!f?.isCellEditable(_)||f?.isSuppressPaste(_))return;let q=this.processCell(_,f,$,Q,this.gos.getCallback("processCellFromClipboard"),!0);_.setDataValue(f,q,FQ);let{rowIndex:X,rowPinned:Y}=_,Z=g0({rowIndex:X,column:f,rowPinned:Y});z[Z]=!0,J?.addCell(_.parent,f.getId())}copyToClipboard(_={}){this.copyOrCutToClipboard(_)}cutToClipboard(_={},f="api"){if(this.gos.get("suppressCutToClipboard"))return;this.eventSvc.dispatchEvent({type:"cutStart",source:f}),this.copyOrCutToClipboard(_,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:f})}copyOrCutToClipboard(_,f){let{includeHeaders:$,includeGroupHeaders:z}=_,{gos:Q,focusSvc:J}=this.beans;if($==null)$=Q.get("copyHeadersToClipboard");if(z==null)z=Q.get("copyGroupHeadersToClipboard");let q={includeHeaders:$,includeGroupHeaders:z},X=Q.get("rowSelection"),Y=Q.get("cellSelection"),Z=null;if(this.shouldCopyCells(Y,X))this.copySelectedRangeToClipboard(q),Z=0;else if(this.shouldCopyRows(X))this.copySelectedRowsToClipboard(q),Z=1;else if(J.isAnyCellFocused())this.copyFocusedCellToClipboard(q),Z=2;if(f&&Z!==null)this.clearCellsAfterCopy(Z)}shouldCopyCells(_,f){let{rangeSvc:$,selectionSvc:z,gos:Q}=this.beans;if(!$||$.isEmpty())return!1;if(_)return!(typeof f==="object"&&f.copySelectedRows&&!z?.isEmpty());else{let J=Q.get("suppressCopySingleCellRanges");return!(!$.isMoreThanOneCell()&&J)}}shouldCopyRows(_){let{selectionSvc:f,gos:$}=this.beans;if(f?.isEmpty()??!0)return!1;if(_&&typeof _!=="string")return _.copySelectedRows??!1;else return!$.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(_){let f=this.beans,{rangeSvc:$,focusSvc:z,eventSvc:Q}=f;if(Q.dispatchEvent({type:"keyShortcutChangedCellStart"}),_===0)$.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(_===1)this.clearSelectedRows();else{let J=z.getFocusedCell();if(J==null)return;let q=D_(f,J);if(q)this.clearCellValue(q,J.column)}Q.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){let{selectionSvc:_,visibleCols:f}=this.beans,$=_?.getSelectedNodes()??[],z=f.allCols;for(let Q of $)for(let J of z)this.clearCellValue(Q,J)}clearCellValue(_,f){if(!f.isCellEditable(_))return;let $=this.beans.valueSvc.getDeleteValue(f,_);_.setDataValue(f,$,"clipboardSvc")}iterateActiveRanges(_,f,$){let z=this.beans.rangeSvc;if(!z||z.isEmpty())return;let Q=z.getCellRanges(),J=f?[Q[0]]:Q;for(let q of J)this.iterateActiveRange({cellRange:q,rowCallback:_,preProcessRange:$})}iterateActiveRange(_){let{cellRange:f,preProcessRange:$,rowCallback:z}=_,{beans:Q}=this,{rangeSvc:J}=Q;if(!J)return;if($)$(f);let q=J.getRangeStartRow(f),X=J.getRangeEndRow(f),Y=0,Z=!1;while(!Z&&q!=null){let G=D_(Q,q);Z=s(q,X),z(q,G,f,Y++),q=K_(Q,q)}}copySelectedRangeToClipboard(_={}){let f=this.beans.rangeSvc;if(!f||f.isEmpty())return;let $=f.areAllRangesAbleToMerge(),{data:z,cellsToFlash:Q}=$?this.buildDataFromMergedRanges(f,_):this.buildDataFromRanges(f,_);this.copyDataToClipboard(z),this.dispatchFlashCells(Q)}buildDataFromMergedRanges(_,f){let $=new Set,z=_.getCellRanges(),Q=new Map,J=[],q={},X=o(this.gos,this.beans.rowModel),Y=new Set;if(!X)this.beans.rowModel.forEachNode((U)=>{Y.add(U.rowIndex)});for(let U of z){U.columns.forEach((B)=>$.add(B));let{rowPositions:H,cellsToFlash:W}=this.getRangeRowPositionsAndCellsToFlash(_,U);for(let B of H){let K=Y.has(B.rowIndex);if(!X&&!K)continue;let L=`${B.rowIndex}-${B.rowPinned||"null"}`;if(!Q.get(L))Q.set(L,!0),J.push(B)}Object.assign(q,W)}let Z=this.beans.visibleCols.allCols,G=Array.from($);return G.sort((U,H)=>{let W=Z.indexOf(U),B=Z.indexOf(H);return W-B}),{data:this.buildExportParams({columns:G,rowPositions:J,includeHeaders:f.includeHeaders,includeGroupHeaders:f.includeGroupHeaders}),cellsToFlash:q}}buildDataFromRanges(_,f){let $=_.getCellRanges(),z=[],Q={};for(let J of $){let{rowPositions:q,cellsToFlash:X}=this.getRangeRowPositionsAndCellsToFlash(_,J);Object.assign(Q,X),z.push(this.buildExportParams({columns:J.columns,rowPositions:q,includeHeaders:f.includeHeaders,includeGroupHeaders:f.includeGroupHeaders}))}return{data:z.join(` -`),cellsToFlash:Q}}getRangeRowPositionsAndCellsToFlash(_,f){let $=[],z={},Q=_.getRangeStartRow(f),J=_.getRangeEndRow(f),q=Q;while(q){$.push(q);for(let X of f.columns){let{rowIndex:Y,rowPinned:Z}=q,G=g0({rowIndex:Y,column:X,rowPinned:Z});z[G]=!0}if(s(q,J))break;q=K_(this.beans,q)}return{rowPositions:$,cellsToFlash:z}}getCellsToFlashFromRowNodes(_){let f=this.beans.visibleCols.allCols,$={};for(let z=0;z<_.length;z++){let{level:Q,rowIndex:J,rowPinned:q,sibling:X}=_[z],Y=Q===-1?X.rowIndex:J;if(Y==null)continue;for(let Z=0;Z{let{value:E,valueFormatted:U}=this.beans.valueSvc.getValueForDisplay({column:G,node:Z,includeValueFormatted:!0,from:"batch"}),H=U??E??"",W=J.getCallback("processCellForClipboard");if(!W)return H;return W({column:G,node:Z,value:H,type:F2,formatValue:(B)=>this.beans.valueSvc.formatValue(G,Z,B)??B,parseValue:(B)=>this.beans.valueSvc.parseValue(G,Z,B,E)??B})},Y={columnKeys:f,rowPositions:$,skipColumnHeaders:!z,skipColumnGroupHeaders:!Q,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!$,valueFrom:"batch",processCellCallback:J.getCallback("processCellForClipboard"),processRowGroupCallback:X,processHeaderCallback:J.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:J.getCallback("processGroupHeaderForClipboard")};return q.getDataAsCsv(Y,!0)}dispatchFlashCells(_){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:_})},0)}processCell(_,f,$,z,Q,J,q){let{valueSvc:X,formula:Y}=this.beans;if(Q)return Q({column:f,node:_,value:$,type:z,formatValue:(G)=>X.formatValue(f,_??null,G)??G,parseValue:(G)=>X.parseValue(f,_??null,G,X.getValue(f,_,"edit"))});if(J&&f.getColDef().useValueParserForImport!==!1)return X.parseValue(f,_??null,$,X.getValue(f,_,"edit"));if(q&&f.getColDef().useValueFormatterForExport!==!1){if(Y?.isFormula($))return $;return X.formatValue(f,_??null,$)??$}return $}copyDataToClipboard(_){let f=this.gos.getCallback("sendToClipboard");if(f){f({data:_});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(_).catch((z)=>{j(40,{e:z,method:"writeText"}),this.copyDataToClipboardLegacy(_)});return}this.copyDataToClipboardLegacy(_)}copyDataToClipboardLegacy(_){this.executeOnTempElement((f)=>{let $=q_(this.beans),z=d(this.beans);if(f.value=_||" ",f.select(),f.focus({preventScroll:!0}),!$.execCommand("copy"))j(41);if(z?.focus!=null)z.focus({preventScroll:!0})})}executeOnTempElement(_,f){if(!this.gridCtrl)return;let $=q_(this.beans),z=$.createElement("textarea"),Q=z.style;Q.width="1px",Q.height="1px";let J=$.documentElement;Q.top=J.scrollTop+"px",Q.left=J.scrollLeft+"px",Q.position="absolute",Q.opacity="0",this.gridCtrl.getGui().appendChild(z);try{_(z)}catch(X){j(42)}if(f)window.setTimeout(()=>{f(z),z.remove()},100);else z.remove()}},mZ={moduleName:"Clipboard",version:$_,beans:[pV],apiFunctions:{copyToClipboard:NV,cutToClipboard:gV,copySelectedRowsToClipboard:hV,copySelectedRangeToClipboard:uV,copySelectedRangeDown:iV,pasteFromClipboard:mV},dependsOn:[y_,I5,f1,t5]};var cZ=class extends A{constructor(){super(...arguments);this.loadRowDataVersion=0}wireBeans(_){this.environment=_.environment}init(_,f){if(this.params=f,this.comp=_,f.pinned!=null)return;this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)})}onFullWidthRowFocused(_){let f=this.params,$={rowIndex:f.node.rowIndex,rowPinned:f.node.rowPinned},z={rowIndex:_.rowIndex,rowPinned:_.rowPinned};if(!s($,z))return;F_(this.comp.getGui(),_.fromBelow)}setAutoHeightClasses(){let _=this.gos.get("detailRowAutoHeight"),f=_?"ag-details-row-auto-height":"ag-details-row-fixed-height",$=_?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",z=this.comp;z.toggleCss(f,!0),z.toggleDetailGridCss($,!0)}setupRefreshStrategy(){let _=this.params.refreshStrategy;if(_=="everything"||_=="nothing"||_=="rows"){this.refreshStrategy=_;return}if(_!=null)j(170,{providedStrategy:_});this.refreshStrategy="rows"}createDetailGrid(){let{params:_,gos:f}=this;if(n(_.detailGridOptions)){j(171);return}let $=f.get("theme"),z=_.detailGridOptions.theme;if(z&&z!==$)j(267);let Q={themeStyleContainer:this.environment.eStyleContainer,..._.detailGridOptions,theme:$};if(f.get("detailRowAutoHeight"))Q.domLayout="autoHeight";this.comp.setDetailGrid(Q)}registerDetailWithMaster(_){let{params:f,beans:{selectionSvc:$,findSvc:z,expansionSvc:Q}}=this,J=f.node.id,q=f.api,X={id:J,api:_},Y=f.node;if(q.isDestroyed())return;q.addDetailGridInfo(J,X),Y.detailGridInfo=X;let Z=Y.parent;z?.registerDetailGrid(Y,_);function G(){if(Z)$?.refreshMasterNodeState(Z)}function E({source:H}){if(H==="expandAll")return _.expandAll();if(H==="collapseAll")return _.collapseAll()}function U({node:H,source:W}){if(H!==Z||W==="masterDetail"||_.isDestroyed())return;$?.setDetailSelectionState(Z,f.detailGridOptions,_)}_.addEventListener("firstDataRendered",()=>{if(_.isDestroyed()||q.isDestroyed())return;$?.setDetailSelectionState(Z,f.detailGridOptions,_),_.addEventListener("selectionChanged",G),q.addEventListener("rowSelected",U);let W=`${"CsrmSsrmSharedApi"}Module`;if(_.isModuleRegistered(W))q.addEventListener("expandOrCollapseAll",E),Q?.setDetailsExpansionState(_)}),this.addManagedListeners(Z,{masterChanged:(H)=>{if(!H.node.master)this.onDestroy(X)}}),this.addDestroyFunc(()=>this.onDestroy(X))}onDestroy(_){let{params:f}=this,$=f.node,z=f.api;if($.detailGridInfo!==_)return;if(!z.isDestroyed())z.removeDetailGridInfo($.id);$.detailGridInfo=null}loadRowData(){this.loadRowDataVersion++;let _=this.loadRowDataVersion,f=this.params;if(f.detailGridOptions?.rowModelType==="serverSide"){f.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}let $=f.getDetailRowData;if(!$){j(172);return}let z=(J)=>{if(this.loadRowDataVersion===_)this.comp.setRowData(J)},Q={node:f.node,data:f.node.data,successCallback:z,context:C(this.gos,{}).context};$(Q)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},nV=class{constructor(_){this.parentWrapper=_}wrap(_,f,$,z){return this.parentWrapper.wrap(_,f,$,z)}},dV={tag:"div",cls:"ag-details-row"},tV={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},rV=class extends w{constructor(){super(...arguments);this.eDetailGrid=V}wireBeans(_){this.context=_.context}init(_){this.params=_,this.selectAndSetTemplate();let f={toggleCss:($,z)=>this.toggleCss($,z),toggleDetailGridCss:($,z)=>this.eDetailGrid.classList.toggle($,z),setDetailGrid:($)=>this.setDetailGrid($),setRowData:($)=>this.setRowData($),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new cZ),this.ctrl.init(f,_)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){let _=this.params;if(_.pinned){this.setTemplate(dV);return}let f=()=>{this.setTemplate(tV)};if(n(_.template))f();else if(typeof _.template==="string")this.setTemplate(_.template,[]);else if(typeof _.template==="function"){let $=_.template,z=$(_);this.setTemplate(z,[])}else j(168),f();if(this.eDetailGrid==null)j(169)}setDetailGrid(_){if(!this.eDetailGrid)return;let f=this.context.getBean("frameworkCompWrapper"),$=new nV(f),{frameworkOverrides:z}=this.beans,Q=b$(this.eDetailGrid,_,{frameworkOverrides:z,providedBeanInstances:{frameworkCompWrapper:$},modules:Rq(this.params.api.getGridId(),_.rowModelType??"clientSide")});this.detailApi=Q,this.ctrl?.registerDetailWithMaster(Q),this.addDestroyFunc(()=>{Q.destroy()})}setRowData(_){this.detailApi?.setGridOption("rowData",_)}};function xQ(_,f){let $=_.masterDetailSvc?.store;return $?f($):void 0}function lV(_,f,$){xQ(_,(z)=>{z[f]=$})}function sV(_,f){xQ(_,($)=>{delete $[f]})}function aV(_,f){return xQ(_,($)=>$[f])}function oV(_,f){xQ(_,($)=>{let z=0;Object.values($).forEach((Q)=>{if(Q)f(Q,z++)})})}var eV=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}",_O=class extends A{constructor(){super(...arguments);this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){let _=this.gos;if(o(_))this.enabled=this.isEnabled();if(Kf(_))this.addEventListeners()}addEventListeners(){let _=(z)=>{this.setMaster(z.node,!1,!0)},f,$=()=>{if(f){for(let z of f)z();f=void 0}if(this.isEnabled())f=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:_})};$(),this.gos.addPropertyEventListener("masterDetail",$)}refreshModel(_){if(_.changedProps){let f=this.isEnabled();if(this.enabled!==f){this.setMasters(null);return}}if(_.rowDataUpdated)this.setMasters(_.changedRowNodes)}setMaster(_,f,$){let z=_.master,Q=this.isEnabled(),J=Q,q=this.gos,X=q.get("isRowMaster"),Y=q.get("treeData");if(Q)if(f||$){if(X){let Z=_.data;J=!!Z&&!!X(Z)}}else J=z;if(!Y){if(J&&f||!J&&z)_._expanded??(_._expanded=null)}if(J!==z)_.master=J,_.dispatchRowEvent("masterChanged")}setMasters(_){if(this.enabled=this.isEnabled(),_){for(let f of _.updates)this.setMaster(f,!1,!0);for(let f of _.adds)this.setMaster(f,!0,!1)}else{let f=kJ(this.beans)?.rootNode?._leafs;if(f)for(let $=0,z=f.length;${let q=f.clientHeight;if(q!=null&&q>0){let X=()=>{let{rowModel:Y}=this.beans,{rowNode:Z}=_;if(Z.setRowHeight(q),o($,Y)||Kf($,Y))Y.onRowHeightChanged()};window.setTimeout(X,0)}},J=S0(z,f,Q);_.addDestroyFunc(J),Q()}destroy(){this.store={},super.destroy()}},fO={moduleName:"SharedMasterDetail",version:$_,beans:[_O],userComponents:{agDetailCellRenderer:rV},dynamicBeans:{detailCellRendererCtrl:cZ},apiFunctions:{addDetailGridInfo:lV,removeDetailGridInfo:sV,getDetailGridInfo:aV,forEachDetailGridInfo:oV},dependsOn:[y_,gZ,uZ],css:[eV]},pZ={moduleName:"MasterDetail",version:$_,dependsOn:[fO,wQ,d5]},nZ=class extends w{constructor(){super(...arguments);this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:(_)=>{let f=!1;if(!this.dragging)f=!0,this.dragging=!0,T1(this.beans).classList?.add(this.getDraggingCssClass());if(this.updateValuesOnMove(_),f){this.changedCalculatedValues=!1;return}if(this.beans.rangeSvc.autoScrollService.check(_),this.changedCalculatedValues)this.onDrag(_),this.changedCalculatedValues=!1},onDragStop:(_)=>{this.dragging=!1,this.onDragEnd(_),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:TY,mousedown:TY})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(_){let f=CJ(this.gos,_);if(!f||this.shouldSkipCell(f)||this.lastCellHovered&&C1(f,this.lastCellHovered))return;this.lastCellHovered=f,this.changedCalculatedValues=!0}clearDragProperties(){if(this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),T1(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging)this.destroy()}getType(){return this.type}refresh(_,f){let $=this.cellCtrl,z=this.getGui(),Q=f??b(this.beans.rangeSvc.getCellRanges()),J=Q.startRow,q=Q.endRow;if(J&&q)if(Y_(q,J))this.rangeStartRow=q,this.rangeEndRow=J;else this.rangeStartRow=J,this.rangeEndRow=q;if($!==_||!A_(z)){this.cellCtrl=_;let X=_.comp.getParentOfValue();if(X)X.appendChild(z)}this.cellRange=Q}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){N(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(_){if(!this.cellRange)return;let{id:f,type:$}=this.cellRange;if(!f||f!==_.id)return;let z=this.beans.rangeSvc?.getCellRanges().find((Q)=>Q.id===f&&Q.type===$);if(z&&z!==this.cellRange)this.cellRange=z}},TY=(_)=>{_.stopPropagation()};function $O(_){let f=_.length,$=0;if(f<=1)return _;for(let E=0;E<_.length;E++){let U=_[E],H=U.toString().split("e-");if(H.length>1){$=Math.max($,parseInt(H[1],10));continue}if(Math.floor(U)===U)continue;$=Math.max($,U.toString().split(".")[1].length)}let z=0,Q=0,J=0,q=0,X=0;for(let E=0;Eq?"x":"y";else Y=X;if(Y!==this.dragAxis)this.dragAxis=Y,this.changedCalculatedValues=!0}shouldSkipCell(_){return I_(_.column)}onDrag(_){if(!this.initialPosition){let $=this.cellCtrl;if(!$)return;this.initialPosition=$.cellPosition}let f=this.getLastCellHovered();if(f)this.markPathFrom(this.initialPosition,f)}onDragEnd(_){if(this.initialXY=null,!this.markedCells.length)return;let f=this.dragAxis==="x",{cellRange:$,rangeStartRow:z,rangeEndRow:Q,beans:{rangeSvc:J}}=this,q=$.columns.length,X;if(!this.isUp&&!this.isLeft)X=J.createCellRangeFromCellRangeParams({rowStartIndex:z.rowIndex,rowStartPinned:z.rowPinned,columnStart:$.columns[0],rowEndIndex:f?Q.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:f?Q.rowPinned:this.lastCellMarked.rowPinned,columnEnd:f?this.lastCellMarked.column:$.columns[q-1]});else{let Y=f?z:this.lastCellMarked;X=J.createCellRangeFromCellRangeParams({rowStartIndex:Y.rowIndex,rowStartPinned:Y.rowPinned,columnStart:f?this.lastCellMarked.column:$.columns[0],rowEndIndex:Q.rowIndex,rowEndPinned:Q.rowPinned,columnEnd:$.columns[q-1]})}if(X)this.performFill({event:_,initialRange:$,finalRange:X,shouldUpdateRange:!0})}onDragCancel(){if(this.initialXY=null,!this.markedCells.length)return;this.clearMarkedPath()}performFill({event:_,initialRange:f,finalRange:$,shouldUpdateRange:z}){let{eventSvc:Q,rangeSvc:J}=this.beans;if(Q.dispatchEvent({type:"fillStart"}),this.handleValueChanged(f,$,_),z)J.setCellRanges([$]);Q.dispatchEvent({type:"fillEnd",initialRange:f,finalRange:$})}getFillHandleDirection(){let _=rz(this.gos)?.direction;if(!_)return"xy";if(_!=="x"&&_!=="y"&&_!=="xy")return j(177),"xy";return _}handleValueChanged(_,f,$){let{beans:z}=this,{rangeSvc:Q,gos:J,valueSvc:q}=z,X=Q.getRangeEndRow(_),Y=Q.getRangeStartRow(_),Z=Q.getRangeEndRow(f),G=Q.getRangeStartRow(f),E=this.dragAxis==="y";if(this.isReduce&&!rz(J)?.suppressClearOnFillReduction){let R=E?_.columns:_.columns.filter((I)=>f.columns.indexOf(I)<0),O=E?K_(z,Z):G;if(O)this.clearCellsInRange(O,X,R);return}let U=[],H=[],W=[],B=[],K=!0,L=0,F=()=>{U.length=0,H.length=0,W.length=0,B.length=0,L=0},D=(R,O)=>{let I=this.isUp?X:Y,T=!1;if(E)K=!0,F();while(!T&&I){let y=D_(z,I);if(!y)break;if(E&&R)M(U,R,y,()=>!s(I,this.isUp?Y:X));else if(O){K=!0,F();for(let i of O)M(U,i,y,()=>i!==(this.isLeft?_.columns[0]:b(_.columns)))}T=s(I,this.isUp?G:Z),I=this.isUp?m_(this.beans,I):K_(z,I)}},M=(R,O,I,T)=>{let y,i=!1;if(K)y=q.getValue(O,I,"edit"),H.push(y),W.push(q.getValue(O,I,"edit",!0)),B.push(q.getValueForDisplay({column:O,node:I,from:"edit"}).valueFormatted),K=T();else{let{value:x,fromUserFunction:a,sourceCol:t,sourceRowNode:u}=this.processValues({event:$,values:R,initialValues:H,initialNonAggregatedValues:W,initialFormattedValues:B,col:O,rowNode:I,idx:L++});if(y=x,O.isCellEditable(I)){let __=q.getValue(O,I,"edit");if(!a){if(t){let r=t.getColDef();if(r.useValueFormatterForExport!==!1&&r.valueFormatter){let O_=q.getValueForDisplay({column:t,node:u,includeValueFormatted:!0,from:"edit"}).valueFormatted;if(O_!=null)y=O_}}if(O.getColDef().useValueParserForImport!==!1)y=q.parseValue(O,I,t?y:$$(y),__)}if(!a||__!==y)I.setDataValue(O,y,"rangeSvc");else i=!0}}if(!i)R.push({value:y,column:O,rowNode:I})},{changeDetectionSvc:k}=this.beans;k?.beginDeferred();try{if(E)_.columns.forEach((R)=>{D(R)});else{let R=this.isLeft?[...f.columns].reverse():f.columns;D(void 0,R)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{k?.endDeferred()}}clearCellsInRange(_,f,$){let z={startRow:_,endRow:f,columns:$,startColumn:$[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[z],restoreSourceInBatch:!0})}processValues(_){let{formula:f,valueSvc:$}=this.beans,{event:z,values:Q,initialValues:J,initialNonAggregatedValues:q,initialFormattedValues:X,col:Y,rowNode:Z,idx:G}=_,E=rz(this.gos)?.setFillValue,U=this.dragAxis==="y",H;if(U)H=this.isUp?"up":"down";else H=this.isLeft?"left":"right";if(E){let K=C(this.gos,{event:z,values:Q.map(({value:F})=>F),initialValues:J,initialNonAggregatedValues:q,initialFormattedValues:X,currentIndex:G,currentCellValue:$.getValue(Y,Z,"edit"),direction:H,column:Y,rowNode:Z}),L=E(K);if(L!==!1)return{value:L,fromUserFunction:!0}}let W=(K)=>typeof K==="number"&&Number.isFinite(K)||typeof K==="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(K.trim()),B=Q.every(({value:K})=>W(K));if(z.altKey||!B){let K=String(b(Q)?.value??"");if(B&&J.length===1){let R=this.isUp||this.isLeft?-1:1;return{value:parseFloat(K)+1*R,fromUserFunction:!1}}let{value:L,column:F,rowNode:D}=Q[G%Q.length],M,k=F.isAllowFormula()&&f?.isFormula(K);if(k){let R=H==="up"?-1:H==="down"?1:0,O=H==="left"?-1:H==="right"?1:0;M=f.updateFormulaByOffset({value:K,rowDelta:R,columnDelta:O})}else M=L;return{value:M,fromUserFunction:!1,sourceCol:k?void 0:F,sourceRowNode:D}}return{value:b($O(Q.map(({value:K})=>Number(K)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(let _ of this.markedCells){if(!_.isAlive())continue;let{comp:f}=_;f.toggleCss("ag-selection-fill-top",!1),f.toggleCss("ag-selection-fill-right",!1),f.toggleCss("ag-selection-fill-bottom",!1),f.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(_,f){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(s(f,_))return;let $=Y_(f,_),{rangeStartRow:z,rangeEndRow:Q}=this;if($&&(f.rowPinned==z.rowPinned&&f.rowIndex>=z.rowIndex||z.rowPinned!=Q.rowPinned&&f.rowPinned==Q.rowPinned&&f.rowIndex<=Q.rowIndex))this.reduceVertical(_,f),this.isReduce=!0;else this.extendVertical(_,f,$),this.isReduce=!1}else{let $=_.column,z=f.column;if($===z)return;let Q=this.beans.visibleCols.allCols,J=Q.indexOf($),q=Q.indexOf(z);if(q<=J&&q>=Q.indexOf(this.cellRange.columns[0]))this.reduceHorizontal(_,f),this.isReduce=!0;else this.extendHorizontal(_,f,q=4),_.toggleCss(ZO,J),l6(z,Q>0?!0:void 0),_.toggleCss(GO,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){let _=this.getRangeBorders(),f=this.isSingleCell(),$=!f&&_.top,z=!f&&_.right,Q=!f&&_.bottom,J=!f&&_.left,q=this.cellComp;q.toggleCss(UO,$),q.toggleCss(HO,z),q.toggleCss(WO,Q),q.toggleCss(BO,J)}isSingleCell(){let{rangeSvc:_}=this;return this.rangeCount===1&&!!_&&!_.isMoreThanOneCell()}getHasChartRange(){let{rangeSvc:_}=this;if(!this.rangeCount||!_)return!1;let f=_.getCellRanges();return f.length>0&&f.every(($)=>[N0.DIMENSION,N0.VALUE].includes($.type))}updateRangeBordersIfRangeCount(){if(this.rangeCount>0)this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}getRangeBorders(){let _=this.beans.gos.get("enableRtl"),f=!1,$=!1,z=!1,Q=!1,{rangeSvc:J,beans:{visibleCols:q},cellCtrl:{cellPosition:X}}=this,Y=X.column,Z=J.getCellRanges().filter((U)=>J.isCellInSpecificRange(X,U));if(!Z.length)return{top:f,right:$,bottom:z,left:Q};let G,E;if(_)G=q.getColAfter(Y),E=q.getColBefore(Y);else G=q.getColBefore(Y),E=q.getColAfter(Y);if(!G)Q=!0;if(!E)$=!0;for(let U=0;U=0;z--){let Q=$[z],J=Q.colorClass;if(!J)continue;if(_.isCellInSpecificRange(this.cellCtrl.cellPosition,Q))return J}return null}refreshHandleColor(_){let f=this.selectionHandle?.getGui?.(),$=_?.colorClass??null;if(!f){this.handleColorClass=null;return}if(this.handleColorClass&&this.handleColorClass!==$)f.classList.remove(this.handleColorClass);if($)f.classList.add($);else if(this.handleColorClass)f.classList.remove(this.handleColorClass);this.handleColorClass=$??null}getRangeForHandle(){let{gos:_,editSvc:f}=this.beans,$=this.rangeSvc,z=$.getCellRanges(),Q=z.length;if(this.rangeCount<1||Q<1)return null;let J=f?.isRangeSelectionEnabledWhileEditing(),q=J?z:[b(z)];for(let X of q){let{cellPosition:Y,column:Z}=this.cellCtrl,G=bY(_)&&!Z.isSuppressFillHandle(),E=KO(_),H=!f?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(J||Q===1&&(G||E));if(this.hasChartRange)H=X.type===N0.VALUE;if(H&&X.endRow!=null&&$.isContiguousRange(X)&&$.isBottomRightCell(X,Y))return X}return null}addSelectionHandle(_){let{beans:f}=this,$=f.editSvc?.isRangeSelectionEnabledWhileEditing(),z=_.type,J=!$&&bY(f.gos)&&n(z)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==J)this.selectionHandle=f.context.destroyBean(this.selectionHandle);if(!this.selectionHandle){let q=f.registry.createDynamicBean(J===0?"fillHandle":"rangeHandle",!1);if(q)this.selectionHandle=f.context.createBean(q)}this.selectionHandle?.refresh(this.cellCtrl,_)}destroy(){this.unsetComp()}},FO=class extends A{constructor(_){super();this.eContainer=_}postConstruct(){let{beans:_,gos:f,eContainer:$}=this,z=_.rangeSvc,Q={eElement:$,onDragStart:z.onDragStart.bind(z),onDragStop:z.onDragStop.bind(z),onDragging:z.onDragging.bind(z)},J=_.dragSvc,q=J.addDragSource.bind(J,Q),X=J.removeDragSource.bind(J,Q);if(this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(i_(f))q();else X()}),this.addDestroyFunc(X),i_(f))q()}},DO=class extends A{constructor(_,f){super();this.column=_,this.eGui=f}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(_)=>_&&this.onClick(_)})}onClick(_){this.beans.rangeSvc?.handleColumnSelection(this.column,_)}},MO=class extends A{constructor(_,f){super();this.column=_,this.comp=f,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let _;if(this.column.isColumn)_=[this.column];else _=this.column.getDisplayedLeafColumns();for(let f of _)this.columnMap.set(f,!1)}refreshActive(){let{gos:_,rangeSvc:f}=this.beans,$=_.get("cellSelection");this.isActive=!!($&&f&&typeof $==="object"&&$.enableHeaderHighlight)}setupRangeHeaderHighlight(){let _=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:_,columnPinned:_,columnMoved:_,columnGroupOpened:_}),_()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();let _=this.beans.rangeSvc.getCellRanges(),f=!1,$=!0;for(let z of _){if(f)break;for(let Q of z.columns)if(this.columnMap.has(Q))this.columnMap.set(Q,!0),f||(f=!0)}for(let z of Array.from(this.columnMap.values()))if(z===!1){$=!1;break}this.comp.toggleCss("ag-header-range-highlight",f&&$)}destroy(){super.destroy(),this.comp=null,this.column=null}},kO=class extends A{constructor(){super(...arguments);this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(_){this.rowModel=_.rowModel,this.dragSvc=_.dragSvc,this.colModel=_.colModel,this.visibleCols=_.visibleCols,this.cellNavigation=_.cellNavigation,this.ctrlsSvc=_.ctrlsSvc}postConstruct(){let _=this.onColumnsChanged.bind(this),f=()=>this.removeAllCellRanges(),$=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:_,columnVisible:_,columnValueChanged:_,columnPivotModeChanged:f,columnRowGroupChanged:f,columnPivotChanged:f,columnGroupOpened:$,columnMoved:$,columnPinned:$}),this.ctrlsSvc.whenReady(this,(z)=>{let Q=z.gridBodyCtrl;this.autoScrollService=new JQ({scrollContainer:Q.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>Q.scrollFeature.getVScrollPosition().top,setVerticalPosition:(J)=>Q.scrollFeature.setVerticalScrollPosition(J),getHorizontalPosition:()=>Q.scrollFeature.getHScrollPosition().left,setHorizontalPosition:(J)=>Q.scrollFeature.setHorizontalScrollPosition(J),shouldSkipVerticalScroll:()=>!S_(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!Q.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(_){if(this.rangeSelectionExtensions.includes(_))return;this.rangeSelectionExtensions.push(_)}unregisterRangeSelectionExtension(_){Q_(this.rangeSelectionExtensions,_)}shouldSuppressRangeSelection(_){return this.rangeSelectionExtensions.some((f)=>f.shouldSuppressRangeSelection?.(_))}shouldSkipColumn(_){return this.rangeSelectionExtensions.some((f)=>f.shouldSkipColumn?.(_))}isAllColumnsSelectionCell(_){return this.rangeSelectionExtensions.some((f)=>f.isAllColumnsSelectionCell?.(_))}isAllColumnsRange(_,f){return this.rangeSelectionExtensions.some(($)=>$.isAllColumnsRange?.(_,f))}updateSelectionModeForCell(_){this.setSelectionMode(this.isAllColumnsSelectionCell(_))}onDragStart(_){let f=this.gos,$=_.target;if(!i_(f)||IJ(f,$)?.isSuppressMouseEvent(_))return;if(this.shouldSuppressRangeSelection($))return;let{shiftKey:z}=_,Q=this.isMultiRange(_),J=z&&!!this.cellRanges?.length;if(!Q&&(!J||v(b(this.cellRanges).type)))this.removeAllCellRanges(!0);let q=this.dragSvc.startTarget;if(q)this.updateValuesOnMove(q);if(!this.lastCellHovered)return;if(this.dragging=!0,this.lastMouseEvent=_,this.intersectionRange=Q&&this.getCellRangeCount(this.lastCellHovered)>1,!J)this.setNewestRangeStartCell(this.lastCellHovered);if(this.cellRanges.length>0)this.draggingRange=b(this.cellRanges);else{let X={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},Y=this.getColumnsFromModel([this.lastCellHovered.column]);if(!Y?.length)return;this.draggingRange={startRow:X,endRow:X,columns:Y,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}onDragging(_){let{dragging:f,lastCellHovered:$,newestRangeStartCell:z,autoScrollService:Q,cellHasChanged:J}=this;if(!f||!_)return;this.updateValuesOnMove(_.target),this.lastMouseEvent=_;let q=(H)=>$&&$.rowPinned===H&&z.rowPinned===H,X=q("top")||q("bottom");if(Q.check(_,X),!J||!$)return;let Y=z?.column,Z=$?.column,G=this.calculateColumnsBetween(Y,Z);if(!G)return;let{rowIndex:E,rowPinned:U}=$;this.draggingRange.endRow={rowIndex:E,rowPinned:U},this.draggingRange.columns=G,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;let{id:_}=this.draggingRange;if(this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange)this.intersectionRange=!1,this.intersectLastRange();this.dispatchChangedEvent(!1,!0,_)}onColumnsChanged(){this.refreshLastRangeStart();let _=this.visibleCols.allCols;for(let $ of this.cellRanges){let z=$.columns;if($.columns=$.columns.filter((J)=>J.isVisible()&&_.indexOf(J)!==-1),!J_(z,$.columns))this.dispatchChangedEvent(!1,!0,$.id)}let f=this.cellRanges.length;if(this.cellRanges=this.cellRanges.filter(($)=>$.columns.length>0),f>this.cellRanges.length)this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){let _=b(this.cellRanges);if(!_)return;this.refreshRangeStart(_)}isContiguousRange(_){let f=_.columns;if(!f.length)return!1;let $=this.visibleCols.allCols,z=f.map((Q)=>$.indexOf(Q)).sort((Q,J)=>Q-J);return b(z)-z[0]+1===f.length}getRangeStartRow(_){if(_.startRow&&_.endRow)return Y_(_.startRow,_.endRow)?_.startRow:_.endRow;return{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(_){if(_.startRow&&_.endRow)return Y_(_.startRow,_.endRow)?_.endRow:_.startRow;let f=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;if(f>0)return{rowIndex:f-1,rowPinned:"bottom"};return{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(_){let f=this.beans,$=this.getRangeStartRow(_),z=this.getRangeEndRow(_),Q=AJ(f,$);return AJ(f,z)-Q+1}handleCellMouseDown(_,f){let $=_.ctrlKey||_.metaKey;this.handleCellSelectionInput(f,{target:_.target,shiftKey:_.shiftKey,isRightClick:ZJ(this.beans,_),isMultiRange:this.isMultiRange(_),isMultiKey:$,preventDefault:()=>_.preventDefault()})}handleCellKeyboardSelect(_,f){let $=_.ctrlKey||_.metaKey;this.handleCellSelectionInput(f,{target:_.target,shiftKey:_.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState($),isMultiKey:$,preventDefault:()=>_.preventDefault()})}handleCellSelectionInput(_,f){let{target:$,shiftKey:z,isRightClick:Q,isMultiRange:J,isMultiKey:q,preventDefault:X}=f;if(this.shouldSuppressRangeSelection($))return;let Y=this.isAllColumnsSelectionCell(_);if(Y)X();if(z)return this.extendLatestRangeToCell(_);if(Y&&Q)return;this.updateSelectionModeForCell(_);let Z=this.calculateColumnsBetween(_.column,_.column);if(!Z)return;let G=Y?this.findContainingRange({columns:Z,startRow:_,endRow:_}):void 0;if(Y&&!!G&&J&&q&&G)this.removeRowFromAllColumnsRange(_,G);else this.setRangeToCell(_,J)}isMultiRange(_){return this.isMultiRangeForKeyState(_.ctrlKey||_.metaKey)}isMultiRangeForKeyState(_){let{editingWithRanges:f,allowMulti:$}=this.getMultiRangeContext();return f||($?_:!1)}getMultiRangeContext(){let{gos:_,editSvc:f}=this.beans,$=!!f?.isEditing()&&!!f?.isRangeSelectionEnabledWhileEditing(),z=xq(_)&&!$;return{editingWithRanges:$,suppressMultiRanges:z,allowMulti:!z}}removeRowFromAllColumnsRange(_,f){let{beans:$,cellRanges:z}=this,Q=O1($),J=Wf($),q=this.getRangeStartRow(f),X=this.getRangeEndRow(f);if(!q&&s(Q,_))DQ(f,K_($,Q),"top");else if(!X&&s(J,_))DQ(f,m_($,J),"bottom");else if(s(q,X))Q_(z,f);else if(s(q,_))DQ(f,K_($,_),"top");else if(s(X,_))DQ(f,m_($,_),"bottom");else{let Y=m_($,_),Z=K_($,_);f.startRow=q,f.endRow=Y??void 0,z.push({...f,startRow:Z??void 0,endRow:X})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(_,f=!1){let{gos:$}=this;if(!i_($))return;this.updateSelectionModeForCell(_);let z=this.calculateColumnsBetween(_.column,_.column);if(!z)return;let{suppressMultiRanges:Q}=this.getMultiRangeContext();if(Q||!f||n(this.cellRanges))this.removeAllCellRanges(!0);let J={rowIndex:_.rowIndex,rowPinned:_.rowPinned},q={startRow:J,endRow:J,columns:z,startColumn:_.column},X=this.ensureRangeStartColumn(q);if(!X)return;this.cellRanges.push(q),this.setNewestRangeStartCell({..._,column:X}),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(_){let f=_.columns[0],$=b(_.columns);return this.newestRangeStartCell?.column===f?$:f}extendRangeRowCountBy(_,f){let{beans:$}=this,{startRow:z,endRow:Q}=_;if(!z||!Q)return;let J=0,q,X=Y_(Q,z);if(X)q=z;else q=Q;let Y=f>0?K_:m_,Z=Math.abs(f);while(Jf.indexOf(z)).filter((z)=>z>-1).sort((z,Q)=>z-Q);return{left:f[$[0]],right:f[b($)]}}extendLatestRangeInDirection(_){if(this.isEmpty()||!this.newestRangeStartCell)return;let f=_.key,$=_.ctrlKey||_.metaKey,z=b(this.cellRanges),Q=this.newestRangeStartCell,J=z.endRow.rowIndex,q=z.endRow.rowPinned,Y={column:this.getRangeLastColumn(z),rowIndex:J,rowPinned:q},Z=this.cellNavigation.getNextCellToFocus(f,Y,$);if(!Z)return;if(this.shouldSkipColumn(Z.column))return;return this.setCellRange({rowStartIndex:Q.rowIndex,rowStartPinned:Q.rowPinned,rowEndIndex:Z.rowIndex,rowEndPinned:Z.rowPinned,columnStart:Q.column,columnEnd:Z.column}),Z}setCellRange(_){if(!i_(this.gos))return;this.removeAllCellRanges(!0),this.addCellRange(_)}setCellRanges(_){if(J_(this.cellRanges,_))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);let f=this.getColumnsFromModel(this.visibleCols.allCols)??[],$=!1;for(let z of _){if(z.columns&&z.startRow){let Q=this.getColumnsFromModel(z.columns);if(!Q||Q.length===0)continue;z.columns=Q;let{startRow:J}=z;this.setNewestRangeStartCell({rowIndex:J.rowIndex,rowPinned:J.rowPinned,column:z.columns[0]})}if(!$&&f.length>0&&this.isAllColumnsRange(z,f))$=!0;this.cellRanges.push(z)}this.setSelectionMode($),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(_){let{beans:f,eventSvc:$}=this,{cellEventSource:z="rangeSvc",dispatchWrapperEvents:Q,wrapperEventSource:J="deleteKey",restoreSourceInBatch:q}=_,{cellRanges:X}=_;if(Q)$.dispatchEvent({type:"cellSelectionDeleteStart",source:J}),$.dispatchEvent({type:"rangeDeleteStart",source:J});if(!X)X=this.cellRanges;let{valueSvc:Y,editSvc:Z}=f,G=!!Z?.isBatchEditing(),{changeDetectionSvc:E}=f;E?.beginDeferred();try{this.forEachEditableCellInRanges(X,(U,H)=>{if(q&&G){Z?.batchResetToSourceValue({rowNode:U,column:H});return}let W=Y.getDeleteValue(H,U);U.setDataValue(H,W,z)})}finally{E?.endDeferred()}if(Q)$.dispatchEvent({type:"cellSelectionDeleteEnd",source:J}),$.dispatchEvent({type:"rangeDeleteEnd",source:J})}createCellRangeFromCellRangeParams(_){return this.createPartialCellRangeFromRangeParams(_,!1)}createPartialCellRangeFromRangeParams(_,f){let{columns:$,columnStart:z,columnEnd:Q,rowStartIndex:J,rowStartPinned:q,rowEndIndex:X,rowEndPinned:Y}=_,Z=this.getColumnsFromParams($,z,Q);if(!Z||!f&&Z.columns.length===0)return;let{columns:G,startsOnTheRight:E}=Z,U=CY(J,q),H=CY(X,Y);return{startRow:U,endRow:H,columns:G,startColumn:this.getColumnFromModel(z)??(E?b(G):G[0])}}addCellRange(_){let f=this.gos;if(!i_(f)||!this.verifyCellRanges(f))return;this.setSelectionMode(!1);let $=this.createCellRangeFromCellRangeParams(_);if($){if($.startRow)this.setNewestRangeStartCell({rowIndex:$.startRow.rowIndex,rowPinned:$.startRow.rowPinned,column:$.startColumn});return this.cellRanges.push($),this.dispatchChangedEvent(!1,!0,$.id),$}}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){let _=this.cellRanges.length;if(_===0)return!1;if(_>1)return!0;let f=this.cellRanges[0],$=this.getRangeStartRow(f),z=this.getRangeEndRow(f);return $.rowPinned!==z.rowPinned||$.rowIndex!==z.rowIndex||f.columns.length!==1}areAllRangesAbleToMerge(){let _=new Map;if(this.cellRanges.length<=1)return!0;for(let z of this.cellRanges)this.forEachRowInRange(z,(Q)=>{let J=`${Q.rowPinned||"normal"}_${Q.rowIndex}`,q=_.get(J),X=z.columns.map((Y)=>Y.getId());if(q){let Y=X.filter((Z)=>q.indexOf(Z)===-1);q.push(...Y)}else _.set(J,X)});let $;for(let z of _.values()){let Q=z.sort().join();if($===void 0){$=Q;continue}if($!==Q)return!1}return!0}removeAllCellRanges(_){if(this.isEmpty())return;if(this.onDragStop(),this.cellRanges.length=0,!_)this.dispatchChangedEvent(!1,!0)}isCellInAnyRange(_){return this.getCellRangeCount(_)>0}isCellInSpecificRange(_,f){let $=f.columns?.includes(_.column),z=this.isRowInRange(_,f);return $&&z}isColumnInAnyRange(_){let{beans:f}=this,$=O1(f),z=Wf(f);if(!$||!z)return!1;let Q=_.isColumn?[_]:_.getDisplayedLeafColumns();return this.findContainingRange({columns:Q,startRow:$,endRow:z},!0)!=null}findContainingRange({columns:_,startRow:f,endRow:$},z=!1){let Q=this.cellRanges;for(let J=Q.length-1;J>=0;J--){let q=Q[J],X=_.every((Z)=>q.columns.includes(Z)),Y=!1;if(z)Y=s(q.startRow,f)&&s(q.endRow,$);else{let Z=f&&this.isRowInRange(f,q),G=$&&this.isRowInRange($,q);Y=!!Z&&!!G}if(X&&Y)return q}}isBottomRightCell(_,f){let $=this.visibleCols.allCols,z=_.columns.map((Z)=>$.indexOf(Z)).sort((Z,G)=>Z-G),{startRow:Q,endRow:J}=_,q=Y_(Q,J)?J:Q,X=$.indexOf(f.column)===b(z),Y=f.rowIndex===q.rowIndex&&T0(f.rowPinned)===T0(q.rowPinned);return X&&Y}getCellRangeCount(_){return this.cellRanges.filter((f)=>this.isCellInSpecificRange(_,f)).length}isRowInRange(_,f){let $=this.getRangeStartRow(f),z=this.getRangeEndRow(f),Q=s(_,$),J=s(_,z);if(Q||J)return!0;let q=!Y_(_,$),X=Y_(_,z);return q&&X}intersectLastRange(_){let{editingWithRanges:f,suppressMultiRanges:$}=this.getMultiRangeContext();if(f||$||_&&this.dragging||this.isEmpty())return;let z=b(this.cellRanges),Q=this.getRangeStartRow(z),J=this.getRangeEndRow(z),q=[];for(let X of this.cellRanges.slice(0,-1)){let Y=this.getRangeStartRow(X),Z=this.getRangeEndRow(X),G=X.columns,E=G.filter((H)=>z.columns.indexOf(H)===-1);if(E.length===G.length){q.push(X);continue}if(Y_(J,Y)||Y_(Z,Q)){q.push(X);continue}let U=q.length;if(Y_(Y,Q)){let H={columns:[...G],startColumn:z.startColumn,startRow:{...Y},endRow:m_(this.beans,Q)};q.push(H)}if(E.length>0){let H={columns:E,startColumn:E.includes(z.startColumn)?z.startColumn:E[0],startRow:SO([{...Q},{...Y}]),endRow:AO([{...J},{...Z}])};q.push(H)}if(Y_(J,Z))q.push({columns:[...G],startColumn:z.startColumn,startRow:K_(this.beans,J),endRow:{...Z}});if(q.length-U===1)q[q.length-1].id=X.id}if(this.cellRanges=q,_)this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(_,f,$){_.createManagedBean(new MO(f,$))}setSelectionMode(_){this.selectionMode=_?1:0}refreshRangeStart(_){let{columns:f}=_,$=this.ensureRangeStartColumn(_);if(!$)return;let z=(Y,Z)=>{let G=_.columns.filter((E)=>E!==Y);if(Y)_.startColumn=Y,_.columns=Z?[Y,...G]:[...G,Y];else _.columns=G},{left:Q,right:J}=this.getRangeEdgeColumns(_);if($===f[0]&&$!==Q){z(Q,!0);return}if($===b(f)&&$===J)z(J,!1)}setNewestRangeStartCell(_){this.newestRangeStartCell=_}getColumnsFromParams(_,f,$){let z=!_&&!f&&!$,Q,J=!1;if(z||_)Q=this.getColumnsFromModel(z?void 0:_);else if(f&&$){if(Q=this.calculateColumnsBetween(f,$),Q?.length)J=Q[0]!==this.getColumnFromModel(f)}return Q?{columns:Q,startsOnTheRight:J}:void 0}verifyCellRanges(_){let{suppressMultiRanges:f}=this.getMultiRangeContext(),$=wq(_)&&f&&this.cellRanges.length>1;if($)j(93);return!$}forEachRowInRange(_,f){let $=this.getRangeStartRow(_),z=this.getRangeEndRow(_),Q=$;while(Q){if(f(Q),s(Q,z))break;Q=K_(this.beans,Q)}}forEachEditableCellInRanges(_,f){let{beans:$}=this;for(let z of _)this.forEachRowInRange(z,(Q)=>{let J=D_($,Q);if(!J)return;for(let q=0;q0,Z=f.ctrlKey||f.metaKey,G=!X||Z,E=O1(z),U=Wf(z);if(!E||!U)return;if(f.key===S.ENTER)f.preventDefault();if(f.shiftKey){let W=Q.root;if(!W)return;let B=_.isColumn?_:b(_.getLeafColumns()),K=this.findContainingRange({columns:[W],startRow:E,endRow:U},!0);if(!K){Q_(J,Q.lastCellRange),this.selectColumns(this.calculateColumnsBetween(W,B),E,U);return}this.updateRangeRowBoundary({cellRange:K,boundary:"end",cellPosition:{column:B,...U}});return}if(Y&&(q||!Z&&!X))this.removeAllCellRanges(!0);let H=(W,B)=>{let K=this.findContainingRange({columns:W,startRow:E,endRow:U},!0);if(K&&G)this.deselectColumnsFromRange(K,W);else{let L=this.selectColumns(W,E,U);if(L)Q.lastCellRange=L}Q.root=B};if(_.isColumn)H([_],_);else{let W=_.getDisplayedLeafColumns();H(W,W[0])}}deselectColumnsFromRange(_,f){if(K$(_.columns,f),f.includes(_.startColumn))_.startColumn=_.columns[0];if(_.columns.length===0)Q_(this.cellRanges,_);this.dispatchChangedEvent(!0,!0)}selectColumns(_,f,$){return this.addCellRange({columns:_,columnStart:_[0],columnEnd:b(_),rowStartIndex:f.rowIndex,rowStartPinned:f.rowPinned,rowEndIndex:$.rowIndex,rowEndPinned:$.rowPinned})}};function CY(_,f){return _!=null?{rowIndex:_,rowPinned:f}:void 0}function SO(_){let f;for(let $ of _)if(f===void 0||Y_(f,$))f=$;return f}function AO(_){let f;for(let $ of _)if(f===void 0||Y_($,f))f=$;return f}function RO(_,f){let{startRow:$,endRow:z}=_,Q=Y_($,z)?z:$,J=f.rowIndex===Q.rowIndex&&f.rowPinned===Q.rowPinned,q=_.columns[0],X=b(_.columns),Y=_.startColumn===q?X:q;return f.column===Y&&J}function DQ(_,f,$){let z;if($==="top")z=!_.startRow||!_.endRow||Y_(_.startRow,_.endRow)?"startRow":"endRow";else z=!_.startRow||!_.endRow||Y_(_.startRow,_.endRow)?"endRow":"startRow";_[z]=f??void 0}var dZ={moduleName:"CellSelection",version:$_,beans:[kO],dynamicBeans:{fillHandle:QO,rangeHandle:JO},apiFunctions:{getCellRanges:XO,addCellRange:YO,clearRangeSelection:IY,clearCellSelection:IY},dependsOn:[y_,f1,qQ],css:[qO]};function jO(_){return _.colModel.isPivotMode()}function VO(_,f,$){return _.pivotResultCols?.lookupPivotResultCol(f,$)??null}function OO(_,f){_.valueColsSvc?.setColumns(f,"api")}function PO(_){return _.valueColsSvc?.columns??[]}function vO(_,f){_.valueColsSvc?.removeColumns(f,"api")}function TO(_,f){_.valueColsSvc?.addColumns(f,"api")}function IO(_,f){_.pivotColsSvc?.setColumns(f,"api")}function yO(_,f){_.pivotColsSvc?.removeColumns(f,"api")}function bO(_,f){_.pivotColsSvc?.addColumns(f,"api")}function CO(_){return _.pivotColsSvc?.columns??[]}function wO(_,f){_.pivotResultCols?.setPivotResultCols(f,"api")}function xO(_){let f=_.pivotResultCols?.getPivotResultCols();return f?f.list:null}var wY="PivotRowTotal_",NO=({headerName:_},{headerName:f})=>{if(_&&!f)return 1;else if(!_&&f)return-1;else if(!_&&!f)return 0;if(_f)return 1;else return 0},gO=(_)=>(f,$)=>_(f.headerName,$.headerName),hO=class extends A{constructor(){super(...arguments);this.beanName="pivotColDefSvc"}wireBeans(_){this.colModel=_.colModel,this.pivotColsSvc=_.pivotColsSvc,this.valueColsSvc=_.valueColsSvc,this.colNames=_.colNames}postConstruct(){let _=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=_(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=_()});let f=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=f(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=f()})}createPivotColumnDefs(_){let f=this.createPivotColumnsFromUniqueValues(_);function $(Q,J=[]){return Q.forEach((q)=>{if(q.children!==void 0)$(q.children,J);else J.push(q)}),J}let z=$(f);return this.addRowGroupTotals(f,z),this.addExpandablePivotGroups(f,z),this.addPivotTotalsToGroups(f,z),f}createPivotColumnsFromUniqueValues(_){let f=this.pivotColsSvc?.columns??[],$=f.length;return this.recursivelyBuildGroup(0,_,[],$,f)}recursivelyBuildGroup(_,f,$,z,Q){if(_>=z)return this.buildMeasureCols($);let{pivotComparator:J}=Q[_].getColDef(),q=J?gO(J):NO,X=this.valueColsSvc?.columns;if(X?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&_===z-1){let Z=[];for(let G of f.keys()){let E=[...$,G],U=this.createColDef(X[0],G,E);U.columnGroupShow="open",Z.push(U)}return Z.sort(q),Z}let Y=[];for(let Z of f.keys()){let G=this.pivotDefaultExpanded===-1||_{let z=this.colNames.getDisplayNameForColumn($,"header"),Q=this.createColDef($,z,_);return Q.columnGroupShow="open",Q})}addExpandablePivotGroups(_,f){let $=this.gos.get("suppressExpandablePivotGroups");if($||this.gos.get("pivotColumnGroupTotals"))return;let z=(Q,J,q)=>{if("children"in Q){let{valueColsSvc:Z}=this,{columns:G=[]}=Z??{},E=new Map;Q.children.forEach((W)=>{z(W,J,E)});let U=!Q.children.some((W)=>W.children),H=U&&G.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let W of G){let B=this.colNames.getDisplayNameForColumn(W,"header"),K=this.createColDef(W,B,Q.pivotKeys);if(K.pivotTotalColumnIds=E.get(W.getColId()),K.columnGroupShow=!$?"closed":"open",K.aggFunc=W.getAggFunc(),!U||H)Q.children.push(K),J.push(K)}this.merge(q,E);return}if(!Q.pivotValueColumn)return;let X=Q.pivotValueColumn.getColId();if(q.has(X))q.get(X).push(Q.colId);else q.set(X,[Q.colId])};_.forEach((Q)=>{z(Q,f,new Map)})}addPivotTotalsToGroups(_,f){if(!this.gos.get("pivotColumnGroupTotals"))return;let $=this.gos.get("pivotColumnGroupTotals")==="after",z=this.valueColsSvc?.columns,Q=z?.map((J)=>J.getAggFunc());if(!Q||Q.length<1||!this.sameAggFuncs(Q))return;if(z){let J=z[0];_.forEach((q)=>{this.recursivelyAddPivotTotal(q,f,J,$)})}}recursivelyAddPivotTotal(_,f,$,z){let Q=_;if(!Q.children){let q=_;return q.colId?[q.colId]:null}let J=[];if(Q.children.forEach((q)=>{let X=this.recursivelyAddPivotTotal(q,f,$,z);if(X)J=J.concat(X)}),Q.children.length>1){let X=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),Y=this.createColDef($,X,_.pivotKeys,!0);Y.pivotTotalColumnIds=J,Y.aggFunc=$.getAggFunc(),Y.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;let Z=_.children;if(z)Z.push(Y);else Z.unshift(Y);f.push(Y)}return J}addRowGroupTotals(_,f){if(!this.gos.get("pivotRowTotals"))return;let $=this.gos.get("pivotRowTotals")==="after",Q=(this.valueColsSvc?.columns??[]).slice();if(!$)Q.reverse();let J=Q.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let q=0;qJ.data?.[J.colDef.field],Q.pivotKeys=$,Q.pivotValueColumn=_,Q.filter===!0)Q.filter="agNumberColumnFilter";return Q}sameAggFuncs(_){if(_.length==1)return!0;for(let f=1;f<_.length;f++)if(_[f]!==_[0])return!1;return!0}merge(_,f){f.forEach(($,z)=>{let J=[..._.has(z)?_.get(z):[],...$];_.set(z,J)})}generateColumnGroupId(_){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(($)=>$.getColId()).join("-")}_${_.join("-")}`}generateColumnId(_,f){return`pivot_${(this.pivotColsSvc?.columns??[]).map((z)=>z.getColId()).join("-")}_${_.join("-")}_${f}`}createColDefsFromFields(_){let f=new Map;for(let Q=0;Q<_.length;Q++){let q=_[Q].split(this.fieldSeparator),X=f;for(let Y=0;Y{let Y=[];for(let[E,U]of q){let H=$(`${Q}${this.fieldSeparator}${E}`,E,U,X+1);Y.push(H)}if(Y.length===0){let E=this.colModel.getColDefCol(J);if(E){let H=this.colNames.getDisplayNameForColumn(E,"header")??J,W=this.createColDef(E,H,void 0,!1);return W.colId=Q,W.aggFunc=E.getAggFunc(),W.valueGetter=(B)=>B.data?.[Q],W}return{colId:Q,headerName:J,valueGetter:(H)=>H.data?.[Q]}}if(this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&Y.length===1&&"colId"in Y[0])return Y[0].headerName=J,Y[0];return{openByDefault:this.pivotDefaultExpanded===-1||X{Q.forEach((J)=>{if(v(J.children)){let X=J;if($)$(X);z(X.children)}else{let X=J;if(f)f(X)}})};if(_)z(_)}},xY="Exceeded maximum allowed pivot column count.",RQ=(_)=>{let f={};return _.forEach(($,z)=>f[z]=$ instanceof Map?RQ($):$),f},iO=class extends A{constructor(){super(...arguments);this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(_){this.valueSvc=_.valueSvc,this.colModel=_.colModel,this.pivotResultCols=_.pivotResultCols,this.rowGroupColsSvc=_.rowGroupColsSvc,this.valueColsSvc=_.valueColsSvc,this.pivotColsSvc=_.pivotColsSvc,this.pivotColDefSvc=_.pivotColDefSvc}execute(_){if(this.colModel.isPivotActive())return this.executePivotOn(_);else return this.executePivotOff()}executePivotOff(){if(this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent())return this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),!0;return!1}executePivotOn(_){let f=this.valueColsSvc?.columns.length??1,$=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=$===-1?-1:$/f;let z;try{z=this.bucketUpRowNodes(_)}catch(L){if(L.message===xY)return this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:L.message}),this.lastTimeFailed=!0,!1;throw L}let Q=this.setUniqueValues(z),J=this.valueColsSvc?.columns??[],q=J.map((L)=>`${L.getId()}-${L.getColDef().headerName}`).join("#"),X=J.map((L)=>L.getAggFunc().toString()).join("#"),Y=this.aggregationColumnsHashLastTime!==q,Z=this.aggregationFuncsHashLastTime!==X;this.aggregationColumnsHashLastTime=q,this.aggregationFuncsHashLastTime=X;let G=(this.rowGroupColsSvc?.columns??[]).map((L)=>L.getId()).join("#"),E=G!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=G;let U=this.gos.get("pivotRowTotals"),H=this.gos.get("pivotColumnGroupTotals"),W=this.gos.get("suppressExpandablePivotGroups"),B=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),K=U!==this.pivotRowTotalsLastTime||H!==this.pivotColumnGroupTotalsLastTime||W!==this.suppressExpandablePivotGroupsLastTime||B!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=U,this.pivotColumnGroupTotalsLastTime=H,this.suppressExpandablePivotGroupsLastTime=W,this.removePivotHeaderRowWhenSingleValueColumnLastTime=B,this.lastTimeFailed||Q||Y||E||Z||K){let L=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(L,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(_){if(!xz(RQ(this.uniqueValues),RQ(_)))return this.uniqueValues=_,!0;return!1}bucketUpRowNodes(_){this.currentUniqueCount=0;let f=new Map;R_(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,_,(z)=>{if(z.leafGroup)z.childrenMapped=null});let $=(z)=>{if(z.leafGroup)this.bucketRowNode(z,f);else{let Q=z.childrenAfterFilter;if(Q)for(let J=0,q=Q.length;Jthis.maxUniqueValues;if(q&&U)throw Error(xY)}if(!Q.has(E))Q.set(E,[]);Q.get(E).push(G)}if($===f.length-1)return Q;let X=new Map;for(let Y of Q.keys())X.set(Y,this.bucketChildren(Q.get(Y),f,$+1,z.get(Y)));return X}},mO={moduleName:"SharedPivot",version:$_,beans:[uO,hO,wZ],apiFunctions:{isPivotMode:jO,getPivotResultColumn:VO,setValueColumns:OO,getValueColumns:PO,removeValueColumns:vO,addValueColumns:TO,setPivotColumns:IO,removePivotColumns:yO,addPivotColumns:bO,getPivotColumns:CO,setPivotResultColumns:wO,getPivotResultColumns:xO},dependsOn:[iZ,NJ]},tZ={moduleName:"Pivot",version:$_,rowModels:["clientSide"],beans:[iO],dependsOn:[mO,xV,wQ]};var kC=String.fromCodePoint(31,41150,8291);var rZ=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],NY=new Map;for(let _ of rZ){let f=NY.get(_.symbol)??[];f.push(_),NY.set(_.symbol,f)}var SC=[...new Set(rZ.map((_)=>_.symbol))].sort((_,f)=>f.length-_.length);var AC=Symbol("WrappedFunctionMarker");var cO={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},pO=new Set(["columnLineCombo","areaColumnCombo","customCombo"]);function nO(_){return pO.has(_)}function dO(_){return _==="doughnut"?"donut":_}function tO(_){return cO[_]}var rO=["number","category","grouped-category","log","time"];var RC=rO.reduce((_,f)=>({..._,[f]:{title:{_enabledFromTheme:!0}}}),{});var NQ=(_)=>{return(f)=>{if(f==null)return!0;return _(f)}};var lO=["doughnut"];function sO(_){return!!tO(_)||nO(_)}function aO(_){return lO.includes(_)}var VC=NQ((_)=>{if(sO(_))return!0;if(aO(_)){let f=dO(_);return Yf(`The chart type '${_}' has been deprecated. Please use '${f}' instead.`),f}return!1}),OC=NQ((_)=>{return typeof _==="object"}),PC=NQ((_)=>{return typeof _==="object"}),vC=NQ((_)=>{return typeof _==="string"||typeof _==="function"});function lZ(_){return _.map((f,$,z)=>f.map((Q,J)=>z.slice(0,$+1).reduce((q,X)=>q+X[J],0)))}function sZ(_){let f=_.map(($,z)=>_.reduce((Q,J)=>Math.max(Q,J[z]),0));return _.map(($)=>$.map((z,Q)=>z/f[Q]*19))}var aZ=[[1,3,5],[2,6,4],[5,3,1]];var oO=lZ(aZ);var TC=sZ(oO);var eO=aZ;var _P=lZ(eO);var IC=sZ(_P);var fP=["number","category","time","grouped-category"],$P=["angle-category","angle-number","radius-category","radius-number"],yC=[...fP,...$P];qJ.registerModules([e5,T5,o5,n5,a5,h5,P5,vZ,dZ,tZ,pZ,O2,DZ,kZ,AZ,jZ,mZ]);var zP=(_)=>{let{data:f,options:$,api:z,on:Q,class:J,style:q="height: 100%; width: 100%;"}=_,X=null,Y=()=>{return document.documentElement.getAttribute("data-theme")==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches},Z=(E)=>{return E?"ag-theme-alpine-dark":"ag-theme-alpine"};return bf("div",{class:J,style:q,ref:(E)=>{if(!E)return;let U=typeof f==="function"?f():f,H=typeof $==="function"?$():$,W=["onFilterChanged","onModelUpdated","onGridSizeChanged","onFirstDataRendered","onRowValueChanged","onSelectionChanged","onCellClicked","onCellDoubleClicked","onCellValueChanged","onRowClicked","onSortChanged","onContextMenu","onColumnResized","onColumnMoved","onRowDataUpdated","onCellEditingStarted","onCellEditingStopped","onPaginationChanged","onBodyScroll"],B={};W.forEach((k)=>{if(Q?.[k])B[k]=(R)=>Q[k](R)});let K={...H,theme:Z(Y()),rowData:U||[],onGridReady:(k)=>{if(X=k.api,z)z.current=X;if(Q?.onGridReady)Q.onGridReady(k);if(H?.autoSizeColumns)setTimeout(()=>{if(X&&!X.isDestroyed()){let R=X.getColumns();if(R?.length)X.autoSizeColumns(R)}},100)},...B};X=b$(E,K);let L=e0(f,()=>{if(!X||X.isDestroyed())return;let k=typeof f==="function"?f():f;if(Array.isArray(k)){let R=X.getGridOption("rowData");if(k!==R)X.setGridOption("rowData",k)}},!0),F=e0(Y,()=>{if(X&&!X.isDestroyed()){let k=Y(),R=Z(k),O=X.getGridOption("theme");if(R!==O)X.setGridOption("theme",R)}},!0),D=["pagination","paginationPageSize","suppressRowClickSelection","rowSelection","enableCellTextSelection","ensureDomOrder","stopEditingWhenCellsLoseFocus","enterMovesDown","enterMovesDownAfterEdit"],M=e0($,()=>{if(!X||X.isDestroyed()||!$)return;let k=typeof $==="function"?$():$;D.forEach((R)=>{if(k[R]!==void 0)try{X.setGridOption(R,k[R])}catch(O){}})},!0);o0(()=>{if(L(),F(),M(),X&&!X.isDestroyed()){if(X.destroy(),z)z.current=null;X=null}})}})};})(); +To see what part of your code that caused the refresh check this stacktrace.`,253:({version:Q})=>["Illegal version string: ",Q],254:()=>"Cannot create chart: no chart themes available.",255:({point:Q})=>`Lone surrogate U+${Q?.toString(16).toUpperCase()} is not a scalar value`,256:()=>"Unable to initialise. See validation error, or load ValidationModule if missing.",257:()=>Y8("IntegratedChartsModule"),258:()=>Y8("SparklinesModule"),259:({part:Q})=>`the argument to theme.withPart must be a Theming API part object, received: ${Q}`,260:({propName:Q,compName:z,gridScoped:J,gridId:Z,rowModelType:$})=>X8({reasonOrId:`AG Grid '${Q}' component: ${z}`,moduleName:B1[z],gridId:Z,gridScoped:J,rowModelType:$}),261:()=>"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",262:()=>'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',263:()=>'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',264:()=>'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',265:({colId:Q})=>`Unable to infer chart data type for column '${Q}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${H1}/integrated-charts-range-chart#coldefchartdatatype .`,266:()=>'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',267:()=>"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",268:()=>"Transactions aren't supported with tree data when using treeDataChildrenField",269:()=>"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",270:({id:Q,parentId:z})=>`Cycle detected for row with id='${Q}' and parent id='${z}'. Resetting the parent for row with id='${Q}' and showing it as a root-level node.`,271:({id:Q,parentId:z})=>`Parent row not found for row with id='${Q}' and parent id='${z}'. Showing row with id='${Q}' as a root-level node.`,272:()=>l$(),273:({providedId:Q,usedId:z})=>`Provided column id '${Q}' was already in use, ensure all column and group ids are unique. Using '${z}' instead.`,274:({prop:Q})=>{let z=`Since v33, ${Q} has been deprecated.`;switch(Q){case"maxComponentCreationTimeMs":z+=" This property is no longer required and so will be removed in a future version.";break;case"setGridApi":z+=" This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api ";break;case"children":z+=" For multiple versions AgGridReact does not support children.";break}return z},275:a$,276:()=>"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",277:({colId:Q})=>`'enableFilterHandlers' is set to true, but column '${Q}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,278:({colId:Q})=>`Unable to create filter handler for column '${Q}'`,279:(Q)=>{},280:({colId:Q})=>`'name' must be provided for custom filter components for column '${Q}`,281:({colId:Q})=>`Filter for column '${Q}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,282:()=>"New filter tool panel requires `enableFilterHandlers: true`.",283:()=>"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",284:()=>"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",285:()=>"As of v34, use (`api.getColumnFilterModel()`) instead.",286:()=>"As of v34, use (`api.setColumnFilterModel()`) instead.",287:()=>"`api.doFilterAction()` requires `enableFilterHandlers = true",288:()=>"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",289:({rowModelType:Q})=>`Row Model '${Q}' is not supported with Batch Editing`,290:({rowIndex:Q,rowPinned:z})=>`Row with index '${Q}' and pinned state '${z}' not found`,291:()=>"License Key being set multiple times with different values. This can result in an incorrect license key being used,",292:({colId:Q})=>`The Multi Filter for column '${Q}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,293:()=>"The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.",294:()=>"When using the `agRichSelectCellEditor` setting `filterListAsync = true` requires `allowTyping = true` and the `values()` callback must return a Promise of filtered values.",295:({blockedService:Q})=>`colDef.allowFormula is not supported with ${Q}. Formulas has been turned off.`,296:()=>"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.",297:()=>'`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.',298:()=>"Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates."};function GK(Q,z){let J=YK[Q];if(!J)return[`Missing error text for error id ${Q}!`];let Z=J(z),X=` +See ${z9(Q,z)}`;return Array.isArray(Z)?Z.concat(X):[Z,X]}var qK={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},HK=class{constructor(Q="javascript"){this.frameworkName=Q,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.wrapIncoming=(z)=>z(),this.wrapOutgoing=(z)=>z(),this.baseDocLink=`${d8}/${this.frameworkName}-data-grid`,TG(this.baseDocLink)}frameworkComponent(Q){return null}isFrameworkComponent(Q){return!1}getDocLink(Q){return this.baseDocLink+(Q?"/"+Q:"")}},G8=new WeakMap,q8=new WeakMap;function MJ(Q,z,J){if(!z)return e(11),{};let Z=J,$;if(!Z?.setThemeOnGridDiv){let Y=Z0({tag:"div"});Y.style.height="100%",Q.appendChild(Y),Q=Y,$=()=>Q.remove()}return new UK().create(Q,z,(Y)=>{let G=new j_(Q);Y.createBean(G)},void 0,J,$)}var _K=1,UK=class{create(Q,z,J,Z,$,X){let Y=y5.applyGlobalGridOptions(z),G=Y.gridId??String(_K++),q=this.getRegisteredModules($,G,Y.rowModelType),H=this.createBeansList(Y.rowModelType,q,G),_=this.createProvidedBeans(Q,Y,$);if(!H)return;let B=new JH({providedBeanInstances:_,beanClasses:H,id:G,beanInitComparator:XH,beanDestroyComparator:YH,derivedBeans:[ZH],destroyCallback:()=>{q8.delete(E),G8.delete(Q),jG(G),X?.()}});this.registerModuleFeatures(B,q),J(B),B.getBean("syncSvc").start(),Z?.(B);let E=B.getBean("gridApi");return G8.set(Q,E),q8.set(E,Q),E}getRegisteredModules(Q,z,J){return t1(oE,void 0,!0),Q?.modules?.forEach((Z)=>t1(Z,z)),RG(z,H8(J))}registerModuleFeatures(Q,z){let J=Q.getBean("registry"),Z=Q.getBean("apiFunctionSvc");for(let $ of z){J.registerModule($);let X=$.apiFunctions;if(X){let Y=Object.keys(X);for(let G of Y)Z?.addFunction(G,X[G])}}}createProvidedBeans(Q,z,J){let Z=J?J.frameworkOverrides:null;if(n(Z))Z=new HK;let $={gridOptions:z,eGridDiv:Q,eRootDiv:Q,globalListener:J?J.globalListener:null,globalSyncListener:J?J.globalSyncListener:null,frameworkOverrides:Z,withinStudio:J?.withinStudio};if(J?.providedBeanInstances)Object.assign($,J.providedBeanInstances);return $}createBeansList(Q,z,J){let Z={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},$=H8(Q),X=Z[$];if(!X){y1(201,{rowModelType:$},`Unknown rowModelType ${$}.`);return}if(!OG()){y1(272,void 0,l$());return}if(!Q){let G=Object.entries(Z).filter(([q,H])=>Q5(H,J,q));if(G.length==1){let[q,H]=G[0];if(q!==$){let _={moduleName:H,rowModelType:q};y1(275,_,a$(_));return}}}if(!Q5(X,J,$)){let G=w5(),q=`rowModelType = '${$}'`,H=G?`Unable to use ${q} as that requires the ag-grid-enterprise script to be included. +`:`Missing module ${X}Module for rowModelType ${$}.`;y1(200,{reasonOrId:q,moduleName:X,gridScoped:x5(),gridId:J,rowModelType:$,isUmd:G},H);return}let Y=new Set;for(let G of z)for(let q of G.beans??[])Y.add(q);return Array.from(Y)}};function H8(Q){return Q??"clientSide"}function WK(Q,z,J="auto"){Q.frameworkOverrides.wrapIncoming(()=>Q.ctrlsSvc.getScrollFeature().ensureColumnVisible(z,J),"ensureVisible")}function BK(Q,z,J){Q.frameworkOverrides.wrapIncoming(()=>Q.ctrlsSvc.getScrollFeature().ensureIndexVisible(z,J),"ensureVisible")}var o$=(Q,z)=>{for(let J=0,Z=Q.length;J{if(J!=null){let X=J.getSortedRows();for(let Y=0,G=X.length;Y{let H=G.level+1;for(let _=0,U=q.length;_{if(!U&&U!==void 0){let M=F.sourceRowIndex;U=M<=W,W=M}if(F.data!==D){if(F.updateData(D),!Y.has(F))G.add(F);if(!F.selectable&&F.isSelected())H.push(F)}},K=(F,D,M)=>{for(let k=0,f=D.length;k0;if(L){let F=J._leafs??(J._leafs=[]);if(U===void 0)MK(F,q,X);else if(DK(F,q))X.reordered=!0}if(L||B||G.size)Q.rowDataUpdated=!0,this.deselect(H)}deleteUnusedNodes(Q,{removals:z},J,Z){let $=this.rootNode._leafs;for(let X=0,Y=$.length;X0}updateRowData(Q,z,J){if(this.dispatchRowDataUpdateStarted(Q.add),this.beans.groupStage?.getNestedDataGetter())return R(268),{remove:[],update:[],add:[]};let Z=[],$=Z5(this.gos),X=this.executeRemove($,Q,z,Z,J),Y=this.executeUpdate($,Q,z,Z),G=this.executeAdd(Q,z);return this.deselect(Z),{remove:X,update:Y,add:G}}executeRemove(Q,{remove:z},{adds:J,updates:Z,removals:$},X,Y){let G=this.rootNode._leafs,q=G?.length,H=z?.length;if(!H||!q)return[];let _=0,U=q,W=0,B=Array(H);for(let E=0;EW)W=L;if(B[_++]=K,!this.destroyNode(K,Y))continue;if(K.isSelected())X.push(K);if(!J.delete(K))Z.delete(K),$.push(K)}if(B.length=_,_)FK(G,U,W);return B}executeUpdate(Q,{update:z},{adds:J,updates:Z},$){let X=z?.length;if(!X)return[];let Y=Array(X),G=0;for(let q=0;q=q;--U){let B=Z[U];B.sourceRowIndex=W,Z[W--]=B}z.reordered=!0}Z.length=G;let H=Array(Y),_=z.adds;for(let U=0;U=J||Number.isNaN(z))return J;z=Math.ceil(z);let Z=this.gos;if(z>0&&Z.get("treeData")&&Z.get("getDataPath"))z=KK(Q,z);return z}},KK=(Q,z)=>{for(let J=0,Z=Q.length;J{if(Q.group=!0,Q.level=-1,Q._expanded=!0,Q.id="ROOT_NODE_ID",Q._leafs?.length!==0)Q._leafs=[];let z=[],J=[],Z=[],$=[];Q.childrenAfterGroup=z,Q.childrenAfterSort=J,Q.childrenAfterAggFilter=Z,Q.childrenAfterFilter=$;let X=Q.sibling;if(X)X.childrenAfterGroup=z,X.childrenAfterSort=J,X.childrenAfterAggFilter=Z,X.childrenAfterFilter=$,X.childrenMapped=Q.childrenMapped;return Q.updateHasChildren(),Q},LK=(Q,z)=>{if(Q)for(let J=0,Z=Q.length;J{z=Math.max(0,z);for(let Z=z,$=Q.length;Z<$;++Z){let X=Q[Z];if(Z<=J&&X.destroyed)continue;X.sourceRowIndex=z,Q[z++]=X}Q.length=z},DK=(Q,z)=>{let J=z.size;Q.length=J;let Z=0,$=!1,X=!1;for(let Y of z){let G=Y.sourceRowIndex;if(G===Z)X||(X=$);else{if(G>=0)X=!0;else $=!0;Y.sourceRowIndex=Z,Q[Z]=Y}++Z}return X},MK=(Q,z,{adds:J})=>{let Z=Q.length,$=z.size;if($>Z)Q.length=$;let X=0;for(let Y=0;Y{if(Z.hasChildren())if(Q&&!$)Z.childrenAfterFilter=Z.childrenAfterGroup.filter((X)=>{let Y=X.childrenAfterFilter&&X.childrenAfterFilter.length>0,G=X.data&&this.filterManager.doesRowPassFilter({rowNode:X});return Y||G});else Z.childrenAfterFilter=Z.childrenAfterGroup;else Z.childrenAfterFilter=Z.childrenAfterGroup;M5(Z)};if(this.doingTreeDataFiltering()){let Z=($,X)=>{if($.childrenAfterGroup)for(let Y=0;Y<$.childrenAfterGroup.length;Y++){let G=$.childrenAfterGroup[Y],q=X||this.filterManager.doesRowPassFilter({rowNode:G});if(G.childrenAfterGroup)Z($.childrenAfterGroup[Y],q);else J(G,q)}J($,X)};Z(this.beans.rowModel.rootNode,!1)}else{let Z=($)=>J($,!1);A0(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,z,Z)}}softFilter(Q,z){let J=($)=>{if($.childrenAfterFilter=$.childrenAfterGroup,$.hasChildren())for(let X of $.childrenAfterGroup)X.softFiltered=Q&&!(X.data&&this.filterManager.doesRowPassFilter({rowNode:X}));M5($)},Z=this.beans.rowModel;A0(Z.rootNode,Z.hierarchical,z,J)}doingTreeDataFiltering(){let{gos:Q}=this;return!!this.beans.groupStage?.treeData&&!Q.get("excludeChildrenWhenTreeDataFiltering")}},VK=4,fK=(Q,z,J,Z,$)=>{let{childrenAfterSort:X,childrenAfterAggFilter:Y}=z;if(!Y)return X&&X.length>0?X:[];let G=Y.length;if(G<=1){if(X?.length===G&&(G===0||X[0]===Y[0]))return X;return Y.slice()}if(!X||G<=VK)return Q.doFullSortInPlace(Y.slice(),$);let q=new Map,{updates:H,adds:_}=J,U=[];for(let B=0;BQ.compareRowNodes($,B,E)||~q.get(B)-~q.get(E)),W===G)return U;return AK(Q,$,U,X,q,G)},AK=(Q,z,J,Z,$,X)=>{let Y=Array(X),G=0,q=J[G],H,_=-1,U=0,W=0,B=J.length,E=Z.length;while(!0){if(_<0){if(U>=E)break;if(H=Z[U++],_=$.get(H)??-1,_<0)continue}if((Q.compareRowNodes(z,q,H)||~$.get(q)-_)<0){if(Y[W++]=q,++G>=B)break;q=J[G]}else Y[W++]=H,_=-1}while(G=0)Y[W++]=K}return Y},jK=(Q,z,J)=>{let Z=0;J.length=z.size;for(let $=0,X=Q.length;${let{childrenAfterSort:z,sibling:J}=Q;if(J)J.childrenAfterSort=z;if(!z)return;for(let Z=0,$=z.length-1;Z<=$;Z++){let X=z[Z],Y=Z===0,G=Z===$;if(X.firstChild!==Y)X.firstChild=Y,X.dispatchRowEvent("firstChildChanged");if(X.lastChild!==G)X.lastChild=G,X.dispatchRowEvent("lastChildChanged");if(X.childIndex!==Z)X.childIndex=Z,X.dispatchRowEvent("childIndexChanged")}},RK=class extends j{constructor(){super(...arguments);this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(Q,z){let J=this.beans.sortSvc.getSortOptions(),Z=J.length>0&&!!z&&this.gos.get("deltaSort"),{gos:$,colModel:X,rowGroupColsSvc:Y,rowNodeSorter:G,rowRenderer:q,showRowGroupCols:H}=this.beans,_=$.get("groupMaintainOrder"),U=X.getCols().some((D)=>D.isRowGroupActive()),W=Y?.columns,B=X.isPivotMode(),E=$.getCallback("postSortRows"),K=!1,L,F=(D)=>{let M=B&&D.leafGroup,k=_&&U&&!D.leafGroup;if(k)L??(L=this.shouldSortContainsGroupCols(J)),k&&(k=!L);let f=null;if(k){let A=!1;if(W){let O=D.level+1;if(O{let{childrenAfterSort:z,childrenAfterAggFilter:J}=Q,Z=z?.length,$=J?.length;if(!Z||!$)return null;let X=Array($),Y=new Set;for(let q=0;q<$;++q)Y.add(J[q]);let G=0;for(let q=0;q{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:J,columnRowGroupChanged:J,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:()=>this.refreshModel({step:"pivot"}),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),stylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){let{beans:Q,stagesRefreshProps:z}=this,J=[Q.groupStage,Q.filterStage,Q.pivotStage,Q.aggStage,Q.sortStage,Q.filterAggStage,Q.flattenStage].filter((Z)=>!!Z);this.stages=J;for(let Z=J.length-1;Z>=0;--Z){let $=J[Z];for(let X of $.refreshProps)z.set(X,Z)}this.addManagedPropertyListeners([...z.keys(),"rowData"],(Z)=>{let $=Z.changeSet?.properties;if($)this.onPropChange($)}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){if(this.started=!0,this.rowNodesCountReady)this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0});else this.setInitialData()}setInitialData(){if(this.gos.get("rowData"))this.onPropChange(["rowData"])}ensureRowHeightsValid(Q,z,J,Z){let $,X=!1;do{$=!1;let Y=this.getRowIndexAtPixel(Q),G=this.getRowIndexAtPixel(z),q=Math.max(Y,J),H=Math.min(G,Z);for(let _=q;_<=H;_++){let U=this.getRow(_);if(U.rowHeightEstimated){let W=r1(this.beans,U);U.setRowHeight(W.height),$=!0,X=!0}}if($)this.setRowTopAndRowIndex()}while($);return X}onPropChange(Q){let{nodeManager:z,gos:J,beans:Z}=this,$=Z.groupStage;if(!z)return;let X=new Set(Q),Y=$?.onPropChange(X),G;if(X.has("rowData"))G=J.get("rowData");else if(Y)G=$?.extractData();if(G&&!Array.isArray(G))G=null,R(1);let q={step:"nothing",changedProps:X};if(G){let _=!Y&&!this.isEmpty()&&G.length>0&&J.exists("getRowId")&&!J.get("resetRowDataOnUpdate");if(this.refreshingData=!0,_)q.keepRenderedRows=!0,q.animate=!J.get("suppressAnimationFrame"),q.changedRowNodes=new W1,z.setImmutableRowData(q,G);else q.rowDataUpdated=!0,q.newData=!0,z.setNewRowData(G),this.rowNodesCountReady=!0}let H=q.rowDataUpdated?"group":this.getRefreshedStage(Q);if(H)q.step=H,this.refreshModel(q)}getRefreshedStage(Q){let{stages:z,stagesRefreshProps:J}=this;if(!z)return null;let Z=z.length,$=Z;for(let X=0,Y=Q.length;X{if(X?.id!=null&&!z.has(X.id))X.clearRowTopAndRowIndex()},Z=(X)=>{J(X),J(X.detailNode),J(X.sibling);let Y=X.childrenAfterGroup;if(!X.hasChildren()||!Y)return;if(Q&&X.level!==-1&&!X.expanded)return;for(let G=0,q=Y.length;G{let H=X[q];if(this.gos.get("groupHideOpenParents"))while(H.expanded&&H.childrenAfterSort&&H.childrenAfterSort.length>0)H=H.childrenAfterSort[0];return H.rowIndex},G=z.footerSvc;if(G)return G?.getTopDisplayIndex(Z,Q,X,Y);return Y(Q)}getTopLevelIndexFromDisplayedIndex(Q){let{rootNode:z,rowsToDisplay:J}=this;if(!z||!J.length||J[0]===z)return Q;let $=this.getRow(Q);if($.footer)$=$.sibling;let X=$.parent;while(X&&X!==z)$=X,X=$.parent;let Y=z.childrenAfterSort?.indexOf($)??-1;return Y>=0?Y:Q}getRowBounds(Q){let z=this.rowsToDisplay[Q];return z?{rowTop:z.rowTop,rowHeight:z.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:_1(this.gos)})}onFilterChanged({afterDataChange:Q,columns:z}){if(!Q){let Z=z.length===0||z.some(($)=>$.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:Z,keepRenderedRows:!0,animate:_1(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:_1(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}isSuppressModelUpdateAfterUpdateTransaction(Q){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;let{changedRowNodes:z,newData:J,rowDataUpdated:Z}=Q;if(!z||J||!Z)return!1;if(z.removals.length||z.adds.size)return!1;return!0}reMapRows(){if(this.refreshingModel||this.refreshingData){this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,this.noAnimate=!0;return}this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(Q){let{nodeManager:z,eventSvc:J,started:Z}=this;if(!z)return;let $=!!Q.rowDataUpdated;if(Z&&$)J.dispatchEvent({type:"rowDataUpdated"});if(this.deferRefresh(Q)){this.setPendingRefreshFlags(Q),this.rowDataUpdatedPending||(this.rowDataUpdatedPending=$);return}if(this.rowDataUpdatedPending)this.rowDataUpdatedPending=!1,Q.step="group";this.updateRefreshParams(Q);let X=!1;this.refreshingModel=!0;try{this.executeRefresh(Q,$),X=!0}finally{if(this.refreshingData=!1,this.refreshingModel=!1,!X)this.setPendingRefreshFlags(Q)}this.clearPendingRefreshFlags(),J.dispatchEvent({type:"modelUpdated",animate:Q.animate,keepRenderedRows:Q.keepRenderedRows,newData:Q.newData,newPage:!1,keepUndoRedoStack:Q.keepUndoRedoStack})}executeRefresh(Q,z){let{beans:J,rootNode:Z}=this;if(J.masterDetailSvc?.refreshModel(Q),z&&Q.step!=="group")J.colFilter?.refreshModel();let $=Q.changedPath;if($?.addRow(Z),Q.step==="group")this.doGrouping(Z,Q),$??($=Q.changedPath);switch($??($=J.changedPathFactory?.ensureRowsPath(Q,Z)),Q.step){case"group":case"filter":this.doFilter($);case"pivot":if(this.doPivot($))$=void 0,Q.changedPath=void 0;case"aggregate":this.doAggregate($);case"filter_aggregates":this.doFilterAggregates($);case"sort":this.doSort($,Q.changedRowNodes);case"map":this.doRowsToDisplay()}let X=new Set;this.setRowTopAndRowIndex(X),this.clearRowTopAndRowIndex($,X),this.updateRefreshParams(Q)}deferRefresh(Q){if(this.refreshingModel)return!0;if(this.beans.colModel.changeEventsDispatching)return!0;if(this.isSuppressModelUpdateAfterUpdateTransaction(Q)){if(this.started)this.refreshingData=!1;return!0}if(!this.started)return!0;return!1}setPendingRefreshFlags(Q){this.pendingNewData||(this.pendingNewData=!!Q.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!Q.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!Q.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!Q.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(Q){Q.newData=this.pendingNewData||!!Q.newData,Q.keepRenderedRows=!this.noKeepRenderedRows&&!!Q.keepRenderedRows,Q.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!Q.keepUndoRedoStack,Q.animate=!this.noAnimate&&!!Q.animate}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getOverlayType(){let{beans:Q,gos:z}=this;if(this.rootNode?._leafs?.length){if(Q.filterManager?.isAnyFilterPresent()&&this.getRowCount()===0)return"noMatchingRows"}else if(this.rowCountReady||(z.get("rowData")?.length??0)==0)return"noRows";return null}getNodesInRangeForSelection(Q,z){let J=!1,Z=!1,$=[],X=l1(this.gos);return this.forEachNodeAfterFilterAndSort((Y)=>{if(Z)return;if(J){if(Y===z||Y===Q){if(Z=!0,X&&Y.group){QX($,Y);return}}}if(!J){if(Y!==z&&Y!==Q)return;if(J=!0,z===Q)Z=!0}if(!Y.group||!X)$.push(Y)}),$}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(Q){return this.rowsToDisplay[Q]}getFormulaRow(Q){return this.formulaRows[Q]}isRowPresent(Q){return this.rowsToDisplay.indexOf(Q)>=0}getRowIndexAtPixel(Q){let z=this.rowsToDisplay,J=z.length;if(this.isEmpty()||J===0)return-1;let Z=0,$=J-1;if(Q<=0)return 0;if(z[$].rowTop<=Q)return $;let Y=-1,G=-1;while(!0){let q=Math.floor((Z+$)/2),H=z[q];if(this.isRowInPixel(H,Q))return q;if(H.rowTopQ)$=q-1;if(Y===Z&&G===$)return q;Y=Z,G=$}}isRowInPixel(Q,z){let J=Q.rowTop,Z=J+Q.rowHeight;return J<=z&&Z>z}forEachLeafNode(Q){let z=this.rootNode?._leafs;if(z)for(let J=0,Z=z.length;JJ.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(Q,z=!1){this.depthFirstSearchRowNodes(Q,z,(J)=>J.childrenAfterSort)}forEachPivotNode(Q,z,J){let{colModel:Z,rowGroupColsSvc:$}=this.beans;if(!Z.isPivotMode())return;if(!$?.columns.length){Q(this.rootNode,0);return}let X=J?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(Q,z,(Y)=>!Y.leafGroup?Y[X]:null)}depthFirstSearchRowNodes(Q,z=!1,J=(X)=>X.childrenAfterGroup,Z=this.rootNode,$=0){let X=$;if(!Z)return X;let Y=Z===this.rootNode;if(!Y)Q(Z,X++);if(Z.hasChildren()&&!Z.footer){let G=Y||this.hierarchical?J(Z):null;if(G){let q=this.beans.footerSvc;X=q?.addTotalRows(X,Z,Q,z,Y,"top")??X;for(let H of G)X=this.depthFirstSearchRowNodes(Q,z,J,H,X);return q?.addTotalRows(X,Z,Q,z,Y,"bottom")??X}}return X}doAggregate(Q){if(this.rootNode)this.beans.aggStage?.execute(Q)}doFilterAggregates(Q){let z=this.rootNode,J=this.beans.filterAggStage;if(J&&this.hierarchical){J.execute(Q);return}z.childrenAfterAggFilter=z.childrenAfterFilter;let Z=z.sibling;if(Z)Z.childrenAfterAggFilter=z.childrenAfterFilter}doSort(Q,z){let J=this.beans.sortStage;if(J){J.execute(Q,z);return}A0(this.rootNode,this.hierarchical,Q,(Z)=>{Z.childrenAfterSort=Z.childrenAfterAggFilter.slice(0),e$(Z)})}doGrouping(Q,z){let Z=this.beans.groupStage?.execute(z);if(Z===void 0){let $=Q._leafs;Q.childrenAfterGroup=$,Q.updateHasChildren();let X=Q.sibling;if(X)X.childrenAfterGroup=$}if(Z||z.rowDataUpdated)this.beans.colFilter?.refreshModel();if(!this.rowCountReady&&this.rowNodesCountReady)this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"})}doFilter(Q){let z=this.beans.filterStage;if(z){z.execute(Q);return}A0(this.rootNode,this.hierarchical,Q,(J)=>{J.childrenAfterFilter=J.childrenAfterGroup,M5(J)})}doPivot(Q){return this.beans.pivotStage?.execute(Q)??!1}getRowNode(Q){let z=this.nodeManager?.getRowNode(Q);if(typeof z==="object")return z;return this.beans.groupStage?.getNonLeaf(Q)}batchUpdateRowData(Q,z){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];let J=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),J)}this.asyncTransactions.push({rowDataTransaction:Q,callback:z})}flushAsyncTransactions(){let Q=this.asyncTransactionsTimer;if(Q)clearTimeout(Q),this.executeBatchUpdateRowData()}executeBatchUpdateRowData(){let{nodeManager:Q,beans:z,eventSvc:J,asyncTransactions:Z}=this;if(!Q)return;z.valueCache?.onDataChanged();let $=[],X=[],Y=new W1,G=!this.gos.get("suppressAnimationFrame");for(let{rowDataTransaction:q,callback:H}of Z??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;let _=Q.updateRowData(q,Y,G);if($.push(_),H)X.push(H.bind(null,_))}if(this.commitTransactions(Y,G),X.length>0)setTimeout(()=>{for(let q=0,H=X.length;q0)J.dispatchEvent({type:"asyncTransactionsFlushed",results:$});this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(Q){let z=this.nodeManager;if(!z)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;let J=new W1,Z=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;let $=z.updateRowData(Q,J,Z);return this.commitTransactions(J,Z),$}commitTransactions(Q,z){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:z,changedRowNodes:Q})}doRowsToDisplay(){let{rootNode:Q,beans:z}=this;if(z.formula?.active){let $=Q?.childrenAfterSort??[];this.formulaRows=$,this.rowsToDisplay=$.filter((X)=>!X.softFiltered);for(let X of this.rowsToDisplay)X.setUiLevel(0);return}let J=z.flattenStage;if(J){this.rowsToDisplay=J.execute();return}let Z=this.rootNode.childrenAfterSort??[];for(let $ of Z)$.setUiLevel(0);this.rowsToDisplay=Z}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){let Q=this.rootNode;if(!Q)return;let z=this.resetRowHeightsForAllRowNodes();Q.setRowHeight(Q.rowHeight,!0);let J=Q.sibling;if(J?.setRowHeight(J.rowHeight,!0),z)this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let Q=!1;return this.forEachNode((z)=>{z.setRowHeight(z.rowHeight,!0);let J=z.detailNode;J?.setRowHeight(J.rowHeight,!0);let Z=z.sibling;Z?.setRowHeight(Z.rowHeight,!0),Q=!0}),Q}onGridStylesChanges(Q){if(Q.rowHeightChanged&&!this.beans.rowAutoHeight?.active)this.resetRowHeights()}onGridReady(){if(!this.started)this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},QX=(Q,z)=>{let J=z.childrenAfterGroup;if(J)for(let Z=0,$=J.length;Z<$;++Z){let X=J[Z];if(X.data)Q.push(X);if(X.group)QX(Q,X)}};var zX={moduleName:"ClientSideRowModel",version:p,rowModels:["clientSide"],beans:[OK,RK],dependsOn:[r$]};var PK=":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}";function TK(Q,z){if(typeof z==="number")Q.colAutosize?.sizeColumnsToFit(z,"api");else Q.colAutosize?.sizeColumnsToFitGridBody(z)}function JX({colAutosize:Q,visibleCols:z},J,Z){if(Array.isArray(J))Q?.autoSizeCols({colKeys:J,skipHeader:Z,source:"api"});else Q?.autoSizeCols({...J,colKeys:J.colIds??z.allCols,source:"api"})}function vK(Q,z){if(z&&typeof z==="object")JX(Q,z);else Q.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:z})}var IK=class extends j{constructor(){super(...arguments);this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){let{gos:Q}=this,z=Q.get("autoSizeStrategy");if(z){let J=!1,Z=z.type;if(Z==="fitGridWidth"||Z==="fitProvidedWidth")J=!0;else if(Z==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(z)});let $=Q.get("rowData");J=$!=null&&$.length>0&&o(Q)}if(J)this.beans.colDelayRenderSvc?.hideColumns(Z)}}autoSizeCols(Q){let{eventSvc:z,visibleCols:J,colModel:Z}=this.beans;b1(this.beans,!0),this.innerAutoSizeCols(Q).then(($)=>{let X=(_)=>L1(z,Array.from(_),!0,"autosizeColumns");if(!Q.scaleUpToFitGridWidth)return b1(this.beans,!1),X($);let Y=U8(this.beans),G=(_)=>J.leftCols.some((U)=>PQ(U,_)),q=(_)=>J.rightCols.some((U)=>PQ(U,_)),H=Q.colKeys.filter((_)=>{return!Z.getCol(_)?.getColDef().suppressAutoSize&&!v0(_)&&!G(_)&&!q(_)});this.sizeColumnsToFit(Y,Q.source,!0,{defaultMaxWidth:Q.defaultMaxWidth,defaultMinWidth:Q.defaultMinWidth,columnLimits:Q.columnLimits?.map((_)=>({..._,key:_.colId})),colKeys:H,onlyScaleUp:!0,animate:!1}),b1(this.beans,!1),X($)})}innerAutoSizeCols(Q){return new Promise((z,J)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(Q).then(z,J));let{colKeys:Z,skipHeader:$,skipHeaderGroups:X,stopAtGroup:Y,defaultMaxWidth:G,defaultMinWidth:q,columnLimits:H=[],source:_="api"}=Q,{animationFrameSvc:U,renderStatus:W,colModel:B,autoWidthCalc:E,visibleCols:K}=this.beans;if(U?.flushAllFrames(),this.timesDelayed<5&&W&&(!W.areHeaderCellsRendered()||!W.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{if(this.isAlive())this.innerAutoSizeCols(Q).then(z,J)});return}this.timesDelayed=0;let L=new Set,F=-1,D=Object.fromEntries(H.map(({colId:f,...A})=>[f,A])),M=$??this.gos.get("skipHeaderOnAutoSize"),k=X??M;while(F!==0){F=0;let f=[];for(let A of Z){if(!A||GJ(A))continue;let O=B.getCol(A);if(!O||L.has(O)||O.getColDef().suppressAutoSize)continue;let v=E.getPreferredWidthForColumn(O,M);if(v>0){let I=D[O.colId]??{};I.minWidth??(I.minWidth=q),I.maxWidth??(I.maxWidth=G);let C=CK(O,v,I);O.setActualWidth(C,_),L.add(O),F++}f.push(O)}if(f.length)K.refresh(_)}if(!k)this.autoSizeColumnGroupsByColumns(Z,_,Y);z(L)})}autoSizeColumn(Q,z,J){this.autoSizeCols({colKeys:[Q],skipHeader:J,skipHeaderGroups:!0,source:z})}autoSizeColumnGroupsByColumns(Q,z,J){let{colModel:Z,ctrlsSvc:$}=this.beans,X=new Set,Y=Z.getColsForKeys(Q);for(let q of Y){let H=q.getParent();while(H&&H!=J){if(!H.isPadding())X.add(H);H=H.getParent()}}let G;for(let q of X){for(let H of $.getHeaderRowContainerCtrls())if(G=H.getHeaderCtrlForColumn(q),G)break;G?.resizeLeafColumnsToFit(z)}}autoSizeAllColumns(Q){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(Q));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...Q})}addColumnAutosizeListeners(Q,z){let J=this.gos.get("skipHeaderOnAutoSize"),Z=()=>{this.autoSizeColumn(z,"uiColumnResized",J)};Q.addEventListener("dblclick",Z);let $=new h0(Q);return $.addEventListener("doubleTap",Z),()=>{Q.removeEventListener("dblclick",Z),$.destroy()}}addColumnGroupResize(Q,z,J){let Z=this.gos.get("skipHeaderOnAutoSize"),$=()=>{let X=[],Y=z.getDisplayedLeafColumns();for(let G of Y)if(!G.getColDef().suppressAutoSize)X.push(G.getColId());if(X.length>0)this.autoSizeCols({colKeys:X,skipHeader:Z,stopAtGroup:z,source:"uiColumnResized"});J()};return Q.addEventListener("dblclick",$),()=>Q.removeEventListener("dblclick",$)}sizeColumnsToFitGridBody(Q,z){if(!this.isAlive())return;let J=U8(this.beans);if(J>0){this.sizeColumnsToFit(J,"sizeColumnsToFit",!1,Q);return}if(z===void 0)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(Q,100)},0);else if(z===100)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(Q,500)},100);else if(z===500)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(Q,-1)},500);else R(29)}sizeColumnsToFit(Q,z="sizeColumnsToFit",J,Z){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(Q,z,J,Z));return}let{beans:$}=this,X=Z?.animate??!0;if(X)b1($,!0);let Y={};for(let{key:F,...D}of Z?.columnLimits??[])Y[typeof F==="string"?F:F.getColId()]=D;let G=$.visibleCols.allCols;if(Q<=0||!G.length)return;let q=NQ(G);if(Z?.onlyScaleUp&&q>Q)return;if(Q===q){if(G.every((D)=>{if(D.colDef.suppressSizeToFit)return!0;let M=Y?.[D.getId()],k=M?.minWidth??Z?.defaultMinWidth,f=M?.maxWidth??Z?.defaultMaxWidth,A=D.getActualWidth();return(k==null||A>=k)&&(f==null||A<=f)}))return}let _=[],U=[];for(let F of G){let D=Z?.colKeys?.some((M)=>PQ(F,M))??!0;if(F.getColDef().suppressSizeToFit||!D)U.push(F);else _.push(F)}let W=_.slice(0),B=!1,E=(F)=>{$0(_,F),U.push(F)},K={};for(let F of _){if(Z?.onlyScaleUp)K[F.getColId()]=F.getActualWidth();F.resetActualWidth(z);let D=Y?.[F.getId()],M=D?.minWidth??Z?.defaultMinWidth??-1/0,k=D?.maxWidth??Z?.defaultMaxWidth??1/0,f=F.getActualWidth(),A=Math.max(Math.min(f,k),M);if(A!=f)F.setActualWidth(A,z,!0)}while(!B){B=!0;let F=Q-NQ(U);if(F<=0)for(let D of _){let M=Y?.[D.getId()]?.minWidth??Z?.defaultMinWidth??D.minWidth;D.setActualWidth(M,z,!0)}else{let D=F/NQ(_),M=F;for(let k=_.length-1;k>=0;k--){let f=_[k],A=f.getColId(),O=K[A],v=Y?.[A],I=v?.minWidth??Z?.defaultMinWidth??O,C=v?.maxWidth??Z?.defaultMaxWidth,m=Math.max(I??-1/0,f.getMinWidth()),w=Math.min(C??1/0,f.getMaxWidth()),a=Math.round(f.getActualWidth()*D);if(aw)a=w,E(f),B=!1;else if(k===0)a=M;f.setActualWidth(a,z,!0),M-=a}}}for(let F of W)F.fireColumnWidthChangedEvent(z);let L=$.visibleCols;if(L.setLeftValues(z),L.updateBodyWidths(),J)return;if(L1(this.eventSvc,W,!0,z),X)b1($,!1)}applyAutosizeStrategy(){let{gos:Q,colDelayRenderSvc:z}=this.beans,J=Q.get("autoSizeStrategy");if(J?.type!=="fitGridWidth"&&J?.type!=="fitProvidedWidth")return;setTimeout(()=>{if(!this.isAlive())return;let Z=J.type;if(Z==="fitGridWidth"){let{columnLimits:$,defaultMinWidth:X,defaultMaxWidth:Y}=J,G=$?.map(({colId:q,minWidth:H,maxWidth:_})=>({key:q,minWidth:H,maxWidth:_}));this.sizeColumnsToFitGridBody({defaultMinWidth:X,defaultMaxWidth:Y,columnLimits:G})}else if(Z==="fitProvidedWidth")this.sizeColumnsToFit(J.width,"sizeColumnsToFit");z?.revealColumns(Z)})}onFirstDataRendered({colIds:Q,...z}){setTimeout(()=>{if(!this.isAlive())return;let J="autosizeColumns";if(Q)this.autoSizeCols({...z,source:J,colKeys:Q});else this.autoSizeAllColumns({...z,source:J});this.beans.colDelayRenderSvc?.revealColumns(z.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(let Q of this.resizeOperationQueue)Q();this.resizeOperationQueue=[]}pushResizeOperation(Q){this.resizeOperationQueue.push(Q)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function CK(Q,z,J={}){let Z=J.minWidth??Q.getMinWidth();if(z$)z=$;return z}function U8({ctrlsSvc:Q,scrollVisibleSvc:z}){let J=Q.getGridBodyCtrl(),$=J.isVerticalScrollShowing()?z.getScrollbarWidth():0;return xz(J.eGridBody)-$}var W8="ag-animate-autosize";function b1({ctrlsSvc:Q,gos:z},J){if(!z.get("animateColumnResizing")||z.get("enableRtl")||!Q.isAlive())return;let Z=Q.getGridBodyCtrl().eGridBody.classList;if(J)Z.add(W8);else Z.remove(W8)}var ZX={moduleName:"ColumnAutoSize",version:p,beans:[IK],apiFunctions:{sizeColumnsToFit:TK,autoSizeColumns:JX,autoSizeAllColumns:vK},dependsOn:[L$],css:[PK]};var bK=class extends j{constructor(){super(...arguments);this.beanName="gridSerializer"}wireBeans(Q){this.visibleCols=Q.visibleCols,this.colModel=Q.colModel,this.rowModel=Q.rowModel,this.pinnedRowModel=Q.pinnedRowModel}serialize(Q,z={}){let{allColumns:J,columnKeys:Z,skipRowGroups:$,exportRowNumbers:X}=z,Y=this.getColumnsToExport({allColumns:J,skipRowGroups:$,columnKeys:Z,exportRowNumbers:X});return[this.prepareSession(Y),this.prependContent(z),this.exportColumnGroups(z,Y),this.exportHeaders(z,Y),this.processPinnedTopRows(z,Y),this.processRows(z,Y),this.processPinnedBottomRows(z,Y),this.appendContent(z)].reduce((G,q)=>q(G),Q).parse()}processRow(Q,z,J,Z){let $=z.shouldRowBeSkipped||(()=>!1),Y=z.rowPositions!=null||!!z.onlySelected,G=this.gos.get("groupHideOpenParents")&&!Y,q=this.colModel.isPivotMode()?Z.leafGroup:!Z.group,H=!!Z.footer,_=Z.allChildrenCount===1&&Z.childrenAfterGroup?.length===1&&gG(this.gos,Z);if(!q&&!H&&(z.skipRowGroups||_||G)||z.onlySelected&&!Z.isSelected()||z.skipPinnedTop&&Z.rowPinned==="top"||z.skipPinnedBottom&&Z.rowPinned==="bottom"||Z.stub)return;if(Z.level===-1&&!q&&!H)return;if($(y(this.gos,{node:Z})))return;let B=Q.onNewBodyRow(Z);if(J.forEach((E,K)=>{B.onColumn(E,K,Z)}),z.getCustomContentBelowRow){let E=z.getCustomContentBelowRow(y(this.gos,{node:Z}));if(E)Q.addCustomContent(E)}}appendContent(Q){return(z)=>{let J=Q.appendContent;if(J)z.addCustomContent(J);return z}}prependContent(Q){return(z)=>{let J=Q.prependContent;if(J)z.addCustomContent(J);return z}}prepareSession(Q){return(z)=>{return z.prepare(Q),z}}exportColumnGroups(Q,z){return(J)=>{if(!Q.skipColumnGroupHeaders){let Z=new k$,{colGroupSvc:$}=this.beans,X=$?$.createColumnGroups({columns:z,idCreator:Z,pinned:null,isStandaloneStructure:!0}):z;this.recursivelyAddHeaderGroups(X,J,Q.processGroupHeaderCallback)}return J}}exportHeaders(Q,z){return(J)=>{if(!Q.skipColumnHeaders){let Z=J.onNewHeaderRow();z.forEach(($,X)=>{Z.onColumn($,X,void 0)})}return J}}processPinnedTopRows(Q,z){return(J)=>{let Z=this.processRow.bind(this,J,Q,z);if(Q.rowPositions)Q.rowPositions.filter(($)=>$.rowPinned==="top").sort(($,X)=>$.rowIndex-X.rowIndex).map(($)=>this.pinnedRowModel?.getPinnedTopRow($.rowIndex)).forEach(Z);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("top",Z);return J}}processRows(Q,z){return(J)=>{let Z=this.rowModel,$=o(this.gos,Z),X=Hz(this.gos,Z),Y=!$&&Q.onlySelected,G=this.processRow.bind(this,J,Q,z),{exportedRows:q="filteredAndSorted"}=Q;if(Q.rowPositions)Q.rowPositions.filter((H)=>H.rowPinned==null).sort((H,_)=>H.rowIndex-_.rowIndex).map((H)=>Z.getRow(H.rowIndex)).forEach(G);else if(this.colModel.isPivotMode())if($)Z.forEachPivotNode(G,!0,q==="filteredAndSorted");else if(X)Z.forEachNodeAfterFilterAndSort(G,!0);else Z.forEachNode(G);else if(Q.onlySelectedAllPages||Y){let H=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(H),H.forEach(G)}else if(q==="all")Z.forEachNode(G);else if($||X)Z.forEachNodeAfterFilterAndSort(G,!0);else Z.forEachNode(G);return J}}replicateSortedOrder(Q){let{sortSvc:z,rowNodeSorter:J}=this.beans;if(!z||!J)return;let Z=z.getSortOptions(),$=(X,Y)=>{if(X.rowIndex!=null&&Y.rowIndex!=null)return X.rowIndex-Y.rowIndex;if(X.level===Y.level){if(X.parent?.id===Y.parent?.id)return J.compareRowNodes(Z,X,Y)||(X.rowIndex??-1)-(Y.rowIndex??-1);return $(X.parent,Y.parent)}if(X.level>Y.level)return $(X.parent,Y);return $(X,Y.parent)};Q.sort($)}processPinnedBottomRows(Q,z){return(J)=>{let Z=this.processRow.bind(this,J,Q,z);if(Q.rowPositions)Q.rowPositions.filter(($)=>$.rowPinned==="bottom").sort(($,X)=>$.rowIndex-X.rowIndex).map(($)=>this.pinnedRowModel?.getPinnedBottomRow($.rowIndex)).forEach(Z);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("bottom",Z);return J}}getColumnsToExport(Q){let{allColumns:z=!1,skipRowGroups:J=!1,exportRowNumbers:Z=!1,columnKeys:$}=Q,{colModel:X,gos:Y,visibleCols:G}=this,q=X.isPivotMode(),H=(W)=>{if(IQ(W))return!1;return!v0(W)||Z};if($?.length)return X.getColsForKeys($).filter(H);let _=Y.get("treeData"),U=[];if(z&&!q)U=X.getCols();else U=G.allCols;return U=U.filter((W)=>H(W)&&(J&&!_?!mz(W):!0)),U}recursivelyAddHeaderGroups(Q,z,J){let Z=[];for(let $ of Q){let X=$;if(!X.getChildren)continue;for(let Y of X.getChildren()??[])Z.push(Y)}if(Q.length>0&&_0(Q[0]))this.doAddHeaderHeader(z,Q,J);if(Z&&Z.length>0)this.recursivelyAddHeaderGroups(Z,z,J)}doAddHeaderHeader(Q,z,J){let Z=Q.onNewHeaderGroupingRow(),$=0;for(let X of z){let Y=X,G;if(J)G=J(y(this.gos,{columnGroup:Y}));else G=this.beans.colNames.getDisplayNameForColumnGroup(Y,"header");let H=(Y.isExpandable()?Y.getLeafColumns():[]).reduce((_,U,W,B)=>{let E=b(_);if(U.getColumnGroupShow()!=="open"){if(E&&E[1]==null)E[1]=W-1}else if(!E||E[1]!=null)E=[W],_.push(E);if(W===B.length-1&&E&&E[1]==null)E[1]=W;return _},[]);Z.onColumn(Y,G||"",$++,Y.getLeafColumns().length-1,H)}}},S6={moduleName:"SharedExport",version:p,beans:[bK]},O6=class extends j{getFileName(Q){let z=this.getDefaultFileExtension();if(!Q?.length)Q=this.getDefaultFileName();return Q.includes(".")?Q:`${Q}.${z}`}getData(Q){return this.beans.gridSerializer.serialize(this.createSerializingSession(Q),Q)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}};function dZ(Q,z){let J=document.defaultView||window;if(!J){R(52);return}let Z=document.createElement("a"),$=J.URL.createObjectURL(z);Z.setAttribute("href",$),Z.setAttribute("download",Q),Z.style.display="none",document.body.appendChild(Z),Z.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:J})),Z.remove(),J.setTimeout(()=>{J.URL.revokeObjectURL($)},0)}var P6=class{constructor(Q){this.valueFrom="data";let{colModel:z,rowGroupColsSvc:J,colNames:Z,valueSvc:$,gos:X,processCellCallback:Y,processHeaderCallback:G,processGroupHeaderCallback:q,processRowGroupCallback:H,valueFrom:_}=Q;if(this.colModel=z,this.rowGroupColsSvc=J,this.colNames=Z,this.valueSvc=$,this.gos=X,this.processCellCallback=Y,this.processHeaderCallback=G,this.processGroupHeaderCallback=q,this.processRowGroupCallback=H,_)this.valueFrom=_}prepare(Q){}extractHeaderValue(Q){return this.getHeaderName(this.processHeaderCallback,Q)??""}extractRowCellValue(Q){let{column:z,node:J,currentColumnIndex:Z,accumulatedRowIndex:$,type:X,useRawFormula:Y}=Q,G=Z===0&&G9(this.gos,J,this.colModel.isPivotMode());if(this.processRowGroupCallback&&(this.gos.get("treeData")||J.group)&&(z.isRowGroupDisplayed(J.rowGroupColumn?.getColId()??"")||G))return{value:this.processRowGroupCallback(y(this.gos,{column:z,node:J}))??""};if(this.processCellCallback)return{value:this.processCellCallback(y(this.gos,{accumulatedRowIndex:$,column:z,node:J,value:this.valueSvc.getValueForDisplay({column:z,node:J,from:this.valueFrom}).value,type:X,parseValue:(E)=>this.valueSvc.parseValue(z,J,E,this.valueSvc.getValue(z,J,this.valueFrom)),formatValue:(E)=>this.valueSvc.formatValue(z,J,E)??E}))??""};let q=this.gos.get("treeData"),H=this.valueSvc,_=J.level===-1&&J.footer,U=z.colDef.showRowGroup===!0&&(J.group||q);if(!_&&(G||U)){let E="",K=J;while(K&&K.level!==-1){let{value:L,valueFormatted:F}=H.getValueForDisplay({column:G?void 0:z,node:K,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});E=` -> ${F??L??""}${E}`,K=K.parent}return{value:E,valueFormatted:E}}let{value:W,valueFormatted:B}=H.getValueForDisplay({column:z,node:J,includeValueFormatted:!0,exporting:!0,useRawFormula:Y,from:this.valueFrom});return{value:W??"",valueFormatted:B}}getHeaderName(Q,z){if(Q)return Q(y(this.gos,{column:z}));return this.colNames.getDisplayNameForColumn(z,"csv",!0)}},B8=`\r +`,yK=class extends P6{constructor(Q){super(Q);this.config=Q,this.isFirstLine=!0,this.result="";let{suppressQuotes:z,columnSeparator:J}=Q;this.suppressQuotes=z,this.columnSeparator=J}addCustomContent(Q){if(!Q)return;if(typeof Q==="string"){if(!/^\s*\n/.test(Q))this.beginNewLine();Q=Q.replace(/\r?\n/g,B8),this.result+=Q}else Q.forEach((z)=>{this.beginNewLine(),z.forEach((J,Z)=>{if(Z!==0)this.result+=this.columnSeparator;if(this.result+=this.putInQuotes(J.data.value||""),J.mergeAcross)this.appendEmptyCells(J.mergeAcross)})})}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(Q,z,J,Z){if(J!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(z),this.appendEmptyCells(Z)}appendEmptyCells(Q){for(let z=1;z<=Q;z++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(Q,z){if(z!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(this.extractHeaderValue(Q))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(Q,z,J){if(z!=0)this.result+=this.columnSeparator;let Z=this.extractRowCellValue({column:Q,node:J,currentColumnIndex:z,accumulatedRowIndex:z,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(Z.valueFormatted??Z.value)}putInQuotes(Q){if(this.suppressQuotes)return Q;if(Q===null||Q===void 0)return'""';let z;if(typeof Q==="string")z=Q;else if(typeof Q.toString==="function")z=Q.toString();else R(53),z="";return'"'+z.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){if(!this.isFirstLine)this.result+=B8;this.isFirstLine=!1}},xK=class extends O6{constructor(){super(...arguments);this.beanName="csvCreator"}getMergedParams(Q){let z=this.gos.get("defaultCsvExportParams");return Object.assign({},z,Q)}export(Q){if(this.isExportSuppressed()){R(51);return}let z=()=>{let Z=this.getMergedParams(Q),$=this.getData(Z),X=new Blob(["\uFEFF",$],{type:"text/plain"}),Y=Z.fileName,G=typeof Y==="function"?Y(y(this.gos,{})):Y;dZ(this.getFileName(G),X)},{overlays:J}=this.beans;if(J)J.showExportOverlay(z);else z()}exportDataAsCsv(Q){this.export(Q)}getDataAsCsv(Q,z=!1){let J=z?Object.assign({},Q):this.getMergedParams(Q);return this.getData(J)}getDefaultFileExtension(){return"csv"}createSerializingSession(Q){let{colModel:z,colNames:J,rowGroupColsSvc:Z,valueSvc:$,gos:X}=this.beans,{processCellCallback:Y,processHeaderCallback:G,processGroupHeaderCallback:q,processRowGroupCallback:H,suppressQuotes:_,columnSeparator:U,valueFrom:W}=Q;return new yK({colModel:z,colNames:J,valueSvc:$,gos:X,processCellCallback:Y||void 0,processHeaderCallback:G||void 0,processGroupHeaderCallback:q||void 0,processRowGroupCallback:H||void 0,suppressQuotes:_||!1,columnSeparator:U||",",rowGroupColsSvc:Z,valueFrom:W})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function wK(Q,z){return Q.csvCreator?.getDataAsCsv(z)}function NK(Q,z){Q.csvCreator?.exportDataAsCsv(z)}var $X={moduleName:"CsvExport",version:p,beans:[xK],apiFunctions:{getDataAsCsv:wK,exportDataAsCsv:NK},dependsOn:[S6]},XX=class extends j0{constructor(Q,z){super();if(this.ctrl=Q,z)this.beans=z}postConstruct(){this.refreshTooltip()}setBrowserTooltip(Q,z){let Z=this.ctrl.getGui();if(!Z)return;if(Q!=null&&(Q!=""||z))Z.setAttribute("title",Q);else Z.removeAttribute("title")}updateTooltipText(){let{getTooltipValue:Q}=this.ctrl;if(Q)this.tooltip=Q()}createTooltipFeatureIfNeeded(){if(this.tooltipManager==null){let Q=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);if(Q)this.tooltipManager=this.createBean(Q,this.beans.context)}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(Q){this.tooltip=Q,this.refreshTooltip()}refreshTooltip(Q){if(this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips)this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context);else this.setBrowserTooltip(Q?"":null,Q),this.createTooltipFeatureIfNeeded()}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},gK=1000,hK=1000,E8=100,K8,mJ=!1,uK=class extends j0{constructor(Q,z){super();this.tooltipCtrl=Q,this.getTooltipValue=z,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(Q){this.popupSvc=Q.popupSvc}postConstruct(){if(this.gos.get("tooltipInteraction"))this.interactionEnabled=!0;this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");let Q=this.tooltipCtrl.getGui();if(this.tooltipTrigger===0)this.addManagedListeners(Q,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)});if(this.tooltipTrigger===1)this.addManagedListeners(Q,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)});if(this.addManagedListeners(Q,{mousemove:this.onMouseMove.bind(this)}),!this.interactionEnabled)this.addManagedListeners(Q,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(Q){let z=this.gos.get(Q);return Math.max(200,z)}getTooltipDelay(Q){return this.tooltipCtrl[`getTooltip${Q}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${Q}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){let Q=this.gos.get("tooltipTrigger");if(!Q||Q==="hover")return 0;return 1}onMouseEnter(Q){if(this.interactionEnabled&&this.interactiveTooltipTimeoutId)this.unlockService(),this.startHideTimeout();if(bz())return;if(mJ)this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(Q)},E8);else this.prepareToShowTooltip(Q)}onMouseMove(Q){if(this.lastMouseEvent)this.lastMouseEvent=Q;if(this.tooltipMouseTrack&&this.state===2&&this.tooltipComp)this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){if(this.interactionEnabled)this.lockService();else this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(Q){let z=Q.relatedTarget,J=this.tooltipCtrl.getGui(),Z=this.tooltipComp?.getGui();if(this.isInteractingWithTooltip||J.contains(z)||this.interactionEnabled&&Z?.contains(z))return;this.setToDoNothing()}onKeyDown(){if(this.isInteractingWithTooltip)this.isInteractingWithTooltip=!1;this.setToDoNothing()}prepareToShowTooltip(Q){if(this.state!=0||mJ)return;let z=0;if(Q)z=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show");this.lastMouseEvent=Q||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),z),this.state=1}isLastTooltipHiddenRecently(){return Date.now()-K8this.hideTooltip(!0),...z.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;let Z=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(J,Z)}hideTooltip(Q){if(!Q&&this.isInteractingWithTooltip)return;if(this.tooltipComp)this.destroyTooltipComp(),K8=Date.now();if(this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),Q)this.isInteractingWithTooltip=!1;this.setToDoNothing(!0)}newTooltipComponentCallback(Q,z){if(this.state!==2||this.tooltipInstanceCount!==Q){this.destroyBean(z);return}let Z=z.getGui();if(this.tooltipComp=z,!Z.classList.contains("ag-tooltip"))Z.classList.add("ag-tooltip-custom");if(this.tooltipTrigger===0)Z.classList.add("ag-tooltip-animate");if(this.interactionEnabled)Z.classList.add("ag-tooltip-interactive");let $=this.getLocaleTextFunc(),X=this.popupSvc?.addPopup({eChild:Z,ariaLabel:$("ariaLabelTooltip","Tooltip")});if(X)this.tooltipPopupDestroyFunc=X.hideFunc;if(this.positionTooltip(),this.tooltipTrigger===1){let Y=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:Y}),this.setEventHandlers(Y)}if(this.interactionEnabled){if([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(Z,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(Y0(this.beans),{keydown:(Y)=>{if(!Z.contains(Y?.target))this.onKeyDown()}}),this.tooltipTrigger===1)[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(Z,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)})}this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:Z,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){if(this.isTooltipFocused())return;this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){let Q=this.tooltipComp?.getGui(),z=d(this.beans);return!!Q&&Q.contains(z)}onTooltipFocusOut(Q){let z=this.tooltipCtrl.getGui();if(this.isTooltipFocused())return;if(this.isInteractingWithTooltip=!1,z.contains(Q.relatedTarget))this.startHideTimeout();else this.hideTooltip()}positionTooltip(){let Q={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};if(this.lastMouseEvent)this.popupSvc?.positionPopupUnderMouseEvent({...Q,mouseEvent:this.lastMouseEvent});else this.popupSvc?.positionPopupByComponent({...Q,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");let Q=this.tooltipPopupDestroyFunc,z=this.tooltipComp,J=this.tooltipTrigger===0?hK:0;window.setTimeout(()=>{Q(),this.destroyBean(z)},J),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(let Q of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])if(Q)Q();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){mJ=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},E8)}unlockService(){mJ=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){if(!this.showTooltipTimeoutId)return;window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0}clearHideTimeout(){if(!this.hideTooltipTimeoutId)return;window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0}clearInteractiveTimeout(){if(!this.interactiveTooltipTimeoutId)return;window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}},mK=class extends XX{constructor(Q,z,J){super(Q,J);this.highlightTracker=z,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",({currentValue:Q})=>{this.setTooltipMode(Q)}),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(Q){if(this.tooltipMode!==1)return;if(Q.highlighted)this.attemptToShowTooltip();else this.attemptToHideTooltip()}setTooltipMode(Q="focus"){this.tooltipMode=Q==="focus"?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},cK=class extends a5{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(Q){let{value:z}=Q,J=this.getGui();J.textContent=ZJ(z);let Z=Q.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();J.classList.add(`ag-${Z}-tooltip`)}},pK=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",cJ=0,iK=200,nK=class extends j0{constructor(){super(...arguments);this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){let Q=this.gos.get("popupParent");if(Q)return Q;return this.getDefaultPopupParent()}positionPopupUnderMouseEvent(Q){let{ePopup:z,nudgeX:J,nudgeY:Z,skipObserver:$}=Q;this.positionPopup({ePopup:z,nudgeX:J,nudgeY:Z,keepWithinBounds:!0,skipObserver:$,updatePosition:()=>this.calculatePointerAlign(Q.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(Q.additionalParams,Q.type,Q.ePopup,null,Q.mouseEvent)})}calculatePointerAlign(Q){let z=this.getParentRect();return{x:Q.clientX-z.left,y:Q.clientY-z.top}}positionPopupByComponent(Q){let{ePopup:z,nudgeX:J,nudgeY:Z,keepWithinBounds:$,eventSource:X,alignSide:Y="left",position:G="over",type:q}=Q,H=X.getBoundingClientRect(),_=this.getParentRect();this.setAlignedTo(X,z);let U=()=>{let W=H.left-_.left;if(Y==="right")W-=z.offsetWidth-H.width;let B;if(G==="over")B=H.top-_.top,this.setAlignedStyles(z,"over");else if(this.setAlignedStyles(z,"under"),this.shouldRenderUnderOrAbove(z,H,_,Q.nudgeY||0)==="under")B=H.top-_.top+H.height;else B=H.top-z.offsetHeight-(Z||0)*2-_.top;return{x:W,y:B}};this.positionPopup({ePopup:z,nudgeX:J,nudgeY:Z,keepWithinBounds:$,updatePosition:U,postProcessCallback:()=>this.callPostProcessPopup(Q.additionalParams,q,z,X,null)})}positionPopupForMenu(Q){let{eventSource:z,ePopup:J,event:Z}=Q,$=z.getBoundingClientRect(),X=this.getParentRect();this.setAlignedTo(z,J);let Y=!1,G=()=>{let q=this.keepXYWithinBounds(J,$.top-X.top,0),H=J.clientWidth>0?J.clientWidth:200;if(!Y)J.style.minWidth=`${H}px`,Y=!0;let U=X.right-X.left-H,W;if(this.gos.get("enableRtl")){if(W=E(),W<0)W=B(),this.setAlignedStyles(J,"left");if(W>U)W=0,this.setAlignedStyles(J,"right")}else{if(W=B(),W>U)W=E(),this.setAlignedStyles(J,"right");if(W<0)W=0,this.setAlignedStyles(J,"left")}return{x:W,y:q};function B(){return $.right-X.left-2}function E(){return $.left-X.left-H}};this.positionPopup({ePopup:J,keepWithinBounds:!0,updatePosition:G,postProcessCallback:()=>this.callPostProcessPopup(Q.additionalParams,"subMenu",J,z,Z instanceof MouseEvent?Z:void 0)})}shouldRenderUnderOrAbove(Q,z,J,Z){let $=J.bottom-z.bottom,X=z.top-J.top,Y=Q.offsetHeight+Z;if($>Y)return"under";if(X>Y||X>$)return"above";return"under"}setAlignedStyles(Q,z){let J=this.getPopupIndex(Q);if(J===-1)return;let Z=this.popupList[J],{alignedToElement:$}=Z;if(!$)return;let X=["right","left","over","above","under"];for(let Y of X)$.classList.remove(`ag-has-popup-positioned-${Y}`),Q.classList.remove(`ag-popup-positioned-${Y}`);if(!z)return;$.classList.add(`ag-has-popup-positioned-${z}`),Q.classList.add(`ag-popup-positioned-${z}`)}setAlignedTo(Q,z){let J=this.getPopupIndex(z);if(J!==-1){let Z=this.popupList[J];Z.alignedToElement=Q}}positionPopup(Q){let{ePopup:z,keepWithinBounds:J,nudgeX:Z,nudgeY:$,skipObserver:X,updatePosition:Y}=Q,G={width:0,height:0},q=(H=!1)=>{let{x:_,y:U}=Y();if(H&&z.clientWidth===G.width&&z.clientHeight===G.height)return;if(G.width=z.clientWidth,G.height=z.clientHeight,Z)_+=Z;if($)U+=$;if(J)_=this.keepXYWithinBounds(z,_,1),U=this.keepXYWithinBounds(z,U,0);if(z.style.left=`${_}px`,z.style.top=`${U}px`,Q.postProcessCallback)Q.postProcessCallback()};if(q(),!X){let H=DQ(this.beans,z,()=>q(!0));setTimeout(()=>H(),iK)}}getParentRect(){let Q=Y0(this.beans),z=this.getPopupParent();if(z===Q.body)z=Q.documentElement;else if(getComputedStyle(z).position==="static")z=z.offsetParent;return N8(z)}keepXYWithinBounds(Q,z,J){let Z=J===0,$=Z?"clientHeight":"clientWidth",X=Z?"top":"left",Y=Z?"height":"width",G=Z?"scrollTop":"scrollLeft",q=Y0(this.beans),H=q.documentElement,_=this.getPopupParent(),U=Q.getBoundingClientRect(),W=_.getBoundingClientRect(),B=q.documentElement.getBoundingClientRect(),E=_===q.body,K=Math.ceil(U[Y]),F=E?(Z?x8:w8)(H)+H[G]:_[$];if(E)F-=Math.abs(B[X]-W[X]);let D=F-K;return Math.min(Math.max(z,0),Math.max(D,0))}addPopup(Q){let{eChild:z,ariaLabel:J,ariaOwns:Z,alwaysOnTop:$,positionCallback:X,anchorToElement:Y}=Q,G=this.getPopupIndex(z);if(G!==-1)return{hideFunc:this.popupList[G].hideFunc};this.initialisePopupPosition(z);let q=this.createPopupWrapper(z,!!$,J,Z),H=this.addEventListenersToPopup({...Q,wrapperEl:q});if(X)X();return this.addPopupToPopupList(z,q,H,Y),{hideFunc:H}}initialisePopupPosition(Q){let J=this.getPopupParent().getBoundingClientRect();if(!T(Q.style.top))Q.style.top=`${J.top*-1}px`;if(!T(Q.style.left))Q.style.left=`${J.left*-1}px`}createPopupWrapper(Q,z,J,Z){let $=this.getPopupParent(),{environment:X,gos:Y}=this.beans,G=K0({tag:"div"});if(X.applyThemeClasses(G),G.classList.add("ag-popup"),Q.classList.add(Y.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),!Q.hasAttribute("role"))H0(Q,"dialog");if(J)E0(Q,J);else if(Z)Q.id||(Q.id=`popup-component-${cJ}`),W7(Z,Q.id);if(G.appendChild(Q),$.appendChild(G),z)this.setAlwaysOnTop(Q,!0);else this.bringPopupToFront(Q);return G}addEventListenersToPopup(Q){let z=this.beans,J=Y0(z),{wrapperEl:Z,eChild:$,closedCallback:X,afterGuiAttached:Y,closeOnEsc:G,modal:q,ariaOwns:H}=Q,_=!1,U=(K)=>{if(!Z.contains(d(z)))return;if(K.key===V.ESCAPE&&!this.isStopPropagation(K))E({keyboardEvent:K})},W=(K)=>E({mouseEvent:K}),B=(K)=>E({touchEvent:K}),E=(K={})=>{let{mouseEvent:L,touchEvent:F,keyboardEvent:D,forceHide:M}=K;if(!M&&(this.isEventFromCurrentPopup({mouseEvent:L,touchEvent:F},$)||_))return;if(_=!0,Z.remove(),J.removeEventListener("keydown",U),J.removeEventListener("mousedown",W),J.removeEventListener("touchstart",B),J.removeEventListener("contextmenu",W),this.eventSvc.removeListener("dragStarted",W),X)X(L||F||D);this.removePopupFromPopupList($,H)};if(Y)Y({hidePopup:E});return window.setTimeout(()=>{if(G)J.addEventListener("keydown",U);if(q)J.addEventListener("mousedown",W),this.eventSvc.addListener("dragStarted",W),J.addEventListener("touchstart",B),J.addEventListener("contextmenu",W)},0),E}addPopupToPopupList(Q,z,J,Z){if(this.popupList.push({element:Q,wrapper:z,hideFunc:J,instanceId:cJ,isAnchored:!!Z}),Z)this.setPopupPositionRelatedToElement(Q,Z);cJ=cJ+1}getPopupIndex(Q){return this.popupList.findIndex((z)=>z.element===Q)}setPopupPositionRelatedToElement(Q,z){let J=this.getPopupIndex(Q);if(J===-1)return;let Z=this.popupList[J];if(Z.stopAnchoringPromise)Z.stopAnchoringPromise.then((X)=>X&&X());if(Z.stopAnchoringPromise=void 0,Z.isAnchored=!1,!z)return;let $=this.keepPopupPositionedRelativeTo({element:z,ePopup:Q,hidePopup:Z.hideFunc});return Z.stopAnchoringPromise=$,Z.isAnchored=!0,$}removePopupFromPopupList(Q,z){if(this.setAlignedStyles(Q,null),this.setPopupPositionRelatedToElement(Q,null),z)W7(z,null);this.popupList=this.popupList.filter((J)=>J.element!==Q)}keepPopupPositionedRelativeTo(Q){let z=this.getPopupParent(),J=z.getBoundingClientRect(),{element:Z,ePopup:$}=Q,X=Z.getBoundingClientRect(),Y=(U)=>Number.parseInt(U.substring(0,U.length-1),10),G=(U,W)=>{let B=J[U]-X[U],E=Y($.style[U]);return{initialDiff:B,lastDiff:B,initial:E,last:E,direction:W}},q=G("top",0),H=G("left",1),_=this.beans.frameworkOverrides;return new g((U)=>{_.wrapIncoming(()=>{Hq(()=>{let W=z.getBoundingClientRect(),B=Z.getBoundingClientRect();if(B.top==0&&B.left==0&&B.height==0&&B.width==0){Q.hidePopup();return}let K=(L,F)=>{let D=Y($.style[F]);if(L.last!==D)L.initial=D,L.last=D;let M=W[F]-B[F];if(M!=L.lastDiff){let k=this.keepXYWithinBounds($,L.initial+L.initialDiff-M,L.direction);$.style[F]=`${k}px`,L.last=k}L.lastDiff=M};K(q,"top"),K(H,"left")},200).then((W)=>{U(()=>{if(W!=null)window.clearInterval(W)})})},"popupPositioning")})}isEventFromCurrentPopup(Q,z){let{mouseEvent:J,touchEvent:Z}=Q,$=J?J:Z;if(!$)return!1;let X=this.getPopupIndex(z);if(X===-1)return!1;for(let Y=X;YQ.element)}hasAnchoredPopup(){return this.popupList.some((Q)=>Q.isAnchored)}isStopPropagation(Q){return zQ(Q)}},nz={moduleName:"Popup",version:p,beans:[dK]};function KZ(Q){return Q.get("tooltipShowMode")==="whenTruncated"}function tZ(Q,z){return KZ(Q)?i1(z):void 0}var tK=(Q,z)=>{let J=Q;if(typeof J.getTranslatedMessage==="function")return J.getTranslatedMessage(z);return Q.message},k5=(Q,z,J)=>{let{editModelSvc:Z}=Q,$=Z?.getCellValidationModel()?.getCellValidation(z)?.errorMessages,X=Z?.getRowValidationModel().getRowValidation(z)?.errorMessages,Y=$||X;return Y?.length?Y.join(J("tooltipValidationErrorSeparator",". ")):void 0},rK=(Q,z)=>{if(!KZ(Q.gos))return;if(z.isCellRenderer()){let Z=z.column.getColDef();if(!(!!Z.showRowGroup||Z.cellRenderer==="agGroupCellRenderer"))return;return i1(()=>{let X=z.eGui;return X.querySelector(".ag-group-value")||X.querySelector(".ag-cell-value")||X})}return i1(()=>{let Z=z.eGui;return Z.children.length===0?Z:Z.querySelector(".ag-cell-value")})},sK=(Q,z,J)=>{let{editSvc:Z}=Q,{column:$}=z,X=rK(Q,z),Y=()=>{if(Z?.isEditing(z))return!1;if(!X)return!0;if(!$.isTooltipEnabled())return!1;return X()};return{shouldDisplayDefault:Y,shouldDisplayColumnTooltip:Y,shouldDisplayCustomTooltip:J??Y}},lK=({beans:Q,ctrl:z,value:J,displayFunctions:Z,translate:$})=>{let{editSvc:X,formula:Y,gos:G}=Q,{column:q,rowNode:H}=z;if(Y?.active&&q.isAllowFormula()){let L=Y.getFormulaError(q,H);if(L)return{value:tK(L,$),location:"cellFormula",shouldDisplay:()=>!!Y?.getFormulaError(q,H)}}if(!X?.isEditing(z)){let L=k5(Q,z,$);if(L)return{value:L,location:"cellEditor",shouldDisplay:()=>!X?.isEditing(z)&&!!k5(Q,z,$)}}let{shouldDisplayCustomTooltip:U,shouldDisplayColumnTooltip:W}=Z;if(J!=null)return{value:J,location:"cell",shouldDisplay:U};let B=q.getColDef(),E=H.data;if(B.tooltipField&&T(E))return{value:h1(E,B.tooltipField,q.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:W};let K=B.tooltipValueGetter;if(K)return{value:K(y(G,{location:"cell",colDef:q.getColDef(),column:q,rowIndex:z.cellPosition.rowIndex,node:H,data:H.data,value:z.value,valueFormatted:z.valueFormatted})),location:"cell",shouldDisplay:W};return null},aK=class extends j{constructor(){super(...arguments);this.beanName="tooltipSvc"}setupHeaderTooltip(Q,z,J,Z){if(Q)z.destroyBean(Q);let $=this.gos,X=KZ($),{column:Y,eGui:G}=z,q=Y.getColDef();if(!Z&&X&&!q.headerComponent)Z=i1(()=>G.querySelector(".ag-header-cell-text"));let H="header",_="header",U=this.beans.colNames.getDisplayNameForColumn(Y,_,!0),W=J??U,B={getGui:()=>G,getLocation:()=>H,getTooltipValue:()=>J??q?.headerTooltipValueGetter?.(y($,{location:H,colDef:q,column:Y,value:W,valueFormatted:U}))??q?.headerTooltip,shouldDisplayTooltip:Z,getAdditionalParams:()=>({column:Y,colDef:Y.getColDef()})},E=this.createTooltipFeature(B);if(E)E=z.createBean(E),z.setRefreshFunction("tooltip",()=>E.refreshTooltip());return E}setupHeaderGroupTooltip(Q,z,J,Z){if(Q)z.destroyBean(Q);let $=this.gos,X=KZ($),{column:Y,eGui:G}=z,q=Y.getColGroupDef();if(!Z&&X&&!q?.headerGroupComponent)Z=i1(()=>G.querySelector(".ag-header-group-text"));let H="headerGroup",_="header",U=this.beans.colNames.getDisplayNameForColumnGroup(Y,_),W=J??U,B={getGui:()=>G,getLocation:()=>H,getTooltipValue:()=>J??q?.headerTooltipValueGetter?.(y($,{location:H,colDef:q,column:Y,value:W,valueFormatted:U}))??q?.headerTooltip,shouldDisplayTooltip:Z,getAdditionalParams:()=>{let K={column:Y};if(q)K.colDef=q;return K}},E=this.createTooltipFeature(B);return E?z.createBean(E):E}enableCellTooltipFeature(Q,z,J){let{beans:Z}=this,{column:$,rowNode:X}=Q,Y=sK(Z,Q,J),G=this.getLocaleTextFunc(),q=null,H=()=>{return q=lK({beans:Z,ctrl:Q,value:z,displayFunctions:Y,translate:G}),q},U={getGui:()=>Q.eGui,getLocation:()=>q?.location??"cell",getTooltipValue:()=>H()?.value,shouldDisplayTooltip:()=>{let W=q??H();if(!W)return!1;return W.shouldDisplay?W.shouldDisplay():!0},getAdditionalParams:()=>({column:$,colDef:$.getColDef(),rowIndex:Q.cellPosition.rowIndex,node:X,data:X.data,valueFormatted:Q.valueFormatted})};return this.createTooltipFeature(U,Z)}setupFullWidthRowTooltip(Q,z,J,Z){let $={getGui:()=>z.getFullWidthElement(),getTooltipValue:()=>J,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:Z},X=this.beans,Y=X.context;if(Q)z.destroyBean(Q,Y);let G=this.createTooltipFeature($,X);if(!G)return;return z.createBean(G,Y)}setupCellEditorTooltip(Q,z){let{beans:J}=this,{context:Z}=J,$=z.getValidationElement?.(!0)||!z.isPopup?.()&&Q.eGui;if(!$)return;let X={getGui:()=>$,getTooltipValue:()=>k5(J,Q,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{let{editModelSvc:G}=J,q=G?.getRowValidationModel()?.getRowValidationMap(),H=G?.getCellValidationModel()?.getCellValidationMap(),_=!!q&&q.size>0,U=!!H&&H.size>0;return _||U}},Y=this.createTooltipFeature(X,J);if(!Y)return;return Q.createBean(Y,Z)}initCol(Q){let{colDef:z}=Q;Q.tooltipEnabled=T(z.tooltipField)||T(z.tooltipValueGetter)||T(z.tooltipComponent)}createTooltipFeature(Q,z){return this.beans.registry.createDynamicBean("tooltipFeature",!1,Q,z)}},oK=class extends uK{createTooltipComp(Q,z){Nq(this.beans.userCompFactory,Q)?.newAgStackInstance().then(z)}setEventHandlers(Q){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:Q})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},eK={moduleName:"Tooltip",version:p,beans:[aK],dynamicBeans:{tooltipFeature:XX,highlightTooltipFeature:mK,tooltipStateManager:oK},userComponents:{agTooltipComponent:cK},dependsOn:[nz],css:[pK]};var QL=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}";var zL=class extends j${constructor(Q,z="ag-text-field",J="text"){super(Q,z,J)}postConstruct(){if(super.postConstruct(),this.config.allowedCharPattern)this.preventDisallowedCharacters()}setValue(Q,z){let J=this.eInput;if(J.value!==Q)J.value=T(Q)?Q:"";return super.setValue(Q,z)}setStartValue(Q){this.setValue(Q,!0)}setCustomValidity(Q){let z=this.eInput,J=Q.length>0;if(z.setCustomValidity(Q),J)z.reportValidity();S8(z,J)}preventDisallowedCharacters(){let Q=new RegExp(`[${this.config.allowedCharPattern}]`),z=(J)=>{if(!e9(J))return;if(J.key&&!Q.test(J.key))J.preventDefault()};this.addManagedListeners(this.eInput,{keydown:z,paste:(J)=>{if(J.clipboardData?.getData("text")?.split("").some(($)=>!Q.test($)))J.preventDefault()}})}},T6={selector:"AG-INPUT-TEXT-FIELD",component:zL};var JL=class extends tq{constructor(Q){super();this.cellEditorInput=Q,this.eEditor=S}initialiseEditor(Q){let{cellEditorInput:z}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[z.getTemplate()]},z.getAgComponents());let{eEditor:J}=this,{cellStartedEdit:Z,eventKey:$,suppressPreventDefault:X}=Q;J.getInputElement().setAttribute("title",""),z.init(J,Q);let Y,G=!0;if(Z){if(this.focusAfterAttached=!0,$===V.BACKSPACE||$===V.DELETE)Y="";else if($&&$.length===1)if(X)G=!1;else Y=$;else if(Y=z.getStartValue(),$!==V.F2)this.highlightAllOnFocus=!0}else this.focusAfterAttached=!1,Y=z.getStartValue();if(G&&Y!=null)J.setStartValue(Y);this.addGuiEventListener("keydown",(q)=>{let{key:H}=q;if(H===V.PAGE_UP||H===V.PAGE_DOWN)q.preventDefault()})}afterGuiAttached(){let Q=this.getLocaleTextFunc(),z=this.eEditor;if(z.setInputAriaLabel(Q("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;if(!cz())z.getFocusableElement().focus();let J=z.getInputElement();if(this.highlightAllOnFocus)J.select();else this.cellEditorInput.setCaret?.()}focusIn(){let{eEditor:Q}=this,z=Q.getFocusableElement(),J=Q.getInputElement();z.focus(),J.select()}getValue(){return this.cellEditorInput.getValue()}agSetEditValue(Q){this.params.value=Q;let z=this.cellEditorInput.getStartValue();this.eEditor.setStartValue(z??null)}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}};var ZL={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},$L=class{constructor(Q){this.getLocaleTextFunc=Q}getTemplate(){return ZL}getAgComponents(){return[T6]}init(Q,z){this.eEditor=Q,this.params=z;let J=z.maxLength;if(J!=null)Q.setMaxLength(J)}getValidationErrors(){let{params:Q}=this,{maxLength:z,getValidationErrors:J}=Q,Z=this.getValue(),$=this.getLocaleTextFunc(),X=[];if(z!=null&&typeof Z==="string"&&Z.length>z)X.push($("maxLengthValidation",`Must be ${z} characters or fewer.`,[String(z)]));if(!X.length)X=null;if(J)return J({value:Z,cellEditorParams:Q,internalErrors:X});return X}getValue(){let{eEditor:Q,params:z}=this,J=Q.getValue();if(!T(J)&&!T(z.value))return z.value;return z.parseValue(J)}getStartValue(){let Q=this.params;return Q.useFormatter||Q.column.getColDef().refData?Q.formatValue(Q.value):Q.value}setCaret(){if(cz())this.eEditor.getInputElement().focus({preventScroll:!0});let Q=this.eEditor,z=Q.getValue(),J=T(z)&&z.length||0;if(J)Q.getInputElement().setSelectionRange(J,J)}},L8=class extends JL{constructor(){super(new $L(()=>this.getLocaleTextFunc()))}};function XL(Q,z){return Q.editModelSvc?.getEditRowDataValue(z,{checkSiblings:!0})}function YL(Q){let z=Q.editModelSvc?.getEditMap(),J=[];return z?.forEach((Z,$)=>{let{rowIndex:X,rowPinned:Y}=$;Z.forEach((G,q)=>{let{editorValue:H,pendingValue:_,sourceValue:U,state:W}=G,B=BQ(G),E=H??_;if(E===P0)E=void 0;let K={newValue:E,oldValue:U,state:W,column:q,colId:q.getColId(),colKey:q.getColId(),rowIndex:X,rowPinned:Y},L=W==="editing";if(L||!L&&B)J.push(K)})}),J}function GL(Q,z=!1){let{editSvc:J}=Q;if(J?.isBatchEditing()){if(z){for(let Z of Q.editModelSvc?.getEditPositions()??[])if(Z.state==="editing")J.revertSingleCellEdit(Z)}else Qz(Q,{persist:!0});eQ(Q,void 0,{cancel:z})}else J?.stopEditing(void 0,{cancel:z,source:"edit",forceStop:!z,forceCancel:z})}function qL(Q,z){let J=s(Q,z);return!!Q.editSvc?.isEditing(J)}function HL(Q,z){let{key:J,colKey:Z,rowIndex:$,rowPinned:X}=z,{editSvc:Y,colModel:G}=Q,q=G.getCol(Z);if(!q){R(12,{colKey:Z});return}let _=M0(Q,{rowIndex:$,rowPinned:X||null,column:q});if(!_){R(290,{rowIndex:$,rowPinned:X});return}if(!Y?.isCellEditable({rowNode:_,column:q},"api"))return;if(X==null)BK(Q,$);WK(Q,Z),Y?.startEditing({rowNode:_,column:q},{event:J?new KeyboardEvent("keydown",{key:J}):void 0,source:"api",editable:!0})}function _L(Q){return Q.editSvc?.validateEdit()||null}var UL={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},WL=class extends a5{constructor(Q){super(UL);this.params=Q}postConstruct(){wz(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){let Q=this.getGui(),z=this.params,J=(Z)=>{if(!_5(this.gos,Z,z.node,z.column,!0))z.onKeyDown(Z)};this.addManagedElementListeners(Q,{keydown:J})}};function BL(Q,{column:z},J,Z,$="ui"){if(J instanceof KeyboardEvent&&(J.key===V.TAB||J.key===V.ENTER||J.key===V.F2||J.key===V.BACKSPACE&&Z))return!0;if(J?.shiftKey&&Q.rangeSvc?.getCellRanges().length!=0)return!1;let Y=z?.getColDef(),G=EL(Q.gos,Y),q=J?.type;if(q==="click"&&J?.detail===1&&G===1)return!0;if(q==="dblclick"&&J?.detail===2&&G===2)return!0;if($==="api")return!!Z;return!1}function EL(Q,z){if(Q.get("suppressClickEdit")===!0)return 0;if(Q.get("singleClickEdit")===!0)return 1;if(z?.singleClickEdit)return 1;return 2}function s2(Q,z){return Q.editModelSvc?.hasEdits(z,{withOpenEditor:!0})??!1}function V5(Q,z){let{column:J,rowNode:Z}=z,$=J.getColDef();if(!Z)return s2(Q,z);let X=$.editable;if(Z.group&&$.groupRowEditable!=null){if(Q.rowGroupingEditValueSvc?.isGroupCellEditable(Z,J))return!0;return s2(Q,z)}if(J.isColumnFunc(Z,X))return!0;return s2(Q,z)}function KL(Q,z,J="ui"){let Z=V5(Q,z);if(Z||J==="ui")return Z;let{rowNode:$,column:X}=z;for(let Y of Q.colModel.getCols())if(Y!==X&&V5(Q,{rowNode:$,column:Y}))return!0;return!1}var LZ=(Q,z=!1)=>{if(Q!==void 0)return BQ(Q)||z&&Q.state==="editing"};function YX(Q,z,J=!1){return LZ(Q.editModelSvc?.getEdit(z),J)}var GX=(Q,z,J)=>{if(!Q)return;for(let Z=0,$=Q.length;Z<$;++Z){let X=Q[Z];if(X.data){if(LZ(z?.getEdit({rowNode:X,column:J}))||LZ(z?.getEdit({rowNode:X.pinnedSibling,column:J})))return!0}if(GX(X.childrenAfterGroup,z,J))return!0}};function qX(Q,z){let{column:J,rowNode:Z}=z;if(Q.gos.get("groupTotalRow")&&!Z?.footer)return!1;return GX(Z?.childrenAfterGroup,Q.editModelSvc,J)}function HX(Q,{rowNode:z,column:J}){if(z=z.pinnedSibling,!z)return;return LZ(Q.editModelSvc?.getEdit({rowNode:z,column:J}))}var LL=class extends j{constructor(Q,z){super();this.cellCtrl=Q,this.beans=z,this.editSvc=z.editSvc,this.editModelSvc=z.editModelSvc}setComp(Q){this.cellComp=Q,this.applyCellStyles()}applyCellStyles(){let{cellCtrl:Q,editSvc:z,beans:J}=this;if(z?.isBatchEditing()&&z.isEditing()){let $=YX(J,Q)||qX(J,Q)||HX(J,Q);this.applyBatchingStyle($)}else this.applyBatchingStyle(!1);let Z=!!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);this.cellComp.toggleCss("ag-cell-editing-error",Z)}applyBatchingStyle(Q){this.cellComp.toggleCss("ag-cell-editing",Q??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(Q&&this.editSvc?.isBatchEditing())??!1)}},FL=class extends j{constructor(Q,z){super();this.rowCtrl=Q,this.beans=z,this.gos=z.gos,this.editSvc=z.editSvc,this.editModelSvc=z.editModelSvc}applyRowStyles(){let{rowCtrl:Q,editModelSvc:z,beans:J}=this,Z=Q.rowNode,$=z?.getEditRow(Z),X=this.editModelSvc?.getRowValidationModel().hasRowValidation({rowNode:Z});if(!$&&Z.pinnedSibling)Z=Z.pinnedSibling,$=z?.getEditRow(Z);if($){let Y=Array.from($.keys()).some((G)=>{let q={rowNode:Z,column:G};return YX(J,q,!0)||qX(J,q)||HX(J,q)});this.applyStyle(X,Y);return}this.applyStyle(X)}applyStyle(Q=!1,z=!1){let J=!!this.editSvc?.isBatchEditing(),Z=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:$})=>{$.toggleCss("ag-row-editing",Z&&z),$.toggleCss("ag-row-batch-edit",Z&&z&&J),$.toggleCss("ag-row-inline-editing",z),$.toggleCss("ag-row-not-inline-editing",!z),$.toggleCss("ag-row-editing-invalid",Z&&z&&Q)})}},DL=({rowModel:Q,pinnedRowModel:z,editModelSvc:J},Z)=>{let $=new Set;Q.forEachNode((X)=>Z.has(X)&&$.add(X)),z?.forEachPinnedRow("top",(X)=>Z.has(X)&&$.add(X)),z?.forEachPinnedRow("bottom",(X)=>Z.has(X)&&$.add(X));for(let X of Z)if(!$.has(X))J.removeEdits({rowNode:X});return $},ML=({editModelSvc:Q},z,J)=>{for(let Z of z)Q?.getEditRow(Z)?.forEach(($,X)=>!J.has(X)&&Q.removeEdits({rowNode:Z,column:X}))},kL=(Q)=>()=>{let z=new Set(Q.colModel.getCols()),J=Q.editModelSvc.getEditMap(!0),Z=new Set(J.keys());ML(Q,DL(Q,Z),z)},VL=new Set(["undo","redo","paste","bulk","rangeSvc"]),fL=new Set(["ui","api"]),_X={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},AL=new Set(Object.keys(_X)),jL=new Set(["paste","rangeSvc","cellClear","redo","undo"]),l2={cancel:!0,source:"api"},RL={cancel:!1,source:"api"},Rz={checkSiblings:!0},lQ={force:!0,suppressFlash:!0},SL={force:!0},OL=class extends j{constructor(){super(...arguments);this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){let{beans:Q}=this;this.model=Q.editModelSvc,this.valueSvc=Q.valueSvc,this.rangeSvc=Q.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:Z})=>{this.stopEditing(void 0,l2),this.createStrategy(Z)});let z=kL(Q),J=()=>{let Z=this.model.getCellValidationModel().getCellValidationMap().size>0,$=this.model.getRowValidationModel().getRowValidationMap().size>0;if(Z||$)this.stopEditing(void 0,l2);else if(this.isEditing())if(this.batch)eQ(Q,this.model.getEditPositions());else this.stopEditing(void 0,RL);return!1};this.addManagedEventListeners({columnPinned:z,columnVisible:z,columnRowGroupChanged:z,rowExpansionStateChanged:z,pinnedRowsChanged:z,displayedRowsChanged:z,sortChanged:J,filterChanged:J,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){if(this.batch)return;this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,l2)}stopBatchEditing(Q){if(!this.batch)return;if(Q)this.stopEditing(void 0,Q);if(this.batchStartDispatched)this.dispatchBatchStopped(new Map,!1);this.batch=!1,this.batchStartDispatched=!1}ensureBatchStarted(){if(!this.batch||this.batchStartDispatched)return;this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map)}createStrategy(Q){let{beans:z,gos:J,strategy:Z}=this,$=F8(J,Q);if(Z){if(Z.beanName===$)return Z;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(z.registry.createDynamicBean($,!0))}destroyStrategy(){if(!this.strategy)return;this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy)}shouldStartEditing(Q,z,J,Z="ui"){let $=BL(this.beans,Q,z,J,Z);if($)this.strategy??(this.strategy=this.createStrategy());return $}shouldStopEditing(Q,z,J="ui"){return this.strategy?.shouldStop(Q,z,J)??null}shouldCancelEditing(Q,z,J="ui"){return this.strategy?.shouldCancel(Q,z,J)??null}validateEdit(){return m3(this.beans)}isEditing(Q,z){return this.model.hasEdits(Q??void 0,z??Rz)}isRowEditing(Q,z){return!!Q&&this.model.hasRowEdits(Q,z)}enableRangeSelectionWhileEditing(){if(this.beans.rangeSvc&&this.gos.get("cellSelection"))this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(Q,z){let{startedEdit:J=!0,event:Z=null,source:$="ui",ignoreEventKey:X=!1,silent:Y}=z;if(this.strategy??(this.strategy=this.createStrategy()),!(z.editable??this.isCellEditable(Q,"api")))return;let q=s(this.beans,Q);if(q&&!q.comp){z.editable=void 0,q.onCompAttachedFuncs.push(()=>this.startEditing(Q,z));return}let H=this.shouldStartEditing(Q,Z,J,$);if(H===!1&&$!=="api"){if(this.isEditing(Q))this.stopEditing();return}if(!this.batch&&this.shouldStopEditing(Q,void 0,$)&&!z.continueEditing)this.stopEditing(void 0,{source:$});if(H)this.ensureBatchStarted();this.strategy.start({position:Q,event:Z,source:$,ignoreEventKey:X,startedEdit:J,silent:Y})}stopEditing(Q,z){let J=this.prepareStopContext(Q,z);if(!J)return!1;this.stopping=!0;let Z=!1,{edits:$}=J;try{let X=this.processStopRequest(J);return Z||(Z=X.res),$=X.edits,this.finishStopEditing({...J,edits:$,params:z,position:Q,res:Z}),Z}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(Q,z){let{event:J=null,cancel:Z=!1,source:$="ui",forceCancel:X=!1,forceStop:Y=!1,commit:G=!1}=z||{};if(AL.has($)&&this.batch){if(Q?.rowNode&&Q?.column)this.bulkRefreshCell(Q);return null}let q=this.committing?_X[$]:$;if(!(this.committing||this.isEditing(Q)||this.batch&&this.model.hasEdits(Q,Rz))||!this.strategy||this.stopping)return null;let _=s(this.beans,Q);if(_)_.onEditorAttachedFuncs=[];let U=!Z&&(!!this.shouldStopEditing(Q,J,q)||(this.committing||$==="paste")&&!this.batch)||Y,W=Z&&!!this.shouldCancelEditing(Q,J,q)||X;return{cancel:Z,cellCtrl:_,edits:this.model.getEditMap(!0),event:J??null,forceCancel:X,forceStop:Y,commit:G,position:Q,source:$,treatAsSource:q,willCancel:W,willStop:U}}processStopRequest(Q){let{event:z,position:J,willCancel:Z,willStop:$}=Q;if($||Z)return this.handleStopOrCancel(Q);if(this.shouldHandleMidBatchKey(z,J))return{res:!1,edits:this.handleMidBatchKey(z,J,Q)};if(Qz(this.beans,{persist:!0}),this.batch)this.strategy?.cleanupEditors(J);return{res:!1,edits:this.model.getEditMap()}}handleStopOrCancel(Q){let{beans:z,model:J}=this,{cancel:Z,commit:$,edits:X,event:Y,source:G,willCancel:q,willStop:H}=Q,_=!this.batch||!q;Qz(z,{persist:_,isCancelling:q||Z,isStopping:H});let U=J.getEditMap(),B=!q&&(!this.batch||$)?this.processEdits(U,G):[];if(Z)this.strategy?.stopCancelled(Q.forceCancel);else this.strategy?.stopCommitted(Y,$);this.clearValidationIfNoOpenEditors();for(let E of B)J.clearEditValue(E);this.bulkRefreshMap(X);for(let E of J.getEditPositions(U)){let K=s(z,E),L=BQ(E);K?.refreshCell({force:!0,suppressFlash:!L})}return{res:H,edits:U}}shouldHandleMidBatchKey(Q,z){return Q instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(z)&&this.isEditing(z,{withOpenEditor:!0})}handleMidBatchKey(Q,z,J){let{beans:Z,model:$}=this,{cellCtrl:X,edits:Y}=J,{key:G}=Q,q=G===V.ENTER,H=G===V.ESCAPE,_=G===V.TAB;if(q||_||H){if(q||_)Qz(Z,{persist:!0});else if(H&&X){let{rowNode:U,column:W}=X;if(this.batch&&U&&W){let B={rowNode:U,column:W};eQ(Z,[B],{silent:!0}),this.model.stop(B,!0,!0),s(Z,B)?.refreshCell(lQ)}else this.revertSingleCellEdit(X)}if(this.batch)this.strategy?.cleanupEditors();else eQ(Z,$.getEditPositions(),{event:Q,cancel:H});return Q.preventDefault(),this.bulkRefreshMap(Y,{suppressFlash:!0}),$.getEditMap()}return Y}finishStopEditing({cellCtrl:Q,edits:z,params:J,position:Z,res:$,commit:X,forceCancel:Y,willCancel:G,willStop:q}){let H=this.beans;if($&&Z){if(!this.batch||X)this.model.removeEdits(Z)}this.navigateAfterEdit(J,Q?.cellPosition),x1(H),this.clearValidationIfNoOpenEditors();let{rowRenderer:_,formula:U}=H;if(G)_.refreshRows({rowNodes:Array.from(z.keys())});if(this.batch){if(U)U.refreshFormulas(!0);else _.refreshRows({suppressFlash:!0,force:!0});let W=q&&X;if(W||G&&Y)this.dispatchBatchStopped(z,W)}}dispatchBatchStopped(Q,z){let J;if(z){if(J=b3(Q),J.size>0)this.ensureBatchStarted()}if(this.batchStartDispatched)this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",J??new Map)}clearValidationIfNoOpenEditors(){if(!this.model.hasEdits(void 0,{withOpenEditor:!0}))this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()}navigateAfterEdit(Q,z){if(!Q||!z)return;let{event:J,suppressNavigateAfterEdit:Z}=Q;if(!(J instanceof KeyboardEvent)||Z)return;let{key:X,shiftKey:Y}=J,G=this.gos.get("enterNavigatesVerticallyAfterEdit");if(X!==V.ENTER||!G)return;let q=Y?V.UP:V.DOWN;this.beans.navigation?.navigateToNextCell(null,q,z,!1)}processEdits(Q,z){let J=Array.from(Q.keys()),Z=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,$=[],{changeDetectionSvc:X}=this.beans;X?.beginDeferred();try{for(let Y of J){let G=Q.get(Y);for(let q of G.keys()){let H=G.get(q),_={rowNode:Y,column:q};if(BQ(H)&&!Z){let U=s(this.beans,_);if(!this.setNodeDataValue(Y,q,H.pendingValue,U,z))$.push(_)}}}}finally{X?.endDeferred()}return $}setNodeDataValue(Q,z,J,Z,$="edit"){let X=fL.has($)?"edit":$;if(Z)Z.suppressRefreshCell=!0;this.committing=!0;try{return Q.setDataValue(z,J,X)}finally{if(this.committing=!1,Z)Z.suppressRefreshCell=!1}}syncEditAfterCommit(Q,z){let J=this.model.getEdit(Q);if(J&&J.state!=="editing")if(z)this.beans.editModelSvc?.setEdit(Q,{sourceValue:J.pendingValue});else this.model.clearEditValue(Q)}setEditMap(Q,z){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(Q,z),this.bulkRefreshMap(Q);let J=lQ;if(z?.forceRefreshOfEditCellsOnly)J={...PL(Q),...lQ};this.beans.rowRenderer.refreshCells(J)}dispatchEditValuesChanged({rowNode:Q,column:z},J={}){if(!Q||!z||!J)return;let{pendingValue:Z,sourceValue:$}=J,{rowIndex:X,rowPinned:Y,data:G}=Q;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:Q,rowIndex:X,rowPinned:Y,column:z,source:"api",data:G,newValue:Z,oldValue:$,value:Z,colDef:z.getColDef()})}bulkRefreshCell(Q,z){if(o(this.gos,this.beans.rowModel))this.refCell(Q,this.model.getEdit(Q),z)}bulkRefreshMap(Q,z){if(o(this.gos,this.beans.rowModel))Q.forEach((J,Z)=>{for(let $ of J.keys())this.refCell({rowNode:Z,column:$},J.get($),z)})}refCell({rowNode:Q,column:z},J,Z={}){let{beans:$,gos:X}=this,Y=new Set([Q]),G=new Set,q=Q.pinnedSibling;if(q)Y.add(q);let H=Q.sibling;if(H)G.add(H);let _=Q.parent;while(_){if(_.sibling?.footer&&X.get("groupTotalRow"))G.add(_.sibling);else if(!_.parent&&_.sibling&&X.get("grandTotalRow"))G.add(_.sibling);else G.add(_);_=_.parent}for(let U of Y)this.dispatchEditValuesChanged({rowNode:U,column:z},J);for(let U of Y)s($,{rowNode:U,column:z})?.refreshCell(Z);for(let U of G){let W=s($,{rowNode:U,column:z});if(W){if(W.refreshCell(Z),!Z.force&&this.batch)W.editStyleFeature?.applyCellStyles?.()}}}stopAllEditing(Q=!1,z="ui"){if(this.isEditing())this.stopEditing(void 0,{cancel:Q,source:z})}isCellEditable(Q,z="ui"){let{gos:J,beans:Z}=this,$=Q.rowNode;if($.group&&Q.column.getColDef().groupRowEditable==null){if(J.get("treeData")){if(!$.data&&!J.get("enableGroupEdit"))return!1}else if(!J.get("enableGroupEdit"))return!1}let X=F8(J)==="fullRow"?KL(Z,Q,z):V5(Z,Q);if(X)this.strategy??(this.strategy=this.createStrategy());return X}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(Q,z,J=!0){if(this.hasValidationErrors(Q)){let Z=s(this.beans,Q);if(this.cellEditingInvalidCommitBlocks()){if(z?.preventDefault?.(),J){if(Z&&!Z.hasBrowserFocus())Z.focusCell();Z?.comp?.getCellEditor()?.focusIn?.()}return"block-stop"}if(Z)this.revertSingleCellEdit(Z);return"revert-continue"}return"continue"}revertSingleCellEdit(Q,z=!1){let J=s(this.beans,Q);if(!J?.comp?.getCellEditor())return;if(eQ(this.beans,[Q],{silent:!0}),this.model.clearEditValue(Q),gz(this.beans,Q,{silent:!0}),Yz(this.beans),J?.refreshCell(lQ),!z)return;J?.focusCell(),J?.comp?.getCellEditor()?.focusIn?.()}hasValidationErrors(Q){Yz(this.beans);let z=s(this.beans,Q);if(z)z.refreshCell(lQ),z.rowCtrl.rowEditStyleFeature?.applyRowStyles();let J=!1;if(Q?.rowNode){if(J||(J=this.model.getRowValidationModel().hasRowValidation({rowNode:Q.rowNode})),Q.column)J||(J=this.model.getCellValidationModel().hasCellValidation({rowNode:Q.rowNode,column:Q.column}))}else J||(J=this.model.getCellValidationModel().getCellValidationMap().size>0),J||(J=this.model.getRowValidationModel().getRowValidationMap().size>0);return J}moveToNextCell(Q,z,J,Z="ui"){let $,X=this.isEditing(),Y=X&&this.checkNavWithValidation(void 0,J)==="block-stop";if(Q instanceof u1&&X)$=this.strategy?.moveToNextEditingCell(Q,z,J,Z,Y);if($===null)return $;if($=$||!!this.beans.focusSvc.focusedHeader,$===!1&&!Y)this.stopEditing();return $}getPendingEditValue(Q,z,J){if(J==="data")return;if(J==="batch"&&!this.batch)return;let Z=this.model.getEdit({rowNode:Q,column:z},Rz);if(!Z)return;if(this.stopping&&!this.batch&&!Z.editorState?.cellStartedEditing)return;if(J==="edit"){let X=Z.editorValue;if(X!=null&&X!==P0)return X}let $=Z.pendingValue;if($!==P0)return $;return}getCellDataValue(Q){let z=this.model.getEdit(Q,Rz);if(z){let J=z.pendingValue;if(J!==P0)return J;let Z=z.sourceValue;if(Z!=null)return Z}return this.valueSvc.getValue(Q.column,Q.rowNode,"data")}addStopEditingWhenGridLosesFocus(Q){v3(this,this.beans,Q)}createPopupEditorWrapper(Q){return new WL(Q)}batchResetToSourceValue(Q){if(!this.batch)return!1;let z=this.model.getEdit(Q);if(!z)return!1;let{pendingValue:J,sourceValue:Z,state:$}=z;if(J===Z)return!1;if($==="editing")return!1;return this.dispatchEditValuesChanged(Q,{...z,pendingValue:Z}),this.beans.editModelSvc?.removeEdits(Q),s(this.beans,Q)?.refreshCell(lQ),!0}setDataValue(Q,z,J){try{let Z=this.batch,$=this.isEditing(Z?void 0:Q);if((!$||this.committing)&&!Z&&!jL.has(J))return;if(!$&&!Z&&J==="paste")return;if(J==="batch"&&!Z)return;if(J==="edit"){if($&&this.applyEditorValue(Q,z))return!0;if(!Z)return}if(this.strategy??(this.strategy=this.createStrategy()),J==="batch"||J==="edit")return this.applyDirectValue(Q,z,J);let X=this.beans,Y;if(Z)Y="ui";else if(this.committing)Y=J??"api";else Y="api";if(!J||VL.has(J))return this.applyDirectValue(Q,z,J);let G=this.applyExistingEdit(Q,z,J,Y);if(G!==void 0)return G;return z1(X,Q,z,J,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(Q,{source:Y,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}applyExistingEdit(Q,z,J,Z){let $=this.model.getEdit(Q);if(!$)return;if($.pendingValue===z)return!1;if($.sourceValue!==z)return z1(this.beans,Q,z,J,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(Q,{source:Z,suppressNavigateAfterEdit:!0}),!0;return this.beans.editModelSvc?.removeEdits(Q),this.ensureBatchStarted(),this.dispatchEditValuesChanged(Q,{...$,pendingValue:z}),!0}applyEditorValue(Q,z){let J=this.beans,Z=s(J,Q),$=Z?.comp?.getCellEditor();if(!Z||!$)return!1;if(z1(J,Q,z,"edit",void 0,{persist:!0}),Z.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in $)return $.agSetEditValue(z),!0;if($.refresh&&Z.editCompDetails)return $.refresh({...Z.editCompDetails.params,value:z}),!0;if(Z.hasBrowserFocus())Z.onEditorAttachedFuncs.push(()=>{let Y=s(this.beans,Q);Y?.focusCell(!0),Y?.comp?.getCellEditor()?.focusIn?.()});return eQ(J,[Q],{silent:!0,cancel:!0}),gz(J,Q,{silent:!0}),Yz(J),s(J,Q)?.refreshCell(lQ),!0}applyDirectValue(Q,z,J){let Z=this.beans;if(this.batch){if(J==="batch"&&s(Z,Q)?.comp?.getCellEditor()){let{editModelSvc:Y,valueSvc:G}=Z,{rowNode:q,column:H}=Q;if(Y?.getEdit(Q)?.sourceValue===void 0)Y?.setEdit(Q,{sourceValue:G.getValue(H,q,"data")});Y?.setEdit(Q,{pendingValue:z})}else if(z1(Z,Q,z,J,void 0,{persist:!0}),J!=="batch")this.cleanupEditors();return x1(Z),this.ensureBatchStarted(),this.bulkRefreshCell(Q),!0}z1(Z,Q,z,J,void 0,{persist:!0});let $=s(Z,Q),X=this.setNodeDataValue(Q.rowNode,Q.column,z,$,J);return this.syncEditAfterCommit(Q,X),x1(Z),s(Z,Q)?.refreshCell(X?SL:lQ),X}handleColDefChanged(Q){x3(this.beans,Q)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(Q,z){let{model:J}=this;if(!this.batch)return;if(!J.hasRowEdits(Q.rowNode,Rz))return;let{rowNode:$}=Q,{compDetails:X,valueToDisplay:Y}=z;if(X){let{params:G}=X;return G.data=J.getEditRowDataValue($,Rz),{compDetails:X}}return{valueToDisplay:Y}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(Q,z,J,Z){this.strategy?.dispatchCellEvent(Q,z,J,Z)}dispatchBatchEvent(Q,z){this.eventSvc.dispatchEvent(this.createBatchEditEvent(Q,z))}createBatchEditEvent(Q,z){return y(this.gos,{type:Q,...Q==="batchEditingStopped"?{changes:this.toEventChangeList(z)}:{}})}toEventChangeList(Q){return this.model.getEditPositions(Q).map((z)=>({rowIndex:z.rowNode.rowIndex,rowPinned:z.rowNode.rowPinned,columnId:z.column.getColId(),newValue:z.pendingValue,oldValue:z.sourceValue}))}applyBulkEdit({rowNode:Q,column:z},J){if(!J||J.length===0)return;let{beans:Z,rangeSvc:$,valueSvc:X}=this,{formula:Y}=Z;Qz(Z,{persist:!0});let G=this.model.getEditMap(!0),q=G.get(Q)?.get(z)?.pendingValue,H=!1;if(!this.batch)this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),H=!0;let _=Y?.isFormula(q)??!1;J.forEach((W)=>{let B=W.columns.some((E)=>E?.isAllowFormula());if($?.forEachRowInRange(W,(E)=>{let K=M0(Z,E);if(K===void 0)return;let L=G.get(K)??new Map,F=q;for(let D of W.columns){if(!D)continue;let M=!!_&&D.isAllowFormula();if(this.isCellEditable({rowNode:K,column:D},"api")){let k=X.getValue(D,K,"data",!0),f=X.parseValue(D,K??null,F,k);if(Number.isNaN(f))f=null;L.set(D,{editorValue:void 0,pendingValue:f,sourceValue:k,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}if(M)F=Y?.updateFormulaByOffset({value:F,columnDelta:1})}if(L.size>0)G.set(K,L);if(_&&B)q=Y?.updateFormulaByOffset({value:q,rowDelta:1})}),this.setEditMap(G),this.batch){this.cleanupEditors(),x1(Z),this.ensureBatchStarted();return}this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{if(this.committing=!1,H)this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(G)})}});let U=s(Z,{rowNode:Q,column:z});if(U)U.focusCell(!0)}createCellStyleFeature(Q){return new LL(Q,this.beans)}createRowStyleFeature(Q){return new FL(Q,this.beans)}setEditingCells(Q,z){let{beans:J}=this,{colModel:Z,valueSvc:$}=J,X=new Map;for(let{colId:Y,column:G,colKey:q,rowIndex:H,rowPinned:_,newValue:U,state:W}of Q){let B=Y?Z.getCol(Y):q?Z.getCol(q):G;if(!B)continue;let E=M0(J,{rowIndex:H,rowPinned:_});if(!E)continue;let K=$.getValue(B,E,"data",!0);if(!z?.forceRefreshOfEditCellsOnly&&!BQ({pendingValue:U,sourceValue:K})&&W!=="editing")continue;let L=X.get(E);if(!L)L=new Map,X.set(E,L);if(U===void 0)U=P0;L.set(B,{editorValue:void 0,pendingValue:U,sourceValue:K,state:W??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(X,z)}onCellFocused(Q){let z=s(this.beans,Q);if(!z||!this.isEditing(z,Rz))return;let J=this.model.getEdit(z);if(!J||!BQ(J))return;let $=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue($,"pendingChange")}allowedFocusTargetOnValidation(Q){return s(this.beans,Q)}};function PL(Q){return{rowNodes:Q?Array.from(Q.keys()):void 0,columns:Q?[...new Set(Array.from(Q.values()).flatMap((z)=>Array.from(z.keys())))]:void 0}}function F8(Q,z){return z??Q.get("editType")??"singleCell"}var UX=class extends j{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(Q){this.model.clearEditValue(Q)}onCellFocusChanged(Q){let z,J=Q.previousParams,{editSvc:Z,beans:$}=this,X=Q.type==="cellFocused"?Q.sourceEvent:null;if(J)z=s($,J);let{gos:Y,editModelSvc:G}=$,q=Q.type==="cellFocusCleared";if(Z.isEditing(void 0,{withOpenEditor:!0})){let{column:H,rowIndex:_,rowPinned:U}=Q,W={column:H,rowNode:M0($,{rowIndex:_,rowPinned:U})},B=Y.get("invalidEditValueMode")==="block";if(B)return;let E=!B,K=!!G?.getCellValidationModel().hasCellValidation(W),L=E&&K;if(!(J||q?Z.stopEditing(void 0,{cancel:L,source:q&&E?"api":void 0,event:X}):!0))if(Z.isBatchEditing())Z.cleanupEditors();else Z.stopEditing(void 0,{source:"api"})}z?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(Q){let z=this.editSvc.isBatchEditing()&&!Q;for(let J of this.model.getEditPositions())QJ(this.beans,J,{cancel:!0},s(this.beans,J)),this.model.stop(J,z,!0);return!0}stopCommitted(Q,z){let J=this.model.getEditPositions(),Z={all:[],pass:[],fail:[]};for(let Y of J)if(Z.all.push(Y),(this.model.getCellValidationModel().getCellValidation(Y)?.errorMessages?.length??0)>0)Z.fail.push(Y);else Z.pass.push(Y);let $=this.processValidationResults(Z),X=this.editSvc.isBatchEditing()&&!z;for(let Y of $.destroy)QJ(this.beans,Y,{event:Q},s(this.beans,Y)),this.model.stop(Y,X,!1);for(let Y of $.keep){let G=s(this.beans,Y);if(!this.editSvc.cellEditingInvalidCommitBlocks()&&G)this.editSvc.revertSingleCellEdit(G)}return!0}cleanupEditors({rowNode:Q}={},z){Qz(this.beans,{persist:!1});let J=this.model.getEditPositions(),Z=[];if(Q){for(let $ of J)if($.rowNode!==Q)Z.push($)}else for(let $ of J)Z.push($);eQ(this.beans,Z),x1(this.beans,z)}setFocusOutOnEditor(Q){Q.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(Q){let z=Q.comp,J=z?.getCellEditor();if(J?.focusIn)J.focusIn();else{let Z=this.beans.gos.get("editType")==="fullRow";Q.focusCell(Z),Q.onEditorAttachedFuncs.push(()=>z?.getCellEditor()?.focusIn?.())}}setupEditors(Q){let{event:z,ignoreEventKey:J=!1,startedEdit:Z,position:$,cells:X=this.model.getEditPositions()}=Q,Y=z instanceof KeyboardEvent&&!J&&z.key||void 0;C3(this.beans,X,$,Y,z,Z)}dispatchCellEvent(Q,z,J,Z){let $=s(this.beans,Q);if($)this.eventSvc.dispatchEvent({...$.createEvent(z??null,J),...Z})}dispatchRowEvent(Q,z,J){if(J)return;let Z=BZ(this.beans,Q);if(Z)this.eventSvc.dispatchEvent(Z.createRowEvent(z))}shouldStop(Q,z,J="ui"){let Z=this.editSvc.isBatchEditing();if(Z&&J==="api")return!0;if(Z&&(J==="ui"||J==="edit"))return!1;if(J==="api")return!0;if(z instanceof KeyboardEvent&&!Z)return z.key===V.ENTER;return null}shouldCancel(Q,z,J="ui"){let Z=this.editSvc.isBatchEditing();if(z instanceof KeyboardEvent&&!Z){if(z.key===V.ESCAPE)return!0}if(Z&&J==="api")return!0;if(J==="api")return!0;return!1}setEditMap(Q,z){if(!z?.update)this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});let J=[];if(Q.forEach((Z,$)=>{Z.forEach((X,Y)=>{if(X.state==="editing")J.push({...X,rowNode:$,column:Y})})}),z?.update)Q=new Map([...this.model.getEditMap(),...Q]);if(this.model?.setEditMap(Q),J.length>0){let Z=J.at(-1),$=Z.pendingValue===P0?void 0:Z.pendingValue;this.start({position:Z,event:new KeyboardEvent("keydown",{key:$}),source:"api"});let X=s(this.beans,Z);if(X)this.setFocusInOnEditor(X)}}destroy(){this.cleanupEditors(),super.destroy()}},TL=class extends UX{constructor(){super(...arguments);this.beanName="fullRow",this.startedRows=new Set}shouldStop(Q,z,J="ui"){let{rowNode:Z,beans:$}=this,{rowNode:X}=Q||{};if(!BZ($,{rowNode:Z}))return!0;let G=super.shouldStop({rowNode:Z},z,J);if(G!==null)return G;if(!Z)return!1;return X!==Z}midBatchInputsAllowed({rowNode:Q}){if(!Q)return!1;return this.model.hasEdits({rowNode:Q})}clearEdits(Q){this.model.clearEditValue(Q)}start(Q){let{position:z,silent:J,startedEdit:Z,event:$,ignoreEventKey:X}=Q,{rowNode:Y}=z,{beans:G,model:q,startedRows:H}=this;if(this.rowNode!==Y)super.cleanupEditors(z);let _=G.visibleCols.allCols,U=[],W=[];for(let B of _)if(B.isCellEditable(Y))W.push(B);if(W.length==0)return;if(!H.has(Y))this.dispatchRowEvent({rowNode:Y},"rowEditingStarted",J),H.add(Y);for(let B of W){let E={rowNode:Y,column:B};U.push(E),q.start(E)}this.rowNode=Y,this.setupEditors({cells:U,position:z,startedEdit:Z,event:$,ignoreEventKey:X})}processValidationResults(Q){if(Q.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:Q.all};return{destroy:Q.all,keep:[]}}stopCancelled(Q){let{rowNode:z,model:J}=this;if(z&&!J.hasRowEdits(z))return!1;return super.stopCancelled(Q),this.cleanupEditors({rowNode:z},!0),this.rowNode=void 0,!0}stopCommitted(Q,z){let{rowNode:J,beans:Z,model:$,editSvc:X}=this;if(J&&!$.hasRowEdits(J))return!1;let Y=[];if($.getEditMap().forEach((G,q)=>{if(!G||G.size===0)return;for(let H of G.values())if(BQ(H)){Y.push(q);break}}),Yz(Z),X.checkNavWithValidation({rowNode:J})==="block-stop")return!1;if(super.stopCommitted(Q,z),z||!X.isBatchEditing())for(let G of Y)this.dispatchRowEvent({rowNode:G},"rowValueChanged");return this.cleanupEditors({rowNode:J},!0),this.rowNode=void 0,!0}onCellFocusChanged(Q){let{rowIndex:z}=Q,J=Q.previousParams;if(J?.rowIndex===z||Q.sourceEvent instanceof KeyboardEvent)return;let{beans:Z,gos:$,model:X}=this;if(Z.editSvc?.isRangeSelectionEnabledWhileEditing())return;let Y=s(Z,J);if($.get("invalidEditValueMode")==="block"&&Y&&(X.getCellValidationModel().getCellValidation(Y)||X.getRowValidationModel().getRowValidation(Y)))return;super.onCellFocusChanged(Q)}cleanupEditors(Q={},z){super.cleanupEditors(Q,z);let{startedRows:J}=this;for(let Z of J)this.dispatchRowEvent({rowNode:Z},"rowEditingStopped"),this.destroyEditorsForRow(Z);J.clear()}destroyEditorsForRow(Q){let z=BZ(this.beans,{rowNode:Q});if(!z)return;let J={};for(let Z of z.getAllCellCtrls())if(Z.comp?.getCellEditor())QJ(this.beans,Z,J,Z)}moveToNextEditingCell(Q,z,J,Z="ui",$=!1){let{beans:X,model:Y,gos:G,editSvc:q}=this,H=Q.cellPosition,_;Y.suspend(!0);try{_=X.navigation?.findNextCellToFocusOn(H,{backwards:z,startEditing:!0,skipToNextEditableCell:!1})}finally{Y.suspend(!1)}if(_===!1)return null;if(_==null)return!1;let U=_.cellPosition,W=Q.isCellEditable(),B=_.isCellEditable(),E=U&&H.rowIndex===U.rowIndex&&H.rowPinned===U.rowPinned;if(W)this.setFocusOutOnEditor(Q);this.restoreEditors();let K=G.get("suppressStartEditOnTab");if(B&&!$)if(K)_.focusCell(!0,J);else{if(!_.comp?.getCellEditor())gz(X,_,{event:J,cellStartedEdit:!0});this.setFocusInOnEditor(_),_.focusCell(!1,J)}else{if(B&&$)this.setFocusInOnEditor(_);_.focusCell(!0,J)}if(!E&&!$){if(q?.stopEditing({rowNode:Q.rowNode},{event:J,forceStop:!0}),q?.isRowEditing(Q.rowNode,{withOpenEditor:!0}))this.cleanupEditors(_,!0);if(K)_.focusCell(!0,J);else q.startEditing(_,{startedEdit:!0,event:J,source:Z,ignoreEventKey:!0,editable:B||void 0})}return Q.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){let{beans:Q,model:z}=this;z.getEditMap().forEach((J,Z)=>J.forEach(({state:$},X)=>{if($!=="editing")return;let Y=s(Q,{rowNode:Z,column:X});if(Y&&!Y.comp?.getCellEditor())gz(Q,Y,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}},vL=class extends UX{constructor(){super(...arguments);this.beanName="singleCell"}shouldStop(Q,z,J="ui"){let Z=super.shouldStop(Q,z,J);if(Z!==null)return Z;let $=Q?.rowNode,X=Q?.column,Y=this.rowNode,G=this.column;if((!Y||!G)&&$&&X)return null;if(Y!==$||G!==X)return!0;if(!Y&&!G)return this.model.hasEdits(void 0,{withOpenEditor:!0});return!1}midBatchInputsAllowed(Q){return this.model.hasEdits(Q)}start(Q){let{position:z,startedEdit:J,event:Z,ignoreEventKey:$}=Q;if(this.rowNode!==z.rowNode||this.column!==z.column)super.cleanupEditors();this.rowNode=z.rowNode,this.column=z.column,this.model.start(z),this.setupEditors({cells:[z],position:z,startedEdit:J,event:Z,ignoreEventKey:$})}dispatchRowEvent(Q,z,J){}processValidationResults(Q){if(Q.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:Q.all};return{destroy:Q.all,keep:[]}}stopCancelled(Q){return super.stopCancelled(Q),this.clearPosition()}stopCommitted(Q,z){return super.stopCommitted(Q,z),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(Q){let{colModel:z,editSvc:J}=this.beans,{rowIndex:Z,column:$,rowPinned:X}=Q,Y=M0(this.beans,{rowIndex:Z,rowPinned:X}),G=L5($),q=z.getCol(G),H=Q.previousParams;if(H){let _=L5(H.column);if(H?.rowIndex===Z&&_===G&&H?.rowPinned===X)return}if(Q.type=="cellFocused"&&(J?.isRangeSelectionEnabledWhileEditing()||J?.isEditing({rowNode:Y,column:q},{withOpenEditor:!0})))return;super.onCellFocusChanged(Q)}moveToNextEditingCell(Q,z,J,Z="ui",$=!1){let X=this.beans.focusSvc.getFocusedCell();if(X)Q=e0(this.beans,X)??Q;let Y=Q.cellPosition,G,q=this.beans.gos.get("editType")==="fullRow";if(q)this.model.suspend(!0);if(!$)Q.eGui.focus(),this.editSvc?.stopEditing(Q,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:J});try{G=this.beans.navigation?.findNextCellToFocusOn(Y,{backwards:z,startEditing:!0})}finally{if(q)this.model.suspend(!1)}if(G===!1)return null;if(G==null)return!1;let H=G.cellPosition,_=Q.isCellEditable(),U=G.isCellEditable(),W=H&&Y.rowIndex===H.rowIndex&&Y.rowPinned===H.rowPinned;if(_&&!$)this.setFocusOutOnEditor(Q);let B=this.gos.get("suppressStartEditOnTab"),E=!1;if(!W&&!$)if(super.cleanupEditors(G,!0),B)G.focusCell(!0,J);else E=!0,this.editSvc.startEditing(G,{startedEdit:!0,event:J,source:Z,ignoreEventKey:!0,editable:U});if(U&&!$){if(G.focusCell(!1,J),B)G.focusCell(!0,J);else if(!G.comp?.getCellEditor()){if(!E){let K=this.editSvc?.isEditing(G,{withOpenEditor:!0});gz(this.beans,G,{event:J,cellStartedEdit:!0,silent:K})}this.setFocusInOnEditor(G),this.cleanupEditors(G)}}else{if(U&&$)this.setFocusInOnEditor(G);G.focusCell(!0,J)}return Q.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},IL={moduleName:"EditCore",version:p,beans:[T3,OL],apiFunctions:{getEditingCells:YL,getEditRowValues:XL,getCellEditorInstances:I3,startEditingCell:HL,stopEditing:GL,isEditing:qL,validateEdit:_L},dynamicBeans:{singleCell:vL,fullRow:TL},dependsOn:[nz,eK],css:[QL]};var WX={moduleName:"TextEditor",version:p,userComponents:{agCellEditor:L8,agTextCellEditor:L8},dependsOn:[IL]};var BX={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},CL=new Set(Object.values(BX));function aQ(Q,z){let J=Q.filterUi;if(!J)return null;if(J.created)return J.promise;if(z)return null;let Z=J.create(J.refreshed),$=J;return $.created=!0,$.promise=Z,Z}function rZ(Q,z,J,Z,$,X,Y){return z.refresh?.({...J,model:Z,source:X,additionalEventAttributes:Y}),Q().then((G)=>{if(G){let{filter:q,filterParams:H}=G;A1(q,H,Z,$,X,Y)}})}function A1(Q,z,J,Z,$,X){Q?.refresh?.({...z,model:J,state:Z,source:$,additionalEventAttributes:X})}function EX(Q,z,J,Z){let $=Q();if($?.created)$.promise.then((X)=>{let Y=z();A1(X,$.filterParams,Y,J()??{model:Y},"ui",Z)})}function FZ(Q){let z,J=!1,Z,{action:$,filterParams:X,getFilterUi:Y,getModel:G,getState:q,updateState:H,updateModel:_,processModelToApply:U}=Q;switch($){case"apply":{let W=q();if(Z=W?.model??null,U)Z=U(Z);z={state:W?.state,model:Z},J=!0;break}case"clear":{if(z={model:null},!X?.buttons?.includes("apply"))J=!0,Z=null;break}case"reset":{z={model:null},J=!0,Z=null;break}case"cancel":{z={model:G()};break}}if(H(z),J)_(Z);else EX(Y,G,q,{fromAction:$})}function F0(Q,z){return Q[z]??null}var bL=class extends Y6{constructor(){super(...arguments);this.iconCreated=!1}wireComp(Q,z,J,Z,$){this.comp=Q;let X=BJ(this,this.beans.context,$);this.eButtonShowMainFilter=J,this.eFloatingFilterBody=Z,this.setGui(z,X),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(X),this.setupLeft(X),this.setupHover(X),this.setupFocus(X),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(X),this.setupUi(),X.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(X);let Y=()=>this.onColDefChanged(X);X.addManagedListeners(this.column,{colDefChanged:Y}),X.addManagedEventListeners({filterSwitched:({column:G})=>{if(G===this.column)Y()}}),X.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){let{column:Q,beans:z}=this,J=Q.colDef;return y(z.gos,{colDef:J,column:Q,floatingFilter:!0})}setupActive(){let Q=this.column.getColDef(),z=!!Q.filter,J=!!Q.floatingFilter;this.active=z&&J}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;let Q=h("filter",this.beans,this.column);if(Q)this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(Q)}setupFocus(Q){Q.createManagedBean(new cQ(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){let Q=this.getLocaleTextFunc();E0(this.eButtonShowMainFilter,Q("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(Q){let{beans:z}=this;if(d(z)===this.eGui)return;let $=R0(z,this.eGui,null,Q.shiftKey);if($){z.headerNavigation?.scrollToColumn(this.column),Q.preventDefault(),$.focus();return}let X=this.findNextColumnWithFloatingFilter(Q.shiftKey);if(!X)return;if(z.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:X},event:Q}))Q.preventDefault()}findNextColumnWithFloatingFilter(Q){let z=this.beans.visibleCols,J=this.column;do if(J=Q?z.getColBefore(J):z.getColAfter(J),!J)break;while(!J.getColDef().filter||!J.getColDef().floatingFilter);return J}handleKeyDown(Q){super.handleKeyDown(Q);let z=this.getWrapperHasFocus();switch(Q.key){case V.UP:case V.DOWN:case V.LEFT:case V.RIGHT:if(z)return;i0(Q);case V.ENTER:if(z){if(D0(this.eGui))Q.preventDefault()}break;case V.ESCAPE:if(!z)this.eGui.focus()}}onFocusIn(Q){if(this.eGui.contains(Q.relatedTarget))return;let J=!!Q.relatedTarget&&!Q.relatedTarget.classList.contains("ag-floating-filter"),Z=!!Q.relatedTarget&&vz(Q.relatedTarget,"ag-floating-filter");if(J&&Z&&Q.target===this.eGui){let $=this.lastFocusEvent,X=!!($&&$.key===V.TAB);if($&&X){let Y=$.shiftKey;D0(this.eGui,Y)}}this.focusThis()}setupHover(Q){this.beans.colHover?.addHeaderFilterColumnHoverListener(Q,this.comp,this.column,this.eGui)}setupLeft(Q){let z=new X6(this.column,this.eGui,this.beans);Q.createManagedBean(z)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!U0(this.gos)}setupUserComp(){if(!this.active)return;let Q=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());if(Q)this.setCompDetails(Q)}setCompDetails(Q){this.userCompDetails=Q,this.comp.setCompDetails(Q)}showParentFilter(){let Q=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:Q,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(Q){if(!this.active)return;let{beans:{colFilter:z},column:J,gos:Z}=this,$=(X)=>{if(X?.source==="filterDestroyed"&&(!this.isAlive()||!z?.isAlive()))return;let Y=this.comp.getFloatingFilterComp();if(!Y)return;Y.then((G)=>{if(G){if(Z.get("enableFilterHandlers")){let _=X,U="filter";if(_?.afterFloatingFilter)U="ui";else if(_?.afterDataChange)U="dataChanged";else if(X?.source==="api")U="api";this.updateFloatingFilterParams(this.userCompDetails,U);return}let q=z?.getCurrentFloatingFilterParentModel(J),H=X?{...X,columns:X.columns??[],source:X.source==="api"?"api":"columnFilter"}:null;G.onParentModelChanged(q,H)}})};if([this.destroySyncListener]=Q.addManagedListeners(J,{filterChanged:$}),z?.isFilterActive(J))$(null)}setupWidth(Q){let z=()=>{let J=`${this.column.getActualWidth()}px`;this.comp.setWidth(J)};Q.addManagedListeners(this.column,{widthChanged:z}),z()}setupFilterChangedListener(Q){if(this.active)[this.destroyFilterChangedListener]=Q.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton()}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){let Q=!!this.beans.filterManager?.isFilterAllowed(this.column);if(this.comp.setButtonWrapperDisplayed(Q),this.highlightFilterButtonWhenActive&&Q)this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(Q){let z=this.active;this.setupActive();let J=!z&&this.active;if(z&&!this.active)this.destroySyncListener(),this.destroyFilterChangedListener();let Z=this.beans.colFilter,$=this.active?Z?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,X=this.comp.getFloatingFilterComp();if(!X||!$)this.updateCompDetails(Q,$,J);else X.then((Y)=>{if(!Y||Z?.areFilterCompsDifferent(this.userCompDetails??null,$))this.updateCompDetails(Q,$,J);else this.updateFloatingFilterParams($,"colDef")})}updateCompDetails(Q,z,J){if(!this.isAlive())return;if(this.setCompDetails(z),this.setupFilterButton(),this.setupUi(),J)this.setupSyncWithFilter(Q),this.setupFilterChangedListener(Q)}updateFloatingFilterParams(Q,z){if(!Q)return;let J=Q.params;this.comp.getFloatingFilterComp()?.then((Z)=>{if(typeof Z?.refresh==="function"){if(this.gos.get("enableFilterHandlers"))J={...J,model:F0(this.beans.colFilter?.model??{},this.column.getColId()),source:z};Z.refresh(J)}})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function yL(Q,z){let J=Q.colModel.getCol(z);if(!J){e(12,{colKey:z});return}Q.menuSvc?.showColumnMenu({column:J,positionBy:"auto"})}function xL(Q){Q.menuSvc?.hidePopupMenu()}var wL=class extends j{constructor(){super(...arguments);this.beanName="menuSvc"}postConstruct(){let{enterpriseMenuFactory:Q,filterMenuFactory:z}=this.beans;this.activeMenuFactory=Q??z}showColumnMenu(Q){this.showColumnMenuCommon(this.activeMenuFactory,Q,"columnMenu")}showFilterMenu(Q){this.showColumnMenuCommon(D8(this.beans),Q,Q.containerType,!0)}showHeaderContextMenu(Q,z,J){this.activeMenuFactory?.showMenuAfterContextMenuEvent(Q,z,J)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){D8(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(Q){let{suppressHeaderMenuButton:z}=Q.getColDef();return!z&&!!this.activeMenuFactory?.isMenuEnabled(Q)&&(U0(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(Q){return!Q.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(Q)}isHeaderContextMenuEnabled(Q){return!(Q&&JQ(Q)?Q.getColDef():Q?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){let Q=!this.isSuppressMenuHide();return!(bz()&&Q)}isHeaderFilterButtonEnabled(Q){return this.isFilterMenuInHeaderEnabled(Q)&&!U0(this.gos)&&!this.isFloatingFilterButtonDisplayed(Q)}isFilterMenuItemEnabled(Q){return!!this.beans.filterManager?.isFilterAllowed(Q)&&!U0(this.gos)&&!this.isFilterMenuInHeaderEnabled(Q)&&!this.isFloatingFilterButtonDisplayed(Q)}isFloatingFilterButtonEnabled(Q){return!Q.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(Q){return!!Q.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(Q)}isSuppressMenuHide(){let Q=this.gos,z=Q.get("suppressMenuHide");if(U0(Q))return Q.exists("suppressMenuHide")?z:!1;return z}showColumnMenuCommon(Q,z,J,Z){let{positionBy:$,onClosedCallback:X}=z,Y=z.column;if($==="button"){let{buttonElement:G}=z;Q?.showMenuAfterButtonClick(Y,G,J,X,Z)}else if($==="mouse"){let{mouseEvent:G}=z;Q?.showMenuAfterMouseEvent(Y,G,J,X,Z)}else if(Y){let G=this.beans,q=G.ctrlsSvc;q.getScrollFeature().ensureColumnVisible(Y,"auto"),YQ(G,()=>{let H=q.getHeaderRowContainerCtrl(Y.getPinned())?.getHeaderCtrlForColumn(Y);if(H)Q?.showMenuAfterButtonClick(Y,H.getAnchorElementForMenu(Z),J,X,Z)})}}};function zJ(Q,z,J){if(Q.menuVisible!==z)Q.menuVisible=z,Q.dispatchColEvent("menuVisibleChanged",J)}function D8(Q){let{enterpriseMenuFactory:z,filterMenuFactory:J,gos:Z}=Q;return z&&U0(Z)?z:J}var v6={moduleName:"SharedMenu",version:p,beans:[wL],apiFunctions:{showColumnMenu:yL,hidePopupMenu:xL}},NL=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function gL(Q){let z=Q.filterManager;return!!z?.isColumnFilterPresent()||!!z?.isAggregateFilterPresent()}function hL(Q,z){return Q.filterManager?.getColumnFilterInstance(z)??Promise.resolve(void 0)}function uL(Q,z){let J=Q.colModel.getColDefCol(z);if(J)return Q.colFilter?.destroyFilter(J,"api")}function mL(Q,z){Q.frameworkOverrides.wrapIncoming(()=>Q.filterManager?.setFilterModel(z))}function cL(Q){return Q.filterManager?.getFilterModel()??{}}function pL(Q,z,J){let{gos:Z,colModel:$,colFilter:X}=Q;if(J&&!Z.get("enableFilterHandlers"))R(288),J=!1;let Y=$.getColDefCol(z);return Y?X?.getModelForColumn(Y,J)??null:null}function iL(Q,z,J){return Q.filterManager?.setColumnFilterModel(z,J)??Promise.resolve()}function nL(Q,z){let J=Q.colModel.getCol(z);if(!J){e(12,{colKey:z});return}Q.menuSvc?.showFilterMenu({column:J,containerType:"columnFilter",positionBy:"auto"})}function dL(Q){Q.menuSvc?.hideFilterMenu()}function tL(Q,z){let J=Q.colModel.getCol(z);if(!J){e(12,{colKey:z});return}return Q.colFilter?.getHandler(J,!0)}function rL(Q,z){let{colModel:J,colFilter:Z,gos:$}=Q;if(!$.get("enableFilterHandlers")){R(287);return}let{colId:X,action:Y}=z;if(X){let G=J.getColById(X);if(G)Z?.updateModel(G,Y)}else Z?.updateAllModels(Y)}var M8={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},k8=["january","february","march","april","may","june","july","august","september","october","november","december"];function sL(Q,z){if(Q==null)return-1;if(z==null)return 1;return Number.parseFloat(Q)-Number.parseFloat(z)}function lL(Q,z){if(Q==null)return-1;if(z==null)return 1;let J=qz(Q),Z=qz(z);if(J!=null&&Z!=null){if(J===Z)return 0;return J>Z?1:-1}return String(Q).localeCompare(String(z))}function V8(Q){return Q instanceof Date&&!isNaN(Q.getTime())}var f5={number:()=>{return},bigint:()=>{return},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(Q,z)=>z,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(Q,z)=>z===!1,numberOfInputs:0}]}),date:()=>({isValidDate:V8}),dateString:({dataTypeDefinition:Q})=>({comparator:(z,J)=>{let Z=Q.dateParser(J);if(J==null||Zz)return 1;return 0},isValidDate:(z)=>typeof z==="string"&&V8(Q.dateParser(z))}),dateTime:(Q)=>f5.date(Q),dateTimeString:(Q)=>f5.dateString(Q),object:()=>{return},text:()=>{return}},A5={number:()=>({comparator:sL}),bigint:()=>({comparator:lL}),boolean:({t:Q})=>({valueFormatter:(z)=>T(z.value)?Q(String(z.value),z.value?"True":"False"):Q("blanks","(Blanks)")}),date:({formatValue:Q,t:z})=>({valueFormatter:(J)=>{let Z=Q(J);return T(Z)?Z:z("blanks","(Blanks)")},treeList:!0,treeListFormatter:(J,Z)=>{if(J==="NaN")return z("invalidDate","Invalid Date");if(Z===1&&J!=null){let $=k8[Number(J)-1];return z($,M8[$])}return J??z("blanks","(Blanks)")},treeListPathGetter:(J)=>$1(J,!1)}),dateString:({formatValue:Q,dataTypeDefinition:z,t:J})=>({valueFormatter:(Z)=>{let $=Q(Z);return T($)?$:J("blanks","(Blanks)")},treeList:!0,treeListPathGetter:(Z)=>$1(z.dateParser(Z??void 0),!1),treeListFormatter:(Z,$)=>{if($===1&&Z!=null){let X=k8[Number(Z)-1];return J(X,M8[X])}return Z??J("blanks","(Blanks)")}}),dateTime:(Q)=>{let z=A5.date(Q);return z.treeListPathGetter=$1,z},dateTimeString(Q){let z=Q.dataTypeDefinition.dateParser,J=A5.dateString(Q);return J.treeListPathGetter=(Z)=>$1(z(Z??void 0)),J},object:({formatValue:Q,t:z})=>({valueFormatter:(J)=>{let Z=Q(J);return T(Z)?Z:z("blanks","(Blanks)")}}),text:()=>{return}};function I6(Q,z,J,Z,$,X,Y){let G=z,q=J,H=Q==="agSetColumnFilter";if(!q&&Z.baseDataType==="object"&&!H)q=({column:B,node:E})=>$({column:B,node:E,value:X.valueSvc.getValue(B,E,"data")});let U=(H?A5:f5)[Z.baseDataType],W=U({dataTypeDefinition:Z,formatValue:$,t:Y});return G=typeof z==="object"?{...W,...z}:W,{filterParams:G,filterValueGetter:q}}var aL={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},oL={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function C6(Q,z=!1){return(z?oL:aL)[Q??"text"]}function b6(Q,z,J){if(z==null)return null;let Z=null,{compName:$,jsComp:X,fwComp:Y}=T9(Q,z);if($)Z={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[$];else if(X==null&&Y==null&&z.filter===!0)Z=J();return Z}var eL={filterHandler:()=>({doesFilterPass:()=>!0})};function f8(Q,z,J,Z){if(!Q.isPrimary())return!0;let X=!J;if(!Q.isValueActive()||!X)return!1;if(z)return!0;return Z}var QF=class extends j{constructor(){super(...arguments);this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...BX},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));let Q=this.gos,z={...Q.get("initialState")?.filter?.filterModel??{}};if(this.initialModel=z,this.model={...z},!Q.get("enableFilterHandlers"))delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(Q,z="api",J){let{colModel:Z,dataTypeSvc:$,filterManager:X}=this.beans;if($?.isPendingInference){this.modelUpdates.push({model:Q,source:z});return}let Y=[],G=this.getModel(!0);if(Q){let q=new Set(Object.keys(Q));this.allColumnFilters.forEach((H,_)=>{let U=Q[_];Y.push(this.setModelOnFilterWrapper(H,U)),q.delete(_)}),q.forEach((H)=>{let _=Z.getColDefCol(H)||Z.getCol(H);if(!_){R(62,{colId:H});return}if(!_.isFilterAllowed()){R(63,{colId:H});return}let U=this.getOrCreateFilterWrapper(_,!0);if(!U){R(64,{colId:H});return}Y.push(this.setModelOnFilterWrapper(U,Q[H],!0))})}else this.model={},this.allColumnFilters.forEach((q)=>{Y.push(this.setModelOnFilterWrapper(q,null))});g.all(Y).then(()=>{let q=this.getModel(!0),H=[];if(this.allColumnFilters.forEach((_,U)=>{let W=G?G[U]:null,B=q?q[U]:null;if(!DZ(W,B))H.push(_.column)}),H.length>0)X?.onFilterChanged({columns:H,source:z});else if(J)this.updateActive("filterChanged")})}getModel(Q){let z={},{allColumnFilters:J,initialModel:Z,beans:{colModel:$}}=this;if(J.forEach((X,Y)=>{let G=this.getModelFromFilterWrapper(X);if(T(G))z[Y]=G}),!Q)for(let X of Object.keys(Z)){let Y=Z[X];if(T(Y)&&!J.has(X)&&$.getCol(X)?.isFilterAllowed())z[X]=Y}return z}setState(Q,z,J="api"){if(this.state.clear(),z)for(let Z of Object.keys(z)){let $=z[Z];this.state.set(Z,{model:F0(this.model,Z),state:$})}this.setModel(Q,J,!0)}getState(){let Q=this.state;if(!Q.size)return;let z={},J=!1;return Q.forEach((Z,$)=>{let X=Z.state;if(X!=null)J=!0,z[$]=X}),J?z:void 0}getModelFromFilterWrapper(Q){let J=Q.column.getColId();if(Q.isHandler)return F0(this.model,J);let Z=Q.filter;if(Z){if(typeof Z.getModel!=="function")return R(66),null;return Z.getModel()}return F0(this.initialModel,J)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};let{allColumnFilters:Q}=this;if(Q.size)return Q.forEach((z)=>this.disposeFilterWrapper(z,"advancedFilterEnabled")),!0;return!1}updateActiveFilters(){let Q=(q)=>{if(!q)return!1;if(!q.isFilterActive)return R(67),!1;return q.isFilterActive()},{colModel:z,gos:J}=this.beans,Z=!!TQ(J),$=[],X=[],Y=(q,H,_)=>{if(H)if(f8(q,z.isPivotMode(),z.isPivotActive(),Z))$.push(_);else X.push(_)},G=[];return this.allColumnFilters.forEach((q)=>{let H=q.column,_=H.getColId();if(q.isHandler)G.push(g.resolve().then(()=>{Y(H,this.isHandlerActive(H),{colId:_,isHandler:!0,handler:q.handler,handlerParams:q.handlerParams})}));else{let U=aQ(q);if(U)G.push(U.then((W)=>{Y(H,Q(W),{colId:_,isHandler:!1,comp:W})}))}}),g.all(G).then(()=>{this.activeAggregateFilters=$,this.activeColumnFilters=X})}updateFilterFlagInColumns(Q,z){let J=[];return this.allColumnFilters.forEach((Z)=>{let $=Z.column;if(Z.isHandler)J.push(g.resolve().then(()=>{this.setColFilterActive($,this.isHandlerActive($),Q,z)}));else{let X=aQ(Z);if(X)J.push(X.then((Y)=>{this.setColFilterActive($,Y.isFilterActive(),Q,z)}))}}),this.beans.groupFilter?.updateFilterFlags(Q,z),g.all(J)}doFiltersPass(Q,z,J){let{data:Z,aggData:$}=Q,X=J?this.activeAggregateFilters:this.activeColumnFilters,Y=J?$:Z,G=this.model;for(let q=0;q{if(this.isAlive())J?.onFilterChanged(Q)};if(z.isRefreshInProgress())setTimeout(Z,0);else Z()}updateBeforeFilterChanged(Q={}){let{column:z,additionalEventAttributes:J}=Q,Z=z?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",J).then(()=>{this.allColumnFilters.forEach(($)=>{let{column:X,isHandler:Y}=$;if(Z===X.getColId())return;if(Y)$.handler.onAnyFilterChanged?.();aQ($,Y)?.then((G)=>{if(typeof G?.onAnyFilterChanged==="function")G.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(Q){let z=[];this.allColumnFilters.forEach((J)=>{let Z=J.isHandler;if(Z)J.handler.onNewRowsLoaded?.();let $=aQ(J,Z);if($)z.push($.then((X)=>{X.onNewRowsLoaded?.()}))}),g.all(z).then(()=>this.updateActive(Q,{afterDataChange:!0}))}updateActive(Q,z){this.updateFilterFlagInColumns(Q,z).then(()=>this.updateActiveFilters())}createGetValue(Q,z){let{filterValueSvc:J,colModel:Z}=this.beans;return($,X)=>{let Y=X?Z.getCol(X):Q;return Y?J.getValue(Y,$,z):void 0}}isFilterActive(Q){let z=this.cachedFilter(Q);if(z?.isHandler)return this.isHandlerActive(Q);let J=z?.filter;if(J)return J.isFilterActive();return F0(this.initialModel,Q.getColId())!=null}isHandlerActive(Q){let z=T(F0(this.model,Q.getColId()));if(z)return z;let J=this.beans.groupFilter;return J?.isGroupFilter(Q)?J.isFilterActive(Q):!1}getOrCreateFilterUi(Q){let z=this.getOrCreateFilterWrapper(Q,!0);return z?aQ(z):null}getFilterUiForDisplay(Q){let z=this.getOrCreateFilterWrapper(Q,!0);if(!z)return null;let J=aQ(z);if(!J)return null;return J.then((Z)=>({comp:Z,params:z.filterUi.filterParams,isHandler:z.isHandler}))}getHandler(Q,z){let J=this.getOrCreateFilterWrapper(Q,z);return J?.isHandler?J.handler:void 0}getOrCreateFilterWrapper(Q,z){if(!Q.isFilterAllowed())return;let J=this.cachedFilter(Q);if(!J&&z)J=this.createFilterWrapper(Q),this.setColumnFilterWrapper(Q,J);return J}cachedFilter(Q){return this.allColumnFilters.get(Q.getColId())}getDefaultFilter(Q,z=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(Q),z)}getDefaultFilterFromDataType(Q,z=!1){if(iG(this.gos))return z?"agSetColumnFloatingFilter":"agSetColumnFilter";return C6(Q(),z)}getDefaultFloatingFilter(Q){return this.getDefaultFilter(Q,!0)}createFilterComp(Q,z,J,Z,$,X){let Y=()=>{let H=this.createFilterCompParams(Q,$,X),_=Z(H,$);return d5(this.beans.userCompFactory,z,_,J)},G=Y();if(!G)return null;return{compDetails:G,createFilterUi:(H)=>{return(H?Y():G).newAgStackInstance()}}}createFilterInstance(Q,z,J,Z){let $=this.beans.selectableFilter;if($?.isSelectable(z))z=$.getFilterDef(Q,z);let{handler:X,handlerParams:Y,handlerGenerator:G}=this.createHandler(Q,z,J)??{},q=this.createFilterComp(Q,z,J,Z,!!X,"init");if(!q)return{compDetails:null,createFilterUi:null,handler:X,handlerGenerator:G,handlerParams:Y};let{compDetails:H,createFilterUi:_}=q;if(this.isGlobalButtons){if(!H.params?.buttons?.length)R(281,{colId:Q.getColId()})}return{compDetails:H,handler:X,handlerGenerator:G,handlerParams:Y,createFilterUi:_}}createBaseFilterParams(Q,z){let{filterManager:J,rowModel:Z}=this.beans;return y(this.gos,{column:Q,colDef:Q.getColDef(),getValue:this.createGetValue(Q),doesRowPassOtherFilter:z?()=>!0:($)=>J?.doesRowPassOtherFilters(Q.getColId(),$)??!0,rowModel:Z})}createFilterCompParams(Q,z,J,Z){let $=this.filterChangedCallbackFactory(Q),X=this.createBaseFilterParams(Q,Z);if(X.filterChangedCallback=$,X.filterModifiedCallback=Z?()=>{}:(Y)=>this.filterModified(Q,Y),z){let Y=X,G=Q.getColId(),q=F0(this.model,G);Y.model=q,Y.state=this.state.get(G)??{model:q},Y.onModelChange=(H,_)=>{this.updateStoredModel(G,H),this.refreshHandlerAndUi(Q,H,"ui",!1,_).then(()=>{$({..._,source:"columnFilter"})})},Y.onStateChange=(H)=>{this.updateState(Q,H),this.updateOrRefreshFilterUi(Q)},Y.onAction=(H,_,U)=>{this.updateModel(Q,H,_),this.dispatchLocalEvent({type:"filterAction",column:Q,action:H,event:U})},Y.getHandler=()=>this.getHandler(Q,!0),Y.onUiChange=(H)=>this.filterUiChanged(Q,H),Y.source=J}return X}createFilterUiForHandler(Q,z){return z?{created:!1,create:z,filterParams:Q.params,compDetails:Q}:null}createFilterUiLegacy(Q,z,J){let Z=z(),$={created:!0,create:z,filterParams:Q.params,compDetails:Q,promise:Z};return Z.then(J),$}createFilterWrapper(Q){let{compDetails:z,handler:J,handlerGenerator:Z,handlerParams:$,createFilterUi:X}=this.createFilterInstance(Q,Q.getColDef(),this.getDefaultFilter(Q),(G)=>G),Y=Q.getColId();if(J)return delete this.initialModel[Y],J.init?.({...$,source:"init",model:F0(this.model,Y)}),{column:Q,isHandler:!0,handler:J,handlerGenerator:Z,handlerParams:$,filterUi:this.createFilterUiForHandler(z,X)};if(X){let G={column:Q,filterUi:null,isHandler:!1};return G.filterUi=this.createFilterUiLegacy(z,X,(q)=>{G.filter=q??void 0}),G}return{column:Q,filterUi:null,isHandler:!1}}createHandlerFunc(Q,z,J){let{gos:Z,frameworkOverrides:$,registry:X}=this.beans,Y,G=(B)=>{let E=B.filter;if(S9(E)){let K=E.handler;if(K)return K;if(Y=E.doesFilterPass,Y)return()=>({doesFilterPass:Y});return}return typeof E==="string"?E:void 0},q=Z.get("enableFilterHandlers"),H=q?G(z):void 0,_=(B)=>()=>this.createBean(X.createDynamicBean(B,!0)),U,W;if(typeof H==="string"){let B=Z.get("filterHandlers")?.[H];if(B!=null)U=B;else if(CL.has(H))U=_(H),W=H}else U=H;if(!U){let B,{compName:E,jsComp:K,fwComp:L}=T9($,z);if(E)B=E;else if(K==null&&L==null&&z.filter===!0)B=J;if(W=this.handlerMap[B],W)U=_(W)}if(!U){if(!q)return;if(o(Z))R(277,{colId:Q.getColId()});return eL}return{filterHandler:U,handlerNameOrCallback:Y??W}}createHandler(Q,z,J){let Z=this.createHandlerFunc(Q,z,J);if(!Z)return;let $=R2(this.beans.userCompFactory,z,this.createFilterCompParams(Q,!0,"init")),{handlerNameOrCallback:X,filterHandler:Y}=Z,{handler:G,handlerParams:q}=this.createHandlerFromFunc(Q,Y,$);return{handler:G,handlerParams:q,handlerGenerator:X??Y}}createHandlerFromFunc(Q,z,J){let Z=Q.getColDef(),$=z(y(this.gos,{column:Q,colDef:Z})),X=this.createHandlerParams(Q,J);return{handler:$,handlerParams:X}}createHandlerParams(Q,z){let J=Q.getColDef(),Z=Q.getColId(),$=this.filterChangedCallbackFactory(Q);return y(this.gos,{colDef:J,column:Q,getValue:this.createGetValue(Q),doesRowPassOtherFilter:(X)=>this.beans.filterManager?.doesRowPassOtherFilters(Z,X)??!0,onModelChange:(X,Y)=>{this.updateStoredModel(Z,X),this.refreshHandlerAndUi(Q,X,"handler",!1,Y).then(()=>{$({...Y,source:"columnFilter"})})},onModelAsStringChange:()=>{Q.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:Q})},filterParams:z})}onColumnsChanged(){let Q=[],{colModel:z,filterManager:J,groupFilter:Z}=this.beans;this.allColumnFilters.forEach((X,Y)=>{let G;if(X.column.isPrimary())G=z.getColDefCol(Y);else G=z.getCol(Y);if(G&&G===X.column)return;Q.push(X.column),this.disposeFilterWrapper(X,"columnChanged"),this.disposeColumnListener(Y)});let $=Z&&Q.every((X)=>Z.isGroupFilter(X));if(Q.length>0&&!$)J?.onFilterChanged({columns:Q,source:"api"})}isFilterAllowed(Q){if(!Q.isFilterAllowed())return!1;let J=this.beans.groupFilter;if(J?.isGroupFilter(Q))return J.isFilterAllowed(Q);return!0}getFloatingFilterCompDetails(Q,z){let{userCompFactory:J,frameworkOverrides:Z,selectableFilter:$,gos:X}=this.beans,Y=(B)=>{this.getOrCreateFilterUi(Q)?.then((K)=>{B(mQ(K))})},G=Q.getColDef(),q=$?.isSelectable(G)?$.getFilterDef(Q,G):G,H=b6(Z,q,()=>this.getDefaultFloatingFilter(Q))??"agReadOnlyFloatingFilter",_=X.get("enableFilterHandlers"),U=R2(J,q,this.createFilterCompParams(Q,_,"init",!0)),W=y(X,{column:Q,filterParams:U,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(Q),parentFilterInstance:Y,showParentFilter:z});if(_){let B=W,E=Q.getColId(),K=this.filterChangedCallbackFactory(Q);B.onUiChange=(L)=>this.floatingFilterUiChanged(Q,L),B.model=F0(this.model,E),B.onModelChange=(L,F)=>{this.updateStoredModel(E,L),this.refreshHandlerAndUi(Q,L,"floating",!0,F).then(()=>{K({...F,source:"columnFilter"})})},B.getHandler=()=>this.getHandler(Q,!0),B.source="init"}return t5(J,G,W,H)}getCurrentFloatingFilterParentModel(Q){return this.getModelFromFilterWrapper(this.cachedFilter(Q)??{column:Q})}destroyFilterUi(Q,z,J,Z){if(Q.isHandler){let X=z.getColId();delete this.initialModel[X],this.state.delete(X);let Y=Q.filterUi,G=this.createFilterUiForHandler(J,Z);Q.filterUi=G;let q=this.eventSvc;if(Y?.created)Y.promise.then((H)=>{this.destroyBean(H),q.dispatchEvent({type:"filterDestroyed",source:"paramsUpdated",column:z})});else q.dispatchEvent({type:"filterHandlerDestroyed",source:"paramsUpdated",column:z})}else this.destroyFilter(z,"paramsUpdated")}destroyFilter(Q,z="api"){let J=Q.getColId(),Z=this.allColumnFilters.get(J);if(this.disposeColumnListener(J),delete this.initialModel[J],Z)this.disposeFilterWrapper(Z,z).then(($)=>{if($&&this.isAlive())this.beans.filterManager?.onFilterChanged({columns:[Q],source:"api"})})}disposeColumnListener(Q){let z=this.allColumnListeners.get(Q);if(z)this.allColumnListeners.delete(Q),z()}disposeFilterWrapper(Q,z){let J=!1,{column:Z,isHandler:$,filterUi:X}=Q,Y=Z.getColId();if($)J=this.isHandlerActive(Z),this.destroyBean(Q.handler),delete this.model[Y],this.state.delete(Y);let G=()=>{this.setColFilterActive(Z,!1,"filterDestroyed"),this.allColumnFilters.delete(Y),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:z,column:Z})};if(X)if(X.created)return X.promise.then((q)=>{return J=$?J:!!q?.isFilterActive(),this.destroyBean(q),G(),J});else G();return g.resolve(J)}filterChangedCallbackFactory(Q){return(z)=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:z,columns:[Q],column:Q,source:z?.source??"columnFilter"})}}filterParamsChanged(Q,z="api"){let J=this.allColumnFilters.get(Q);if(!J)return;let Z=this.beans,$=J.column,X=$.getColDef(),Y=$.isFilterAllowed(),G=this.getDefaultFilter($),q=Z.selectableFilter,H=q?.isSelectable(X)?q.getFilterDef($,X):X,_=Y?this.createHandlerFunc($,H,this.getDefaultFilter($)):void 0,U=!!_,W=J.isHandler;if(W!=U){this.destroyFilter($,"paramsUpdated");return}let{compDetails:B,createFilterUi:E}=(Y?this.createFilterComp($,H,G,(L)=>L,U,"colDef"):null)??{compDetails:null,createFilterUi:null},K=B?.params??R2(Z.userCompFactory,H,this.createFilterCompParams($,U,"colDef"));if(W){let L=_?.handlerNameOrCallback??_?.filterHandler,F=F0(this.model,Q);if(J.handlerGenerator!=L){let D=J.handler,{handler:M,handlerParams:k}=this.createHandlerFromFunc($,_.filterHandler,K);if(J.handler=M,J.handlerParams=k,J.handlerGenerator=L,delete this.model[Q],M.init?.({...k,source:"init",model:null}),this.destroyBean(D),F!=null)this.beans.filterManager?.onFilterChanged({columns:[$],source:z})}else{let D=this.createHandlerParams($,B?.params);J.handlerParams=D,J.handler.refresh?.({...D,source:"colDef",model:F})}}if(this.areFilterCompsDifferent(J.filterUi?.compDetails??null,B)||!J.filterUi||!B){this.destroyFilterUi(J,$,B,E);return}J.filterUi.filterParams=K,aQ(J,W)?.then((L)=>{if((L?.refresh?L.refresh(K):!0)===!1)this.destroyFilterUi(J,$,B,E);else this.dispatchLocalEvent({type:"filterParamsChanged",column:$,params:K})})}refreshHandlerAndUi(Q,z,J,Z,$){let X=this.cachedFilter(Q);if(!X){if(Z)this.getOrCreateFilterWrapper(Q,!0);return g.resolve()}if(!X.isHandler)return g.resolve();let{filterUi:Y,handler:G,handlerParams:q}=X;return rZ(()=>{if(Y){let{created:H,filterParams:_}=Y;if(H)return Y.promise.then((U)=>{return U?{filter:U,filterParams:_}:void 0});else Y.refreshed=!0}return g.resolve(void 0)},G,q,z,this.state.get(Q.getColId())??{model:z},J,$)}setColumnFilterWrapper(Q,z){let J=Q.getColId();this.allColumnFilters.set(J,z),this.allColumnListeners.set(J,this.addManagedListeners(Q,{colDefChanged:()=>this.filterParamsChanged(J)})[0])}areFilterCompsDifferent(Q,z){if(!z||!Q)return!0;let{componentClass:J}=Q,{componentClass:Z}=z;return!(J===Z||J?.render&&Z?.render&&J.render===Z.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some((z)=>z.getColDef().floatingFilter)}getFilterInstance(Q){let z=this.beans.colModel.getColDefCol(Q);if(!z)return Promise.resolve(void 0);let J=this.getOrCreateFilterUi(z);if(!J)return Promise.resolve(null);return new Promise((Z)=>{J.then(($)=>{Z(mQ($))})})}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:Q,source:z})=>this.setModel(Q,z)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:Q,model:z,resolve:J})=>{this.setModelForColumn(Q,z).then(()=>J())}),this.columnModelUpdates=[]}getModelForColumn(Q,z){if(z){let{state:Z,model:$}=this,X=Q.getColId(),Y=Z.get(X);if(Y)return Y.model??null;return F0($,X)}let J=this.cachedFilter(Q);return J?this.getModelFromFilterWrapper(J):null}setModelForColumn(Q,z){if(this.beans.dataTypeSvc?.isPendingInference){let J=()=>{},Z=new Promise(($)=>{J=$});return this.columnModelUpdates.push({key:Q,model:z,resolve:J}),Z}return new Promise((J)=>{this.setModelForColumnLegacy(Q,z).then((Z)=>J(Z))})}getStateForColumn(Q){return this.state.get(Q)??{model:F0(this.model,Q)}}setModelForColumnLegacy(Q,z){let J=this.beans.colModel.getColDefCol(Q),Z=J?this.getOrCreateFilterWrapper(J,!0):null;return Z?this.setModelOnFilterWrapper(Z,z):g.resolve()}setColDefPropsForDataType(Q,z,J){let Z=Q.filter,$=Z===!0?this.getDefaultFilterFromDataType(()=>z.baseDataType):Z;if(typeof $!=="string")return;let X,Y,G=this.beans,{filterParams:q,filterValueGetter:H}=Q;if($==="agMultiColumnFilter")({filterParams:X,filterValueGetter:Y}=G.multiFilter?.getParamsForDataType(q,H,z,J)??{});else({filterParams:X,filterValueGetter:Y}=I6($,q,H,z,J,G,this.getLocaleTextFunc()));if(Q.filterParams=X,Y)Q.filterValueGetter=Y}setColFilterActive(Q,z,J,Z){if(Q.filterActive!==z)Q.filterActive=z,Q.dispatchColEvent("filterActiveChanged",J);Q.dispatchColEvent("filterChanged",J,Z)}setModelOnFilterWrapper(Q,z,J){return new g((Z)=>{if(Q.isHandler){let X=Q.column,Y=X.getColId(),G=this.model[Y];if(this.updateStoredModel(Y,z),J&&z===G){Z();return}this.refreshHandlerAndUi(X,z,"api").then(()=>Z());return}let $=aQ(Q);if($){$.then((X)=>{if(typeof X?.setModel!=="function"){R(65),Z();return}(X.setModel(z)||g.resolve()).then(()=>Z())});return}Z()})}updateStoredModel(Q,z){if(T(z))this.model[Q]=z;else delete this.model[Q];let J=this.state.get(Q),Z={model:z,state:J?.state};this.state.set(Q,Z)}filterModified(Q,z){this.getOrCreateFilterUi(Q)?.then((J)=>{this.eventSvc.dispatchEvent({type:"filterModified",column:Q,filterInstance:J,...z})})}filterUiChanged(Q,z){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"filterUiChanged",column:Q,...z})}floatingFilterUiChanged(Q,z){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:Q,...z})}updateModel(Q,z,J){let Z=Q.getColId(),$=this.cachedFilter(Q),X=()=>$?.filterUi;FZ({action:z,filterParams:$?.filterUi?.filterParams,getFilterUi:X,getModel:()=>F0(this.model,Z),getState:()=>this.state.get(Z),updateState:(Y)=>this.updateState(Q,Y),updateModel:(Y)=>X()?.filterParams?.onModelChange(Y,{...J,fromAction:z}),processModelToApply:$?.isHandler?$.handler.processModelToApply?.bind($.handler):void 0})}updateAllModels(Q,z){let J=[];if(this.allColumnFilters.forEach((Z,$)=>{let X=this.beans.colModel.getColDefCol($);if(X)FZ({action:Q,filterParams:Z.filterUi?.filterParams,getFilterUi:()=>Z.filterUi,getModel:()=>F0(this.model,$),getState:()=>this.state.get($),updateState:(Y)=>this.updateState(X,Y),updateModel:(Y)=>{this.updateStoredModel($,Y),this.dispatchLocalEvent({type:"filterAction",column:X,action:Q}),J.push(this.refreshHandlerAndUi(X,Y,"ui"))},processModelToApply:Z?.isHandler?Z.handler.processModelToApply?.bind(Z.handler):void 0})}),J.length)g.all(J).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:z,columns:[]})})}updateOrRefreshFilterUi(Q){let z=Q.getColId();EX(()=>this.cachedFilter(Q)?.filterUi,()=>F0(this.model,z),()=>this.state.get(z))}updateState(Q,z){this.state.set(Q.getColId(),z),this.dispatchLocalEvent({type:"filterStateChanged",column:Q,state:z})}canApplyAll(){let{state:Q,model:z,activeFilterComps:J}=this;for(let $ of J)if($.source==="COLUMN_MENU")return!1;let Z=!1;for(let $ of Q.keys()){let X=Q.get($);if(X.valid===!1)return!1;if((X.model??null)!==F0(z,$))Z=!0}return Z}hasUnappliedModel(Q){let{model:z,state:J}=this;return(J.get(Q)?.model??null)!==F0(z,Q)}setGlobalButtons(Q){this.isGlobalButtons=Q,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:Q})}shouldKeepStateOnDetach(Q,z){if(z==="newFiltersToolPanel")return!0;let J=this.beans.filterPanelSvc;if(J?.isActive)return!!J.getState(Q.getColId());return!1}onPivotModeChanged(Q){let{colModel:z,pivotColsSvc:J}=this.beans,Z=!!TQ(this.gos),$=Q.currentValue,X=$?this.activeColumnFilters:this.activeAggregateFilters,Y=$?this.activeAggregateFilters:this.activeColumnFilters,G=[];for(let q of X){let H=z.getColById(q.colId),_=$&&!!J?.columns.length;if(H&&$===f8(H,$,_,Z))Y.push(q),G.push(q)}JJ(X,G)}destroy(){super.destroy(),this.allColumnFilters.forEach((Q)=>this.disposeFilterWrapper(Q,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function zF(Q){return!!Q.filterManager?.isAnyFilterPresent()}function JF(Q,z="api"){Q.filterManager?.onFilterChanged({source:z})}var ZF=class extends j{constructor(){super(...arguments);this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(Q){this.quickFilter=Q.quickFilter,this.advancedFilter=Q.advancedFilter,this.colFilter=Q.colFilter}postConstruct(){let Q=this.refreshFiltersForAggregations.bind(this),z=this.updateAdvFilterColumns.bind(this);if(this.addManagedEventListeners({columnValueChanged:Q,columnPivotChanged:Q,columnPivotModeChanged:Q,newColumnsLoaded:z,columnVisible:z,advancedFilterEnabledChanged:({enabled:Z})=>this.onAdvFilterEnabledChanged(Z),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter)this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});let{gos:J}=this;this.alwaysPassFilter=J.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=J.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){let Q=this.gos.getCallback("isExternalFilterPresent");return typeof Q==="function"&&Q({})}doesExternalFilterPass(Q){let z=this.gos.get("doesExternalFilterPass");return typeof z==="function"&&z(Q)}setFilterState(Q,z,J="api"){if(this.isAdvFilterEnabled())return;this.colFilter?.setState(Q,z,J)}setFilterModel(Q,z="api",J){if(this.isAdvFilterEnabled()){if(!J)this.warnAdvFilters();return}this.colFilter?.setModel(Q,z)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(Q){if(Q){if(this.colFilter?.disableFilters())this.onFilterChanged({source:"advancedFilter"})}else if(this.advancedFilter?.isFilterPresent())this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"})}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){if(TQ(this.gos)&&this.isAnyFilterPresent())this.onFilterChanged()}onFilterChanged(Q={}){let{source:z,additionalEventAttributes:J,columns:Z=[]}=Q;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(Q):g.resolve()).then(()=>{let $={source:z,type:"filterChanged",columns:Z};if(J)B0($,J);this.eventSvc.dispatchEvent($),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!TQ(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(Q,z){return this.doesRowPassFilter({rowNode:z,colIdToSkip:Q})}doesRowPassAggregateFilters(Q){let{rowNode:z}=Q;if(this.alwaysPassFilter?.(z))return!0;if(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(z))return!1;if(this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(z,Q.colIdToSkip,!0))return!1;return!0}doesRowPassFilter(Q){let{rowNode:z}=Q;if(this.alwaysPassFilter?.(z))return!0;if(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(z))return!1;if(this.externalFilterPresent&&!this.doesExternalFilterPass(z))return!1;if(this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(z,Q.colIdToSkip))return!1;if(this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(z))return!1;return!0}isFilterAllowed(Q){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.isFilterAllowed(Q)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(Q,z="api"){if(!this.isAdvFilterEnabled())return;if(this.beans.dataTypeSvc?.isPendingInference){this.advFilterModelUpdateQueue.push(Q);return}this.advancedFilter.setModel(Q??null),this.onFilterChanged({source:z})}toggleAdvFilterBuilder(Q,z){if(!this.isAdvFilterEnabled())return;this.advancedFilter.getCtrl().toggleFilterBuilder({source:z,force:Q})}updateAdvFilterColumns(){if(!this.isAdvFilterEnabled())return;if(this.advancedFilter.updateValidity())this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(Q){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve(void 0);return this.colFilter?.getFilterInstance(Q)??Promise.resolve(void 0)}warnAdvFilters(){R(68)}setupAdvFilterHeaderComp(Q){this.advancedFilter?.getCtrl().setupHeaderComp(Q)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(let Q of this.advFilterModelUpdateQueue)this.setAdvFilterModel(Q);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(Q,z){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve();return this.colFilter?.setModelForColumn(Q,z)??Promise.resolve()}};function $F(Q){return{tag:"div",cls:Q}}var y6=class extends x{constructor(Q){let{className:z="ag-filter-apply-panel"}=Q??{};super($F(z));this.listeners=[],this.validationMessage=null,this.className=z}updateButtons(Q,z){let J=this.buttons;if(this.buttons=Q,J===Q)return;let Z=this.getGui();z0(Z);let $;this.destroyListeners();let X=document.createDocumentFragment(),Y=this.className,G=({type:H,label:_})=>{let U=(F)=>{this.dispatchLocalEvent({type:H,event:F})};if(!["apply","clear","reset","cancel"].includes(H))R(75);let W=H==="apply",E=Z0({tag:"button",attrs:{type:W&&z?"submit":"button"},ref:`${H}FilterButton`,cls:`ag-button ag-standard-button ${Y}-button${W?" "+Y+"-apply-button":""}`,children:_});if(this.activateTabIndex([E]),W)$=E;let K=(F)=>{if(F.key===V.ENTER)F.preventDefault(),U(F)},L=this.listeners;E.addEventListener("click",U),L.push(()=>E.removeEventListener("click",U)),E.addEventListener("keydown",K),L.push(()=>E.removeEventListener("keydown",K)),X.append(E)};for(let H of Q)G(H);this.eApply=$;let q=this.validationTooltipFeature;if($&&!q)this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1000}));else if(!$&&q)this.validationTooltipFeature=this.destroyBean(q);Z.append(X)}getApplyButton(){return this.eApply}updateValidity(Q,z=null){let J=this.eApply;if(!J)return;T5(J,!Q),this.validationMessage=z,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage)}destroyListeners(){for(let Q of this.listeners)Q();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}};var x6=class extends x{constructor(Q,z,J,Z,$,X){super();this.column=Q,this.wrapper=z,this.eventParent=J,this.updateModel=Z,this.isGlobalButtons=$,this.enableGlobalButtonCheck=X,this.hidePopup=null,this.applyActive=!1}postConstruct(){let{comp:Q,params:z}=this.wrapper,J=z,Z=J.useForm,$=Z?"form":"div";if(this.setTemplate({tag:$,cls:"ag-filter-wrapper"}),Z)this.addManagedElementListeners(this.getGui(),{submit:(X)=>{X?.preventDefault()},keydown:this.handleKeyDown.bind(this)});this.appendChild(Q.getGui()),this.params=J,this.resetButtonsPanel(J),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:X,params:Y})=>{if(X===this.column)this.resetButtonsPanel(Y,this.params)},filterStateChanged:({column:X,state:Y})=>{if(X===this.column)this.eButtons?.updateValidity(Y.valid!==!1)},filterAction:({column:X,action:Y,event:G})=>{if(X===this.column)this.afterAction(Y,G)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:X})=>{if(X!==this.isGlobalButtons){this.isGlobalButtons=X;let Y=this.params;this.resetButtonsPanel(Y,Y,!0)}}}:void 0})}afterGuiAttached(Q){if(Q)this.hidePopup=Q.hidePopup}resetButtonsPanel(Q,z,J){let{buttons:Z,readOnly:$}=z??{},{buttons:X,readOnly:Y,useForm:G}=Q;if(!J&&$===Y&&DZ(Z,X))return;let q=X&&X.length>0&&!Q.readOnly&&!this.isGlobalButtons,H=this.eButtons;if(q){let _=X.map((U)=>{let W=`${U}Filter`;return{type:U,label:N9(this,W)}});if(this.applyActive=WJ(this.params),!H){H=this.createBean(new y6),this.appendChild(H.getGui());let U=this.column,W=(B)=>({event:E})=>{this.updateModel(U,B,{fromButtons:!0}),this.afterAction(B,E)};H?.addManagedListeners(H,{apply:W("apply"),clear:W("clear"),reset:W("reset"),cancel:W("cancel")}),this.eButtons=H}H.updateButtons(_,G)}else if(this.applyActive=!1,H)T0(H.getGui()),this.eButtons=this.destroyBean(H)}close(Q){let z=this.hidePopup;if(!z)return;let J=Q,Z=J?.key,$;if(Z===V.ENTER||Z===V.SPACE)$={keyboardEvent:J};z($),this.hidePopup=null}afterAction(Q,z){let{params:J,applyActive:Z}=this,$=J?.closeOnApply;switch(Q){case"apply":{if(z?.preventDefault(),$&&Z)this.close(z);break}case"reset":{if($&&Z)this.close();break}case"cancel":{if($)this.close(z);break}}}handleKeyDown(Q){if(!Q.defaultPrevented&&Q.key===V.ENTER&&this.applyActive)this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",Q)}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},XF=":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}",YF={tag:"div",cls:"ag-filter"},w6=class extends x{constructor(Q,z,J){super(YF);this.column=Q,this.source=z,this.enableGlobalButtonCheck=J,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return this.wrapper!=null}getFilter(){return this.wrapper?.then((Q)=>Q.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??g.resolve()}afterGuiAttached(Q){this.afterGuiAttachedParams=Q,this.wrapper?.then((z)=>{this.comp?.afterGuiAttached(Q),z?.comp?.afterGuiAttached?.(Q)})}afterGuiDetached(){this.wrapper?.then((Q)=>{Q?.comp?.afterGuiDetached?.()})}createFilter(Q){let{column:z,source:J,beans:{colFilter:Z}}=this,$=Z.getFilterUiForDisplay(z)??null;this.wrapper=$,$?.then((X)=>{if(!X)return;let{isHandler:Y,comp:G}=X,q;if(Y){let H=!!this.enableGlobalButtonCheck,_=this.createBean(new x6(z,X,Z,Z.updateModel.bind(Z),H&&Z.isGlobalButtons,H));this.comp=_,q=_.getGui()}else if(this.registerCSS(XF),q=G.getGui(),!T(q))R(69,{guiFromFilter:q});if(this.appendChild(q),Q)this.eventSvc.dispatchEvent({type:"filterOpened",column:z,source:J,eGui:this.getGui()});else G.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(Q){let{source:z,column:J}=Q;if((z==="api"||z==="paramsUpdated")&&J.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column))z0(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter()}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},GF=class extends j{constructor(){super(...arguments);this.beanName="filterMenuFactory"}wireBeans(Q){this.popupSvc=Q.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(Q,z,J,Z){if(Q&&!Q.isColumn)return;this.showPopup(Q,($)=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:Q},type:J,mouseEvent:z,ePopup:$})},J,z.target,U0(this.gos),Z)}showMenuAfterButtonClick(Q,z,J,Z){if(Q&&!Q.isColumn)return;let $=-1,X="left",Y=U0(this.gos);if(!Y&&this.gos.get("enableRtl"))$=1,X="right";let G=Y?void 0:4*$,q=Y?void 0:4;this.showPopup(Q,(H)=>{this.popupSvc?.positionPopupByComponent({type:J,eventSource:z,ePopup:H,nudgeX:G,nudgeY:q,alignSide:X,keepWithinBounds:!0,position:"under",additionalParams:{column:Q}})},J,z,Y,Z)}showPopup(Q,z,J,Z,$,X){let Y=Q?this.createBean(new w6(Q,"COLUMN_MENU")):void 0;if(this.activeMenu=Y,!Y?.hasFilter()||!Q){e(57);return}let G=Z0({tag:"div",cls:`ag-menu${!$?" ag-filter-menu":""}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(G,{keydown:(K)=>this.trapFocusWithin(K,G)}),G.appendChild(Y?.getGui());let q,H=()=>Y?.afterGuiDetached(),_=h5(this.gos)?Z??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,U=(K)=>{zJ(Q,!1,"contextMenu");let L=K instanceof KeyboardEvent;if(this.tabListener)this.tabListener=this.tabListener();if(L&&Z&&f0(Z))xZ(Z)?.focus({preventScroll:!0});H(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,J,Q),X?.()},W=this.getLocaleTextFunc(),B=$&&J!=="columnFilter"?W("ariaLabelColumnMenu","Column Menu"):W("ariaLabelColumnFilter","Column Filter"),E=this.popupSvc?.addPopup({modal:!0,eChild:G,closeOnEsc:!0,closedCallback:U,positionCallback:()=>z(G),anchorToElement:_,ariaLabel:B});if(E)this.hidePopup=q=E.hideFunc;Y.afterInit().then(()=>{z(G),Y.afterGuiAttached({container:J,hidePopup:q})}),zJ(Q,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,J,Q)}trapFocusWithin(Q,z){if(Q.key!==V.TAB||Q.defaultPrevented||R0(this.beans,z,!1,Q.shiftKey))return;Q.preventDefault(),D0(z,Q.shiftKey)}dispatchVisibleChangedEvent(Q,z,J){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:Q,switchingTab:!1,key:z,column:J??null,columnGroup:null})}isMenuEnabled(Q){return Q.isFilterAllowed()&&(Q.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},qF=class extends j{constructor(){super(...arguments);this.beanName="filterValueSvc"}getValue(Q,z,J){if(!z)return;let Z=Q.getColDef(),{selectableFilter:$,valueSvc:X,formula:Y}=this.beans,G=J??$?.getFilterValueGetter(Q.getColId())??Z.filterValueGetter;if(G)return this.executeFilterValueGetter(G,z.data,Q,z,Z);let q=X.getValue(Q,z,"data");if(Q.isAllowFormula()&&Y?.isFormula(q))return Y.resolveValue(Q,z);return q}executeFilterValueGetter(Q,z,J,Z,$){let{expressionSvc:X,valueSvc:Y}=this.beans,G=y(this.gos,{data:z,node:Z,column:J,colDef:$,getValue:Y.getValueCallback.bind(Y,Z)});if(typeof Q==="function")return Q(G);return X?.evaluate(Q,G)}};function HF(Q){return!!Q.quickFilter?.isFilterPresent()}function _F(Q){return Q.quickFilter?.getText()}function UF(Q){Q.quickFilter?.resetCache()}var WF=class extends j{constructor(){super(...arguments);this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){let Q=this.resetCache.bind(this),z=this.gos;this.addManagedEventListeners({columnPivotModeChanged:Q,newColumnsLoaded:Q,columnRowGroupChanged:Q,columnVisible:()=>{if(!z.get("includeHiddenColumnsInQuickFilter"))this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",(J)=>this.setFilter(J.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(z.get("quickFilterText")),this.parser=z.get("quickFilterParser"),this.matcher=z.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){let{autoColSvc:Q,colModel:z,gos:J,pivotResultCols:Z}=this.beans,$=z.isPivotMode(),X=Q?.getColumns(),Y=z.getColDefCols(),G=($&&!J.get("applyQuickFilterBeforePivotOrAgg")?Z?.getPivotResultCols()?.list:Y)??[];if(X)G=G.concat(X);this.colsToUse=J.get("includeHiddenColumnsInQuickFilter")?G:G.filter((q)=>q.isVisible()||q.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(Q){let z=this.gos.get("cacheQuickFilter");if(this.matcher)return this.doesRowPassMatcher(z,Q);return this.quickFilterParts.every((J)=>z?this.doesRowPassCache(Q,J):this.doesRowPassNoCache(Q,J))}resetCache(){this.beans.rowModel.forEachNode((Q)=>Q.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){let{quickFilter:Q,parser:z}=this;if(Q)this.quickFilterParts=z?z(Q):Q.split(" ");else this.quickFilterParts=null}parseFilter(Q){if(!T(Q))return null;return Q.toUpperCase()}setFilter(Q){if(Q!=null&&typeof Q!=="string"){R(70,{newFilter:Q});return}let z=this.parseFilter(Q);if(this.quickFilter!==z)this.quickFilter=z,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}setParserAndMatcher(){let Q=this.gos.get("quickFilterParser"),z=this.gos.get("quickFilterMatcher"),J=Q!==this.parser||z!==this.matcher;if(this.parser=Q,this.matcher=z,J)this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}onColumnConfigChanged(){if(this.refreshCols(),this.resetCache(),this.isFilterPresent())this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(Q,z){return this.colsToUse.some((J)=>{let Z=this.getTextForColumn(J,Q);return T(Z)&&Z.includes(z)})}doesRowPassCache(Q,z){return this.checkGenerateAggText(Q),Q.quickFilterAggregateText.includes(z)}doesRowPassMatcher(Q,z){let J;if(Q)this.checkGenerateAggText(z),J=z.quickFilterAggregateText;else J=this.getAggText(z);let{quickFilterParts:Z,matcher:$}=this;return $(Z,J)}checkGenerateAggText(Q){if(!Q.quickFilterAggregateText)Q.quickFilterAggregateText=this.getAggText(Q)}getTextForColumn(Q,z){let J=this.beans.filterValueSvc.getValue(Q,z),Z=Q.getColDef();if(Z.getQuickFilterText){let $=y(this.gos,{value:J,node:z,data:z.data,column:Q,colDef:Z});J=Z.getQuickFilterText($)}return T(J)?J.toString().toUpperCase():null}getAggText(Q){let z=[];for(let J of this.colsToUse){let Z=this.getTextForColumn(J,Q);if(T(Z))z.push(Z)}return z.join(` +`)}},BF={moduleName:"ClientSideRowModelFilter",version:p,rowModels:["clientSide"],beans:[kK]},KX={moduleName:"FilterCore",version:p,beans:[ZF],apiFunctions:{isAnyFilterPresent:zF,onFilterChanged:JF},css:[NL],dependsOn:[BF]},LX={moduleName:"FilterValue",version:p,beans:[qF]},FX={moduleName:"ColumnFilter",version:p,beans:[QF,GF],dynamicBeans:{headerFilterCellCtrl:bL},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:gL,getColumnFilterInstance:hL,destroyFilter:uL,setFilterModel:mL,getFilterModel:cL,getColumnFilterModel:pL,setColumnFilterModel:iL,showColumnFilter:nL,hideColumnFilter:dL,getColumnFilterHandler:tL,doFilterAction:rL},dependsOn:[KX,nz,LX,v6]};var EF={moduleName:"QuickFilterCore",version:p,rowModels:["clientSide"],beans:[WF],dependsOn:[KX,LX]},DX={moduleName:"QuickFilter",version:p,apiFunctions:{isQuickFilterPresent:HF,getQuickFilter:_F,resetQuickFilter:UF},dependsOn:[EF]};var KF=class extends j{constructor(){super(...arguments);this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(Q,z){let J=this.wrapSvc?.wrap(Q,z)??z,Z=!lJ.has(Q),$=Z?this.asyncListeners:this.syncListeners;if(!$.has(Q))$.set(Q,new Set);$.get(Q).add(J),this.eventSvc.addListener(Q,J,Z)}removeListener(Q,z){let J=this.wrapSvc?.unwrap(Q,z)??z,$=!!this.asyncListeners.get(Q)?.delete(J);if(!$)this.syncListeners.get(Q)?.delete(J);this.eventSvc.removeListener(Q,J,$)}addGlobalListener(Q){let z=this.wrapSvc?.wrapGlobal(Q)??Q,J=(X,Y)=>{if(lJ.has(X))z(X,Y)},Z=(X,Y)=>{if(!lJ.has(X))z(X,Y)};this.globalListenerPairs.set(Q,{syncListener:J,asyncListener:Z});let $=this.eventSvc;$.addGlobalListener(J,!1),$.addGlobalListener(Z,!0)}removeGlobalListener(Q){let{eventSvc:z,wrapSvc:J,globalListenerPairs:Z}=this,$=J?.unwrapGlobal(Q)??Q;if(Z.has($)){let{syncListener:Y,asyncListener:G}=Z.get($);z.removeGlobalListener(Y,!1),z.removeGlobalListener(G,!0),Z.delete(Q)}else this.syncGlobalListeners.delete($),z.removeGlobalListener($,!1)}destroyEventListeners(Q,z){Q.forEach((J,Z)=>{J.forEach(($)=>this.eventSvc.removeListener(Z,$,z)),J.clear()}),Q.clear()}destroyGlobalListeners(Q,z){for(let J of Q)this.eventSvc.removeGlobalListener(J,z);Q.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);let{globalListenerPairs:Q,eventSvc:z}=this;Q.forEach(({syncListener:J,asyncListener:Z})=>{z.removeGlobalListener(J,!1),z.removeGlobalListener(Z,!0)}),Q.clear()}};function LF(Q,z,J){Q.apiEventSvc?.addListener(z,J)}function FF(Q,z,J){Q.apiEventSvc?.removeListener(z,J)}function DF(Q,z){Q.apiEventSvc?.addGlobalListener(z)}function MF(Q,z){Q.apiEventSvc?.removeGlobalListener(z)}var MX={moduleName:"EventApi",version:p,apiFunctions:{addEventListener:LF,addGlobalListener:DF,removeEventListener:FF,removeGlobalListener:MF},beans:[KF]};function MQ(Q,z){if(typeof Q!=="number")return"";let J=z(),Z=J("thousandSeparator",","),$=J("decimalSeparator",".");return Q.toString().replace(".",$).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${Z}`)}var kF="↑",VF="↓",fF={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},AF=class extends x{constructor(){super(fF);this.eValue=S,this.eDelta=S,this.refreshCount=0}init(Q){this.refresh(Q,!0)}showDelta(Q,z){let J=Math.abs(z),Z=Q.formatValue(J),$=T(Z)?Z:J,X=z>=0,Y=this.eDelta;if(X)Y.textContent=kF+$;else Y.textContent=VF+$;Y.classList.toggle("ag-value-change-delta-up",X),Y.classList.toggle("ag-value-change-delta-down",!X)}setTimerToRemoveDelta(){this.refreshCount++;let Q=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(Q===this.refreshCount)this.hideDeltaValue()},2000)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),z0(this.eDelta)}refresh(Q,z=!1){let{value:J,valueFormatted:Z}=Q,{eValue:$,lastValue:X,beans:Y}=this;if(J===X)return!1;if(T(Z))$.textContent=Z;else if(T(J))$.textContent=J;else z0($);if(Y.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;let G=J&&typeof J==="object"&&"toNumber"in J?J.toNumber():J,q=X&&typeof X==="object"&&"toNumber"in X?X.toNumber():X;if(G===q)return!1;if(typeof G==="number"&&typeof q==="number"){let H=G-q;this.showDelta(Q,H)}if(X)$.classList.add("ag-value-change-value-highlight");if(!z)this.setTimerToRemoveDelta();return this.lastValue=J,!0}},jF=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",RF={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},SF=class extends x{constructor(){super(RF);this.eCurrent=S,this.refreshCount=0,this.registerCSS(jF)}init(Q){this.refresh(Q,!0)}addSlideAnimation(){this.refreshCount++;let Q=this.refreshCount;this.ePrevious?.remove();let{beans:z,eCurrent:J}=this,Z=Z0({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=Z,Z.textContent=J.textContent,this.getGui().insertBefore(Z,J),z.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(Q!==this.refreshCount)return;this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{if(Q!==this.refreshCount)return;this.ePrevious?.remove(),this.ePrevious=null},3000)})}refresh(Q,z=!1){let J=Q.value;if(n(J))J="";if(J===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if(!z)this.addSlideAnimation();this.lastValue=J;let Z=this.eCurrent;if(T(Q.valueFormatted))Z.textContent=Q.valueFormatted;else if(T(Q.value))Z.textContent=J;else z0(Z);return!0}},OF=class extends j{constructor(){super(...arguments);this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(Q,z,J=this.beans.gos.get("cellFlashDuration"),Z=this.beans.gos.get("cellFadeDuration")){let $=this.animations[z];$.delete(Q);let X=Date.now(),Y=X+J,G=X+J+Z,q={phase:"flash",flashEndTime:Y,fadeEndTime:G};$.set(Q,q);let H=`ag-cell-${z}`,_=`${H}-animation`,{comp:U,eGui:{style:W}}=Q;if(U.toggleCss(H,!0),U.toggleCss(_,!1),W.removeProperty("transition"),W.removeProperty("transition-delay"),this.nextAnimationTime&&Y+15{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),J)}),this.nextAnimationTime=Y}advanceAnimations(){let Q=Date.now(),z=null;for(let J of Object.keys(this.animations)){let Z=this.animations[J],$=`ag-cell-${J}`,X=`${$}-animation`;for(let[Y,G]of Z){if(!Y.isAlive()||!Y.comp){Z.delete(Y);continue}let{phase:q,flashEndTime:H,fadeEndTime:_}=G,U=q==="flash"?H:_;if(!(Q+15>=U)){z=Math.min(U,z??1/0);continue}let{comp:B,eGui:{style:E}}=Y;switch(q){case"flash":B.toggleCss($,!1),B.toggleCss(X,!0),E.transition=`background-color ${_-H}ms`,E.transitionDelay=`${H-Q}ms`,z=Math.min(_,z??1/0),G.phase="fade";break;case"fade":B.toggleCss($,!1),B.toggleCss(X,!1),E.removeProperty("transition"),E.removeProperty("transition-delay"),Z.delete(Y);break}}}if(z==null)this.nextAnimationTime=null,this.nextAnimationCycle=null;else if(z)this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),z-Q),this.nextAnimationTime=z}onFlashCells(Q,z){if(!Q.comp)return;let J=bQ(Q.cellPosition);if(z.cells[J])this.animateCell(Q,"highlight")}flashCell(Q,z){this.animateCell(Q,"data-changed",z?.flashDuration,z?.fadeDuration)}destroy(){for(let Q of Object.keys(this.animations))this.animations[Q].clear()}};function PF(Q,z={}){let{cellFlashSvc:J}=Q;if(!J)return;Q.frameworkOverrides.wrapIncoming(()=>{for(let Z of Q.rowRenderer.getCellCtrls(z.rowNodes,z.columns))J.flashCell(Z,z)})}var kX={moduleName:"HighlightChanges",version:p,beans:[OF],userComponents:{agAnimateShowChangeCellRenderer:AF,agAnimateSlideCellRenderer:SF},apiFunctions:{flashCells:PF}};var TF=class extends j{constructor(){super(...arguments);this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",(Q)=>{this.onSelectionOptionsChanged(Q.currentValue,Q.previousValue,Xz(Q.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(Q){let z=this.columns;if(z==null)return;Q.list=z.list.concat(Q.list),Q.tree=z.tree.concat(Q.tree),HJ(Q)}createColumns(Q,z){let J=()=>{ZQ(this.beans,this.columns?.tree),this.columns=null},Z=Q.treeDepth,X=(this.columns?.treeDepth??-1)==Z,Y=this.generateSelectionCols();if(qJ(Y,this.columns?.list??[])&&X)return;J();let{colGroupSvc:q}=this.beans,H=q?.findDepth(Q.tree)??0,_=q?.balanceTreeForAutoCols(Y,H)??[];this.columns={list:Y,tree:_,treeDepth:H,map:{}},z((W)=>{if(!W)return null;let B=W.filter((E)=>!IQ(E));return[...Y,...B]})}updateColumns(Q){let z=Xz(Q.source),{beans:J}=this;for(let Z of this.columns?.list??[]){let $=this.createSelectionColDef(Q.currentValue);Z.setColDef($,null,z),n0(J,{state:[i5($,Z.colId)]},z)}}getColumn(Q){return this.columns?.list.find((z)=>PQ(z,Q))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){let{gos:Q,beans:z}=this,J=Q.get("rowSelection");if(typeof J!=="object"||!hQ(Q))return!1;let Z=(z.autoColSvc?.getColumns()?.length??0)>0;if(J.checkboxLocation==="autoGroupColumn"&&Z)return!1;let $=!!Jz(J),X=dJ(J);return $||X}createSelectionColDef(Q){let{gos:z}=this,J=Q??z.get("selectionColumnDef"),Z=z.get("enableRtl"),{rowSpan:$,spanRows:X,...Y}=J??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:Z?"right":"left",comparator(G,q,H,_){let U=H.isSelected(),W=_.isSelected();return U===W?0:U?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...Y,colId:k9,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];let Q=this.createSelectionColDef(),z=Q.colId;this.gos.validateColDef(Q,z,!0);let J=new GQ(Q,null,z,!1);return this.createBean(J),[J]}onSelectionOptionsChanged(Q,z,J){let Z=z&&typeof z!=="string"?Jz(z):void 0,$=Q&&typeof Q!=="string"?Jz(Q):void 0,X=Z!==$,Y=z&&typeof z!=="string"?dJ(z):void 0,G=Q&&typeof Q!=="string"?dJ(Q):void 0,q=Y!==G,H=E1(Q),_=E1(z);if(X||q||H!==_)this.beans.colModel.refreshAll(J)}destroy(){ZQ(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(Q,z,J){if(!this.columns?.list.length)return;let Z=Q.length+z.length+J.length;if(Z===0)return;let $=this.columns.list[0];if(!$.isVisible())return;let X=()=>{let q;switch($.pinned){case"left":case!0:q=Q;break;case"right":q=J;break;default:q=z}if(q)$0(q,$)};if((this.beans.rowNumbersSvc?.getColumn(V9)?2:1)===Z)X()}},vF=':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}';function IF(Q,z){if(!z.nodes.every((Y)=>{if(Y.rowPinned&&!iZ(Y))return R(59),!1;if(Y.id===void 0)return R(60),!1;return!0}))return;let{nodes:Z,source:$,newValue:X}=z;Q.selectionSvc?.setNodesSelected({nodes:Z,source:$??"api",newValue:X})}function CF(Q,z,J="apiSelectAll"){Q.selectionSvc?.selectAllRowNodes({source:J,selectAll:z})}function bF(Q,z,J="apiSelectAll"){Q.selectionSvc?.deselectAllRowNodes({source:J,selectAll:z})}function yF(Q,z="apiSelectAllFiltered"){Q.selectionSvc?.selectAllRowNodes({source:z,selectAll:"filtered"})}function xF(Q,z="apiSelectAllFiltered"){Q.selectionSvc?.deselectAllRowNodes({source:z,selectAll:"filtered"})}function wF(Q,z="apiSelectAllCurrentPage"){Q.selectionSvc?.selectAllRowNodes({source:z,selectAll:"currentPage"})}function NF(Q,z="apiSelectAllCurrentPage"){Q.selectionSvc?.deselectAllRowNodes({source:z,selectAll:"currentPage"})}function gF(Q){return Q.selectionSvc?.getSelectedNodes()??[]}function hF(Q){return Q.selectionSvc?.getSelectedRows()??[]}var uF={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},mF=class extends x{constructor(){super(uF,[yQ]);this.eCheckbox=S}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){let Q=this.getLocaleTextFunc(),{rowNode:z,eCheckbox:J}=this,Z=z.isSelected(),$=O5(Q,Z),[X,Y]=z.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],G=Q(X,Y);J.setValue(Z,!0),J.setInputAriaLabel(`${G} (${$})`)}init(Q){if(this.rowNode=Q.rowNode,this.column=Q.column,this.overrides=Q.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:i0,click:(Z)=>{if(i0(Z),this.eCheckbox.isDisabled())return;this.beans.selectionSvc?.handleSelectionEvent(Z,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:Z,previousValue:$})=>{let X=typeof Z==="object"?j2(Z):void 0,Y=typeof $==="object"?j2($):void 0;if(X!==Y)this.onSelectableChanged()}),$5(this.gos)||typeof this.getIsVisible()==="function"){let Z=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:Z}),this.addManagedListeners(this.rowNode,{dataChanged:Z,cellChanged:Z}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){let{column:Q,rowNode:z,overrides:J,gos:Z}=this,$=z.selectable,X=this.getIsVisible(),Y=void 0;if(typeof X==="function"){let U=J?.callbackParams;if(!Q)Y=X({...U,node:z,data:z.data});else{let W=Q.createColumnFunctionCallbackParams(z);Y=X({...U,...W})}}else Y=X??!1;let G=$&&!Y||!$&&Y,q=$||Y,H=Z.get("rowSelection"),_=H&&typeof H!=="string"?!j2(H):!!Q?.getColDef().showDisabledCheckboxes;if(this.setVisible(q&&(G?_:!0)),this.setDisplayed(q&&(G?_:!0)),q)this.eCheckbox.setDisabled(G);if(J?.removeHidden)this.setDisplayed(q)}getIsVisible(){let Q=this.overrides;if(Q)return Q.isVisible;let z=this.gos.get("rowSelection");if(z&&typeof z!=="string")return Jz(z);return this.column?.getColDef()?.checkboxSelection}},cF=class{constructor(Q,z){this.rowModel=Q,this.pinnedRowModel=z,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(Q){this.rootId=Q.id,this.endId=null,this.cachedRange.length=0}setEndRange(Q){this.endId=Q.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){let Q=this.getRoot(),z=this.getEnd();if(Q==null||z==null)return this.cachedRange;this.cachedRange=this.getNodesInRange(Q,z)??[]}return this.cachedRange}isInRange(Q){if(this.rootId===null)return!1;return this.getRange().some((z)=>z.id===Q.id)}getRoot(Q){if(this.rootId)return this.getRowNode(this.rootId);if(Q)return this.setRoot(Q),Q}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(Q){let z,{rowModel:J,pinnedRowModel:Z}=this;if(z??(z=J.getRowNode(Q)),Z?.isManual())z??(z=Z.getPinnedRowById(Q,"top")),z??(z=Z.getPinnedRowById(Q,"bottom"));return z}truncate(Q){let z=this.getRange();if(z.length===0)return{keep:[],discard:[]};let J=z[0].id===this.rootId,Z=z.findIndex(($)=>$.id===Q.id);if(Z>-1){let $=z.slice(0,Z),X=z.slice(Z+1);return this.setEndRange(Q),J?{keep:$,discard:X}:{keep:X,discard:$}}else return{keep:z,discard:[]}}extend(Q,z=!1){let J=this.getRoot();if(J==null){let $=this.getRange().slice();if(z)Q.depthFirstSearch((X)=>!X.group&&$.push(X));return $.push(Q),this.setRoot(Q),{keep:$,discard:[]}}let Z=this.getNodesInRange(J,Q);if(!Z)return this.setRoot(Q),{keep:[Q],discard:[]};if(Z.find(($)=>$.id===this.endId))return this.setEndRange(Q),{keep:this.getRange(),discard:[]};else{let $=this.getRange().slice();return this.setEndRange(Q),{keep:this.getRange(),discard:$}}}getNodesInRange(Q,z){let{pinnedRowModel:J,rowModel:Z}=this;if(!J?.isManual())return Z.getNodesInRangeForSelection(Q,z);if(Q.rowPinned==="top"&&!z.rowPinned)return t0(J,"top",Q,void 0).concat(Z.getNodesInRangeForSelection(Z.getRow(0),z)??[]);if(Q.rowPinned==="bottom"&&!z.rowPinned){let $=t0(J,"bottom",void 0,Q),X=Z.getRowCount(),Y=Z.getRow(X-1);return(Z.getNodesInRangeForSelection(z,Y)??[]).concat($)}if(!Q.rowPinned&&!z.rowPinned)return Z.getNodesInRangeForSelection(Q,z);if(Q.rowPinned==="top"&&z.rowPinned==="top")return t0(J,"top",Q,z);if(Q.rowPinned==="bottom"&&z.rowPinned==="top"){let $=t0(J,"top",z,void 0),X=t0(J,"bottom",void 0,Q),Y=Z.getRow(0),G=Z.getRow(Z.getRowCount()-1);return $.concat(Z.getNodesInRangeForSelection(Y,G)??[]).concat(X)}if(!Q.rowPinned&&z.rowPinned==="top")return t0(J,"top",z,void 0).concat(Z.getNodesInRangeForSelection(Z.getRow(0),Q)??[]);if(Q.rowPinned==="top"&&z.rowPinned==="bottom"){let $=t0(J,"top",Q,void 0),X=t0(J,"bottom",void 0,z),Y=Z.getRow(0),G=Z.getRow(Z.getRowCount()-1);return $.concat(Z.getNodesInRangeForSelection(Y,G)??[]).concat(X)}if(Q.rowPinned==="bottom"&&z.rowPinned==="bottom")return t0(J,"bottom",Q,z);if(!Q.rowPinned&&z.rowPinned==="bottom"){let $=t0(J,"bottom",void 0,z),X=Z.getRow(Z.getRowCount());return(Z.getNodesInRangeForSelection(Q,X)??[]).concat($)}return null}},pF=class extends j{constructor(Q){super();this.column=Q,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(Q){let z=this.cbSelectAll;if(z.isDisplayed()&&!z.getGui().contains(d(this.beans)))Q.preventDefault(),z.setValue(!z.getValue())}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(Q){this.headerCellCtrl=Q;let z=this.createManagedBean(new K6);this.cbSelectAll=z,z.addCss("ag-header-select-all"),H0(z.getGui(),"presentation"),this.showOrHideSelectAll();let J=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:J,paginationChanged:J,modelUpdated:J}),this.addManagedPropertyListener("rowSelection",({currentValue:Z,previousValue:$})=>{let X=(Y)=>typeof Y==="string"||!Y||Y.mode==="singleRow"?void 0:Y.selectAll;if(X(Z)!==X($))this.showOrHideSelectAll();this.updateStateOfCheckbox()}),this.addManagedListeners(z,{fieldValueChanged:this.onCbSelectAll.bind(this)}),z.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(Q){if(!this.isAlive())return;this.showOrHideSelectAll(Q.source==="uiColumnMoved")}showOrHideSelectAll(Q=!1){let z=this.isCheckboxSelection();if(this.cbSelectAllVisible=z,this.cbSelectAll.setDisplayed(z),z)this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox();this.refreshSelectAllLabel(Q)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;let Q=this.getSelectAllMode(),z=this.beans.selectionSvc,J=this.cbSelectAll,Z=z.getSelectAllState(Q);J.setValue(Z);let $=z.hasNodesToSelect(Q);J.setDisabled(!$),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(Q=!1){let z=this.getLocaleTextFunc(),{headerCellCtrl:J,cbSelectAll:Z,cbSelectAllVisible:$}=this,X=Z.getValue(),Y=O5(z,X),G=z("ariaRowSelectAll","Press Space to toggle all rows selection");if(J.setAriaDescriptionProperty("selectAll",$?`${G} (${Y})`:null),Z.setInputAriaLabel(z("ariaHeaderSelection","Column with Header Selection")),!Q)J.announceAriaDescription()}checkSelectionType(Q){if(!s1(this.gos))return R(128,{feature:Q}),!1;return!0}checkRightRowModelType(Q){let{gos:z,rowModel:J}=this.beans;if(!(o(z)||Hz(z)))return R(129,{feature:Q,rowModel:J.getType()}),!1;return!0}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;let Q=this.cbSelectAll.getValue(),z=this.getSelectAllMode(),J="uiSelectAll";if(z==="currentPage")J="uiSelectAllCurrentPage";else if(z==="filtered")J="uiSelectAllFiltered";let Z={source:J,selectAll:z},$=this.beans.selectionSvc;if(Q)$.selectAllRowNodes(Z);else $.deselectAllRowNodes(Z)}isCheckboxSelection(){let{column:Q,gos:z,beans:J}=this,X=typeof z.get("rowSelection")==="object"?"headerCheckbox":"headerCheckboxSelection";return VX(J,Q)&&this.checkRightRowModelType(X)&&this.checkSelectionType(X)}getSelectAllMode(){let Q=U9(this.gos,!1);if(Q)return Q;let{headerCheckboxSelectionCurrentPageOnly:z,headerCheckboxSelectionFilteredOnly:J}=this.column.getColDef();if(z)return"currentPage";if(J)return"filtered";return"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function VX({gos:Q,selectionColSvc:z},J){let Z=Q.get("rowSelection"),$=J.getColDef(),{headerCheckboxSelection:X}=$,Y=!1;if(typeof Z==="object"){let q=IQ(J),H=mz(J);if(E1(Z)==="autoGroupColumn"&&H||q&&z?.isSelectionColumnEnabled())Y=dJ(Z)}else if(typeof X==="function")Y=X(y(Q,{column:J,colDef:$}));else Y=!!X;return Y}var iF=class extends j{postConstruct(){let{gos:Q,beans:z}=this;this.selectionCtx=new cF(z.rowModel,z.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{let J=$5(Q);if(J!==this.isRowSelectable)this.isRowSelectable=J,this.updateSelectable()}),this.isRowSelectable=$5(Q),this.addManagedEventListeners({cellValueChanged:(J)=>this.updateRowSelectable(J.node),rowNodeDataChanged:(J)=>this.updateRowSelectable(J.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new mF}createSelectAllFeature(Q){if(VX(this.beans,Q))return new pF(Q)}isMultiSelect(){return s1(this.gos)}onRowCtrlSelected(Q,z,J){let Z=!!Q.rowNode.isSelected();Q.forEachGui(J,($)=>{$.rowComp.toggleCss("ag-row-selected",Z);let X=$.element;if(S5(X,Z),X.contains(d(this.beans)))z($)})}announceAriaRowSelection(Q){if(this.isRowSelectionBlocked(Q))return;let z=Q.isSelected(),J=this.beans.editSvc?.isEditing({rowNode:Q});if(!Q.selectable||J)return;let $=this.getLocaleTextFunc()(z?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${z?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue($,"rowSelection")}isRowSelectionBlocked(Q){return!Q.selectable||Q.rowPinned&&!iZ(Q)||!hQ(this.gos)}updateRowSelectable(Q,z){let J=Q.rowPinned&&Q.pinnedSibling?Q.pinnedSibling.selectable:this.isRowSelectable?.(Q)??!0;return this.setRowSelectable(Q,J,z),J}setRowSelectable(Q,z,J){if(Q.selectable!==z){if(Q.selectable=z,Q.dispatchRowEvent("selectableChanged"),J)return;if(l1(this.gos)){let $=this.calculateSelectedFromChildren(Q);this.setNodesSelected({nodes:[Q],newValue:$??!1,source:"selectableChanged"});return}if(Q.isSelected()&&!Q.selectable)this.setNodesSelected({nodes:[Q],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(Q){let z=!1,J=!1;if(!Q.childrenAfterGroup?.length)return Q.selectable?Q.__selected:null;for(let Z=0;Z{let z=l1(Q),J=ZZ(Q),Z=$Z(Q)==="filteredDescendants";if(this.masterSelectsDetail=D7(Q)==="detail",z!==this.groupSelectsDescendants||Z!==this.groupSelectsFiltered||J!==this.mode)this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=z,this.groupSelectsFiltered=Z,this.mode=J}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(Q,z,J){if(this.isRowSelectionBlocked(z))return 0;let Z=this.inferNodeSelections(z,Q.shiftKey,Q.metaKey||Q.ctrlKey,J);if(Z==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in Z){if(Z.reset)this.resetNodes();else this.selectRange(Z.deselect,!1,J);return this.selectRange(Z.select,!0,J)}else{let $=Z.checkFilteredNodes?AX(Z.node):Z.newValue;return this.setNodesSelected({nodes:[Z.node],newValue:$,clearSelection:Z.clearSelection,keepDescendants:Z.keepDescendants,event:Q,source:J})}}setNodesSelected({newValue:Q,clearSelection:z,suppressFinishActions:J,nodes:Z,event:$,source:X,keepDescendants:Y=!1}){if(Z.length===0)return 0;let{gos:G}=this;if(!hQ(G)&&Q)return R(132),0;if(Z.length>1&&!this.isMultiSelect())return R(130),0;let q=0;for(let H=0;H0)this.updateGroupsFromChildrenSelections(X),this.dispatchSelectionChanged(X)}return q}selectRange(Q,z,J){let Z=0;if(Q.forEach(($)=>{let X=$.primaryRow;if(X.group&&this.groupSelectsDescendants)return;if(this.selectRowNode(X,z,void 0,J))Z++}),Z>0)this.updateGroupsFromChildrenSelections(J),this.dispatchSelectionChanged(J);return Z}selectChildren(Q,z,J){let Z=this.groupSelectsFiltered?Q.childrenAfterAggFilter:Q.childrenAfterGroup;if(!Z)return 0;return this.setNodesSelected({newValue:z,clearSelection:!1,suppressFinishActions:!0,source:J,nodes:Z})}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){let Q=[];return this.selectedNodes.forEach((z)=>z.data&&Q.push(z.data)),Q}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(Q){let z=new Map;this.selectedNodes.forEach((J,Z)=>{if(Q(J))z.set(Z,J)}),this.selectedNodes=z}updateGroupsFromChildrenSelections(Q,z){if(!this.groupSelectsDescendants)return!1;let{gos:J,rowModel:Z}=this.beans;if(!o(J,Z))return!1;let $=Z.rootNode;if(!$)return!1;let X=!1,Y=(G)=>{if(G!==$){let q=this.calculateSelectedFromChildren(G);X=this.selectRowNode(G,q===null?!1:q,void 0,Q)||X}};return A0($,this.beans.rowModel.hierarchical,z,Y),X}clearOtherNodes(Q,z,J){let Z=new Map,$=0;return this.selectedNodes.forEach((X)=>{let Y=X.id==Q.id;if((z?!tF(Q,X):!0)&&!Y){let q=this.selectedNodes.get(X.id);if($+=this.setNodesSelected({nodes:[q],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:J}),this.groupSelectsDescendants&&X.parent)Z.set(X.parent.id,X.parent)}}),Z.forEach((X)=>{let Y=this.calculateSelectedFromChildren(X);this.selectRowNode(X,Y===null?!1:Y,void 0,J)}),$}onRowSelected(Q){let z=Q.node;if(this.groupSelectsDescendants&&z.group)return;if(z.isSelected())this.selectedNodes.set(z.id,z);else this.selectedNodes.delete(z.id)}syncInRowNode(Q,z){this.syncInOldRowNode(Q,z),this.syncInNewRowNode(Q)}createDaemonNode(Q){if(!Q.id)return;let z=new Wz(this.beans);return z.id=Q.id,z.data=Q.data,z.__selected=Q.__selected,z.level=Q.level,z}syncInOldRowNode(Q,z){if(z&&Q.id!==z.id){if(this.selectedNodes.get(z.id)==Q)this.selectedNodes.set(z.id,z)}}syncInNewRowNode(Q){if(this.selectedNodes.has(Q.id))Q.__selected=!0,this.selectedNodes.set(Q.id,Q);else Q.__selected=!1}reset(Q){let z=this.getSelectionCount();if(this.resetNodes(),z)this.dispatchSelectionChanged(Q)}resetNodes(){this.selectedNodes.forEach((Q)=>{this.selectRowNode(Q,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){let{gos:Q,rowModel:z}=this.beans;if(!o(Q,z))return;let J=z.getTopLevelNodes();if(J===null)return;let Z=[];function $(X){for(let Y=0,G=X.length;Y{let Y=this.selectRowNode(X.primaryRow,!1,void 0,Q);Z||(Z=Y)};if(z==="currentPage"||z==="filtered"){if(!J){e(102);return}this.getNodesToSelect(z).forEach($)}else this.selectedNodes.forEach($),this.reset(Q);if(this.selectionCtx.selectAll=!1,J&&this.groupSelectsDescendants){let X=this.updateGroupsFromChildrenSelections(Q);Z||(Z=X)}if(Z)this.dispatchSelectionChanged(Q)}getSelectedCounts(Q){let z=0,J=0;return this.getNodesToSelect(Q).forEach((Z)=>{if(this.groupSelectsDescendants&&Z.group)return;if(Z.isSelected())z++;else if(Z.selectable)J++}),{selectedCount:z,notSelectedCount:J}}getSelectAllState(Q){let{selectedCount:z,notSelectedCount:J}=this.getSelectedCounts(Q);return fX(z,J)??null}hasNodesToSelect(Q){return this.getNodesToSelect(Q).filter((z)=>z.selectable).length>0}getNodesToSelect(Q){if(!this.canSelectAll())return[];let z=[],J=($)=>z.push($);if(Q==="currentPage")return this.forEachNodeOnPage(($)=>{if(!$.group){J($);return}if(!$.footer&&!$.expanded){let X=(Y)=>{J(Y);let G=Y.childrenAfterFilter;if(G)for(let q=0,H=G.length;q{let G=this.selectRowNode(Y.primaryRow,!0,void 0,Z);X||(X=G)}),J.selectAll=!0,o(z)&&this.groupSelectsDescendants){let Y=this.updateGroupsFromChildrenSelections(Z);X||(X=Y)}if(X)this.dispatchSelectionChanged(Z)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(Q,z,J){if(!Q)Q=[];if(!Array.isArray(Q)){e(103);return}let Z=new Set(Q),$=[];if(this.beans.rowModel.forEachNode((X)=>{if(Z.has(X.id))$.push(X)}),J)this.resetNodes();this.setNodesSelected({newValue:!0,nodes:$,source:z})}canSelectAll(){return o(this.beans.gos)}updateSelectable(Q){let{gos:z,rowModel:J}=this.beans;if(!hQ(z))return;let Z="selectableChanged",$=o(z)&&this.groupSelectsDescendants,X=[];if($){let Y=J.rootNode;if(Y)A0(Y,J.hierarchical,Q,(G)=>{let q=!1;for(let H of G.childrenAfterGroup)if(q||(q=H.selectable),!H.group&&!this.updateRowSelectable(H,!0)&&H.isSelected())X.push(H);this.setRowSelectable(G,q,!0)})}else J.forEachNode((Y)=>{if(!this.updateRowSelectable(Y,!0)&&Y.isSelected())X.push(Y)});if(X.length)this.setNodesSelected({nodes:X,newValue:!1,source:Z});if(!Q&&$)this.updateGroupsFromChildrenSelections?.(Z)}updateSelectableAfterGrouping(Q){if(this.updateSelectable(Q),this.groupSelectsDescendants){if(this.updateGroupsFromChildrenSelections?.("rowGroupChanged",Q))this.dispatchSelectionChanged("rowGroupChanged")}}refreshMasterNodeState(Q,z){if(!this.masterSelectsDetail)return;let J=Q.detailNode?.detailGridInfo?.api;if(!J)return;let Z=dF(J);if(Q.isSelected()!==Z){if(this.selectRowNode(Q,Z,z,"masterDetail"))this.dispatchSelectionChanged("masterDetail")}if(!Z)this.detailSelection.set(Q.id,new Set(J.getSelectedNodes().map((X)=>X.id)))}setDetailSelectionState(Q,z,J){if(!this.masterSelectsDetail)return;if(!s1(z)){R(269);return}switch(Q.isSelected()){case!0:{J.selectAll();break}case!1:{J.deselectAll();break}case void 0:{let Z=this.detailSelection.get(Q.id);if(Z){let $=[];for(let X of Z){let Y=J.getRowNode(X);if(Y)$.push(Y)}J.setNodesSelected({nodes:$,newValue:!0,source:"masterDetail"})}break}default:break}}dispatchSelectionChanged(Q){this.eventSvc.dispatchEvent({type:"selectionChanged",source:Q,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function dF(Q){let z=0,J=0;return Q.forEachNode((Z)=>{if(Z.isSelected())z++;else if(Z.selectable)J++}),fX(z,J)}function fX(Q,z){if(Q===0&&z===0)return!1;if(Q>0&&z>0)return;return Q>0}function tF(Q,z){let J=z.parent;while(J){if(J===Q)return!0;J=J.parent}return!1}function AX(Q){let z=Q.isSelected()===!1,J=Q.childrenAfterFilter?.some(AX)??!1;return z||J}var rF={moduleName:"SharedRowSelection",version:p,beans:[TF],css:[vF],apiFunctions:{setNodesSelected:IF,selectAll:CF,deselectAll:bF,selectAllFiltered:yF,deselectAllFiltered:xF,selectAllOnCurrentPage:wF,deselectAllOnCurrentPage:NF,getSelectedNodes:gF,getSelectedRows:hF}},jX={moduleName:"RowSelection",version:p,rowModels:["clientSide","infinite","viewport"],beans:[nF],dependsOn:[rF]},sF=class extends j{constructor(Q,z){super();this.cellCtrl=Q,this.staticClasses=[],this.beans=z,this.column=Q.column}setComp(Q){this.cellComp=Q,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){let{column:Q,cellComp:z}=this,J=Q.colDef,Z=J.cellClassRules,$=this.getCellClassParams(Q,J);d$(this.beans.expressionSvc,Z===this.cellClassRules?void 0:this.cellClassRules,Z,$,(X)=>z.toggleCss(X,!0),(X)=>z.toggleCss(X,!1)),this.cellClassRules=Z}applyUserStyles(){let Q=this.column,z=Q.colDef,J=z.cellStyle;if(!J)return;let Z;if(typeof J==="function"){let $=this.getCellClassParams(Q,z);Z=J($)}else Z=J;if(Z)this.cellComp.setUserStyles(Z)}applyClassesFromColDef(){let{column:Q,cellComp:z}=this,J=Q.colDef,Z=this.getCellClassParams(Q,J);for(let X of this.staticClasses)z.toggleCss(X,!1);let $=this.beans.cellStyles.getStaticCellClasses(J,Z);this.staticClasses=$;for(let X of $)z.toggleCss(X,!0)}getCellClassParams(Q,z){let{value:J,rowNode:Z}=this.cellCtrl;return y(this.beans.gos,{value:J,data:Z.data,node:Z,colDef:z,column:Q,rowIndex:Z.rowIndex})}},lF=class extends j{constructor(){super(...arguments);this.beanName="cellStyles"}processAllCellClasses(Q,z,J,Z){d$(this.beans.expressionSvc,void 0,Q.cellClassRules,z,J,Z),this.processStaticCellClasses(Q,z,J)}getStaticCellClasses(Q,z){let{cellClass:J}=Q;if(!J)return[];let Z;if(typeof J==="function")Z=J(z);else Z=J;if(typeof Z==="string")Z=[Z];return Z||[]}createCellCustomStyleFeature(Q){return new sF(Q,this.beans)}processStaticCellClasses(Q,z,J){this.getStaticCellClasses(Q,z).forEach(($)=>{J($)})}},RX={moduleName:"CellStyle",version:p,beans:[lF]};var aF={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,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,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,overlayComponent:!0,suppressOverlays:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,groupLockGroupColumns:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!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,renderingMode:!0,columnMenu:!0,suppressSetFilterByDefault:!0,getDataPath:!0,enableCellSpan:!0,enableFilterHandlers:!0,filterHandlers:!0},g0="clientSide",C0="serverSide",Q1="infinite",oF={onGroupExpandedOrCollapsed:[g0],refreshClientSideRowModel:[g0],isRowDataEmpty:[g0],forEachLeafNode:[g0],forEachNodeAfterFilter:[g0],forEachNodeAfterFilterAndSort:[g0],resetRowHeights:[g0,C0],applyTransaction:[g0],applyTransactionAsync:[g0],flushAsyncTransactions:[g0],getBestCostNodeSelection:[g0],getServerSideSelectionState:[C0],setServerSideSelectionState:[C0],applyServerSideTransaction:[C0],applyServerSideTransactionAsync:[C0],applyServerSideRowData:[C0],retryServerSideLoads:[C0],flushServerSideAsyncTransactions:[C0],refreshServerSide:[C0],getServerSideGroupLevelState:[C0],refreshInfiniteCache:[Q1],purgeInfiniteCache:[Q1],getInfiniteRowCount:[Q1],isLastRowIndexKnown:[Q1,C0],expandAll:[g0,C0],collapseAll:[g0,C0],onRowHeightChanged:[g0,C0],setRowCount:[Q1,C0],getCacheBlockState:[Q1,C0]},eF={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};function QD(Q,z,J){let Z=eF[Q];if(Z){let{version:X,new:Y,old:G,message:q}=Z,H=G??Q;return(..._)=>{let U=Y?`Please use ${Y} instead. `:"";return zz(`Since ${X} api.${H} is deprecated. ${U}${q??""}`),z.apply(z,_)}}let $=oF[Q];if($)return(...X)=>{let Y=J.rowModel.getType();if(!$.includes(Y)){q1(`api.${Q} can only be called when gridOptions.rowModelType is ${$.join(" or ")}`);return}return z.apply(z,X)};return z}var zD={detailCellRendererCtrl:"SharedMasterDetail",dndSourceComp:"DragAndDrop",fillHandle:"CellSelection",groupCellRendererCtrl:"GroupCellRenderer",headerFilterCellCtrl:"ColumnFilter",headerGroupCellCtrl:"ColumnGroup",rangeHandle:"CellSelection",tooltipFeature:"Tooltip",highlightTooltipFeature:"Tooltip",tooltipStateManager:"Tooltip",groupStrategy:"RowGrouping",treeGroupStrategy:"TreeData",rowNumberRowResizer:"RowNumbers",singleCell:"EditCore",fullRow:"EditCore",agSetColumnFilterHandler:"SetFilter",agMultiColumnFilterHandler:"MultiFilter",agGroupColumnFilterHandler:"GroupFilter",agNumberColumnFilterHandler:"NumberFilter",agBigIntColumnFilterHandler:"BigIntFilter",agDateColumnFilterHandler:"DateFilter",agTextColumnFilterHandler:"TextFilter"},JD={expanded:1,contracted:1,"tree-closed":1,"tree-open":1,"tree-indeterminate":1,pin:1,"eye-slash":1,arrows:1,left:1,right:1,group:1,aggregation:1,pivot:1,"not-allowed":1,chart:1,cross:1,cancel:1,tick:1,first:1,previous:1,next:1,last:1,linked:1,unlinked:1,"color-picker":1,loading:1,menu:1,"menu-alt":1,filter:1,"filter-add":1,columns:1,maximize:1,minimize:1,copy:1,cut:1,paste:1,grip:1,save:1,csv:1,excel:1,"small-down":1,"small-left":1,"small-right":1,"small-up":1,asc:1,desc:1,aasc:1,adesc:1,none:1,up:1,down:1,plus:1,minus:1,settings:1,"checkbox-checked":1,"checkbox-indeterminate":1,"checkbox-unchecked":1,"radio-button-on":1,"radio-button-off":1,eye:1,"column-arrow":1,"un-pin":1,"pinned-top":1,"pinned-bottom":1,"chevron-up":1,"chevron-down":1,"chevron-left":1,"chevron-right":1,edit:1},ZD={chart:"MenuCore",cancel:"EnterpriseCore",first:"Pagination",previous:"Pagination",next:"Pagination",last:"Pagination",linked:"IntegratedCharts",loadingMenuItems:"MenuCore",unlinked:"IntegratedCharts",menu:"ColumnHeaderComp",legacyMenu:"ColumnMenu",filter:"ColumnFilter",filterActive:"ColumnFilter",filterAdd:"NewFiltersToolPanel",filterCardCollapse:"NewFiltersToolPanel",filterCardExpand:"NewFiltersToolPanel",filterCardEditing:"NewFiltersToolPanel",filterTab:"ColumnMenu",filtersToolPanel:"FiltersToolPanel",columns:["MenuCore"],columnsToolPanel:["ColumnsToolPanel"],maximize:"EnterpriseCore",minimize:"EnterpriseCore",save:"MenuCore",columnGroupOpened:"ColumnGroupHeaderComp",columnGroupClosed:"ColumnGroupHeaderComp",accordionOpen:"EnterpriseCore",accordionClosed:"EnterpriseCore",accordionIndeterminate:"EnterpriseCore",columnSelectClosed:["ColumnsToolPanel","ColumnMenu"],columnSelectOpen:["ColumnsToolPanel","ColumnMenu"],columnSelectIndeterminate:["ColumnsToolPanel","ColumnMenu"],columnMovePin:"SharedDragAndDrop",columnMoveHide:"SharedDragAndDrop",columnMoveMove:"SharedDragAndDrop",columnMoveLeft:"SharedDragAndDrop",columnMoveRight:"SharedDragAndDrop",columnMoveGroup:"SharedDragAndDrop",columnMoveValue:"SharedDragAndDrop",columnMovePivot:"SharedDragAndDrop",dropNotAllowed:"SharedDragAndDrop",ensureColumnVisible:["ColumnsToolPanel","ColumnMenu"],groupContracted:"GroupCellRenderer",groupExpanded:"GroupCellRenderer",setFilterGroupClosed:"SetFilter",setFilterGroupOpen:"SetFilter",setFilterGroupIndeterminate:"SetFilter",setFilterLoading:"SetFilter",close:"EnterpriseCore",check:"MenuItem",colorPicker:"CommunityCore",groupLoading:"LoadingCellRenderer",overlayLoading:"Overlay",overlayExporting:"Overlay",menuAlt:"ColumnHeaderComp",menuPin:"MenuCore",menuValue:"MenuCore",menuAddRowGroup:["MenuCore","ColumnsToolPanel"],menuRemoveRowGroup:["MenuCore","ColumnsToolPanel"],clipboardCopy:"MenuCore",clipboardCut:"MenuCore",clipboardPaste:"MenuCore",pivotPanel:["ColumnsToolPanel","RowGroupingPanel"],rowGroupPanel:["ColumnsToolPanel","RowGroupingPanel"],valuePanel:"ColumnsToolPanel",columnDrag:"EnterpriseCore",rowDrag:["RowDrag","DragAndDrop"],csvExport:"MenuCore",excelExport:"MenuCore",smallDown:"CommunityCore",selectOpen:"CommunityCore",richSelectOpen:"RichSelect",richSelectRemove:"RichSelect",richSelectLoading:"RichSelect",smallLeft:"CommunityCore",smallRight:"CommunityCore",subMenuOpen:"MenuItem",subMenuOpenRtl:"MenuItem",panelDelimiter:"RowGroupingPanel",panelDelimiterRtl:"RowGroupingPanel",smallUp:"CommunityCore",sortAscending:["MenuCore","Sort"],sortDescending:["MenuCore","Sort"],sortAbsoluteAscending:["MenuCore","Sort"],sortAbsoluteDescending:["MenuCore","Sort"],sortUnSort:["MenuCore","Sort"],advancedFilterBuilder:"AdvancedFilter",advancedFilterBuilderDrag:"AdvancedFilter",advancedFilterBuilderInvalid:"AdvancedFilter",advancedFilterBuilderMoveUp:"AdvancedFilter",advancedFilterBuilderMoveDown:"AdvancedFilter",advancedFilterBuilderAdd:"AdvancedFilter",advancedFilterBuilderRemove:"AdvancedFilter",advancedFilterBuilderSelectOpen:"AdvancedFilter",chartsMenu:"IntegratedCharts",chartsMenuEdit:"IntegratedCharts",chartsMenuAdvancedSettings:"IntegratedCharts",chartsMenuAdd:"IntegratedCharts",chartsColorPicker:"IntegratedCharts",chartsThemePrevious:"IntegratedCharts",chartsThemeNext:"IntegratedCharts",chartsDownload:"IntegratedCharts",checkboxChecked:"CommunityCore",checkboxIndeterminate:"CommunityCore",checkboxUnchecked:"CommunityCore",radioButtonOn:"CommunityCore",radioButtonOff:"CommunityCore",rowPin:"PinnedRow",rowUnpin:"PinnedRow",rowPinBottom:"PinnedRow",rowPinTop:"PinnedRow"},$D=new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),XD=class extends j{constructor(){super(...arguments);this.beanName="validation"}wireBeans(Q){this.gridOptions=Q.gridOptions,PG(GK)}warnOnInitialPropertyUpdate(Q,z){if(Q==="api"&&aF[z])R(22,{key:z})}processGridOptions(Q){this.processOptions(Q,Z3())}validateApiFunction(Q,z){return QD(Q,z,this.beans)}missingUserComponent(Q,z,J,Z){let $=B1[z];if($)this.gos.assertModuleRegistered($,`AG Grid '${Q}' component: ${z}`);else R(101,{propertyName:Q,componentName:z,agGridDefaults:J,jsComps:Z})}missingDynamicBean(Q){let z=zD[Q];return z?QQ(200,{...this.gos.getModuleErrorParams(),moduleName:z,reasonOrId:Q}):void 0}checkRowEvents(Q){if(GD.has(Q))R(10,{eventType:Q})}validateIcon(Q){if($D.has(Q))R(43,{iconName:Q});if(JD[Q])return;let z=ZD[Q];if(z){e(200,{reasonOrId:`icon '${Q}'`,moduleName:z,gridScoped:x5(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."});return}R(134,{iconName:Q})}isProvidedUserComp(Q){return!!B1[Q]}validateColDef(Q){this.processOptions(Q,dB())}processOptions(Q,z){let{validations:J,deprecations:Z,allProperties:$,propertyExceptions:X,objectName:Y,docsUrl:G}=z;if($&&this.gridOptions.suppressPropertyNamesCheck!==!0)this.checkProperties(Q,[...X??[],...Object.keys(Z)],$,Y,G);let q=new Set;if(Object.keys(Q).forEach((_)=>{let U=Z[_];if(U){let{message:D,version:M}=U;q.add(`As of v${M}, ${String(_)} is deprecated. ${D??""}`)}let W=Q[_];if(W==null||W===!1)return;let B=J[_];if(!B)return;let{dependencies:E,validate:K,supportedRowModels:L,expectedType:F}=B;if(F){let D=typeof W;if(D!==F){q.add(`${String(_)} should be of type '${F}' but received '${D}' (${W}).`);return}}if(L){let D=this.gridOptions.rowModelType??"clientSide";if(!L.includes(D)){q.add(`${String(_)} is not supported with the '${D}' row model. It is only valid with: ${L.join(", ")}.`);return}}if(E){let D=this.checkForRequiredDependencies(_,E,Q);if(D){q.add(D);return}}if(K){let D=K(Q,this.gridOptions,this.beans);if(D){q.add(D);return}}}),q.size>0)for(let _ of q)zz(_)}checkForRequiredDependencies(Q,z,J){let $=Object.entries(z).filter(([X,Y])=>{let G=J[X];return!Y.required.includes(G)});if($.length===0)return null;return $.map(([X,Y])=>`'${String(Q)}' requires '${X}' to be one of [${Y.required.map((G)=>{if(G===null)return"null";else if(G===void 0)return"undefined";return G}).join(", ")}]. ${Y.reason??""}`).join(` + `)}checkProperties(Q,z,J,Z,$){let X=["__ob__","__v_skip","__metadata__"],Y=YD(Object.getOwnPropertyNames(Q),[...X,...z,...J],J),G=Object.keys(Y);for(let q of G){let H=Y[q],_=`invalid ${Z} property '${q}' did you mean any of these: ${H.slice(0,8).join(", ")}.`;if(J.includes("context"))_+=` +If you are trying to annotate ${Z} with application data, use the '${Z}.context' property instead.`;zz(_)}if(G.length>0&&$){let q=this.beans.frameworkOverrides.getDocLink($);zz(`to see all the valid ${Z} properties please check: ${q}`)}}};function YD(Q,z,J){let Z={},$=Q.filter((X)=>!z.some((Y)=>Y===X));if($.length>0)for(let X of $)Z[X]=D5({inputValue:X,allSuggestions:J}).values;return Z}var GD=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),SX={moduleName:"Validation",version:p,beans:[XD]};var j1=class extends j{constructor(){super(...arguments);this.dispatchColumnChangedEvent=M$,this.columns=[],this.columnIndexMap={},this.updateIndexMap=()=>{this.columnIndexMap={},this.columns.forEach((Q,z)=>this.columnIndexMap[Q.getId()]=z)}}wireBeans(Q){this.colModel=Q.colModel,this.aggFuncSvc=Q.aggFuncSvc,this.visibleCols=Q.visibleCols,this.groupHierarchCols=Q.groupHierarchyColSvc}sortColumns(Q){let{groupHierarchCols:z}=this;this.columns.sort((J,Z)=>z?.compareVirtualColumns(J,Z)??Q(J,Z)),this.updateIndexMap()}setColumns(Q,z){this.setColList(Q,this.columns,this.eventName,!0,!0,this.columnProcessors.set,z)}addColumns(Q,z){this.updateColList(Q,this.columns,!0,!0,this.columnProcessors.add,this.eventName,z)}removeColumns(Q,z){this.updateColList(Q,this.columns,!1,!0,this.columnProcessors.remove,this.eventName,z)}getColumnIndex(Q){return this.columnIndexMap[Q]}setColList(Q=[],z,J,Z,$,X,Y){let G=this.colModel.getCols();if(!G||G.length===0)return;let q=new Map;z.forEach((_,U)=>q.set(_,U)),z.length=0;for(let _ of Q){let U=this.colModel.getColDefCol(_);if(U)z.push(U)}z.forEach((_,U)=>{let W=q.get(_);if(W===void 0){q.set(_,0);return}if(Z&&W!==U)return;q.delete(_)}),this.updateIndexMap();let H=this.colModel.getColDefCols();for(let _ of H??[]){let U=z.indexOf(_)>=0;X(_,U,Y)}if($)this.colModel.refreshCols(!1,Y);this.visibleCols.refresh(Y),this.dispatchColumnChangedEvent(this.eventSvc,J,[...q.keys()],Y)}updateColList(Q=[],z,J,Z,$,X,Y){if(!Q||Q.length===0)return;let G=!1,q=new Set;for(let _ of Q){if(!_)continue;let U=this.colModel.getColDefCol(_);if(!U)continue;if(q.add(U),J){if(z.indexOf(U)>=0)continue;z.push(U)}else{let W=z.indexOf(U);if(W<0)continue;for(let B=W+1;B=0;else if(L)if(I)A=M;else if(C)A=f!=null&&f>=0;else A=!1;else A=J.indexOf(K)>=0;if(A)if(L?k!=null||f!=null:k!=null)Z.push(K);else $.push(K)}let U=(K)=>{let L=K.getColDef();return Y(L)??G(L)};Z.sort((K,L)=>U(K)-U(L));let W=[],B=this.groupHierarchCols,E=(K)=>{if(B)B.expandColumnInto(W,K);else W.push(K)};Z.forEach(E);for(let K of J)if($.indexOf(K)>=0)E(K);for(let K of $)if(W.indexOf(K)<0)E(K);for(let K of J)if(W.indexOf(K)<0)X(K,!1,Q);for(let K of W)if(J.indexOf(K)<0)X(K,!0,Q);return this.columns=W,this.updateIndexMap(),this.columns}restoreColumnOrder(Q,z){let J=this.columns,Z=this.colModel.getColDefCols();if(!J.length||!Z)return Q;let $=Object.keys(z),X=new Set($),Y=new Set($),G=new Set(J.map((M)=>{let k=M.getColId();return Y.delete(k),k}).concat($)),q=[],H={},_=0;for(let M=0;M{let k=H[M];for(let f=B;f>>32-$,J)}ff(Q,z,J,Z,$,X,Y){return this.cmn(z&J|~z&Z,Q,z,$,X,Y)}gg(Q,z,J,Z,$,X,Y){return this.cmn(z&Z|J&~Z,Q,z,$,X,Y)}hh(Q,z,J,Z,$,X,Y){return this.cmn(z^J^Z,Q,z,$,X,Y)}ii(Q,z,J,Z,$,X,Y){return this.cmn(J^(z|~Z),Q,z,$,X,Y)}md51(Q){let z=Q.length,J=[1732584193,-271733879,-1732584194,271733878],Z;for(Z=64;Z<=Q.length;Z+=64)this.md5cycle(J,this.md5blk(Q.substring(Z-64,Z)));Q=Q.substring(Z-64);let $=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(Z=0;Z>2]|=Q.charCodeAt(Z)<<(Z%4<<3);if($[Z>>2]|=128<<(Z%4<<3),Z>55){this.md5cycle(J,$);for(Z=0;Z<16;Z++)$[Z]=0}return $[14]=z*8,this.md5cycle(J,$),J}md5blk(Q){let z=[];for(let J=0;J<64;J+=4)z[J>>2]=Q.charCodeAt(J)+(Q.charCodeAt(J+1)<<8)+(Q.charCodeAt(J+2)<<16)+(Q.charCodeAt(J+3)<<24);return z}rhex(Q){let z="0123456789abcdef".split(""),J="",Z=0;for(;Z<4;Z++)J+=z[Q>>Z*8+4&15]+z[Q>>Z*8&15];return J}hex(Q){for(let z=0;z>16)+(z>>16)+(J>>16)<<16|J&65535}},sZ={"01":"GRID","02":"CHARTS","0102":"BOTH"};var UY=class Q{constructor(z){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=z,this.md5=new HD,this.md5.init()}validateLicense(){let z=this.getLicenseDetails(Q.licenseKey),J=`AG Grid ${z.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,Z=z.suppliedLicenseType===void 0?"":`AG ${z.suppliedLicenseType==="BOTH"?"Grid and AG Charts":z.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(z.missing){if(!this.isWebsiteUrl()||this.isForceWatermark())this.outputMissingLicenseKey(J)}else if(z.expired){let $=Q.getGridReleaseDate(),X=Q.formatDate($);this.outputExpiredKey(z.expiry,X,J,Z)}else if(!z.valid)this.outputInvalidLicenseKey(!!z.incorrectLicenseType,J,Z);else if(z.isTrial&&z.trialExpired)this.outputExpiredTrialKey(z.expiry,J,Z)}static extractExpiry(z){let J=z.substring(z.lastIndexOf("_")+1,z.length);return new Date(parseInt(Q.decode(J),10))}static extractLicenseComponents(z){let J=z.replace(/[\u200B-\u200D\uFEFF]/g,"");if(J=J.replace(/\r?\n|\r/g,""),z.length<=32)return{md5:null,license:z,version:null,isTrial:null};let Z=J.length-32,$=J.substring(Z),X=J.substring(0,Z),[Y,G,q]=Q.extractBracketedInformation(J);return{md5:$,license:X,version:Y,isTrial:G,type:q}}getLicenseDetails(z){let J=Q.chartsLicenseManager?"BOTH":"GRID";if(!z?.length)return{licenseKey:z,valid:!1,missing:!0,currentLicenseType:J};let Z=Q.getGridReleaseDate(),{md5:$,license:X,version:Y,isTrial:G,type:q}=Q.extractLicenseComponents(z),H=$===this.md5.md5(X)&&!z.includes("For_Trialing_ag-Grid_Only"),_=void 0,U=void 0,W=null,B=!1,E=void 0;function K(){_=WW,Y){case"legacy":case"2":{if(G)K();break}case"3":if(!q?.length)H=!1;else if(E=q,q!==sZ["01"]&&q!==sZ["0102"]||J==="BOTH"&&E!=="BOTH")H=!1,B=!0;else if(G)K()}}if(!H)return{licenseKey:z,valid:H,incorrectLicenseType:B,currentLicenseType:J,suppliedLicenseType:E};return{licenseKey:z,valid:H,expiry:Q.formatDate(W),expired:U,version:Y,isTrial:G,trialExpired:_,incorrectLicenseType:B,currentLicenseType:J,suppliedLicenseType:E}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){let J=(this.document.defaultView||window).location,{hostname:Z=""}=J;return Z}isForceWatermark(){let J=(this.document.defaultView||window).location,{pathname:Z}=J;return Z?Z.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(z){let J=["January","February","March","April","May","June","July","August","September","October","November","December"],Z=z.getDate(),$=z.getMonth(),X=z.getFullYear();return Z+" "+J[$]+" "+X}static getGridReleaseDate(){return new Date(parseInt(Q.decode(Q.RELEASE_INFORMATION),10))}static decode(z){let Z="",$,X,Y,G,q,H,_,U=0,W=z.replace(/[^A-Za-z0-9+/=]/g,"");while(U>4,X=(q&15)<<4|H>>2,Y=(H&3)<<6|_,Z=Z+String.fromCharCode($),H!=64)Z=Z+String.fromCharCode(X);if(_!=64)Z=Z+String.fromCharCode(Y)}return Z=Q.utf8_decode(Z),Z}static utf8_decode(z){z=z.replace(/rn/g,"n");let J="";for(let Z=0;Z127&&$<2048)J+=String.fromCharCode($>>6|192),J+=String.fromCharCode($&63|128);else J+=String.fromCharCode($>>12|224),J+=String.fromCharCode($>>6&63|128),J+=String.fromCharCode($&63|128)}return J}static setChartsLicenseManager(z){this.chartsLicenseManager=z,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(z){if(T(this.licenseKey)&&this.licenseKey!==z)J9(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used.");this.licenseKey=z,this.chartsLicenseManager?.setLicenseKey(z,!0)}static extractBracketedInformation(z){if(!z.includes("["))return["legacy",!1,void 0];let J=z.match(/\[(.*?)\]/g).map((G)=>G.replace("[","").replace("]",""));if(!J||J.length===0)return["legacy",!1,void 0];let Z=J.filter((G)=>G==="TRIAL").length===1,$=J.filter((G)=>G.indexOf("v")===0)[0],X=$?$.replace("v",""):"legacy",Y=sZ[J.filter((G)=>sZ[G])[0]];return[X,Z,Y]}centerPadAndOutput(z){let J=this.totalMessageLength-z.length}padAndOutput(z,J="*",Z=""){}outputInvalidLicenseKey(z,J,Z){}outputExpiredTrialKey(z,J,Z){}outputMissingLicenseKey(z){}outputExpiredKey(z,J,Z,$){}};UY.RELEASE_INFORMATION="MTc3NDQyNTc0Nzc3NQ==";var lZ=UY,_D='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',UD={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},WD=class extends x{constructor(){super(UD);this.eLicenseTextRef=S,this.registerCSS(_D)}wireBeans(Q){this.licenseManager=Q.licenseManager}postConstruct(){let Q=this.shouldDisplayWatermark();if(this.setDisplayed(Q),Q)this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5000)}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},BD={selector:"AG-WATERMARK",component:WD},PX=class extends j{constructor(){super(...arguments);this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){let Q=this.beans;if(Q.withinStudio)this.licenseManager={isDisplayWatermark:()=>!1,getWatermarkMessage:()=>""};else{let z=new lZ(Y0(Q));this.licenseManager=z,z.validateLicense()}}static getLicenseDetails(Q){return new lZ(null).getLicenseDetails(Q)}getWatermarkSelector(){return BD}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(Q){lZ.setLicenseKey(Q)}static setChartsLicenseManager(Q){lZ.setChartsLicenseManager(Q)}},ED=9525,TX={"0":1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},aZ=`\r +`;function vX(Q,z,J){if(!z&&z!==""&&z!==0)return"";let Z=z;if(typeof z==="boolean"){if(J)Z=J(z)}return` ${Q}="${Z}"`}function KD(Q={}){let Z=["version"];if(!Q.version)Q.version="1.0";if(Q.encoding)Z.push("encoding");if(Q.standalone)Z.push("standalone");return``${X}="${Q[X]}"`).join(" ")} ?>`}function WY(Q,z){let J="";if(Q.properties){if(Q.properties.prefixedAttributes)Q.properties.prefixedAttributes.forEach(($)=>{for(let X of Object.keys($.map))J+=vX($.prefix+X,$.map[X],z)});if(Q.properties.rawMap)for(let $ of Object.keys(Q.properties.rawMap))J+=vX($,Q.properties.rawMap[$],z)}let Z="<"+Q.name+J;if(!Q.children&&Q.textNode==null)return Z+"/>"+aZ;if(Q.textNode!=null)return Z+">"+Q.textNode+""+aZ;if(Z+=">"+aZ,Q.children)for(let $ of Q.children)Z+=WY($,z);return Z+""+aZ}var LD=(Q)=>{return Math.round(Q*96/72)},R1=(Q)=>{return Math.ceil(Q*ED)},FD=(Q)=>{if(Q===void 0)return;let J=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(Q||"Automatic");return Math.max(J,0)},J2=(Q,z)=>{if(!z)return;let J;if(typeof z==="number")J=z;else J=z({rowIndex:Q});return J},DD=(Q,z)=>{let{colSpan:J,column:Z}=Q.position;if(!Q.width)return;if(J){let $=z.slice(Z-1,Z+J-1),X=0;for(let Y=0;Y<$.length;Y++){let G=$[Y].getActualWidth();if(Q.width{let{rowSpan:J,row:Z}=Q.position;if(!Q.height)return;if(J){let $=0,X=0;for(let Y=Z;Y{let J=KD({encoding:"UTF-8",standalone:"yes"}),Z=WY(Q);if(z)return Z;return`${J}${Z}`},az=(Q)=>{let Z=String.fromCharCode,$=Math.floor(Q/26),X=Q%26;if(!$||Q===26)return Z(65+Q-1);if(!X)return az($-1)+"Z";if($<26)return Z(65+$-1)+Z(65+X-1);return az($)+Z(65+X-1)},kD=(Q)=>{return Q.replaceAll(` +`,"_x000a_")},G2=(Q)=>{if(Q==null)return null;let z="";for(let J=0;J=0&&Z<=31&&Z!==10){let Y=`_x${Z.toString(16).toUpperCase().padStart(4,"0")}_`;z+=Y}else z+=Q[J]}return z},VD=(Q)=>{let z=[];for(let J of Q.keys()){let Z=J.toString(),$={name:"t",textNode:W0(G2(Z))};if(Z.trim().length!==Z.length)$.properties={rawMap:{"xml:space":"preserve"}};z.push({name:"si",children:[$]})}return z},fD=class extends P6{constructor(Q){super(Q);this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=Q.formulaSvc,this.config=Object.assign({},Q),this.workbook=Q.workbook,this.stylesByIds={};for(let J of this.config.baseExcelStyles)this.stylesByIds[J.id]=J;let z={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[z.id]=z,this.excelStyles=[...this.config.baseExcelStyles,z]}addCustomContent(Q){for(let z of Q){let J=this.rows.length+1,Z;if(!this.config.suppressRowOutline&&z.outlineLevel!=null)Z=z.outlineLevel;let $={height:J2(J,z.height||this.config.rowHeight),cells:(z.cells||[]).map((X,Y)=>{let G=this.addImage(J,this.columnsToExport[Y],X.data?.value),q=null;if(X.styleId)q=typeof X.styleId==="string"?[X.styleId]:X.styleId;let H=this.getStyleId(q);if(G)return this.createCell(H,this.getDataTypeForValue(G.value),G.value==null?"":G.value);let _=X.data?.value??"",U=this.getDataTypeForValue(_);if(X.mergeAcross)return this.createMergedCell(H,U,_,X.mergeAcross);return this.createCell(H,U,_)}),outlineLevel:Z};if(z.collapsed!=null)$.collapsed=z.collapsed;if(z.hidden!=null)$.hidden=z.hidden;this.rows.push($)}}onNewHeaderGroupingRow(){let Q=[],{freezeRows:z,headerRowHeight:J}=this.config;if(this.rows.push({cells:Q,height:J2(this.rows.length+1,J)}),z)this.frozenRowCount++;return{onColumn:(Z,$,X,Y,G)=>{let q=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${$}`,columnGroup:Z});Q.push({...this.createMergedCell(this.getStyleId(q),this.getDataTypeForValue("string"),$,Y),collapsibleRanges:G})}}}onNewHeaderRow(){let{freezeRows:Q,headerRowHeight:z}=this.config;if(Q)this.frozenRowCount++;return this.onNewRow(this.onNewHeaderColumn,z)}onNewBodyRow(Q){let{freezeRows:z,rowHeight:J}=this.config;if(!this.skipFrozenRows)if(z==="headersAndPinnedRows"&&Q?.rowPinned==="top")this.frozenRowCount++;else if(typeof z==="function")if(z(y(this.gos,{node:Q})))this.frozenRowCount++;else this.skipFrozenRows=!0;else this.skipFrozenRows=!0;let Z=this.onNewRow(this.onNewBodyColumn,J);if(Q)this.addRowOutlineIfNecessary(Q);return Z}prepare(Q){super.prepare(Q),this.columnsToExport=[...Q],this.cols=Q.map((z,J)=>this.convertColumnToExcel(z,J))}parse(){let Q=this.rows.reduce((J,Z)=>Math.max(J,Z.cells.length),0);while(this.cols.length{let Z=this.extractHeaderValue(J),$=this.config.styleLinker({rowType:"HEADER",rowIndex:Q,value:Z,column:J});z.push(this.createCell(this.getStyleId($),this.getDataTypeForValue("string"),Z))}}onNewBodyColumn(Q,z){let J=0,{freezeColumns:Z,rightToLeft:$}=this.config;return(X,Y,G)=>{if(J>0){J-=1;return}if(!this.skipFrozenColumns){let L=X.getPinned();if(Z==="pinned"&&L&&(L===!0||L==="left")!==$)this.frozenColumnCount++;else if(typeof Z==="function"&&Z(y(this.gos,{column:X})))this.frozenColumnCount++;else this.skipFrozenColumns=!0}let{value:q,valueFormatted:H}=this.extractRowCellValue({column:X,node:G,currentColumnIndex:Y,accumulatedRowIndex:Q,type:"excel",useRawFormula:!0}),_=q,U=typeof _==="bigint"?_.toString():_,W=this.config.styleLinker({rowType:"BODY",rowIndex:Q,value:_,column:X,node:G}),B=this.getStyleId(W),E=X.getColSpan(G),K=this.addImage(Q,X,U);if(K)z.push(this.createCell(B,this.getDataTypeForValue(K.value),K.value==null?"":K.value));else if(E>1)J=E-1,z.push(this.createMergedCell(B,this.getDataTypeForValue(_),U,E-1));else{let L=X.isAllowFormula()&&this.formulaSvc?.isFormula(U),F=this.createCell(B,L?"f":this.getDataTypeForValue(_),L?this.formulaSvc?.updateFormulaByOffset({value:U,rowDelta:Q-(G.formulaRowIndex+1),useRefFormat:!1}):U,H);z.push(F)}}}onNewRow(Q,z){let J=[];return this.rows.push({cells:J,height:J2(this.rows.length+1,z)}),{onColumn:Q.bind(this,this.rows.length,J)()}}addWorksheetToWorkbook(Q){let{excelStyles:z,config:J}=this;if(this.mapSharedStrings(Q),this.frozenColumnCount)J.frozenColumnCount=this.frozenColumnCount;if(this.frozenRowCount)J.frozenRowCount=this.frozenRowCount;return this.workbook.addWorksheet(z,Q,J)}mapSharedStrings(Q){let z;for(let J of Q.table.rows)for(let Z of J.cells){let $=Z.data;if(!$||$.type!=="s")continue;let X=$.value;if(X==null)continue;if(X===""){z??(z=this.workbook.getStringPosition("").toString()),$.value=z;continue}$.value=this.workbook.getStringPosition(String(X)).toString()}}getDataTypeForValue(Q){if(Q===void 0)return"empty";let z="s";try{if(this.isNumerical(Q))z="n"}catch(J){}return z}getTypeFromStyle(Q,z){if(this.isFormula(z))return"f";if(Q?.dataType)switch(Q.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:R(162,{id:Q.id,dataType:Q.dataType})}return null}addImage(Q,z,J){if(!this.config.addImageToCell)return;let Z=this.config.addImageToCell(Q,z,J);if(!Z)return;return this.workbook.addBodyImageToMap(Z.image,Q,z,this.columnsToExport,this.config.rowHeight),Z}createCell(Q,z,J,Z){let $=this.getStyleById(Q);if(!$?.dataType&&z==="s"&&Z!=null)J=Z;let X=this.getTypeFromStyle($,J)||z,{value:Y,escaped:G}=this.getCellValue(X,J),q=[];if($)q.push(Q);if(G)q.push("_quotePrefix");return Q=this.getStyleId(q)||void 0,{styleId:Q,data:{type:X,value:Y}}}createMergedCell(Q,z,J,Z){let $=J==null?"":J;return{styleId:this.getStyleById(Q)?Q:void 0,data:{type:z,value:z==="s"?String($):J},mergeAcross:Z}}getCellValue(Q,z){let J=!1;if(z==null||Q==="s"&&z==="")return{value:"",escaped:!1};if(Q==="s"){if(z=String(z),z[0]==="'")J=!0,z=z.slice(1)}else if(Q==="f")z=this.addXlfnPrefix(z).slice(1);else if(Q==="n"){let Z=Number(z);if(isNaN(Z))z="";else if(z!=="")z=Z.toString()}return{value:z,escaped:J}}addXlfnPrefix(Q){if(!Q)return Q;let z=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return Q.replace(z,(J,Z,$,X)=>`${Z}_xlfn.${$}${X}`)}getStyleId(Q){if(!Q?.length)return null;let z=Q.filter((Z)=>this.stylesByIds[Z]!=null);if(!z.length)return null;if(z.length===1)return z[0];let J=z.join("-");if(!this.mixedStyles[J])this.addNewMixedStyle(z);return this.mixedStyles[J].excelID}addNewMixedStyle(Q){this.mixedStyleCounter+=1;let z=`mixedStyle${this.mixedStyleCounter}`,J={};for(let $ of Q){let X=this.stylesByIds[$];if(X)B0(J,X,!0,!0)}J.id=z;let Z=Q.join("-");this.mixedStyles[Z]={excelID:z,key:Z,result:J},this.excelStyles.push(J),this.stylesByIds[z]=J}isFormula(Q){if(Q==null)return!1;let z=String(Q);return this.config.autoConvertFormulas&&oJ(z)}isNumerical(Q){if(typeof Q==="bigint")return!1;return isFinite(Q)&&Q!==""&&!isNaN(parseFloat(Q))}getStyleById(Q){if(Q==null)return null;return this.stylesByIds[Q]||null}},AD={getTemplate(Q){let{name:z,ContentType:J,Extension:Z,PartName:$}=Q;return{name:z,properties:{rawMap:{Extension:Z,PartName:$,ContentType:J}}}}},jD=AD,K2=(Q)=>Q==="jpg"?"jpeg":Q,RD={getTemplate({sheetLen:Q,hasCustomProperties:z}){let J=Array(Q).fill(void 0).map((U,W)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${W+1}.xml`})),Z=fz.size,$=dQ.size,X={};T1.forEach((U)=>{X[K2(U.type)]=!0});let Y=Array(Z).fill(void 0).map((U,W)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${W+1}.xml`})),G=[];wQ.forEach(({name:U})=>{G.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${U}.xml`})});let q=z?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],H=Object.keys(X).map((U)=>({name:"Default",ContentType:`image/${U}`,Extension:U}));if($)H.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});let _=[...H,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...J,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...Y,...G,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...q].map((U)=>jD.getTemplate(U));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:_}}},SD=RD,OD={getTemplate(Q){let J=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:Q},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:J},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:J}]}}},PD=OD,TD="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",vD=(Q)=>{return Object.keys(Q).filter((J)=>J&&Q[J]!=null).map((J,Z)=>({name:"property",properties:{rawMap:{fmtid:TD,pid:(Z+2).toString(),name:W0(J)??""}},children:[{name:"vt:lpwstr",textNode:W0(G2(String(Q[J])))??""}]}))},ID={getTemplate(Q){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:vD(Q)}}},CD=ID,IX=(Q,z)=>({name:`xdr:${Q}`,children:[{name:"xdr:col",textNode:z.col.toString()},{name:"xdr:colOff",textNode:z.offsetX.toString()},{name:"xdr:row",textNode:z.row.toString()},{name:"xdr:rowOff",textNode:z.offsetY.toString()}]}),bD=(Q)=>{let z=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(Q.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":z.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:z}},yD=(Q,z)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:z,name:Q.id,descr:Q.altText!=null?Q.altText:void 0}},children:[bD(Q)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),CX=(Q)=>{if(!Q.saturation&&!Q.tint)return;let z=[];if(Q.saturation)z.push({name:"a:satMod",properties:{rawMap:{val:Q.saturation*1000}}});if(Q.tint)z.push({name:"a:tint",properties:{rawMap:{val:Q.tint*1000}}});return z},xD=(Q,z)=>{return{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:Q.color}},children:CX(Q)},{name:"a:srgbClr",properties:{rawMap:{val:z.color}},children:CX(z)}]}},wD=(Q,z)=>{let J;if(Q.transparency){let Z=Math.min(Math.max(Q.transparency,0),100);J=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(Z*1000)}}}]}if(Q.recolor){if(!J)J=[];switch(Q.recolor.toLocaleLowerCase()){case"grayscale":J.push({name:"a:grayscl"});break;case"sepia":J.push(xD({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":J.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${z}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:J},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},ND=(Q,z)=>{let J={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:z.width,cy:z.height}}}]};if(Q.rotation){let X=Q.rotation;J.properties={rawMap:{rot:Math.min(Math.max(X,0),360)*60000}}}return{name:"xdr:spPr",children:[J,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},gD=(Q)=>{Q.fitCell=!!Q.fitCell||!Q.width||!Q.height;let{position:z={},fitCell:J,width:Z=0,height:$=0,totalHeight:X,totalWidth:Y}=Q,{offsetX:G=0,offsetY:q=0,row:H=1,rowSpan:_=1,column:U=1,colSpan:W=1}=z;return{from:{row:H-1,col:U-1,offsetX:R1(G),offsetY:R1(q)},to:{row:H-1+(J?1:_-1),col:U-1+(J?1:W-1),offsetX:R1(Z+G),offsetY:R1($+q)},height:R1(X||$),width:R1(Y||Z)}},hD=(Q,z,J,Z)=>{return{name:"xdr:pic",children:[yD(Q,z+1),wD(Q,J+1),ND(Q,Z)]}},uD={getTemplate(Q){let{sheetIndex:z}=Q,J=fz.get(z),Z=v1.get(z),$=J.map((X,Y)=>{let G=gD(X);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[IX("from",G.from),IX("to",G.to),hD(X,Y,Z.get(X.id).index,G),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:$}}},mD=uD,cD={getTemplate(Q){let{Id:z,Type:J,Target:Z}=Q;return{name:"Relationship",properties:{rawMap:{Id:z,Type:J,Target:Z}}}}},pD=cD,iD={getTemplate(Q){let z=Q.map((J)=>pD.getTemplate(J));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:z}}},IJ=iD,nD={getTemplate(Q){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:Q.size,uniqueCount:Q.size}},children:VD(Q)}}},dD=nD,tD=(Q)=>{switch(Q){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},rD={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},sD=["Dashed","DashDot","DashDotDot"],lD={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},aD={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},oD={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},eD=(Q)=>{if(!Q)return"none";return lD[Q]||Q},kz=(Q)=>{if(Q==null)return Q;if(Q.charAt(0)==="#")Q=Q.substring(1);return Q.length===6?"FF"+Q:Q},oZ=(Q,z)=>{if(!Q)return"thin";let J=tD(z);if(Q==="Continuous")return J;let Z=rD[Q];if(J==="medium"&&sD.some(($)=>$===Z))return`medium${Z}`;return`${Z.charAt(0).toLowerCase()}${Z.substring(1)}`},QM=(Q)=>{return aD[Q]||"general"},zM=(Q)=>{return oD[Q]||void 0},kJ=(Q)=>{return{name:"color",properties:{rawMap:{rgb:kz(Q||"#000000")}}}},JM={getTemplate(Q){let{left:z,right:J,top:Z,bottom:$,diagonal:X}=Q,Y=z?[kJ(z.color)]:void 0,G=J?[kJ(J.color)]:void 0,q=Z?[kJ(Z.color)]:void 0,H=$?[kJ($.color)]:void 0,_=X?[kJ(X.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:z?.style}},children:Y},{name:"right",properties:{rawMap:{style:J?.style}},children:G},{name:"top",properties:{rawMap:{style:Z?.style}},children:q},{name:"bottom",properties:{rawMap:{style:$?.style}},children:H},{name:"diagonal",properties:{rawMap:{style:X?.style}},children:_}]}}},ZM=JM,$M={getTemplate(Q){return{name:"borders",properties:{rawMap:{count:Q.length}},children:Q.map((z)=>ZM.getTemplate(z))}}},XM=$M,YM=(Q)=>{let J=["Context","LeftToRight","RightToLeft"].indexOf(Q);return Math.max(J,0)},GM={getTemplate(Q){let{horizontal:z,indent:J,readingOrder:Z,rotate:$,shrinkToFit:X,vertical:Y,wrapText:G}=Q;return{name:"alignment",properties:{rawMap:{horizontal:z&&QM(z),indent:J,readingOrder:Z&&YM(Z),textRotation:$,shrinkToFit:X,vertical:Y&&zM(Y),wrapText:G}}}}},qM=GM,HM={getTemplate(Q){let z=Q.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:Q.hideFormula===!0?1:0,locked:z}}}}},_M=HM,UM={getTemplate(Q){let{alignment:z,borderId:J,fillId:Z,fontId:$,numFmtId:X,protection:Y,quotePrefix:G,xfId:q}=Q,H=[];if(z)H.push(qM.getTemplate(z));if(Y)H.push(_M.getTemplate(Y));return{name:"xf",properties:{rawMap:{applyAlignment:z?1:void 0,applyProtection:Y?1:void 0,applyBorder:J?1:void 0,applyFill:Z?1:void 0,borderId:J,fillId:Z,applyFont:$?1:void 0,fontId:$,applyNumberFormat:X?1:void 0,numFmtId:X,quotePrefix:G?1:void 0,xfId:q}},children:H.length?H:void 0}}},BY=UM,WM={getTemplate(Q){return{name:"cellStyleXfs",properties:{rawMap:{count:Q.length}},children:Q.map((z)=>BY.getTemplate(z))}}},BM=WM,EM={getTemplate(Q){let{builtinId:z,name:J,xfId:Z}=Q;return{name:"cellStyle",properties:{rawMap:{builtinId:z,name:J,xfId:Z}}}}},KM=EM,LM={getTemplate(Q){return{name:"cellStyles",properties:{rawMap:{count:Q.length}},children:Q.map((z)=>KM.getTemplate(z))}}},FM=LM,DM={getTemplate(Q){return{name:"cellXfs",properties:{rawMap:{count:Q.length}},children:Q.map((z)=>BY.getTemplate(z))}}},MM=DM,kM={getTemplate(Q){let{patternType:z,fgTheme:J,fgTint:Z,fgRgb:$,bgRgb:X,bgIndexed:Y}=Q,G={name:"patternFill",properties:{rawMap:{patternType:z}}};if(J||Z||$)G.children=[{name:"fgColor",properties:{rawMap:{theme:J,tint:Z,rgb:$}}}];if(Y||X){if(!G.children)G.children=[];G.children.push({name:"bgColor",properties:{rawMap:{indexed:Y,rgb:X}}})}return{name:"fill",children:[G]}}},VM=kM,fM={getTemplate(Q){return{name:"fills",properties:{rawMap:{count:Q.length}},children:Q.map((z)=>VM.getTemplate(z))}}},AM=fM,jM={getTemplate(Q){let{size:z,colorTheme:J,color:Z="FF000000",fontName:$="Calibri",family:X,scheme:Y,italic:G,bold:q,strikeThrough:H,outline:_,shadow:U,underline:W,verticalAlign:B}=Q,E=[{name:"sz",properties:{rawMap:{val:z}}},{name:"color",properties:{rawMap:{theme:J,rgb:Z}}},{name:"name",properties:{rawMap:{val:$}}}];if(X)E.push({name:"family",properties:{rawMap:{val:X}}});if(Y)E.push({name:"scheme",properties:{rawMap:{val:Y}}});if(G)E.push({name:"i"});if(q)E.push({name:"b"});if(H)E.push({name:"strike"});if(_)E.push({name:"outline"});if(U)E.push({name:"shadow"});if(W)E.push({name:"u",properties:{rawMap:{val:W}}});if(B)E.push({name:"vertAlign",properties:{rawMap:{val:B}}});return{name:"font",children:E}}},RM=jM,SM={getTemplate(Q){return{name:"fonts",properties:{rawMap:{count:Q.length}},children:Q.map((z)=>RM.getTemplate(z))}}},OM=SM;function PM(Q){let z=Q.split(/(\[[^\]]*\])/);for(let J=0;JvM.getTemplate(z))}}},CM=IM,q2,S1,AJ,jJ,RJ,EY,H2,KY,l6,LY=(Q,z)=>{if(Q.includes("mixedStyle")&&z>1)Q+=`_${z}`;return Q},FY=()=>{q2={base:0},S1=[],AJ=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],jJ=[{patternType:"none"},{patternType:"gray125"}],RJ=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],EY=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],H2=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],KY=[{builtinId:0,name:"Normal",xfId:0}]},bM=(Q)=>{let z=eD(Q.pattern),J=kz(Q.color),Z=kz(Q.patternColor),$=jJ.findIndex((X)=>{let{patternType:Y,fgRgb:G,bgRgb:q}=X;return!(Y!=z||G!=J||q!=Z)});if($===-1)$=jJ.length,jJ.push({patternType:z,fgRgb:J,bgRgb:Z});return $},yM=(Q)=>{if(TX[Q])return TX[Q];let z=S1.findIndex((J)=>J.formatCode===Q);if(z===-1)z=S1.length+164,S1.push({formatCode:Q,numFmtId:z});else z=S1[z].numFmtId;return z},xM=(Q)=>{let{borderBottom:z,borderTop:J,borderLeft:Z,borderRight:$}=Q,X,Y,G,q,H,_,U,W;if(Z)G=oZ(Z.lineStyle,Z.weight),U=kz(Z.color);if($)q=oZ($.lineStyle,$.weight),W=kz($.color);if(z)X=oZ(z.lineStyle,z.weight),H=kz(z.color);if(J)Y=oZ(J.lineStyle,J.weight),_=kz(J.color);let B=RJ.findIndex((E)=>{let{left:K,right:L,top:F,bottom:D}=E;if(!K&&(G||U))return!1;if(!L&&(q||W))return!1;if(!F&&(Y||_))return!1;if(!D&&(X||H))return!1;let{style:M,color:k}=K||{},{style:f,color:A}=L||{},{style:O,color:v}=F||{},{style:I,color:C}=D||{};if(M!=G||k!=U)return!1;if(f!=q||A!=W)return!1;if(O!=Y||v!=_)return!1;if(I!=X||C!=H)return!1;return!0});if(B===-1)B=RJ.length,RJ.push({left:{style:G,color:U},right:{style:q,color:W},top:{style:Y,color:_},bottom:{style:X,color:H},diagonal:{style:void 0,color:void 0}});return B},wM=(Q)=>{let{fontName:z="Calibri",color:J,size:Z,bold:$,italic:X,outline:Y,shadow:G,strikeThrough:q,underline:H,family:_,verticalAlign:U}=Q,W=kz(J),B=FD(_),E=H?H.toLocaleLowerCase():void 0,K=U?U.toLocaleLowerCase():void 0,L=AJ.findIndex((F)=>{return!(F.fontName!=z||F.color!=W||F.size!=Z||F.bold!=$||F.italic!=X||F.outline!=Y||F.shadow!=G||F.strikeThrough!=q||F.underline!=E||F.verticalAlign!=K||F.family!=B)});if(L===-1)L=AJ.length,AJ.push({fontName:z,color:W,size:Z,bold:$,italic:X,outline:Y,shadow:G,strikeThrough:q,underline:E,verticalAlign:K,family:B!=null?B.toString():void 0});return L},NM=(Q)=>{let{alignment:z,borders:J,font:Z,interior:$,numberFormat:X,protection:Y,quotePrefix:G}=Q,{id:q}=Q,H=0,_=0,U=0,W=0;if(!q)return;if(q=LY(q,l6),q2[q]!=null)return;if($)H=bM($);if(J)_=xM(J);if(Z)U=wM(Z);if(X)W=yM(X.format);q2[q]=H2.length,H2.push({alignment:z,borderId:_||0,fillId:H||0,fontId:U||0,numFmtId:W||0,protection:Y,quotePrefix:G,xfId:0})},gM={getTemplate(Q){let z=CM.getTemplate(S1),J=OM.getTemplate(AJ.map((q)=>({...q,size:q.size!=null?q.size:Q}))),Z=AM.getTemplate(jJ),$=XM.getTemplate(RJ),X=BM.getTemplate(EY),Y=MM.getTemplate(H2),G=FM.getTemplate(KY);return FY(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[z,J,Z,$,X,Y,G,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},hM=(Q,z)=>{return q2[LY(Q,z)]||0},uM=(Q,z)=>{if(l6=z,l6===1)FY();Q.forEach(NM)},mM=gM,cM={getTemplate(Q,z){let{name:J,columns:Z,rowRange:$,displayName:X,showRowStripes:Y,showColumnStripes:G,showFilterButtons:q,highlightFirstColumn:H,highlightLastColumn:_}=Q||{},U=!$||$[0]-$[1]===0;if(!Q||!J||!Array.isArray(Z)||!Z.length||U)return{name:"table"};let W=Z.map((D,M)=>({name:"filterColumn",properties:{rawMap:{colId:M.toString(),hiddenButton:q[M]?0:1}}})),B=`A${$[0]}`,E=`${az(Z.length)}${$[1]}`,K=`${B}:${E}`,L=`${z+1}`,F=z?`${X}_${L}`:X;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:F,displayName:F,ref:K,totalsRowShown:0,id:L}},children:[{name:"autoFilter",properties:{rawMap:{ref:K}},children:W},{name:"tableColumns",properties:{rawMap:{count:Z.length}},children:Z.map((D,M)=>({name:"tableColumn",properties:{rawMap:{id:(M+1).toString(),name:W0(kD(D)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:H?1:0,showLastColumn:_?1:0,showRowStripes:Y?1:0,showColumnStripes:G?1:0}}}]}}},pM=cM,HQ=(Q)=>{let[z,J,Z,$]=Q;return{name:`a:${z}`,children:[{name:`a:${J}`,properties:{rawMap:{val:Z,lastClr:$}}}]}},iM={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[HQ(["dk1","sysClr","windowText","000000"]),HQ(["lt1","sysClr","window","FFFFFF"]),HQ(["dk2","srgbClr","44546A"]),HQ(["lt2","srgbClr","E7E6E6"]),HQ(["accent1","srgbClr","4472C4"]),HQ(["accent2","srgbClr","ED7D31"]),HQ(["accent3","srgbClr","A5A5A5"]),HQ(["accent4","srgbClr","FFC000"]),HQ(["accent5","srgbClr","5B9BD5"]),HQ(["accent6","srgbClr","70AD47"]),HQ(["hlink","srgbClr","0563C1"]),HQ(["folHlink","srgbClr","954F72"])]}}},nM=iM,P=(Q)=>{let[z,J,Z,$]=Q;return{name:`a:${z}`,properties:{rawMap:{script:Z,typeface:J,panose:$}}}},dM={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[P(["latin","Calibri Light",void 0,"020F0302020204030204"]),P(["ea",""]),P(["cs",""]),P(["font","游ゴシック Light","Jpan"]),P(["font","맑은 고딕","Hang"]),P(["font","等线 Light","Hans"]),P(["font","新細明體","Hant"]),P(["font","Times New Roman","Arab"]),P(["font","Times New Roman","Hebr"]),P(["font","Tahoma","Thai"]),P(["font","Nyala","Ethi"]),P(["font","Vrinda","Beng"]),P(["font","Shruti","Gujr"]),P(["font","MoolBoran","Khmr"]),P(["font","Tunga","Knda"]),P(["font","Raavi","Guru"]),P(["font","Euphemia","Cans"]),P(["font","Plantagenet Cherokee","Cher"]),P(["font","Microsoft Yi Baiti","Yiii"]),P(["font","Microsoft Himalaya","Tibt"]),P(["font","MV Boli","Thaa"]),P(["font","Mangal","Deva"]),P(["font","Gautami","Telu"]),P(["font","Latha","Taml"]),P(["font","Estrangelo Edessa","Syrc"]),P(["font","Kalinga","Orya"]),P(["font","Kartika","Mlym"]),P(["font","DokChampa","Laoo"]),P(["font","Iskoola Pota","Sinh"]),P(["font","Mongolian Baiti","Mong"]),P(["font","Times New Roman","Viet"]),P(["font","Microsoft Uighur","Uigh"]),P(["font","Sylfaen","Geor"]),P(["font","Arial","Armn"]),P(["font","Leelawadee UI","Bugi"]),P(["font","Microsoft JhengHei","Bopo"]),P(["font","Javanese Text","Java"]),P(["font","Segoe UI","Lisu"]),P(["font","Myanmar Text","Mymr"]),P(["font","Ebrima","Nkoo"]),P(["font","Nirmala UI","Olck"]),P(["font","Ebrima","Osma"]),P(["font","Phagspa","Phag"]),P(["font","Estrangelo Edessa","Syrn"]),P(["font","Estrangelo Edessa","Syrj"]),P(["font","Estrangelo Edessa","Syre"]),P(["font","Nirmala UI","Sora"]),P(["font","Microsoft Tai Le","Tale"]),P(["font","Microsoft New Tai Lue","Talu"]),P(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[P(["latin","Calibri",void 0,"020F0502020204030204"]),P(["ea",""]),P(["cs",""]),P(["font","游ゴシック","Jpan"]),P(["font","맑은 고딕","Hang"]),P(["font","等线","Hans"]),P(["font","新細明體","Hant"]),P(["font","Arial","Arab"]),P(["font","Arial","Hebr"]),P(["font","Tahoma","Thai"]),P(["font","Nyala","Ethi"]),P(["font","Vrinda","Beng"]),P(["font","Shruti","Gujr"]),P(["font","DaunPenh","Khmr"]),P(["font","Tunga","Knda"]),P(["font","Raavi","Guru"]),P(["font","Euphemia","Cans"]),P(["font","Plantagenet Cherokee","Cher"]),P(["font","Microsoft Yi Baiti","Yiii"]),P(["font","Microsoft Himalaya","Tibt"]),P(["font","MV Boli","Thaa"]),P(["font","Mangal","Deva"]),P(["font","Gautami","Telu"]),P(["font","Latha","Taml"]),P(["font","Estrangelo Edessa","Syrc"]),P(["font","Kalinga","Orya"]),P(["font","Kartika","Mlym"]),P(["font","DokChampa","Laoo"]),P(["font","Iskoola Pota","Sinh"]),P(["font","Mongolian Baiti","Mong"]),P(["font","Arial","Viet"]),P(["font","Microsoft Uighur","Uigh"]),P(["font","Sylfaen","Geor"]),P(["font","Arial","Armn"]),P(["font","Leelawadee UI","Bugi"]),P(["font","Microsoft JhengHei","Bopo"]),P(["font","Javanese Text","Java"]),P(["font","Segoe UI","Lisu"]),P(["font","Myanmar Text","Mymr"]),P(["font","Ebrima","Nkoo"]),P(["font","Nirmala UI","Olck"]),P(["font","Ebrima","Osma"]),P(["font","Phagspa","Phag"]),P(["font","Estrangelo Edessa","Syrn"]),P(["font","Estrangelo Edessa","Syrj"]),P(["font","Estrangelo Edessa","Syre"]),P(["font","Nirmala UI","Sora"]),P(["font","Microsoft Tai Le","Tale"]),P(["font","Microsoft New Tai Lue","Talu"]),P(["font","Ebrima","Tfng"])]}]}}},tM=dM,xQ=(Q,z,J)=>({name:`a:${Q}`,properties:{rawMap:{val:z}},children:J}),g6=(Q)=>{let[z,J,Z,$,X,Y]=Q,G=[];if(G.push(xQ("satMod",Z)),$)G.push(xQ("lumMod",$));if(X)G.push(xQ("tint",X));if(Y)G.push(xQ("shade",Y));return{name:"a:gs",properties:{rawMap:{pos:z}},children:[{name:"a:schemeClr",properties:{rawMap:{val:J}},children:G}]}},_2=(Q,z)=>({name:"a:solidFill",children:[xQ("schemeClr",Q,z)]}),a6=(Q)=>{let[z,J,Z,$,X]=Q,[Y,G]=X;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:z}},children:[{name:"a:gsLst",children:[g6(J),g6(Z),g6($)]},{name:"a:lin",properties:{rawMap:{ang:Y,scaled:G}}}]}},h6=(Q)=>{let[z,J,Z,$]=Q;return{name:"a:ln",properties:{rawMap:{w:z,cap:J,cmpd:Z,algn:$}},children:[_2("phClr"),xQ("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},u6=(Q)=>{let z=[];if(Q){let[J,Z,$,X,Y]=Q;z.push({name:"a:outerShdw",properties:{rawMap:{blurRad:J,dist:Z,dir:$,algn:X,rotWithShape:Y}},children:[xQ("srgbClr","000000",[xQ("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},z.length?{children:z}:{})]}},rM=()=>({name:"a:fillStyleLst",children:[_2("phClr"),a6(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),a6(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),sM=()=>({name:"a:lnStyleLst",children:[h6(["6350","flat","sng","ctr"]),h6(["12700","flat","sng","ctr"]),h6(["19050","flat","sng","ctr"])]}),lM=()=>({name:"a:effectStyleLst",children:[u6(),u6(),u6(["57150","19050","5400000","ctr","0"])]}),aM=()=>({name:"a:bgFillStyleLst",children:[_2("phClr"),_2("phClr",[xQ("tint","95000"),xQ("satMod","170000")]),a6(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),oM={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[rM(),sM(),lM(),aM()]}}},eM=oM,Qk={getTemplate(){return{name:"a:themeElements",children:[nM.getTemplate(),tM.getTemplate(),eM.getTemplate()]}}},zk=Qk,Jk={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[zk.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},Zk=Jk,$k=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),Xk=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),Yk=(Q)=>({name:"v:formulas",children:Q.map((z)=>({name:"v:f",properties:{rawMap:{eqn:z}}}))}),Gk=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),DY=(Q)=>{let{aspectratio:z,rotation:J}=Q||{},Z={};if(z)Z.aspectratio="t";if(J)Z.rotation="t";return{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:Z}}};function qk(Q,z,J,Z,$){return(Q-z)/(J-z)*($-Z)+Z}var Hk=(Q,z)=>{let J,{recolor:Z,brightness:$,contrast:X,id:Y}=Q;if(Z){if(J={},Z==="Washout"||Z==="Grayscale")J.gain="19661f",J.blacklevel="22938f";if(Z==="Black & White"||Z==="Grayscale"){if(J.grayscale="t",Z==="Black & White")J.bilevel="t"}}if(!Z||Z==="Grayscale"){if(!J)J={};if(X!=null&&X!==50){let G="1";if(X>=0){if(X<50)G=String(X/50);else if(X<100)G=String(50/(100-X));else if(X===100)G="2147483647f"}J.gain=G}if($!=null&&$!==50)J.blacklevel=qk($,0,100,-0.5,0.5).toString()}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${z}`,title:Y}}],rawMap:J}}},_k=()=>{let Q=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[Xk(),Yk(Q),Gk(),DY({aspectratio:!0})]}},bX=(Q)=>Math.floor((Q??0)*0.74999943307122),Uk=(Q,z)=>{let{width:J=0,height:Z=0,altText:$}=Q,X=bX(J),Y=bX(Z);return{name:"v:shape",properties:{rawMap:{id:Q.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${X}pt; height: ${Y}pt; z-index: ${z+1}`,type:"#_x0000_t75",alt:$}},children:[Hk(Q,z+1),DY({rotation:!0})]}},Wk={getTemplate(Q){let z=dQ.get(Q.sheetIndex)||[],J=[$k(),_k(),...z.map((Z,$)=>Uk(Z,$))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:J}}},Bk=Wk,Ek={getTemplate(Q,z){let J=(z+1).toString();return{name:"sheet",properties:{rawMap:{name:Q,sheetId:J,"r:id":`rId${J}`}}}}},Kk=Ek,Lk={getTemplate(Q){return{name:"sheets",children:Q.map((z,J)=>Kk.getTemplate(z,J))}}},Fk=Lk,Dk={getTemplate(Q,z){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:z}}}]},Fk.getTemplate(Q)]}}},Mk=Dk,kk=(Q)=>Math.ceil((Q-12)/7+1),Vk={getTemplate(Q){let{min:z,max:J,outlineLevel:Z,s:$,width:X,hidden:Y,bestFit:G}=Q,q=1,H="0";if(X>1)q=kk(X),H="1";return{name:"col",properties:{rawMap:{min:z,max:J,outlineLevel:Z!=null?Z:void 0,width:q,style:$,hidden:Y?"1":"0",bestFit:G?"1":"0",customWidth:H}}}}},fk=Vk,Ak={getTemplate(Q){return{name:"mergeCell",properties:{rawMap:{ref:Q}}}}},jk=Ak,Rk=(Q)=>{let z=Q.charAt(0).toLowerCase();return z==="s"?"inlineStr":z},Sk={getTemplate(Q,z,J){let{ref:Z,data:$,styleId:X}=Q,{type:Y,value:G}=$||{type:"empty",value:null},q=Y;if(Y==="f")q="str";else if(Y.charAt(0)===Y.charAt(0).toUpperCase())q=Rk(Y);let H={name:"c",properties:{rawMap:{r:Z,t:q==="empty"?void 0:q,s:X?hM(X,J):void 0}}};if(q==="empty")return H;let _;if(q==="str"&&Y==="f")_=[{name:"f",textNode:W0(G2(G))}];else if(q==="inlineStr")_=[{name:"is",children:[{name:"t",textNode:W0(G2(G))}]}];else _=[{name:"v",textNode:G}];return Object.assign({},H,{children:_})}},Ok=Sk,Pk=(Q,z)=>{let J=[],Z=0;for(let $=0;$=0;$--){let X=[],Y=Q[J[$].pos];for(let G=1;G<=Y.mergeAcross;G++)X.push({ref:`${az(J[$].excelPos+1+G)}${z+1}`,styleId:Y.styleId,data:{type:"empty",value:null}});if(X.length)Q.splice(J[$].pos+1,0,...X)}},Tk=(Q)=>Q.data?.value!==""||Q.styleId!==void 0,vk={getTemplate(Q,z,J){let{collapsed:Z,hidden:$,height:X,outlineLevel:Y,cells:G=[]}=Q;Pk(G,z);let q=G.filter(Tk).map((H,_)=>Ok.getTemplate(H,_,J));return{name:"row",properties:{rawMap:{r:z+1,collapsed:Z?"1":"0",hidden:$?"1":"0",ht:X,customHeight:X!=null?"1":"0",spans:"1:1",outlineLevel:Y||void 0}},children:q}}},Ik=vk,Ck=(Q,z,J)=>{let Z=[],$=[];Q.forEach((G,q)=>{let H=G.cells,_=0,U;H.forEach((W,B)=>{let E=B+_+1,K=az(E),L=q+1;if(W.mergeAcross){_+=W.mergeAcross;let D=az(B+_+1);Z.push(`${K}${L}:${D}${L}`)}if(!z[E-1])z[E-1]={};let{collapsibleRanges:F}=W;if(F)F.forEach((D)=>{$.push([E+D[0],E+D[1]])});U=z[E-1],U.min=E,U.max=E,W.ref=`${K}${L}`})}),$.sort((G,q)=>{if(G[0]!==q[0])return G[0]-q[0];return q[1]-G[1]});let X=new Map,Y=new Map;return $.filter((G)=>{let q=G.toString();if(X.get(q))return!1;return X.set(q,!0),!0}).forEach((G)=>{let q=z.find((_)=>_.min==G[0]&&_.max==G[1]),H=Y.get(G[0]);z.push({min:G[0],max:G[1],outlineLevel:J?void 0:H||1,width:(q||{width:100}).width}),Y.set(G[0],(H||0)+1)}),Z},bk=(Q)=>{if(!Q||Q!=="Portrait"&&Q!=="Landscape")return"portrait";return Q.toLocaleLowerCase()},yk=(Q)=>{if(Q==null)return 1;let J=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(Q);return J===-1?1:J+1},xk=(Q)=>{let z={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(let J of Object.keys(z))Q=Q.replace(J,z[J]);return Q},wk=(Q)=>{if(Q==="Center")return"C";if(Q==="Right")return"R";return"L"},Nk=(Q,z)=>{if(!z)return Q;if(Q+="&"",Q+=z.fontName||"Calibri",z.bold!==z.italic)Q+=z.bold?",Bold":",Italic";else if(z.bold)Q+=",Bold Italic";else Q+=",Regular";if(Q+=""",z.size)Q+=`&${z.size}`;if(z.strikeThrough)Q+="&S";if(z.underline)Q+=`&${z.underline==="Double"?"E":"U"}`;if(z.color)Q+=`&K${z.color.replace("#","").toUpperCase()}`;return Q},gk=(Q,z,J)=>Q.reduce((Z,$,X)=>{let Y=wk($.position),G=Nk(`${Z}&${Y}`,$.font),q=["Left","Center","Right"];if(!$.position)$.position=q[X];let{image:H}=$;if($.value==="&[Picture]"&&H){let _=`${Y}${z}${J}`;MY(H,_)}return`${G}${W0(xk($.value))}`},""),hk=(Q)=>{let z=["all","first","even"],J=[];return z.forEach((Z)=>{let $=Q[Z],X=Z==="all"?"odd":Z;if(!$)return;for(let Y of Object.keys($)){let G=$[Y],q=`${Y.charAt(0).toUpperCase()}${Y.slice(1)}`,H=Y[0].toUpperCase();if(G){let _=Z==="all"?"":Z.toUpperCase();J.push({name:`${X}${q}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:gk(G,H,_)})}}}),J},uk=(Q)=>{return(z)=>{if(Q.length)z.children.push({name:"cols",children:Q.map((J)=>fk.getTemplate(J))});return z}},mk=(Q,z)=>{return(J)=>{if(Q.length)J.children.push({name:"sheetData",children:Q.map((Z,$)=>Ik.getTemplate(Z,$,z))});return J}},ck=(Q)=>{let z=Q.length;if(!z)return"";let J=Array(z+1);J[0]=z;for(let $=1;$<=z;$++)J[$]=Q.charCodeAt($-1)&255;let Z=0;for(let $=J.length-1;$>=0;$--){let X=J[$],Y=(Z&16384)===0?0:1,G=Z<<1&32767;Z=(Y|G)^X}return(Z^52811).toString(16).toUpperCase().padStart(4,"0")},pk=(Q)=>{return(z)=>{if(!Q)return z;let J=typeof Q==="boolean"?{}:Q,Z={sheet:1},$=J.password?ck(J.password):"";if($)Z.password=$;let X={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(X).forEach((Y)=>{let G=J[Y];if(G==null||G===X[Y])return;Z[Y]=G?0:1}),z.children.push({name:"sheetProtection",properties:{rawMap:Z}}),z}},ik=(Q)=>{return(z)=>{if(Q.length)z.children.push({name:"mergeCells",properties:{rawMap:{count:Q.length}},children:Q.map((J)=>jk.getTemplate(J))});return z}},nk=(Q)=>{return(z)=>{let{top:J=0.75,right:Z=0.7,bottom:$=0.75,left:X=0.7,header:Y=0.3,footer:G=0.3}=Q;return z.children.push({name:"pageMargins",properties:{rawMap:{bottom:$,footer:G,header:Y,left:X,right:Z,top:J}}}),z}},dk=(Q)=>{return(z)=>{if(Q)z.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:bk(Q.orientation),paperSize:yk(Q.pageSize)}}});return z}},tk=(Q)=>{return(z)=>{if(!Q)return z;let J=Q.first!=null?1:0,Z=Q.even!=null?1:0;return z.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:J,differentOddEven:Z}},children:hk(Q)}),z}},rk=(Q)=>{return(z)=>{if(Q)z.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++z.rIdCounter}`}}}]});return z}},sk=(Q)=>{return(z)=>{if(fz.get(Q)?.length)z.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++z.rIdCounter}`}}});return z}},lk=(Q)=>{return(z)=>{if(dQ.get(Q))z.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++z.rIdCounter}`}}});return z}},ak=(Q=0,z=0)=>{let J=Q>0||z>0;return J?[{name:"pane",properties:{rawMap:{state:J?"frozen":void 0,topLeftCell:J?`${az(Q+1)}${z+1}`:void 0,xSplit:Q===0?void 0:Q,ySplit:z===0?void 0:z}}}]:void 0},ok=(Q=!1,z,J)=>{return(Z)=>{return Z.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:Q===!0?"1":"0",workbookViewId:"0"}},children:ak(z,J)}]}),Z}},ek=()=>{return(Q)=>{return Q.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),Q}},QV=(Q)=>{return(z)=>{let J=Q.reduce((Z,$)=>{if($.outlineLevel&&$.outlineLevel>Z)return $.outlineLevel;return Z},0);return z.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:J?J:void 0}}}),z}},zV={getTemplate(Q){let{worksheet:z,currentSheet:J,config:Z}=Q,{margins:$={},pageSetup:X,headerFooterConfig:Y,suppressColumnOutline:G,rightToLeft:q,frozenRowCount:H,frozenColumnCount:_,protectSheet:U}=Z,{table:W}=z,{rows:B,columns:E}=W,K=E?.length?Ck(B,E,!!G):[],L=wQ.get(J),{children:F}=[ek(),ok(q,_,H),QV(B),uk(E),mk(B,J+1),pk(U),ik(K),nk($),dk(X),tk(Y),sk(J),lk(J),rk(L)].reduce((D,M)=>M(D),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:F}}},JV=zV,rz=new Map,d0=[],sz=[],lz=new Map,Vz=new Map,fz=new Map,dQ=new Map,T1=new Map,v1=new Map,wQ=new Map,ZV="AG-GRID-TABLE",J7="SINGLE_SHEET";function $V(){return J7}function XV(Q){J7=Q}function YV(Q,z,J){UV(z),uM(Q,d0.length);let Z=Object.assign({},J);if(J.exportAsExcelTable&&J.pivotModeActive)R(163,{featureName:"pivot mode"}),Z.exportAsExcelTable=!1;HV(z,Z);let $=TV(z,Z);return vV($),$}function GV(Q){return Q.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function qV(Q,z){if(wQ.has(Q)){R(164);return}wQ.set(Q,z)}function HV(Q,z){let{exportAsExcelTable:J,prependContent:Z,appendContent:$,headerRowCount:X=0}=z;if(!J)return;let Y=typeof J==="boolean"?{}:J,{name:G,showColumnStripes:q,showRowStripes:H,showFilterButton:_,highlightFirstColumn:U,highlightLastColumn:W}=Y,B=GV(G||ZV),E=d0.length-1,{table:K}=Q,{rows:L,columns:F}=K,D=Z?Z.length:0,M=$?$.length:0,k=L.length,f=F.length,A=[],O=[];for(let v=0;vX.id===Q.id))$.push(Q)}function _V(Q,z,J,Z,$){let X=d0.length,{row:Y,column:G}=Q.position||{},q=Q;if(Z){if(z!=null&&J!=null&&(!Y||!G)){if(!Q.position)Q.position={};Q.position=Object.assign({},Q.position,{row:z,column:Z.indexOf(J)+1})}DD(q,Z),MD(q,$)}kY({imageToAdd:q,idx:X});let H=v1.get(X);if(!H)H=new Map,v1.set(X,H);let _=fz.get(X);if(!_)fz.set(X,[q]);else _.push(q);if(!H.get(Q.id))H.set(Q.id,{index:H.size,type:Q.imageType})}function kY(Q){let{imageToAdd:z,idx:J}=Q,Z=Vz.get(z.id);if(Z){let $=Z.find((X)=>X.sheetId===J);if($)$.image.push(z);else Z.push({sheetId:J,image:[z]})}else Vz.set(z.id,[{sheetId:J,image:[z]}]),T1.set(z.id,{type:z.imageType,index:T1.size})}function UV(Q){let z=W0(Q.name)||"",J="";while(d0.indexOf(`${z}${J}`)!==-1)if(J==="")J="_1";else J=`_${parseInt(J.slice(1),10)+1}`;Q.name=`${z}${J}`,d0.push(Q.name)}function WV(Q){if(rz.has(Q))return rz.get(Q);return rz.set(Q,rz.size),rz.size-1}function BV(){rz.clear(),Vz.clear(),fz.clear(),dQ.clear(),T1.clear(),v1.clear(),wQ.clear(),d0=[],sz=[],lz=new Map,J7="SINGLE_SHEET"}function EV(Q){return y0(Mk.getTemplate(d0,Q))}function KV(Q){return y0(mM.getTemplate(Q))}function LV(){return y0(dD.getTemplate(rz))}function FV(Q){return y0(PD.getTemplate(Q))}function DV(Q){return y0(CD.getTemplate(Q))}function MV(Q,z){return y0(SD.getTemplate({sheetLen:Q,hasCustomProperties:z}))}function kV(Q){let z=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];if(Q)z.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});let J=IJ.getTemplate(z);return y0(J)}function VV(){return y0(Zk.getTemplate())}function fV(Q,z){return y0(pM.getTemplate(Q,z))}function AV(Q){let z=Array(Q).fill(void 0).map((Z,$)=>({Id:`rId${$+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${$+1}.xml`})),J=IJ.getTemplate([...z,{Id:`rId${Q+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${Q+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${Q+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return y0(J)}function jV(Q){return y0(mD.getTemplate({sheetIndex:Q}))}function RV(Q){let z=v1.get(Q)||[],J=[];for(let[Z,$]of z){let{index:X,type:Y}=$;J.push({Id:`rId${X+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${T1.get(Z).index+1}.${K2(Y)}`})}return y0(IJ.getTemplate(J))}function SV(Q){return y0(Bk.getTemplate({sheetIndex:Q}),!0)}function OV(Q){let z=dQ.get(Q)||[],J=[];for(let Z=0;Z{if(!Q.size)return;let J=new Map;z.forEach((Z,$)=>{if(Q.has(Z))J.set($,Q.get(Z))}),Q.clear(),J.forEach((Z,$)=>Q.set($,Z))},vV=(Q)=>{let z=lz.get(Q)??[];z.push(d0.length-1),lz.set(Q,z),sz.push(Q)},IV=(Q)=>{let z=new Map(lz),J=[];for(let Z of Q){let $=z.get(Z);if(!$?.length)return null;let X=$.shift();J.push(X),z.set(Z,$)}return J},CV=(Q)=>{if(!Q.length||sz.length===0)return null;let z=new Set,J=[];for(let Z of Q){let $=sz.findIndex((X,Y)=>!z.has(Y)&&X===Z);if($===-1)return null;z.add($),J.push($)}return J},bV=(Q)=>{let z=new Map;Q.forEach((J,Z)=>z.set(J,Z)),d0=Q.map((J)=>d0[J]),sz=Q.map((J)=>sz[J]),eZ(fz,Q),eZ(dQ,Q),eZ(wQ,Q),eZ(v1,Q),Vz.forEach((J)=>{J.forEach((Z)=>{let $=z.get(Z.sheetId);if($!=null)Z.sheetId=$})}),lz=new Map,sz.forEach((J,Z)=>{let $=lz.get(J)??[];$.push(Z),lz.set(J,$)})},yV=(Q)=>{if(Q.length<=1)return;let z=IV(Q)??CV(Q);if(!z)return;bV(z)},Z7=class{getStringPosition(Q){return WV(Q)}addBodyImageToMap(Q,z,J,Z,$){_V(Q,z,J,Z,$)}addHeaderFooterImageToMap(Q,z){MY(Q,z)}addWorksheet(Q,z,J){return YV(Q,z,J)}syncOrderWithSheetData(Q){yV(Q)}reset(){BV()}setFactoryMode(Q){XV(Q)}getFactoryMode(){return $V()}getSheetNames(){return[...d0]}},xV=async(Q)=>{let z=0,J=[],Z=new WritableStream({write:(Y)=>{J.push(Y),z+=Y.length}}),$=new ReadableStream({start:(Y)=>{let G=new FileReader;G.onload=(q)=>{if(q.target?.result)Y.enqueue(q.target.result);Y.close()},G.readAsArrayBuffer(Q)}}),X=new window.CompressionStream("deflate-raw");return await $.pipeThrough(X).pipeTo(Z),{size:z,content:new Blob(J)}},wV=async(Q)=>{let z=new Blob([Q]),{size:J,content:Z}=await xV(z),$=new Uint8Array(await Z.arrayBuffer());return{size:J,content:$}},NV=(Q)=>{let z=Q.getHours();return z<<=6,z=z|Q.getMinutes(),z<<=5,z=z|Q.getSeconds()/2,z},gV=(Q)=>{let z=Q.getFullYear()-1980;return z<<=4,z=z|Q.getMonth()+1,z<<=5,z=z|Q.getDate(),z};function b0(Q,z){let J="";for(let Z=0;Z>>=8;return J}var yX=(Q)=>{if(!Q.length)return 0;let z=-1,J=0,Z=0,$=0;for(let X=0;X>>8^$;return z^-1},xX=(Q)=>{if(!Q.length)return 0;if(typeof Q==="string")return yX(new TextEncoder().encode(Q));return yX(Q)},hV=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function uV(Q){let z=String.fromCharCode;function J(U){let W=[];if(!U)return[];let B=U.length,E=0,K,L;while(E=55296&&K<=56319&&E=55296&&U<=57343)throw Error(QQ(255,{point:U}))}function $(U,W){return z(U>>W&63|128)}function X(U){if((U&4294967168)==0)return z(U);let W="";if((U&4294965248)==0)W=z(U>>6&31|192);else if((U&4294901760)==0)Z(U),W=z(U>>12&15|224),W+=$(U,6);else if((U&4292870144)==0)W=z(U>>18&7|240),W+=$(U,12),W+=$(U,6);return W+=z(U&63|128),W}let Y=J(Q),G=Y.length,q=-1,H,_="";while(++q{let{content:Y,path:G,created:q}=Q,H=NV(q),_=gV(q),U=xX($),W=X!==void 0?X:Z,B=uV(G),E=B!==G,K="";if(E){let M=b0(1,1)+b0(xX(B),4)+B;K="up"+b0(M.length,2)+M}let L="\x14\x00"+(E?"\x00\b":"\x00\x00")+b0(z?8:0,2)+b0(H,2)+b0(_,2)+b0(W?U:0,4)+b0(X??Z,4)+b0(Z,4)+b0(B.length,2)+b0(K.length,2),F="PK\x03\x04"+L+B+K,D="PK\x01\x02\x14\x00"+L+"\x00\x00\x00\x00\x00\x00"+(Y?"\x00\x00\x00\x00":"\x10\x00\x00\x00")+b0(J,4)+B+K;return{localFileHeader:Uint8Array.from(F,(M)=>M.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(D,(M)=>M.charCodeAt(0))}},fY=(Q)=>{let z;if(typeof Q==="string"){let J=atob(Q.split(";base64,")[1]);z=Uint8Array.from(J,(Z)=>Z.charCodeAt(0))}else z=Q;return{size:z.length,content:z}},mV=async(Q)=>{let{content:z}=Q,{size:J,content:Z}=!z?{size:0,content:Uint8Array.from([])}:fY(z),$,X,Y=!1;if(Q.type==="file"&&Z&&J>0){let q=await wV(Z);$=q.content,X=q.size,Y=!0}return{rawContent:Z,rawSize:J,deflatedContent:$,deflatedSize:X,isCompressed:Y}},cV=(Q,z)=>{let{content:J}=Q,{content:Z}=!J?{content:Uint8Array.from([])}:fY(J);return{...VY(Q,!1,z,Z.length,Z,void 0),content:Z,isCompressed:!1}},pV=(Q,z,J)=>{let Z="PK\x05\x06\x00\x00\x00\x00"+b0(Q,2)+b0(Q,2)+b0(z,4)+b0(J,4)+"\x00\x00";return Uint8Array.from(Z,($)=>$.charCodeAt(0))},AY=class{constructor(){this.folders=[],this.files=[]}addFolders(Q){Q.forEach(this.addFolder.bind(this))}addFolder(Q){this.folders.push({path:Q,created:new Date,isBase64:!1,type:"folder"})}addFile(Q,z,J=!1){this.files.push({path:Q,created:new Date,content:J?z:new TextEncoder().encode(z),isBase64:J,type:"file"})}async getZipFile(Q="application/zip"){let z=await this.buildCompressedFileStream();return this.clearStream(),new Blob([z],{type:Q})}getUncompressedZipFile(Q="application/zip"){let z=this.buildFileStream();return this.clearStream(),new Blob([z],{type:Q})}clearStream(){this.folders=[],this.files=[]}packageFiles(Q){let z=0,J=0;for(let H of Q){let{localFileHeader:_,centralDirectoryHeader:U,content:W}=H;z+=_.length+W.length,J+=U.length}let Z=new Uint8Array(z),$=new Uint8Array(J),X=0,Y=0;for(let H of Q){let{localFileHeader:_,centralDirectoryHeader:U,content:W}=H;Z.set(_,X),X+=_.length,Z.set(W,X),X+=W.length,$.set(U,Y),Y+=U.length}let G=pV(Q.length,J,z),q=new Uint8Array(Z.length+$.length+G.length);return q.set(Z),q.set($,Z.length),q.set(G,Z.length+$.length),q}async buildCompressedFileStream(){let Q=[...this.folders,...this.files],z=await Promise.all(Q.map(mV)),J=[],Z=0;for(let $=0;${if(Q.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!Vz.size)return;Q.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let z=0;Vz.forEach((J)=>{let Z=J[0].image[0],{base64:$,imageType:X}=Z;Q.addFile(`xl/media/image${++z}.${K2(X)}`,$,!0)})},nV=(Q,z)=>{let J=0,Z=0;for(let $=0;$0&&fz.has($),G=wQ.size>0&&wQ.get($),q=Vz.size&&dQ.has($);if(!Y&&!G&&!q)continue;let H,_,U;if(Y)dV(Q,$,J),_=J,J++;if(q)tV(Q,$,Z),U=Z,Z++;if(G)H=G.name;let W=`xl/worksheets/_rels/sheet${$+1}.xml.rels`;Q.addFile(W,PV({tableName:H,drawingIndex:_,vmlDrawingIndex:U}))}},dV=(Q,z,J)=>{let $=`xl/drawings/drawing${J+1}.xml`,X=`xl/drawings/_rels/drawing${J+1}.xml.rels`;Q.addFile(X,RV(z)),Q.addFile($,jV(z))},tV=(Q,z,J)=>{let $=`xl/drawings/vmlDrawing${J+1}.vml`,X=`xl/drawings/_rels/vmlDrawing${J+1}.vml.rels`;Q.addFile($,SV(z)),Q.addFile(X,OV(z))},rV=(Q)=>{let z=wQ,J=Array.from(z.keys());for(let Z=0;Z{let Y=!!X&&Object.keys(X).some((G)=>X[G]!=null);if(Q.addFile("xl/workbook.xml",EV($)),Q.addFile("xl/styles.xml",KV(z)),Q.addFile("xl/sharedStrings.xml",LV()),Q.addFile("xl/theme/theme1.xml",VV()),Q.addFile("xl/_rels/workbook.xml.rels",AV(Z)),Q.addFile("docProps/core.xml",FV(J)),Y)Q.addFile("docProps/custom.xml",DV(X));Q.addFile("[Content_Types].xml",MV(Z,Y)),Q.addFile("_rels/.rels",kV(Y))},jY=(Q,z,J={},Z)=>{if(!z||z.length===0)return R(159),Z.reset(),!1;Z.syncOrderWithSheetData(z);let{fontSize:$=11,author:X="AG Grid",activeTab:Y=0,customMetadata:G}=J,q=z.length,H=Math.max(Math.min(Y,q-1),0);return iV(Q),rV(Q),nV(Q,z),sV(Q,$,X,q,H,G),Z.reset(),!0},wX=(Q,z=new Z7)=>{let{data:J,fontSize:Z,author:$,activeSheetIndex:X,customMetadata:Y}=Q,G=Q.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",q=new AY;if(!jY(q,J,{author:$,fontSize:Z,activeTab:X,customMetadata:Y},z))return Promise.resolve(void 0);return q.getZipFile(G)},NX=(Q,z=new Z7)=>{let{data:J,fontSize:Z,author:$,activeSheetIndex:X,customMetadata:Y}=Q,G=Q.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",q=new AY;if(!jY(q,J,{author:$,fontSize:Z,activeTab:X,customMetadata:Y},z))return;return q.getUncompressedZipFile(G)};var lV=class extends O6{constructor(){super(...arguments);this.beanName="excelCreator",this.workbook=new Z7}getMergedParams(Q){let z=this.gos.get("defaultExcelExportParams");return Object.assign({},z,Q)}export(Q){if(this.isExportSuppressed()){R(160);return}let z=()=>{let Z=this.getMergedParams(Q),$=this.getData(Z),{fontSize:X,author:Y,mimeType:G,customMetadata:q}=Z,H={data:[$],fontSize:X,author:Y,mimeType:G,customMetadata:q};this.packageCompressedFile(H).then((_)=>{if(_){let{fileName:U}=Z,W=typeof U==="function"?U(y(this.gos,{})):U;dZ(this.getFileName(W),_)}})},{overlays:J}=this.beans;if(J)J.showExportOverlay(z);else z()}exportDataAsExcel(Q){this.export(Q)}getDataAsExcel(Q){let z=this.getMergedParams(Q),J=this.getData(z),{fontSize:Z,author:$,mimeType:X,customMetadata:Y}=z,G={data:[J],fontSize:Z,author:$,mimeType:X,customMetadata:Y};return this.packageFile(G)}setFactoryMode(Q){this.workbook.setFactoryMode(Q)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(Q){let z=this.getMergedParams(Q);return this.getData(z)}getMultipleSheetsAsExcel(Q){return NX(Q,this.workbook)}exportMultipleSheetsAsExcel(Q){wX(Q,this.workbook).then((z)=>{let{fileName:J="export.xlsx"}=Q;if(z){let Z=typeof J==="function"?J():J;dZ(Z,z)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(Q){let{colModel:z,colNames:J,rowGroupColsSvc:Z,valueSvc:$,formula:X,gos:Y}=this.beans,G=Y.get("excelStyles")||[],q=this.createStyleLinker(G),H={...Q,colModel:z,colNames:J,rowGroupColsSvc:Z,valueSvc:$,formulaSvc:X,gos:Y,suppressRowOutline:Q.suppressRowOutline||Q.skipRowGroups,headerRowHeight:Q.headerRowHeight||Q.rowHeight,baseExcelStyles:G,rightToLeft:Q.rightToLeft??Y.get("enableRtl"),styleLinker:q,headerRowCount:i9(z),pivotModeActive:z.isPivotActive(),workbook:this.workbook};return new fD(H)}createStyleLinker(Q){let z=[],J=new Set,Z=new Map;Q.forEach((Y,G)=>{z.push(Y.id),J.add(Y.id),Z.set(Y.id,G)});let{gos:$,cellStyles:X}=this.beans;return(Y)=>{let{rowType:G,rowIndex:q,value:H,column:_,columnGroup:U,node:W}=Y,B=G==="HEADER",E=G==="HEADER_GROUPING",K=B?_:U,L=[];if(B||E){if(L.push("header"),E)L.push("headerGroup");if(K)L=L.concat(gZ(K.getDefinition(),$,_||null,U||null));return L}let F=["cell"];if(!z.length)return F;let D=_.getDefinition();return X?.processAllCellClasses(D,y($,{value:H,data:W.data,node:W,colDef:D,column:_,rowIndex:q}),(M)=>{if(J.has(M))F.push(M)}),F.sort((M,k)=>{let f=Z.get(M)??-1,A=Z.get(k)??-1;return f===A?0:fthis.onFocusIn(Q),onFocusOut:(Q)=>this.onFocusOut(Q),focusInnerElement:(Q)=>this.focusInnerElement(Q),onTabKeyDown:(Q)=>this.onTabKeyDown(Q),handleKeyDown:(Q)=>this.handleKeyDown(Q)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(Q){if(Q.listItemHeightChanged)this.rowHeight=this.getItemHeight(),this.refresh()}refreshAriaProperties(){let z=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),J=this.eContainer;H0(J,this.model?.getRowCount()>0?this.ariaRole:"presentation"),E0(J,z)}addResizeObserver(){let Q=()=>YQ(this.beans,()=>this.drawVirtualRows()),z=DQ(this.beans,this.getGui(),Q);this.addDestroyFunc(z)}focusInnerElement(Q){return this.focusRow(Q?this.model.getRowCount()-1:0),!0}onFocusIn(Q){let z=Q.target;if(z.classList.contains("ag-virtual-list-item"))this.lastFocusedRowIndex=j8(z)-1}onFocusOut(Q){if(!this.getFocusableElement().contains(Q.relatedTarget))this.lastFocusedRowIndex=null}handleKeyDown(Q){let{key:z,shiftKey:J}=Q;switch(z){case V.UP:case V.DOWN:{let Z=z===V.UP;if(Q.preventDefault(),J)this.moveItem(Z);else this.navigate(Z)}break;case V.PAGE_HOME:case V.PAGE_END:case V.PAGE_UP:case V.PAGE_DOWN:if(this.navigateToPage(z)!==null)Q.preventDefault();break}}onTabKeyDown(Q){this.stopPropagationCallbacks?.stopPropagation(Q),this.forceFocusOutOfContainer(Q.shiftKey)}getNextRow(Q){if(this.lastFocusedRowIndex==null)return;let z=this.lastFocusedRowIndex+(Q?-1:1);if(z<0||z>=this.model.getRowCount())return;return z}moveItem(Q){if(!this.moveItemCallback)return;let z=this.getComponentAt(this.lastFocusedRowIndex);if(!z)return;this.moveItemCallback(z,Q)}navigate(Q){let z=this.getNextRow(Q);if(z===void 0)return;this.focusRow(z)}navigateToPage(Q,z="focused"){let J=!1;if(z==="focused")z=this.getLastFocusedRow(),J=!0;let Z=this.model.getRowCount()-1,$=-1;if(Q===V.PAGE_HOME)$=0;else if(Q===V.PAGE_END)$=Z;else if(Q===V.PAGE_DOWN)$=Math.min(z+this.pageSize,Z);else if(Q===V.PAGE_UP)$=Math.max(z-this.pageSize,0);if($===-1)return null;if(J)this.focusRow($);else this.ensureIndexVisible($);return $}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(Q){if(this.isScrolling)return;this.isScrolling=!0,this.ensureIndexVisible(Q),YQ(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;let z=this.renderedRows.get(Q);if(z)z.eDiv.focus()})}getComponentAt(Q){let z=this.renderedRows.get(Q);return z&&z.rowComponent}forEachRenderedRow(Q){this.renderedRows.forEach((z,J)=>Q(z.rowComponent,J))}getItemHeight(){if(!this.isHeightFromTheme)return this.rowHeight;return this.beans.environment.getDefaultListItemHeight()}ensureIndexVisible(Q,z=!0){let J=this.model.getRowCount();if(typeof Q!=="number"||Q<0||Q>=J)return!1;let Z=Q*this.rowHeight,$=Z+this.rowHeight,X=this.getGui(),Y=X.scrollTop,G=X.offsetHeight,q=Y+G,H=z?0:this.rowHeight,_=Y>Z+H,U=q<$-H;if(_)return X.scrollTop=Z,!0;if(U){let W=$-G;return X.scrollTop=W,!0}return!1}setComponentCreator(Q){this.componentCreator=Q}setComponentUpdater(Q){this.componentUpdater=Q}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(Q){this.isHeightFromTheme=!1,this.rowHeight=Q,this.refresh()}refresh(Q){if(this.model==null||!this.isAlive())return;let z=this.model.getRowCount();this.eContainer.style.height=`${z*this.rowHeight}px`,this.refreshAriaProperties(),this.awaitStable(()=>{if(!this.isAlive())return;if(this.canSoftRefresh(Q))this.drawVirtualRows(!0);else this.clearVirtualRows(),this.drawVirtualRows()})}awaitStable(Q){if(this.awaitStableCallbacks.push(Q),this.awaitStableCallbacks.length>1)return;let z=this.model.getRowCount();C5(this,()=>this.eContainer.clientHeight>=z*this.rowHeight,()=>{if(!this.isAlive())return;let J=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(let Z of J)Z()})}canSoftRefresh(Q){return!!(Q&&this.renderedRows.size&&typeof this.model.areRowsEqual==="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((Q,z)=>this.removeRow(z))}drawVirtualRows(Q){if(!this.isAlive()||!this.model)return;let z=this.getGui(),J=z.scrollTop,Z=J+z.offsetHeight;if(J===Z)this.clearVirtualRows();else{let $=Math.floor(J/this.rowHeight),X=Math.floor(Z/this.rowHeight);this.pageSize=Math.floor((Z-J)/this.rowHeight),this.ensureRowsRendered($,X,Q)}}ensureRowsRendered(Q,z,J){if(this.renderedRows.forEach((Z,$)=>{if(($z)&&$!==this.lastFocusedRowIndex)this.removeRow($)}),J)this.refreshRows();for(let Z=Q;Z<=z;Z++){if(this.renderedRows.has(Z))continue;if(Z=z.getRowCount())return;let{cssIdentifier:J,ariaRole:Z,renderedRows:$,eContainer:X}=this,Y=z.getRow(Q),G=Z==="tree"?"treeitem":"option",q=K0({tag:"div",cls:`ag-virtual-list-item ag-${J}-virtual-list-item`,role:G,attrs:{tabindex:"-1"}});VZ(q,z.getRowCount()),fZ(q,Q+1);let H=this.rowHeight;q.style.height=`${H}px`,q.style.top=`${H*Q}px`;let _=this.componentCreator(Y,q);if(_.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=Q),q.appendChild(_.getGui()),$.has(Q-1))$.get(Q-1).eDiv.insertAdjacentElement("afterend",q);else if($.has(Q+1))$.get(Q+1).eDiv.insertAdjacentElement("beforebegin",q);else X.appendChild(q);$.set(Q,{rowComponent:_,eDiv:q,value:Y})}removeRow(Q){let z=this.renderedRows.get(Q);z.eDiv.remove(),this.destroyBean(z.rowComponent),this.renderedRows.delete(Q)}refreshRows(){let Q=this.model.getRowCount();this.renderedRows.forEach((z,J)=>{if(J>=Q)this.removeRow(J);else{let Z=this.model.getRow(J);if(this.model.areRowsEqual?.(z.value,Z))this.componentUpdater(Z,z.rowComponent);else this.removeRow(J)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(Q){this.model=Q}getAriaElement(){return this.eContainer}destroy(){if(!this.isAlive())return;this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy()}},Qf='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',m6="ag-list-item-hovered",zf=class extends j0{constructor(Q,z,J){super();this.comp=Q,this.virtualList=z,this.params=J,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(Qf,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(Q){this.currentDragValue=this.params.getCurrentDragValue(Q),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){let Q={isInterestedIn:(z)=>z===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:(z)=>this.onDragging(z),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(Q)}createAutoScrollService(){let Q=this.virtualList.getGui();this.autoScrollService=new mZ({scrollContainer:Q,scrollAxis:"y",getVerticalPosition:()=>Q.scrollTop,setVerticalPosition:(z)=>Q.scrollTop=z})}onDragging(Q){if(!this.currentDragValue||this.moveBlocked)return;let z=this.getListDragItem(Q),J=this.virtualList.getComponentAt(z.rowIndex);if(!J)return;let Z=J.getGui().parentElement;if(this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===z.rowIndex&&this.lastHoveredListItem.position===z.position)return;this.autoScrollService.check(Q.event),this.clearHoveredItems(),this.lastHoveredListItem=z,P5(Z,m6),P5(Z,`ag-item-highlight-${z.position}`)}getListDragItem(Q){let z=this.virtualList.getGui(),J=Number.parseFloat(window.getComputedStyle(z).paddingTop),Z=this.virtualList.getRowHeight(),$=this.virtualList.getScrollTop(),X=Math.max(0,(Q.y-J+$)/Z),Y=this.params.getNumRows(this.comp)-1,G=Math.min(Y,X)|0;return{rowIndex:G,position:Math.round(X)>X||X>Y?"bottom":"top",component:this.virtualList.getComponentAt(G)}}onDragStop(){if(this.moveBlocked)return;this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties()}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){let Q=this.virtualList.getGui();for(let z of Q.querySelectorAll(`.${m6}`))for(let J of[m6,"ag-item-highlight-top","ag-item-highlight-bottom"])z.classList.remove(J);this.lastHoveredListItem=null}};var Jf=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function Zf(Q){return Q??(Q=Q||"default"),{tag:"div",cls:`ag-panel ag-${Q}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${Q}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${Q}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${Q}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${Q}-panel-content-wrapper`}]}}var $f=class extends p0{constructor(Q){super(Zf(Q.cssIdentifier));this.config=Q,this.closable=!0,this.eContentWrapper=S,this.eTitleBar=S,this.eTitleBarButtons=S,this.eTitle=S,this.registerCSS(Jf)}postConstruct(){let{component:Q,closable:z,hideTitleBar:J,title:Z,minWidth:$=250,width:X,minHeight:Y=250,height:G,centered:q,popup:H,x:_,y:U,postProcessPopupParams:W}=this.config,B=this.beans,E=this.createManagedBean(new r5(this.getGui(),{minWidth:$,width:X,minHeight:Y,height:G,centered:q,x:_,y:U,popup:H,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=E;let K=this.getGui();if(Q)this.setBodyComponent(Q);if(!J){if(Z)this.setTitle(Z);this.setClosable(z!=null?z:this.closable)}else N(this.eTitleBar,!1);if(this.addManagedElementListeners(this.eTitleBar,{mousedown:(F)=>{if(K.contains(F.relatedTarget)||K.contains(d(B))||this.eTitleBarButtons.contains(F.target)){F.preventDefault();return}let D=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");if(D)D.focus()}}),H&&E.isPositioned())return;if(this.renderComponent)this.renderComponent();let L;if(W){let{type:F,eventSource:D,mouseEvent:M}=W;L=()=>B.popupSvc?.callPostProcessPopup(W,F,K,D,M)}E.initialisePosition(L),this.eContentWrapper.style.height="0"}renderComponent(){let Q=this.getGui();Q.focus(),this.close=()=>{Q.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(Q){this.positionableFeature.setHeight(Q)}getWidth(){return this.positionableFeature.getWidth()}setWidth(Q){this.positionableFeature.setWidth(Q)}setClosable(Q){if(Q!==this.closable)this.closable=Q;if(Q){let z=this.closeButtonComp=new p0({tag:"div",cls:"ag-button"});this.createBean(z);let J=z.getGui(),Z=this.beans.iconSvc.createIconNoSpan("close",this.beans);Z.classList.add("ag-panel-title-bar-button-icon"),J.appendChild(Z),this.addTitleBarButton(z),z.addManagedElementListeners(J,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp)this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}setBodyComponent(Q){Q.setParentComponent(this),this.eContentWrapper.appendChild(Q.getGui())}addTitleBarButton(Q,z){let J=this.eTitleBarButtons,Z=J.children,$=Z.length;if(z==null)z=$;z=Math.max(0,Math.min(z,$)),Q.addCss("ag-panel-title-bar-button");let X=Q.getGui();if(z===0)J.prepend(X);else if(z===$)J.append(X);else Z[z-1].after(X);Q.setParentComponent(this)}getBodyHeight(){return AZ(this.eContentWrapper)}getBodyWidth(){return xz(this.eContentWrapper)}setTitle(Q){this.eTitle.innerText=Q}onBtClose(){this.close()}destroy(){if(this.closeButtonComp)this.closeButtonComp=this.destroyBean(this.closeButtonComp);let Q=this.getGui();if(Q&&f0(Q))this.close();super.destroy()}},Xf=class extends $f{constructor(Q,z){super({...Q,popup:!0});this.callbacks=z,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(Q){this.popupSvc=Q.popupSvc}postConstruct(){let Q=this.getGui(),{movable:z,resizable:J,maximizable:Z,modal:$}=this.config;if(this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new H6(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(Q)},onTabKeyDown:(X)=>{if($)return;let Y=X.shiftKey,G=R0(this.beans,Q,!1,Y);if(!G||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(G)){if(this.callbacks?.focusNextContainer(this.beans,Y))X.preventDefault()}}}),z)this.setMovable(z);if(Z)this.setMaximizable(Z);if(J)this.setResizable(J);if(!this.config.modal)this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(Q){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(Q)}renderComponent(){let Q=this.getGui(),{alwaysOnTop:z,modal:J,title:Z,afterGuiAttached:$}=this.config,X=this.getLocaleTextFunc(),Y=this.popupSvc?.addPopup({modal:J,eChild:Q,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:z,ariaLabel:Z||X("ariaLabelDialog","Dialog"),afterGuiAttached:$});if(Y)this.close=Y.hideFunc}onClosed(Q){this.destroy(),this.config.closedCallback?.(Q)}setMaximized(Q){if(this.isMaximizable&&Q!==this.isMaximized)this.toggleMaximize()}toggleMaximize(){let Q=this.positionableFeature.getPosition();if(this.isMaximized){let{x:z,y:J,width:Z,height:$}=this.lastPosition;this.setWidth(Z),this.setHeight($),this.positionableFeature.offsetElement(z,J)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=Q.x,this.lastPosition.y=Q.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){N(this.maximizeIcon,!this.isMaximized),N(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(let Q of this.maximizeListeners)Q();this.maximizeListeners.length=0}if(this.resizeListenerDestroy)this.resizeListenerDestroy(),this.resizeListenerDestroy=null}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(Q){this.positionableFeature.setResizable(Q)}setMovable(Q){this.positionableFeature.setMovable(Q,this.eTitleBar)}setMaximizable(Q){if(!Q){if(this.clearMaximizebleListeners(),this.maximizeButtonComp)this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0;return}let z=this.eTitleBar;if(!z||Q===this.isMaximizable)return;this.isMaximizable=Q;let J=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),J.addManagedElementListeners(J.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(J,0),this.maximizeListeners.push(...this.addManagedElementListeners(z,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){let Q=this.maximizeButtonComp=this.createBean(new p0({tag:"div",cls:"ag-dialog-button"})),z=Q.getGui(),J=this.beans.iconSvc;return this.maximizeIcon=J.createIconNoSpan("maximize"),z.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=J.createIconNoSpan("minimize"),z.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),Q}};var Yf=class extends pQ{constructor(Q){super();this.setTemplateFromElement(Q.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(Q)=>this.onTabKeyDown(Q),handleKeyDown:(Q)=>this.handleKeyDown(Q)})}handleKeyDown(Q){if(Q.key===V.ESCAPE)this.closePanel()}onTabKeyDown(Q){if(Q.defaultPrevented)return;this.closePanel(),Q.preventDefault()}closePanel(){let Q=this.parentComponent;Q.closeSubMenu(),setTimeout(()=>Q.getGui().focus(),0)}},o6=class extends j0{constructor(Q){super();this.callbacks=Q,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(Q){let{menuItemDef:z,isAnotherSubMenuOpen:J,level:Z,childComponent:$,contextParams:X}=Q;return this.params=Q.menuItemDef,this.level=Z,this.isAnotherSubMenuOpen=J,this.childComponent=$,this.contextParams=X,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...z,level:Z,isAnotherSubMenuOpen:J,openSubMenu:(Y)=>this.openSubMenu(Y),closeSubMenu:()=>this.closeSubMenu(),closeMenu:(Y)=>this.closeMenu(Y),updateTooltip:(Y,G)=>this.refreshTooltip(Y,G),onItemActivated:()=>this.onItemActivated()}).then((Y)=>{if(!Y)return;this.menuItemComp=Y;let G=Y.configureDefaults?.();if(G)this.configureDefaults(G===!0?void 0:G)})}addListeners(Q,z){if(!z?.suppressClick)this.addManagedElementListeners(Q,{click:(J)=>this.onItemSelected(J)});if(!z?.suppressKeyboardSelect)this.addManagedElementListeners(Q,{keydown:(J)=>{if(J.key===V.ENTER||J.key===V.SPACE)J.preventDefault(),this.onItemSelected(J)}});if(!z?.suppressMouseDown)this.addManagedElementListeners(Q,{mousedown:(J)=>{J.stopPropagation(),J.preventDefault()}});if(!z?.suppressMouseOver)this.addManagedElementListeners(Q,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(Q=!1,z){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;let J=Z0({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=J;let Z,$=()=>{this.subMenuIsOpening=!1};if(this.childComponent){let H=this.createBean(new Yf(this.childComponent));H.setParentComponent(this);let _=H.getGui(),U="mouseenter",W=()=>this.cancelDeactivate();if(_.addEventListener(U,W),Z=()=>{_.removeEventListener(U,W),this.destroyBean(H)},J.appendChild(_),this.childComponent.afterGuiAttached)$=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1}}else if(this.params.subMenu){let H=this.createBean(new RY(this.level+1,this.contextParams,this.callbacks));if(H.setParentComponent(this),H.addMenuItems(this.params.subMenu),J.appendChild(H.getGui()),this.addManagedListeners(H,{closeMenu:(_)=>this.dispatchLocalEvent(_)}),H.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),Z=()=>this.destroyBean(H),Q)$=()=>{H.activateFirstItem(),this.subMenuIsOpening=!1}}let X=this.beans.popupSvc,Y=()=>{let H=this.eGui;X?.positionPopupForMenu({eventSource:H,ePopup:J,event:z instanceof MouseEvent?z:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},G=this.getLocaleTextFunc(),q=X?.addPopup({modal:!0,eChild:J,positionCallback:Y,anchorToElement:this.eGui,ariaLabel:G("ariaLabelSubMenu","SubMenu"),afterGuiAttached:$});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{if(q)q.hideFunc();this.subMenuIsOpen=!1,this.setAriaExpanded(!1),Z(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(Q){if(!this.suppressAria)w0(this.eGui,Q)}closeSubMenu(){if(!this.hideSubMenu)return;this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1)}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(Q,z){if(this.cancelActivate(),this.params.disabled&&!z)return;if(this.isActive=!0,!this.suppressRootStyles)this.eGui.classList.add(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!0),!this.suppressFocus)this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!z}));if(Q&&this.params.subMenu)window.setTimeout(()=>{if(this.isAlive()&&this.isActive)this.openSubMenu()},300);this.onItemActivated()}deactivate(){if(this.cancelDeactivate(),!this.suppressRootStyles)this.eGui.classList.remove(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen)this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(Q){this.parentComponent=Q}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(Q){if(this.menuItemComp.select?.(),this.params.action)this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams})));else this.openSubMenu(Q&&Q.type==="keydown",Q);if(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)return;this.closeMenu(Q)}closeMenu(Q){let z={type:"closeMenu"};if(Q)if(Q instanceof MouseEvent)z.mouseEvent=Q;else z.keyboardEvent=Q;this.dispatchLocalEvent(z)}onItemActivated(){let Q={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(Q)}cancelActivate(){if(this.activateTimeoutId)window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0}cancelDeactivate(){if(this.deactivateTimeoutId)window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0}onMouseEnter(){if(this.cancelDeactivate(),this.isAnotherSubMenuOpen())this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY);else this.activate(!0)}onMouseLeave(){if(this.cancelActivate(),this.isSubMenuOpen())this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY);else this.deactivate()}refreshRootElementGui(Q){let z=this.menuItemComp.getGui(),{cssClassPrefix:J,params:{cssClasses:Z,disabled:$}}=this,X=this.menuItemComp.getRootElement?.();if(X){if(!Q)z.classList.add("ag-menu-option-custom");z=X}if(this.suppressRootStyles=!!Q,!this.suppressRootStyles){z.classList.add(J);for(let Y of Z??[])z.classList.add(Y);if($)z.classList.add(`${J}-disabled`)}return z}applyAriaProperties(Q){let{params:{checked:z,subMenu:J,subMenuRole:Z,disabled:$}}=this,X=z!=null;if(H0(Q,X?"menuitemcheckbox":"menuitem"),J)b8(Q,Z??"menu");if($)P8(Q,!0)}configureDefaults(Q){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(Q));return}let{suppressRootStyles:z,suppressTooltip:J,suppressAria:Z,suppressTabIndex:$,suppressFocus:X}=Q||{},{params:{tooltip:Y,disabled:G}}=this,q=this.eGui=this.refreshRootElementGui(!!z);if(this.suppressAria=!!Z,!Z)this.applyAriaProperties(q);if(!$)q.setAttribute("tabindex","-1");if(!J)this.refreshTooltip(Y);if(!G)this.addListeners(q,Q);this.suppressFocus=!!X}refreshTooltip(Q,z){if(this.tooltip=Q,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!Q||!this.menuItemComp)return;let J=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:z});if(J)this.tooltipFeature=this.createBean(J)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},RY=class extends pQ{constructor(Q=0,z,J){super({tag:"div",cls:"ag-menu-list",role:"menu"});this.level=Q,this.menuActionParams=z,this.callbacks=J,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(Q)=>this.onTabKeyDown(Q),handleKeyDown:(Q)=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(Q)),onFocusIn:(Q)=>this.handleFocusIn(Q),onFocusOut:(Q)=>this.handleFocusOut(Q)})}onTabKeyDown(Q){if(!this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed"))Q.preventDefault();if(Q.shiftKey)this.closeIfIsChild(Q)}handleKeyDown(Q){switch(Q.key){case V.UP:case V.RIGHT:case V.DOWN:case V.LEFT:Q.preventDefault(),this.handleNavKey(Q.key);break;case V.ESCAPE:if(this.closeIfIsChild())this.callbacks.stopPropagationCallbacks.stopPropagation(Q);break}}handleFocusIn(Q){let z=Q.relatedTarget;if(!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(z)&&(this.getGui().contains(z)||this.activeMenuItem?.getSubMenuGui()?.contains(z)))return;if(this.activeMenuItem)this.activeMenuItem.activate();else this.activateFirstItem()}handleFocusOut(Q){let z=Q.relatedTarget;if(!this.activeMenuItem||this.getGui().contains(z)||this.activeMenuItem.getSubMenuGui()?.contains(z))return;if(!this.activeMenuItem.isSubMenuOpening())this.activeMenuItem.deactivate()}clearActiveItem(){if(this.activeMenuItem)this.activeMenuItem.deactivate(),this.activeMenuItem=null}addMenuItems(Q){if(Q==null)return;g.all(Q.map((z)=>{if(z==="separator")return g.resolve({eGui:this.createSeparator()});else if(typeof z==="string")return this.callbacks.warnNoItem?.(z),g.resolve({eGui:null});else return this.addItem(z)})).then((z)=>{for(let J of z??[])if(J?.eGui){if(this.appendChild(J.eGui),J.comp)this.menuItems.push(J.comp)}})}addItem(Q){let z=this.createManagedBean(new o6(this.callbacks));return z.init({menuItemDef:Q,isAnotherSubMenuOpen:()=>this.menuItems.some((J)=>J.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>{return z.setParentComponent(this),this.addManagedListeners(z,{closeMenu:(J)=>{this.dispatchLocalEvent(J)},menuItemActivated:(J)=>{if(this.activeMenuItem&&this.activeMenuItem!==J.menuItem)this.activeMenuItem.deactivate();this.activeMenuItem=J.menuItem}}),{comp:z,eGui:z.getGui()}})}activateFirstItem(){let Q=this.menuItems.filter((z)=>!z.isDisabled())[0];if(!Q)return;Q.activate()}createSeparator(){let Q={tag:"div",cls:"ag-menu-separator-part"};return K0({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[Q,Q,Q,Q]})}handleNavKey(Q){switch(Q){case V.UP:case V.DOWN:{let J=this.findNextItem(Q===V.UP);if(J&&J!==this.activeMenuItem)J.activate(!1,!0);return}}let z=this.gos.get("enableRtl")?V.RIGHT:V.LEFT;if(Q===z)this.closeIfIsChild();else this.openChild()}closeIfIsChild(Q){let z=this.getParentComponent();if(z&&z instanceof o6){if(Q)Q.preventDefault();return z.closeSubMenu(),z.getGui().focus(),!0}return!1}openChild(){if(this.activeMenuItem)this.activeMenuItem.openSubMenu(!0)}findNextItem(Q){let z=[...this.menuItems];if(!z.length)return;if(!this.activeMenuItem)return Q?b(z):z[0];if(Q)z.reverse();let J,Z=!1;for(let $ of z){if(!Z){if($===this.activeMenuItem)Z=!0;continue}J=$;break}if(Z&&!J)return z[0];return J||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};var Gf=class extends p0{constructor(Q){super({tag:"div"});this.callbacks=Q}init(Q){this.params=Q,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){let{checked:Q,subMenu:z}=this.params,J=this.getGui();if(Q)I8(J,Q);if(z)w0(J,!1)}addIcon(){if(this.params.isCompact)return;let Q=K0({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:z,icon:J}=this.params;if(z)Q.appendChild(this.beans.iconSvc.createIconNoSpan("check"));else if(J)if(XJ(J))Q.appendChild(J);else if(typeof J==="string")Q.innerHTML=J;else this.callbacks?.warnNoIcon?.();this.getGui().appendChild(Q)}addName(){let Q=K0({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(Q)}addShortcut(){if(this.params.isCompact)return;let Q=K0({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(Q)}addSubMenu(){let Q=K0({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),z=this.getGui();if(this.params.subMenu){let J=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";Q.appendChild(this.beans.iconSvc.createIconNoSpan(J))}z.appendChild(Q)}getClassName(Q){return`${this.cssClassPrefix}-${Q}`}};function e6(Q,z){if(!z)return null;let J=EQ(Q),Z=J.indexOf(z);if(Z===-1)return null;let $=-1;for(let X=Z-1;X>=0;X--)if(J[X].classList.contains(g1.TAB_GUARD_TOP)){$=X;break}if($<=0)return null;return J[$-1]}function SY(Q,z){if(!z)return!1;let J=Q.querySelectorAll(`.${l5}`);if(!J.length)return!1;for(let Z=0;Zthis.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){let{enableCloseButton:Q,cssClass:z}=this.params,J=(Z,$)=>{if(Z.classList.add(`ag-tabs-${$}`),z)Z.classList.add(`${z}-${$}`)};if(Q)this.setupCloseButton(J),this.eTabHeader=K0({tag:"div",role:"presentation"}),J(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader);else this.eTabHeader=this.eHeader;H0(this.eTabHeader,"tablist"),J(this.eTabHeader,"header")}setupCloseButton(Q){let z=K0({tag:"button"});Q(z,"close-button");let J=this.beans.iconSvc.createIconNoSpan("close");E0(z,this.params.closeButtonAriaLabel),z.appendChild(J),this.addManagedElementListeners(z,{click:()=>this.params.onCloseClicked?.()});let Z=K0({tag:"div",role:"presentation"});Q(Z,"close-button-wrapper"),Z.appendChild(z),this.eHeader.appendChild(Z),this.eCloseButton=z}handleKeyDown(Q){switch(Q.key){case V.RIGHT:case V.LEFT:{if(!this.eTabHeader.contains(d(this.beans)))return;let z=Q.key===V.RIGHT,J=this.gos.get("enableRtl"),Z=this.items.indexOf(this.activeItem),$=z!==J?Math.min(Z+1,this.items.length-1):Math.max(Z-1,0);if(Z===$)return;Q.preventDefault();let X=this.items[$];this.showItemWrapper(X),X.eHeaderButton.focus();break}case V.UP:case V.DOWN:Q.stopPropagation();break}}onTabKeyDown(Q){if(Q.defaultPrevented)return;let{beans:z,eHeader:J,eBody:Z,activeItem:$,params:X}=this,{suppressTrapFocus:Y,enableCloseButton:G}=X,q=d(z),H=Q.target,_=Q.shiftKey;if(J.contains(q)){if(Q.preventDefault(),G&&_&&!this.eCloseButton?.contains(q))this.eCloseButton?.focus();else if(Y&&_)e6(Y0(z).body,H)?.focus();else this.focusBody(Q.shiftKey);return}let U=null;if(SY(Z,H)){if(_)U=e6(Z,H);if(!U&&!Y)U=$.eHeaderButton}if(!U&&Z.contains(q)){if(U=R0(z,Z,!1,_),!U){if(Y&&!_)this.forceFocusOutOfContainer(_);else if(G&&!_)Q.preventDefault(),this.eCloseButton?.focus();else Q.preventDefault(),this.focusHeader();return}}if(U)Q.preventDefault(),U.focus()}focusInnerElement(Q){if(Q)return this.focusBody(!0);else return this.focusHeader(),!0}focusHeader(Q){this.activeItem.eHeaderButton.focus({preventScroll:Q})}focusBody(Q){return D0(this.eBody,Q)}setAfterAttachedParams(Q){this.afterAttachedParams=Q}showFirstItem(){if(this.items.length>0)this.showItemWrapper(this.items[0])}addItem(Q){let z=K0({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});z.appendChild(Q.title),this.eTabHeader.appendChild(z),E0(z,Q.titleLabel);let J={tabbedItem:Q,eHeaderButton:z};this.items.push(J),z.addEventListener("click",this.showItemWrapper.bind(this,J))}showItem(Q){let z=this.items.find((J)=>J.tabbedItem===Q);if(z)this.showItemWrapper(z)}showItemWrapper(Q){let{tabbedItem:z,eHeaderButton:J}=Q;if(this.params.onItemClicked?.({item:z}),this.activeItem===Q){this.params.onActiveItemClicked?.();return}if(this.lastScrollListener)this.lastScrollListener=this.lastScrollListener();if(z0(this.eBody),z.bodyPromise.then((Z)=>{this.eBody.appendChild(Z);let $=!V1();if(!this.params.suppressFocusBodyOnOpen)D0(this.eBody,!1,$);if(z.afterAttachedCallback)z.afterAttachedCallback(this.afterAttachedParams);if(this.params.keepScrollPosition){let X=z.getScrollableContainer?.()||Z;[this.lastScrollListener]=this.addManagedElementListeners(X,{scroll:()=>{this.tabbedItemScrollMap.set(z.name,X.scrollTop)}});let Y=this.tabbedItemScrollMap.get(z.name);if(Y!==void 0)setTimeout(()=>{X.scrollTop=Y},0)}}),this.activeItem)this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.();J.classList.add("ag-tab-selected"),this.activeItem=Q}},_f=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function Uf(Q){let z=Q.cssIdentifier||"default",J=Q.direction||"vertical";return{tag:"div",cls:`ag-group ag-${z}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${z}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${J} ag-${z}-group-container`}]}}var Wf=class extends p0{constructor(Q={}){super(Uf(Q),[yQ]);this.params=Q,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=S,this.cbGroupEnabled=S,this.eContainer=S,this.registerCSS(_f);let{enabled:z,items:J,suppressEnabledCheckbox:Z,expanded:$,suppressToggleExpandOnEnableChange:X,useToggle:Y}=Q;if(this.cssIdentifier=Q.cssIdentifier||"default",this.enabled=z!=null?z:!0,this.items=J||[],this.useToggle=Y??!1,this.alignItems=Q.alignItems||"center",this.expanded=$==null?!0:$,Z!=null)this.suppressEnabledCheckbox=Z;if(X!=null)this.suppressToggleExpandOnEnableChange=X}postConstruct(){if(this.setupTitleBar(),this.items.length){let $=this.items;this.items=[],this.addItems($)}let Q=this.getLocaleTextFunc();if(this.cbGroupEnabled.setLabel(Q("enabled","Enabled")),this.enabled)this.setEnabled(this.enabled,void 0,!0);this.setAlignItems(this.alignItems);let{onEnableChange:z,onExpandedChange:J,suppressOpenCloseIcons:Z}=this.params;if(this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(Z??!1),this.refreshChildDisplay(),N(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(($)=>{this.setEnabled($,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent($)}),z!=null)this.onEnableChange(z);if(J!=null)this.onExpandedChange(J)}refreshChildDisplay(){N(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(Q){if(this.alignItems!==Q)this.removeCss(`ag-group-item-alignment-${this.alignItems}`);this.alignItems=Q;let z=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(z),this}toggleGroupExpand(Q,z){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)Q=!0,z=!0;else if(Q=Q!=null?Q:!this.expanded,this.expanded===Q)return this;if(this.expanded=Q,this.refreshChildDisplay(),N(this.eContainer,Q),!z)this.dispatchLocalEvent({type:Q?"expanded":"collapsed"});return this}addItems(Q){for(let z of Q)this.addItem(z)}prependItem(Q){this.insertItem(Q,!0)}addItem(Q){this.insertItem(Q,!1)}updateItems(Q){let z=this.items,J=0;for(let Z=0;ZQ(z.enabled)}),this}onExpandedChange(Q){return this.addManagedListeners(this,{expanded:()=>Q(!0),collapsed:()=>Q(!1)}),this}hideEnabledCheckbox(Q){return this.suppressEnabledCheckbox=Q,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(Q){return this.eTitleBar?.hideOpenCloseIcons(Q),this}refreshDisabledStyles(){let Q=!this.enabled;this.eContainer.classList.toggle("ag-disabled",Q),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&Q),this.eContainer.classList.toggle("ag-disabled-group-container",Q)}setupTitleBar(){let Q=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",Q.getGui())}createDefaultTitleBar(){let Q=this.createManagedBean(new Ef(this.params));return this.eTitleBar=Q,Q.refreshOnExpand(this.expanded),this.addManagedListeners(Q,{expandedChanged:(z)=>this.toggleGroupExpand(z.expanded)}),Q}createToggleTitleBar(){let Q=this.createManagedBean(new N6({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:(z)=>{this.setEnabled(z,!0),this.dispatchEnableChangeEvent(z)}}));return Q.addCss("ag-group-title-bar"),Q.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=Q,this.toggleGroupExpand(this.enabled),Q}},c6="ag-disabled-group-title-bar";function Bf(Q){let z=Q.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${z}-group-title-bar ag-unselectable`,role:Q.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${z}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${z}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${z}-group-title`}]}}var Ef=class extends p0{constructor(Q={}){super(Bf(Q));this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=S,this.eGroupClosedIcon=S,this.eTitle=S;let{title:z,suppressOpenCloseIcons:J,suppressKeyboardNavigation:Z}=Q;if(!!z&&z.length>0)this.title=z;if(J!=null)this.suppressOpenCloseIcons=J;this.suppressKeyboardNavigation=Z??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){let Q=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(Q.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(Q.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:(z)=>{switch(z.key){case V.ENTER:case V.SPACE:z.preventDefault(),this.dispatchExpandChanged();break;case V.RIGHT:case V.LEFT:z.preventDefault(),this.dispatchExpandChanged(z.key===V.RIGHT);break}}})}refreshOnExpand(Q){this.refreshAriaStatus(Q),this.refreshOpenCloseIcons(Q)}refreshAriaStatus(Q){if(!this.suppressOpenCloseIcons)w0(this.getGui(),Q)}refreshOpenCloseIcons(Q){let z=!this.suppressOpenCloseIcons;N(this.eGroupOpenedIcon,z&&Q),N(this.eGroupClosedIcon,z&&!Q)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(Q){let z={type:"expandedChanged",expanded:Q};this.dispatchLocalEvent(z)}setTitle(Q){let z=this.getGui(),J=!!Q&&Q.length>0;if(Q=J?Q:void 0,this.eTitle.textContent=Q??"",N(z,J),Q!==this.title)this.title=Q;let Z=z.classList.contains(c6);return this.refreshDisabledStyles(Z),this}addWidget(Q){return this.getGui().appendChild(Q),this}hideOpenCloseIcons(Q){if(this.suppressOpenCloseIcons=Q,Q)this.dispatchExpandChanged(!0);return this}refreshDisabledStyles(Q){let z=this.getGui();if(Q)z.classList.add(c6),z.removeAttribute("tabindex"),H0(z,"presentation");else if(z.classList.remove(c6),typeof this.title==="string"&&!this.suppressKeyboardNavigation)this.activateTabIndex([z]),H0(z,"group");else z.removeAttribute("tabindex"),H0(z,"presentation")}};var J0="35.2.0",I0={moduleName:"EnterpriseCore",version:J0,beans:[PX],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:PX.setLicenseKey};var Kf={stopPropagationCallbacks:Uz,focusNextContainer:(Q,z)=>{return $Q(Q,z)},configureFocusableContainer:(Q,z)=>{let J=Q.ctrlsSvc.get("gridCtrl");J.addFocusableContainer(z),z.addDestroyFunc(()=>J.removeFocusableContainer(z))}},Lf=class extends Xf{constructor(Q){super(Q,Kf)}getFocusableContainerName(){return"dialog"}};var OY=class extends eV{constructor(Q){super(Uz,Q)}};var Ff=class extends zf{};function Df(Q){return Q.sideBar?.comp.isDisplayed()??!1}function Mf(Q,z){Q.sideBar?.comp.setDisplayed(z)}function kf(Q,z){Q.sideBar?.comp.setSideBarPosition(z)}function Vf(Q,z,J){Q.sideBar?.comp.openToolPanel(z,"api",J)}function ff(Q){Q.sideBar?.comp.close("api")}function Af(Q){return Q.sideBar?.comp.openedItem()??null}function jf(Q){Q.sideBar?.comp.refresh()}function Rf(Q){return Q.sideBar?.comp.isToolPanelShowing()??!1}function Sf(Q,z){let J=Q.sideBar?.comp.getToolPanelInstance(z);return mQ(J)}function Of(Q){return Q.sideBar?.comp.getDef()}var Pf=`.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{ + /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}`,Tf={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},vf=class extends x{constructor(Q){super();this.toolPanelDef=Q,this.eToggleButton=S,this.eIconWrapper=S,this.eLabel=S}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(Tf,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){let Q=this.toolPanelDef,z=this.getLocaleTextFunc()(Q.labelKey,Q.labelDefault);this.eLabel.textContent=z}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",h(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(Q){this.toggleCss("ag-selected",Q),w0(this.eToggleButton,Q)}},If={tag:"div",cls:"ag-side-buttons",role:"tablist"},Cf=class extends x{constructor(){super(If);this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(Q){if(Q.key!==V.TAB||!Q.shiftKey)return;if($Q(this.beans,!0)){Q.preventDefault();return}i0(Q)}setActiveButton(Q){for(let z of this.buttonComps)z.setSelected(Q===z.getToolPanelId())}addButtonComp(Q){let z=this.createBean(new vf(Q));return this.buttonComps.push(z),this.appendChild(z),z.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:Q.id})}),z}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),z0(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},bf={selector:"AG-SIDE-BAR-BUTTONS",component:Cf},PY={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},TY={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},yf={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},SJ={columns:PY,filters:TY,"filters-new":yf};function Q7(Q){if(!Q)return;if(Q===!0)return{toolPanels:[PY,TY],defaultToolPanel:"columns"};if(typeof Q==="string")return Q7([Q]);if(Array.isArray(Q)){let z=[];for(let J of Q){let Z=SJ[J];if(!Z){R(215,{key:J,defaultByKey:SJ});continue}z.push(Z)}if(z.length===0)return;return{toolPanels:z,defaultToolPanel:z[0].id}}return{toolPanels:xf(Q.toolPanels),defaultToolPanel:Q.defaultToolPanel,hiddenByDefault:Q.hiddenByDefault,position:Q.position,hideButtons:Q.hideButtons}}function xf(Q){let z=[];if(!Q)return z;return Q.forEach((J)=>{let Z=wf(J);if(!Z)return;z.push(Z)}),z}function wf(Q){if(typeof Q!=="string")return Q;if(SJ[Q])return SJ[Q];return R(215,{key:Q,defaultByKey:SJ}),null}var Nf=class extends x{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"});this.minWidth=100,this.maxWidth=null}postConstruct(){let Q=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(Q),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(Q,z,J){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:J,started:Q,ended:z})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(Q){return this.onResizing(Q,!0)}onResizing(Q,z=!1){let J=this.inverted?-1:1,Z=Math.max(this.minWidth,Math.floor(this.startingWidth-Q*J));if(this.maxWidth!=null)Z=Math.min(this.maxWidth,Z);this.elementToResize.style.setProperty("--ag-horizontal-size",`${Z}px`),this.dispatchResizeEvent(!1,z,Z)}};function gf(Q,z,J){return Q.getCompDetails(z,hf,void 0,J,!0)}var hf={name:"toolPanel",optionalMethods:["refresh","getState"]},uf={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},mf=class extends x{constructor(){super(uf);this.eContent=S,this.animationId=0,this.defParent=null}postConstruct(){let Q=this.getGui(),z=this.resizeBar=this.createManagedBean(new Nf);Q.setAttribute("id",`ag-${this.getCompId()}`),z.elementToResize=Q,this.appendChild(z)}getToolPanelId(){return this.toolPanelId}getDefParent(){return this.defParent}setDefParent(Q){this.defParent=Q}setToolPanelDef(Q,z){let{id:J,minWidth:Z,maxWidth:$,width:X,parent:Y}=Q;if(this.toolPanelId=J,this.defParent=Y??null,X)this.getGui().style.setProperty("--ag-side-bar-panel-width",`${X}px`);let G=gf(this.beans.userCompFactory,Q,z);if(G==null)return!1;let q=G.newAgStackInstance();this.params=G.params,q.then(this.setToolPanelComponent.bind(this));let H=this.resizeBar;if(Z!=null)H.minWidth=Z;if($!=null)H.maxWidth=$;return!0}setToolPanelComponent(Q){this.toolPanelCompInstance=Q;let{eContent:z}=this;z.appendChild(Q.getGui()),this.addDestroyFunc(()=>{this.destroyBean(Q)})}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(Q){let z=this.gos.get("enableRtl"),J=Q==="left",Z=z?J:!J;this.resizeBar.inverted=Z}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(Q){if(this.isDisplayed()===Q)return;let z=++this.animationId,{eContent:J}=this,Z=()=>{if(this.animationId===z)$.classList.remove("ag-tool-panel-animating"),J.style.width="",$.style.width=""},$=this.getGui(),X=$.offsetWidth;this.setDisplayed(Q),$.classList.add("ag-tool-panel-animating");let Y=getComputedStyle($).transitionDuration;if(!parseFloat(Y)){Z();return}$.style.transition="none",$.style.width="",J.style.width=`${J.offsetWidth}px`,$.style.width=`${X}px`;let G=$.offsetWidth;$.style.transition="",$.style.width=Q?"":"0";let q=setTimeout(Z,100);$.addEventListener("transitionstart",()=>clearTimeout(q),{once:!0}),$.addEventListener("transitionend",Z,{once:!0})}},cf={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},pf=class extends x{constructor(){super(cf,[bf]);this.sideBarButtons=S,this.toolPanelWrappers=[],this.registerCSS(Pf)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));let{beans:Q,gos:z}=this,{sideBar:J}=z.get("initialState")??{};this.setSideBarDef({sideBarDef:Q7(z.get("sideBar")),sideBarState:J}),this.addManagedPropertyListener("sideBar",()=>this.setState()),Q.sideBar.comp=this;let Z=this.getFocusableElement();this.createManagedBean(new cQ(Z,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),Bz(Q,this,Z),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(Q){if(Q.defaultPrevented)return;let{beans:z,sideBarButtons:J}=this,Z=this.getGui(),$=J.getGui(),X=d(z),Y=Z.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),G=Q.target,q=Q.shiftKey;if(!Y){if($Q(z,q,!0))return Q.preventDefault(),!0;return p9(Q),!1}if($.contains(X)){if(D0(Y,q))Q.preventDefault();return}if(!q)return;let H=null;if(Y.contains(X))H=R0(z,Y,void 0,!0);else if(SY(Y,G))H=e6(Y,G);if(!H)H=$.querySelector(".ag-selected button"),H=f0(H)?H:null;if(H&&H!==Q.target)Q.preventDefault(),H.focus()}handleKeyDown(Q){let z=d(this.beans),J=this.sideBarButtons;if(!J.getGui().contains(z))return;let Z=J.getGui(),$=Array.prototype.slice.call(Z.querySelectorAll(".ag-side-button")),X=$.findIndex((q)=>q.contains(z)),Y=null;switch(Q.key){case V.LEFT:case V.UP:Y=Math.max(0,X-1);break;case V.RIGHT:case V.DOWN:Y=Math.min(X+1,$.length-1);break}if(Y===null)return;let G=$[Y].querySelector("button");if(G)G.focus(),Q.preventDefault()}onToolPanelButtonClicked(Q){let z=Q.toolPanelId;if(this.openedItem()===z)this.openToolPanel(void 0,"sideBarButtonClicked");else this.openToolPanel(z,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:Q,sideBarState:z,existingToolPanelWrappers:J}){if(this.setDisplayed(!1),this.sideBar=Q,Q)this.sideBarButtons.setDisplayed(!Q.hideButtons);if(Q?.toolPanels){let Z=Q.toolPanels;if(this.createToolPanelsAndSideButtons(Z,z,J),!this.toolPanelWrappers.length)return;let $=z?z.visible:!Q.hiddenByDefault;if(this.setDisplayed($),this.setSideBarPosition(z?z.position:Q.position),$)if(z){let{openToolPanel:X}=z;if(X)this.openToolPanel(X,"sideBarInitializing")}else this.openToolPanel(Q.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(Q){if(!Q)Q="right";this.position=Q;let z=Q==="left",J=z?"right":"left";this.toggleCss("ag-side-bar-left",z),this.toggleCss("ag-side-bar-right",!z);for(let Z of this.toolPanelWrappers)Z.setResizerSizerSide(J);return this.dispatchSideBarUpdated(),this}setDisplayed(Q,z){super.setDisplayed(Q,z),this.dispatchSideBarUpdated()}getState(){let Q={};for(let z of this.toolPanelWrappers)Q[z.getToolPanelId()]=z.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:Q}}createToolPanelsAndSideButtons(Q,z,J){for(let Z of Q)this.createToolPanelAndSideButton(Z,z?.toolPanels?.[Z.id],J?.[Z.id])}validateDef(Q){let{id:z,toolPanel:J}=Q;if(z==null)return R(212),!1;if(gX(J)){if(this.beans.filterManager?.isAdvFilterEnabled())return R(213),!1}return!0}createToolPanelAndSideButton(Q,z,J){if(!this.validateDef(Q)){this.destroyBean(J);return}let Z;if(J)Z=J,Z.setDefParent(Q.parent??null);else if(Z=this.createBean(new mf),!Z.setToolPanelDef(Q,y(this.gos,{initialState:z,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;Z.setDisplayed(!1),this.renderToolPanelUnderParent(Z,Q.parent),this.toolPanelWrappers.push(Z);let $=this.sideBarButtons.addButtonComp(Q);C8($.eToggleButton,Z.getGui())}refresh(){for(let Q of this.toolPanelWrappers)Q.refresh()}renderToolPanelUnderParent(Q,z){let J=Q.getGui();if(z)this.beans.environment.applyThemeClasses(z,["ag-external","ag-tool-panel-external"]),J.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let Z=z??Q.getDefParent()??this.getGui();if(J.parentElement!==Z)Z.appendChild(J)}getWrapper(Q){return this.toolPanelWrappers.find((z)=>z.getToolPanelId()===Q)}openToolPanel(Q,z="api",J){let Z=this.openedItem(),X=!!Q&&!!Z||z==="sideBarInitializing";for(let q of this.toolPanelWrappers){let H=Q===q.getToolPanelId();if(H)this.renderToolPanelUnderParent(q,J??null);if(X)q.setDisplayed(H);else q.animateDisplayed(H)}let Y=this.openedItem();if(Z!==Y)this.sideBarButtons.setActiveButton(Q),this.raiseToolPanelVisibleEvent(Q,Z??void 0,z)}getToolPanelInstance(Q){let z=this.getWrapper(Q);if(!z){R(214,{key:Q});return}return z.getToolPanelInstance()}raiseToolPanelVisibleEvent(Q,z,J){let Z=!!Q&&!!z,$=this.eventSvc;if(z)$.dispatchEvent({type:"toolPanelVisibleChanged",source:J,key:z,visible:!1,switchingToolPanel:Z});if(Q)$.dispatchEvent({type:"toolPanelVisibleChanged",source:J,key:Q,visible:!0,switchingToolPanel:Z})}close(Q="api"){this.openToolPanel(void 0,Q)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let Q=null;for(let z of this.toolPanelWrappers)if(z.isDisplayed())Q=z.getToolPanelId();return Q}setState(Q){let z=Q7(this.gos.get("sideBar")),J={};if(z&&this.sideBar)z.toolPanels?.forEach((Z)=>{let{id:$}=Z;if(!$)return;let X=this.sideBar.toolPanels?.find((H)=>H.id===$);if(!X||Z.toolPanel!==X.toolPanel)return;let Y=this.getWrapper($);if(!Y)return;let G=y(this.gos,{...Z.toolPanelParams??{},initialState:Q?.toolPanels?.[$],onStateUpdated:()=>this.dispatchSideBarUpdated()});if(Y.getToolPanelInstance()?.refresh(G)!==!0)return;this.toolPanelWrappers=this.toolPanelWrappers.filter((H)=>H!==Y),T0(Y.getGui()),J[$]=Y});this.clearDownUi(),this.setSideBarDef({sideBarDef:z,sideBarState:Q,existingToolPanelWrappers:J})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(let Q of this.toolPanelWrappers)T0(Q.getGui()),this.destroyBean(Q);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){if(this.sideBar?.toolPanels?.some((z)=>gX(typeof z==="string"?z:z.toolPanel)))this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function gX(Q){return Q==="agFiltersToolPanel"||Q==="agNewFiltersToolPanel"}var nf={selector:"AG-SIDE-BAR",component:pf},df=class extends j{constructor(){super(...arguments);this.beanName="sideBar"}getSelector(){return nf}},$7={moduleName:"SideBar",version:J0,beans:[df],apiFunctions:{isSideBarVisible:Df,setSideBarVisible:Mf,setSideBarPosition:kf,openToolPanel:Vf,closeToolPanel:ff,getOpenedToolPanel:Af,refreshToolPanel:jf,isToolPanelShowing:Rf,getToolPanelInstance:Sf,getSideBar:Of},dependsOn:[I0,B6]},tf='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',vY=class extends Gf{constructor(){super({warnNoIcon:()=>R(227)})}},X7={moduleName:"MenuItem",version:J0,userComponents:{agMenuItem:vY},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[tf]},rf=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}",sf=300,lf={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},af=class extends x{constructor(){super(lf,[yQ,T6]);this.eExpand=S,this.eSelect=S,this.eFilterTextField=S}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:(z)=>{if(z.key===V.SPACE)z.preventDefault(),this.onExpandClicked()}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});let Q=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(Q("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(Q("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){let Q=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(Q),this.eSelect.toggleCss("ag-column-select-column-readonly",Q)}init(Q){this.params=Q;let z=this.gos.get("functionsReadOnly");if(this.eSelect.setReadOnly(z),this.eSelect.toggleCss("ag-column-select-column-readonly",z),this.beans.colModel.ready)this.showOrHideOptions()}createExpandIcons(){let Q=this.beans;this.eExpand.appendChild(this.eExpandChecked=h("columnSelectOpen",Q)),this.eExpand.appendChild(this.eExpandUnchecked=h("columnSelectClosed",Q)),this.eExpand.appendChild(this.eExpandIndeterminate=h("columnSelectIndeterminate",Q)),this.setExpandState(0)}showOrHideOptions(){let Q=this.params,z=!Q.suppressColumnFilter,J=!Q.suppressColumnSelectAll,Z=!Q.suppressColumnExpandAll,$=!!this.beans.colModel.colDefCols?.treeDepth,X=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(X("searchOoo","Search...")),N(this.eFilterTextField.getGui(),z),N(this.eSelect.getGui(),J),N(this.eExpand,Z&&$)}onFilterTextChanged(){if(!this.onFilterTextChangedDebounced)this.onFilterTextChangedDebounced=gQ(this,()=>{let Q=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:Q})},sf);this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(Q){this.expandState=Q,N(this.eExpandChecked,Q===0),N(this.eExpandUnchecked,Q===1),N(this.eExpandIndeterminate,Q===2)}setSelectionState(Q){this.selectState=Q,this.eSelect.setValue(this.selectState)}},of={selector:"AG-PRIMARY-COLS-HEADER",component:af};function P1(Q){return!!Q&&typeof Q.children<"u"}function Fz(Q){return P1(Q)?Q.groupId:Q.colId}function IY(Q,z,J){let Z=(Y,G)=>{let H=Y.children.map(Fz).includes(Fz(G)),_=b(Y.children),U=_&&Fz(_)!==Fz(G);return H&&U};if(!P1(Q))return!0;let $=Q,X=J;if(Z($,X))return $.children.push(X),!0;if($.groupId===z){if(!$.children.map(Fz).includes(Fz(X)))return $.children.push(X),!0}for(let Y=$.children.length-1;Y>=0;Y--)if(IY($.children[Y],z,J))break;return!1}function CY(Q){let z=($,X)=>{return P1($)&&P1(X)&&Fz($)===Fz(X)},J=($,X)=>{if(!P1(X))return $;let Y=$,G=X;if(G.children&&G.groupId){if(IY(Y,G.groupId,G.children[0]))return Y}for(let q of G.children)J(Y,q);return Y},Z=[];for(let $=1;$<=Q.length;$++){let X=Q[$-1],Y=Q[$];if(z(X,Y))Q[$]=J(X,Y);else Z.push(X)}return Z}function ef(Q,z){let J=[],Z=(X,Y)=>{if(P1(X)){let G=X,q=typeof G.groupId<"u"?G.groupId:G.headerName,H=new Cz(G,q,!1,Y),_=[];for(let U of G.children){let W=Z(U,Y+1);if(W)_.push(W)}return H.setChildren(_),H}else{let G=X,q=G.colId?G.colId:G.field,H=Q.getColDefCol(q);if(!H)J.push(G);return H}},$=[];for(let X of z){let Y=Z(X,0);if(Y)$.push(Y)}if(J.length>0)R(217,{invalidColIds:J});return $}function QA(Q,z){let J=bY(JA(Q)),Z=CY(J);z(Z)}function zA(Q,z){let J=bY(Q),Z=CY(J);z(Z)}function bY(Q){let z=(J,Z)=>{let $;if(G0(J))if(J.isPadding())$=Z;else{let Y=Object.assign({},J.getColGroupDef());Y.groupId=J.getGroupId(),Y.children=[Z],$=Y}else{let Y=Object.assign({},J.getColDef());Y.colId=J.getColId(),$=Y}let X=J.getOriginalParent();if(X)return z(X,$);else return $};return Q.map((J)=>z(J,J.getColDef()))}function JA(Q){return Q.getCols().filter((z)=>{let J=z.getColDef();return z.isPrimary()&&!J.showRowGroup})}var hX=class{constructor(Q,z,J,Z=!1,$){if(this.displayName=Q,this.depth=J,this.group=Z,this.localEventService=new KQ,Z)this.columnGroup=z,this._expanded=$,this.children=[];else this.column=z}get expanded(){return!!this._expanded}set expanded(Q){if(Q===this._expanded)return;this._expanded=Q,this.localEventService.dispatchEvent({type:"expandedChanged"})}addEventListener(Q,z){this.localEventService.addEventListener(Q,z)}removeEventListener(Q,z){this.localEventService.removeEventListener(Q,z)}};function i(Q){return!!Q?.buttons?.includes("apply")}function N0(Q,z){if(!i(z))return;let J=Q.sideBar?.comp.openedItem();if(!J)return;Q.sideBar?.comp.getToolPanelInstance(J)?.refreshDeferredUi()}function yY(Q,z,J,Z,$){let X=ZA(z);xY(Q,X,J,Z,$)}function xY(Q,z,J,Z,$){if(Q.columnStateUpdateStrategy.getPivotMode(i($)))XA(Q,z,J,Z,$);else $A(Q,z,J,Z,$)}function ZA(Q){let z=[],J=(Z)=>{for(let $ of Z){if(!$.passesFilter)continue;if($.group)J($.children);else z.push($.column)}};return J(Q),z}function $A(Q,z,J,Z,$){let X=Q.columnStateUpdateStrategy,Y=[];for(let G of z){if(G.getColDef().lockVisible)continue;if(X.isColumnVisibleInToolPanel(i($),G)!==J)Y.push({colId:G.getId(),hide:!J})}X.applyColumnState(i($),Y,Z),N0(Q,$)}function XA(Q,z,J,Z,$){YA(Q,z,J,Z,$)}function YA(Q,z,J,Z,$){let X=Q.columnStateUpdateStrategy,Y=[],H=J?(_)=>{if(X.isColumnSelectedInPivotModeToolPanel(i($),_))return;if(_.isAllowValue()){let U=typeof _.getAggFunc()==="string"?_.getAggFunc():Q.aggFuncSvc?.getDefaultAggFunc(_);Y.push({colId:_.getId(),aggFunc:U})}else if(_.isAllowRowGroup())Y.push({colId:_.getId(),rowGroup:!0});else if(_.isAllowPivot())Y.push({colId:_.getId(),pivot:!0})}:(_)=>{if(X.isColumnSelectedInPivotModeToolPanel(i($),_))Y.push({colId:_.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};z.forEach(H),X.applyColumnState(i($),Y,Z),N0(Q,$)}function wY(Q,z){let{columns:J,visibleState:Z,pivotState:$,eventType:X}=z,Y=Q.columnStateUpdateStrategy,G=Y.getPivotMode(i(z)),q=J.map((H)=>{let _=H.getColId();if(G){let U=$?.[_];return{colId:_,pivot:U?.pivot,rowGroup:U?.rowGroup,aggFunc:U?.aggFunc}}else return{colId:_,hide:!Z?.[_]}});Y.applyColumnState(i(z),q,X),N0(Q,z)}function GA(Q){return{pivot:Q.isPivotActive(),rowGroup:Q.isRowGroupActive(),aggFunc:Q.isValueActive()?Q.getAggFunc():void 0}}function NY(Q,z,J){if(!J)return GA(Q);let Z=z.getRowGroupColumns(J).includes(Q),$=z.getPivotColumns(J).includes(Q),X=z.getValueColumns(J).includes(Q);return{pivot:$,rowGroup:Z,aggFunc:X?z.getColumnAggFunc(J,Q):void 0}}var gY=(Q,z)=>{if(!z)return[];let J=Q;for(let Z=0,$=z.length;Z<$&&J;++Z)J=J[z[Z]];return Array.isArray(J)?J:[]},O1=(Q,z,J)=>{let Z=Q.aggData;if(Z===z)return;if(Q.aggData=z,Q.__localEventService)qA(Q,Z,z,J)},uX=(Q,z,J)=>{O1(Q,z,J);let Z=Q.pinnedSibling;if(Z)O1(Z,z,J);let $=Q.sibling;if($){O1($,z,J);let X=$.pinnedSibling;if(X)O1(X,z,J)}},qA=(Q,z,J,Z)=>{if(!J){if(!z)return;let Y=Object.keys(z);for(let G=0,q=Y.length;G{if(!Q)return;let Z=Q.group;if(Z===J)return;if(Q.group=J,Q.updateHasChildren(),Z&&!J)O1(Q,null,z.colModel),Q.setAllChildrenCount(null);z.selectionSvc?.updateRowSelectable(Q),Q.dispatchRowEvent("groupChanged")},hY=(Q,z,J)=>{mX(Q,z,J),mX(Q.pinnedSibling,z,J)},TJ=(Q,z)=>{let{gos:J,rowGroupColsSvc:Z}=z;if(!Z||!Q)return!1;let $=J.get("groupLockGroupColumns");if(!Q.isRowGroupActive()||$===0)return!1;if($===-1)return!0;let X=Z.columns.findIndex((Y)=>Y.getColId()===Q.getColId());return $>X},OJ=(Q,z,J)=>{let $=Q(z,`${z==="groupBy"?"Group by":"Un-Group by"} ${J}`,[J]);if($.indexOf(J)>=0)return $;else return`${$} ${J}`};function HA(Q){let z=s0(Q),J="getSelection"in z?z.getSelection():null,Z=[];for(let $=0;$<(J?.rangeCount??0);$++){let X=J?.getRangeAt($);if(X)Z.push(X)}return{selection:J,ranges:Z}}function _A(Q,z){if(!Q.gos.get("enableCellTextSelection"))return z();if(!yZ()&&!cz())return z();let{selection:Z,ranges:$}=HA(Q);z(),Z?.removeAllRanges();for(let X of $)Z?.addRange(X)}var UA={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},uY={getMenuItemComp:(Q,z,J)=>{return Q.userCompFactory.getCompDetails(z,UA,"agMenuItem",y(Q.gos,J),!0)?.newAgStackInstance()??g.resolve()},getPostProcessPopupParams:({column:Q,node:z})=>({column:Q,rowNode:z}),preserveRangesWhile:_A,stopPropagationCallbacks:Uz,warnNoItem:(Q)=>{R(228,{menuItemOrString:Q})}},WA=class extends o6{constructor(){super(uY)}},mY=class extends RY{constructor(Q,z={column:null,node:null,value:null}){super(Q,z,uY)}},cY=class extends x{constructor(Q,z,J,Z={}){super({tag:"div",cls:"ag-menu"});this.column=Q,this.mouseEventOrTouch=z,this.parentEl=J,this.params=Z,this.displayName=null}postConstruct(){let{column:Q,beans:{colNames:z}}=this;this.initializeProperties(Q);let J;if(JQ(Q))J=z.getDisplayNameForColumn(Q,"columnToolPanel");else J=z.getDisplayNameForProvidedColumnGroup(null,Q,"columnToolPanel");if(this.displayName=J,this.buildMenuItemMap(),this.isActive()){let Z=this.mouseEventOrTouch;if("preventDefault"in Z)Z.preventDefault();let $=this.getMappedMenuItems();if($.length===0)return;this.displayContextMenu($)}}initializeProperties(Q){let z=this.beans.columnStateUpdateStrategy,J;if(G0(Q))J=Q.getLeafColumns();else J=[Q];this.columns=J;let Z=z.getPivotMode(i(this.params));this.allowScrollIntoView=!Z&&J.some(this.isColumnValidForScrollIntoView),this.allowGrouping=J.some(($)=>$.isPrimary()&&$.isAllowRowGroup()),this.allowValues=J.some(($)=>$.isPrimary()&&$.isAllowValue()),this.allowPivoting=Z&&J.some(($)=>$.isPrimary()&&$.isAllowPivot())}buildMenuItemMap(){let Q=this.getLocaleTextFunc(),{beans:z,displayName:J}=this,Z=this.beans.columnStateUpdateStrategy,$=new Map;this.menuItemMap=$;let X=i(this.params),Y=Z.getPivotMode(X),G=new Set(Z.getRowGroupColumns(X).map((B)=>B.getColId())),q=new Set(Z.getValueColumns(X).map((B)=>B.getColId())),H=new Set(Z.getPivotColumns(X).map((B)=>B.getColId()));$.set("scrollIntoView",{allowedFunction:(B)=>!B.isPinned()&&!Y&&this.isColumnValidForScrollIntoView(B),activeFunction:()=>!1,activateLabel:()=>Q("scrollColumnIntoView",`Scroll ${J} into View`,[J]),activateFunction:()=>{let B=this.columns.find(this.isColumnValidForScrollIntoView);if(B)this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(B)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});let _=(B)=>B.isPrimary()&&B.isAllowRowGroup()&&!TJ(B,z);$.set("rowGroup",{allowedFunction:_,activeFunction:(B)=>G.has(B.getColId()),activateLabel:()=>OJ(Q,"groupBy",J),deactivateLabel:()=>OJ(Q,"ungroupBy",J),activateFunction:()=>{let B=this.addColumnsToList(Z.getRowGroupColumns(X),_);Z.setRowGroupColumns(X,B,"toolPanelUi"),N0(this.beans,this.params)},deActivateFunction:()=>{let B=this.removeColumnsFromList(Z.getRowGroupColumns(X),_);Z.setRowGroupColumns(X,B,"toolPanelUi"),N0(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});let U=(B)=>B.isPrimary()&&B.isAllowValue();$.set("value",{allowedFunction:U,activeFunction:(B)=>q.has(B.getColId()),activateLabel:()=>Q("addToValues",`Add ${J} to values`,[J]),deactivateLabel:()=>Q("removeFromValues",`Remove ${J} from values`,[J]),activateFunction:()=>{let B=this.addColumnsToList(Z.getValueColumns(X),U);Z.setValueColumns(X,B,"toolPanelUi"),N0(this.beans,this.params)},deActivateFunction:()=>{let B=this.removeColumnsFromList(Z.getValueColumns(X),U);Z.setValueColumns(X,B,"toolPanelUi"),N0(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});let W=(B)=>Y&&B.isPrimary()&&B.isAllowPivot();$.set("pivot",{allowedFunction:W,activeFunction:(B)=>H.has(B.getColId()),activateLabel:()=>Q("addToLabels",`Add ${J} to labels`,[J]),deactivateLabel:()=>Q("removeFromLabels",`Remove ${J} from labels`,[J]),activateFunction:()=>{let B=this.addColumnsToList(Z.getPivotColumns(X),W);Z.setPivotColumns(X,B,"toolPanelUi"),N0(this.beans,this.params)},deActivateFunction:()=>{let B=this.removeColumnsFromList(Z.getPivotColumns(X),W);Z.setPivotColumns(X,B,"toolPanelUi"),N0(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(Q){if(!Q.isVisible())return!1;let J=Q.getParent();if(!J)return!0;return J.getDisplayedChildren()?.includes(Q)??!0}addColumnsToList(Q,z){return[...Q].concat(this.columns.filter((J)=>z(J)&&!Q.includes(J)))}removeColumnsFromList(Q,z){return Q.filter((J)=>!z(J)||!this.columns.includes(J))}displayContextMenu(Q){let z=this.getGui(),J=this.createBean(new mY),Z=this.getLocaleTextFunc(),$=()=>{};z.appendChild(J.getGui()),J.addMenuItems(Q),J.addManagedListeners(J,{closeMenu:()=>{this.parentEl.focus(),$()}});let X=this.beans.popupSvc,Y=X.addPopup({modal:!0,eChild:z,closeOnEsc:!0,afterGuiAttached:()=>D0(J.getGui()),ariaLabel:Z("ariaLabelContextMenu","Context Menu"),closedCallback:(G)=>{if(G instanceof KeyboardEvent)this.parentEl.focus();this.destroyBean(J)}});if(Y)$=Y.hideFunc;X.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:z})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){let Q=[],{menuItemMap:z,columns:J,displayName:Z,beans:$}=this;for(let X of z.values()){let Y=J.some((q)=>X.allowedFunction(q)&&!X.activeFunction(q)),G=J.some((q)=>X.allowedFunction(q)&&X.activeFunction(q));if(Y)Q.push({name:X.activateLabel(Z),icon:h(X.addIcon,$,null),action:()=>X.activateFunction()});if(G&&X.removeIcon&&X.deactivateLabel)Q.push({name:X.deactivateLabel(Z),icon:h(X.removeIcon,$,null),action:()=>X.deActivateFunction?.()})}return Q}},BA={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},pY=class extends x{constructor(Q,z,J,Z,$){super();this.modelItem=Q,this.allowDragging=z,this.eventType=J,this.focusWrapper=Z,this.params=$,this.cbSelect=S,this.eLabel=S,this.eGroupOpenedIcon=S,this.eGroupClosedIcon=S,this.eColumnGroupIcons=S,this.processingColumnStateChange=!1;let{columnGroup:X,depth:Y,displayName:G}=Q;this.columnGroup=X,this.columnDepth=Y,this.displayName=G}postConstruct(){this.setTemplate(BA,[yQ]);let{beans:Q,cbSelect:z,eLabel:J,displayName:Z,columnDepth:$,modelItem:X,focusWrapper:Y,columnGroup:G}=this,{registry:q,gos:H}=Q,_=h("columnDrag",Q);this.eDragHandle=_,_.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");let U=z.getGui(),W=z.getInputElement();U.after(_),W.setAttribute("tabindex","-1"),J.textContent=Z??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+$),this.getGui().style.setProperty("--ag-indentation-level",String($)),this.tooltipFeature=this.createOptionalManagedBean(q.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:tZ(H,()=>J)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(J,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(z,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(X,{expandedChanged:this.onExpandChanged.bind(this)});let B=new h0(this.getGui(),!1);this.addManagedListeners(B,{longTap:(K)=>this.onContextMenu(K.touchStart)}),this.addDestroyFunc(B.destroy.bind(B)),this.addManagedListeners(Y,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();let E=hZ(G.getColGroupDef(),H,null,G);for(let K of E)this.toggleCss(K,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){let Q=this.columnGroup.getColGroupDef();if(!Q)return;let z=()=>this.tooltipFeature?.setTooltipAndRefresh(Q.headerTooltip);z(),this.addManagedEventListeners({newColumnsLoaded:z})}handleKeyDown(Q){switch(Q.key){case V.LEFT:Q.preventDefault(),this.modelItem.expanded=!1;break;case V.RIGHT:Q.preventDefault(),this.modelItem.expanded=!0;break;case V.SPACE:if(Q.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(Q){let{columnGroup:z,gos:J}=this;if(J.get("functionsReadOnly"))return;let Z=this.createBean(new cY(z,Q,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(Z.isAlive())this.destroyBean(Z)})}addVisibilityListenersToAllChildren(){let Q=this.onColumnStateChanged.bind(this);for(let z of this.columnGroup.getLeafColumns())this.addManagedListeners(z,{visibleChanged:Q,columnValueChanged:Q,columnPivotChanged:Q,columnRowGroupChanged:Q})}setupDragging(){if(!this.allowDragging){N(this.eDragHandle,!1);return}let Q=this.beans,{gos:z,eventSvc:J,dragAndDrop:Z}=Q,$=!z.get("suppressDragLeaveHidesColumns"),X={type:qQ.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>$?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{$=!z.get("suppressDragLeaveHidesColumns"),J.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{J.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(Y)=>{if($)wY(Q,{columns:this.columnGroup.getLeafColumns(),visibleState:Y?.visibleState,pivotState:Y?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{if($)this.onChangeCommon(!1)}};Z.addDragSource(X,!0),this.addDestroyFunc(()=>Z.removeDragSource(X))}createDragItem(){let Q=this.columnGroup.getLeafColumns(),z={},J={},Z=this.beans.columnStateUpdateStrategy,$=i(this.params);for(let X of Q){let Y=X.getId();z[Y]=X.isVisible(),J[Y]=NY(X,Z,$)}return{columns:Q,visibleState:z,pivotState:J}}setupExpandContract(){let{beans:Q,eGroupClosedIcon:z,eGroupOpenedIcon:J,eColumnGroupIcons:Z}=this;z.appendChild(uZ("columnSelectClosed",Q,null)),J.appendChild(uZ("columnSelectOpen",Q,null));let $=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(z,{click:$}),this.addManagedElementListeners(J,{click:$});let X=new h0(Z,!0);this.addManagedListeners(X,{tap:$}),this.addDestroyFunc(X.destroy.bind(X))}onLabelClicked(){let Q=!this.cbSelect.getValue();this.onChangeCommon(Q)}onCheckboxChanged(Q){this.onChangeCommon(Q.selected)}getVisibleLeafColumns(){let Q=[],z=(J)=>{for(let Z of J)if(Z.passesFilter)if(Z.group)z(Z.children);else Q.push(Z.column)};return z(this.modelItem.children),Q}onChangeCommon(Q){if(this.refreshAriaLabel(),this.processingColumnStateChange)return;yY(this.beans,this.modelItem.children,Q,this.eventType,this.params)}refreshAriaLabel(){let{cbSelect:Q,focusWrapper:z,displayName:J}=this,Z=this.getLocaleTextFunc(),$=Z("ariaColumnGroup","Column Group"),X=Q.getValue(),Y=X===void 0?Z("ariaIndeterminate","indeterminate"):X?Z("ariaVisible","visible"):Z("ariaHidden","hidden"),G=Z("ariaToggleVisibility","Press SPACE to toggle visibility");E0(z,`${J} ${$}`),Q.setInputAriaLabel(`${G} (${Y})`),MZ(z,Q.getInputElement().id)}onColumnStateChanged(){let Q=this.workOutSelectedValue(),z=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;let J=this.cbSelect;J.setValue(Q),J.setReadOnly(z),this.toggleCss("ag-column-select-column-group-readonly",z),this.processingColumnStateChange=!1}workOutSelectedValue(){let z=this.beans.columnStateUpdateStrategy.getPivotMode(i(this.params)),J=this.getVisibleLeafColumns(),Z=0,$=0;for(let X of J)if(z||!X.getColDef().lockVisible)if(this.isColumnChecked(X))Z++;else $++;if(Z>0&&$>0)return;return Z>0}workOutReadOnlyValue(){let Q=this.beans.columnStateUpdateStrategy.getPivotMode(i(this.params)),z=0;for(let J of this.columnGroup.getLeafColumns())if(Q){if(J.isAnyFunctionAllowed())z++}else if(!J.getColDef().lockVisible)z++;return z===0}isColumnChecked(Q){let z=this.beans.columnStateUpdateStrategy;if(z.getPivotMode(i(this.params)))return z.isColumnSelectedInPivotModeToolPanel(i(this.params),Q);return z.isColumnVisibleInToolPanel(i(this.params),Q)}onExpandOrContractClicked(){let Q=this.modelItem,z=Q.expanded;Q.expanded=!z}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){let Q=this.modelItem.expanded;N(this.eGroupClosedIcon,!Q),N(this.eGroupOpenedIcon,Q)}refreshAriaExpanded(){w0(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(Q){let z=this.cbSelect,J=z.getValue();if(!z.isReadOnly()&&(Q&&!J||!Q&&J))z.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(Q){this.cbSelect.setValue(Q,!0)}},p6=(Q)=>{if(G0(Q))return Q.getLeafColumns();return Q?[Q]:[]},EA=(Q,z,J,Z)=>{if(!z||!Q)return null;let $=Z.indexOf(z),X=J?$:$+1,Y=KA(Z,Q,X);return X-Y},KA=(Q,z,J)=>{if(!z)return 0;let Z=z[0],$=z.length;if(Q.indexOf(Z){let $=i(Z);if(Q.get("suppressMovableColumns")||z.columnStateUpdateStrategy.getPivotMode($))return!0;return!!J.find(({colDef:G})=>!!G.suppressMovable||!!G.lockPosition)},pX=(Q,z,J,Z)=>{if(!J)return;let{component:$}=J,X=null,Y=J.position==="top";if($ instanceof pY)X=$.getColumns()[0],Y=!0;else if($)X=$.column;if(!X)return;let G=i(Z),q=G?Q.columnStateUpdateStrategy.getPrimaryColumns(G):Q.colModel.getCols(),H=EA(z,X,Y,q);if(H!=null)Q.columnStateUpdateStrategy.moveColumns(G,z,H,"toolPanelUi"),N0(Q,Z)},LA=(Q)=>{return Q.column},FA={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},DA=class extends x{constructor(Q,z,J,Z,$){super();this.modelItem=Q,this.allowDragging=z,this.groupsExist=J,this.focusWrapper=Z,this.params=$,this.eLabel=S,this.cbSelect=S,this.processingColumnStateChange=!1;let{column:X,depth:Y,displayName:G}=Q;this.column=X,this.columnDepth=Y,this.displayName=G}postConstruct(){this.setTemplate(FA,[yQ]);let{beans:Q,cbSelect:z,displayName:J,eLabel:Z,columnDepth:$,groupsExist:X,column:Y,gos:G,focusWrapper:q}=this,H=h("columnDrag",Q);this.eDragHandle=H,H.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");let _=z.getGui(),U=z.getInputElement();if(_.after(H),U.setAttribute("tabindex","-1"),Z.textContent=J,X)this.addCss("ag-column-select-add-group-indent");this.addCss(`ag-column-select-indent-${$}`),this.getGui().style.setProperty("--ag-indentation-level",String($)),this.tooltipFeature=this.createOptionalManagedBean(Q.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:tZ(G,()=>Z),getAdditionalParams:()=>({colDef:Y.getColDef()})})),this.setupDragging();let W=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:W}),this.addManagedListeners(Y,{columnValueChanged:W,columnPivotChanged:W,columnRowGroupChanged:W,visibleChanged:W}),this.addManagedListeners(q,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});let B=new h0(q);this.addManagedListeners(B,{longTap:(K)=>this.onContextMenu(K.touchStart)}),this.addDestroyFunc(B.destroy.bind(B)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(z,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(Z,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();let E=hZ(Y.getColDef(),G,Y,null);for(let K of E)this.toggleCss(K,!0)}getColumn(){return this.column}setupTooltip(){let Q=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);Q(),this.addManagedEventListeners({newColumnsLoaded:Q})}onContextMenu(Q){let{column:z,gos:J}=this;if(J.get("functionsReadOnly"))return;let Z=this.createBean(new cY(z,Q,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(Z.isAlive())this.destroyBean(Z)})}handleKeyDown(Q){if(Q.key===V.SPACE){if(Q.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected())}}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;let Q=!this.cbSelect.getValue();this.onChangeCommon(Q)}onCheckboxChanged(Q){this.onChangeCommon(Q.selected)}onChangeCommon(Q){if(this.cbSelect.isReadOnly())return;if(this.refreshAriaLabel(),this.processingColumnStateChange)return;xY(this.beans,[this.column],Q,"toolPanelUi",this.params)}refreshAriaLabel(){let{cbSelect:Q,focusWrapper:z,displayName:J}=this,Z=this.getLocaleTextFunc(),$=Z("ariaColumn","Column"),X=Q.getValue()?Z("ariaVisible","visible"):Z("ariaHidden","hidden"),Y=Z("ariaToggleVisibility","Press SPACE to toggle visibility");E0(z,`${J} ${$}`),this.cbSelect.setInputAriaLabel(`${Y} (${X})`),MZ(z,Q.getInputElement().id)}setupDragging(){let Q=this.eDragHandle;if(!this.allowDragging){N(Q,!1);return}let z=this.beans,{gos:J,eventSvc:Z,dragAndDrop:$}=z;if(i(this.params))Q.setAttribute("data-column-tool-panel-deferred","");let X=!J.get("suppressDragLeaveHidesColumns"),Y={type:qQ.ToolPanel,eElement:Q,dragItemName:this.displayName,getDefaultIconName:()=>X&&!i(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{X=!J.get("suppressDragLeaveHidesColumns"),Z.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{Z.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(G)=>{if(X&&!i(this.params))wY(z,{columns:[this.column],visibleState:G?.visibleState,pivotState:G?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{if(X&&!i(this.params))this.onChangeCommon(!1)}};$.addDragSource(Y,!0),this.addDestroyFunc(()=>$.removeDragSource(Y))}createDragItem(){let Q=this.column.getColId(),z={[Q]:this.column.isVisible()},J=this.beans.columnStateUpdateStrategy,Z={[Q]:NY(this.column,J,i(this.params))};return{columns:[this.column],visibleState:z,pivotState:Z}}onColumnStateChanged(){this.processingColumnStateChange=!0;let Q=this.beans.columnStateUpdateStrategy,z=Q.getPivotMode(i(this.params));if(z){let $=Q.isColumnSelectedInPivotModeToolPanel(i(this.params),this.column);this.cbSelect.setValue($)}else this.cbSelect.setValue(Q.isColumnVisibleInToolPanel(i(this.params),this.column));let J=!0,Z=!0;if(z){let $=this.gos.get("functionsReadOnly"),X=!this.column.isAnyFunctionAllowed();J=!$&&!X,Z=J}else{let{enableRowGroup:$,enableValue:X,lockPosition:Y,suppressMovable:G,lockVisible:q}=this.column.getColDef(),H=!!$||!!X,_=!!Y||!!G;J=!q,Z=H||!_}this.cbSelect.setReadOnly(!J),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!Z),this.toggleCss("ag-column-select-column-readonly",!Z&&!J),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(Q){let z=this.cbSelect;if(Q!==z.getValue()){if(!z.isReadOnly())z.toggle()}}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(Q){R(158)}},MA=class{constructor(Q){this.items=Q}getRowCount(){return this.items.length}getRow(Q){return this.items[Q]}},kA="ag-column-select-list",VA=class extends x{constructor(){super({tag:"div",cls:kA,role:"presentation"});this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(Q){this.colModel=Q.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(let Q of this.destroyColumnItemFuncs)Q();this.destroyColumnItemFuncs=[]}init(Q,z,J){this.params=Q;let{suppressSyncLayoutWithGrid:Z,contractColumnSelection:$,suppressColumnMove:X}=Q;if(this.allowDragging=z,this.eventType=J,!Z)this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)});this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});let Y=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:Y,columnPivotModeChanged:Y,columnRowGroupChanged:Y,columnValueChanged:Y,columnVisible:Y,newColumnsLoaded:Y}),this.expandGroupsByDefault=!$;let G=X||Z,q=this.createManagedBean(new OY({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(H,_)=>{if(G)return;this.moveItems(H,_)}}));if(this.virtualList=q,this.appendChild(q.getGui()),q.setComponentCreator((H,_)=>{return O8(_,H.depth+1),this.createComponentFromItem(H,_)}),this.colModel.ready)this.onColumnsChanged();if(G)return;this.createItemDragFeature()}createItemDragFeature(){let{gos:Q,beans:z,virtualList:J}=this;this.createManagedBean(new Ff(this,J,{dragSourceType:qQ.ToolPanel,addListeners:(Z,$,X)=>{Z.addManagedEventListeners({columnPanelItemDragStart:$,columnPanelItemDragEnd:X})},getCurrentDragValue:(Z)=>LA(Z),isMoveBlocked:(Z)=>cX(Q,z,p6(Z),this.params),getNumRows:(Z)=>Z.getDisplayedColsList().length,moveItem:(Z,$)=>pX(z,p6(Z),$,this.params)}))}moveItems(Q,z){let{gos:J,beans:Z}=this,{modelItem:$}=Q,{group:X,columnGroup:Y,column:G,expanded:q}=$,H=p6(X?Y:G);if(cX(J,Z,H,this.params))return;let _=this.displayedColsList.indexOf($),U=z?-1:1,W=0;if(z){let E=Q.columnDepth>0?G.getParent()?.getChildren():null;if(E?.length&&G===E[0])W=-1}else if(X)W=q?$.children.length:0;let B=Math.min(Math.max(_+W+U,0),this.displayedColsList.length-1);this.skipRefocus=!0,pX(Z,H,{rowIndex:B,position:z?"top":"bottom",component:this.virtualList.getComponentAt(B)},this.params),this.focusRowIfAlive(B-W).then(()=>{this.skipRefocus=!1})}createComponentFromItem(Q,z){let J=this.allowDragging;if(Q.group){let $=new pY(Q,J,this.eventType,z,this.params);return this.createBean($),$}let Z=new DA(Q,J,this.groupsExist,z,this.params);return this.createBean(Z),Z}onColumnsChanged(){let Q=this.params;if(!this.hasLoadedInitialState)this.hasLoadedInitialState=!0,this.isInitialState=!!Q.initialState;let z=this.getExpandedStates(),J=this.colModel.isPivotMode(),Z=i(Q),$=Z&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(Z);if((!Q.suppressSyncLayoutWithGrid||Z)&&!J||$)this.buildTreeFromWhatGridIsDisplaying();else this.buildTreeFromProvidedColumnDefs();this.setExpandedStates(z),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){let Q={};if(this.isInitialState){let{expandedGroupIds:z}=this.params.initialState;for(let J of z)Q[J]=!0;return Q}if(!this.allColsTree)return{};return this.forEachItem((z)=>{if(!z.group)return;let J=z.columnGroup;if(J)Q[J.getId()]=z.expanded}),Q}setExpandedStates(Q){if(!this.allColsTree)return;let{isInitialState:z}=this;this.forEachItem((J)=>{if(!J.group)return;let Z=J.columnGroup;if(Z){let $=Q[Z.getId()];if($!=null||z)J.expanded=!!$}})}buildTreeFromWhatGridIsDisplaying(){let Q=i(this.params);if(Q&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(Q)){let z=this.beans.columnStateUpdateStrategy.getPrimaryColumns(Q);if(z.length>0){zA(z,this.setColumnLayout.bind(this));return}}if(this.params.suppressSyncLayoutWithGrid){this.buildTreeFromProvidedColumnDefs();return}QA(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(Q){let z=ef(this.colModel,Q);this.buildListModel(z),this.groupsExist=Q.some((J)=>{return J&&typeof J.children<"u"}),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){let Q=this.colModel;this.buildListModel(Q.getColDefColTree()),this.groupsExist=!!Q.colDefCols?.treeDepth}buildListModel(Q){let z=this.onColumnExpanded.bind(this),J=(G)=>{G.addEventListener("expandedChanged",z);let q=G.removeEventListener.bind(G,"expandedChanged",z);this.destroyColumnItemFuncs.push(q)},Z=this.beans.colNames,$=(G,q,H)=>{for(let _ of G)if(G0(_))X(_,q,H);else Y(_,q,H)},X=(G,q,H)=>{if(G.getColGroupDef()?.suppressColumnsToolPanel)return;if(G.isPadding()){$(G.getChildren(),q,H);return}let W=Z.getDisplayNameForProvidedColumnGroup(null,G,"columnToolPanel"),B=new hX(W,G,q,!0,this.expandGroupsByDefault);H.push(B),J(B),$(G.getChildren(),q+1,B.children)},Y=(G,q,H)=>{if(G.getColDef()?.suppressColumnsToolPanel)return;let U=Z.getDisplayNameForColumn(G,"columnToolPanel");H.push(new hX(U,G,q))};this.destroyColumnTree(),$(Q,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];let Q=(Z)=>{if(!Z.passesFilter)return;if(this.displayedColsList.push(Z),Z.group&&Z.expanded)Z.children.forEach(Q)},z=this.virtualList;this.allColsTree.forEach(Q),z.setModel(new MA(this.displayedColsList));let J=null;if(!this.skipRefocus)J=z.getLastFocusedRow();if(z.refresh(),J!=null)this.focusRowIfAlive(J);this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){let Q=this.getLocaleTextFunc(),z=Q("ariaColumnPanelList","Column List"),J=Q("columns","Columns"),Z=this.displayedColsList.length;E0(this.virtualList.getAriaElement(),`${z} ${Z} ${J}`)}focusRowIfAlive(Q){if(Q===-1)return Promise.resolve();return new Promise((z)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(Q);z()},0)})}forEachItem(Q){let z=(Z)=>{for(let $ of Z)if(Q($),$.group)z($.children)},J=this.allColsTree;if(!J)return;z(J)}doSetExpandedAll(Q){this.forEachItem((z)=>{if(z.group)z.expanded=Q})}setGroupsExpanded(Q,z){if(!z){this.doSetExpandedAll(Q);return}let J=[];this.forEachItem(($)=>{if(!$.group)return;let X=$.columnGroup.getId();if(z.indexOf(X)>=0)$.expanded=Q,J.push(X)});let Z=z.filter(($)=>!J.includes($));if(Z.length>0)R(157,{unrecognisedGroupIds:Z})}getExpandState(){let Q=0,z=0;if(this.forEachItem((J)=>{if(!J.group)return;if(J.expanded)Q++;else z++}),Q>0&&z>0)return 2;if(z>0)return 1;return 0}doSetSelectedAll(Q){yY(this.beans,this.allColsTree,Q,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let Q=0;Q{if($.group)return;if(!$.passesFilter)return;let X=$.column,Y=X.getColDef(),G;if(Z){if(!X.isAllowPivot()&&!X.isAllowRowGroup()&&!X.isAllowValue())return;G=J.isColumnSelectedInPivotModeToolPanel(i(this.params),X)??!1}else{if(Y.lockVisible)return;G=J.isColumnVisibleInToolPanel(i(this.params),X)??!1}if(G)Q++;else z++}),Q>0&&z>0)return;return!(Q===0||z>0)}setFilterText(Q){this.filterText=T(Q)?Q.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){let Q=(J)=>{if(!T(this.filterText))return!0;let Z=J.displayName;return Z==null||Z.toLowerCase().indexOf(this.filterText)!==-1},z=(J,Z)=>{let $=!1;if(J.group){let Y=Q(J);for(let G of J.children){let q=z(G,Y||Z);if(q)$=q}}let X=Z||$?!0:Q(J);return J.passesFilter=X,X};for(let J of this.allColsTree)z(J,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){let Q=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:Q})}fireSelectionChangedEvent(){if(!this.allColsTree)return;let Q=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:Q})}getExpandedGroups(){let Q=[];if(!this.allColsTree)return Q;return this.forEachItem((z)=>{if(z.group&&z.expanded)Q.push(z.columnGroup.getId())}),Q}},fA={selector:"AG-PRIMARY-COLS-LIST",component:VA},AA={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},iY=class extends x{constructor(){super(AA,[of,fA]);this.primaryColsHeaderPanel=S,this.primaryColsListPanel=S,this.registerCSS(rf)}init(Q,z,J){let{primaryColsHeaderPanel:Z,primaryColsListPanel:$}=this;Z.init(z);let{suppressColumnFilter:X,suppressColumnSelectAll:Y}=z;if(z.suppressColumnExpandAll&&X&&Y)Z.setDisplayed(!1);this.addManagedListeners($,{groupExpanded:(q)=>{Z.setExpandState(q.state),z.onStateUpdated()},selectionChanged:(q)=>Z.setSelectionState(q.state)}),$.init(z,Q,J),this.addManagedListeners(Z,{expandAll:$.doSetExpandedAll.bind($,!0),collapseAll:$.doSetExpandedAll.bind($,!1),selectAll:$.doSetSelectedAll.bind($,!0),unselectAll:$.doSetSelectedAll.bind($,!1),filterChanged:(q)=>$.setFilterText(q.filterText)}),this.positionableFeature=this.createManagedBean(new UJ(this.getGui(),{minHeight:100}))}toggleResizable(Q){this.positionableFeature.setResizable(Q?{bottom:!0}:!1)}expandGroups(Q){this.primaryColsListPanel.setGroupsExpanded(!0,Q)}collapseGroups(Q){this.primaryColsListPanel.setGroupsExpanded(!1,Q)}setColumnLayout(Q){this.primaryColsListPanel.setColumnLayout(Q)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},jA=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}",RA="ag-column-panel-deferred",SA=class extends x{constructor(){super({tag:"div",cls:"ag-column-panel"});this.initialised=!1,this.childDestroyFuncs=[],this.isDeferModeEnabled=!1,this.isCommitting=!1,this.onDeferredApply=()=>{this.isCommitting=!0;try{this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled)}finally{this.isCommitting=!1}this.deferredButtonsComp?.updateValidity(!1),this.lastKnownGridState=this.captureGridState()},this.onDeferredCancel=()=>{this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy(),this.lastKnownGridState=this.captureGridState()},this.onPivotModePanelValueChanged=()=>{this.refreshToolPanelLayouts(),this.setLastVisible(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))},this.onColumnEverythingChanged=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;let Q=this.captureGridState();if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)){this.lastKnownGridState=Q;return}let z=this.lastKnownGridState&&this.isGridStateEqual(this.lastKnownGridState,Q);if(this.lastKnownGridState=Q,!z)return;this.resetDeferredState()},this.onExternalGridChange=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))return;this.resetDeferredState(),this.lastKnownGridState=this.captureGridState()},this.registerCSS(jA)}wireBeans(Q){this.colToolPanelFactory=Q.colToolPanelFactory}setVisible(Q){if(super.setDisplayed(Q),Q&&!this.initialised)this.init(this.params)}init(Q){let J={...y(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...Q};this.params=J;let{childDestroyFuncs:Z,colToolPanelFactory:$,gos:X}=this,Y=X.isModuleRegistered("SharedPivot"),G=Y||X.isModuleRegistered("SharedRowGrouping");if(this.isDeferModeEnabled=i(J),this.toggleCss(RA,this.isDeferModeEnabled),!J.suppressPivotMode&&$&&Y)this.pivotModePanel=$.createPivotModePanel(this,Z,J,this.onPivotModePanelValueChanged);let q=this.createBean(new iY);if(this.primaryColsPanel=q,Z.push(()=>this.destroyBean(this.primaryColsPanel)),q.init(!0,J,"toolPanelUi"),q.addCss("ag-column-panel-column-select"),this.appendChild(q),$){if(!J.suppressRowGroups&&G)this.rowGroupDropZonePanel=$.createRowGroupPanel(this,Z,J);if(!J.suppressValues&&G)this.valuesDropZonePanel=$.createValuesPanel(this,Z,J);if(!J.suppressPivots&&Y)this.pivotDropZonePanel=$.createPivotPanel(this,Z,J);this.setLastVisible();let[H]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});Z.push(()=>H())}if(this.isDeferModeEnabled){let H=this.onExternalGridChange;Z.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:H,columnVisible:H,columnRowGroupChanged:H,columnValueChanged:H,columnPivotChanged:H,columnPivotModeChanged:H,newColumnsLoaded:H,...J.suppressSyncLayoutWithGrid?{}:{columnMoved:H}}))}if(J.buttons){if(!J.buttons.includes("apply"))R(298);if(J.buttons.length)this.initDeferredButtons(J.buttons)}this.initialised=!0}initDeferredButtons(Q){let z=this.createBean(new y6({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=z,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});let J=this.getLocaleTextFunc(),Z=Q.map(($)=>({type:$,label:J($==="apply"?"applyColumnToolPanel":"cancelColumnToolPanel",$==="apply"?"Apply":"Cancel")}));z.updateButtons(Z),z.updateValidity(!1),z.addManagedListeners(z,{apply:this.onDeferredApply,cancel:this.onDeferredCancel}),this.appendChild(z)}resetDeferredState(){this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy()}captureGridState(){let{beans:Q}=this,z=(J)=>(J??[]).map((Z)=>Z.getColId());return{rowGroupColIds:z(Q.rowGroupColsSvc?.columns),valueColIds:z(Q.valueColsSvc?.columns),pivotColIds:z(Q.pivotColsSvc?.columns),pivotMode:Q.colModel.isPivotMode(),columnOrder:Q.colModel.getCols().map((J)=>J.getColId()),visibleColIds:Q.colModel.getCols().filter((J)=>J.isVisible()).map((J)=>J.getColId()),sortState:Q.colModel.getCols().filter((J)=>J.getSort()).map((J)=>`${J.getColId()}:${J.getSort()}:${J.getSortIndex()}`),aggFuncState:(Q.valueColsSvc?.columns??[]).map((J)=>J.getAggFunc()),widthState:Q.colModel.getCols().map((J)=>`${J.getColId()}:${J.getActualWidth()}`)}}isGridStateEqual(Q,z){return X0(Q.rowGroupColIds,z.rowGroupColIds)&&X0(Q.valueColIds,z.valueColIds)&&X0(Q.pivotColIds,z.pivotColIds)&&Q.pivotMode===z.pivotMode&&X0(Q.columnOrder,z.columnOrder)&&X0(Q.visibleColIds,z.visibleColIds)&&X0(Q.sortState,z.sortState)&&X0(Q.aggFuncState,z.aggFuncState)&&X0(Q.widthState,z.widthState)}refreshDeferredUi(){this.refreshToolPanelLayouts(),this.setLastVisible(),this.pivotModePanel?.refreshEditStrategy(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))}refreshToolPanelLayouts(){this.primaryColsPanel.syncLayoutWithGrid(),this.rowGroupDropZonePanel?.refreshGui(),this.valuesDropZonePanel?.refreshGui(),this.pivotDropZonePanel?.refresh()}setPivotModeSectionVisible(Q){let z=this.colToolPanelFactory;if(!z)return;this.pivotModePanel=z.setPanelVisible(this.pivotModePanel,Q,z.createPivotModePanel.bind(z,this,this.childDestroyFuncs,this.params,this.onPivotModePanelValueChanged,!0)),this.setLastVisible()}setRowGroupsSectionVisible(Q){let z=this.colToolPanelFactory;if(!z)return;this.rowGroupDropZonePanel=z.setPanelVisible(this.rowGroupDropZonePanel,Q,z.createRowGroupPanel.bind(z,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setValuesSectionVisible(Q){let z=this.colToolPanelFactory;if(!z)return;this.valuesDropZonePanel=z.setPanelVisible(this.valuesDropZonePanel,Q,z.createValuesPanel.bind(z,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setPivotSectionVisible(Q){let z=this.colToolPanelFactory;if(!z)return;this.pivotDropZonePanel=z.setPanelVisible(this.pivotDropZonePanel,Q,z.createPivotPanel.bind(z,this,this.childDestroyFuncs,this.params)),this.pivotDropZonePanel?.setDisplayed(Q),this.setLastVisible()}setResizers(){for(let Q of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!Q)continue;let z=Q.getGui();Q.toggleResizable(!z.classList.contains("ag-last-column-drop")&&!z.classList.contains("ag-hidden")&&!z.classList.contains("ag-last-visible-child"))}}setLastVisible(){let Q=this.getGui(),z=Array.prototype.slice.call(Q.querySelectorAll(".ag-column-drop"));for(let $ of z)$.classList.remove("ag-last-column-drop");let J=Q.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),Z=b(J);if(Z)Z.classList.add("ag-last-column-drop");this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!Z),this.setResizers()}resetChildrenHeight(){let z=this.getGui().children;for(let J=0;JX.getGui().getBoundingClientRect()),$=Z.findIndex((X)=>this.horizontal?X.right>J&&X.leftJ);if($===-1){let X=this.gos.get("enableRtl");if(Z.every((q)=>J>(this.horizontal?q.right:q.bottom)))return X&&this.horizontal?0:this.childPillComponents.length;if(Z.every((q)=>J<(this.horizontal?q.left:q.top)))return X&&this.horizontal?this.childPillComponents.length:0;return this.insertIndex}if(this.insertIndex<=$)return $+1;return $}checkDragStartedBySelf(Q){if(this.state!=="notDragging")return;this.state="rearrangeItems",this.potentialDndItems=this.getItems(Q.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(Q),this.refreshGui()}onDragging(Q){if(this.checkDragStartedBySelf(Q),this.checkInsertIndex(Q))this.refreshGui()}handleDragEnterEnd(Q){}onDragEnter(Q){let z=this.getItems(Q.dragSource.getDragItem());this.state="newItemsIn";let J=z.filter(($)=>this.isItemDroppable($,Q)),Z=J.every(($)=>this.childPillComponents.map((X)=>X.getItem()).indexOf($)!==-1);if(J.length===0)return;if(this.potentialDndItems=J,Z){this.state="notDragging";return}this.handleDragEnterEnd(Q),this.checkInsertIndex(Q),this.refreshGui()}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(Q){}onDragLeave(Q){if(this.state==="rearrangeItems"){let z=this.getItems(Q.dragSource.getDragItem());this.removeItems(z)}if(this.isPotentialDndItems())this.handleDragLeaveEnd(Q),this.potentialDndItems=[],this.refreshGui();this.state="notDragging"}onDragCancel(Q){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.handleDragLeaveEnd(Q);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}onDragStop(){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.addItems(this.potentialDndItems);else this.rearrangeItems(this.potentialDndItems);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}removeItems(Q){let z=this.getExistingItems().filter((J)=>!Q.includes(J));this.updateItems(z),this.refreshGui()}addItems(Q){if(!Q)return;let z=this.getExistingItems().slice(),J=Q.filter((Z)=>z.indexOf(Z)<0);iX(z,J,this.insertIndex),this.updateItems(z),this.refreshGui()}addItem(Q){this.insertIndex=this.getExistingItems().length,this.addItems([Q])}rearrangeItems(Q,z){let J;if(!z)J=this.getNonGhostItems().slice();else J=this.getExistingItems().filter((Z)=>Q.indexOf(Z)===-1);if(iX(J,Q,this.insertIndex),X0(J,this.getExistingItems()))return!1;return this.updateItems(J),this.refreshGui(),!0}refreshGui(){let Q=0;if(!this.horizontal)Q=this.ePillDropList.scrollTop;let z=this.resizeEnabled,J=this.getFocusedItem(),{eGridDiv:Z}=this.beans,$=V1(),X=null;if($)X=R0(this.beans,Z)??R0(this.beans,Z,!1,!0);if(this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),Q!==0)this.ePillDropList.scrollTop=Q;if(z)this.toggleResizable(z);if($)this.restoreFocus(J,X)}getFocusedItem(){let Q=this.getGui(),z=d(this.beans);if(!Q.contains(z))return-1;return Array.from(Q.querySelectorAll(".ag-column-drop-cell")).indexOf(z)}focusItemAtIndex(Q){let z=this.getGui(),Z=Array.from(z.querySelectorAll(".ag-column-drop-cell"))[Q];if(!Z)return;Z.focus({preventScroll:!0})}restoreFocus(Q,z){let J=this.getGui(),Z=Array.from(J.querySelectorAll(".ag-column-drop-cell"));if(Q===-1)return;if(Z.length===0)z.focus();let $=Math.min(Z.length-1,Q),X=Z[$];if(X)X.focus()}focusList(Q){let z=Q?this.childPillComponents.length-1:0;this.restoreFocus(z,this.getFocusableElement())}getNonGhostItems(){let Q=this.getExistingItems();if(this.isPotentialDndItems())return Q.filter((z)=>!this.potentialDndItems.includes(z));return Q}addItemsToGui(){let z=this.getNonGhostItems().map((J)=>this.createItemComponent(J,!1));if(this.isPotentialDndItems()){let J=this.potentialDndItems.map((Z)=>this.createItemComponent(Z,!0));if(this.insertIndex>=z.length)z.push(...J);else z.splice(this.insertIndex,0,...J)}this.appendChild(this.ePillDropList),z.forEach((J,Z)=>{if(Z>0)this.addArrow(this.ePillDropList);this.ePillDropList.appendChild(J.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){let{childPillComponents:Q,ePillDropList:z}=this,J=Q.length;H0(z,J===0?"presentation":"listbox");for(let Z=0;Zthis.destroyBean(J)),!z)this.childPillComponents.push(J);return J}addIconAndTitleToGui(){let{title:Q,icon:z}=this.params;if(!Q||!z)return;let J=Z0({tag:"div"});if(kZ(J,!0),this.addElementClasses(J,"title-bar"),this.addElementClasses(z,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),J.appendChild(z),!this.horizontal){let Z=Z0({tag:"span"});this.addElementClasses(Z,"title"),Z.textContent=Q,J.appendChild(Z)}this.appendChild(J)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){let{emptyMessage:Q}=this.params;if(!Q||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;let z=Z0({tag:"span"});z.textContent=Q,this.addElementClasses(z,"empty-message"),this.ePillDropList.appendChild(z)}addArrow(Q){if(this.horizontal){let z=this.gos.get("enableRtl"),J=h(z?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(J,"cell-separator"),Q.appendChild(J)}}},vA={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},IA=class extends x{constructor(Q,z,J,Z,$){super();this.dragSourceDropTarget=Q,this.ghost=z,this.horizontal=J,this.template=Z,this.agComponents=$,this.eText=S,this.eDragHandle=S,this.eButton=S}postConstruct(){this.setTemplate(this.template??vA,this.agComponents);let Q=this.getGui(),{beans:z,eDragHandle:J,eText:Z,eButton:$}=this;if(this.addElementClasses(Q),this.addElementClasses(J,"drag-handle"),this.addElementClasses(Z,"text"),this.addElementClasses($,"button"),J.appendChild(h("columnDrag",z)),$.appendChild(h("cancel",z)),this.tooltipFeature=this.createOptionalManagedBean(z.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable())this.addDragSource();this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){let Q=this.getLocaleTextFunc(),z=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(z,Q),E0(this.getGui(),z.join(". "))}addAdditionalAriaInstructions(Q,z){if(this.isRemovable()){let J=z("ariaDropZoneColumnComponentDescription","Press DELETE to remove");Q.push(J)}}setupTooltip(){let Q=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());Q(),this.addManagedEventListeners({newColumnsLoaded:Q})}getDragSourceId(){return}getDefaultIconName(){return"notAllowed"}addDragSource(){let{beans:{dragAndDrop:Q},eDragHandle:z}=this,J=this.createGetDragItem(),Z=this.getDefaultIconName(),$={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:z,getDefaultIconName:()=>Z,getDragItem:J,dragItemName:this.getDisplayName()};Q?.addDragSource($,!0),this.addDestroyFunc(()=>Q?.removeDragSource($))}setupComponents(){if(this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost)this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){N(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();let Q={type:"columnRemove"};this.addGuiEventListener("keydown",(J)=>this.onKeyDown(J)),this.addManagedElementListeners(this.eButton,{click:(J)=>{this.dispatchLocalEvent(Q),J.stopPropagation()}});let z=new h0(this.eButton);this.addManagedListeners(z,{tap:()=>this.dispatchLocalEvent(Q)}),this.addDestroyFunc(z.destroy.bind(z))}onKeyDown(Q){if(Q.key===V.DELETE){if(this.isRemovable())Q.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"})}}getDisplayValue(){return this.getDisplayName()}addElementClasses(Q,z){z=z?`-${z}`:"";let J=this.horizontal?"horizontal":"vertical";Q.classList.add(`ag-column-drop-cell${z}`,`ag-column-drop-${J}-cell${z}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},CA=class extends IA{constructor(Q,z,J,Z,$,X){super(z,J,$);this.column=Q,this.dropZonePurpose=Z,this.updateParams=X,this.eSortIndicator=S,this.popupShowing=!1,this.deferApply=i(X)}postConstruct(){let{sortSvc:Q,colNames:z}=this.beans;if(this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},Q?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},Q)this.agComponents=[Q.getSortIndicatorSelector()];if(this.displayName=z.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.deferApply)this.eDragHandle.setAttribute("data-column-tool-panel-deferred","");if(Q)this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}});if(this.isGroupingZone())this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(Q,z){let J=this.gos.get("rowGroupPanelSuppressSort"),Z=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!Z){let $=z("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");Q.push($)}if(this.isGroupingZone()&&this.column.isSortable()&&!J){let $=z("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");Q.push($)}super.addAdditionalAriaInstructions(Q,z)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){let Q=this.getLocaleTextFunc(),{name:z,aggFuncName:J}=this.getColumnAndAggFuncName(),Z=Q("ariaDropZoneColumnComponentAggFuncSeparator"," of "),$={asc:Q("ariaDropZoneColumnComponentSortAscending","ascending"),desc:Q("ariaDropZoneColumnComponentSortDescending","descending")},X=this.getCurrentSortDirection(this.column),Y=this.gos.get("rowGroupPanelSuppressSort");return[J&&`${J}${Z}`,z,this.isGroupingZone()&&!Y&&X&&`, ${$[X]}`].filter((G)=>!!G).join("")}getColumnAndAggFuncName(){let Q=this.displayName,z="";if(this.isAggregationZone()){let J=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),Z=typeof J==="string"?J:"agg";z=this.getLocaleTextFunc()(Z,Z)}return{name:Q,aggFuncName:z}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;let{gos:Q,column:z,eSortIndicator:J}=this;if(!Q.get("rowGroupPanelSuppressSort")){J.setupSort(z,!0,this.getSortDefOverride.bind(this));let Z=($)=>{$.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,z,$),J.refresh(),this.setupAria(),N0(this.beans,this.updateParams)};this.addGuiEventListener("click",Z),this.addGuiEventListener("keydown",($)=>{if($.key===V.ENTER&&this.isGroupingZone())Z($)})}}getCurrentSortDirection(Q){return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,Q)?.direction??null}getSortDefOverride(){if(!this.deferApply)return;return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,this.column)}getDefaultIconName(){return"hide"}createGetDragItem(){let{column:Q}=this;return()=>{let z={};return z[Q.getId()]=Q.isVisible(),{columns:[Q],visibleState:z}}}setupComponents(){if(super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(Q){if(super.onKeyDown(Q),Q.key===V.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))Q.preventDefault(),this.onShowAggFuncSelection()}getDisplayValue(){let{name:Q,aggFuncName:z}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${z}(${Q})`:Q}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;let{aggFuncSvc:Q,popupSvc:z}=this.beans,J=new OY({cssIdentifier:"select-agg-func"}),Z=Q.getFuncNames(this.column),$=this.getGui(),X=J.getGui();J.setModel({getRow:function(B){return Z[B]},getRowCount:function(){return Z.length}}),this.createBean(J);let Y=Z0({tag:"div",cls:"ag-select-agg-func-popup"});Y.style.top="0px",Y.style.left="0px",Y.appendChild(X),Y.style.width=`${$.clientWidth}px`;let[G]=this.addManagedElementListeners(Y,{focusout:(B)=>{if(!Y.contains(B.relatedTarget)&&_)_.hideFunc()}}),q=(B)=>{if(this.destroyBean(J),this.popupShowing=!1,B?.key==="Escape")$.focus();if(G)G()},H=this.getLocaleTextFunc(),_=z.addPopup({modal:!0,eChild:Y,closeOnEsc:!0,closedCallback:q,ariaLabel:H("ariaLabelAggregationFunction","Aggregation Function")});if(_)J.setComponentCreator(this.createAggSelect.bind(this,_.hideFunc));J.addGuiEventListener("keydown",(B)=>{if(B.key===V.ENTER||B.key===V.SPACE){let E=J.getLastFocusedRow();if(E==null)return;let K=J.getComponentAt(E);if(K)K.selectItem()}}),z.positionPopupByComponent({type:"aggFuncSelect",eventSource:$,ePopup:Y,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),J.refresh();let U=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),W=Z.findIndex((B)=>B===U);if(W===-1)W=0;J.focusRow(W)}createAggSelect(Q,z){let J=()=>{if(Q(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,z,"toolPanelDragAndDrop"),this.column){let G=this.getGui().querySelector(".ag-column-drop-cell-text");if(G)G.textContent=this.getDisplayValue();this.setupAria()}N0(this.beans,this.updateParams)},Z=this.getLocaleTextFunc(),$=(z||"").toString(),X=Z($,$);return new bA(J,X)}isGroupingAndLocked(){return this.isGroupingZone()&&TJ(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return qQ.ToolPanel}destroy(){super.destroy(),this.column=null}},bA=class extends x{constructor(Q,z){super({tag:"div",cls:"ag-select-agg-func-item",children:z});this.selectItem=Q,this.addGuiEventListener("click",this.selectItem)}},Y7=class extends TA{constructor(Q,z,J){super(Q);this.dropZonePurpose=z,this.updateParams=J,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(Q){super.init(Q),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(Q){return Q.columns??[]}isInterestedIn(Q,z){if(Q===qQ.HeaderCell)return!0;if(Q!==qQ.ToolPanel)return!1;if(!this.horizontal)return!0;return!z.hasAttribute("data-column-tool-panel-deferred")}minimumAllowedNewInsertIndex(){let{gos:Q,rowGroupColsSvc:z}=this.beans,J=Q.get("groupLockGroupColumns"),Z=z?.columns.length??0;if(J===-1)return Z;return Math.min(J,Z)}showOrHideColumnOnExit(Q){return this.isRowGroupPanel()&&TZ(this.gos,!0)&&!Q.fromNudge}handleDragEnterEnd(Q){if(this.showOrHideColumnOnExit(Q)){let Z=Q.dragSource.getDragItem().columns;this.setColumnsVisible(Z,!1,"uiColumnDragged")}}handleDragLeaveEnd(Q){if(this.showOrHideColumnOnExit(Q)){let J=Q.dragSource.getDragItem();this.setColumnsVisible(J.columns,!0,"uiColumnDragged")}}setColumnsVisible(Q,z,J){if(!Q)return;if(i(this.updateParams))return;let Z=Q.filter(($)=>!$.getColDef().lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,Z,z,J)}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(Q,z,J,Z){return new CA(Q,z,J,this.dropZonePurpose,Z,this.updateParams)}},yA=class extends Y7{constructor(Q,z){super(Q,"pivot",z)}postConstruct(){let Q=this.getLocaleTextFunc(),z=Q("pivotColumnsEmptyMessage","Drag here to set column labels"),J=Q("pivots","Column Labels");if(super.init({icon:h("pivotPanel",this.beans,null),emptyMessage:z,title:J}),this.horizontal)Bz(this.beans,this,this.getGui());this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){let Q=this.beans.colModel,z=Q.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(z);break;case"onlyWhenPivoting":{let J=Q.isPivotActive();this.setDisplayed(z&&J);break}default:this.setDisplayed(!1);break}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(i(this.updateParams)))}isItemDroppable(Q,z){if(this.gos.get("functionsReadOnly")||!Q.isPrimary())return!1;let J=this.beans.columnStateUpdateStrategy.getPivotColumns(i(this.updateParams)).includes(Q);return Q.isAllowPivot()&&(!J||this.isSourceEventFromTarget(z))}updateItems(Q){this.beans.columnStateUpdateStrategy.setPivotColumns(i(this.updateParams),Q,"toolPanelUi"),N0(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(i(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},xA=class extends Y7{constructor(Q,z){super(Q,"rowGroup",z)}postConstruct(){let Q=this.getLocaleTextFunc(),z=Q("rowGroupColumnsEmptyMessage","Drag here to set row groups"),J=Q("groups","Row Groups");if(super.init({icon:h("rowGroupPanel",this.beans,null),emptyMessage:z,title:J}),this.horizontal)Bz(this.beans,this,this.getGui());this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(Q,z){if(this.gos.get("functionsReadOnly")||!Q.isPrimary()||Q.colDef.showRowGroup)return!1;let J=this.beans.columnStateUpdateStrategy.getRowGroupColumns(i(this.updateParams)).includes(Q);return Q.isAllowRowGroup()&&(!J||this.isSourceEventFromTarget(z))}updateItems(Q){this.beans.columnStateUpdateStrategy.setRowGroupColumns(i(this.updateParams),Q,"toolPanelUi"),N0(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(i(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},wA=class extends Y7{constructor(Q,z){super(Q,"aggregation",z)}postConstruct(){let Q=this.getLocaleTextFunc(),z=Q("valueColumnsEmptyMessage","Drag here to aggregate"),J=Q("values","Values");super.init({icon:h("valuePanel",this.beans,null),emptyMessage:z,title:J}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(Q,z){if(this.gos.get("functionsReadOnly")||!Q.isPrimary())return!1;let J=this.beans.columnStateUpdateStrategy.getValueColumns(i(this.updateParams)).includes(Q);return Q.isAllowValue()&&(!J||this.isSourceEventFromTarget(z))}updateItems(Q){this.beans.columnStateUpdateStrategy.setValueColumns(i(this.updateParams),Q,"toolPanelUi"),N0(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(i(this.updateParams))}},NA={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},gA=class extends x{constructor(Q,z){super();this.params=Q,this.onPivotModeValueChanged=z,this.cbPivotMode=S}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(i(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(NA,[OX]);let Q=this.cbPivotMode;Q.setValue(this.getCurrentPivotMode());let z=this.getLocaleTextFunc();Q.setLabel(z("pivotMode","Pivot Mode"));let J=()=>{let $=!!Q.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(i(this.params),$,"toolPanelUi"),this.onPivotModeValueChanged?.()},Z=()=>{Q.setValue(this.getCurrentPivotMode())};this.addManagedListeners(Q,{fieldValueChanged:J}),this.addManagedEventListeners({newColumnsLoaded:Z,columnPivotModeChanged:Z})}},hA=class extends j{constructor(){super(...arguments);this.beanName="colToolPanelFactory"}setPanelVisible(Q,z,J){if(Q)Q.setDisplayed(z);else if(z)Q=J();return Q}createRowGroupPanel(Q,z,J){return this.createPanel(Q,z,new xA(!1,J))}createValuesPanel(Q,z,J){return this.createPanel(Q,z,new wA(!1,J))}createPivotPanel(Q,z,J){return this.createPanel(Q,z,new yA(!1,J))}createPivotModePanel(Q,z,J,Z,$){return this.createPanel(Q,z,new gA(J,Z),$)}createPanel(Q,z,J,Z){if(J=Q.createBean(J),z.push(()=>Q.destroyBean(J)),Z)Q.prependChild(J);else Q.appendChild(J);return J}},nX=()=>{},uA=class extends j{constructor(){super(...arguments);this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(Q,z,J){this.getUpdateStrategy(Q).applyColumnState(z,J)}commit(Q){this.getUpdateStrategy(Q).commit()}hasPendingChanges(Q){return this.getUpdateStrategy(Q).hasPendingChanges()}moveColumns(Q,z,J,Z){this.getUpdateStrategy(Q).moveColumns(z,J,Z)}reset(Q){this.getUpdateStrategy(Q).reset()}setColumnsVisible(Q,z,J,Z){this.getUpdateStrategy(Q).setColumnsVisible(z,J,Z)}isColumnVisibleInToolPanel(Q,z){return this.getUpdateStrategy(Q).isColumnVisibleInToolPanel(z)}setRowGroupColumns(Q,z,J){this.getUpdateStrategy(Q).setRowGroupColumns(z,J)}getRowGroupColumns(Q){return this.getUpdateStrategy(Q).getRowGroupColumns()}getPrimaryColumns(Q){return this.getUpdateStrategy(Q).getPrimaryColumns()}hasDeferredColumnOrder(Q){return this.getUpdateStrategy(Q).hasDeferredColumnOrder()}setValueColumns(Q,z,J){this.getUpdateStrategy(Q).setValueColumns(z,J)}getValueColumns(Q){return this.getUpdateStrategy(Q).getValueColumns()}setColumnAggFunc(Q,z,J,Z){this.getUpdateStrategy(Q).setColumnAggFunc(z,J,Z)}getColumnAggFunc(Q,z){return this.getUpdateStrategy(Q).getColumnAggFunc(z)}setPivotColumns(Q,z,J){this.getUpdateStrategy(Q).setPivotColumns(z,J)}getPivotColumns(Q){return this.getUpdateStrategy(Q).getPivotColumns()}setPivotMode(Q,z,J){this.getUpdateStrategy(Q).setPivotMode(z,J)}getPivotMode(Q){return this.getUpdateStrategy(Q).getPivotMode()}isColumnSelectedInPivotModeToolPanel(Q,z){return this.getUpdateStrategy(Q).isColumnSelectedInPivotModeToolPanel(z)}progressSortFromEvent(Q,z,J){this.getUpdateStrategy(Q).progressSortFromEvent(z,J)}getSortDef(Q,z){return this.getUpdateStrategy(Q).getSortDef(z)}getUpdateStrategy(Q){return Q?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new mA(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new cA(this.beans))}},mA=class{constructor(Q){this.beans=Q,this.lastPivotColIds=[],this.reset=nX,this.commit=nX,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(Q,z){if(Q.length===0)return;n0(this.beans,{state:Q},z)}moveColumns(Q,z,J){this.beans.colMoves?.moveColumns(Q,z,J),pA(this.beans)}setColumnsVisible(Q,z,J){let Z=Q.filter(($)=>!$.getColDef().lockVisible);this.beans.colModel.setColsVisible(Z,z,J)}setRowGroupColumns(Q,z){this.beans.rowGroupColsSvc?.setColumns(Q,z)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return G7(this.beans)}setValueColumns(Q,z){this.beans.valueColsSvc?.setColumns(Q,z)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(Q,z,J){this.beans.valueColsSvc?.setColumnAggFunc?.(Q,z,J)}getColumnAggFunc(Q){return Q.getAggFunc()}setPivotColumns(Q,z){this.lastPivotColIds=Q.map((J)=>J.getColId()),this.beans.pivotColsSvc?.setColumns(Q,z)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(Q,z){let{colModel:J,gos:Z,ctrlsSvc:$}=this.beans;if(Q===J.isPivotMode())return;let X=this.beans.pivotColsSvc?.columns.map((Y)=>Y.getColId())??[];if(X.length>0)this.lastPivotColIds=X;if(!Q){let Y=this.beans.colModel.getColDefCols()??[];n0(this.beans,{state:Y.map((G)=>({colId:G.getColId(),pivot:!1,pivotIndex:null}))},z)}if(Z.updateGridOptions({options:{pivotMode:Q},source:z}),Q&&this.lastPivotColIds.length>0)this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,z);for(let Y of $.getHeaderRowContainerCtrls())Y.refresh()}progressSortFromEvent(Q,z){this.beans.sortSvc?.progressSortFromEvent(Q,z)}isColumnVisibleInToolPanel(Q){return Q.isVisible()}isColumnSelectedInPivotModeToolPanel(Q){return Q.isAnyFunctionActive()}getPivotMode(){return this.beans.colModel.isPivotMode()}getSortDef(Q){return Q.getSortDef()}},cA=class{constructor(Q){this.beans=Q,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){let{state:Q,beans:z}=this,{columnState:J,columnOrder:Z,rowGroup:$,aggregation:X,pivot:Y,pivotMode:G,sort:q,aggFuncs:H}=Q,_=(U)=>(U??[]).map((W)=>W.getColId());if(J)for(let[U,W]of J.patches){let B=z.colModel.getColDefCol(U);if(!B)continue;if(W.hide!==void 0&&W.hide!==!B.isVisible()||W.rowGroup!==void 0&&!!W.rowGroup!==B.isRowGroupActive()||W.pivot!==void 0&&!!W.pivot!==B.isPivotActive()||W.aggFunc!==void 0&&(W.aggFunc??null)!==(B.getAggFunc()??null))return!0}if(Z&&!X0(Z.colIds,n6(z)))return!0;if($&&!X0($.colIds,_(z.rowGroupColsSvc?.columns)))return!0;if(X&&!X0(X.colIds,_(z.valueColsSvc?.columns)))return!0;if(Y&&!X0(Y.colIds,_(z.pivotColsSvc?.columns)))return!0;if(G&&G.pivotMode!==z.colModel.isPivotMode())return!0;if(q){for(let[U,W]of q.sortDefsByColId){let B=z.colModel.getColDefCol(U);if(!B)continue;if((W?.direction??null)!==(B.getSortDef()?.direction??null))return!0}if(q.baselineCleared){let U=G7(z);for(let W of U)if(!q.sortDefsByColId.has(W.getColId())&&W.getSortDef()!==null)return!0}}if(H)for(let[U,W]of H.values){let B=z.colModel.getColDefCol(U);if(!B)continue;if(W!==B.getAggFunc())return!0}return!1}commit(){let{beans:Q,state:z}=this,J=[];for(let $ of Object.keys(z)){let X=z[$];if(X)J.push({type:$,...X})}let Z=J.sort(($,X)=>$.seq-X.seq);for(let $ of Z)switch($.type){case"columnState":{n0(Q,{state:[...$.patches.values()]},$.eventType);break}case"columnOrder":{let X=$.colIds.map((Y)=>Q.colModel.getColDefCol(Y)).filter((Y)=>!!Y&&vJ(Y));if(!Q.colModel.isPivotMode())for(let Y=0;YvJ(U)),_=(H>=0?H:0)+Y;if(q[_]!==G)Q.colMoves?.moveColumns([G],_,$.eventType,!0)}nY(Q,X);break}case"rowGroup":{Q.rowGroupColsSvc?.setColumns($.colIds,$.eventType);break}case"aggregation":{Q.valueColsSvc?.setColumns($.colIds,$.eventType);break}case"pivot":{this.lastPivotColIds=$.colIds,Q.pivotColsSvc?.setColumns($.colIds,$.eventType);break}case"pivotMode":{let{colModel:X,ctrlsSvc:Y,gos:G,stateSvc:q}=Q;if($.pivotMode!==X.isPivotMode()){let H=Q.pivotColsSvc?.columns.map((W)=>W.getColId())??[];if(H.length>0)this.lastPivotColIds=H;let _=q?.getState().pivot?.pivotColIds??H,U=$.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:_;if(q?.setState({...q.getState(),pivot:{pivotMode:$.pivotMode,pivotColIds:U}},["pivot"]),!$.pivotMode){let W=Q.colModel.getColDefCols()??[];n0(Q,{state:W.map((B)=>({colId:B.getColId(),pivot:!1,pivotIndex:null}))},$.eventType)}if(G.updateGridOptions({options:{pivotMode:$.pivotMode},source:$.eventType}),$.pivotMode&&U.length>0)Q.pivotColsSvc?.setColumns(U,$.eventType);for(let W of Y.getHeaderRowContainerCtrls())W.refresh()}break}case"sort":{let X=[],Y=0;for(let[G,q]of $.sortDefsByColId)X.push({colId:G,sort:q?.direction??null,sortIndex:q?.direction?Y++:null,sortType:q?.type??void 0});n0(Q,{state:X,defaultState:$.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},$.eventType);break}case"aggFuncs":{for(let[X,Y]of $.values){let G=Q.colModel.getColDefCol(X);if(!G)continue;Q.valueColsSvc?.setColumnAggFunc?.(G,Y,$.eventType)}break}}this.reset()}applyColumnState(Q,z){for(let Z of Q)d6(this.state,Z);let J=Z2(this.state);J.seq=iQ(this.sequence),this.sequence=J.seq,J.eventType=z}moveColumns(Q,z,J){let Z=new Set(Q.map((q)=>q.getColId())),X=(this.state.columnOrder?.colIds??n6(this.beans)).filter((q)=>!Z.has(q)),Y=Q.map((q)=>q.getColId()),G=iQ(this.sequence);this.sequence=G,this.state.columnOrder={colIds:[...X.slice(0,z),...Y,...X.slice(z)],eventType:J,seq:G}}setColumnsVisible(Q,z,J){for(let $ of Q){if($.getColDef().lockVisible)continue;d6(this.state,{colId:$.getColId(),hide:!z})}let Z=Z2(this.state);Z.seq=iQ(this.sequence),this.sequence=Z.seq,Z.eventType=J}setRowGroupColumns(Q,z){t6(this.state,"rowGroup");let J=iQ(this.sequence);this.sequence=J,this.state.rowGroup={colIds:Q.map((Z)=>Z.getColId()),eventType:z,seq:J}}setValueColumns(Q,z){t6(this.state,"aggFunc");let J=new Set((this.beans.valueColsSvc?.columns??[]).map((X)=>X.getColId())),Z=dX(this.state);for(let X of Q)if(!J.has(X.getColId())&&!Z.values.has(X.getColId())){let Y=X.getAggFunc(),G=Y!=null?Y:this.beans.aggFuncSvc?.getDefaultAggFunc(X);if(G!=null)Z.values.set(X.getColId(),G)}let $=iQ(this.sequence);this.sequence=$,Z.seq=$,Z.eventType=z,this.state.aggregation={colIds:Q.map((X)=>X.getColId()),eventType:z,seq:$}}setColumnAggFunc(Q,z,J){d6(this.state,{colId:Q.getColId(),aggFunc:z});let Z=Z2(this.state);Z.seq=iQ(this.sequence),this.sequence=Z.seq,Z.eventType=J;let $=dX(this.state);$.seq=Z.seq,$.eventType=J,$.values.set(Q.getColId(),z)}getColumnAggFunc(Q){let z=Q.getColId();if(this.state.aggFuncs?.values.has(z))return this.state.aggFuncs.values.get(z);return Q.getAggFunc()}isColumnVisibleInToolPanel(Q){let z=this.state.columnState?.patches.get(Q.getColId());if(z?.hide!==void 0)return!z.hide;return Q.isVisible()}isColumnSelectedInPivotModeToolPanel(Q){let z=Q.getColId(),J=this.state.columnState?.patches.get(z),Z;if(J?.rowGroup!==void 0)Z=!!J.rowGroup;else if(this.state.rowGroup)Z=this.state.rowGroup.colIds.includes(z);else Z=Q.isRowGroupActive();let $;if(J?.pivot!==void 0)$=!!J.pivot;else if(this.state.pivot)$=this.state.pivot.colIds.includes(z);else $=Q.isPivotActive();let X;if(J?.aggFunc!==void 0)X=J.aggFunc!=null;else if(this.state.aggregation)X=this.state.aggregation.colIds.includes(z);else X=Q.isValueActive();return Z||$||X}setPivotColumns(Q,z){t6(this.state,"pivot");let J=iQ(this.sequence);this.sequence=J,this.state.pivot={colIds:Q.map((Z)=>Z.getColId()),eventType:z,seq:J}}setPivotMode(Q,z){let J=iQ(this.sequence);this.sequence=J,this.state.pivotMode={pivotMode:Q,eventType:z,seq:J}}getRowGroupColumns(){return VJ(this.beans,i6(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,(Q)=>Q.rowGroup==null?void 0:!!Q.rowGroup))}getPrimaryColumns(){return VJ(this.beans,this.state.columnOrder?.colIds??n6(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return VJ(this.beans,i6(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,(Q)=>Q.aggFunc===void 0?void 0:Q.aggFunc!=null))}getPivotColumns(){if(!this.getPivotMode())return[];let Q=this.beans.pivotColsSvc?.columns,z=Q?.length?Q:VJ(this.beans,this.lastPivotColIds);return VJ(this.beans,i6(this.state.pivot?.colIds,z,this.state.columnState?.patches,(J)=>J.pivot==null?void 0:!!J.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.isPivotMode()}getSortDef(Q){let z=this.state.sort,J=Q.getColId(),Z=z?.sortDefsByColId;if(Z?.has(J))return Z.get(J)??null;if(z?.baselineCleared)return null;return Q.getSortDef()}progressSortFromEvent(Q,z){let J=this.state.sort??{sortDefsByColId:new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:Z}=this.beans,$=Q.getColId(),X;if(J.sortDefsByColId.has($))X=J.sortDefsByColId.get($);else if(J.baselineCleared)X=null;else X=Q.getSortDef();let Y=Z?.getNextSortDirection(Q,X);if(!Y)return;let{gos:G}=this.beans;if(!(((G.get("multiSortKey")==="ctrl"?z.ctrlKey||z.metaKey:z.shiftKey)||G.get("alwaysMultiSort"))&&!G.get("suppressMultiSort")))J.sortDefsByColId.clear(),J.baselineCleared=!0;J.sortDefsByColId.set($,Y.direction?Y:null),J.seq=iQ(this.sequence),this.sequence=J.seq,this.state.sort=J}};function VJ(Q,z){if(!z)return[];return z.map((J)=>Q.colModel.getColDefCol(J)).filter((J)=>!!J)}function i6(Q,z,J,Z){let $=[...Q??z?.map((Y)=>Y.getColId())??[]];if(!J?.size)return $;let X=new Set($);for(let[Y,G]of J){let q=Z(G);if(q===void 0)continue;if(q){if(!X.has(Y))$.push(Y),X.add(Y);continue}if(!X.has(Y))continue;X.delete(Y);let H=$.indexOf(Y);if(H>=0)$.splice(H,1)}return $}function pA(Q){let z=Q.colModel.getCols().filter((J)=>vJ(J)).map((J)=>Q.colModel.getColDefCol(J.getColId())).filter((J)=>!!J);nY(Q,z)}function nY(Q,z){let J=iA(Q);if(!J)return;let Z=new Set(z);J.list=[...z,...J.list.filter(($)=>vJ($)&&!Z.has($))]}function n6(Q){return G7(Q).map((z)=>z.getColId())}function G7(Q){return(Q.colModel.getColDefCols()??Q.colModel.getCols()).filter((z)=>vJ(z))}function iA(Q){let z=Q.colModel.colDefCols,J=z?.list;if(!Array.isArray(J))return;return z}function vJ(Q){if(!Q.isPrimary())return!1;return!mz(Q)&&!GJ(Q)}function iQ(Q){return Q+1}function d6(Q,z){let J=Z2(Q),Z=J.patches.get(z.colId);J.patches.set(z.colId,Z?{...Z,...z}:z)}function t6(Q,z){let J=Q.columnState?.patches;if(!J?.size)return;for(let[Z,$]of J){if(!(z in $))continue;let X={...$};if(delete X[z],Object.keys(X).length===1){J.delete(Z);continue}J.set(Z,X)}}function Z2(Q){let{columnState:z}=Q;if(!z)z={patches:new Map,seq:0,eventType:"toolPanelUi"},Q.columnState=z;return z}function dX(Q){let{aggFuncs:z}=Q;if(!z)z={values:new Map,seq:0,eventType:"toolPanelUi"},Q.aggFuncs=z;return z}var nA=class extends j{constructor(){super(...arguments);this.beanName="columnStateUpdateStrategy"}applyColumnState(Q,z,J){this.delegate("applyColumnState",Q,z,J)}commit(Q){this.delegate("commit",Q)}hasPendingChanges(Q){return this.delegate("hasPendingChanges",Q)}moveColumns(Q,z,J,Z){this.delegate("moveColumns",Q,z,J,Z)}reset(Q){this.delegate("reset",Q)}setColumnsVisible(Q,z,J,Z){this.delegate("setColumnsVisible",Q,z,J,Z)}isColumnVisibleInToolPanel(Q,z){return this.delegate("isColumnVisibleInToolPanel",Q,z)}setRowGroupColumns(Q,z,J){this.delegate("setRowGroupColumns",Q,z,J)}getRowGroupColumns(Q){return this.delegate("getRowGroupColumns",Q)}getPrimaryColumns(Q){return this.delegate("getPrimaryColumns",Q)}hasDeferredColumnOrder(Q){return this.delegate("hasDeferredColumnOrder",Q)}setValueColumns(Q,z,J){this.delegate("setValueColumns",Q,z,J)}getValueColumns(Q){return this.delegate("getValueColumns",Q)}setColumnAggFunc(Q,z,J,Z){this.delegate("setColumnAggFunc",Q,z,J,Z)}getColumnAggFunc(Q,z){return this.delegate("getColumnAggFunc",Q,z)}setPivotColumns(Q,z,J){this.delegate("setPivotColumns",Q,z,J)}getPivotColumns(Q){return this.delegate("getPivotColumns",Q)}setPivotMode(Q,z,J){this.delegate("setPivotMode",Q,z,J)}getPivotMode(Q){return this.delegate("getPivotMode",Q)}isColumnSelectedInPivotModeToolPanel(Q,z){return this.delegate("isColumnSelectedInPivotModeToolPanel",Q,z)}progressSortFromEvent(Q,z,J){this.delegate("progressSortFromEvent",Q,z,J)}getSortDef(Q,z){return this.delegate("getSortDef",Q,z)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new uA))}delegate(Q,...z){let J=this.getUpdateStrategy();return J[Q].bind(J)(...z)}},dA={moduleName:"SharedColumnStateUpdateStrategy",version:J0,beans:[nA],dependsOn:[I0]},dY={moduleName:"ColumnsToolPanel",version:J0,beans:[hA],userComponents:{agColumnsToolPanel:SA},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[I0,dA,$7,FJ,LJ,nz,X7]},tA=class extends j{constructor(){super(...arguments);this.beanName="chartMenuItemMapper"}getChartItems(Q){let z=this.beans,J=z.chartSvc,Z=Q==="pivotChart";if(!J)return null;let $=this.getLocaleTextFunc.bind(this),X=Z?new rA(z,J,$):new sA(z,J,$),Y=J.isEnterprise(),G=X.getMenuItem();if(G?.subMenu&&!Y){let H=(_)=>({..._,subMenu:_.subMenu?.filter((U)=>!U._enterprise).map((U)=>H(U))});G=H(G)}let q=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(q)G=this.filterAndOrderChartMenu(G,q,X.getConfigLookup());return this.cleanInternals(G)}cleanInternals(Q){if(!Q)return Q;let z=(J)=>{delete J?._key,delete J?._enterprise;for(let Z of J?.subMenu??[])z(Z);return J};return z(Q)}buildLookup(Q){let z={},J=(Z)=>{if(z[Z._key]=Z,Z.subMenu)for(let $ of Z.subMenu)J($)};return J(Q),z}filterAndOrderChartMenu(Q,z,J){let Z=this.buildLookup(Q),$={...Q,subMenu:[]};for(let X of Object.keys(z)){let Y=z[X],G=J[X];if(G===null)continue;if(G==null){R(173,{group:X});continue}let q=Z[G._key];if(q)if(q.subMenu){let H=Y.map((_)=>{let U=G[_];if(U==null){R(174,{group:X,chartType:_});return}return Z[U]}).filter((_)=>_!==void 0);if(H.length>0)q.subMenu=H,$.subMenu?.push(q)}else $.subMenu?.push(q)}if($.subMenu?.length==0)return null;return $}},rA=class{constructor(Q,z,J){this.beans=Q,this.chartSvc=z,this.getLocaleTextFunc=J}getMenuItem(){let Q=this.getLocaleTextFunc(),z=(J,Z,$,X,Y=!1)=>{return{name:Q(J,Z+"‎"),action:()=>this.chartSvc.createPivotChart({chartType:$}),_key:X,_enterprise:Y}};return{name:Q("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:Q("columnChart","Column"),subMenu:[z("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),z("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),z("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:Q("barChart","Bar"),subMenu:[z("groupedBar","Grouped","groupedBar","pivotGroupedBar"),z("stackedBar","Stacked","stackedBar","pivotStackedBar"),z("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:Q("pieChart","Pie"),subMenu:[z("pie","Pie","pie","pivotPie"),z("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:Q("lineChart","Line"),subMenu:[z("lineChart","Line","line","pivotLineChart"),z("stackedLine","Stacked","stackedLine","pivotStackedLine"),z("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:Q("areaChart","Area"),subMenu:[z("areaChart","Area","area","pivotArea"),z("stackedArea","Stacked","stackedArea","pivotStackedArea"),z("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:Q("xyChart","X Y (Scatter)"),subMenu:[z("scatter","Scatter","scatter","pivotScatter"),z("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:Q("statisticalChart","Statistical"),subMenu:[z("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:Q("hierarchicalChart","Hierarchical"),subMenu:[z("treemapChart","Treemap","treemap","pivotTreemap",!0),z("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:Q("funnel","Funnel"),subMenu:[z("funnel","Funnel","funnel","pivotFunnel"),z("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),z("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:Q("combinationChart","Combination"),subMenu:[z("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),z("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:h("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},sA=class{constructor(Q,z,J){this.beans=Q,this.chartSvc=z,this.getLocaleTextFunc=J}getMenuItem(){let Q=this.getLocaleTextFunc(),z=(J,Z,$,X,Y=!1)=>{return{name:Q(J,Z),action:()=>this.chartSvc.createChartFromCurrentRange($),_key:X,_enterprise:Y}};return{name:Q("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:Q("columnChart","Column"),subMenu:[z("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),z("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),z("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:Q("barChart","Bar"),subMenu:[z("groupedBar","Grouped","groupedBar","rangeGroupedBar"),z("stackedBar","Stacked","stackedBar","rangeStackedBar"),z("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:Q("pieChart","Pie"),subMenu:[z("pie","Pie","pie","rangePie"),z("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:Q("lineChart","Line"),subMenu:[z("lineChart","Line","line","rangeLineChart"),z("stackedLine","Stacked","stackedLine","rangeStackedLine"),z("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:Q("areaChart","Area"),subMenu:[z("areaChart","Area","area","rangeArea"),z("stackedArea","Stacked","stackedArea","rangeStackedArea"),z("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:Q("xyChart","X Y (Scatter)"),subMenu:[z("scatter","Scatter","scatter","rangeScatter"),z("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:Q("polarChart","Polar"),subMenu:[z("radarLine","Radar Line","radarLine","rangeRadarLine"),z("radarArea","Radar Area","radarArea","rangeRadarArea"),z("nightingale","Nightingale","nightingale","rangeNightingale"),z("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),z("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:Q("statisticalChart","Statistical"),subMenu:[z("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),z("histogramChart","Histogram","histogram","rangeHistogram",!1),z("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),z("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:Q("hierarchicalChart","Hierarchical"),subMenu:[z("treemap","Treemap","treemap","rangeTreemap"),z("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:Q("specializedChart","Specialized"),subMenu:[z("heatmap","Heatmap","heatmap","rangeHeatmap"),z("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:Q("funnel","Funnel"),subMenu:[z("funnel","Funnel","funnel","rangeFunnel"),z("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),z("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:Q("combinationChart","Combination"),subMenu:[z("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),z("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:h("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},lA=class extends j{constructor(){super(...arguments);this.beanName="colChooserFactory"}createColumnSelectPanel(Q,z,J,Z){let $=Q.createManagedBean(new iY),X=Z??z?.getColDef().columnChooserParams??{},{contractColumnSelection:Y,suppressColumnExpandAll:G,suppressColumnFilter:q,suppressColumnSelectAll:H,suppressSyncLayoutWithGrid:_,columnLayout:U}=X;if($.init(!!J,y(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!Y,suppressColumnExpandAll:!!G,suppressColumnFilter:!!q,suppressColumnSelectAll:!!H,suppressSyncLayoutWithGrid:!!U||!!_,onStateUpdated:()=>{}}),"columnMenu"),U)$.setColumnLayout(U);return $}showColumnChooser({column:Q,chooserParams:z,eventSource:J,headerPosition:Z}){this.hideActiveColumnChooser();let $=this.createColumnSelectPanel(this,Q,!0,z),X=this.getLocaleTextFunc(),Y=this.beans,{visibleCols:G,focusSvc:q,menuUtils:H}=Y,_=G.allCols.indexOf(Q),U=Q?q.focusedHeader??Z??null:null;this.activeColumnChooserDialog=this.createBean(new Lf({title:X("chooseColumns","Choose Columns"),component:$,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{R0(Y,$.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,Q)},closedCallback:(W)=>{let B=this.activeColumnChooser.getGui();if(this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,Q),Q)H.restoreFocusOnClose({column:Q,headerPosition:U,columnIndex:_,eventSource:J},B,W,!0)},postProcessPopupParams:{type:"columnChooser",column:Q,eventSource:J}})),this.activeColumnChooser=$}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(Q,z){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:Q,switchingTab:!1,key:"columnChooser",column:z??null})}},aA={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function oA(Q,z){let J=aA[z];if(J)Q.assertModuleRegistered(J,`menu item '${z}'`)}var dz="separator";function tY(Q,z){if(!Q)return;for(let J=Q.length-2;J>=0;J--){let Z=Q[J]===z,$=Q[J+1]===z;if(Z&&$)Q.splice(J+1,1)}}var eA={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:(Q)=>({type:LQ(Q.getSortDef()?.type),direction:null})}},Qj=class extends j{constructor(){super(...arguments);this.beanName="menuItemMapper"}mapWithStockItems(Q,z,J,Z,$){if(!Q)return[];let X=[],Y=this.getLocaleTextFunc(),{beans:G,gos:q}=this,{pinnedCols:H,colAutosize:_,aggFuncSvc:U,rowGroupColsSvc:W,colNames:B,colModel:E,clipboardSvc:K,expansionSvc:L,focusSvc:F,csvCreator:D,excelCreator:M,menuSvc:k,colChooserFactory:f,sortSvc:A,chartMenuItemMapper:O,valueColsSvc:v,pinnedRowModel:I}=G,C=(m,w,a,t)=>{switch(oA(q,m),m){case"pinSubMenu":return H&&w?{name:Y("pinColumn","Pin Column"),icon:h("menuPin",G,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return H&&w?{name:Y("pinLeft","Pin Left"),action:()=>H.setColsPinned([w],"left",t),checked:!!w&&w.isPinnedLeft()}:null;case"pinRight":return H&&w?{name:Y("pinRight","Pin Right"),action:()=>H.setColsPinned([w],"right",t),checked:!!w&&w.isPinnedRight()}:null;case"clearPinned":return H&&w?{name:Y("noPin","No Pin"),action:()=>H.setColsPinned([w],null,t),checked:!!w&&!w.isPinned()}:null;case"pinRowSubMenu":{let u=q.get("enableRowPinning"),Q0=[],r=J?.rowPinned??J?.pinnedSibling?.rowPinned;if(r)Q0.push("unpinRow");if(u&&u!=="bottom"&&r!="top")Q0.push("pinTop");if(u&&u!=="top"&&r!="bottom")Q0.push("pinBottom");return I?.isManual()?{name:Y("pinRow","Pin Row"),icon:h("rowPin",G,w),subMenu:Q0}:null}case"pinTop":return I?.isManual()?{name:Y("pinTop","Pin to Top"),icon:h("rowPinTop",G,w),action:({node:u,column:Q0})=>u&&I.pinRow(u,"top",Q0)}:null;case"pinBottom":return I?.isManual()?{name:Y("pinBottom","Pin to Bottom"),icon:h("rowPinBottom",G,w),action:({node:u,column:Q0})=>u&&I.pinRow(u,"bottom",Q0)}:null;case"unpinRow":return I?.isManual()?{name:Y("unpinRow","Unpin Row"),icon:h("rowUnpin",G,w),action:({node:u,column:Q0})=>u&&I.pinRow(u,null,Q0)}:null;case"valueAggSubMenu":if(U&&v&&(w?.isPrimary()||w?.getColDef().pivotValueColumn))return{name:Y("valueAggregation","Value Aggregation"),icon:h("menuValue",G,null),subMenu:zj(w,U,v,Y),disabled:q.get("functionsReadOnly")};else return null;case"autoSizeThis":return _?{name:Y("autosizeThisColumn","Autosize This Column"),action:()=>w&&_.autoSizeColumn(w,t,q.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return _?{name:Y("autosizeAllColumns","Autosize All Columns"),action:()=>_.autoSizeAllColumns({source:t,skipHeader:q.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return W?{name:OJ(Y,"groupBy",B.getDisplayNameForColumn(w,"header")),disabled:q.get("functionsReadOnly")||w?.isRowGroupActive()||!w?.getColDef().enableRowGroup,action:()=>W.addColumns([w],t),icon:h("menuAddRowGroup",G,null)}:null;case"rowUnGroup":if(W&&q.isModuleRegistered("SharedRowGrouping")){let u=w?.getColDef().showRowGroup,Q0=q.get("groupLockGroupColumns"),r,S0,O0;if(u===!0)r=Y("ungroupAll","Un-Group All"),S0=q.get("functionsReadOnly")||Q0===-1||Q0>=(W.columns.length??0),O0=()=>W.setColumns(W.columns.slice(0,Q0),t);else if(typeof u==="string"){let k0=E.getColDefCol(u),Az=k0!=null?B.getDisplayNameForColumn(k0,"header"):u;r=OJ(Y,"ungroupBy",Az),S0=q.get("functionsReadOnly")||TJ(k0,G),O0=()=>{W.removeColumns([u],t)}}else r=OJ(Y,"ungroupBy",B.getDisplayNameForColumn(w,"header")),S0=q.get("functionsReadOnly")||!w?.isRowGroupActive()||!w?.getColDef().enableRowGroup||TJ(w,G),O0=()=>W.removeColumns([w],t);return{name:r,disabled:S0,action:O0,icon:h("menuRemoveRowGroup",G,null)}}else return null;case"resetColumns":return{name:Y("resetColumns","Reset Columns"),action:()=>V$(G,t)};case"expandAll":return L?{name:Y("expandAll","Expand All Row Groups"),action:()=>L.expandAll(!0)}:null;case"contractAll":return L?{name:Y("collapseAll","Collapse All Row Groups"),action:()=>L.expandAll(!1)}:null;case"copy":return K?{name:Y("copy","Copy"),shortcut:Y("ctrlC","Ctrl+C"),icon:h("clipboardCopy",G,null),action:()=>K.copyToClipboard()}:null;case"copyWithHeaders":return K?{name:Y("copyWithHeaders","Copy with Headers"),icon:h("clipboardCopy",G,null),action:()=>K.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return K?{name:Y("copyWithGroupHeaders","Copy with Group Headers"),icon:h("clipboardCopy",G,null),action:()=>K.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(K){let u=F.getFocusedCell(),Q0=u?M0(G,u):null,r=Q0?u?.column.isCellEditable(Q0):!1;return{name:Y("cut","Cut"),shortcut:Y("ctrlX","Ctrl+X"),icon:h("clipboardCut",G,null),disabled:!r||q.get("suppressCutToClipboard"),action:()=>K.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(K){let u=q.get("suppressClipboardApi")||q.get("suppressClipboardPaste")||!w||!J||!w.isCellEditable(J)||w.isSuppressPaste(J);return{name:Y("paste","Paste"),shortcut:Y("ctrlV","Ctrl+V"),icon:h("clipboardPaste",G,null),disabled:u,action:()=>K.pasteFromClipboard()}}else return null;case"export":{let u=[];if(!q.get("suppressCsvExport")&&D)u.push("csvExport");if(!q.get("suppressExcelExport")&&M)u.push("excelExport");return u.length?{name:Y("export","Export"),subMenu:u,icon:h("save",G,null)}:null}case"csvExport":return D?{name:Y("csvExport","CSV Export"),icon:h("csvExport",G,null),action:()=>D.exportDataAsCsv()}:null;case"excelExport":return M?{name:Y("excelExport","Excel Export"),icon:h("excelExport",G,null),action:()=>M.exportDataAsExcel()}:null;case"separator":return m;case"pivotChart":case"chartRange":return O.getChartItems(m);case"columnFilter":return k&&w?{name:Y("columnFilter","Column Filter"),icon:h("filter",G,null),action:()=>k.showFilterMenu({column:w,buttonElement:a(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{let u=F.focusedHeader;return f?{name:Y("columnChooser","Choose Columns"),icon:h("columns",G,null),action:()=>f.showColumnChooser({column:w,eventSource:a(),headerPosition:u})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!A||!w)return null;let{fallback:u,getSortDef:Q0}=eA[m];return{name:Y(m,u),icon:h(m,G,null),action:()=>A.setSortForColumn(w,Q0(w),!1,t)}}default:return R(176,{key:m}),null}};for(let m of Q){let w;if(typeof m==="string")w=C(m,z,Z,$);else w={...m};if(!w)continue;let a=w,{subMenu:t}=a;if(t&&t instanceof Array)a.subMenu=this.mapWithStockItems(t,z,J,Z,$);if(w!=null)X.push(w)}return tY(X,dz),X}};function zj(Q,z,J,Z){let $;if(Q.isPrimary())$=Q;else{let Y=Q.getColDef().pivotValueColumn;$=T(Y)?Y:void 0}let X=[];if($){let Y=$.isValueActive(),G=z.getFuncNames($);X.push({name:Z("noAggregation","None"),action:()=>{J.removeColumns([$],"contextMenu"),J.setColumnAggFunc($,void 0,"contextMenu")},checked:!Y});for(let q of G)X.push({name:Z(q,z.getDefaultFuncLabel(q)),action:()=>{J.setColumnAggFunc($,q,"contextMenu"),J.addColumns([$],"contextMenu")},checked:Y&&$.getAggFunc()===q})}return X}var Jj=class extends j{constructor(){super(...arguments);this.beanName="colMenuFactory"}createMenu(Q,z,J,Z){let $=Q.createManagedBean(new mY(0,{column:J??null,node:null,value:null})),X=this.beans.menuItemMapper.mapWithStockItems(z,J??null,null,Z,"columnMenu");return $.addMenuItems(X),$}getMenuItems(Q=null,z=null){let J=this.getDefaultMenuOptions(Q),Z,$=(Q?.getColDef()??z?.getColGroupDef())?.mainMenuItems;if(Array.isArray($))Z=$;else if(typeof $==="function")Z=$(y(this.gos,{column:Q,columnGroup:z,defaultItems:J}));else{let X=this.gos.getCallback("getMainMenuItems");if(X)Z=X({column:Q,columnGroup:z,defaultItems:J});else Z=J}return tY(Z,dz),Z}getDefaultMenuOptions(Q){let z=[],{beans:J,gos:Z}=this,{colChooserFactory:$,rowGroupColsSvc:X,colModel:Y,expansionSvc:G,sortSvc:q,menuSvc:H,pinnedCols:_,aggFuncSvc:U,colAutosize:W}=J,B=U0(Z),E=()=>{if(!B&&$)z.push("columnChooser");z.push("resetColumns")};if(!Q)return E(),z;let{colDef:K}=Q,L=_&&!K.lockPinned,F=X?.columns.length??0,D=F>0,M=_z(Z),k=Z.get("treeData"),f=Q.isPrimary(),A=!f||U&&Q.isAllowValue()&&(D||M||k);if(q&&!B&&Q.isSortable()){let{isDefaultSortAllowed:O,isAbsoluteSortAllowed:v,isAbsoluteSort:I,isDefaultSort:C,isAscending:m,isDescending:w,direction:a}=c5(Q,J);if(O&&!(m&&C))z.push("sortAscending");if(O&&!(w&&C))z.push("sortDescending");if(v&&!(m&&I))z.push("sortAbsoluteAscending");if(v&&!(w&&I))z.push("sortAbsoluteDescending");if(a)z.push("sortUnSort");z.push(dz)}if(H?.isFilterMenuItemEnabled(Q))z.push("columnFilter"),z.push(dz);if(L)z.push("pinSubMenu");if(A)z.push("valueAggSubMenu");if(L||A)z.push(dz);if(W){if(!K.suppressAutoSize)z.push("autoSizeThis");z.push("autoSizeAll"),z.push(dz)}if(X&&Z.isModuleRegistered("SharedRowGrouping")){let O=z.length;if(K.showRowGroup)z.push("rowUnGroup");else if(Q.isAllowRowGroup()&&f)if(Q.isRowGroupActive()){if(!TJ(Q,J))z.push("rowUnGroup")}else z.push("rowGroup");if(z.length>O)z.push(dz)}if(E(),G&&(o(Z)||Z.get("ssrmExpandAllAffectsAllRows"))&&(k||F>(Y.isPivotMode()?1:0)))z.push("expandAll"),z.push("contractAll");return z}};var Dz="filterMenuTab",Mz="generalMenuTab",tz="columnsMenuTab",$2=[Mz,Dz,tz],Zj=class extends j{constructor(){super(...arguments);this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(Q,z,J,Z,$){let{column:X,columnGroup:Y}=this.splitColumnOrGroup(Q),G=$?"filterMenuTab":void 0;this.showMenu(X,Y,(q)=>{let H=q.getGui();if(this.beans.popupSvc.positionPopupUnderMouseEvent({type:J,additionalParams:{column:X},mouseEvent:z,ePopup:H}),G)q.showTab?.(G);this.dispatchVisibleChangedEvent(!0,!1,X,Y,G)},J,G,void 0,z.target,Z)}splitColumnOrGroup(Q){let z=Q&&JQ(Q);return{column:z?Q:void 0,columnGroup:z?void 0:Q}}showMenuAfterButtonClick(Q,z,J,Z,$){let X=-1,Y="left";if(this.gos.get("enableRtl"))X=1,Y="right";let G=$?"filterMenuTab":void 0,q=G?[G]:void 0,H=U0(this.gos),_=(H?9:4)*X,U=H?-23:4,{column:W,columnGroup:B}=this.splitColumnOrGroup(Q);this.showMenu(W,B,(E)=>{let K=E.getGui();if(this.beans.popupSvc.positionPopupByComponent({type:J,additionalParams:{column:W},eventSource:z,ePopup:K,alignSide:Y,nudgeX:_,nudgeY:U,position:"under",keepWithinBounds:!0}),G)E.showTab?.(G);this.dispatchVisibleChangedEvent(!0,!1,W,B,G)},J,G,q,z,Z)}showMenu(Q,z,J,Z,$,X,Y,G){let q=this.getMenuParams(Q,z,X,Y);if(!q)return;let{menu:H,eMenuGui:_,anchorToElement:U,restoreFocusParams:W}=q,B=[],{menuUtils:E,popupSvc:K}=this.beans;B.push((F)=>{let D=H.getGui();if(this.destroyBean(H),Q)zJ(Q,!1,"contextMenu"),E.restoreFocusOnClose(W,D,F);G?.()});let L=this.getLocaleTextFunc();if(K.addPopup({modal:!0,eChild:_,closeOnEsc:!0,closedCallback:(F)=>{for(let D of B)D(F);this.dispatchVisibleChangedEvent(!1,!1,Q,z,$)},afterGuiAttached:(F)=>H.afterGuiAttached(Object.assign({},{container:Z},F)),positionCallback:$?()=>J(H):void 0,ariaLabel:L("ariaLabelColumnMenu","Column Menu")}),!$)H.showTabBasedOnPreviousSelection?.(),J(H);if(h5(this.gos)){let F=K.setPopupPositionRelatedToElement(_,U);if(F&&Q)this.addStopAnchoring(F,Q,B)}if(H.addEventListener("tabSelected",(F)=>{this.dispatchVisibleChangedEvent(!1,!0,Q),this.lastSelectedTab=F.key,this.dispatchVisibleChangedEvent(!0,!0,Q)}),Q)zJ(Q,!0,"contextMenu");this.activeMenu=H,H.addEventListener("destroyed",()=>{if(this.activeMenu===H)this.activeMenu=null})}addStopAnchoring(Q,z,J){Q.then((Z)=>{z.__addEventListener("leftChanged",Z),z.__addEventListener("visibleChanged",Z),J.push(()=>{z.__removeEventListener("leftChanged",Z),z.__removeEventListener("visibleChanged",Z)})})}getMenuParams(Q,z,J,Z){let{focusSvc:$,visibleCols:X,ctrlsSvc:Y}=this.beans,G={column:Q,headerPosition:$.focusedHeader,columnIndex:X.allCols.indexOf(Q),eventSource:Z},q=this.createMenu(Q,z,G,J,Z);return q?{menu:q,eMenuGui:q.getGui(),anchorToElement:Z||Y.getGridBodyCtrl().eGridBody,restoreFocusParams:G}:void 0}createMenu(Q,z,J,Z,$){if(U0(this.gos))return this.createBean(new $j(Q,J,this.lastSelectedTab,Z,$));else{let X=this.beans.colMenuFactory.getMenuItems(Q,z);return X.length?this.createBean(new Xj(X,Q,J,$)):void 0}}dispatchVisibleChangedEvent(Q,z,J,Z,$){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:Q,switchingTab:z,key:this.lastSelectedTab??$??(U0(this.gos)?Mz:"columnMenu"),column:J??null,columnGroup:Z??null})}isMenuEnabled(Q){if(!U0(this.gos))return!0;let z=!this.beans.filterManager?.isFilterAllowed(Q),J=Q.getColDef().menuTabs??$2;return(z&&J.includes(Dz)?J.length-1:J.length)>0}showMenuAfterContextMenuEvent(Q,z,J){this.beans.menuUtils.onContextMenu({mouseEvent:z,touchEvent:J,source:"ui",showMenuCallback:(Z)=>{return this.showMenuAfterMouseEvent(Q,Z,"columnMenu"),!0}})}},$j=class extends j{constructor(Q,z,J,Z,$){super();this.column=Q,this.restoreFocusParams=z,this.initialSelection=J,this.restrictTo=Z,this.sourceElement=$,this.tabFactories={},this.includeChecks={};let{tabFactories:X,includeChecks:Y}=this;X[Mz]=this.createMainPanel.bind(this),X[Dz]=this.createFilterPanel.bind(this),X[tz]=this.createColumnsPanel.bind(this),Y[Mz]=()=>!0,Y[Dz]=()=>Q?!!this.beans.filterManager?.isFilterAllowed(Q):!1,Y[tz]=()=>!0}postConstruct(){let Q=this.getTabsToCreate().map((J)=>this.createTab(J)),z=new Hf({items:Q,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(z),this.mainMenuList?.setParentComponent(z),this.addDestroyFunc(()=>this.destroyBean(z))}getTabsToCreate(){if(this.restrictTo)return this.restrictTo;return(this.column?.getColDef().menuTabs??$2).filter((Q)=>this.isValidMenuTabItem(Q)&&this.isNotSuppressed(Q))}isValidMenuTabItem(Q){let z=!0,J=$2;if(this.restrictTo!=null)z=this.restrictTo.indexOf(Q)>-1,J=this.restrictTo;if(z=z&&$2.indexOf(Q)>-1,!z)R(175,{menuTabName:Q,itemsToConsider:J});return z}isNotSuppressed(Q){return this.includeChecks[Q]()}createTab(Q){return this.tabFactories[Q]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(Q){let{tabItemColumns:z,tabbedLayout:J,tabItemFilter:Z,tabItemGeneral:$}=this;if(z&&Q===tz)J.showItem(z);else if(Z&&Q===Dz)J.showItem(Z);else if($&&Q===Mz)J.showItem($);else J.showFirstItem()}onTabItemClicked(Q){let z=null;switch(Q.item){case this.tabItemColumns:z=tz;break;case this.tabItemFilter:z=Dz;break;case this.tabItemGeneral:z=Mz;break}if(z)this.activateTab(z)}activateTab(Q){let z={type:"tabSelected",key:Q};this.dispatchLocalEvent(z)}createMainPanel(){let{beans:Q,column:z}=this,J=Q.colMenuFactory,Z=J.createMenu(this,J.getMenuItems(z),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=Z,Z.addEventListener("closeMenu",this.onHidePopup.bind(this));let $={title:h("legacyMenu",Q,z),titleLabel:Mz.replace("MenuTab",""),bodyPromise:g.resolve(Z.getGui()),name:Mz};return this.tabItemGeneral=$,$}onHidePopup(Q){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,Q)}createFilterPanel(){let Q=this.column?this.createBean(new w6(this.column,"COLUMN_MENU")):null;if(this.filterComp=Q,!Q?.hasFilter())e(119);let z=(Z)=>Q?.afterGuiAttached(Z),J=()=>Q?.afterGuiDetached();return this.tabItemFilter={title:h("filterTab",this.beans,this.column),titleLabel:Dz.replace("MenuTab",""),bodyPromise:g.resolve(Q?.getGui()),afterAttachedCallback:z,afterDetachedCallback:J,name:Dz},this.tabItemFilter}createColumnsPanel(){let Q=Z0({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:z,column:J}=this,$=z.colChooserFactory.createColumnSelectPanel(this,J).getGui();$.classList.add("ag-menu-column-select"),Q.appendChild($);let X={title:h("columns",z,J),titleLabel:tz.replace("MenuTab",""),bodyPromise:g.resolve(Q),name:tz};return this.tabItemColumns=X,X}afterGuiAttached(Q){let{container:z,hidePopup:J}=Q;if(this.tabbedLayout.setAfterAttachedParams({container:z,hidePopup:J}),J)this.hidePopupFunc=J,this.addDestroyFunc(J)}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},Xj=class extends x{constructor(Q,z,J,Z){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"});this.menuItems=Q,this.column=z,this.restoreFocusParams=J,this.sourceElement=Z,this.eColumnMenu=S}postConstruct(){let Q=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=Q,Q.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(Q.getGui())}onHidePopup(Q){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,Q)}afterGuiAttached({hidePopup:Q}){if(Q)this.hidePopupFunc=Q,this.addDestroyFunc(Q);D0(this.mainMenuList.getGui())}};function Yj(Q,z){Q.colChooserFactory?.showColumnChooser({chooserParams:z})}function Gj(Q){Q.colChooserFactory?.hideActiveColumnChooser()}var qj=class extends j{constructor(){super(...arguments);this.beanName="menuUtils"}restoreFocusOnClose(Q,z,J,Z){let{eventSource:$}=Q,X=J instanceof KeyboardEvent;if(!Z&&!X||!$)return;let Y=d(this.beans);if(!z.contains(Y)&&!hz(this.beans))return;this.focusHeaderCell(Q)}closePopupAndRestoreFocusOnSelect(Q,z,J){let Z;if(J?.keyboardEvent)Z=J.keyboardEvent;Q(Z&&{keyboardEvent:Z});let $=this.beans,X=$.focusSvc,Y=X.getFocusedCell();if(hz($))if(Y){let{rowIndex:G,rowPinned:q,column:H}=Y;X.setFocusedCell({rowIndex:G,column:H,rowPinned:q,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(z)}onContextMenu(Q){let{mouseEvent:z,touchEvent:J,showMenuCallback:Z,source:$}=Q;if(!this.gos.get("allowContextMenuWithControlKey")){if(z&&(z.ctrlKey||z.metaKey))return}if(z)this.blockMiddleClickScrollsIfNeeded(z);if($==="ui"&&this.gos.get("suppressContextMenu"))return;let X=z??J.touches[0];if(Z(X)){let Y=z??J;if(Y?.cancelable)Y.preventDefault()}}async focusHeaderCell(Q){let{column:z,columnIndex:J,headerPosition:Z,eventSource:$}=Q,{visibleCols:X,headerNavigation:Y,focusSvc:G}=this.beans,q=await X.allCols.some((H)=>H===z);if(!this.isAlive())return;if(z?.isAlive()&&q&&$&&f0($)){let H=xZ($);if(H)Y?.scrollToColumn(z),H.focus()}else if(Z&&J!==-1){let H=X.allCols,_=H[J]||b(H);if(_)G.focusHeaderPosition({headerPosition:{headerRowIndex:Z.headerRowIndex,column:_}})}}blockMiddleClickScrollsIfNeeded(Q){if(this.gos.get("suppressMiddleClickScrolls")&&Q.which===2)Q.preventDefault()}},Hj={moduleName:"MenuCore",version:J0,beans:[Qj,tA,qj],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[I0,nz,v6,X7]},rY={moduleName:"ColumnMenu",version:J0,beans:[Zj,Jj,lA],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:Yj,hideColumnChooser:Gj},dependsOn:[Hj,LJ,FJ]};var _j=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function Uj(Q,z,J){return Q.getCompDetails(z,Wj,void 0,J,!0)}var Wj={name:"statusPanel",optionalMethods:["refresh"]},Bj={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},Ej={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},Kj=class extends x{constructor(){super(Ej);this.updateQueued=!1,this.panelsPromise=g.resolve(),this.eStatusBarLeft=S,this.eStatusBarCenter=S,this.eStatusBarRight=S,this.compDestroyFunctions={},this.registerCSS(_j)}wireBeans(Q){this.userCompFactory=Q.userCompFactory,this.statusBarSvc=Q.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),Bz(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){let Q=this.gos,z=Q.get("statusBar")?.statusPanels;if(!z)return z;return z.filter((J)=>{let{rowModels:Z,warnArgs:$}=Bj[J.statusPanel]??{};if(!Z)return!0;if(Z.includes(Q.get("rowModelType")))return!0;return R(...$),!1})}processStatusPanels(Q){let z=this.getValidPanels();if(z){let J=z.filter((X)=>X.align==="left"),Z=z.filter((X)=>X.align==="center"),$=z.filter((X)=>!X.align||X.align==="right");this.panelsPromise=g.all([this.createAndRenderComponents(J,this.eStatusBarLeft,Q),this.createAndRenderComponents(Z,this.eStatusBarCenter,Q),this.createAndRenderComponents($,this.eStatusBarRight,Q)])}else this.setDisplayed(!1)}handleStatusBarChanged(){if(this.updateQueued)return;this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1})}updateStatusBar(){let Q=this.getValidPanels(),z=Array.isArray(Q)&&Q.length>0;this.setDisplayed(z);let J=new Map;if(z)for(let Z of Q){let $=Z.key??Z.statusPanel,X=this.statusBarSvc.getStatusPanel($);if(X?.refresh){let Y=y(this.gos,{...Z.statusPanelParams??{},key:$});if(X.refresh(Y))J.set($,X),delete this.compDestroyFunctions[$],T0(X.getGui())}}if(this.resetStatusBar(),z)this.processStatusPanels(J)}resetStatusBar(){z0(this.eStatusBarLeft),z0(this.eStatusBarCenter),z0(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(let Q of Object.values(this.compDestroyFunctions))Q();this.compDestroyFunctions={}}createAndRenderComponents(Q,z,J){let Z=[];for(let $ of Q){let X=$.key||$.statusPanel,Y=J.get(X),G;if(Y)G=g.resolve(Y);else{let q=Uj(this.userCompFactory,$,y(this.gos,{key:X}));if(q==null)continue;G=q.newAgStackInstance()}Z.push({key:X,promise:G})}return g.all(Z.map(($)=>$.promise)).then(()=>{for(let $ of Z)$.promise.then((X)=>{let Y=()=>{this.destroyBean(X)};if(this.isAlive())this.statusBarSvc.registerStatusPanel($.key,X),z.appendChild(X.getGui()),this.compDestroyFunctions[$.key]=Y;else Y()})})}},Lj={selector:"AG-STATUS-BAR",component:Kj},Fj={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},": ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},Dj=BigInt(Number.MIN_SAFE_INTEGER),Mj=BigInt(Number.MAX_SAFE_INTEGER),CJ=class extends x{constructor(){super(Fj);this.eLabel=S,this.eValue=S}setLabel(Q,z){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(Q,z)}setValue(Q,z){let J=null,Z;if(typeof Q==="bigint"){if(Z=Q,Q>=Dj&&Q<=Mj)J=Number(Q)}else J=Q;this.eValue.textContent=this.valueFormatter(y(this.gos,{value:J,bigintValue:Z,totalRows:z,key:this.key}))}},kj={selector:"AG-NAME-VALUE",component:CJ},sY=(Q)=>{let z=0;return Q.forEachNodeAfterFilter((J)=>{if(J.data)z++}),z},bJ=(Q)=>{let z=0;return Q.forEachNode((J)=>{if(J.data)z++}),z};function Vj(Q,z){if(typeof Q!=="number")return"";return MQ(Math.round(Q*100)/100,z)}var fj={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},Aj=class extends x{constructor(){super(fj,[kj]);this.sumAggregationComp=S,this.countAggregationComp=S,this.minAggregationComp=S,this.maxAggregationComp=S,this.avgAggregationComp=S}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(Q){this.refresh(Q)}refresh(Q){this.params=Q;let z=Q.valueFormatter??((Z)=>{let{value:$,bigintValue:X}=Z;if(X!=null)return X.toString();return Vj($,this.getLocaleTextFunc.bind(this))}),J=["avg","count","min","max","sum"];for(let Z of J){let $=this.getAllowedAggregationValueComponent(Z);if($)$.key=Z,$.valueFormatter=z.bind(this)}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(Q,z,J){let Z=this.getAllowedAggregationValueComponent(Q),$=bJ(this.beans.rowModel);if(T(Z)&&Z)Z.setValue(z,$),Z.setDisplayed(J);else this.getAggregationValueComponent(Q)?.setDisplayed(!1)}getAllowedAggregationValueComponent(Q){let{aggFuncs:z}=this.params;if(!z||z.includes(Q))return this.getAggregationValueComponent(Q);return null}getAggregationValueComponent(Q){let z=`${Q}AggregationComp`;return this[z]}onCellSelectionChanged(){let Q=this.beans,{rangeSvc:z,valueSvc:J}=Q,Z=z?.getCellRanges(),$=0,X=0n,Y=!1,G=!1,q=0,H=0,_=null,U=null,W=null,B=null,E=(I)=>{if(typeof I==="number"){if($+=I,_===null||I<_)_=I;if(U===null||I>U)U=I;if(!Number.isInteger(I)||!Number.isSafeInteger(I))G=!0;else{let C=BigInt(I);if(X+=C,W===null||CB)B=C}}else{if(Y=!0,X+=I,W===null||IB)B=I;let C=Number(I);if($+=C,_===null||C<_)_=C;if(U===null||C>U)U=C}H++},K={};if(Z?.length&&z)for(let I=0;I{if(m===null)return;let u=bQ({rowPinned:m.rowPinned,column:t,rowIndex:m.rowIndex});if(K[u])return;K[u]=!0;let Q0=M0(Q,m);if(n(Q0))return;let r=J.getValue(t,Q0,"data");if(n(r)||r==="")return;if(q++,typeof r==="object"&&"value"in r){if(r=r.value,r==="")return}if(typeof r==="string"){let S0=r.trim();if(S0==="")return;let O0=Number(S0);if(!Number.isFinite(O0))return;if($+O0>=Number.MAX_SAFE_INTEGER||$+O0<=Number.MIN_SAFE_INTEGER||O0>=Number.MAX_SAFE_INTEGER||O0<=Number.MIN_SAFE_INTEGER){if(r=qz(S0),r===null)r=O0}else r=O0}if(typeof r==="number"&&!isNaN(r)||typeof r==="bigint")E(r)}),m=L0(Q,m)}}let L=q>1,F=H>1,D=Y&&!G,M;if(D)M=X/BigInt(H);else M=$/H;let k=F?D?X:$:null,f=F?D?W:_:null,A=F?D?B:U:null,O=F?M:null,v=F;this.setAggregationComponentValue("count",q,L),this.setAggregationComponentValue("sum",k,F),this.setAggregationComponentValue("min",f,F),this.setAggregationComponentValue("max",A,F),this.setAggregationComponentValue("avg",O,v)}},jj=class extends CJ{postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);let Q=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:Q})}onDataChanged(){let{rowModel:Q}=this.beans,z=bJ(Q),J=sY(Q);this.setValue(J,z),this.setDisplayed(z!==J)}init(Q){this.refresh(Q),this.onDataChanged()}updateValueFormatter(Q){this.valueFormatter=Q??(({value:z})=>MQ(z,this.getLocaleTextFunc.bind(this)))}refresh(Q){let{key:z,valueFormatter:J}=Q;return this.key=z,this.updateValueFormatter(J),!0}},Rj=class extends CJ{postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");let Q=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:Q,selectionChanged:Q})}onRowSelectionChanged(){let{selectionSvc:Q,rowModel:z}=this.beans,J=Q?.getSelectionCount()??0,Z=bJ(z);if(this.setValue(J,Z),J<0){this.setDisplayed(!0);return}this.setDisplayed(J>0)}init(Q){this.refresh(Q),this.onRowSelectionChanged()}updateValueFormatter(Q){this.valueFormatter=Q??(({value:z})=>{if(z==null||z>=0)return MQ(z,this.getLocaleTextFunc.bind(this));return this.getLocaleTextFunc()("statusBarLastRowUnknown","?")})}refresh(Q){let{key:z,valueFormatter:J}=Q;return this.key=z,this.updateValueFormatter(J),!0}},Sj=class extends CJ{postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let{rowModel:Q}=this.beans,z=sY(Q),J=bJ(Q);this.setValue(z,J)}init(Q){this.refresh(Q),this.onDataChanged()}updateValueFormatter(Q){this.valueFormatter=Q??(({value:z,totalRows:J})=>{let Z=this.getLocaleTextFunc.bind(this),$=MQ(z,Z),X=MQ(J??z,Z);if(z===J)return $;let Y=Z();return`${$} ${Y("of","of")} ${X}`})}refresh(Q){let{key:z,valueFormatter:J}=Q;return this.key=z,this.updateValueFormatter(J),!0}},Oj=class extends CJ{postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let Q=bJ(this.beans.rowModel);this.setValue(Q,Q)}init(Q){this.refresh(Q),this.onDataChanged()}updateValueFormatter(Q){this.valueFormatter=Q??(({value:z})=>MQ(z,this.getLocaleTextFunc.bind(this)))}refresh(Q){let{key:z,valueFormatter:J}=Q;return this.key=z,this.updateValueFormatter(J),!0}};function Pj(Q,z){let J=Q.statusBarSvc?.getStatusPanel(z);return mQ(J)}var Tj=class extends j{constructor(){super();this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(Q,z){this.comps.set(Q,z)}unregisterStatusPanel(Q){this.comps.delete(Q)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(Q){return this.comps.get(Q)}destroy(){this.unregisterAllComponents(),super.destroy()}},lY={moduleName:"StatusBar",version:J0,beans:[Tj],userComponents:{agAggregationComponent:Aj,agTotalRowCountComponent:Oj,agFilteredRowCountComponent:jj,agTotalAndFilteredRowCountComponent:Sj,agSelectedRowCountComponent:Rj},selectors:[Lj],apiFunctions:{getStatusPanel:Pj},dependsOn:[I0,iz]};function aY(Q){if(Q.excelCreator?.getFactoryMode()==="MULTI_SHEET")return R(161),!1;return!0}function vj(Q,z){if(aY(Q))return Q.excelCreator?.getDataAsExcel(z);return}function Ij(Q,z){if(aY(Q))Q.excelCreator?.exportDataAsExcel(z)}function Cj(Q,z){return Q.excelCreator?.setFactoryMode("MULTI_SHEET"),Q.excelCreator?.getSheetDataForExcel(z)}function bj(Q,z){return Q.excelCreator?.getMultipleSheetsAsExcel(z)}function yj(Q,z){Q.excelCreator?.exportMultipleSheetsAsExcel(z)}var oY={moduleName:"ExcelExport",version:J0,beans:[lV],apiFunctions:{getDataAsExcel:vj,exportDataAsExcel:Ij,getSheetDataForExcel:Cj,getMultipleSheetsAsExcel:bj,exportMultipleSheetsAsExcel:yj},dependsOn:[S6,I0]};function L2(Q){let{filters:z}=Q;return z&&z.length>0?z:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function U2(Q,z){if(Q==null)return;for(let J=Q.length-1;J>=0;J--)z(Q[J],J)}function xj(Q,z){if(z.title!=null)return z.title;return Q instanceof wZ?Q.getFilterTitle():"Filter"}function W2(Q,z,J,Z){let $=[],X=Q?.filterModels;for(let Y=0;YY==null)?null:{filterType:"multi",filterModels:$}}function nQ(Q,z){return Q?.filterModels?.[z]??null}function B2(Q,z,J,Z){let $=J.filterValueGetter;return $?Q.colFilter.createGetValue(z,$):Z}var eY=class extends _6{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"});this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:(Q)=>this.onFocusIn(Q)})}refreshGui(Q){if(Q===this.lastOpenedInContainer)return g.resolve();return this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),g.all(this.getFilterWrappers().map((z,J)=>{if(!z)return g.resolve(null);let Z=this.getFilterFromWrapper(z),$=this.getCompFromWrapper(z),X=this.filterDefs[J],Y=xj(Z,X),G;if(X.display==="subMenu"&&Q!=="toolPanel")G=this.insertFilterMenu($,Z,Y).then((q)=>q.getGui());else if(X.display==="subMenu"||X.display==="accordion"){let q=this.insertFilterGroup(Z,$,Y);G=g.resolve(q.getGui())}else G=g.resolve($.getGui());return G})).then((z)=>{z.forEach((J,Z)=>{if(!J)return;if(Z>0)this.appendChild(Z0({tag:"div",cls:"ag-filter-separator"}));this.appendChild(J)}),this.filterGuis=z,this.lastOpenedInContainer=Q})}destroyChildren(){for(let Q of this.guiDestroyFuncs)Q();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(Q,z,J){let Z=Q.getGui();H0(Z,"dialog");let $=this.createBean(new WA),X={getGui:()=>Q.getGui(),afterGuiAttached:(Y)=>{if(Q.afterGuiAttached?.(Y),Q!==z)z.afterGuiAttached?.(Y)}};return $.init({menuItemDef:{name:J,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:vY,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:X,contextParams:{column:null,node:null,value:null}}).then(()=>{$.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean($)),this.addManagedListeners($,{menuItemActivated:(G)=>{if(this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==G.menuItem)this.lastActivatedMenuItem.deactivate();this.lastActivatedMenuItem=G.menuItem}});let Y=$.getGui();return $.addManagedElementListeners(Y,{keydown:(G)=>{let{key:q}=G;switch(q){case V.UP:case V.RIGHT:case V.DOWN:case V.LEFT:if(G.preventDefault(),q===V.RIGHT)$.openSubMenu(!0);break}},focusin:()=>$.activate(),focusout:()=>{if(!$.isSubMenuOpen()&&!$.isSubMenuOpening())$.deactivate()}}),$})}insertFilterGroup(Q,z,J){let Z=this.createBean(new Wf({title:J,cssIdentifier:"multi-filter"}));if(this.guiDestroyFuncs.push(()=>this.destroyBean(Z)),Z.addItem(z.getGui()),Z.toggleGroupExpand(!1),Q.afterGuiAttached)Z.addManagedListeners(Z,{expanded:()=>Q.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})});return Z}afterGuiAttached(Q){let z;if(Q)this.hidePopup=Q.hidePopup,z=this.refreshGui(Q.container);else this.hidePopup=void 0,z=g.resolve();let J=Q?.suppressFocus;z.then(()=>{let{filterDefs:Z,filterGuis:$,beans:X}=this,Y=this.getFilterWrappers(),G=!!J;if(Z)U2(Z,(H,_)=>{let U=_===0,W=H.display&&H.display!=="inline",B=J||!U||W,E={...Q??{},suppressFocus:B},K=Y[_],L=K?this.getFilterFromWrapper(K):void 0;if(K){let F=this.getCompFromWrapper(K);if(F!==L)F.afterGuiAttached(E)}if(L){if(this.executeFunctionIfExistsOnFilter(L,"afterGuiAttached",E),U&&!B)G=!0}if(!J&&U&&W){let F=$[_];if(F){if(!D0(F))F.focus({preventScroll:!0});G=!0}}});let q=d(X);if(!G&&(hz(X)||this.getGui().contains(q)))this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",(Q)=>this.executeOnWrapper(Q,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",(Q)=>this.executeOnWrapper(Q,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(Q,z){}executeFunctionIfExists(Q,z){U2(this.getFilterWrappers(),(J)=>{if(J)z?.(J),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(J),Q)})}executeFunctionIfExistsOnFilter(Q,z,...J){let Z=Q[z];if(typeof Z==="function")Z.apply(Q,J)}onFocusIn(Q){let z=this.lastActivatedMenuItem;if(z!=null&&!z.getGui().contains(Q.target))z.deactivate(),this.lastActivatedMenuItem=null}},Q4=class extends eY{constructor(){super(...arguments);this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(Q){this.params=Q,this.filterDefs=L2(Q);let z=F0(this.beans.colFilter.model,Q.column.getColId()),{filterChangedCallback:J}=Q;this.filterChangedCallback=J;let Z=this.filterDefs.map(($,X)=>this.createFilter($,X,z));return new g(($)=>{g.all(Z).then((X)=>{this.wrappers=X,this.refreshGui("columnMenu").then(()=>{$()})})}).then(()=>{for(let $ of this.afterFiltersReadyFuncs)$();this.afterFiltersReadyFuncs.length=0})}refresh(Q){return this.params=Q,!0}isFilterActive(){return this.wrappers.some((Q)=>{if(!Q)return!1;let{filter:z,handler:J,model:Z}=Q;if(J)return Z!=null;return z.isFilterActive()})}getLastActiveFilterIndex(){let Q=this.activeFilterIndices;return Q.length>0?Q[Q.length-1]:null}doesFilterPass(Q,z){return this.wrappers.every((J,Z)=>{if(!J||z!=null&&Z===z)return!0;let{handler:$,filter:X,model:Y}=J;if($)return Y==null||$.doesFilterPass({...Q,model:Y,handlerParams:J.handlerParams});return!X.isFilterActive()||X.doesFilterPass(Q)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map((z)=>{if(!z)return null;let J=z.filter;if(typeof J.getModelFromUi==="function")return J.getModelFromUi();return null})}}getModel(){if(!this.isFilterActive())return null;return{filterType:this.filterType,filterModels:this.wrappers.map((z)=>{if(!z)return null;let{filter:J,handler:Z,model:$}=z;if(Z)return $;return J.isFilterActive()?J.getModel():null})}}setModel(Q){let z=(Z,$)=>{return new g((X)=>{let Y=Z.setModel($);if(Y)Y.then(X);else X()})},J=[];return this.wrappers.forEach((Z,$)=>{if(!Z)return;let X=nQ(Q,$),{filter:Y,filterParams:G,handler:q,handlerParams:H,state:_}=Z;if(q){let U={model:X,state:_?.state};Z.state=U,Z.model=X,J.push(rZ(()=>g.resolve({filter:Y,filterParams:G}),q,H,X,U,"api").then(()=>{this.updateActiveListForHandler($,Z.model)}))}else J.push(z(Y,X).then(()=>{this.updateActiveListForFilter($,Y)}))}),g.all(J).then(()=>{})}applyModel(Q="api"){let z=!1;for(let J of this.wrappers)if(J){let Z=J.filter;if(Z instanceof wZ)z=Z.applyModel(Q)||z}return z}getChildFilterInstance(Q){return this.wrappers[Q]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(let Q of this.wrappers)this.destroyBean(Q?.filter),this.destroyBean(Q?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(Q){return Q.filter}getCompFromWrapper(Q){return Q.comp}executeOnWrapper(Q,z){Q.handler?.[z]?.()}createFilter(Q,z,J){let Z=this.params.column,$=null,X,Y=this.beans,G=(B,E)=>{let K=this.wrappers[z];if(!K)return;let L={model:B,state:K.state?.state};K.state=L,K.model=B,rZ(()=>g.resolve({filter:K.filter,filterParams:K.filterParams}),K.handler,K.handlerParams,B,L,"ui").then(()=>{this.onHandlerModelChanged(z,K.model,E)})},{compDetails:q,handler:H,handlerParams:_,createFilterUi:U}=Y.colFilter.createFilterInstance(Z,Q,"agTextColumnFilter",(B,E)=>{let K={...B,filterChangedCallback:E?()=>{}:(L)=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(z,L))},doesRowPassOtherFilter:(L)=>B.doesRowPassOtherFilter(L)&&this.doesFilterPass({node:L,data:L.data},z),getValue:B2(Y,Z,Q,B.getValue)};if(E)$=nQ(J,z),X=this.updateDisplayParams(K,z,$,()=>q,()=>H,G);return K});if(!U)return g.resolve(null);let W;if(H){let{doesRowPassOtherFilter:B,getValue:E}=_;W={..._,onModelChange:G,doesRowPassOtherFilter:(K)=>B(K)&&this.doesFilterPass({node:K,data:K.data},z),getValue:B2(Y,Z,Q,E)},H.init?.({...W,model:$,source:"init"})}return U().then((B)=>{if(!H)return{filter:B,comp:B};let E=q?.params,K=X(B);return{filter:B,comp:K,filterParams:E,handler:H,handlerParams:W,model:$}})}updateDisplayParams(Q,z,J,Z,$,X){let Y=this.params.column,G=new KQ;Q.model=J,Q.state={model:J},Q.onModelChange=X,Q.getHandler=$;let q=(_,U)=>{_.state=U,G.dispatchEvent({type:"filterStateChanged",column:Y,state:U})};Q.onStateChange=(_)=>{let U=this.wrappers[z];if(!U)return;q(U,_),A1(U.filter,U.filterParams,U.model??null,_,"ui")};let H=(_,U,W)=>{let B=this.wrappers[z];if(!B)return;let E=()=>B?.model??null;FZ({action:U,filterParams:B.filterParams,getFilterUi:()=>{let K=g.resolve(B.filter);return{created:!0,filterParams:B.filterParams,compDetails:Z(),create:()=>K,promise:K}},getModel:E,getState:()=>B?.state??{model:E()},updateState:(K)=>q(B,K),updateModel:(K)=>B.filterParams?.onModelChange(K,W),processModelToApply:B.handler?.processModelToApply?.bind(B.handler)})};return Q.onAction=(_,U,W)=>{H(Y,_,U),G.dispatchEvent({type:"filterAction",column:Y,action:_,event:W})},(_)=>{let U=Z()?.params;return this.createManagedBean(new x6(Y,{comp:_,params:U,isHandler:!0},G,H,!1))}}executeWhenAllFiltersReady(Q){if((this.wrappers?.length??0)>0)Q();else this.afterFiltersReadyFuncs.push(Q)}updateActiveListForFilter(Q,z){this.updateActiveList(Q,()=>z?.isFilterActive())}updateActiveListForHandler(Q,z){this.updateActiveList(Q,()=>z!=null)}updateActiveList(Q,z){let J=this.activeFilterIndices;if($0(this.activeFilterIndices,Q),z())J.push(Q)}onFilterModelChanged(Q,z){this.updateActiveListForFilter(Q,this.wrappers[Q]?.filter),this.filterChanged(Q,z)}onHandlerModelChanged(Q,z,J){this.updateActiveListForHandler(Q,z),this.filterChanged(Q,J)}filterChanged(Q,z){this.filterChangedCallback(z),this.wrappers.forEach((J,Z)=>{if(Q===Z||!J)return;let{filter:$,handler:X}=J;if(X?.onAnyFilterChanged?.(),typeof $.onAnyFilterChanged==="function")$.onAnyFilterChanged()})}getModelAsString(Q){if(!Q?.filterModels?.length)return"";let z=this.getLastActiveFilterIndex()??0;return this.wrappers[z]?.filter?.getModelAsString?.(Q.filterModels[z])??""}},wj=class extends j{constructor(){super(...arguments);this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(Q){this.params=Q;let z=L2(Q.filterParams);this.filterDefs=z,z.forEach((J,Z)=>{let $=this.beans.colFilter.createHandler(Q.column,J,"agTextColumnFilter");if(this.handlerWrappers.push($),!$){R(278,{colId:Q.column.getColId()});return}let{handler:X,handlerParams:Y}=$;X.init?.({...this.updateHandlerParams(Y,Z,!0),model:nQ(Q.model,Z),source:"init"})}),this.resetActiveList(Q.model)}refresh(Q){this.params=Q;let{model:z,source:J,filterParams:Z}=Q,$=Z?.filters;if(this.handlerWrappers.forEach((X,Y)=>{if(X){let G=this.updateHandlerParams(Q,Y,!1,$?.[Y].filterParams);X.handlerParams=G,X.handler.refresh?.({...G,model:nQ(z,Y),source:J})}}),Q.source!=="floating"&&Q.source!=="ui")this.resetActiveList(Q.model);if(Q.additionalEventAttributes?.fromButtons)this.onAnyFilterChanged()}updateHandlerParams(Q,z,J,Z){let{onModelChange:$,doesRowPassOtherFilter:X,getValue:Y}=Q,G={...Q,onModelChange:(q,H)=>$(W2(this.params.model,this.handlerWrappers.length,q,z),H),doesRowPassOtherFilter:(q)=>X(q)&&this.doesFilterPass({node:q,data:q.data,model:this.params.model,handlerParams:G},z),getValue:B2(this.beans,Q.column,this.filterDefs[z],Y),filterParams:this.updateFilterParams(Q,J,Z)};return G}updateFilterParams(Q,z,J){let Z=Q.filterParams;if(J?.buttons&&z)R(292,{colId:Q.column.getColId()});let $=J?{...Z,...J}:Z;if(!$.buttons)return $;if(J)return delete $.buttons,$;let{buttons:X,...Y}=$;return Y}doesFilterPass(Q,z){let J=Q.model?.filterModels;if(J==null)return!0;return this.handlerWrappers.every((Z,$)=>{let X=J[$];if(X==null||z!=null&&$===z)return!0;let Y=Z?.handler;return!Y||Y.doesFilterPass({...Q,model:X,handlerParams:Z.handlerParams})})}resetActiveList(Q){this.activeFilterIndices=[];let z=Q?.filterModels;if(z==null)return;for(let J=0;J0?Q[Q.length-1]:null}getModelAsString(Q,z){let J=z==="filterToolPanel",Z=()=>J?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!Q?.filterModels?.length)return Z();let $=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[$]?.handler.getModelAsString?.(Q.filterModels[$],z)??Z()}getHandler(Q){return this.handlerWrappers[Q]?.handler}onAnyFilterChanged(){U2(this.handlerWrappers,(Q)=>Q?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){U2(this.handlerWrappers,(Q)=>Q?.handler?.onNewRowsLoaded?.())}destroy(){for(let Q of this.handlerWrappers)this.destroyBean(Q?.handler);this.handlerWrappers.length=0,super.destroy()}},Nj=class extends j{constructor(){super(...arguments);this.beanName="multiFilter"}getParamsForDataType(Q,z,J,Z){let $=Q?.filters,X=this.beans;if(!$)$=[{filter:C6(J.baseDataType)},{filter:"agSetColumnFilter"}];let Y=this.getLocaleTextFunc();return $=$.map((G)=>{let{filter:q,filterParams:H,filterValueGetter:_}=G;if(typeof q!=="string")return G;let{filterParams:U,filterValueGetter:W}=I6(q,H,_??z,J,Z,X,Y);return{...G,filterParams:U,filterValueGetter:W}}),{filterParams:{...Q,filters:$}}}},z4=class extends eY{constructor(){super(...arguments);this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(Q){this.params=Q;let z=L2(Q).map((Z)=>{if(Z.filterParams?.buttons){R(292,{colId:Q.column.getColId()});let $={...Z.filterParams};return delete $.buttons,{...Z,filterParams:$}}return Z});this.filterDefs=z,this.allState=Q.state;let J=this.filterDefs.map((Z,$)=>this.createFilter(Z,$));return new g((Z)=>{g.all(J).then(($)=>{this.filters=$,this.refreshGui("columnMenu").then(()=>{Z()})})})}refresh(Q){let{model:z,state:J,source:Z}=Q;if(Z==="colDef")return!1;this.params=Q;let $=this.filterParams;if(J===this.allState)return!0;this.allState=J;let X=J.state;return this.filters.forEach((Y,G)=>{let q=nQ(z,G),H={state:X?.[G],model:nQ(J.model,G)};A1(Y,$[G],q,H,Z)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(Q){return this.filters[Q]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(let Q of this.filters)this.destroyBean(Q);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(Q){return Q}getCompFromWrapper(Q){return Q}createFilter(Q,z){let J=this.beans.userCompFactory,Z=this.updateParams(Q,this.params,z),$=d5(J,Q,Z,"agTextColumnFilter");if(!$)return g.resolve(null);return this.filterParams[z]=$.params,$.newAgStackInstance()}updateParams(Q,z,J){let{doesRowPassOtherFilter:Z,model:$,onModelChange:X,state:Y,onStateChange:G,column:q,source:H,onAction:_,onUiChange:U,getValue:W}=z,B=nQ($,J),E=Y?{model:nQ(Y.model,J),state:Y.state?.[J]}:{model:B},K=()=>{let F=this.getHandler();this.filters.forEach((D,M)=>{if(J!==M)F.getHandler(M)?.onAnyFilterChanged?.(),D?.onAnyFilterChanged?.()})},L=this.beans.colFilter;return{...L.createBaseFilterParams(q),...Q,doesRowPassOtherFilter:(F)=>Z(F)&&this.getHandler().doesFilterPass({node:F,data:F.data,model:this.params.model,handlerParams:L.getHandlerParams(q)},J),model:B,state:E,onModelChange:(F,D)=>{let{filters:M,params:k}=this,f=W2(k.model,M.length,F,J);this.updateActiveList(J,F),X(f,D),K()},onStateChange:(F)=>this.onStateChange(G,J,F),getHandler:()=>this.getHandler().getHandler(J),onAction:(F,D,M)=>{if(WJ(z))return;let k=F==="apply"||F==="reset";if(k)this.updateActiveList(J,nQ(this.params.state.model,J));if(_(F,D,M),k)K()},onUiChange:U,source:H,getValue:B2(this.beans,q,Q,W)}}updateActiveList(Q,z){this.getHandler().updateActiveList?.(Q,z)}getHandler(){return this.params.getHandler()}onStateChange(Q,z,J){let{model:Z,state:$,valid:X}=J,Y=this.validity;Y[z]=X;let G=this.allState,q=W2(G.model,this.filters.length,Z,z),H=Y.every((W)=>W!==!1),_=[...G.state??[]];_[z]=$;let U={state:_,model:q,valid:H};this.allState=U,Q(U)}getModelAsString(Q){return this.getHandler().getModelAsString?.(Q)??""}},gj={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},hj=class extends x{constructor(){super(gj);this.floatingFilters=[],this.compDetailsList=[]}init(Q){this.params=Q;let{compDetailsList:z}=this.getCompDetailsList(Q);return this.setParams(z)}setParams(Q){let z=[];return Q.forEach((J)=>{let Z=J?.newAgStackInstance();if(Z!=null)this.compDetailsList.push(J),z.push(Z)}),g.all(z).then((J)=>{J.forEach((Z,$)=>{this.floatingFilters.push(Z);let X=Z.getGui();if(this.appendChild(X),$>0)N(X,!1)})})}refresh(Q){this.params=Q;let{compDetailsList:z,floatingFilterParamsList:J}=this.getCompDetailsList(Q);if(z.length===this.compDetailsList.length&&z.every(($,X)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[X],$))){if(J.forEach(($,X)=>{this.floatingFilters[X].refresh?.($)}),this.gos.get("enableFilterHandlers")){let $=Q;if($.model==null)this.floatingFilters.forEach((X,Y)=>{N(X.getGui(),Y===0)});else{let X=$.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((Y,G)=>{let q=X==null?G===0:G===X;N(Y.getGui(),q)})}}}else z0(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(z)}getCompDetailsList(Q){let z=[],J=[],Z=Q.filterParams,$=Q.currentParentModel,X=L2(Z);return X.forEach((Y,G)=>{let q={...Q,parentFilterInstance:(_)=>{this.parentMultiFilterInstance((U)=>{let W=U.getChildFilterInstance(G);if(W==null)return;_(W)})},currentParentModel:()=>$()?.filterModels?.[G]??null};if(this.gos.get("enableFilterHandlers")){let _=q;_.model=_.model?.filterModels?.[G]??null;let{onModelChange:U,getHandler:W}=_;_.onModelChange=(B,E)=>U(W2(this.params.model,X.length,B,G),E),_.getHandler=()=>{return W().getHandler(G)}}B0(q.filterParams,Y.filterParams);let H=this.getCompDetails(Y,q);if(H)z.push(H),J.push(q)}),{compDetailsList:z,floatingFilterParamsList:J}}onParentModelChanged(Q,z){if(z?.afterFloatingFilter)return;this.parentMultiFilterInstance((J)=>{if(Q==null)this.floatingFilters.forEach((Z,$)=>{Z.onParentModelChanged(null,z),N(Z.getGui(),$===0)});else{let Z=J.getLastActiveFilterIndex();this.floatingFilters.forEach(($,X)=>{let Y=Q.filterModels.length>X?Q.filterModels[X]:null;$.onParentModelChanged(Y,z);let G=Z==null?X===0:X===Z;N($.getGui(),G)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(Q,z){let{colFilter:J,frameworkOverrides:Z,userCompFactory:$}=this.beans,X=b6(Z,Q,()=>J.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return t5($,Q,z,X)}parentMultiFilterInstance(Q){this.params.parentFilterInstance((z)=>{if(!(z instanceof Q4||z instanceof z4))e(120);Q(z)})}},J4={moduleName:"MultiFilter",version:J0,userComponents:{agMultiColumnFilter:{getComp:(Q)=>Q.gos.get("enableFilterHandlers")?{classImp:z4,params:{useForm:!0}}:Q4},agMultiColumnFloatingFilter:hj},beans:[Nj],dynamicBeans:{agMultiColumnFilterHandler:wj},dependsOn:[I0,FX,X7]},uj=class extends j{constructor(){super(...arguments);this.beanName="aggColNameSvc"}getHeaderName(Q,z){if(this.gos.get("suppressAggFuncInHeader"))return z;let{valueColsSvc:J,colModel:Z,rowGroupColsSvc:$}=this.beans,X=Q.getColDef().pivotValueColumn,Y=T(X),G=null,q;if(Y){let H=J?.columns??[],_=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&H.length===1,U=Q.getColDef().pivotTotalColumnIds!==void 0;if(_&&!U)return z;G=X?X.getAggFunc():null,q=!0}else{let H=Q.isValueActive(),_=$?.columns.length!==0,U=Z.isPivotMode()||_||this.gos.get("treeData");if(H&&U)G=Q.getAggFunc(),q=!0;else q=!1}if(q){let H=typeof G==="string"?G:"func";return`${this.getLocaleTextFunc()(H,H)}(${z})`}return z}},mj={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},cj=class extends j{constructor(){super(...arguments);this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){if(this.initialised)return;this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs"))}initialiseWithDefaultAggregations(){let Q=this.aggFuncsMap;Q.sum=pj,Q.first=ij,Q.last=nj,Q.min=dj,Q.max=tj,Q.count=sj,Q.avg=aj,this.initialised=!0}isAggFuncPossible(Q,z){let Z=this.getFuncNames(Q).includes(z),$=T(this.aggFuncsMap[z]);return Z&&$}getDefaultFuncLabel(Q){return mj[Q]??Q}getDefaultAggFunc(Q){let z=Q.getColDef().defaultAggFunc;if(T(z)&&this.isAggFuncPossible(Q,z))return z;if(this.isAggFuncPossible(Q,"sum"))return"sum";let J=this.getFuncNames(Q);return J?.length?J[0]:null}addAggFuncs(Q){if(this.init(),!Q)return;for(let z of Object.keys(Q))if(Q[z])this.aggFuncsMap[z]=Q[z]}getAggFunc(Q){return this.init(),this.aggFuncsMap[Q]}getFuncNames(Q){let z=Q.getColDef().allowedAggFuncs;return z==null?Object.keys(this.aggFuncsMap).sort():z}clear(){this.aggFuncsMap={}}};function pj(Q){let{values:z}=Q,J=null;for(let Z=0;Z0?Q.values[0]:null}function nj(Q){return Q.values.length>0?b(Q.values):null}function dj(Q){let{values:z}=Q,J=null;for(let Z=0;Z$))J=$}return J}function tj(Q){let{values:z}=Q,J=null;for(let Z=0;Z0)$=J/(typeof J==="number"?Z:BigInt(Z));let X=Q.rowNode?.aggData?.[Q.column?.getColId()];if(X&&X.count===Z&&X.value===$)return X;let Y=Object.create(lj);return Y.count=Z,Y.value=$,Y}var oj=class extends j{constructor(){super(...arguments);this.beanName="aggChildrenSvc"}getAggregatedChildren(Q,z,J){if(!Q?.group)return[];if(Q.rowPinned){if(Q=Q.pinnedSibling,!Q)return[]}let Z=this.gos,$=Z4(Q,z,Z);if(!J)return $;let X=[];return $4($,z,Z,X),X}},Z4=(Q,z,J)=>{let Z=z?.colDef,$=Z?.pivotKeys;if($){if(Q.leafGroup&&$.length&&!Z.pivotTotalColumnIds)return gY(Q.childrenMapped,$);return Q.childrenAfterFilter??Q.childrenAfterGroup??[]}if(TQ(J)||J.get("suppressAggFilteredOnly"))return Q.childrenAfterGroup??[];return Q.childrenAfterFilter??Q.childrenAfterGroup??[]},$4=(Q,z,J,Z)=>{for(let $=0,X=Q.length;${uX(A,null,k)})}return}this.hadAgg=!0;let{colModel:X,aggFuncSvc:Y}=J,G=z.get("alwaysAggregateAtRootLevel")||!!_z(z)||X.isPivotMode(),q=!TQ(z)&&!z.get("suppressAggFilteredOnly"),H=J.valueSvc,_=J.gridApi,U=J.gridOptions.context,W=$??[],B=W.length,E=Q?.kind==="cells"?Q:void 0,K,L=Array(B);for(let k=0;k=0)K=E;L[k]={column:f,colId:f.colId,colDef:f.colDef,aggFunc:X4(f.getAggFunc(),Y,f),colSlot:A}}let F=XR(X,J.pivotResultCols,Y),D=B>0?Array(B):null,M=J.rowModel;A0(M.rootNode,M.hierarchical,Q,(k)=>{if(k.level===-1&&!G){O1(k,null,X);return}let f;if(Z)f=Z({nodes:k.childrenAfterFilter});else if(!D)f=null;else if(F)f=$R(k,F,H,_,U);else f=ZR(k,L,B,D,K,q,H,_,U);uX(k,f,X)})}},ZR=(Q,z,J,Z,$,X,Y,G,q)=>{let H=(X?Q.childrenAfterFilter:Q.childrenAfterGroup)??[],_=H.length,U=Q.data,W=Object.create(null),B=$?$.getSlot(Q):-1,E=B>=0?Q.aggData:void 0,K=0;for(let L=0;L=0&&!$.hasCellBySlot(B,F.colSlot)){if(Z[L]=null,E)W[F.colId]=E[F.colId]}else Z[L]=Array(_),++K}if(K===0)return W;for(let L=0;L<_;++L){let F=H[L],D=F.aggData;if(D)for(let M=0;M{let X=z.length,Y=Q.leafGroup,G=Q.data,q=Q.childrenMapped,H=Q.childrenAfterFilter??[],_=Object.create(null),U,W;for(let B=0;B{if(typeof Q==="function")return Q;if(Q==null)return null;let Z=z.getAggFunc(Q);if(typeof Z!=="function")return R(109,{inputValue:Q.toString(),allSuggestions:z.getFuncNames(J)}),null;return Z},XR=(Q,z,J)=>{if(!Q.isPivotActive())return null;let Z=z?.getAggregationOrderedList();if(!Z||Z.length===0)return null;let $=Z.length,X=Array($),Y=0;for(let G=0;G<$;++G){let q=Z[G],H=q.colDef,_=H.pivotValueColumn;if(!_)continue;X[Y++]={column:_,colId:H.colId,aggFunc:X4(_.getAggFunc(),J,_),pivotResultCol:q,pivotKeys:H.pivotKeys,totalColIds:H.pivotTotalColumnIds}}if(Y===0)return null;return X.length=Y,X},YR=class extends j{constructor(){super(...arguments);this.beanName="filterAggStage",this.step="filter_aggregates",this.refreshProps=[],this.setAllChildrenCountTreeData=(Q)=>{let z=Q.childrenAfterAggFilter,J=0;if(z){let $=z.length;J=$;for(let X=0;X<$;++X)J+=z[X].allChildrenCount??0}let Z=J===0&&Q.level>=0?null:J;Q.setAllChildrenCount(Z),Q.pinnedSibling?.setAllChildrenCount(Z)},this.setAllChildrenCountGridGrouping=(Q)=>{let z=Q.childrenAfterAggFilter,J=0;for(let Z=0,$=z.length;Z<$;++Z){let X=z[Z];if(X.group)J+=X.allChildrenCount;else J++}Q.setAllChildrenCount(J),Q.pinnedSibling?.setAllChildrenCount(J)}}wireBeans(Q){this.filterManager=Q.filterManager}execute(Q){let{rowModel:z,colModel:J,groupStage:Z}=this.beans,{filterManager:$}=this,X=J.isPivotMode(),Y=$?.isAggregateFilterPresent()||$?.isAggregateQuickFilterPresent(),G=!!Z?.treeData,q=(E)=>!E.node.group,H=(E)=>E.node.leafGroup,_=TQ(this.gos)||(X?H:q),U=G?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,W=(E,K=!1)=>{if(E.childrenAfterFilter){if(E.childrenAfterAggFilter=E.childrenAfterFilter,K){let L=E.childrenAfterAggFilter;for(let F=0,D=L.length;F{if(E.childrenAfterAggFilter=E.childrenAfterFilter?.filter((K)=>{if(_({node:K})){if($.doesRowPassAggregateFilters({rowNode:K}))return W(K,!0),!0}return K.childrenAfterAggFilter?.length})||null,E.hasChildren())U(E);else E.setAllChildrenCount(null),E.pinnedSibling?.setAllChildrenCount(null);if(E.sibling)E.sibling.childrenAfterAggFilter=E.childrenAfterAggFilter};A0(z.rootNode,z.hierarchical,Q,Y?B:W)}};function PJ(Q,z){if(Q.sibling)return;let J=g9(Q,z);J.footer=!0,J.setRowTop(null),J.setRowIndex(null),J.oldRowTop=null,J.id="rowGroupFooter_"+Q.id,J.sibling=Q,Q.sibling=J}function GR(Q){let z=Q.sibling;if(!z)return;z._destroy(!1),Q.sibling=void 0,z.sibling=void 0}var qR=class extends j{constructor(){super(...arguments);this.beanName="footerSvc"}addTotalRows(Q,z,J,Z,$,X){let Y=Q;if($){let H=Z&&_z(this.gos);if(HR(X,H))PJ(z,this.beans),J(z.sibling,Y++);return Y}let G=OZ(this.gos);if((Z&&G({node:z}))===X)PJ(z,this.beans),J(z.sibling,Y++);return Y}getTopDisplayIndex(Q,z,J,Z){let $=z;if(Q[0].footer){if(z===0)return 0;$-=1}let X=Q[Q.length-1],Y=$>=J.length;if(X.footer&&Y)return X.rowIndex;return Z($)}doesCellShowTotalPrefix(Q,z){if(!Q.footer||!z?.getColDef().showRowGroup)return!1;if(this.gos.get("treeData"))return!0;if(Q.level===-1)return this.beans.showRowGroupCols?.columns[0]===z;return!!Q.rowGroupColumn&&z?.isRowGroupDisplayed(Q.rowGroupColumn.getId())}applyTotalPrefix(Q,z,J,Z){let $=Z.getColDef().cellRendererParams?.totalValueGetter;if($){let X=y(this.gos,{column:Z,node:J,value:Q,formattedValue:z});if(typeof $==="function")return $(X);if(typeof $==="string")return this.beans.expressionSvc?.evaluate($,X);R(179)}if(J.level===-1)return this.getLocaleTextFunc()("footerTotal","Total")+" ";return this.getTotalValue(z??Q)??""}getTotalValue(Q){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(Q??"")}};function HR(Q,z){switch(z){case"top":case"pinnedTop":return Q==="top";case"bottom":case"pinnedBottom":return Q==="bottom";default:return!1}}var Y4=class extends j1{constructor(){super(...arguments);this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(Q,z,J)=>this.setValueActive(z,Q,J),add:(Q,z,J)=>this.setValueActive(!0,Q,J),remove:(Q,z,J)=>this.setValueActive(!1,Q,J)},this.columnExtractors={setFlagFunc:(Q,z,J)=>this.setColValueActive(Q,z,J),getIndexFunc:()=>{return},getInitialIndexFunc:()=>{return},getValueFunc:(Q)=>{let z=Q.aggFunc;if(z===null||z==="")return null;if(z===void 0)return;return!!z},getInitialValueFunc:(Q)=>{return Q.initialAggFunc!=null&&Q.initialAggFunc!=""}},this.modifyColumnsNoEventsCallbacks={addCol:(Q)=>this.columns.push(Q),removeCol:(Q)=>$0(this.columns,Q)}}extractCols(Q,z){this.columns=super.extractCols(Q,z);for(let J of this.columns){let Z=J.getColDef();if(Z.aggFunc!=null&&Z.aggFunc!="")this.setColAggFunc(J,Z.aggFunc);else if(!J.getAggFunc())this.setColAggFunc(J,Z.initialAggFunc)}return this.columns}setColumnAggFunc(Q,z,J){if(!Q)return;let Z=this.colModel.getColDefCol(Q);if(!Z)return;this.setColAggFunc(Z,z),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[Z],J)}syncColumnWithState(Q,z,J){let Z=J("aggFunc").value1;if(Z!==void 0)if(typeof Z==="string"){if(this.setColAggFunc(Q,Z),!Q.isValueActive())this.setColValueActive(Q,!0,z),this.modifyColumnsNoEventsCallbacks.addCol(Q)}else{if(T(Z))R(33);if(Q.isValueActive())this.setColValueActive(Q,!1,z),this.modifyColumnsNoEventsCallbacks.removeCol(Q)}}setValueActive(Q,z,J){if(Q===z.isValueActive())return;if(this.setColValueActive(z,Q,J),Q&&!z.getAggFunc()&&this.aggFuncSvc){let Z=this.aggFuncSvc.getDefaultAggFunc(z);this.setColAggFunc(z,Z)}}setColAggFunc(Q,z){Q.aggFunc=z,Q.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(Q,z,J){if(Q.aggregationActive!==z)Q.aggregationActive=z,Q.dispatchColEvent("columnValueChanged",J)}},G4={moduleName:"SharedAggregation",version:J0,beans:[cj,uj,qR,Y4],apiFunctions:{addAggFuncs:ej,clearAggFuncs:QR,setColumnAggFunc:zR},dependsOn:[I0]},_R={moduleName:"Aggregation",version:J0,beans:[JR,YR,oj],rowModels:["clientSide"],dependsOn:[G4]},q4=class extends j1{constructor(){super(...arguments);this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(Q,z,J)=>this.setColPivotActive(Q,z,J),add:(Q,z,J)=>this.setColPivotActive(Q,!0,J),remove:(Q,z,J)=>this.setColPivotActive(Q,!1,J)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(Q,z,J)=>this.setColPivotActive(Q,z,J),getIndexFunc:(Q)=>Q.pivotIndex,getInitialIndexFunc:(Q)=>Q.initialPivotIndex,getValueFunc:(Q)=>Q.pivot,getInitialValueFunc:(Q)=>Q.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:(Q)=>{if(!this.columns.includes(Q))this.columns.push(Q)},removeCol:(Q)=>$0(this.columns,Q)}}syncColumnWithState(Q,z,J,Z){let{value1:$,value2:X}=J("pivot","pivotIndex");if($!==void 0||X!==void 0){if(typeof X==="number"||$){if(!Q.isPivotActive())this.setColPivotActive(Q,!0,z),this.modifyColumnsNoEventsCallbacks.addCol(Q);if(Z&&typeof X==="number")Z[Q.getId()]=X}else if(Q.isPivotActive())this.setColPivotActive(Q,!1,z),this.modifyColumnsNoEventsCallbacks.removeCol(Q)}}setColPivotActive(Q,z,J){if(Q.pivotActive!==z){if(Q.pivotActive=z,z)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,Q)?.forEach(($)=>this.setColPivotActive($,z,J));Q.dispatchColEvent("columnPivotChanged",J)}Q.dispatchStateUpdatedEvent("pivot")}},UR=class extends j1{constructor(){super(...arguments);this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(Q,z,J)=>this.setActive(z,Q,J),add:(Q,z,J)=>this.setActive(!0,Q,J),remove:(Q,z,J)=>this.setActive(!1,Q,J)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(Q,z,J)=>this.setColRowGroupActive(Q,z,J),getIndexFunc:(Q)=>Q.rowGroupIndex,getInitialIndexFunc:(Q)=>Q.initialRowGroupIndex,getValueFunc:(Q)=>Q.rowGroup,getInitialValueFunc:(Q)=>Q.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:(Q)=>{if(!this.columns.includes(Q))this.columns.push(Q)},removeCol:(Q)=>$0(this.columns,Q)}}moveColumn(Q,z,J){if(this.columns.length===0)return;let Z=this.columns[Q],$=this.columns.slice(Q,z);this.columns.splice(Q,1),this.columns.splice(z,0,Z),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:$,column:$.length===1?$[0]:null,source:J})}syncColumnWithState(Q,z,J,Z){let{value1:$,value2:X}=J("rowGroup","rowGroupIndex");if($!==void 0||X!==void 0){if(typeof X==="number"||$){if(!Q.isRowGroupActive())this.setColRowGroupActive(Q,!0,z),this.modifyColumnsNoEventsCallbacks.addCol(Q);if(Z&&typeof X==="number")Z[Q.getId()]=X}else if(Q.isRowGroupActive())this.setColRowGroupActive(Q,!1,z),this.modifyColumnsNoEventsCallbacks.removeCol(Q)}}setActive(Q,z,J){if(Q===z.isRowGroupActive())return;this.setColRowGroupActive(z,Q,J);let Z=this.beans.groupHierarchyColSvc?.getColumn(z);if(TZ(this.gos,Q)&&!Z)this.colModel.setColsVisible([z],!Q,J)}setColRowGroupActive(Q,z,J){if(Q.rowGroupActive!==z){if(Q.rowGroupActive=z,z)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,Q)?.forEach(($)=>this.setColRowGroupActive($,z,J));Q.dispatchColEvent("columnRowGroupChanged",J)}Q.dispatchStateUpdatedEvent("rowGroup")}},WR=class extends j{constructor(){super(...arguments);this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this)),this.setupGroupHideColumnsUntilExpanded()}setupGroupHideColumnsUntilExpanded(){let Q=()=>this.updateGroupColumnVisibility();this.addManagedEventListeners({modelUpdated:Q}),this.addManagedPropertyListeners(["groupHideColumnsUntilExpanded","groupDisplayType","groupHideOpenParents"],Q)}addColumns(Q){let{columns:z}=this;if(z==null)return;Q.list=z.list.concat(Q.list),Q.tree=z.tree.concat(Q.tree),HJ(Q)}createColumns(Q,z,J){let Z=this.beans,{colModel:$,gos:X,rowGroupColsSvc:Y,colGroupSvc:G}=Z,q=$.isPivotMode(),H=PZ(X,q),_=q?X.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),U=Y?.columns,B=!(U&&U.length>0||X.get("treeData"))||_||H,E=()=>{if(this.columns)ZQ(Z,this.columns.tree),this.columns=null};if(B){E();return}let K=this.generateAutoCols(U),L=qJ(K,this.columns?.list||null),F=Q.treeDepth,M=(this.columns?this.columns.treeDepth:-1)==F;if(L&&M){let O=new Map(K.map((v)=>[v.getId(),v]));for(let v of this.columns?.list??[]){let I=O.get(v.getId());if(I)v.setColDef(I.getColDef(),null,J)}return}E();let k=G?.findDepth(Q.tree)??0,f=G?.balanceTreeForAutoCols(K,k)??[];this.columns={list:K,tree:f,treeDepth:k,map:{}},z((O)=>{if(!O)return null;let v=O.filter((I)=>!mz(I));return[...K,...v]})}updateColumns(Q){let z=Xz(Q.source);this.columns?.list.forEach((J,Z)=>this.updateOneAutoCol(J,Z,z))}getColumn(Q){return this.columns?.list.find((z)=>PQ(z,Q))??null}getColumns(){return this.columns?.list??null}generateAutoCols(Q=[]){let z=[],{gos:J}=this,Z=J.get("treeData"),$=YJ(J);if(Z&&$)R(182),$=!1;if($)Q.forEach((X,Y)=>{z.push(this.createOneAutoCol(X,Y))});else z.push(this.createOneAutoCol());return z}isSuppressAutoCol(){let Q=this.gos;if(Q.get("groupDisplayType")==="custom")return!0;return Q.get("treeDataDisplayType")==="custom"}createOneAutoCol(Q,z){let J;if(Q)J=`${uz}-${Q.getId()}`;else J=uz;let Z=this.createAutoColDef(J,Q,z);Z.colId=J;let $=new GQ(Z,null,J,!0);return this.createBean($),$}updateOneAutoCol(Q,z,J){let Z=Q.getColDef(),$=typeof Z.showRowGroup=="string"?Z.showRowGroup:void 0,X=this.beans,Y=$!=null?X.colModel.getColDefCol($):void 0,G=Q.getId(),q=this.createAutoColDef(G,Y??void 0,z);Q.setColDef(q,null,J),n0(X,{state:[i5(q,G)]},J)}createAutoColDef(Q,z,J){let Z=this.createBaseColDef(z),$=this.gos.get("autoGroupColumnDef");if(B0(Z,$),Z=uQ(this.beans,Z,Q,!0),$?.groupRowEditable==null)Z.groupRowEditable=void 0;if($?.groupRowValueSetter==null)Z.groupRowValueSetter=void 0;if(!this.gos.get("treeData")){if(n(Z.field)&&n(Z.valueGetter)&&n(Z.filterValueGetter)&&Z.filter!=="agGroupColumnFilter")Z.filter=!1}if(J&&J>0)Z.headerCheckboxSelection=!1;let X=WQ(this.gos),Y=Z.valueGetter||Z.field!=null;if(X&&!Y)Z.sortIndex=void 0,Z.initialSort=void 0;return Z}createBaseColDef(Q){let z=this.gos.get("autoGroupColumnDef"),Z={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:Q?.getColId()??!0};if(!(z&&(z.cellRenderer||z.cellRendererSelector)))Z.cellRenderer="agGroupCellRenderer";if(Q)Z.headerName=this.beans.colNames.getDisplayNameForColumn(Q,"header")??void 0,Z.headerValueGetter=Q.colDef.headerValueGetter;return Z}getDeepestExpandedLevel(Q,z){let J=-1;if(!Q)return J;for(let Z of Q){if(!Z.group||!Z.expanded)continue;if(Z.level>J)J=Z.level;if(J>=z)return J;let $=this.getDeepestExpandedLevel(Z.childrenAfterGroup,z);if($>J)J=$;if(J>=z)return J}return J}updateGroupColumnVisibility(){let Q=this.columns?.list;if(!Q||Q.length===0)return;let{gos:z,visibleCols:J,rowModel:Z}=this.beans,$=g5(z),X=!1,Y=(q,H)=>{if(H!==q.isVisible())q.setVisible(H,"api"),X=!0},G=()=>{for(let q of Q)Y(q,!0)};if(!$)G();else if(Q.length>1){let q=Q.length-2,H=Z?.rootNode?.childrenAfterGroup,_=this.getDeepestExpandedLevel(H,q);if(_>=q)G();else for(let U=0;U=U)}if(X)J.refresh("api")}destroy(){ZQ(this.beans,this.columns?.tree),super.destroy()}},z7=null,tX=(Q)=>{let z=z7,J=new Uint32Array(1<<32-Math.clz32(Q|63));if(z)J.set(z);return z7=J,J},BR=(Q,z,J,Z)=>{let $=z-Z,X=J-1;if($===1){let H=0;while(Q[H].level===X)++H;if(H0){let _=Q[H];Q.copyWithin(1,0,H),Q[0]=_}return Q}let Y=Array($),G=0,q=0;for(let H=0;H{let J=Q[0].level+1,Z=J,$=0,X=J,Y=z7;if(!Y||J>=Y.length)Y=tX(J);++Y[J];for(let U=1;UJ){if(J=W,J>=Y.length)Y=tX(J)}else if(W=0)return Y.fill(0,Z,J+1),Q;let G=Y[Z],q=Y[J];if(G+q===z)return Y[Z]=0,Y[J]=0,BR(Q,z,J,q);let H=0;for(let U=J;U>=Z;--U){let W=Y[U];Y[U]=H,H+=W}let _=Array(z);for(let U=0;U{if(z===2){if(Q[0].level16)return ER(Q,z);for(let J=1;J=0&&Q[X].level<$);Q[Y]=Z}}return Q},KR=class{constructor(){this.kind="cells",this.rows=[],this.unsorted=!1,this.slots=new Map,this.bits=[],this.extraBits=null,this.colCount=0}addRow(Q){let z=Q;if(z==null)return;let J=this.slots;if(J.get(z)!==void 0){while(z!=null&&J.get(z)>=0)J.set(z,-1),z=z.parent;return}let Z=this.rows;do J.set(z,-1),Z.push(z),z=z.parent;while(z!=null&&!J.has(z));this.unsorted=!0}addCell(Q,z){if(z==null){this.addRow(Q);return}if(Q==null)return;let J=this.slots,Z=this.bits,$=J.get(z)??this.ensureCol(z),X=J.get(Q);if(X===void 0)X=this.ensureRow(Q);else if(X<0)return;let Y=$<32?Z:this.extraBits[($>>>5)-1],G=1<<($&31),q=Y[X];if((q&G)!==0)return;Y[X]=q|G;let H=Q.parent;while(H!=null){let _=J.get(H);if(_<0)break;let U=Y[_];if((U&G)!==0)break;Y[_]=U|G,H=H.parent}}hasRow(Q){return this.slots.has(Q)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let Q=H4(this.rows);return this.rows=Q,Q}getSlot(Q){return this.slots.get(Q)??-1}hasCellBySlot(Q,z){if(Q<0)return!0;if(z<32)return z>=0&&(this.bits[Q]&1<>>5)-1][Q]&1<<(z&31))!==0}ensureRow(Q){let z=this.slots,J=this.rows,Z=this.bits,$=this.extraBits,X=Z.push(0),Y=X-1;if($!==null)for(let q=0,H=$.length;q=32){let J=(z>>>5)-1,Z=this.extraBits;if(Z===null)Z=[],this.extraBits=Z;if(J>=Z.length)Z.push(Array(this.bits.length).fill(0))}return z}},rX=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=new Set}addRow(Q){let z=Q;if(z==null)return;let J=this.rowSet;if(J.has(z))return;let Z=this.rows;do J.add(z),Z.push(z),z=z.parent;while(z!=null&&!J.has(z));this.unsorted=!0}addCell(Q,z){this.addRow(Q)}hasRow(Q){return this.rowSet.has(Q)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let Q=H4(this.rows);return this.rows=Q,Q}},LR=class extends j{constructor(){super(...arguments);this.beanName="changedPathFactory"}newPath(Q){return Q?new KR:new rX}ensureRowsPath(Q){let z=Q.changedPath;if(!z&&Q.changedRowNodes&&!Q.newData){let J=this.beans.rowModel;if(J.hierarchical)z=new rX,Q.changedPath=z,z.addRow(J.rootNode)}return z}},FR=class extends j{addExpandedCss(Q,z){if(z.isExpandable())Q.push("ag-row-group"),Q.push(z.expanded?"ag-row-group-expanded":"ag-row-group-contracted")}getRowExpandedListeners(Q){let{rowNode:z}=Q,J=this.updateExpandedCss.bind(this,Q,z);return{expandedChanged:J,hasChildrenChanged:J}}setExpanded(Q,z,J,Z){if(Q.expanded===z)return;Q._expanded=z,Q.dispatchRowEvent("expandedChanged");let $={...e5(Q,this.gos,"rowGroupOpened"),expanded:z,event:J||null};this.dispatchExpandedEvent($,Z)}defaultExpanded(Q){let J=this.beans.gos,Z=Q.level??0,$=Q.group&&J.get("isGroupOpenByDefault");if(!$){let Y=J.get("groupDefaultExpanded");return Y===-1||Z{let X=$.rowComp;X.toggleCss("ag-row-group",J),X.toggleCss("ag-row-group-expanded",J&&Z),X.toggleCss("ag-row-group-contracted",J&&!Z),w0($.element,J&&Z)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},DR=class extends FR{constructor(){super(...arguments);this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(Q){let z=new Set(Q.expandedRowGroupIds);this.beans.rowModel.forEachNode((J)=>{let Z=J.id;if(!Z)return;J._expanded=z.has(Z)}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(Q=!1){let z=[],J=[];return this.beans.rowModel.forEachNode((Z)=>{let $=Z.id;if(!$)return;if(Z.expanded)z.push($);else if(Q&&Z.isExpandable())J.push($)}),{expandedRowGroupIds:z,collapsedRowGroupIds:J}}getExpansionState(){return this.getInternalExpansionState()}isExpanded(Q){if(Q.footer)return!!Q._expanded;if(!(Q.group||Q.master)||Q.leafGroup&&this.beans.colModel.isPivotMode())return!1;let z=Q._expanded;if(z===null)z=this.defaultExpanded(Q)??!1,Q._expanded=z;return!!z}resetExpansion(){let{rowModel:Q}=this.beans;Q.forEachNode((z)=>{if(!z.group&&!z.master)return;z._expanded=null}),this.onGroupExpandedOrCollapsed()}expandAll(Q){let{gos:z,rowModel:J,colModel:Z,eventSvc:$}=this.beans,X=z.get("treeData"),Y=Z.isPivotActive(),G=(H)=>{if(!H)return;for(let _ of H){let U=()=>{_._expanded=Q,G(_.childrenAfterGroup)};if(_.master){U();continue}if(X){if(T(_.childrenAfterGroup))U();continue}if(Y){if(!_.leafGroup)U();continue}if(_.group)U()}},q=J.rootNode;if(q)G(q.childrenAfterGroup);this.onGroupExpandedOrCollapsed(),$.dispatchEvent({type:"expandOrCollapseAll",source:Q?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(Q){let z=this.getInternalExpansionState(!0),J=z.collapsedRowGroupIds.length===0;if(z.expandedRowGroupIds.length===0===J)return;return J?Q.expandAll():Q.collapseAll()}dispatchExpandedEvent(Q,z){if((this.events??(this.events=[])).push(Q),z){this.dispatchExpandedEvents();return}let J=this.dispatchExpandedDebounced;if(!J){if(!this.isAlive())return;J=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=J}J()}dispatchExpandedEvents(){let{eventSvc:Q,rowRenderer:z}=this.beans,J=this.events,Z=J?.length;if(!Z)return;this.events=null;let $=Array(Z);for(let X=0;Xwindow.setTimeout(Q,0);let J=!1;return()=>{if(!z.active){window.setTimeout(Q,0);return}if(J)return;J=!0,z.addDestroyTask(()=>{J=!1,Q()})}}};function MR(Q){let z=Q.get("groupHideParentOfSingleChild");if(!z){if(z=Q.get("groupRemoveSingleChildren"),!z&&Q.get("groupRemoveLowestSingleChildren"))z="leafGroupsOnly"}return{groupHideParentOfSingleChild:z,isGroupMultiAutoColumn:YJ(Q),hideOpenParents:Q.get("groupHideOpenParents"),grandTotalRow:_z(Q),groupTotalRow:OZ(Q)}}function kR(Q,z,J){return Q.groupHideParentOfSingleChild===!0&&J&&z.childrenAfterGroup.length===1}function VR(Q,z,J){return Q.groupHideParentOfSingleChild==="leafGroupsOnly"&&J&&z.leafGroup&&z.childrenAfterGroup.length===1}function fR(Q,z,J,Z,$,X){if(Z&&!J)return!1;if($||X)return!1;if(!Q.hideOpenParents)return!0;if(z.master||z.level===-1)return!0;if(!(Z&&z.leafGroup)&&z.expanded)return!1;return!0}var AR=class extends j{constructor(){super(...arguments);this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){let{beans:Q,gos:z}=this,J=[],Z=Q.rowModel.rootNode;if(!Z)return J;let $=Q.colModel.isPivotMode(),X=$&&Z.leafGroup&&Z.aggData,Y=X?[Z]:Z.childrenAfterSort,G=MR(z);this.recursivelyAddToRowsToDisplay(G,Y,J,$,0);let q=J.length>0,H=G.grandTotalRow;if(!X&&q&&H)if(PJ(Z,Q),H==="pinnedBottom"||H==="pinnedTop")this.beans.pinnedRowModel?.setGrandTotalPinned(H==="pinnedBottom"?"bottom":"top");else{let U=H==="top";this.addRowNodeToRowsToDisplay(G,Z.sibling,J,0,U)}return J}recursivelyAddToRowsToDisplay(Q,z,J,Z,$){if(!z?.length)return;let X=this.beans.masterDetailSvc;for(let Y=0;Ythis.onCsrmCellChange(Q),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(Q){if(!Q.rowDragManaged||!Q.sameGrid)return!1;if(!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()}initDraggingGroups(Q){let z=new Map,J=(Z)=>{let $=Z.childrenAfterGroup;if($){if(z.has(Z))return;let X=$.slice();z.set(Z,X);for(let Y of X)J(Y)}};for(let Z of Q.rows)if(Z.group)J(Z);this.draggingGroups=z}canSetParent(Q){if(!Q.sameGrid)return!1;if(this.beans.groupStage?.treeData)return!0;if(Q.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length}canDropRow(Q,z){if(this.beans.groupStage?.treeData)return!RR(Q,z.newParent);let{position:J,target:Z,newParent:$,rootNode:X}=z,Y=Q.parent;if(Q.group&&(lX(Q,Z)||lX(Q,$)))return!1;if(J==="inside")return!0;if($&&$!==Y)return $!==X||Y===X;let G=$??Z?.parent??X;if(G!==Y)return!1;let q=Q.group?Q.level:Y.level??-1,H=-1;if(Z)H=Z.group?Z.level:Z.parent?.level??-1;else if(G)H=G.level;if(q>=0&&H>=0&&H!==q)return!1;return!0}fixRowsDrop(Q,z,J,Z){let $=!!this.beans.groupStage?.treeData;if(Q.treeData=$,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!$)return;if(!this.draggingGroups&&this.isGroupingDrop(Q)&&!Q.suppressMoveWhenRowDragging)this.initDraggingGroups(Q);let Y=Q.target,G=null,q=!1,H=Q.rootNode,_=this.beans.rowModel,U=this.canStartGroup(Y,$);this.updateDropTarget(Q,J,U);let W=this.beans.pageBounds?.getLastRow?.()??_.getRowCount()-1;if(z){if(!Y||Z>=0.5&&Y.rowIndex===W)G=H;else if(Q.moved&&Y&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(Q))G=Y;if(!G)G=Y?.parent??H}if(!J&&Y&&U&&!(Y.group&&Y.expanded))this.startDropGroupDelay(Y);if(G){if(Y&&G===Y&&G!==H){let B=G.expanded?h9(_,1,Y):null;if(B?.parent===G)Y=B,Z=-0.5;else q=!0}if(Y&&!q){let B=Y;while(B&&B!==H&&B!==G)Y=B,B=B.parent}}Q.target=Y,Q.newParent=G,Q.yDelta=Z,Q.inside=q}clearNewSameParent(Q,z){let J=Q.newParent;if(J&&(!z||SR(Q.rows,J)))Q.newParent=null}updateDropTarget(Q,z,J){let Z=J?Q.target:null;if(this.dropGroupTarget&&this.dropGroupTarget!==Z)this.resetDragGroup();if(!Z?.childrenAfterSort?.length)return;if(z&&this.dropGroupThrottled&&!Z.expanded&&Z.isExpandable?.())Z.setExpanded(!0,void 0,!0);if(this.canDropInTarget(Z,Q))this.dropGroupThrottled=!0,this.dropGroupTarget=Z}canDropInTarget(Q,z){if(Q.expanded)return!0;if(!Q.group)return!1;if(z.pointerPos==="inside")return!0;if(z.treeData)return!1;let J=z.rows,Z=Q.level;for(let $=0,X=J.length;${this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},z)}resetDragGroup(){if(this.dropGroupTimer!==null)window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null;this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(Q){if(Q)this.draggingGroups=null;this.resetDragGroup()}shouldDropTargetBeParent({target:Q,rows:z,pointerPos:J,treeData:Z}){if(!Q||J==="none")return!1;if(J==="inside")return!0;if(!Z&&Q.group&&!Q.expanded)return!0;if(J==="above")return!1;let $=this.beans.rowModel,Y=Q.rowIndex+1,G;do G=$.getRow(Y++);while(G?.footer);let q=this.draggingGroups?.get(Q)??Q.childrenAfterGroup;if(G&&G.parent===Q&&q?.length){let H=new Set(z);for(let _=0,U=q.length;_{if(H.has(D))return;if(H.add(D),W??(W=this.newGroupValues(X)),this.setRowGroup(D,W))U.add(D)},E=(D)=>{let M=this.draggingGroups?.get(D)??D.childrenAfterGroup,k=M?.length;if(k)for(let f=0;f=0)B(A);else E(A)}};for(let D of Q.rows)if(D.group)E(D);else{let M=D.sourceRowIndex>=0&&!D.destroyed?D:this.csrmFirstLeaf(D);if(M)B(M)}let K=J==="inside"?"above":J,L=J==="inside"?this.findFirstLeafForParent(X,H)??Z:Z,F=!1;if(H.size&&K!=="none")F=U$($._leafs,H,L,K==="above");if(!U.size&&!F)return!1;_.reordered=F;for(let D of H)_.updates.add(D);if(this.csrmRefresh(_),q)q.focusCell();else Y.clearFocusedCell();return!0}canStartGroup(Q,z){if(!Q||Q.level<0||Q.footer||Q.detail)return!1;if(Q.group)return!0;return z}flushGroupEdits(){let Q=this.pendingEditRefresh;if(Q)this.pendingEditRefresh=null,this.csrmRefresh(Q)}csrmRefresh(Q){let z=this.beans.rowModel;if(!z.rootNode)return;z.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:Q})}newGroupValues(Q){let z=this.beans.rowGroupColsSvc?.columns??[],J=Array(z.length),Z=-1,$=Q;while($&&$.level>=0){let X=z[$.level];if(X){let Y=X.getColId(),G=$.level;if(J[G]=$.groupData?.[Y]??$.key??void 0,G>Z)Z=G}$=$.parent}return{values:J,columns:z,maxLevel:Z}}setRowGroup(Q,{values:z,columns:J,maxLevel:Z}){if(Z<0)return!1;let{valueSvc:$,changeDetectionSvc:X}=this.beans,Y=!1;X?.beginDeferred();try{for(let G=0;GZ)continue;let H=z[G],_=$.getValue(q,Q,"data");if(_===H||_==null&&H==null)continue;let U=H,W=$.parseValue(q,Q,H,_);if(W!==void 0)U=W;if(Q.setDataValue(q,U,"rowDrag"))Y=!0}}finally{X?.endDeferred()}return Y}onCsrmCellChange(Q){let{column:z,node:J,source:Z}=Q;if(!this.gos.get("refreshAfterGroupEdit"))return;if(Z==="rowDrag")return;if(!z?.isRowGroupActive())return;if(J.group||!J.data)return;if(this.beans.editSvc?.isBatchEditing()){let X=this.pendingEditRefresh;if(!X)X=sX(),this.pendingEditRefresh=X;X.updates.add(J)}else{let X=sX();X.updates.add(J),this.csrmRefresh(X)}}csrmFirstLeaf(Q){if(!Q)return null;let z=this.draggingGroups,J=z?.get(Q)??Q.childrenAfterGroup;while(J?.length){let Z=J[0];if(Z.sourceRowIndex>=0){if(!Z.destroyed)return Z;return this.firstAliveChildLeaf(Z)}J=z?.get(Z)??Z.childrenAfterGroup}return pz(Q)}firstAliveChildLeaf(Q){let z=this.draggingGroups?.get(Q)??Q.childrenAfterGroup;if(z){for(let J of z)if(J.sourceRowIndex>=0&&!J.destroyed)return J}return null}findFirstLeafForParent(Q,z){if(!Q)return null;let J=this.draggingGroups?.get(Q)??Q?.childrenAfterGroup;if(!J)return null;for(let Z=0,$=J.length;Z<$;++Z){let X=J[Z];if(X.sourceRowIndex>=0&&!z.has(X))return X;let Y=this.findFirstLeafForParent(X,z);if(Y!==null)return Y}return null}},sX=()=>{let Q=new W1;return Q.reordered=!0,Q},lX=(Q,z)=>{if(!Q||!z)return!1;let J=z;while(J){if(J===Q)return!0;J=J.parent}return!1},RR=(Q,z)=>{if(!z||Q.parent===z)return!1;let J=z,Z=Q.id;while(J){if(J===Q)return!0;if(Z!=null&&J.id===Z)return!0;J=J.parent}return!1},SR=(Q,z)=>{for(let J=0,Z=Q.length;Jthis.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.columnsInvalidated=!0,this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(Q){return this.strategy?.nonLeafsById?.get(Q)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(Q){let z=this.gos,J=this.strategy?.nestedDataGetter;if(Q.has("treeData"))this.gosTreeData=z.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0;return this.strategy?.onPropChange?.(Q),this.getNestedDataGetter()!==J}extractData(){let Q=this.beans.rowModel.rootNode,z=this.nested?Q?.childrenAfterGroup:Q?._leafs;if(!z)return this.gos.get("rowData")??[];let J=z.length,Z=Array(J),$=0;for(let X=0;X{let z=Q.sibling;if(!z)return null;let J=z._leafs;if(J!==void 0)return J;return E2(z)},E2=(Q)=>{let z=Q.childrenAfterGroup,J=z?.length;if(Q._leafs=null,!J)return null;let Z,$=J===1?z[0]:null;if($?.group&&$.sourceRowIndex<0){if(Z=$._leafs,Z===void 0)Z=E2($)}else if(Q.leafGroup)Z=z;else{Z=[];for(let X=0;X=0)Z.push(Y);if(!Y.group)continue;let G=Y._leafs;if(G===void 0)G=E2(Y);if(G)for(let q=0,H=G.length;q{let{_leafs:Z,sibling:$}=Q;if(Q.treeNodeFlags=0,Q.childrenAfterGroup=Z,Q.childrenMapped=null,Q._groupData=void 0,Q.aggData=null,$)$.childrenAfterGroup=Q.childrenAfterGroup,$.childrenAfterAggFilter=Q.childrenAfterAggFilter,$.childrenAfterFilter=Q.childrenAfterFilter,$.childrenAfterSort=Q.childrenAfterSort,$.childrenMapped=null,$._groupData=void 0,$.aggData=null;for(let X=0,Y=Z.length??0;X{Q.key=null,Q.treeNodeFlags=0,Q.allChildrenCount=null,Q.childrenAfterGroup=null,Q.childrenAfterAggFilter=null,Q.childrenAfterFilter=null,Q.childrenAfterSort=null,Q.childrenMapped=null,Q.level=0,Q._groupData=void 0};function oX(Q,z,J){let Z=Q,$=Z.level-z.level;if($<=0)return!1;if(!J.get("groupHideOpenParents"))return!1;for(let Y=0;Y<$;Y++){if(Z.parent?.getFirstChild()!==Z)return!1;Z=Z.parent}return Z===z}var _4=class extends j{constructor(){super(...arguments);this.indentClass=null}init(Q,z,J,Z,$,X,Y){this.params=Y,this.eGui=z,this.eCheckbox=J,this.eExpanded=Z,this.eContracted=$,this.comp=Q,this.compClass=X;let{node:G,column:q}=Y;if(this.node=G,this.displayedNode=G,this.isEmbeddedRowMismatch())return;if(G.footer){this.initFooterCell();return}if(!q){this.initFullWidthCell();return}this.displayedNode=this.beans.showRowGroupColValueSvc?.getDisplayedNode(G,q)??this.node,this.setupExpand(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}initFooterCell(){let{node:Q}=this.params;if(this.addGroupValue(),this.setupIndent(),Q.level!==-1)this.comp.toggleCss("ag-row-group-leaf-indent",!0)}initFullWidthCell(){let Q=()=>{let{rowDragSvc:z}=this.beans;if(!this.params.rowDrag||!z)return;let J=z.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(J),this.eGui.insertAdjacentElement("afterbegin",J.getGui())};this.setupExpand(),Q(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){let Q=this.params.colDef?.cellAriaRole,z=this.params.column?.getColDef().cellAriaRole;return Q||z||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;let{visibleCols:Q}=this.beans,z=this.params.pinned==="left",J=this.params.pinned==="right",Z=!z&&!J;if(this.gos.get("enableRtl")){if(Q.isPinningLeft())return!J;return!Z}if(Q.isPinningLeft())return!z;return!Z}addGroupValue(){let{params:{value:Q,valueFormatted:z}}=this,J=this.getInnerCompDetails();this.comp.setInnerRenderer(J,z??Q??null)}setupExpand(){let{colModel:Q}=this.beans,{eGridCell:z,suppressDoubleClickExpand:J}=this.params,Z=(q,H)=>{let _=h(q,this.beans,null);if(_)H.appendChild(_),this.addDestroyFunc(()=>_.remove())};Z("groupExpanded",this.eExpanded),Z("groupContracted",this.eContracted);let $=this.comp,X=()=>{if(!this.isExpandable())return;let H=!!this.displayedNode.expanded;$.setExpandedDisplayed(H),$.setContractedDisplayed(!H),w0(z,H)},Y=()=>{let q=this.isExpandable();$.toggleCss("ag-cell-expandable",q),$.toggleCss("ag-row-group",q);let H=!q&&Q.isPivotMode();$.toggleCss("ag-pivot-leaf-group",H);let _=!Q.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);$.toggleCss("ag-row-group-leaf-indent",!q&&_);let U=this.getChildCount(),W=U>0?`(${U})`:"";if($.setChildCount(W),!q)$.setExpandedDisplayed(!1),$.setContractedDisplayed(!1),T8(z);else X()};(()=>{if(!J&&!this.isGroupCellEditable(this.displayedNode))this.addManagedListeners(z,{dblclick:this.onCellDblClicked.bind(this)});this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(z,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:Y,masterChanged:Y,groupChanged:Y,hasChildrenChanged:Y,expandedChanged:X})})(),Y()}getInnerCompDetails(){let{userCompFactory:Q,findSvc:z}=this.beans,J=this.params;if(J.fullWidth){let q=this.gos.get("groupRowRendererParams"),H=_J(Q,q,J);if(H)return H;if(z?.isMatch(J.node,null))return _J(Q,{...q,innerRenderer:"agFindCellRenderer"},J);return}let Z=(q)=>q&&q.componentClass==this.compClass,$=_J(Q,J,J);if($&&!Z($))return $;let{displayedNode:{rowGroupColumn:X}}=this,Y=X?.colDef,G=X&&J.column?.isRowGroupDisplayed(X.getId());if(Y&&G){let q=o1(Q,Y,J);if(q)if(Z(q)){if(Y?.cellRendererParams?.innerRenderer)return _J(Q,Y.cellRendererParams,J)}else return q}if(z?.isMatch(J.node,J.column))return o1(Q,{...Y??J.colDef,cellRenderer:"agFindCellRenderer"},J)}getChildCount(){let{column:Q,suppressCount:z}=this.params;if(z)return 0;let{allChildrenCount:J,rowGroupColumn:Z}=this.displayedNode;if(!((J??0)>0&&(!Z||!Q||Q?.isRowGroupDisplayed(Z.getId()))))return 0;if(this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!oX(this.node,this.displayedNode,this.gos))return 0;return J??0}isExpandable(){let{node:Q,column:z,colDef:J}=this.params;if(!this.displayedNode.isExpandable())return!1;if(Q.rowPinned)return!1;if(!z)return!0;if(Q.hasChildren()&&J){let{showRowGroup:X}=J;if(!X)return!1;if(X===!0)return!0}if(Q===this.displayedNode){if(Q.rowGroupColumn){if(z?.isRowGroupDisplayed(Q.rowGroupColumn.getId()))return!0}if(Q.master)return J?.showRowGroup===!0||J?.showRowGroup==null;return!1}return oX(this.node,this.displayedNode,this.gos)}setupIndent(){let{suppressPadding:Q,node:z,colDef:J}=this.params;if(Q)return;let Z=()=>{let $=z.uiLevel;if(J&&J.showRowGroup!==!0)$=0;let X="ag-row-group-indent-"+$;if(X===this.indentClass)return;if(this.indentClass)this.comp.toggleCss(this.indentClass,!1);this.indentClass=X,this.comp.toggleCss(X,!0),this.eGui.style.setProperty("--ag-indentation-level",String($))};this.addManagedListeners(z,{uiLevelChanged:Z.bind(this)}),Z()}setupCheckbox(){let{node:Q}=this.params;if(!(!Q.footer&&!Q.rowPinned&&!Q.detail))return;this.addManagedPropertyListener("rowSelection",({currentValue:J,previousValue:Z})=>{let $=typeof J==="object"?J:void 0,X=typeof Z==="object"?Z:void 0;if($?.checkboxLocation!==X?.checkboxLocation)this.destroyCheckbox(),this.addCheckbox()}),this.addCheckbox()}addCheckbox(){let{selectionSvc:Q}=this.beans;if(!Q||!hQ(this.gos))return;let{node:z,column:J}=this.params,Z=this.gos.get("rowSelection"),$=E1(Z);if($==="selectionColumn")return;if($==="autoGroupColumn"){let H=J?.getColDef().showRowGroup!=null,_=!J&&z.group;if(!(H||_))return}let X=typeof Z==="object"?Jz(Z):this.params.checkbox;if(!(typeof X==="function"||X===!0))return;if(typeof J?.getColDef().showRowGroup==="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}let q=Q.createCheckboxSelectionComponent();this.cbComp=q,this.createBean(q),q.init({rowNode:z,column:J,overrides:{isVisible:X,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(q.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}isGroupCellEditable(Q){let z=this.params.column;return!!z&&(!!z.getColDef().groupRowEditable||this.gos.get("enableGroupEdit"))&&z.isCellEditable(Q)}onExpandClicked(Q){if(zQ(Q))return;i0(Q),this.onExpandOrContract(Q)}onKeyDown(Q){if(Q.key!==V.ENTER||this.params.suppressEnterExpand)return;if(this.isGroupCellEditable(this.params.node))return;this.onExpandOrContract(Q)}onCellDblClicked(Q){if(zQ(Q))return;if(!(jZ(this.eExpanded,Q)||jZ(this.eContracted,Q)))this.onExpandOrContract(Q)}onExpandOrContract(Q){if(!this.isExpandable())return;let z=this.displayedNode,J=!z.expanded;if(!J&&z.sticky)this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(z.rowTop-z.stickyRowTop);z.setExpanded(J,Q)}destroy(){super.destroy(),this.destroyCheckbox()}},vR={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},eX=class extends x{constructor(){super(vR);this.eExpanded=S,this.eContracted=S,this.eCheckbox=S,this.eValue=S,this.eChildCount=S}init(Q){let z={setInnerRenderer:(X,Y)=>this.setRenderDetails(X,Y),setChildCount:(X)=>this.eChildCount.textContent=X,toggleCss:(X,Y)=>this.toggleCss(X,Y),setContractedDisplayed:(X)=>N(this.eContracted,X),setExpandedDisplayed:(X)=>N(this.eExpanded,X),setCheckboxVisible:(X)=>this.eCheckbox.classList.toggle("ag-invisible",!X),setCheckboxSpacing:(X)=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",X)},J=this.createManagedBean(new _4),Z=!Q.colDef,$=this.getGui();if(J.init(z,$,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,Q),Z)H0($,J.getCellAriaRole())}setRenderDetails(Q,z){if(Q)Q.newAgStackInstance().then((J)=>{if(!J)return;let Z=()=>this.destroyBean(J);if(this.isAlive())this.eValue.appendChild(J.getGui()),this.addDestroyFunc(Z);else Z()});else this.eValue.innerText=z}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},IR=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}",CR=class extends j{constructor(){super(...arguments);this.beanName="showRowGroupColValueSvc"}getGroupValue(Q,z,J){if(!z){if(!Q.group)return null;return{displayedNode:Q,value:Q.groupValue}}let Z=this.beans.valueSvc,$=z.colDef.showRowGroup;if(!$)return null;if(Q.level===-1&&Q.footer)return{displayedNode:Q,value:null};if(typeof $==="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex($)??-1)>Q.level)return null;let G=this.getDisplayedNode(Q,z,!0);if(G)return{displayedNode:G,value:Z.getValue(z,G,"data",J)}}let X=Z.getValue(z,Q,"data",J);if(X==null){let Y=this.getDisplayedNode(Q,z);if(Y)return{displayedNode:Y,value:Z.getValue(z,Y,"data",J)}}return{displayedNode:Q,value:X}}formatAndPrefixGroupColValue(Q,z,J=!1){let Z=this.formatGroupColValue(Q,z,J),{value:$,displayedNode:X}=Q,Y=this.beans.footerSvc;if(Y?.doesCellShowTotalPrefix(X,z))return Y.applyTotalPrefix($,Z,X,z);if(X.footer&&X.level===-1)return null;return Z}formatGroupColValue(Q,z,J=!1){let Z=this.beans.valueSvc,{displayedNode:$,value:X}=Q,Y=$.rowGroupColumn,G=$.group&&!z;if(Y&&(G||z?.isRowGroupDisplayed(Y.colId))){if(J&&Y.colDef.useValueFormatterForExport===!1)return null;let H=Z.formatValue(Y,$,X);if(H==null&&$.key==="")return this.getLocaleTextFunc()("blanks","(Blanks)");return H}if(!z||$.group)return null;if(J&&z.colDef.useValueFormatterForExport===!1)return null;return Z.formatValue(z,$,X)}getDisplayedNode(Q,z,J=!1){let Z=this.gos,$=Z.get("groupHideOpenParents"),X=Z.get("showOpenedGroup")&&!J;if(!$&&!X)return;let Y=z.colDef.showRowGroup;if(Y===!0){if(Q.group)return;return Q.parent??void 0}let G=Q;while(G&&G.rowGroupColumn?.getId()!=Y){let q=G===G.parent?.getFirstChild();if(!X&&!q)return;G=G.parent}if(G===Q)return;return G??void 0}},bR=class extends j{constructor(){super(...arguments);this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){let{colModel:Q,rowGroupColsSvc:z}=this.beans,J=this.columns,Z=this.colsSet,$=this.colsMap;$.clear();let X=J.length,Y=0,G=!1,q=Q.getCols();for(let H=0,_=q.length;H<_;++H){let U=q[H],B=U.getColDef().showRowGroup;if(typeof B==="string")$.set(B,U);else if(B===!0){let E=z?.columns;if(E)for(let K=0,L=E.length;K=X||!Z.has(U)),J[Y++]=U}if(G||(G=Y!==X),G){J.length=Y,Z.clear();for(let H=0;H{this.gridBodyCtrl=Q.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(Q){if(this.extraTopHeight===Q)return;this.extraTopHeight=Q,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:Q})}setOffsetBottom(Q){if(this.extraBottomHeight===Q)return;this.extraBottomHeight=Q}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(Q){return this.isClientSide?wR(Q):xR(Q)}getFirstPixelOfGroup(Q){if(Q.footer)return Q.sibling.rowTop+Q.sibling.rowHeight-1;if(Q.hasChildren())return Q.rowTop-1;return 0}updateStickyRows(Q){let z=Q==="top",J=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(Q,new Set,J);let Z=new Set,{rowModel:$,rowRenderer:X,pinnedRowModel:Y,pageBounds:G,rowContainerHeight:q}=this.beans,{pageFirstPixel:H,pageLastPixel:_}=G.getCurrentPagePixelRange(),U=z?X.firstVisibleVPixel-this.extraTopHeight:X.lastVisibleVPixel-this.extraTopHeight,W=q.divStretchOffset??0,B=H+W,E=_+W,K=(M)=>{if(Z.add(M),z){let k=this.getLastPixelOfGroup(M),f=U+J+M.rowHeight;if(kf)M.stickyRowTop=J-(k-f);else M.stickyRowTop=J}J=0,Z.forEach((k)=>{let f=k.stickyRowTop+k.rowHeight;if(J{if(!M.displayed)return!1;if(M.footer){if(L===!0)return!1;if(L==="grand"&&M.level===-1)return!1;if(L==="group"&&M.level>-1)return!1;let k=M.sibling.rowIndex?M.sibling.rowIndex+1===M.rowIndex:!1;if(Q==="bottom"&&k)return!1;if(M.level===-1&&Y?.getGrandTotalPinned())return!1;return!Z.has(M)}if(M.isExpandable()){if(F===!0)return!1;if(Q==="bottom")return!1;return!Z.has(M)&&!!M.expanded}return!1};for(let M=0;M<100;M++){let k=U+J;if(!z)k=U-J;if(z&&kE)k=E;let f=$.getRowIndexAtPixel(k),A=$.getRow(f);if(A==null)break;let v=this.getStickyAncestors(A).find((C)=>(z?C.rowIndexf)&&D(C));if(v){K(v);continue}if((z?A.rowTopk)&&D(A)){K(A);continue}break}if(!z)Z.forEach((M)=>{M.stickyRowTop=J-(M.stickyRowTop+M.rowHeight)});return this.refreshNodesAndContainerHeight(Q,Z,J)}areFooterRowsStickySuppressed(){let Q=this.gos.get("suppressStickyTotalRow");if(Q===!0)return!0;let z=Q==="group",J=Q==="grand";if(z&&J)return!0;if(J)return"grand";if(z)return"group";return!1}canRowsBeSticky(){let Q=k1(this.gos),z=this.areFooterRowsStickySuppressed(),J=this.gos.get("suppressGroupRowsSticky");return Q&&(!z||!J)}getStickyAncestors(Q){let z=[],J=Q.footer?Q.sibling:Q.parent;while(J){if(J.sibling)z.push(J.sibling);z.push(J),J=J.parent}return z.reverse()}checkStickyRows(){let Q=this.updateStickyRows("top"),z=this.updateStickyRows("bottom");return Q||z}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(Q){let z=new Set;if(this.stickyTopRowCtrls.some((J)=>J.rowNode===Q)){for(let J=0;J{if(G.has(B))return;B.sticky=!0,q.push(this.createRowCon(B,!1,!1))});let H=!!q.length||Y.length!==$.length;if(Z){if(this.topContainerHeight!==J)this.topContainerHeight=J,this.gridBodyCtrl.setStickyTopHeight(J),H=!0}else if(this.bottomContainerHeight!==J)this.bottomContainerHeight=J,this.gridBodyCtrl.setStickyBottomHeight(J),H=!0;this.destroyRowCtrls(X,!1);let _=[...Y,...q];if(_.sort((B,E)=>E.rowNode.rowIndex-B.rowNode.rowIndex),!Z)_.reverse();for(let B of _)B.setRowTop(B.rowNode.stickyRowTop);let U=this.beans.pageBounds,W=0;if(Z){for(let B of z)if(B.rowIndexthis.topContainerHeight)W=this.topContainerHeight;this.setOffsetTop(W)}else{for(let B of z)if(B.rowIndex>U.getLastRow())W+=B.rowHeight;if(W>this.bottomContainerHeight)W=this.bottomContainerHeight;this.setOffsetBottom(W)}if(!H)return!1;if(Z)this.stickyTopRowCtrls=_;else this.stickyBottomRowCtrls=_;return!0}ensureRowHeightsValid(){let Q=!1,z=(J)=>{let Z=J.rowNode;if(Z.rowHeightEstimated){let $=r1(this.beans,Z);Z.setRowHeight($.height),Q=!0}};return this.stickyTopRowCtrls.forEach(z),this.stickyBottomRowCtrls.forEach(z),Q}};function xR(Q){if(Q.isExpandable()||Q.footer){if(Q.master&&Q.detailNode)return Q.detailNode.rowTop+Q.detailNode.rowHeight;if(!Q.sibling||Math.abs(Q.sibling.rowIndex-Q.rowIndex)===1){let J=Q.childStore?.getStoreBounds();if(Q.footer)J=Q.sibling.childStore?.getStoreBounds();return(J?.heightPx??0)+(J?.topPx??0)}if(Q.footer)return Q.rowTop+Q.rowHeight;return Q.sibling.rowTop+Q.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function wR(Q){if(Q.isExpandable()||Q.footer){if(Q.footer&&Q.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!Q.sibling||Math.abs(Q.sibling.rowIndex-Q.rowIndex)===1){let Z=Q.footer?Q.sibling:Q;while(Z.isExpandable()&&Z.expanded)if(Z.master&&Z.detailNode)Z=Z.detailNode;else if(Z.childrenAfterSort){if(Z.childrenAfterSort.length===0)break;Z=b(Z.childrenAfterSort)}return Z.rowTop+Z.rowHeight}if(Q.footer)return Q.rowTop+Q.rowHeight;return Q.sibling.rowTop+Q.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var NR=class extends j{constructor(){super(...arguments);this.beanName="stickyRowSvc"}createStickyRowFeature(Q,z,J){let Z=this.gos;if(k1(Z)&&o(Z)||Hz(Z))return Q.createManagedBean(new yR(z,J));return}},U4={moduleName:"GroupCellRenderer",version:J0,userComponents:{agGroupRowRenderer:eX,agGroupCellRenderer:eX},dynamicBeans:{groupCellRendererCtrl:_4},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[IR],dependsOn:[I0]},gR={moduleName:"GroupColumn",version:J0,beans:[WR,bR,CR,UR,q4,Y4],dependsOn:[I0,U4]},W4={moduleName:"ChangedPath",version:J0,beans:[LR],dependsOn:[I0]},F2={moduleName:"ClientSideRowModelHierarchy",version:J0,rowModels:["clientSide"],beans:[OR,AR,DR],dependsOn:[I0,W4]},B4={moduleName:"StickyRow",version:J0,beans:[NR]},hR={moduleName:"GroupEdit",version:J0,beans:[jR],dependsOn:[I0,F2]},uR=({valueSvc:Q,dataTypeSvc:z},J,Z)=>{let $=Q.getValue(J,Z,"data"),X=null;if($ instanceof Date)X=$;else if(typeof $==="string")X=(z?.getDateParserFunction(J)??e1)($)??null;return X},Kz=(Q,z,J,Z)=>($)=>{let X=uR(Q,z,$.node),Y=$1(X);if(!Y)return null;return Z?.(Y[J])??Y[J]},Lz=({colNames:Q},z,J)=>(Z)=>{let $=Q.getDisplayNameForColumn(z,Z.location);if($)return`${$} (${J})`;return""},mR=Object.fromEntries(F6.map((Q)=>[Q,Q.toLowerCase()])),cR=(Q)=>{let z=F6[Number.parseInt(Q,10)-1]??Q,J=mR[z]??Q;return{month:z,localeKey:J}};function QY(Q){return Q.groupHierarchy??Q.rowGroupingHierarchy}var pR=class extends j{constructor(){super(...arguments);this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(Q){let z=this.columns;if(z==null)return;Q.list=z.list.filter((J)=>!Q.list.some((Z)=>Z.getColId()===J.getColId())).concat(Q.list),Q.tree=z.tree.filter((J)=>!Q.tree.some((Z)=>Z.getId()===J.getId())).concat(Q.tree),HJ(Q)}createColumns(Q){let z=new WeakMap,J=new WeakMap,Z=this.createGroupHierarchyColumns(Q,z,J);if(qJ(Z,this.columns?.list??[]))return;ZQ(this.beans,this.columns?.tree),this.columns=null;let{colGroupSvc:X}=this.beans,Y=X?.findDepth(Q.tree)??0,G=X?.balanceTreeForAutoCols(Z,Y)??[];this.columns={list:Z,tree:G,treeDepth:Y,map:{}},this.sourceColumnMap=z,this.inverseColumnMap=J}updateColumns(Q){}getColumn(Q){return this.columns?.list.find((z)=>PQ(z,Q))??null}getColumns(){return this.columns?.list??null}expandColumnInto(Q,z){let J=this.getVirtualColumnsForColumn(z).concat(z);for(let Z of J)if(!Q.some(($)=>PQ($,Z)||$.getColId()===Z.getColId()))Q.push(Z)}compareVirtualColumns(Q,z){let J=this.inverseColumnMap.get(Q),Z=this.inverseColumnMap.get(z);if(J&&J===Z){let $=this.sourceColumnMap.get(J)??[];return $?.indexOf(Q)-$?.indexOf(z)}if(this.sourceColumnMap.get(Q)?.includes(z))return 1;if(this.sourceColumnMap.get(z)?.includes(Q))return-1;return null}insertVirtualColumnsForCol(Q,z){let J=this.getVirtualColumnsForColumn(z);if(!J)return[];let Z=Q.indexOf(z);if(Z<0)Z=Q.length-1;return JJ(Q,J),Q.splice(Z,0,...J),J}getVirtualColumnsForColumn(Q){if(this.isGroupHierarchyColsEnabledForCol(Q))return this.sourceColumnMap.get(Q)??[];return[]}isGroupHierarchyColsEnabled(Q){return Q.list.some((z)=>this.isGroupHierarchyColsEnabledForCol(z))}isGroupHierarchyColsEnabledForCol(Q){let z=Q.getColDef();return!!(QY(z)&&(z.rowGroup||z.enableRowGroup||z.rowGroupIndex!=null||z.pivot||z.enablePivot||z.pivotIndex!=null))}createGroupHierarchyColDefs(Q){let z=[],J=Q.getColDef(),Z=QY(J);if(!Z)return z;if(!this.isGroupHierarchyColsEnabledForCol(Q))return z;for(let $ of Z){let X=null;if(typeof $==="string")X=this.createColDefForPart($,Q,J);else X=$;if(X)z.push(X)}return z}createGroupHierarchyColumns(Q,z,J){if(!this.isGroupHierarchyColsEnabled(Q))return[];let Z=[];for(let $ of Q.list)for(let X of this.createGroupHierarchyColDefs($)){let Y=X.colId;this.gos.validateColDef(X,Y,!0);let G=new GQ(X,null,Y,!0);this.createBean(G),Z.push(G),iR(z,$,G),J.set(G,$)}return Z}createColDefForPart(Q,z,J){let{beans:Z,gos:$}=this,X=`${f9}-${z.getColId()}-${Q}`,Y={enableRowGroup:J.enableRowGroup,rowGroup:J.rowGroup,enablePivot:J.enablePivot,hide:!0,editable:!1},G=$.get("groupHierarchyConfig")??{};if(Q in G){let U={...Y,...G[Q]};return U.colId??(U.colId=X),uQ(Z,U,U.colId,!0)}let q=uQ(Z,{colId:X,...Y},X,!0),H=this.getLocaleTextFunc(),_=(U,W)=>H?.(U,W)??W;switch(Q){case"year":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Year")),valueGetter:Kz(Z,z,0)};case"quarter":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Quarter")),valueGetter:Kz(Z,z,1,(U)=>(Math.floor(Number(U)/4)+1).toString())};case"month":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Month")),valueGetter:Kz(Z,z,1)};case"formattedMonth":return{...q,headerValueGetter:Lz(Z,z,_("month","Month")),valueGetter:Kz(Z,z,1,(U)=>{let W=cR(U);return _(W.localeKey,W.month)})};case"day":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Day")),valueGetter:Kz(Z,z,2)};case"hour":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Hour")),valueGetter:Kz(Z,z,3)};case"minute":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Minute")),valueGetter:Kz(Z,z,4)};case"second":return{...q,headerValueGetter:Lz(Z,z,_(Q,"Second")),valueGetter:Kz(Z,z,5)};default:return null}}};function iR(Q,z,J){let Z=Q.get(z);Q.set(z,(Z??[]).concat(J))}var nR={moduleName:"GroupHierarchy",version:J0,beans:[pR],dependsOn:[W4]};var dR=(Q,z)=>{if(!Q){z.length=0;return}let J=Q.length;z.length=J;for(let Z=0;Z{let J=Q.length;if(J!==z?.length)return!0;for(let Z=0;Z0){J=!0;break}if(!J)return!1;return Q.sort(zY),!0}function zY(Q,z){let J=Q.sourceRowIndex,Z=z.sourceRowIndex,$=J>=0,X=Z>=0,Y=$&&X,G=!$&&!X;if(Y)return J-Z;if(G)return Q.__objectId-z.__objectId;if($)return 1;return-1}var sR=class extends j{constructor(){super(...arguments);this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){let Q=this.nonLeafsById;for(let z of Q.values())z._destroy(!1);Q.clear()}loadGroupData(Q){if(!Q.group)return Q._groupData=null,null;let z=Q.rowGroupColumn,{valueSvc:J,showRowGroupCols:Z}=this.beans,$={};if(Q._groupData=$,!z)return $;let X=pz(Q),Y=z.getId();if(!Z)return $;let G=Z.columns;for(let q=0,H=G.length;q{let Z=J.childrenAfterGroup,$=Z?.length;if(!$)return;let X=Array($),Y=0,G=!1,q;for(let H=0;H<$;++H){let _=Z[H];if(!_.childrenAfterGroup?.length)G||(G=Y!==H),X[Y++]=_;else if(!q&&_.key===""){q=_;let U=$-1;G||(G=H!==U),X[U]=_}}if(G){for(let _=0;_<$;++_){let U=Z[_];if(U.childrenAfterGroup?.length&&U!==q)X[Y++]=U}J.childrenAfterGroup=X;let H=J.sibling;if(H)H.childrenAfterGroup=X}})}initRefresh(Q){let{rowGroupColsSvc:z,colModel:J,gos:Z}=this.beans;this.pivotMode=J.isPivotMode(),this.groupEmpty=this.pivotMode||!Z.get("groupAllowUnbalanced");let $=z?.columns,X=this.groupCols,Y=Q.afterColumnsChanged;if(Y||!X||this.checkGroupCols)if(this.checkGroupCols=!1,X&&!tR(X,$)){if(Y)return"skip"}else{Q.animate=!1;let G=X[0]?.col.getId()!==$?.[0]?.getId();return dR($,X),G?"refresh":"groupColsChanged"}return"refresh"}handleDeltaUpdate(Q,z,{removals:J,updates:Z,adds:$,reordered:X},Y){let G=new Set;for(let q=0,H=J.length;q1)}}if($.size)for(let q of $){this.insertOneNode(Q,q);let H=q.parent;z?.addRow(H),X||(X=(H?.childrenAfterGroup?.length??0)>1)}if(G.size)JY(G),this.removeEmptyGroups(G,Y);if(X)this.sortChildren(Q,z)}sortChildren(Q,z){A0(Q,!0,void 0,(J)=>{if(rR(J.childrenAfterGroup))z?.addRow(J)})}orderGroups(Q){let z=this.gos.getCallback("initialGroupOrderComparator");if(!z)return;let J=this.beans,Z=J.gridApi,$=J.gridOptions.context,X=(G,q)=>z({api:Z,context:$,nodeA:G,nodeB:q}),Y=(G)=>{let q=G.childrenAfterGroup,H=q?.length;if(!H||G.leafGroup)return;if(H>1)q.sort(X);for(let _=0,U=H;_=0;--G){let{col:q}=Y[G],H=J.getKeyForNode(q,z);if(H==null||H===""){if(!Z)continue;H=""}if(!$?.parent||$.key!==H){X=!0;break}$=$.parent}if(X||(X=!!$?.parent),!X)return!1;return this.removeFromParent(z),this.insertOneNode(Q,z),z.setData(z.data),!0}groupShouldBeRemoved(Q){let z=this.getChildrenMappedKey(Q.key,Q.rowGroupColumn),J=Q.parent?.childrenMapped;if(J?!J[z]:!0)return!1;return!!Q.group&&(Q.childrenAfterGroup?.length??0)===0}removeEmptyGroups(Q,z){let J=this.beans.selectionSvc,Z,$=Array.from(Q),X=this.nonLeafsById;do{Q.clear();for(let Y=0;Y<$.length;++Y){let G=$[Y];while(G){let q=G.parent;if(G.destroyed){$[Y]=q,G=q;continue}if(!q)break;if(!this.groupShouldBeRemoved(G)){G=q;continue}if(Q.add(q),this.removeFromParent(G),J&&G.isSelected())Z??(Z=[]),Z.push(G);$[Y]=q,X.delete(G.id),G._destroy(z),G=q}}JY(Q)}while(Q.size);if(Z)J.setNodesSelected({nodes:Z,newValue:!1,source:"rowGroupChanged"})}removeFromParent(Q){let z=Q.parent;if(z){let J=this.getChildrenMappedKey(Q.key,Q.rowGroupColumn),Z=z.childrenMapped;if(Z)delete Z[J]}return Q.setRowTop(null),Q.setRowIndex(null),z}addToParent(Q,z){let J=z.childrenMapped??(z.childrenMapped={}),Z=this.getChildrenMappedKey(Q.key,Q.rowGroupColumn);if(J[Z]!==Q){J[Z]=Q;let $=z.childrenAfterGroup;if(!$){z.childrenAfterGroup=$=[];let X=z.sibling;if(X)X.childrenAfterGroup=z.childrenAfterGroup}$.push(Q),hY(z,this.beans,!0),X2(z)}}shotgunResetEverything(Q){let z=this.nonLeafsById;for(let $ of z.values())$.childrenAfterGroup=null,$.childrenMapped=null;Q.leafGroup=!this.groupCols?.length,Q.childrenAfterGroup=[],Q.childrenMapped={},Q.updateHasChildren();let J=Q.sibling;if(J)J.childrenAfterGroup=Q.childrenAfterGroup,J.childrenMapped=Q.childrenMapped;let Z=Q._leafs;for(let $=0,X=Z.length;$=G-1,K=this.createGroup(J,H,U,B,E,z);this.addToParent(K,J),J=K}if(!J.group)R(184,{parentGroupData:J.data,childNodeData:z.data});z.parent=J,z.level=J.level+1,J.childrenAfterGroup.push(z),J.updateHasChildren(),X2(J)}createGroup(Q,z,J,Z,$,X){let Y=z.col,G=(Q.level>=0?Q.id+"-":"row-group-")+(Y.getColId()+"-"+J),q=this.nonLeafsById,H=q.get(G),_=!0;if(H){if(H.childrenAfterGroup!==null)return H._expanded??(H._expanded=null),H;_=!1,X2(H)}else H=new Wz(this.beans),H.group=!0,H.key=J,H.id=G,H.aggData=null,q.set(G,H);let U=(K)=>{K.childrenAfterGroup=W,K.childrenMapped=B,K.parent=Q,K.level=Z,K.rowGroupIndex=Z,K.leafGroup=$},W=[],B={};if(U(H),H.field=z.field??null,H.rowGroupColumn=Y,H.groupValue=this.beans.valueSvc.getValue(Y,X,"data"),H._expanded??(H._expanded=null),_)return H.setAllChildrenCount(0),H.updateHasChildren(),H;let E=H.sibling;if(E)U(E);return H.dispatchRowEvent("hasChildrenChanged"),H}getChildrenMappedKey(Q,z){return z?z.getId()+"-"+Q:Q}onShowRowGroupColsSetChanged(){let{rowModel:Q,valueSvc:z}=this.beans;for(let Z of this.nonLeafsById.values()){Z._groupData=void 0;let $=Z.rowGroupColumn,X=$&&pz(Z);Z.groupValue=X&&z.getValue($,X,"data")}let J=Q.rootNode?._leafs;if(J)for(let Z=0,$=J.length;Z<$;++Z){let X=J[Z];X.parent._groupData=void 0}}},JY=(Q)=>{for(let z of Q){let J=z?.childrenAfterGroup;if(!J)continue;let Z=J.length,$=0;for(let X=0;X{while(Q._leafs!==void 0){let z=Q.parent;if(!z)break;Q._leafs=void 0,Q=z}};function lR(Q,z){Q.rowGroupColsSvc?.setColumns(z,"api")}function aR(Q,z){Q.rowGroupColsSvc?.removeColumns(z,"api")}function oR(Q,z){Q.rowGroupColsSvc?.addColumns(z,"api")}function eR(Q,z,J){Q.rowGroupColsSvc?.moveColumn?.(z,J,"api")}function QS(Q){return Q.rowGroupColsSvc?.columns??[]}var E4={moduleName:"SharedRowGrouping",version:J0,apiFunctions:{setRowGroupColumns:lR,removeRowGroupColumns:aR,addRowGroupColumns:oR,getRowGroupColumns:QS,moveRowGroupColumn:eR},dependsOn:[I0,G4,gR,B4,nR]},zS={moduleName:"RowGrouping",version:J0,dynamicBeans:{groupStrategy:sR},rowModels:["clientSide"],dependsOn:[E4,_R,F2,hR]};function JS(Q,z){Q.clipboardSvc?.copyToClipboard(z)}function ZS(Q,z){Q.clipboardSvc?.cutToClipboard(z)}function $S(Q,z){Q.clipboardSvc?.copySelectedRowsToClipboard(z)}function XS(Q,z){Q.clipboardSvc?.copySelectedRangeToClipboard(z)}function YS(Q){Q.clipboardSvc?.copyRangeDown()}function GS(Q){Q.clipboardSvc?.pasteFromClipboard()}var Q2="paste",r6="dragCopy",s6="clipboard";function qS(Q,z=","){let J=[],Z=(X)=>X==="\r"||X===` +`,$=!1;if(Q==="")return[[""]];for(let X=0,Y=0,G=0;G{if(!J[X])J[X]=[];if(!J[X][Y])J[X][Y]=""};if(U(),H==='"'){if($)if(_==='"')J[X][Y]+='"',G++;else $=!1;else if(q===void 0||q===z||Z(q))$=!0}if(!$&&H!=='"'){if(H===z){Y++,U();continue}else if(Z(H)){if(Y=0,X++,U(),H==="\r"&&_===` +`)G++;continue}}J[X][Y]+=H}return J}var HS=class extends j{constructor(){super(...arguments);this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){let{gos:Q,rowModel:z,ctrlsSvc:J}=this.beans;if(o(Q,z))this.clientSideRowModel=z;J.whenReady(this,(Z)=>{this.gridCtrl=Z.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){if(!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText)navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((z)=>{R(40,{e:z,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()});else this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let Q=!1,z=(J)=>{let Z=Date.now();if(Z-this.lastPasteOperationTime<50)Q=!0,J.preventDefault();this.lastPasteOperationTime=Z};this.executeOnTempElement((J)=>{J.addEventListener("paste",z),J.focus({preventScroll:!0})},(J)=>{let Z=J.value;if(!Q)this.processClipboardData(Z);else this.refocusLastFocusedCell();J.removeEventListener("paste",z)})}refocusLastFocusedCell(){let{focusSvc:Q}=this.beans,z=Q.getFocusedCell();if(z)Q.setFocusedCell({rowIndex:z.rowIndex,column:z.column,rowPinned:z.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){let Q=this.gos.get("clipboardDelimiter");return T(Q)?Q:"\t"}processClipboardData(Q){if(Q==null)return;let z=qS(Q,this.getClipboardDelimiter()),J=this.gos.getCallback("processDataFromClipboard");if(J)z=J({data:z});if(z==null)return;if(this.gos.get("suppressLastEmptyLineOnPaste"))this.removeLastLineIfBlank(z);let{rangeSvc:Z,editSvc:$}=this.beans,X=(Y,G,q,H)=>{if(Z?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(z))this.pasteIntoActiveRange(z,Y,G,H);else this.pasteStartingFromFocusedCell(z,Y,G,q,H);$?.stopEditing(void 0,{source:Q2})};this.doPasteOperation(X)}doPasteOperation(Q){let{eventSvc:J,focusSvc:Z,rowRenderer:$,gos:X}=this.beans;J.dispatchEvent({type:"pasteStart",source:"clipboard"});let{clientSideRowModel:Y}=this,G=Y?.rootNode,q=G&&this.beans.changedPathFactory?.newPath(X.get("aggregateOnlyChangedColumns")),H={},_=[],U=Z.getFocusedCell();Q(H,_,U,q);let W=_.slice();if(q)Y.doAggregate(q),A0(G,Y.hierarchical,q,(B)=>{W.push(B)});$.refreshCells({rowNodes:W}),this.dispatchFlashCells(H),this.fireRowChanged(_),this.refocusLastFocusedCell(),J.dispatchEvent({type:"pasteEnd",source:"clipboard"})}getPreProcessRangeCallback(Q){return(z)=>{let{rangeSvc:J}=this.beans;if(!J)return;let{rowDiff:Z,colDiff:$}=this.getAdjustedRangeDimensionForPaste(z,Q);if(Z!==0)J.extendRangeRowCountBy(z,Z);if($!==0)J.extendRangeColumnCountBy(z,$)}}getAdjustedRangeDimensionForPaste(Q,z){let J=this.beans.rangeSvc,Z=z.length,$=J.getRangeRowCount(Q),X=$>=Z&&$%Z===0,Y=z[0].length,G=Q.columns.length,q=G>=Y&&G%Y===0;return{rowDiff:X?0:Z-$,colDiff:q?0:Y-G}}pasteIntoActiveRange(Q,z,J,Z){let $=0,X=0,Y=(G,q,H,_)=>{if(_-$>=Q.length){if(_%Q.length!==0)return;$+=X,X=0}let W=Q[_-$];J.push(q);let B=this.gos.getCallback("processCellFromClipboard"),E=H.columns,K=E.findIndex(IQ);if(K!==-1)E.splice(K,1);for(let L=0;L=W.length)D=L%W.length;let M=this.processCell(q,F,W[D],r6,B,!0);q.setDataValue(F,M,Q2),Z?.addCell(q.parent,F.getId());let{rowIndex:k,rowPinned:f}=G,A=bQ({rowIndex:k,column:F,rowPinned:f});z[A]=!0}X++};this.iterateActiveRanges(Y,!1,this.getPreProcessRangeCallback(Q))}getDisplayedColumnsStartingAt(Q){let z=Q,J=[],{visibleCols:Z}=this.beans;while(z&&GJ(z))z=Z.getColAfter(z);while(z!=null)J.push(z),z=Z.getColAfter(z);return J}pasteStartingFromFocusedCell(Q,z,J,Z,$){if(!Z)return;let X={rowIndex:Z.rowIndex,rowPinned:Z.rowPinned},Y=this.getDisplayedColumnsStartingAt(Z.column);if(this.isPasteSingleValueIntoRange(Q))this.pasteSingleValueIntoRange(Q,J,z,$);else this.pasteMultipleValues(Q,X,J,Y,z,s6,$)}isPasteSingleValueIntoRange(Q){let z=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(Q)&&!!z&&!z.isEmpty()}pasteSingleValueIntoRange(Q,z,J,Z){let $=Q[0][0],X=(Y,G,q)=>{z.push(G),q.columns.forEach((H)=>this.updateCellValue(G,H,$,J,s6,Z))};this.iterateActiveRanges(X)}hasOnlyOneValueToPaste(Q){return Q.length===1&&Q[0].length===1}copyRangeDown(){let{rangeSvc:Q,gos:z,formula:J,valueSvc:Z}=this.beans;if(!Q||Q.isEmpty())return;let $=[],X=(Y,G,q,H)=>{let _=z.getCallback("processCellForClipboard"),U=z.getCallback("processCellFromClipboard"),W=(B,E,K)=>{let{columns:L}=K;if(!$.length)L.forEach((F)=>{let D=this.processCell(E,F,Z.getValue(F,E,"batch"),r6,_,!1,!0);$.push(D)});else G.push(E),L.forEach((F,D)=>{if(!F.isCellEditable(E)||F.isSuppressPaste(E))return;if(F.isAllowFormula()&&J?.isFormula($[D]))$[D]=J?.updateFormulaByOffset({value:$[D],rowDelta:1});let k=this.processCell(E,F,$[D],r6,U,!0);E.setDataValue(F,k,Q2),H?.addCell(E.parent,F.getId());let{rowIndex:f,rowPinned:A}=B,O=bQ({rowIndex:f,column:F,rowPinned:A});Y[O]=!0})};this.iterateActiveRanges(W,!0)};this.doPasteOperation(X)}removeLastLineIfBlank(Q){let z=b(Q);if(z&&z.length===1&&z[0]===""){if(Q.length===1)return;$0(Q,z)}}fireRowChanged(Q){if(this.gos.get("editType")!=="fullRow")return;for(let z of Q)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:z,data:z.data,rowIndex:z.rowIndex,rowPinned:z.rowPinned})}shouldSkipPasteRow(Q,z,J){if(Q.detail||Q.footer)return!0;if(J&&Q.group){for(let Z of z)if(Z.isCellEditable(Q))return!1;return!0}return!1}pasteMultipleValues(Q,z,J,Z,$,X,Y){let G=z,q=this.beans,{gos:H}=q,_=this.clientSideRowModel!=null&&!H.get("enableGroupEdit")&&!H.get("treeData"),U=()=>{while(G){let W=M0(q,G);if(G=L0(q,{rowPinned:G.rowPinned,rowIndex:G.rowIndex}),W!=null&&!this.shouldSkipPasteRow(W,Z,_))return W}return null};for(let W of Q){let B=U();if(!B)continue;W.forEach((E,K)=>this.updateCellValue(B,Z[K],E,$,X,Y)),J.push(B)}}updateCellValue(Q,z,J,Z,$,X){if(!Q||!z?.isCellEditable(Q)||z?.isSuppressPaste(Q))return;let Y=this.processCell(Q,z,J,$,this.gos.getCallback("processCellFromClipboard"),!0);Q.setDataValue(z,Y,Q2);let{rowIndex:G,rowPinned:q}=Q,H=bQ({rowIndex:G,column:z,rowPinned:q});Z[H]=!0,X?.addCell(Q.parent,z.getId())}copyToClipboard(Q={}){this.copyOrCutToClipboard(Q)}cutToClipboard(Q={},z="api"){if(this.gos.get("suppressCutToClipboard"))return;this.eventSvc.dispatchEvent({type:"cutStart",source:z}),this.copyOrCutToClipboard(Q,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:z})}copyOrCutToClipboard(Q,z){let{includeHeaders:J,includeGroupHeaders:Z}=Q,{gos:$,focusSvc:X}=this.beans;if(J==null)J=$.get("copyHeadersToClipboard");if(Z==null)Z=$.get("copyGroupHeadersToClipboard");let Y={includeHeaders:J,includeGroupHeaders:Z},G=$.get("rowSelection"),q=$.get("cellSelection"),H=null;if(this.shouldCopyCells(q,G))this.copySelectedRangeToClipboard(Y),H=0;else if(this.shouldCopyRows(G))this.copySelectedRowsToClipboard(Y),H=1;else if(X.isAnyCellFocused())this.copyFocusedCellToClipboard(Y),H=2;if(z&&H!==null)this.clearCellsAfterCopy(H)}shouldCopyCells(Q,z){let{rangeSvc:J,selectionSvc:Z,gos:$}=this.beans;if(!J||J.isEmpty())return!1;if(Q)return!(typeof z==="object"&&z.copySelectedRows&&!Z?.isEmpty());else{let X=$.get("suppressCopySingleCellRanges");return!(!J.isMoreThanOneCell()&&X)}}shouldCopyRows(Q){let{selectionSvc:z,gos:J}=this.beans;if(z?.isEmpty()??!0)return!1;if(Q&&typeof Q!=="string")return Q.copySelectedRows??!1;else return!J.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(Q){let z=this.beans,{rangeSvc:J,focusSvc:Z,eventSvc:$}=z;if($.dispatchEvent({type:"keyShortcutChangedCellStart"}),Q===0)J.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(Q===1)this.clearSelectedRows();else{let X=Z.getFocusedCell();if(X==null)return;let Y=M0(z,X);if(Y)this.clearCellValue(Y,X.column)}$.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){let{selectionSvc:Q,visibleCols:z}=this.beans,J=Q?.getSelectedNodes()??[],Z=z.allCols;for(let $ of J)for(let X of Z)this.clearCellValue($,X)}clearCellValue(Q,z){if(!z.isCellEditable(Q))return;let J=this.beans.valueSvc.getDeleteValue(z,Q);Q.setDataValue(z,J,"clipboardSvc")}iterateActiveRanges(Q,z,J){let Z=this.beans.rangeSvc;if(!Z||Z.isEmpty())return;let $=Z.getCellRanges(),X=z?[$[0]]:$;for(let Y of X)this.iterateActiveRange({cellRange:Y,rowCallback:Q,preProcessRange:J})}iterateActiveRange(Q){let{cellRange:z,preProcessRange:J,rowCallback:Z}=Q,{beans:$}=this,{rangeSvc:X}=$;if(!X)return;if(J)J(z);let Y=X.getRangeStartRow(z),G=X.getRangeEndRow(z),q=0,H=!1;while(!H&&Y!=null){let _=M0($,Y);H=l(Y,G),Z(Y,_,z,q++),Y=L0($,Y)}}copySelectedRangeToClipboard(Q={}){let z=this.beans.rangeSvc;if(!z||z.isEmpty())return;let J=z.areAllRangesAbleToMerge(),{data:Z,cellsToFlash:$}=J?this.buildDataFromMergedRanges(z,Q):this.buildDataFromRanges(z,Q);this.copyDataToClipboard(Z),this.dispatchFlashCells($)}buildDataFromMergedRanges(Q,z){let J=new Set,Z=Q.getCellRanges(),$=new Map,X=[],Y={},G=o(this.gos,this.beans.rowModel),q=new Set;if(!G)this.beans.rowModel.forEachNode((W)=>{q.add(W.rowIndex)});for(let W of Z){W.columns.forEach((K)=>J.add(K));let{rowPositions:B,cellsToFlash:E}=this.getRangeRowPositionsAndCellsToFlash(Q,W);for(let K of B){let L=q.has(K.rowIndex);if(!G&&!L)continue;let F=`${K.rowIndex}-${K.rowPinned||"null"}`;if(!$.get(F))$.set(F,!0),X.push(K)}Object.assign(Y,E)}let H=this.beans.visibleCols.allCols,_=Array.from(J);return _.sort((W,B)=>{let E=H.indexOf(W),K=H.indexOf(B);return E-K}),{data:this.buildExportParams({columns:_,rowPositions:X,includeHeaders:z.includeHeaders,includeGroupHeaders:z.includeGroupHeaders}),cellsToFlash:Y}}buildDataFromRanges(Q,z){let J=Q.getCellRanges(),Z=[],$={};for(let X of J){let{rowPositions:Y,cellsToFlash:G}=this.getRangeRowPositionsAndCellsToFlash(Q,X);Object.assign($,G),Z.push(this.buildExportParams({columns:X.columns,rowPositions:Y,includeHeaders:z.includeHeaders,includeGroupHeaders:z.includeGroupHeaders}))}return{data:Z.join(` +`),cellsToFlash:$}}getRangeRowPositionsAndCellsToFlash(Q,z){let J=[],Z={},$=Q.getRangeStartRow(z),X=Q.getRangeEndRow(z),Y=$;while(Y){J.push(Y);for(let G of z.columns){let{rowIndex:q,rowPinned:H}=Y,_=bQ({rowIndex:q,column:G,rowPinned:H});Z[_]=!0}if(l(Y,X))break;Y=L0(this.beans,Y)}return{rowPositions:J,cellsToFlash:Z}}getCellsToFlashFromRowNodes(Q){let z=this.beans.visibleCols.allCols,J={};for(let Z=0;Z{let{value:U,valueFormatted:W}=this.beans.valueSvc.getValueForDisplay({column:_,node:H,includeValueFormatted:!0,from:"batch"}),B=W??U??"",E=X.getCallback("processCellForClipboard");if(!E)return B;return E({column:_,node:H,value:B,type:s6,formatValue:(K)=>this.beans.valueSvc.formatValue(_,H,K)??K,parseValue:(K)=>this.beans.valueSvc.parseValue(_,H,K,U)??K})},q={columnKeys:z,rowPositions:J,skipColumnHeaders:!Z,skipColumnGroupHeaders:!$,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!J,valueFrom:"batch",processCellCallback:X.getCallback("processCellForClipboard"),processRowGroupCallback:G,processHeaderCallback:X.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:X.getCallback("processGroupHeaderForClipboard")};return Y.getDataAsCsv(q,!0)}dispatchFlashCells(Q){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:Q})},0)}processCell(Q,z,J,Z,$,X,Y){let{valueSvc:G,formula:q}=this.beans;if($)return $({column:z,node:Q,value:J,type:Z,formatValue:(_)=>G.formatValue(z,Q??null,_)??_,parseValue:(_)=>G.parseValue(z,Q??null,_,G.getValue(z,Q,"edit"))});if(X&&z.getColDef().useValueParserForImport!==!1)return G.parseValue(z,Q??null,J,G.getValue(z,Q,"edit"));if(Y&&z.getColDef().useValueFormatterForExport!==!1){if(q?.isFormula(J))return J;return G.formatValue(z,Q??null,J)??J}return J}copyDataToClipboard(Q){let z=this.gos.getCallback("sendToClipboard");if(z){z({data:Q});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(Q).catch((Z)=>{R(40,{e:Z,method:"writeText"}),this.copyDataToClipboardLegacy(Q)});return}this.copyDataToClipboardLegacy(Q)}copyDataToClipboardLegacy(Q){this.executeOnTempElement((z)=>{let J=Y0(this.beans),Z=d(this.beans);if(z.value=Q||" ",z.select(),z.focus({preventScroll:!0}),!J.execCommand("copy"))R(41);if(Z?.focus!=null)Z.focus({preventScroll:!0})})}executeOnTempElement(Q,z){if(!this.gridCtrl)return;let J=Y0(this.beans),Z=J.createElement("textarea"),$=Z.style;$.width="1px",$.height="1px";let X=J.documentElement;$.top=X.scrollTop+"px",$.left=X.scrollLeft+"px",$.position="absolute",$.opacity="0",this.gridCtrl.getGui().appendChild(Z);try{Q(Z)}catch(G){R(42)}if(z)window.setTimeout(()=>{z(Z),Z.remove()},100);else Z.remove()}},K4={moduleName:"Clipboard",version:J0,beans:[HS],apiFunctions:{copyToClipboard:JS,cutToClipboard:ZS,copySelectedRowsToClipboard:$S,copySelectedRangeToClipboard:XS,copySelectedRangeDown:YS,pasteFromClipboard:GS},dependsOn:[I0,$X,iz,kX]};var L4=class extends j{constructor(){super(...arguments);this.loadRowDataVersion=0}wireBeans(Q){this.environment=Q.environment}init(Q,z){if(this.params=z,this.comp=Q,z.pinned!=null)return;this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)})}onFullWidthRowFocused(Q){let z=this.params,J={rowIndex:z.node.rowIndex,rowPinned:z.node.rowPinned},Z={rowIndex:Q.rowIndex,rowPinned:Q.rowPinned};if(!l(J,Z))return;D0(this.comp.getGui(),Q.fromBelow)}setAutoHeightClasses(){let Q=this.gos.get("detailRowAutoHeight"),z=Q?"ag-details-row-auto-height":"ag-details-row-fixed-height",J=Q?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",Z=this.comp;Z.toggleCss(z,!0),Z.toggleDetailGridCss(J,!0)}setupRefreshStrategy(){let Q=this.params.refreshStrategy;if(Q=="everything"||Q=="nothing"||Q=="rows"){this.refreshStrategy=Q;return}if(Q!=null)R(170,{providedStrategy:Q});this.refreshStrategy="rows"}createDetailGrid(){let{params:Q,gos:z}=this;if(n(Q.detailGridOptions)){R(171);return}let J=z.get("theme"),Z=Q.detailGridOptions.theme;if(Z&&Z!==J)R(267);let $={themeStyleContainer:this.environment.eStyleContainer,...Q.detailGridOptions,theme:J};if(z.get("detailRowAutoHeight"))$.domLayout="autoHeight";this.comp.setDetailGrid($)}registerDetailWithMaster(Q){let{params:z,beans:{selectionSvc:J,findSvc:Z,expansionSvc:$}}=this,X=z.node.id,Y=z.api,G={id:X,api:Q},q=z.node;if(Y.isDestroyed())return;Y.addDetailGridInfo(X,G),q.detailGridInfo=G;let H=q.parent;Z?.registerDetailGrid(q,Q);function _(){if(H)J?.refreshMasterNodeState(H)}function U({source:B}){if(B==="expandAll")return Q.expandAll();if(B==="collapseAll")return Q.collapseAll()}function W({node:B,source:E}){if(B!==H||E==="masterDetail"||Q.isDestroyed())return;J?.setDetailSelectionState(H,z.detailGridOptions,Q)}Q.addEventListener("firstDataRendered",()=>{if(Q.isDestroyed()||Y.isDestroyed())return;J?.setDetailSelectionState(H,z.detailGridOptions,Q),Q.addEventListener("selectionChanged",_),Y.addEventListener("rowSelected",W);let E=`${"CsrmSsrmSharedApi"}Module`;if(Q.isModuleRegistered(E))Y.addEventListener("expandOrCollapseAll",U),$?.setDetailsExpansionState(Q)}),this.addManagedListeners(H,{masterChanged:(B)=>{if(!B.node.master)this.onDestroy(G)}}),this.addDestroyFunc(()=>this.onDestroy(G))}onDestroy(Q){let{params:z}=this,J=z.node,Z=z.api;if(J.detailGridInfo!==Q)return;if(!Z.isDestroyed())Z.removeDetailGridInfo(J.id);J.detailGridInfo=null}loadRowData(){this.loadRowDataVersion++;let Q=this.loadRowDataVersion,z=this.params;if(z.detailGridOptions?.rowModelType==="serverSide"){z.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}let J=z.getDetailRowData;if(!J){R(172);return}let Z=(X)=>{if(this.loadRowDataVersion===Q)this.comp.setRowData(X)},$={node:z.node,data:z.node.data,successCallback:Z,context:y(this.gos,{}).context};J($)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},_S=class{constructor(Q){this.parentWrapper=Q}wrap(Q,z,J,Z){return this.parentWrapper.wrap(Q,z,J,Z)}},US={tag:"div",cls:"ag-details-row"},WS={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},BS=class extends x{constructor(){super(...arguments);this.eDetailGrid=S}wireBeans(Q){this.context=Q.context}init(Q){this.params=Q,this.selectAndSetTemplate();let z={toggleCss:(J,Z)=>this.toggleCss(J,Z),toggleDetailGridCss:(J,Z)=>this.eDetailGrid.classList.toggle(J,Z),setDetailGrid:(J)=>this.setDetailGrid(J),setRowData:(J)=>this.setRowData(J),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new L4),this.ctrl.init(z,Q)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){let Q=this.params;if(Q.pinned){this.setTemplate(US);return}let z=()=>{this.setTemplate(WS)};if(n(Q.template))z();else if(typeof Q.template==="string")this.setTemplate(Q.template,[]);else if(typeof Q.template==="function"){let J=Q.template,Z=J(Q);this.setTemplate(Z,[])}else R(168),z();if(this.eDetailGrid==null)R(169)}setDetailGrid(Q){if(!this.eDetailGrid)return;let z=this.context.getBean("frameworkCompWrapper"),J=new _S(z),{frameworkOverrides:Z}=this.beans,$=MJ(this.eDetailGrid,Q,{frameworkOverrides:Z,providedBeanInstances:{frameworkCompWrapper:J},modules:a8(this.params.api.getGridId(),Q.rowModelType??"clientSide")});this.detailApi=$,this.ctrl?.registerDetailWithMaster($),this.addDestroyFunc(()=>{$.destroy()})}setRowData(Q){this.detailApi?.setGridOption("rowData",Q)}};function D2(Q,z){let J=Q.masterDetailSvc?.store;return J?z(J):void 0}function ES(Q,z,J){D2(Q,(Z)=>{Z[z]=J})}function KS(Q,z){D2(Q,(J)=>{delete J[z]})}function LS(Q,z){return D2(Q,(J)=>J[z])}function FS(Q,z){D2(Q,(J)=>{let Z=0;Object.values(J).forEach(($)=>{if($)z($,Z++)})})}var DS=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}",MS=class extends j{constructor(){super(...arguments);this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){let Q=this.gos;if(o(Q))this.enabled=this.isEnabled();if(Hz(Q))this.addEventListeners()}addEventListeners(){let Q=(Z)=>{this.setMaster(Z.node,!1,!0)},z,J=()=>{if(z){for(let Z of z)Z();z=void 0}if(this.isEnabled())z=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:Q})};J(),this.gos.addPropertyEventListener("masterDetail",J)}refreshModel(Q){if(Q.changedProps){let z=this.isEnabled();if(this.enabled!==z){this.setMasters(null);return}}if(Q.rowDataUpdated)this.setMasters(Q.changedRowNodes)}setMaster(Q,z,J){let Z=Q.master,$=this.isEnabled(),X=$,Y=this.gos,G=Y.get("isRowMaster"),q=Y.get("treeData");if($)if(z||J){if(G){let H=Q.data;X=!!H&&!!G(H)}}else X=Z;if(!q){if(X&&z||!X&&Z)Q._expanded??(Q._expanded=null)}if(X!==Z)Q.master=X,Q.dispatchRowEvent("masterChanged")}setMasters(Q){if(this.enabled=this.isEnabled(),Q){for(let z of Q.updates)this.setMaster(z,!1,!0);for(let z of Q.adds)this.setMaster(z,!0,!1)}else{let z=o5(this.beans)?.rootNode?._leafs;if(z)for(let J=0,Z=z.length;J{let Y=z.clientHeight;if(Y!=null&&Y>0){let G=()=>{let{rowModel:q}=this.beans,{rowNode:H}=Q;if(H.setRowHeight(Y),o(J,q)||Hz(J,q))q.onRowHeightChanged()};window.setTimeout(G,0)}},X=DQ(Z,z,$);Q.addDestroyFunc(X),$()}destroy(){this.store={},super.destroy()}},kS={moduleName:"SharedMasterDetail",version:J0,beans:[MS],userComponents:{agDetailCellRenderer:BS},dynamicBeans:{detailCellRendererCtrl:L4},apiFunctions:{addDetailGridInfo:ES,removeDetailGridInfo:KS,getDetailGridInfo:LS,forEachDetailGridInfo:FS},dependsOn:[I0,U4,B4],css:[DS]},F4={moduleName:"MasterDetail",version:J0,dependsOn:[kS,F2,MX]},D4=class extends x{constructor(){super(...arguments);this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:(Q)=>{let z=!1;if(!this.dragging)z=!0,this.dragging=!0,D1(this.beans).classList?.add(this.getDraggingCssClass());if(this.updateValuesOnMove(Q),z){this.changedCalculatedValues=!1;return}if(this.beans.rangeSvc.autoScrollService.check(Q),this.changedCalculatedValues)this.onDrag(Q),this.changedCalculatedValues=!1},onDragStop:(Q)=>{this.dragging=!1,this.onDragEnd(Q),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:ZY,mousedown:ZY})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(Q){let z=U6(this.gos,Q);if(!z||this.shouldSkipCell(z)||this.lastCellHovered&&f1(z,this.lastCellHovered))return;this.lastCellHovered=z,this.changedCalculatedValues=!0}clearDragProperties(){if(this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),D1(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging)this.destroy()}getType(){return this.type}refresh(Q,z){let J=this.cellCtrl,Z=this.getGui(),$=z??b(this.beans.rangeSvc.getCellRanges()),X=$.startRow,Y=$.endRow;if(X&&Y)if(q0(Y,X))this.rangeStartRow=Y,this.rangeEndRow=X;else this.rangeStartRow=X,this.rangeEndRow=Y;if(J!==Q||!f0(Z)){this.cellCtrl=Q;let G=Q.comp.getParentOfValue();if(G)G.appendChild(Z)}this.cellRange=$}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){N(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(Q){if(!this.cellRange)return;let{id:z,type:J}=this.cellRange;if(!z||z!==Q.id)return;let Z=this.beans.rangeSvc?.getCellRanges().find(($)=>$.id===z&&$.type===J);if(Z&&Z!==this.cellRange)this.cellRange=Z}},ZY=(Q)=>{Q.stopPropagation()};function VS(Q){let z=Q.length,J=0;if(z<=1)return Q;for(let U=0;U1){J=Math.max(J,parseInt(B[1],10));continue}if(Math.floor(W)===W)continue;J=Math.max(J,W.toString().split(".")[1].length)}let Z=0,$=0,X=0,Y=0,G=0;for(let U=0;UY?"x":"y";else q=G;if(q!==this.dragAxis)this.dragAxis=q,this.changedCalculatedValues=!0}shouldSkipCell(Q){return v0(Q.column)}onDrag(Q){if(!this.initialPosition){let J=this.cellCtrl;if(!J)return;this.initialPosition=J.cellPosition}let z=this.getLastCellHovered();if(z)this.markPathFrom(this.initialPosition,z)}onDragEnd(Q){if(this.initialXY=null,!this.markedCells.length)return;let z=this.dragAxis==="x",{cellRange:J,rangeStartRow:Z,rangeEndRow:$,beans:{rangeSvc:X}}=this,Y=J.columns.length,G;if(!this.isUp&&!this.isLeft)G=X.createCellRangeFromCellRangeParams({rowStartIndex:Z.rowIndex,rowStartPinned:Z.rowPinned,columnStart:J.columns[0],rowEndIndex:z?$.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:z?$.rowPinned:this.lastCellMarked.rowPinned,columnEnd:z?this.lastCellMarked.column:J.columns[Y-1]});else{let q=z?Z:this.lastCellMarked;G=X.createCellRangeFromCellRangeParams({rowStartIndex:q.rowIndex,rowStartPinned:q.rowPinned,columnStart:z?this.lastCellMarked.column:J.columns[0],rowEndIndex:$.rowIndex,rowEndPinned:$.rowPinned,columnEnd:J.columns[Y-1]})}if(G)this.performFill({event:Q,initialRange:J,finalRange:G,shouldUpdateRange:!0})}onDragCancel(){if(this.initialXY=null,!this.markedCells.length)return;this.clearMarkedPath()}performFill({event:Q,initialRange:z,finalRange:J,shouldUpdateRange:Z}){let{eventSvc:$,rangeSvc:X}=this.beans;if($.dispatchEvent({type:"fillStart"}),this.handleValueChanged(z,J,Q),Z)X.setCellRanges([J]);$.dispatchEvent({type:"fillEnd",initialRange:z,finalRange:J})}getFillHandleDirection(){let Q=vZ(this.gos)?.direction;if(!Q)return"xy";if(Q!=="x"&&Q!=="y"&&Q!=="xy")return R(177),"xy";return Q}handleValueChanged(Q,z,J){let{beans:Z}=this,{rangeSvc:$,gos:X,valueSvc:Y}=Z,G=$.getRangeEndRow(Q),q=$.getRangeStartRow(Q),H=$.getRangeEndRow(z),_=$.getRangeStartRow(z),U=this.dragAxis==="y";if(this.isReduce&&!vZ(X)?.suppressClearOnFillReduction){let A=U?Q.columns:Q.columns.filter((v)=>z.columns.indexOf(v)<0),O=U?L0(Z,H):_;if(O)this.clearCellsInRange(O,G,A);return}let W=[],B=[],E=[],K=[],L=!0,F=0,D=()=>{W.length=0,B.length=0,E.length=0,K.length=0,F=0},M=(A,O)=>{let v=this.isUp?G:q,I=!1;if(U)L=!0,D();while(!I&&v){let C=M0(Z,v);if(!C)break;if(U&&A)k(W,A,C,()=>!l(v,this.isUp?q:G));else if(O){L=!0,D();for(let m of O)k(W,m,C,()=>m!==(this.isLeft?Q.columns[0]:b(Q.columns)))}I=l(v,this.isUp?_:H),v=this.isUp?m0(this.beans,v):L0(Z,v)}},k=(A,O,v,I)=>{let C,m=!1;if(L)C=Y.getValue(O,v,"edit"),B.push(C),E.push(Y.getValue(O,v,"edit",!0)),K.push(Y.getValueForDisplay({column:O,node:v,from:"edit"}).valueFormatted),L=I();else{let{value:w,fromUserFunction:a,sourceCol:t,sourceRowNode:u}=this.processValues({event:J,values:A,initialValues:B,initialNonAggregatedValues:E,initialFormattedValues:K,col:O,rowNode:v,idx:F++});if(C=w,O.isCellEditable(v)){let Q0=Y.getValue(O,v,"edit");if(!a){if(t){let r=t.getColDef();if(r.useValueFormatterForExport!==!1&&r.valueFormatter){let S0=Y.getValueForDisplay({column:t,node:u,includeValueFormatted:!0,from:"edit"}).valueFormatted;if(S0!=null)C=S0}}if(O.getColDef().useValueParserForImport!==!1)C=Y.parseValue(O,v,t?C:c1(C),Q0)}if(!a||Q0!==C)v.setDataValue(O,C,"rangeSvc");else m=!0}}if(!m)A.push({value:C,column:O,rowNode:v})},{changeDetectionSvc:f}=this.beans;f?.beginDeferred();try{if(U)Q.columns.forEach((A)=>{M(A)});else{let A=this.isLeft?[...z.columns].reverse():z.columns;M(void 0,A)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{f?.endDeferred()}}clearCellsInRange(Q,z,J){let Z={startRow:Q,endRow:z,columns:J,startColumn:J[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[Z],restoreSourceInBatch:!0})}processValues(Q){let{formula:z,valueSvc:J}=this.beans,{event:Z,values:$,initialValues:X,initialNonAggregatedValues:Y,initialFormattedValues:G,col:q,rowNode:H,idx:_}=Q,U=vZ(this.gos)?.setFillValue,W=this.dragAxis==="y",B;if(W)B=this.isUp?"up":"down";else B=this.isLeft?"left":"right";if(U){let L=y(this.gos,{event:Z,values:$.map(({value:D})=>D),initialValues:X,initialNonAggregatedValues:Y,initialFormattedValues:G,currentIndex:_,currentCellValue:J.getValue(q,H,"edit"),direction:B,column:q,rowNode:H}),F=U(L);if(F!==!1)return{value:F,fromUserFunction:!0}}let E=(L)=>typeof L==="number"&&Number.isFinite(L)||typeof L==="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(L.trim()),K=$.every(({value:L})=>E(L));if(Z.altKey||!K){let L=String(b($)?.value??"");if(K&&X.length===1){let A=this.isUp||this.isLeft?-1:1;return{value:parseFloat(L)+1*A,fromUserFunction:!1}}let{value:F,column:D,rowNode:M}=$[_%$.length],k,f=D.isAllowFormula()&&z?.isFormula(L);if(f){let A=B==="up"?-1:B==="down"?1:0,O=B==="left"?-1:B==="right"?1:0;k=z.updateFormulaByOffset({value:L,rowDelta:A,columnDelta:O})}else k=F;return{value:k,fromUserFunction:!1,sourceCol:f?void 0:D,sourceRowNode:M}}return{value:b(VS($.map(({value:L})=>Number(L)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(let Q of this.markedCells){if(!Q.isAlive())continue;let{comp:z}=Q;z.toggleCss("ag-selection-fill-top",!1),z.toggleCss("ag-selection-fill-right",!1),z.toggleCss("ag-selection-fill-bottom",!1),z.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(Q,z){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(l(z,Q))return;let J=q0(z,Q),{rangeStartRow:Z,rangeEndRow:$}=this;if(J&&(z.rowPinned==Z.rowPinned&&z.rowIndex>=Z.rowIndex||Z.rowPinned!=$.rowPinned&&z.rowPinned==$.rowPinned&&z.rowIndex<=$.rowIndex))this.reduceVertical(Q,z),this.isReduce=!0;else this.extendVertical(Q,z,J),this.isReduce=!1}else{let J=Q.column,Z=z.column;if(J===Z)return;let $=this.beans.visibleCols.allCols,X=$.indexOf(J),Y=$.indexOf(Z);if(Y<=X&&Y>=$.indexOf(this.cellRange.columns[0]))this.reduceHorizontal(Q,z),this.isReduce=!0;else this.extendHorizontal(Q,z,Y=4),Q.toggleCss(PS,X),S5(Z,$>0?!0:void 0),Q.toggleCss(TS,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){let Q=this.getRangeBorders(),z=this.isSingleCell(),J=!z&&Q.top,Z=!z&&Q.right,$=!z&&Q.bottom,X=!z&&Q.left,Y=this.cellComp;Y.toggleCss(IS,J),Y.toggleCss(CS,Z),Y.toggleCss(bS,$),Y.toggleCss(yS,X)}isSingleCell(){let{rangeSvc:Q}=this;return this.rangeCount===1&&!!Q&&!Q.isMoreThanOneCell()}getHasChartRange(){let{rangeSvc:Q}=this;if(!this.rangeCount||!Q)return!1;let z=Q.getCellRanges();return z.length>0&&z.every((J)=>[CQ.DIMENSION,CQ.VALUE].includes(J.type))}updateRangeBordersIfRangeCount(){if(this.rangeCount>0)this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}getRangeBorders(){let Q=this.beans.gos.get("enableRtl"),z=!1,J=!1,Z=!1,$=!1,{rangeSvc:X,beans:{visibleCols:Y},cellCtrl:{cellPosition:G}}=this,q=G.column,H=X.getCellRanges().filter((W)=>X.isCellInSpecificRange(G,W));if(!H.length)return{top:z,right:J,bottom:Z,left:$};let _,U;if(Q)_=Y.getColAfter(q),U=Y.getColBefore(q);else _=Y.getColBefore(q),U=Y.getColAfter(q);if(!_)$=!0;if(!U)J=!0;for(let W=0;W=0;Z--){let $=J[Z],X=$.colorClass;if(!X)continue;if(Q.isCellInSpecificRange(this.cellCtrl.cellPosition,$))return X}return null}refreshHandleColor(Q){let z=this.selectionHandle?.getGui?.(),J=Q?.colorClass??null;if(!z){this.handleColorClass=null;return}if(this.handleColorClass&&this.handleColorClass!==J)z.classList.remove(this.handleColorClass);if(J)z.classList.add(J);else if(this.handleColorClass)z.classList.remove(this.handleColorClass);this.handleColorClass=J??null}getRangeForHandle(){let{gos:Q,editSvc:z}=this.beans,J=this.rangeSvc,Z=J.getCellRanges(),$=Z.length;if(this.rangeCount<1||$<1)return null;let X=z?.isRangeSelectionEnabledWhileEditing(),Y=X?Z:[b(Z)];for(let G of Y){let{cellPosition:q,column:H}=this.cellCtrl,_=YY(Q)&&!H.isSuppressFillHandle(),U=xS(Q),B=!z?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(X||$===1&&(_||U));if(this.hasChartRange)B=G.type===CQ.VALUE;if(B&&G.endRow!=null&&J.isContiguousRange(G)&&J.isBottomRightCell(G,q))return G}return null}addSelectionHandle(Q){let{beans:z}=this,J=z.editSvc?.isRangeSelectionEnabledWhileEditing(),Z=Q.type,X=!J&&YY(z.gos)&&n(Z)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==X)this.selectionHandle=z.context.destroyBean(this.selectionHandle);if(!this.selectionHandle){let Y=z.registry.createDynamicBean(X===0?"fillHandle":"rangeHandle",!1);if(Y)this.selectionHandle=z.context.createBean(Y)}this.selectionHandle?.refresh(this.cellCtrl,Q)}destroy(){this.unsetComp()}},NS=class extends j{constructor(Q){super();this.eContainer=Q}postConstruct(){let{beans:Q,gos:z,eContainer:J}=this,Z=Q.rangeSvc,$={eElement:J,onDragStart:Z.onDragStart.bind(Z),onDragStop:Z.onDragStop.bind(Z),onDragging:Z.onDragging.bind(Z)},X=Q.dragSvc,Y=X.addDragSource.bind(X,$),G=X.removeDragSource.bind(X,$);if(this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(u0(z))Y();else G()}),this.addDestroyFunc(G),u0(z))Y()}},gS=class extends j{constructor(Q,z){super();this.column=Q,this.eGui=z}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(Q)=>Q&&this.onClick(Q)})}onClick(Q){this.beans.rangeSvc?.handleColumnSelection(this.column,Q)}},hS=class extends j{constructor(Q,z){super();this.column=Q,this.comp=z,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let Q;if(this.column.isColumn)Q=[this.column];else Q=this.column.getDisplayedLeafColumns();for(let z of Q)this.columnMap.set(z,!1)}refreshActive(){let{gos:Q,rangeSvc:z}=this.beans,J=Q.get("cellSelection");this.isActive=!!(J&&z&&typeof J==="object"&&J.enableHeaderHighlight)}setupRangeHeaderHighlight(){let Q=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:Q,columnPinned:Q,columnMoved:Q,columnGroupOpened:Q}),Q()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();let Q=this.beans.rangeSvc.getCellRanges(),z=!1,J=!0;for(let Z of Q){if(z)break;for(let $ of Z.columns)if(this.columnMap.has($))this.columnMap.set($,!0),z||(z=!0)}for(let Z of Array.from(this.columnMap.values()))if(Z===!1){J=!1;break}this.comp.toggleCss("ag-header-range-highlight",z&&J)}destroy(){super.destroy(),this.comp=null,this.column=null}},uS=class extends j{constructor(){super(...arguments);this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(Q){this.rowModel=Q.rowModel,this.dragSvc=Q.dragSvc,this.colModel=Q.colModel,this.visibleCols=Q.visibleCols,this.cellNavigation=Q.cellNavigation,this.ctrlsSvc=Q.ctrlsSvc}postConstruct(){let Q=this.onColumnsChanged.bind(this),z=()=>this.removeAllCellRanges(),J=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:Q,columnVisible:Q,columnValueChanged:Q,columnPivotModeChanged:z,columnRowGroupChanged:z,columnPivotChanged:z,columnGroupOpened:J,columnMoved:J,columnPinned:J}),this.ctrlsSvc.whenReady(this,(Z)=>{let $=Z.gridBodyCtrl;this.autoScrollService=new mZ({scrollContainer:$.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>$.scrollFeature.getVScrollPosition().top,setVerticalPosition:(X)=>$.scrollFeature.setVerticalScrollPosition(X),getHorizontalPosition:()=>$.scrollFeature.getHScrollPosition().left,setHorizontalPosition:(X)=>$.scrollFeature.setHorizontalScrollPosition(X),shouldSkipVerticalScroll:()=>!V0(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!$.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(Q){if(this.rangeSelectionExtensions.includes(Q))return;this.rangeSelectionExtensions.push(Q)}unregisterRangeSelectionExtension(Q){$0(this.rangeSelectionExtensions,Q)}shouldSuppressRangeSelection(Q){return this.rangeSelectionExtensions.some((z)=>z.shouldSuppressRangeSelection?.(Q))}shouldSkipColumn(Q){return this.rangeSelectionExtensions.some((z)=>z.shouldSkipColumn?.(Q))}isAllColumnsSelectionCell(Q){return this.rangeSelectionExtensions.some((z)=>z.isAllColumnsSelectionCell?.(Q))}isAllColumnsRange(Q,z){return this.rangeSelectionExtensions.some((J)=>J.isAllColumnsRange?.(Q,z))}updateSelectionModeForCell(Q){this.setSelectionMode(this.isAllColumnsSelectionCell(Q))}onDragStart(Q){let z=this.gos,J=Q.target;if(!u0(z)||q6(z,J)?.isSuppressMouseEvent(Q))return;if(this.shouldSuppressRangeSelection(J))return;let{shiftKey:Z}=Q,$=this.isMultiRange(Q),X=Z&&!!this.cellRanges?.length;if(!$&&(!X||T(b(this.cellRanges).type)))this.removeAllCellRanges(!0);let Y=this.dragSvc.startTarget;if(Y)this.updateValuesOnMove(Y);if(!this.lastCellHovered)return;if(this.dragging=!0,this.lastMouseEvent=Q,this.intersectionRange=$&&this.getCellRangeCount(this.lastCellHovered)>1,!X)this.setNewestRangeStartCell(this.lastCellHovered);if(this.cellRanges.length>0)this.draggingRange=b(this.cellRanges);else{let G={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},q=this.getColumnsFromModel([this.lastCellHovered.column]);if(!q?.length)return;this.draggingRange={startRow:G,endRow:G,columns:q,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}onDragging(Q){let{dragging:z,lastCellHovered:J,newestRangeStartCell:Z,autoScrollService:$,cellHasChanged:X}=this;if(!z||!Q)return;this.updateValuesOnMove(Q.target),this.lastMouseEvent=Q;let Y=(B)=>J&&J.rowPinned===B&&Z.rowPinned===B,G=Y("top")||Y("bottom");if($.check(Q,G),!X||!J)return;let q=Z?.column,H=J?.column,_=this.calculateColumnsBetween(q,H);if(!_)return;let{rowIndex:U,rowPinned:W}=J;this.draggingRange.endRow={rowIndex:U,rowPinned:W},this.draggingRange.columns=_,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;let{id:Q}=this.draggingRange;if(this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange)this.intersectionRange=!1,this.intersectLastRange();this.dispatchChangedEvent(!1,!0,Q)}onColumnsChanged(){this.refreshLastRangeStart();let Q=this.visibleCols.allCols;for(let J of this.cellRanges){let Z=J.columns;if(J.columns=J.columns.filter((X)=>X.isVisible()&&Q.indexOf(X)!==-1),!X0(Z,J.columns))this.dispatchChangedEvent(!1,!0,J.id)}let z=this.cellRanges.length;if(this.cellRanges=this.cellRanges.filter((J)=>J.columns.length>0),z>this.cellRanges.length)this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){let Q=b(this.cellRanges);if(!Q)return;this.refreshRangeStart(Q)}isContiguousRange(Q){let z=Q.columns;if(!z.length)return!1;let J=this.visibleCols.allCols,Z=z.map(($)=>J.indexOf($)).sort(($,X)=>$-X);return b(Z)-Z[0]+1===z.length}getRangeStartRow(Q){if(Q.startRow&&Q.endRow)return q0(Q.startRow,Q.endRow)?Q.startRow:Q.endRow;return{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(Q){if(Q.startRow&&Q.endRow)return q0(Q.startRow,Q.endRow)?Q.endRow:Q.startRow;let z=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;if(z>0)return{rowIndex:z-1,rowPinned:"bottom"};return{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(Q){let z=this.beans,J=this.getRangeStartRow(Q),Z=this.getRangeEndRow(Q),$=Q6(z,J);return Q6(z,Z)-$+1}handleCellMouseDown(Q,z){let J=Q.ctrlKey||Q.metaKey;this.handleCellSelectionInput(z,{target:Q.target,shiftKey:Q.shiftKey,isRightClick:u5(this.beans,Q),isMultiRange:this.isMultiRange(Q),isMultiKey:J,preventDefault:()=>Q.preventDefault()})}handleCellKeyboardSelect(Q,z){let J=Q.ctrlKey||Q.metaKey;this.handleCellSelectionInput(z,{target:Q.target,shiftKey:Q.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState(J),isMultiKey:J,preventDefault:()=>Q.preventDefault()})}handleCellSelectionInput(Q,z){let{target:J,shiftKey:Z,isRightClick:$,isMultiRange:X,isMultiKey:Y,preventDefault:G}=z;if(this.shouldSuppressRangeSelection(J))return;let q=this.isAllColumnsSelectionCell(Q);if(q)G();if(Z)return this.extendLatestRangeToCell(Q);if(q&&$)return;this.updateSelectionModeForCell(Q);let H=this.calculateColumnsBetween(Q.column,Q.column);if(!H)return;let _=q?this.findContainingRange({columns:H,startRow:Q,endRow:Q}):void 0;if(q&&!!_&&X&&Y&&_)this.removeRowFromAllColumnsRange(Q,_);else this.setRangeToCell(Q,X)}isMultiRange(Q){return this.isMultiRangeForKeyState(Q.ctrlKey||Q.metaKey)}isMultiRangeForKeyState(Q){let{editingWithRanges:z,allowMulti:J}=this.getMultiRangeContext();return z||(J?Q:!1)}getMultiRangeContext(){let{gos:Q,editSvc:z}=this.beans,J=!!z?.isEditing()&&!!z?.isRangeSelectionEnabledWhileEditing(),Z=H9(Q)&&!J;return{editingWithRanges:J,suppressMultiRanges:Z,allowMulti:!Z}}removeRowFromAllColumnsRange(Q,z){let{beans:J,cellRanges:Z}=this,$=K1(J),X=Gz(J),Y=this.getRangeStartRow(z),G=this.getRangeEndRow(z);if(!Y&&l($,Q))z2(z,L0(J,$),"top");else if(!G&&l(X,Q))z2(z,m0(J,X),"bottom");else if(l(Y,G))$0(Z,z);else if(l(Y,Q))z2(z,L0(J,Q),"top");else if(l(G,Q))z2(z,m0(J,Q),"bottom");else{let q=m0(J,Q),H=L0(J,Q);z.startRow=Y,z.endRow=q??void 0,Z.push({...z,startRow:H??void 0,endRow:G})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(Q,z=!1){let{gos:J}=this;if(!u0(J))return;this.updateSelectionModeForCell(Q);let Z=this.calculateColumnsBetween(Q.column,Q.column);if(!Z)return;let{suppressMultiRanges:$}=this.getMultiRangeContext();if($||!z||n(this.cellRanges))this.removeAllCellRanges(!0);let X={rowIndex:Q.rowIndex,rowPinned:Q.rowPinned},Y={startRow:X,endRow:X,columns:Z,startColumn:Q.column},G=this.ensureRangeStartColumn(Y);if(!G)return;this.cellRanges.push(Y),this.setNewestRangeStartCell({...Q,column:G}),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(Q){let z=Q.columns[0],J=b(Q.columns);return this.newestRangeStartCell?.column===z?J:z}extendRangeRowCountBy(Q,z){let{beans:J}=this,{startRow:Z,endRow:$}=Q;if(!Z||!$)return;let X=0,Y,G=q0($,Z);if(G)Y=Z;else Y=$;let q=z>0?L0:m0,H=Math.abs(z);while(Xz.indexOf(Z)).filter((Z)=>Z>-1).sort((Z,$)=>Z-$);return{left:z[J[0]],right:z[b(J)]}}extendLatestRangeInDirection(Q){if(this.isEmpty()||!this.newestRangeStartCell)return;let z=Q.key,J=Q.ctrlKey||Q.metaKey,Z=b(this.cellRanges),$=this.newestRangeStartCell,X=Z.endRow.rowIndex,Y=Z.endRow.rowPinned,q={column:this.getRangeLastColumn(Z),rowIndex:X,rowPinned:Y},H=this.cellNavigation.getNextCellToFocus(z,q,J);if(!H)return;if(this.shouldSkipColumn(H.column))return;return this.setCellRange({rowStartIndex:$.rowIndex,rowStartPinned:$.rowPinned,rowEndIndex:H.rowIndex,rowEndPinned:H.rowPinned,columnStart:$.column,columnEnd:H.column}),H}setCellRange(Q){if(!u0(this.gos))return;this.removeAllCellRanges(!0),this.addCellRange(Q)}setCellRanges(Q){if(X0(this.cellRanges,Q))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);let z=this.getColumnsFromModel(this.visibleCols.allCols)??[],J=!1;for(let Z of Q){if(Z.columns&&Z.startRow){let $=this.getColumnsFromModel(Z.columns);if(!$||$.length===0)continue;Z.columns=$;let{startRow:X}=Z;this.setNewestRangeStartCell({rowIndex:X.rowIndex,rowPinned:X.rowPinned,column:Z.columns[0]})}if(!J&&z.length>0&&this.isAllColumnsRange(Z,z))J=!0;this.cellRanges.push(Z)}this.setSelectionMode(J),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(Q){let{beans:z,eventSvc:J}=this,{cellEventSource:Z="rangeSvc",dispatchWrapperEvents:$,wrapperEventSource:X="deleteKey",restoreSourceInBatch:Y}=Q,{cellRanges:G}=Q;if($)J.dispatchEvent({type:"cellSelectionDeleteStart",source:X}),J.dispatchEvent({type:"rangeDeleteStart",source:X});if(!G)G=this.cellRanges;let{valueSvc:q,editSvc:H}=z,_=!!H?.isBatchEditing(),{changeDetectionSvc:U}=z;U?.beginDeferred();try{this.forEachEditableCellInRanges(G,(W,B)=>{if(Y&&_){H?.batchResetToSourceValue({rowNode:W,column:B});return}let E=q.getDeleteValue(B,W);W.setDataValue(B,E,Z)})}finally{U?.endDeferred()}if($)J.dispatchEvent({type:"cellSelectionDeleteEnd",source:X}),J.dispatchEvent({type:"rangeDeleteEnd",source:X})}createCellRangeFromCellRangeParams(Q){return this.createPartialCellRangeFromRangeParams(Q,!1)}createPartialCellRangeFromRangeParams(Q,z){let{columns:J,columnStart:Z,columnEnd:$,rowStartIndex:X,rowStartPinned:Y,rowEndIndex:G,rowEndPinned:q}=Q,H=this.getColumnsFromParams(J,Z,$);if(!H||!z&&H.columns.length===0)return;let{columns:_,startsOnTheRight:U}=H,W=GY(X,Y),B=GY(G,q);return{startRow:W,endRow:B,columns:_,startColumn:this.getColumnFromModel(Z)??(U?b(_):_[0])}}addCellRange(Q){let z=this.gos;if(!u0(z)||!this.verifyCellRanges(z))return;this.setSelectionMode(!1);let J=this.createCellRangeFromCellRangeParams(Q);if(J){if(J.startRow)this.setNewestRangeStartCell({rowIndex:J.startRow.rowIndex,rowPinned:J.startRow.rowPinned,column:J.startColumn});return this.cellRanges.push(J),this.dispatchChangedEvent(!1,!0,J.id),J}}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){let Q=this.cellRanges.length;if(Q===0)return!1;if(Q>1)return!0;let z=this.cellRanges[0],J=this.getRangeStartRow(z),Z=this.getRangeEndRow(z);return J.rowPinned!==Z.rowPinned||J.rowIndex!==Z.rowIndex||z.columns.length!==1}areAllRangesAbleToMerge(){let Q=new Map;if(this.cellRanges.length<=1)return!0;for(let Z of this.cellRanges)this.forEachRowInRange(Z,($)=>{let X=`${$.rowPinned||"normal"}_${$.rowIndex}`,Y=Q.get(X),G=Z.columns.map((q)=>q.getId());if(Y){let q=G.filter((H)=>Y.indexOf(H)===-1);Y.push(...q)}else Q.set(X,G)});let J;for(let Z of Q.values()){let $=Z.sort().join();if(J===void 0){J=$;continue}if(J!==$)return!1}return!0}removeAllCellRanges(Q){if(this.isEmpty())return;if(this.onDragStop(),this.cellRanges.length=0,!Q)this.dispatchChangedEvent(!1,!0)}isCellInAnyRange(Q){return this.getCellRangeCount(Q)>0}isCellInSpecificRange(Q,z){let J=z.columns?.includes(Q.column),Z=this.isRowInRange(Q,z);return J&&Z}isColumnInAnyRange(Q){let{beans:z}=this,J=K1(z),Z=Gz(z);if(!J||!Z)return!1;let $=Q.isColumn?[Q]:Q.getDisplayedLeafColumns();return this.findContainingRange({columns:$,startRow:J,endRow:Z},!0)!=null}findContainingRange({columns:Q,startRow:z,endRow:J},Z=!1){let $=this.cellRanges;for(let X=$.length-1;X>=0;X--){let Y=$[X],G=Q.every((H)=>Y.columns.includes(H)),q=!1;if(Z)q=l(Y.startRow,z)&&l(Y.endRow,J);else{let H=z&&this.isRowInRange(z,Y),_=J&&this.isRowInRange(J,Y);q=!!H&&!!_}if(G&&q)return Y}}isBottomRightCell(Q,z){let J=this.visibleCols.allCols,Z=Q.columns.map((H)=>J.indexOf(H)).sort((H,_)=>H-_),{startRow:$,endRow:X}=Q,Y=q0($,X)?X:$,G=J.indexOf(z.column)===b(Z),q=z.rowIndex===Y.rowIndex&&RQ(z.rowPinned)===RQ(Y.rowPinned);return G&&q}getCellRangeCount(Q){return this.cellRanges.filter((z)=>this.isCellInSpecificRange(Q,z)).length}isRowInRange(Q,z){let J=this.getRangeStartRow(z),Z=this.getRangeEndRow(z),$=l(Q,J),X=l(Q,Z);if($||X)return!0;let Y=!q0(Q,J),G=q0(Q,Z);return Y&&G}intersectLastRange(Q){let{editingWithRanges:z,suppressMultiRanges:J}=this.getMultiRangeContext();if(z||J||Q&&this.dragging||this.isEmpty())return;let Z=b(this.cellRanges),$=this.getRangeStartRow(Z),X=this.getRangeEndRow(Z),Y=[];for(let G of this.cellRanges.slice(0,-1)){let q=this.getRangeStartRow(G),H=this.getRangeEndRow(G),_=G.columns,U=_.filter((B)=>Z.columns.indexOf(B)===-1);if(U.length===_.length){Y.push(G);continue}if(q0(X,q)||q0(H,$)){Y.push(G);continue}let W=Y.length;if(q0(q,$)){let B={columns:[..._],startColumn:Z.startColumn,startRow:{...q},endRow:m0(this.beans,$)};Y.push(B)}if(U.length>0){let B={columns:U,startColumn:U.includes(Z.startColumn)?Z.startColumn:U[0],startRow:mS([{...$},{...q}]),endRow:cS([{...X},{...H}])};Y.push(B)}if(q0(X,H))Y.push({columns:[..._],startColumn:Z.startColumn,startRow:L0(this.beans,X),endRow:{...H}});if(Y.length-W===1)Y[Y.length-1].id=G.id}if(this.cellRanges=Y,Q)this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(Q,z,J){Q.createManagedBean(new hS(z,J))}setSelectionMode(Q){this.selectionMode=Q?1:0}refreshRangeStart(Q){let{columns:z}=Q,J=this.ensureRangeStartColumn(Q);if(!J)return;let Z=(q,H)=>{let _=Q.columns.filter((U)=>U!==q);if(q)Q.startColumn=q,Q.columns=H?[q,..._]:[..._,q];else Q.columns=_},{left:$,right:X}=this.getRangeEdgeColumns(Q);if(J===z[0]&&J!==$){Z($,!0);return}if(J===b(z)&&J===X)Z(X,!1)}setNewestRangeStartCell(Q){this.newestRangeStartCell=Q}getColumnsFromParams(Q,z,J){let Z=!Q&&!z&&!J,$,X=!1;if(Z||Q)$=this.getColumnsFromModel(Z?void 0:Q);else if(z&&J){if($=this.calculateColumnsBetween(z,J),$?.length)X=$[0]!==this.getColumnFromModel(z)}return $?{columns:$,startsOnTheRight:X}:void 0}verifyCellRanges(Q){let{suppressMultiRanges:z}=this.getMultiRangeContext(),J=q9(Q)&&z&&this.cellRanges.length>1;if(J)R(93);return!J}forEachRowInRange(Q,z){let J=this.getRangeStartRow(Q),Z=this.getRangeEndRow(Q),$=J;while($){if(z($),l($,Z))break;$=L0(this.beans,$)}}forEachEditableCellInRanges(Q,z){let{beans:J}=this;for(let Z of Q)this.forEachRowInRange(Z,($)=>{let X=M0(J,$);if(!X)return;for(let Y=0;Y0,H=z.ctrlKey||z.metaKey,_=!G||H,U=K1(Z),W=Gz(Z);if(!U||!W)return;if(z.key===V.ENTER)z.preventDefault();if(z.shiftKey){let E=$.root;if(!E)return;let K=Q.isColumn?Q:b(Q.getLeafColumns()),L=this.findContainingRange({columns:[E],startRow:U,endRow:W},!0);if(!L){$0(X,$.lastCellRange),this.selectColumns(this.calculateColumnsBetween(E,K),U,W);return}this.updateRangeRowBoundary({cellRange:L,boundary:"end",cellPosition:{column:K,...W}});return}if(q&&(Y||!H&&!G))this.removeAllCellRanges(!0);let B=(E,K)=>{let L=this.findContainingRange({columns:E,startRow:U,endRow:W},!0);if(L&&_)this.deselectColumnsFromRange(L,E);else{let F=this.selectColumns(E,U,W);if(F)$.lastCellRange=F}$.root=K};if(Q.isColumn)B([Q],Q);else{let E=Q.getDisplayedLeafColumns();B(E,E[0])}}deselectColumnsFromRange(Q,z){if(JJ(Q.columns,z),z.includes(Q.startColumn))Q.startColumn=Q.columns[0];if(Q.columns.length===0)$0(this.cellRanges,Q);this.dispatchChangedEvent(!0,!0)}selectColumns(Q,z,J){return this.addCellRange({columns:Q,columnStart:Q[0],columnEnd:b(Q),rowStartIndex:z.rowIndex,rowStartPinned:z.rowPinned,rowEndIndex:J.rowIndex,rowEndPinned:J.rowPinned})}};function GY(Q,z){return Q!=null?{rowIndex:Q,rowPinned:z}:void 0}function mS(Q){let z;for(let J of Q)if(z===void 0||q0(z,J))z=J;return z}function cS(Q){let z;for(let J of Q)if(z===void 0||q0(J,z))z=J;return z}function pS(Q,z){let{startRow:J,endRow:Z}=Q,$=q0(J,Z)?Z:J,X=z.rowIndex===$.rowIndex&&z.rowPinned===$.rowPinned,Y=Q.columns[0],G=b(Q.columns),q=Q.startColumn===Y?G:Y;return z.column===q&&X}function z2(Q,z,J){let Z;if(J==="top")Z=!Q.startRow||!Q.endRow||q0(Q.startRow,Q.endRow)?"startRow":"endRow";else Z=!Q.startRow||!Q.endRow||q0(Q.startRow,Q.endRow)?"endRow":"startRow";Q[Z]=z??void 0}var M4={moduleName:"CellSelection",version:J0,beans:[uS],dynamicBeans:{fillHandle:AS,rangeHandle:jS},apiFunctions:{getCellRanges:SS,addCellRange:OS,clearRangeSelection:$Y,clearCellSelection:$Y},dependsOn:[I0,iz,cZ],css:[RS]};function iS(Q){return Q.colModel.isPivotMode()}function nS(Q,z,J){return Q.pivotResultCols?.lookupPivotResultCol(z,J)??null}function dS(Q,z){Q.valueColsSvc?.setColumns(z,"api")}function tS(Q){return Q.valueColsSvc?.columns??[]}function rS(Q,z){Q.valueColsSvc?.removeColumns(z,"api")}function sS(Q,z){Q.valueColsSvc?.addColumns(z,"api")}function lS(Q,z){Q.pivotColsSvc?.setColumns(z,"api")}function aS(Q,z){Q.pivotColsSvc?.removeColumns(z,"api")}function oS(Q,z){Q.pivotColsSvc?.addColumns(z,"api")}function eS(Q){return Q.pivotColsSvc?.columns??[]}function QO(Q,z){Q.pivotResultCols?.setPivotResultCols(z,"api")}function zO(Q){let z=Q.pivotResultCols?.getPivotResultCols();return z?z.list:null}var qY="PivotRowTotal_",JO=({headerName:Q},{headerName:z})=>{if(Q&&!z)return 1;else if(!Q&&z)return-1;else if(!Q&&!z)return 0;if(Qz)return 1;else return 0},ZO=(Q)=>(z,J)=>Q(z.headerName,J.headerName),$O=class extends j{constructor(){super(...arguments);this.beanName="pivotColDefSvc"}wireBeans(Q){this.colModel=Q.colModel,this.pivotColsSvc=Q.pivotColsSvc,this.valueColsSvc=Q.valueColsSvc,this.colNames=Q.colNames}postConstruct(){let Q=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=Q(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=Q()});let z=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=z(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=z()})}createPivotColumnDefs(Q){let z=this.createPivotColumnsFromUniqueValues(Q);function J($,X=[]){return $.forEach((Y)=>{if(Y.children!==void 0)J(Y.children,X);else X.push(Y)}),X}let Z=J(z);return this.addRowGroupTotals(z,Z),this.addExpandablePivotGroups(z,Z),this.addPivotTotalsToGroups(z,Z),z}createPivotColumnsFromUniqueValues(Q){let z=this.pivotColsSvc?.columns??[],J=z.length;return this.recursivelyBuildGroup(0,Q,[],J,z)}recursivelyBuildGroup(Q,z,J,Z,$){if(Q>=Z)return this.buildMeasureCols(J);let{pivotComparator:X}=$[Q].getColDef(),Y=X?ZO(X):JO,G=this.valueColsSvc?.columns;if(G?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&Q===Z-1){let H=[];for(let _ of z.keys()){let U=[...J,_],W=this.createColDef(G[0],_,U);W.columnGroupShow="open",H.push(W)}return H.sort(Y),H}let q=[];for(let H of z.keys()){let _=this.pivotDefaultExpanded===-1||Q{let Z=this.colNames.getDisplayNameForColumn(J,"header"),$=this.createColDef(J,Z,Q);return $.columnGroupShow="open",$})}addExpandablePivotGroups(Q,z){let J=this.gos.get("suppressExpandablePivotGroups");if(J||this.gos.get("pivotColumnGroupTotals"))return;let Z=($,X,Y)=>{if("children"in $){let{valueColsSvc:H}=this,{columns:_=[]}=H??{},U=new Map;$.children.forEach((E)=>{Z(E,X,U)});let W=!$.children.some((E)=>E.children),B=W&&_.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let E of _){let K=this.colNames.getDisplayNameForColumn(E,"header"),L=this.createColDef(E,K,$.pivotKeys);if(L.pivotTotalColumnIds=U.get(E.getColId()),L.columnGroupShow=!J?"closed":"open",L.aggFunc=E.getAggFunc(),!W||B)$.children.push(L),X.push(L)}this.merge(Y,U);return}if(!$.pivotValueColumn)return;let G=$.pivotValueColumn.getColId();if(Y.has(G))Y.get(G).push($.colId);else Y.set(G,[$.colId])};Q.forEach(($)=>{Z($,z,new Map)})}addPivotTotalsToGroups(Q,z){if(!this.gos.get("pivotColumnGroupTotals"))return;let J=this.gos.get("pivotColumnGroupTotals")==="after",Z=this.valueColsSvc?.columns,$=Z?.map((X)=>X.getAggFunc());if(!$||$.length<1||!this.sameAggFuncs($))return;if(Z){let X=Z[0];Q.forEach((Y)=>{this.recursivelyAddPivotTotal(Y,z,X,J)})}}recursivelyAddPivotTotal(Q,z,J,Z){let $=Q;if(!$.children){let Y=Q;return Y.colId?[Y.colId]:null}let X=[];if($.children.forEach((Y)=>{let G=this.recursivelyAddPivotTotal(Y,z,J,Z);if(G)X=X.concat(G)}),$.children.length>1){let G=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),q=this.createColDef(J,G,Q.pivotKeys,!0);q.pivotTotalColumnIds=X,q.aggFunc=J.getAggFunc(),q.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;let H=Q.children;if(Z)H.push(q);else H.unshift(q);z.push(q)}return X}addRowGroupTotals(Q,z){if(!this.gos.get("pivotRowTotals"))return;let J=this.gos.get("pivotRowTotals")==="after",$=(this.valueColsSvc?.columns??[]).slice();if(!J)$.reverse();let X=$.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let Y=0;Y<$.length;Y++){let G=$[Y],q=this.colNames.getDisplayNameForColumn(G,"header"),H=this.createColDef(G,q,[]),_=[];for(let W=0;WX.data?.[X.colDef.field],$.pivotKeys=J,$.pivotValueColumn=Q,$.filter===!0)$.filter="agNumberColumnFilter";return $}sameAggFuncs(Q){if(Q.length==1)return!0;for(let z=1;z{let X=[...Q.has(Z)?Q.get(Z):[],...J];Q.set(Z,X)})}generateColumnGroupId(Q){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map((J)=>J.getColId()).join("-")}_${Q.join("-")}`}generateColumnId(Q,z){return`pivot_${(this.pivotColsSvc?.columns??[]).map((Z)=>Z.getColId()).join("-")}_${Q.join("-")}_${z}`}createColDefsFromFields(Q){let z=new Map;for(let $=0;${let q=[];for(let[U,W]of Y){let B=J(`${$}${this.fieldSeparator}${U}`,U,W,G+1);q.push(B)}if(q.length===0){let U=this.colModel.getColDefCol(X);if(U){let B=this.colNames.getDisplayNameForColumn(U,"header")??X,E=this.createColDef(U,B,void 0,!1);return E.colId=$,E.aggFunc=U.getAggFunc(),E.valueGetter=(K)=>K.data?.[$],E}return{colId:$,headerName:X,valueGetter:(B)=>B.data?.[$]}}if(this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&q.length===1&&"colId"in q[0])return q[0].headerName=X,q[0];return{openByDefault:this.pivotDefaultExpanded===-1||G{$.forEach((X)=>{if(T(X.children)){let G=X;if(J)J(G);Z(G.children)}else{let G=X;if(z)z(G)}})};if(Q)Z(Q)}},HY="Exceeded maximum allowed pivot column count.",Y2=(Q)=>{let z={};return Q.forEach((J,Z)=>z[Z]=J instanceof Map?Y2(J):J),z},YO=class extends j{constructor(){super(...arguments);this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(Q){this.valueSvc=Q.valueSvc,this.colModel=Q.colModel,this.pivotResultCols=Q.pivotResultCols,this.rowGroupColsSvc=Q.rowGroupColsSvc,this.valueColsSvc=Q.valueColsSvc,this.pivotColsSvc=Q.pivotColsSvc,this.pivotColDefSvc=Q.pivotColDefSvc}execute(Q){if(this.colModel.isPivotActive())return this.executePivotOn(Q);else return this.executePivotOff()}executePivotOff(){if(this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent())return this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),!0;return!1}executePivotOn(Q){let z=this.valueColsSvc?.columns.length??1,J=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=J===-1?-1:J/z;let Z;try{Z=this.bucketUpRowNodes(Q)}catch(F){if(F.message===HY)return this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:F.message}),this.lastTimeFailed=!0,!1;throw F}let $=this.setUniqueValues(Z),X=this.valueColsSvc?.columns??[],Y=X.map((F)=>`${F.getId()}-${F.getColDef().headerName}`).join("#"),G=X.map((F)=>F.getAggFunc().toString()).join("#"),q=this.aggregationColumnsHashLastTime!==Y,H=this.aggregationFuncsHashLastTime!==G;this.aggregationColumnsHashLastTime=Y,this.aggregationFuncsHashLastTime=G;let _=(this.rowGroupColsSvc?.columns??[]).map((F)=>F.getId()).join("#"),U=_!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=_;let W=this.gos.get("pivotRowTotals"),B=this.gos.get("pivotColumnGroupTotals"),E=this.gos.get("suppressExpandablePivotGroups"),K=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),L=W!==this.pivotRowTotalsLastTime||B!==this.pivotColumnGroupTotalsLastTime||E!==this.suppressExpandablePivotGroupsLastTime||K!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=W,this.pivotColumnGroupTotalsLastTime=B,this.suppressExpandablePivotGroupsLastTime=E,this.removePivotHeaderRowWhenSingleValueColumnLastTime=K,this.lastTimeFailed||$||q||U||H||L){let F=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(F,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(Q){if(!DZ(Y2(this.uniqueValues),Y2(Q)))return this.uniqueValues=Q,!0;return!1}bucketUpRowNodes(Q){this.currentUniqueCount=0;let z=new Map;A0(this.beans.rowModel.rootNode,this.beans.rowModel.hierarchical,Q,(Z)=>{if(Z.leafGroup)Z.childrenMapped=null});let J=(Z)=>{if(Z.leafGroup)this.bucketRowNode(Z,z);else{let $=Z.childrenAfterFilter;if($)for(let X=0,Y=$.length;Xthis.maxUniqueValues;if(Y&&W)throw Error(HY)}if(!$.has(U))$.set(U,[]);$.get(U).push(_)}if(J===z.length-1)return $;let G=new Map;for(let q of $.keys())G.set(q,this.bucketChildren($.get(q),z,J+1,Z.get(q)));return G}},GO={moduleName:"SharedPivot",version:J0,beans:[XO,$O,q4],apiFunctions:{isPivotMode:iS,getPivotResultColumn:nS,setValueColumns:dS,getValueColumns:tS,removeValueColumns:rS,addValueColumns:sS,setPivotColumns:lS,removePivotColumns:aS,addPivotColumns:oS,getPivotColumns:eS,setPivotResultColumns:QO,getPivotResultColumns:zO},dependsOn:[E4,E6]},k4={moduleName:"Pivot",version:J0,rowModels:["clientSide"],beans:[YO],dependsOn:[GO,zS,F2]};var ub=String.fromCodePoint(31,41150,8291);var V4=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],_Y=new Map;for(let Q of V4){let z=_Y.get(Q.symbol)??[];z.push(Q),_Y.set(Q.symbol,z)}var mb=[...new Set(V4.map((Q)=>Q.symbol))].sort((Q,z)=>z.length-Q.length);var cb=Symbol("WrappedFunctionMarker");var qO={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},HO=new Set(["columnLineCombo","areaColumnCombo","customCombo"]);function _O(Q){return HO.has(Q)}function UO(Q){return Q==="doughnut"?"donut":Q}function WO(Q){return qO[Q]}var BO=["number","category","grouped-category","log","time"];var pb=BO.reduce((Q,z)=>({...Q,[z]:{title:{_enabledFromTheme:!0}}}),{});var M2=(Q)=>{return(z)=>{if(z==null)return!0;return Q(z)}};var EO=["doughnut"];function KO(Q){return!!WO(Q)||_O(Q)}function LO(Q){return EO.includes(Q)}var nb=M2((Q)=>{if(KO(Q))return!0;if(LO(Q)){let z=UO(Q);return zz(`The chart type '${Q}' has been deprecated. Please use '${z}' instead.`),z}return!1}),db=M2((Q)=>{return typeof Q==="object"}),tb=M2((Q)=>{return typeof Q==="object"}),rb=M2((Q)=>{return typeof Q==="string"||typeof Q==="function"});function f4(Q){return Q.map((z,J,Z)=>z.map(($,X)=>Z.slice(0,J+1).reduce((Y,G)=>Y+G[X],0)))}function A4(Q){let z=Q.map((J,Z)=>Q.reduce(($,X)=>Math.max($,X[Z]),0));return Q.map((J)=>J.map((Z,$)=>Z/z[$]*19))}var j4=[[1,3,5],[2,6,4],[5,3,1]];var FO=f4(j4);var sb=A4(FO);var DO=j4;var MO=f4(DO);var lb=A4(MO);var kO=["number","category","time","grouped-category"],VO=["angle-category","angle-number","radius-category","radius-number"],ab=[...kO,...VO];var{h:fO,watch:q7,onUnmount:AO}=window;N5.registerModules([SX,ZX,RX,DX,jX,WX,zX,J4,M4,k4,F4,$7,dY,rY,lY,oY,K4]);var R4=(Q)=>{let{data:z,options:J,api:Z,on:$,class:X,style:Y="height: 100%; width: 100%",dark:G}=Q,q=null,H=null,_=()=>G!==void 0?typeof G==="function"?G():G:document.documentElement.getAttribute("data-theme")==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches,U=()=>_()?"ag-theme-balham-dark":"ag-theme-balham";return fO("div",{class:X,style:Y,ref:(B)=>{if(H)H(),H=null;if(q&&!q.isDestroyed()){if(q.destroy(),Z)Z.current=null;q=null}if(!B)return;let E=typeof z==="function"?z():z,K=typeof J==="function"?J():J,L=["onFilterChanged","onModelUpdated","onGridSizeChanged","onFirstDataRendered","onRowValueChanged","onSelectionChanged","onCellClicked","onCellDoubleClicked","onCellValueChanged","onRowClicked","onSortChanged","onContextMenu","onColumnResized","onColumnMoved","onRowDataUpdated","onCellEditingStarted","onCellEditingStopped","onPaginationChanged","onBodyScroll"],F={};L.forEach((A)=>{if($?.[A])F[A]=(O)=>$[A](O)});let D={...K,theme:U(),rowData:E||[],onGridReady:(A)=>{if(q=A.api,Z)Z.current=q;if($?.onGridReady)$.onGridReady(A);if(K?.autoSizeColumns)A.api.autoSizeAllColumns()},...F};q=MJ(B,D);let M=q7(()=>{if(!q||q.isDestroyed())return;let A=typeof z==="function"?z():z;if(Array.isArray(A)){let O=q.getGridOption("rowData");if(A!==O)q.setGridOption("rowData",A)}}),k=q7(()=>{if(!q||q.isDestroyed())return;_();let A=U();if(A!==q.getGridOption("theme"))q.setGridOption("theme",A)}),f=q7(()=>{if(!q||q.isDestroyed()||!J)return;let A=typeof J==="function"?J():J;if(A)Object.entries(A).forEach(([O,v])=>{try{q.setGridOption(O,v)}catch(I){}})});H=()=>{if(M(),k(),f(),q&&!q.isDestroyed()){if(q.destroy(),Z)Z.current=null;q=null}},AO(()=>{if(H)H(),H=null})}})};if(typeof window<"u")window.Grid=R4;})(); diff --git a/index.js b/index.js index 7fe7b81..986a3a4 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ -import { h, watch, onUnmount } from "sigpro-ui"; +const { h, watch, onUnmount } = window; + import { ModuleRegistry, ValidationModule, @@ -46,19 +47,29 @@ ModuleRegistry.registerModules([ ]); const Grid = (props) => { - const { data, options, api, on, class: className, style = "height: 100%; width: 100%;" } = props; + const { data, options, api, on, class: className, style = "height: 100%; width: 100%", dark } = props; let gridApi = null; + let cleanupFn = null; - const isDark = () => { - return document.documentElement.getAttribute('data-theme') === 'dark' || - window.matchMedia('(prefers-color-scheme: dark)').matches; - }; + const getDark = () => + dark !== undefined + ? (typeof dark === 'function' ? dark() : dark) + : document.documentElement.getAttribute('data-theme') === 'dark' || + window.matchMedia('(prefers-color-scheme: dark)').matches; - const getTheme = (dark) => { - return dark ? 'ag-theme-alpine-dark' : 'ag-theme-alpine'; - }; + const getTheme = () => getDark() ? 'ag-theme-balham-dark' : 'ag-theme-balham'; const initGrid = (container) => { + if (cleanupFn) { + cleanupFn(); + cleanupFn = null; + } + if (gridApi && !gridApi.isDestroyed()) { + gridApi.destroy(); + if (api) api.current = null; + gridApi = null; + } + if (!container) return; const initialData = typeof data === "function" ? data() : data; @@ -83,7 +94,7 @@ const Grid = (props) => { const gridOptions = { ...initialOptions, - theme: getTheme(isDark()), + theme: getTheme(), rowData: initialData || [], onGridReady: (params) => { gridApi = params.api; @@ -91,14 +102,7 @@ const Grid = (props) => { if (on?.onGridReady) on.onGridReady(params); if (initialOptions?.autoSizeColumns) { - setTimeout(() => { - if (gridApi && !gridApi.isDestroyed()) { - const allColumns = gridApi.getColumns(); - if (allColumns?.length) { - gridApi.autoSizeColumns(allColumns); - } - } - }, 100); + params.api.autoSizeAllColumns(); } }, ...eventHandlers @@ -106,7 +110,7 @@ const Grid = (props) => { gridApi = createGrid(container, gridOptions); - const stopData = watch(data, () => { + const stopData = watch(() => { if (!gridApi || gridApi.isDestroyed()) return; const newData = typeof data === "function" ? data() : data; if (Array.isArray(newData)) { @@ -115,38 +119,30 @@ const Grid = (props) => { gridApi.setGridOption("rowData", newData); } } - }, true); + }); - const stopTheme = watch(isDark, () => { - if (gridApi && !gridApi.isDestroyed()) { - const dark = isDark(); - const newTheme = getTheme(dark); - const currentTheme = gridApi.getGridOption("theme"); - if (newTheme !== currentTheme) { - gridApi.setGridOption("theme", newTheme); - } + const stopTheme = watch(() => { + if (!gridApi || gridApi.isDestroyed()) return; + getDark(); + const currentTheme = getTheme(); + if (currentTheme !== gridApi.getGridOption("theme")) { + gridApi.setGridOption("theme", currentTheme); } - }, true); + }); - const safeOptions = [ - 'pagination', 'paginationPageSize', 'suppressRowClickSelection', - 'rowSelection', 'enableCellTextSelection', 'ensureDomOrder', - 'stopEditingWhenCellsLoseFocus', 'enterMovesDown', 'enterMovesDownAfterEdit' - ]; - - const stopOptions = watch(options, () => { + const stopOptions = watch(() => { if (!gridApi || gridApi.isDestroyed() || !options) return; const newOptions = typeof options === "function" ? options() : options; - safeOptions.forEach(key => { - if (newOptions[key] !== undefined) { + if (newOptions) { + Object.entries(newOptions).forEach(([key, val]) => { try { - gridApi.setGridOption(key, newOptions[key]); - } catch (e) { } - } - }); - }, true); + gridApi.setGridOption(key, val); + } catch (e) {} + }); + } + }); - onUnmount(() => { + cleanupFn = () => { stopData(); stopTheme(); stopOptions(); @@ -155,6 +151,13 @@ const Grid = (props) => { if (api) api.current = null; gridApi = null; } + }; + + onUnmount(() => { + if (cleanupFn) { + cleanupFn(); + cleanupFn = null; + } }); };