ag-grid-community 35.2.0 → 35.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13332,10 +13332,10 @@ button.ag-side-button-button:focus {
13332
13332
  font-weight: normal;
13333
13333
  font-style: normal;
13334
13334
  }
13335
- `,document.head.appendChild(e)}}();function j(e){if(e?.length)return e[e.length-1]}function lt(e,t,a){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o]&&!a?.(e[o],t[o]))return!1;return!0}function Xa(e,t){if(e){for(const a of e)if(t(a))return!0}}function Pe(e,t){const a=e.indexOf(t);a>=0&&e.splice(a,1)}function Ns(e,t){let a=0,n=0;for(;a<e.length;a++)t.includes(e[a])||(e[n]=e[a],n++);for(;n<e.length;)e.pop()}function Vs(e,t,a){for(let n=0;n<t.length;n++)Pe(e,t[n]);for(let n=t.length-1;n>=0;n--)e.splice(a,0,t[n])}function pm(e){return[].concat.apply([],e)}var Ke=e=>e==null||e===""?null:e;function z(e){return e!=null&&e!==""}function K(e){return!z(e)}var $n=e=>e!=null&&typeof e.toString=="function"?e.toString():null,ma=(e,t)=>{const a=e?JSON.stringify(e):null,n=t?JSON.stringify(t):null;return a===n},Gs=(e,t,a=!1)=>e==null?t==null?0:-1:t==null?1:(typeof e=="object"&&e.toNumber&&(e=e.toNumber()),typeof t=="object"&&t.toNumber&&(t=t.toNumber()),!a||typeof e!="string"?e>t?1:e<t?-1:0:e.localeCompare(t)),Ct=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,a){const n=t?this.allAsyncListeners:this.allSyncListeners;let o=n.get(e);return!o&&a&&(o=new Set,n.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,a=!1){this.getListeners(e,a,!0).add(t)}removeEventListener(e,t,a=!1){const n=this.getListeners(e,a,!1);n&&(n.delete(t),n.size===0&&(a?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const a=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const{frameworkOverrides:n}=this,o=l=>{const s=n?()=>n.wrapIncoming(l):l;t?this.dispatchAsync(s):s()},r=this.getListeners(a,t,!1);if((r?.size??0)>0){const l=new Set(r);for(const s of l)r?.has(s)&&o(()=>s(e))}const i=this.getGlobalListeners(t);if(i.size>0){const l=new Set(i);for(const s of l)o(()=>s(a,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},a=this.frameworkOverrides;a?a.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},fm=/[&<>"']/g,mm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Yt(e){return e?.toString().toString()??null}function va(e){return Yt(e)?.replace(fm,t=>mm[t])??null}function Mr(e){return typeof e=="string"&&e.startsWith("=")&&e.length>1}function qs(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,a=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(a,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function Ie(e){return e.eRootDiv.getRootNode()}function _(e){return Ie(e).activeElement}function ne(e){const{gos:t,eRootDiv:a}=e;let n=null;const o=t.get("getDocument");return o&&z(o)?n=o():a&&(n=a.ownerDocument),n&&z(n)?n:document}function eo(e){const t=_(e);return t===null||t===ne(e).body}function to(e){return ne(e).defaultView||window}function ao(e){let t=null,a=null;try{t=ne(e).fullscreenElement}catch{}finally{t||(t=Ie(e));const n=t.querySelector("body");n?a=n:t instanceof ShadowRoot?a=t:t instanceof Document?a=t?.documentElement:a=t}return a}function vm(e){return ao(e)?.clientWidth??(window.innerWidth||-1)}function bm(e){return ao(e)?.clientHeight??(window.innerHeight||-1)}function be(e,t,a){a==null||typeof a=="string"&&a==""?no(e,t):xe(e,t,a)}function xe(e,t,a){e.setAttribute(Ws(t),a.toString())}function no(e,t){e.removeAttribute(Ws(t))}function Ws(e){return`aria-${e}`}function _e(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function wm(e){const t=e?.direction;return t==="asc"?"ascending":t==="desc"?"descending":t==="mixed"?"other":"none"}function Cm(e){return Number.parseInt(e.getAttribute("aria-posinset"),10)}function ym(e){return e.getAttribute("aria-label")}function Kt(e,t){be(e,"label",t)}function ba(e,t){be(e,"labelledby",t)}function km(e,t){be(e,"describedby",t)}function Us(e,t){be(e,"live",t)}function Sm(e,t){be(e,"atomic",t)}function xm(e,t){be(e,"relevant",t)}function oo(e,t){be(e,"invalid",t)}function Rm(e,t){be(e,"level",t)}function js(e,t){be(e,"disabled",t)}function zr(e,t){be(e,"hidden",t)}function Em(e,t){be(e,"activedescendant",t)}function ro(e,t){xe(e,"expanded",t)}function Fm(e){no(e,"expanded")}function Ys(e,t){xe(e,"setsize",t)}function Ks(e,t){xe(e,"posinset",t)}function Mm(e,t){xe(e,"multiselectable",t)}function _s(e,t){xe(e,"rowcount",t)}function wa(e,t){xe(e,"rowindex",t)}function zm(e,t){xe(e,"rowspan",t)}function Qs(e,t){xe(e,"colcount",t)}function Dr(e,t){xe(e,"colindex",t)}function Zs(e,t){xe(e,"colspan",t)}function Js(e,t){xe(e,"sort",t)}function Xs(e){no(e,"sort")}function Ar(e,t){be(e,"selected",t)}function Dm(e,t){xe(e,"checked",t===void 0?"mixed":t)}function $s(e,t){be(e,"controls",t)}function ec(e,t){$s(e,t.id),ba(t,e.id)}function tc(e,t){be(e,"owns",t)}function Am(e,t){be(e,"haspopup",t===!1?null:t)}function io(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function Pm(e,t){t?xe(e,"orientation",t):no(e,"orientation")}function Im(e,t,a){const n=e.parentElement;let o=n&&n.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),a&&o.classList.toggle(a,o!==e),o=o.nextSibling}var Tm="[tabindex], input, select, button, textarea, [href]",ac="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ca(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(ac)?!1:Me(e)}function W(e,t,a={}){const{skipAriaHidden:n}=a;e.classList.toggle("ag-hidden",!t),n||zr(e,!t)}function nc(e,t,a={}){const{skipAriaHidden:n}=a;e.classList.toggle("ag-invisible",!t),n||zr(e,!t)}function ya(e,t){const a="disabled",n=t?r=>r.setAttribute(a,""):r=>r.removeAttribute(a);n(e);const o=e.querySelectorAll("input")??[];for(const r of o)n(r)}function _t(e,t,a){let n=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof a=="number"){if(++n>a)break}else if(e===a)break}return!1}function Qt(e){const{height:t,width:a,borderTopWidth:n,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:i,paddingTop:l,paddingRight:s,paddingBottom:c,paddingLeft:d,marginTop:g,marginRight:u,marginBottom:h,marginLeft:p,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(a||"0"),borderTopWidth:m(n||"0"),borderRightWidth:m(o||"0"),borderBottomWidth:m(r||"0"),borderLeftWidth:m(i||"0"),paddingTop:m(l||"0"),paddingRight:m(s||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(g||"0"),marginRight:m(u||"0"),marginBottom:m(h||"0"),marginLeft:m(p||"0"),boxSizing:f}}function lo(e){const t=Qt(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function ka(e){const t=Qt(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Pr(e){const{height:t,marginBottom:a,marginTop:n}=Qt(e);return Math.floor(t+a+n)}function $a(e){const{width:t,marginLeft:a,marginRight:n}=Qt(e);return Math.floor(t+a+n)}function oc(e){const t=e.getBoundingClientRect(),{borderTopWidth:a,borderLeftWidth:n,borderRightWidth:o,borderBottomWidth:r}=Qt(e);return{top:t.top+(a||0),left:t.left+(n||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function so(e,t){let a=e.scrollLeft;return t&&(a=Math.abs(a)),a}function en(e,t,a){a&&(t*=-1),e.scrollLeft=t}function le(e){for(;e?.firstChild;)e.firstChild.remove()}function Fe(e){e?.parentNode&&e.remove()}function rc(e){return!!e.offsetParent}function Me(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!rc(e)||window.getComputedStyle(e).visibility!=="visible")}function co(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function ic(e,t,a){a&&a.nextSibling===t||(e.firstChild?a?a.nextSibling?e.insertBefore(t,a.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function lc(e,t){for(let a=0;a<t.length;a++){const n=t[a],o=e.children[a];o!==n&&e.insertBefore(n,o)}}function Lm(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function tn(e,t){if(t)for(const a of Object.keys(t)){const n=t[a];if(!a?.length||n==null)continue;const o=Lm(a),r=n.toString(),i=r.replace(/\s*!important/g,""),l=i.length!=r.length?"important":void 0;e.style.setProperty(o,i,l)}}function Zt(e){return()=>{const t=e();return t?sc(t)||Bm(t):!0}}function sc(e){return e.clientWidth<e.scrollWidth}function Bm(e){return e.clientHeight<e.scrollHeight}function go(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Ne(e,t)}function Ne(e,t){t=Ir(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function an(e,t){t=Ir(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Ir(e){return typeof e=="number"?`${e}px`:e}function uo(e){return e instanceof Node||e instanceof HTMLElement}function we(e,t,a){a==null||a===""?e.removeAttribute(t):e.setAttribute(t,a.toString())}function cc(e,t){if(!t.isContentEditable)return;const a=to(e).getSelection();if(!a)return;const n=ne(e).createRange();n.selectNodeContents(t),n.collapse(!1),a.removeAllRanges(),a.addRange(n)}function st(e,t,a){const o=to(e).ResizeObserver,r=o?new o(a):null;return r?.observe(t),()=>r?.disconnect()}function Qe(e,t){const a=to(e);a.requestAnimationFrame?a.requestAnimationFrame(t):a.webkitRequestAnimationFrame?a.webkitRequestAnimationFrame(t):a.setTimeout(t,0)}var dc="data-ref",Tr;function gc(){return Tr??(Tr=document.createTextNode(" ")),Tr.cloneNode()}function yt(e){const{attrs:t,children:a,cls:n,ref:o,role:r,tag:i}=e,l=document.createElement(i);if(n&&(l.className=n),o&&l.setAttribute(dc,o),r&&l.setAttribute("role",r),t)for(const s of Object.keys(t))l.setAttribute(s,t[s]);if(a)if(typeof a=="string")l.textContent=a;else{let s=!0;for(const c of a)c&&(typeof c=="string"?(l.appendChild(document.createTextNode(c)),s=!1):typeof c=="function"?l.appendChild(c()):(s&&(l.appendChild(gc()),s=!1),l.append(yt(c)),l.appendChild(gc())))}return l}var Om=["touchstart","touchend","touchmove","touchcancel","scroll"],Hm=["wheel"],Lr={},ho=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a=>{if(typeof Lr[a]=="boolean")return Lr[a];const n=document.createElement(e[a]||"div");return a="on"+a,Lr[a]=a in n}})();function uc(e,t){return!t||!e?!1:Vm(t).indexOf(e)>=0}function Nm(e){const t=[];let a=e.target;for(;a;)t.push(a),a=a.parentElement;return t}function Vm(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Nm(t)}function Gm(e,t,a){const n=qm(t);let o;n!=null&&(o={passive:n}),e.addEventListener(t,a,o)}var qm=e=>{const t=Om.includes(e),a=Hm.includes(e);if(t)return!0;if(a)return!1};function hc(e,t,a){if(a===0)return!1;const n=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(n,o)<=a}var Sa=(e,t)=>{const a=e.identifier;for(let n=0,o=t.length;n<o;++n){const r=t[n];if(r.identifier===a)return r}return null};function nn(e,t){return e.gos.isElementInThisInstance(t.target)}function pc(e,t,a){const o=e.getBoundingClientRect().height,r=vm(a)-2,i=bm(a)-2;if(!e.offsetParent)return;const s=oc(e.offsetParent),{clientY:c,clientX:d}=t;let g=c-s.top-o/2,u=d-s.left-10;const h=ne(a),p=h.defaultView||window,f=p.pageYOffset||h.documentElement.scrollTop,m=p.pageXOffset||h.documentElement.scrollLeft;r>0&&u+e.clientWidth>r+m&&(u=r+m-e.clientWidth),u<0&&(u=0),i>0&&g+e.clientHeight>i+f&&(g=i+f-e.clientHeight),g<0&&(g=0),e.style.left=`${u}px`,e.style.top=`${g}px`}var po=(e,...t)=>{for(const a of t){const[n,o,r,i]=a;n.addEventListener(o,r,i),e.push(a)}},Br=e=>{if(e){for(const[t,a,n,o]of e)t.removeEventListener(a,n,o);e.length=0}},kt=e=>{e.cancelable&&e.preventDefault()};function Wm(e,t){return t}function Or(e){return e?.getLocaleTextFunc()??Wm}function fc(e,t,a,n){const o=t[a];return e.getLocaleTextFunc()(a,typeof o=="function"?o(n):o,n)}function mc(e){return(t,a,n)=>e({key:t,defaultValue:a,variableValues:n})}function vc(e){return(t,a,n)=>{let o=e?.[t];if(o&&n?.length){let r=0;for(;!(r>=n.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",n[r++])}return o??a}}var ue=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,a){this.localEventService||(this.localEventService=new Ct),this.localEventService.addEventListener(e,t,a)}removeEventListener(e,t,a){this.localEventService?.removeEventListener(e,t,a)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const a=[];for(const n of Object.keys(t)){const o=t[n];o&&a.push(this._setupListener(e,n,o))}return a}_setupListener(e,t,a){if(this.destroyed)return()=>null;let n;if(Um(e))e.__addEventListener(t,a),n=()=>(e.__removeEventListener(t,a),null);else{const o=jm(e);e instanceof HTMLElement?Gm(e,t,a):o?e.addListener(t,a):e.addEventListener(t,a),n=o?()=>(e.removeListener(t,a),null):()=>(e.removeEventListener(t,a),null)}return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==n),null)}setupPropertyListener(e,t){const{gos:a}=this;a.addPropertyEventListener(e,t);const n=()=>(a.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==n),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const a=e.join("-")+this.propertyListenerId++,n=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[a])return;this.lastChangeSetIdLookup[a]=o.changeSet.id}const r={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(r)};for(const o of e)this.setupPropertyListener(o,n)}getLocaleTextFunc(){return Or(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const a=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),a}createBean(e,t,a){return(t||this.stubContext).createBean(e,a)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Um(e){return e.__addEventListener!==void 0}function jm(e){return e.eventServiceType==="global"}var y=class extends ue{},Hr=new Set,on=(e,t)=>{Hr.has(t)||(Hr.add(t),e())};on._set=Hr;var Ym={pending:!1,funcs:[]},Km={pending:!1,funcs:[]};function fo(e,t="setTimeout",a){const n=t==="raf"?Km:Ym;if(n.funcs.push(e),n.pending)return;n.pending=!0;const o=()=>{const r=n.funcs.slice();n.funcs.length=0,n.pending=!1;for(const i of r)i()};t==="raf"?Qe(a,o):window.setTimeout(o,0)}function te(e,t,a){let n;return function(...o){const r=this;return window.clearTimeout(n),n=window.setTimeout(function(){e.isAlive()&&t.apply(r,o)},a),n}}function bc(e,t){let a=0;return function(...n){const o=this,r=Date.now();r-a<t||(a=r,e.apply(o,n))}}function wc(e,t,a,n=100){const o=Date.now();let r=null,i=!1;const l=()=>{r!=null&&(window.clearInterval(r),r=null)};e.addDestroyFunc(l);const s=()=>{const c=Date.now()-o>n;(t()||c)&&(a(),i=!0,l())};s(),i||(r=window.setInterval(s,10))}var Cc=new Set(["__proto__","constructor","prototype"]);function _m(e,t){if(e!=null){if(Array.isArray(e)){for(let a=0;a<e.length;a++)t(a.toString(),e[a]);return}for(const a of Object.keys(e).filter(n=>!Cc.has(n)))t(a,e[a])}}function he(e,t,a=!0,n=!1){z(t)&&_m(t,(o,r)=>{let i=e[o];i!==r&&(n&&i==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(i={},e[o]=i),yc(r)&&yc(i)&&!Array.isArray(i)?he(i,r,a,n):(a||r!==void 0)&&(e[o]=r))})}function yc(e){return typeof e=="object"&&e!==null}var Nr=class wt{static applyGlobalGridOptions(t){if(!wt.gridOptions)return{...t};let a={};return he(a,wt.gridOptions,!0,!0),wt.mergeStrategy==="deep"?he(a,t,!0,!0):a={...a,...t},wt.gridOptions.context&&(a.context=wt.gridOptions.context),t.context&&(wt.mergeStrategy==="deep"&&a.context&&he(t.context,a.context,!0,!0),a.context=t.context),a}static applyGlobalGridOption(t,a){if(wt.mergeStrategy==="deep"){const n=Vr(t);if(n&&typeof n=="object"&&typeof a=="object")return wt.applyGlobalGridOptions({[t]:a})[t]}return a}};Nr.gridOptions=void 0,Nr.mergeStrategy="shallow";var rn=Nr;function Qm(e,t="shallow"){rn.gridOptions=e,rn.mergeStrategy=t}function Vr(e){return rn.gridOptions?.[e]}var kc={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",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:1e3,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},Sc="https://www.ag-grid.com";function St(e,t,...a){e.get("debug")&&console.log("AG Grid: "+t,...a)}function Jt(e,...t){on(()=>Rc(e,...t),e+t?.join(""))}function xa(e,...t){on(()=>xc(e,...t),e+t?.join(""))}function xc(e,...t){console.error("AG Grid: "+e,...t)}function Rc(e,...t){console.warn("AG Grid: "+e,...t)}var Ec=new Set,mo={},Xt={},vo,Fc=!1,Mc=!1,zc=!1;function Zm(e){const[t,a]=e.version.split(".")||[],[n,o]=vo.split(".")||[];return t===n&&a===o}function Jm(e){vo||(vo=e.version);const t=n=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${n} Please update all modules to the same version.`;e.version?Zm(e)||xa(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${vo}.`)):xa(t(`'${e.moduleName}' is incompatible.`));const a=e.validate?.();a&&!a.isValid&&xa(`${a.message}`)}function Ra(e,t,a=!1){a||(Fc=!0),Jm(e);const n=e.rowModels??["all"];Ec.add(e);let o;t!==void 0?(Mc=!0,Xt[t]===void 0&&(Xt[t]={}),o=Xt[t]):o=mo;for(const r of n)o[r]===void 0&&(o[r]={}),o[r][e.moduleName]=e;if(e.dependsOn)for(const r of e.dependsOn)Ra(r,t,a)}function Xm(e){delete Xt[e]}function Gr(e,t,a){const n=o=>!!mo[o]?.[e]||!!Xt[t]?.[o]?.[e];return n(a)||n("all")}function qr(){return Mc}function $m(e,t){const a=Xt[e]??{};return[...Object.values(mo.all??{}),...Object.values(a.all??{}),...Object.values(mo[t]??{}),...Object.values(a[t]??{})]}function ev(){return new Set(Ec)}function tv(e,t){const a=Xt[e]??{};return[...Object.values(a.all??{}),...Object.values(a[t]??{})]}function av(){return Fc}function Wr(){return zc}function Dc(){zc=!0}var Ur=class{static register(e){Ra(e,void 0)}static registerModules(e){for(const t of e)Ra(t,void 0)}};function Ac(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const a=Ac(t.dependsOn);if(a)return a}}}var F="35.2.0",Pc=2e3,Ic=100,Tc="_version_",Lc=null,Ea=`${Sc}/javascript-data-grid`;function nv(e){Lc=e}function ov(e){Ea=e}function Bc(e,t,a){return Lc?.(e,t)??[sv(e,t,a)]}function bo(e,t,a,n,o){e(`${n?"warning":"error"} #${t}`,...Bc(t,a,o))}function rv(e){if(!e)return String(e);const t={};for(const a of Object.keys(e))typeof e[a]!="object"&&typeof e[a]!="function"&&(t[a]=e[a]);return JSON.stringify(t)}function iv(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=rv(e)),t}function wo(e){return e===void 0?"undefined":e===null?"null":e}function jr(e,t){return`${e}?${t.toString()}`}function lv(e,t,a){const n=Array.from(t.entries()).sort((r,i)=>i[1].length-r[1].length);let o=jr(e,t);for(const[r,i]of n){if(r===Tc)continue;const l=o.length-a;if(l<=0)break;const s="...",c=l+s.length,d=i.length-c>Ic?i.slice(0,i.length-c)+s:i.slice(0,Ic)+s;t.set(r,d),o=jr(e,t)}return o}function Oc(e,t){const a=new URLSearchParams;if(a.append(Tc,F),t)for(const r of Object.keys(t))a.append(r,iv(t[r]));const n=`${Ea}/errors/${e}`,o=jr(n,a);return o.length<=Pc?o:lv(n,a,Pc)}var sv=(e,t,a)=>{const n=Oc(e,t),o=`${a?a+`
13335
+ `,document.head.appendChild(e)}}();function j(e){if(e?.length)return e[e.length-1]}function lt(e,t,a){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o]&&!a?.(e[o],t[o]))return!1;return!0}function Xa(e,t){if(e){for(const a of e)if(t(a))return!0}}function Pe(e,t){const a=e.indexOf(t);a>=0&&e.splice(a,1)}function Ns(e,t){let a=0,n=0;for(;a<e.length;a++)t.includes(e[a])||(e[n]=e[a],n++);for(;n<e.length;)e.pop()}function Vs(e,t,a){for(let n=0;n<t.length;n++)Pe(e,t[n]);for(let n=t.length-1;n>=0;n--)e.splice(a,0,t[n])}function pm(e){return[].concat.apply([],e)}var Ke=e=>e==null||e===""?null:e;function z(e){return e!=null&&e!==""}function K(e){return!z(e)}var $n=e=>e!=null&&typeof e.toString=="function"?e.toString():null,ma=(e,t)=>{const a=e?JSON.stringify(e):null,n=t?JSON.stringify(t):null;return a===n},Gs=(e,t,a=!1)=>e==null?t==null?0:-1:t==null?1:(typeof e=="object"&&e.toNumber&&(e=e.toNumber()),typeof t=="object"&&t.toNumber&&(t=t.toNumber()),!a||typeof e!="string"?e>t?1:e<t?-1:0:e.localeCompare(t)),Ct=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,a){const n=t?this.allAsyncListeners:this.allSyncListeners;let o=n.get(e);return!o&&a&&(o=new Set,n.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,a=!1){this.getListeners(e,a,!0).add(t)}removeEventListener(e,t,a=!1){const n=this.getListeners(e,a,!1);n&&(n.delete(t),n.size===0&&(a?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const a=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const{frameworkOverrides:n}=this,o=l=>{const s=n?()=>n.wrapIncoming(l):l;t?this.dispatchAsync(s):s()},r=this.getListeners(a,t,!1);if((r?.size??0)>0){const l=new Set(r);for(const s of l)r?.has(s)&&o(()=>s(e))}const i=this.getGlobalListeners(t);if(i.size>0){const l=new Set(i);for(const s of l)o(()=>s(a,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},a=this.frameworkOverrides;a?a.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},fm=/[&<>"']/g,mm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Yt(e){return e?.toString().toString()??null}function va(e){return Yt(e)?.replace(fm,t=>mm[t])??null}function Mr(e){return typeof e=="string"&&e.startsWith("=")&&e.length>1}function qs(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,a=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(a,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function Ie(e){return e.eRootDiv.getRootNode()}function _(e){return Ie(e).activeElement}function ne(e){const{gos:t,eRootDiv:a}=e;let n=null;const o=t.get("getDocument");return o&&z(o)?n=o():a&&(n=a.ownerDocument),n&&z(n)?n:document}function eo(e){const t=_(e);return t===null||t===ne(e).body}function to(e){return ne(e).defaultView||window}function ao(e){let t=null,a=null;try{t=ne(e).fullscreenElement}catch{}finally{t||(t=Ie(e));const n=t.querySelector("body");n?a=n:t instanceof ShadowRoot?a=t:t instanceof Document?a=t?.documentElement:a=t}return a}function vm(e){return ao(e)?.clientWidth??(window.innerWidth||-1)}function bm(e){return ao(e)?.clientHeight??(window.innerHeight||-1)}function be(e,t,a){a==null||typeof a=="string"&&a==""?no(e,t):xe(e,t,a)}function xe(e,t,a){e.setAttribute(Ws(t),a.toString())}function no(e,t){e.removeAttribute(Ws(t))}function Ws(e){return`aria-${e}`}function _e(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function wm(e){const t=e?.direction;return t==="asc"?"ascending":t==="desc"?"descending":t==="mixed"?"other":"none"}function Cm(e){return Number.parseInt(e.getAttribute("aria-posinset"),10)}function ym(e){return e.getAttribute("aria-label")}function Kt(e,t){be(e,"label",t)}function ba(e,t){be(e,"labelledby",t)}function km(e,t){be(e,"describedby",t)}function Us(e,t){be(e,"live",t)}function Sm(e,t){be(e,"atomic",t)}function xm(e,t){be(e,"relevant",t)}function oo(e,t){be(e,"invalid",t)}function Rm(e,t){be(e,"level",t)}function js(e,t){be(e,"disabled",t)}function zr(e,t){be(e,"hidden",t)}function Em(e,t){be(e,"activedescendant",t)}function ro(e,t){xe(e,"expanded",t)}function Fm(e){no(e,"expanded")}function Ys(e,t){xe(e,"setsize",t)}function Ks(e,t){xe(e,"posinset",t)}function Mm(e,t){xe(e,"multiselectable",t)}function _s(e,t){xe(e,"rowcount",t)}function wa(e,t){xe(e,"rowindex",t)}function zm(e,t){xe(e,"rowspan",t)}function Qs(e,t){xe(e,"colcount",t)}function Dr(e,t){xe(e,"colindex",t)}function Zs(e,t){xe(e,"colspan",t)}function Js(e,t){xe(e,"sort",t)}function Xs(e){no(e,"sort")}function Ar(e,t){be(e,"selected",t)}function Dm(e,t){xe(e,"checked",t===void 0?"mixed":t)}function $s(e,t){be(e,"controls",t)}function ec(e,t){$s(e,t.id),ba(t,e.id)}function tc(e,t){be(e,"owns",t)}function Am(e,t){be(e,"haspopup",t===!1?null:t)}function io(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function Pm(e,t){t?xe(e,"orientation",t):no(e,"orientation")}function Im(e,t,a){const n=e.parentElement;let o=n&&n.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),a&&o.classList.toggle(a,o!==e),o=o.nextSibling}var Tm="[tabindex], input, select, button, textarea, [href]",ac="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ca(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(ac)?!1:Me(e)}function W(e,t,a={}){const{skipAriaHidden:n}=a;e.classList.toggle("ag-hidden",!t),n||zr(e,!t)}function nc(e,t,a={}){const{skipAriaHidden:n}=a;e.classList.toggle("ag-invisible",!t),n||zr(e,!t)}function ya(e,t){const a="disabled",n=t?r=>r.setAttribute(a,""):r=>r.removeAttribute(a);n(e);const o=e.querySelectorAll("input")??[];for(const r of o)n(r)}function _t(e,t,a){let n=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof a=="number"){if(++n>a)break}else if(e===a)break}return!1}function Qt(e){const{height:t,width:a,borderTopWidth:n,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:i,paddingTop:l,paddingRight:s,paddingBottom:c,paddingLeft:d,marginTop:g,marginRight:u,marginBottom:h,marginLeft:p,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(a||"0"),borderTopWidth:m(n||"0"),borderRightWidth:m(o||"0"),borderBottomWidth:m(r||"0"),borderLeftWidth:m(i||"0"),paddingTop:m(l||"0"),paddingRight:m(s||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(g||"0"),marginRight:m(u||"0"),marginBottom:m(h||"0"),marginLeft:m(p||"0"),boxSizing:f}}function lo(e){const t=Qt(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function ka(e){const t=Qt(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function Pr(e){const{height:t,marginBottom:a,marginTop:n}=Qt(e);return Math.floor(t+a+n)}function $a(e){const{width:t,marginLeft:a,marginRight:n}=Qt(e);return Math.floor(t+a+n)}function oc(e){const t=e.getBoundingClientRect(),{borderTopWidth:a,borderLeftWidth:n,borderRightWidth:o,borderBottomWidth:r}=Qt(e);return{top:t.top+(a||0),left:t.left+(n||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function so(e,t){let a=e.scrollLeft;return t&&(a=Math.abs(a)),a}function en(e,t,a){a&&(t*=-1),e.scrollLeft=t}function le(e){for(;e?.firstChild;)e.firstChild.remove()}function Fe(e){e?.parentNode&&e.remove()}function rc(e){return!!e.offsetParent}function Me(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!rc(e)||window.getComputedStyle(e).visibility!=="visible")}function co(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function ic(e,t,a){a&&a.nextSibling===t||(e.firstChild?a?a.nextSibling?e.insertBefore(t,a.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function lc(e,t){for(let a=0;a<t.length;a++){const n=t[a],o=e.children[a];o!==n&&e.insertBefore(n,o)}}function Lm(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function tn(e,t){if(t)for(const a of Object.keys(t)){const n=t[a];if(!a?.length||n==null)continue;const o=Lm(a),r=n.toString(),i=r.replace(/\s*!important/g,""),l=i.length!=r.length?"important":void 0;e.style.setProperty(o,i,l)}}function Zt(e){return()=>{const t=e();return t?sc(t)||Bm(t):!0}}function sc(e){return e.clientWidth<e.scrollWidth}function Bm(e){return e.clientHeight<e.scrollHeight}function go(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Ne(e,t)}function Ne(e,t){t=Ir(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function an(e,t){t=Ir(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Ir(e){return typeof e=="number"?`${e}px`:e}function uo(e){return e instanceof Node||e instanceof HTMLElement}function we(e,t,a){a==null||a===""?e.removeAttribute(t):e.setAttribute(t,a.toString())}function cc(e,t){if(!t.isContentEditable)return;const a=to(e).getSelection();if(!a)return;const n=ne(e).createRange();n.selectNodeContents(t),n.collapse(!1),a.removeAllRanges(),a.addRange(n)}function st(e,t,a){const o=to(e).ResizeObserver,r=o?new o(a):null;return r?.observe(t),()=>r?.disconnect()}function Qe(e,t){const a=to(e);a.requestAnimationFrame?a.requestAnimationFrame(t):a.webkitRequestAnimationFrame?a.webkitRequestAnimationFrame(t):a.setTimeout(t,0)}var dc="data-ref",Tr;function gc(){return Tr??(Tr=document.createTextNode(" ")),Tr.cloneNode()}function yt(e){const{attrs:t,children:a,cls:n,ref:o,role:r,tag:i}=e,l=document.createElement(i);if(n&&(l.className=n),o&&l.setAttribute(dc,o),r&&l.setAttribute("role",r),t)for(const s of Object.keys(t))l.setAttribute(s,t[s]);if(a)if(typeof a=="string")l.textContent=a;else{let s=!0;for(const c of a)c&&(typeof c=="string"?(l.appendChild(document.createTextNode(c)),s=!1):typeof c=="function"?l.appendChild(c()):(s&&(l.appendChild(gc()),s=!1),l.append(yt(c)),l.appendChild(gc())))}return l}var Om=["touchstart","touchend","touchmove","touchcancel","scroll"],Hm=["wheel"],Lr={},ho=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a=>{if(typeof Lr[a]=="boolean")return Lr[a];const n=document.createElement(e[a]||"div");return a="on"+a,Lr[a]=a in n}})();function uc(e,t){return!t||!e?!1:Vm(t).indexOf(e)>=0}function Nm(e){const t=[];let a=e.target;for(;a;)t.push(a),a=a.parentElement;return t}function Vm(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Nm(t)}function Gm(e,t,a){const n=qm(t);let o;n!=null&&(o={passive:n}),e.addEventListener(t,a,o)}var qm=e=>{const t=Om.includes(e),a=Hm.includes(e);if(t)return!0;if(a)return!1};function hc(e,t,a){if(a===0)return!1;const n=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(n,o)<=a}var Sa=(e,t)=>{const a=e.identifier;for(let n=0,o=t.length;n<o;++n){const r=t[n];if(r.identifier===a)return r}return null};function nn(e,t){return e.gos.isElementInThisInstance(t.target)}function pc(e,t,a){const o=e.getBoundingClientRect().height,r=vm(a)-2,i=bm(a)-2;if(!e.offsetParent)return;const s=oc(e.offsetParent),{clientY:c,clientX:d}=t;let g=c-s.top-o/2,u=d-s.left-10;const h=ne(a),p=h.defaultView||window,f=p.pageYOffset||h.documentElement.scrollTop,m=p.pageXOffset||h.documentElement.scrollLeft;r>0&&u+e.clientWidth>r+m&&(u=r+m-e.clientWidth),u<0&&(u=0),i>0&&g+e.clientHeight>i+f&&(g=i+f-e.clientHeight),g<0&&(g=0),e.style.left=`${u}px`,e.style.top=`${g}px`}var po=(e,...t)=>{for(const a of t){const[n,o,r,i]=a;n.addEventListener(o,r,i),e.push(a)}},Br=e=>{if(e){for(const[t,a,n,o]of e)t.removeEventListener(a,n,o);e.length=0}},kt=e=>{e.cancelable&&e.preventDefault()};function Wm(e,t){return t}function Or(e){return e?.getLocaleTextFunc()??Wm}function fc(e,t,a,n){const o=t[a];return e.getLocaleTextFunc()(a,typeof o=="function"?o(n):o,n)}function mc(e){return(t,a,n)=>e({key:t,defaultValue:a,variableValues:n})}function vc(e){return(t,a,n)=>{let o=e?.[t];if(o&&n?.length){let r=0;for(;!(r>=n.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",n[r++])}return o??a}}var ue=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,a){this.localEventService||(this.localEventService=new Ct),this.localEventService.addEventListener(e,t,a)}removeEventListener(e,t,a){this.localEventService?.removeEventListener(e,t,a)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const a=[];for(const n of Object.keys(t)){const o=t[n];o&&a.push(this._setupListener(e,n,o))}return a}_setupListener(e,t,a){if(this.destroyed)return()=>null;let n;if(Um(e))e.__addEventListener(t,a),n=()=>(e.__removeEventListener(t,a),null);else{const o=jm(e);e instanceof HTMLElement?Gm(e,t,a):o?e.addListener(t,a):e.addEventListener(t,a),n=o?()=>(e.removeListener(t,a),null):()=>(e.removeEventListener(t,a),null)}return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==n),null)}setupPropertyListener(e,t){const{gos:a}=this;a.addPropertyEventListener(e,t);const n=()=>(a.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(n),()=>(n(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==n),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const a=e.join("-")+this.propertyListenerId++,n=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[a])return;this.lastChangeSetIdLookup[a]=o.changeSet.id}const r={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(r)};for(const o of e)this.setupPropertyListener(o,n)}getLocaleTextFunc(){return Or(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const a=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),a}createBean(e,t,a){return(t||this.stubContext).createBean(e,a)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Um(e){return e.__addEventListener!==void 0}function jm(e){return e.eventServiceType==="global"}var y=class extends ue{},Hr=new Set,on=(e,t)=>{Hr.has(t)||(Hr.add(t),e())};on._set=Hr;var Ym={pending:!1,funcs:[]},Km={pending:!1,funcs:[]};function fo(e,t="setTimeout",a){const n=t==="raf"?Km:Ym;if(n.funcs.push(e),n.pending)return;n.pending=!0;const o=()=>{const r=n.funcs.slice();n.funcs.length=0,n.pending=!1;for(const i of r)i()};t==="raf"?Qe(a,o):window.setTimeout(o,0)}function te(e,t,a){let n;return function(...o){const r=this;return window.clearTimeout(n),n=window.setTimeout(function(){e.isAlive()&&t.apply(r,o)},a),n}}function bc(e,t){let a=0;return function(...n){const o=this,r=Date.now();r-a<t||(a=r,e.apply(o,n))}}function wc(e,t,a,n=100){const o=Date.now();let r=null,i=!1;const l=()=>{r!=null&&(window.clearInterval(r),r=null)};e.addDestroyFunc(l);const s=()=>{const c=Date.now()-o>n;(t()||c)&&(a(),i=!0,l())};s(),i||(r=window.setInterval(s,10))}var Cc=new Set(["__proto__","constructor","prototype"]);function _m(e,t){if(e!=null){if(Array.isArray(e)){for(let a=0;a<e.length;a++)t(a.toString(),e[a]);return}for(const a of Object.keys(e).filter(n=>!Cc.has(n)))t(a,e[a])}}function he(e,t,a=!0,n=!1){z(t)&&_m(t,(o,r)=>{let i=e[o];i!==r&&(n&&i==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(i={},e[o]=i),yc(r)&&yc(i)&&!Array.isArray(i)?he(i,r,a,n):(a||r!==void 0)&&(e[o]=r))})}function yc(e){return typeof e=="object"&&e!==null}var Nr=class wt{static applyGlobalGridOptions(t){if(!wt.gridOptions)return{...t};let a={};return he(a,wt.gridOptions,!0,!0),wt.mergeStrategy==="deep"?he(a,t,!0,!0):a={...a,...t},wt.gridOptions.context&&(a.context=wt.gridOptions.context),t.context&&(wt.mergeStrategy==="deep"&&a.context&&he(t.context,a.context,!0,!0),a.context=t.context),a}static applyGlobalGridOption(t,a){if(wt.mergeStrategy==="deep"){const n=Vr(t);if(n&&typeof n=="object"&&typeof a=="object")return wt.applyGlobalGridOptions({[t]:a})[t]}return a}};Nr.gridOptions=void 0,Nr.mergeStrategy="shallow";var rn=Nr;function Qm(e,t="shallow"){rn.gridOptions=e,rn.mergeStrategy=t}function Vr(e){return rn.gridOptions?.[e]}var kc={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",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:1e3,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},Sc="https://www.ag-grid.com";function St(e,t,...a){e.get("debug")&&console.log("AG Grid: "+t,...a)}function Jt(e,...t){on(()=>Rc(e,...t),e+t?.join(""))}function xa(e,...t){on(()=>xc(e,...t),e+t?.join(""))}function xc(e,...t){console.error("AG Grid: "+e,...t)}function Rc(e,...t){console.warn("AG Grid: "+e,...t)}var Ec=new Set,mo={},Xt={},vo,Fc=!1,Mc=!1,zc=!1;function Zm(e){const[t,a]=e.version.split(".")||[],[n,o]=vo.split(".")||[];return t===n&&a===o}function Jm(e){vo||(vo=e.version);const t=n=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${n} Please update all modules to the same version.`;e.version?Zm(e)||xa(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${vo}.`)):xa(t(`'${e.moduleName}' is incompatible.`));const a=e.validate?.();a&&!a.isValid&&xa(`${a.message}`)}function Ra(e,t,a=!1){a||(Fc=!0),Jm(e);const n=e.rowModels??["all"];Ec.add(e);let o;t!==void 0?(Mc=!0,Xt[t]===void 0&&(Xt[t]={}),o=Xt[t]):o=mo;for(const r of n)o[r]===void 0&&(o[r]={}),o[r][e.moduleName]=e;if(e.dependsOn)for(const r of e.dependsOn)Ra(r,t,a)}function Xm(e){delete Xt[e]}function Gr(e,t,a){const n=o=>!!mo[o]?.[e]||!!Xt[t]?.[o]?.[e];return n(a)||n("all")}function qr(){return Mc}function $m(e,t){const a=Xt[e]??{};return[...Object.values(mo.all??{}),...Object.values(a.all??{}),...Object.values(mo[t]??{}),...Object.values(a[t]??{})]}function ev(){return new Set(Ec)}function tv(e,t){const a=Xt[e]??{};return[...Object.values(a.all??{}),...Object.values(a[t]??{})]}function av(){return Fc}function Wr(){return zc}function Dc(){zc=!0}var Ur=class{static register(e){Ra(e,void 0)}static registerModules(e){for(const t of e)Ra(t,void 0)}};function Ac(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const a=Ac(t.dependsOn);if(a)return a}}}var F="35.2.1",Pc=2e3,Ic=100,Tc="_version_",Lc=null,Ea=`${Sc}/javascript-data-grid`;function nv(e){Lc=e}function ov(e){Ea=e}function Bc(e,t,a){return Lc?.(e,t)??[sv(e,t,a)]}function bo(e,t,a,n,o){e(`${n?"warning":"error"} #${t}`,...Bc(t,a,o))}function rv(e){if(!e)return String(e);const t={};for(const a of Object.keys(e))typeof e[a]!="object"&&typeof e[a]!="function"&&(t[a]=e[a]);return JSON.stringify(t)}function iv(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=rv(e)),t}function wo(e){return e===void 0?"undefined":e===null?"null":e}function jr(e,t){return`${e}?${t.toString()}`}function lv(e,t,a){const n=Array.from(t.entries()).sort((r,i)=>i[1].length-r[1].length);let o=jr(e,t);for(const[r,i]of n){if(r===Tc)continue;const l=o.length-a;if(l<=0)break;const s="...",c=l+s.length,d=i.length-c>Ic?i.slice(0,i.length-c)+s:i.slice(0,Ic)+s;t.set(r,d),o=jr(e,t)}return o}function Oc(e,t){const a=new URLSearchParams;if(a.append(Tc,F),t)for(const r of Object.keys(t))a.append(r,iv(t[r]));const n=`${Ea}/errors/${e}`,o=jr(n,a);return o.length<=Pc?o:lv(n,a,Pc)}var sv=(e,t,a)=>{const n=Oc(e,t),o=`${a?a+`
13336
13336
  `:""}Visit ${n}`;return Wr()?o:`${o}${a?"":`
13337
13337
  Alternatively register the ValidationModule to see the full message in the console.`}`};function R(...e){bo(Jt,e[0],e[1],!0)}function G(...e){bo(xa,e[0],e[1],!1)}function ln(e,t,a){bo(xa,e,t,!1,a)}function cv(e,t,a){bo(Jt,e,t,!0,a)}function Hc(e,t){const a=t[0];return`error #${a} `+Bc(a,t[1],e).join(" ")}function Ve(...e){return Hc(void 0,e)}function dv(...e){return Hc(`
13338
- `,e)}function Nc(e,t){return e.get("rowModelType")===t}function $(e,t){return Nc(e,"clientSide")}function Fa(e,t){return Nc(e,"serverSide")}function se(e,t){return e.get("domLayout")===t}function xt(e){return gn(e)!==void 0}function Yr(e){return typeof e.get("getRowHeight")=="function"}function gv(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Vc({gos:e,formula:t}){const a=e.get("rowNumbers");return a||!!t?.active&&a!==!1}function ct(e,t,a=!1,n){const{gos:o,environment:r}=e;if(n==null&&(n=r.getDefaultRowHeight()),Yr(o)){if(a)return{height:n,estimated:!0};const s={node:t,data:t.data},c=o.getCallback("getRowHeight")(s);if(Kr(c))return c===0&&R(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&o.get("masterDetail"))return uv(o);const i=o.get("rowHeight");return{height:i&&Kr(i)?i:n,estimated:!1}}function uv(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Kr(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Rt(e){const{environment:t,gos:a}=e,n=a.get("rowHeight");if(!n||K(n))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(R(24),t.getDefaultRowHeight())}function Kr(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Gc(e,t,a){const n=t[e.getDomDataKey()];return n?n[a]:void 0}function $t(e,t,a,n){const o=e.getDomDataKey();let r=t[o];K(r)&&(r={},t[o]=r),r[a]=n}function ea(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function _r(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||se(e,"print"))}function Ze(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function sn(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function Qr(e){return e.get("grandTotalRow")}function hv(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function qc(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function Wc(e){return qc(e)&&e.get("groupHideColumnsUntilExpanded")&&$(e)}function Zr(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function Jr(e,t,a){return!!t.group&&!t.footer&&Zr(e,a)}function ta(e){const t=e.getCallback("getRowId");return t===void 0?t:a=>{let n=t(a);return typeof n!="string"&&(on(()=>R(25,{id:n}),"getRowIdString"),n=String(n)),n}}function Uc(e,t){const a=e.get("groupHideParentOfSingleChild");return!!(a===!0||a==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function jc(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function pv(e,t){const a=e.get("suppressGroupChangesColumnVisibility");if(a===!0||t&&a==="suppressHideOnGroup"||!t&&a==="suppressShowOnUngroup")return!1;const n=e.get("suppressRowGroupHidesColumns");if(t&&n===!0)return!1;const o=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&o===!0)}function aa(e){return e?.checkboxes??!0}function cn(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function dn(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function Xr(e){return e?.hideDisabledCheckboxes??!1}function Yc(e){return typeof e.get("rowSelection")!="string"}function fv(e){return e.get("cellSelection")!==void 0}function mv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Je(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function vv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function na(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function Kc(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const a=e.get("suppressRowClickSelection"),n=e.get("suppressRowDeselection");return a&&n?!1:a?"enableDeselection":n?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function bv(e){const t=Kc(e);return t===!0||t==="enableSelection"}function wv(e){const t=Kc(e);return t===!0||t==="enableDeselection"}function Co(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function gn(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Ma(e){return gn(e)==="multiRow"}function Cv(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function un(e){const t=e.get("rowSelection");if(typeof t=="string"){const a=e.get("groupSelectsChildren"),n=e.get("groupSelectsFiltered");return a&&n?"filteredDescendants":a?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function _c(e,t=!0){const a=e.get("rowSelection");return typeof a!="object"?t?"all":void 0:a.mode==="multiRow"?a.selectAll:"all"}function yv(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function za(e){const t=un(e);return t==="descendants"||t==="filteredDescendants"}function Qc(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function Zc(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Ce(e){return e.get("columnMenu")==="legacy"}function Jc(e){return!Ce(e)}function Xc(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function kv(e,t,a){typeof e!="object"&&(e={});const n={...e};for(const o of a){const r=t[o];typeof r<"u"&&(n[o]=r)}return n}function Sv(e,t){if(!e)return;const a={};let n=!1;for(const i of Object.keys(e))a[i]=e[i],n=!0;if(!n)return;const o={type:"gridOptionsChanged",options:a};t.dispatchEvent(o);const r={type:"componentStateChanged",...a};t.dispatchEvent(r)}function I(e,t){return e.addCommon(t)}function xv(e,t){return e[t]??e.gridOptions?.[t]??Vr(t)??kc[t]}function $c({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var Rv={resizable:!0,sortable:!0},Ev=0;function ed(){return Ev++}function dt(e){return e instanceof gt}var Fv=["asc","desc",null],Mv=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],gt=class extends y{constructor(e,t,a,n){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=a,this.primary=n,this.isColumn=!0,this.instanceId=ed(),this.autoHeaderHeight=null,this.sortDef=ze(),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 Ct,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=va(a)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:a,colFlex:n}}=this;t?.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,a?.initCol(this),n?.initCol(this)}setColDef(e,t,a){const n=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),n&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",a)}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(){const{gos:e,colDef:{field:t,tooltipField:a}}=this,n=e.get("suppressFieldDotNotation");this.fieldContainsDots=z(t)&&t.includes(".")&&!n,this.tooltipFieldContainsDots=z(a)&&a.includes(".")&&!n}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:a=>{const n=e.recreateColDef(this.colDef);this.setColDef(n,n,a.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!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(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const a=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,a)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,a)}createColumnFunctionCallbackParams(e){return I(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Rv[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const a=this.createColumnFunctionCallbackParams(e);return t(a)}return!1}createColumnEvent(e,t){return I(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){return this.sortDef.direction?this.sortDef:null}getColDefAllowedSortTypes(){const e=[],{sort:t,initialSort:a}=this.colDef,n=t===null?t:Xe(t?.type),o=a===null?a:Xe(a?.type);return n&&e.push(n),o&&e.push(o),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?Mv:Fv;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(t=>ze(t))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((t,a)=>(a.direction&&t.push(a.type),t),this.getColDefAllowedSortTypes());return new Set(e)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(e,t=!1){t||(this._wasSortExplicitlyRemoved=!e.direction),this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return K(this.getSort())}isSorting(){return z(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(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return R(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const a=e===!0;this.visible!==a&&(this.visible=a,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let a=!0;for(;e;){if(!e.isPadding()){a=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:a}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return I(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(K(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.colSpan(t);return Math.max(a,1)}getRowSpan(e){if(K(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.rowSpan(t);return Math.max(a,1)}setActualWidth(e,t,a=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),a||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>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(e,t,a){const n=this.createColumnEvent(e,t);a&&he(n,a),this.colEventSvc.dispatchEvent(n)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function ze(e){return Da(e)?{direction:e.direction,type:e.type}:{direction:pn(e),type:Xe(e)}}function ut(e){return e==="asc"||e==="desc"||e===null}function yo(e){return e==="default"||e==="absolute"}function Da(e){if(!e||typeof e!="object")return!1;const t=e;return yo(t.type)&&ut(t.direction)}function hn(e,t){return e?t?e.type===t.type&&e.direction===t.direction:e?e.direction===null:!0:t?t.direction===null:!0}function pn(e){return ut(e)?e:null}function Xe(e){return yo(e)?e:"default"}function td(e,t,a){const o=a?.()??t.sortSvc.getDisplaySortForColumn(e),r=Xe(o?.type),i=pn(o?.direction),l=e.getAvailableSortTypes(),s=l.has("default"),c=l.has("absolute");return{isDefaultSortAllowed:s,isAbsoluteSortAllowed:c,isAbsoluteSort:r==="absolute",isDefaultSort:r==="default",isAscending:i==="asc",isDescending:i==="desc",direction:i}}function de(e){return e instanceof Aa}var Aa=class extends y{constructor(e,t,a,n){super(),this.colGroupDef=e,this.groupId=t,this.padding=a,this.level=n,this.isColumn=!1,this.expandable=!1,this.instanceId=ed(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)dt(t)?e(t):de(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)dt(t)?e.push(t):de(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,a=!1;const n=this.findChildrenRemovingPadding();for(let r=0,i=n.length;r<i;r++){const l=n[r];if(!l.isVisible())continue;const s=l.getColumnGroupShow();s==="open"?(e=!0,a=!0):s==="closed"?(t=!0,a=!0):(e=!0,t=!0)}const o=e&&t&&a;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=a=>{for(const n of a)de(n)&&n.isPadding()?t(n.children):e.push(n)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},zv={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function $r(e,t,a){const n={},o=e.gos;return Object.assign(n,o.get("defaultColGroupDef")),Object.assign(n,t),o.validateColDef(n,a),n}var ad=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=$n(e);let a=0;for(;;){let n=e??t;if(n?a!==0&&(n+="_"+a):n=a,!this.existingKeys[n]){const o=String(n);return e&&a>0&&R(273,{providedId:e,usedId:o}),this.existingKeys[o]=!0,o}a++}}},nd=(e,t)=>{de(e)&&e.setupExpandable(),e.originalParent=t};function Dv(e,t=null,a,n,o){const{existingCols:r,existingGroups:i}=rd(n),l=new Map(r.map(f=>[f.getId(),f])),s=new Map(i.map(f=>[f.getId(),f]));let c=0;const d=(f,m)=>{if(c=Math.max(c,m),sd(f)){if(!e.colGroupSvc)return null;const k=f.groupId,S=s.get(k),x=$r(e,f,k),M=new Aa(x,k,!1,m);return e.context.createBean(M),S&&M.setExpanded(S.isExpanded()),M.setChildren(f.children.map(L=>d(L,m+1))),M}const v=f.colId;let b=l.get(v);const w=fn(e,f,b?.getColId()??v);return b?(b.setColDef(w,f,o),ei(e,b,w,o)):(b=new gt(w,f,v,a),e.context.createBean(b)),e.dataTypeSvc?.addColumnListeners(b),b},g=t?.map(f=>d(f,0))??[];let u=0;const h={getUniqueKey:(f,m)=>String(++u)},p=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(g,0,c,h):g;return $e(null,p,nd),{columnTree:p,treeDepth:c}}function od(e,t=null,a,n,o){const r=new ad,{existingCols:i,existingGroups:l,existingColKeys:s}=rd(n);r.addExistingKeys(s);const c=id(e,t,0,a,i,r,l,o),{colGroupSvc:d}=e,g=d?.findMaxDepth(c,0)??0,u=d?d.balanceColumnTree(c,0,g,r):c;return $e(null,u,nd),{columnTree:u,treeDepth:g}}function rd(e){const t=[],a=[],n=[];return e&&$e(null,e,o=>{if(de(o)){const r=o;a.push(r)}else{const r=o;n.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:a,existingColKeys:n}}function id(e,t,a,n,o,r,i,l){if(!t)return[];const{colGroupSvc:s}=e,c=new Array(t.length);for(let d=0;d<c.length;d++){const g=t[d];s&&sd(g)?c[d]=s.createProvidedColumnGroup(n,g,a,o,r,i,l):c[d]=Av(e,n,g,o,r,l)}return c}function Av(e,t,a,n,o,r){const i=Pv(a,n);i&&n?.splice(i.idx,1);let l=i?.column;if(l){const s=fn(e,a,l.getColId());l.setColDef(s,a,r),ei(e,l,s,r)}else{const s=o.getUniqueKey(a.colId,a.field),c=fn(e,a,s);l=new gt(c,a,s,t),e.context.createBean(l)}return e.dataTypeSvc?.addColumnListeners(l),l}function ld(e,t,a,n,o,r,i,l){const{sortSvc:s,pinnedCols:c,colFlex:d}=e;a!==void 0&&t.setVisible(!a,l),s&&(s.updateColSort(t,n,l),o!==void 0&&s.setColSortIndex(t,o)),r!==void 0&&c?.setColPinned(t,r),i!==void 0&&d?.setColFlex(t,i)}function ei(e,t,a,n){ld(e,t,a.hide,a.sort,a.sortIndex,a.pinned,a.flex,n);const o=t.getFlex();if(!(o!=null&&o>0))if(a.width!=null)t.setActualWidth(a.width,n);else{const r=t.getActualWidth();t.setActualWidth(r,n)}}function Pv(e,t){if(t)for(let a=0;a<t.length;a++){const n=t[a].getUserProvidedColDef();if(!n)continue;if(e.colId!=null){if(t[a].getId()===e.colId)return{idx:a,column:t[a]};continue}if(e.field!=null){if(n.field===e.field)return{idx:a,column:t[a]};continue}if(n===e)return{idx:a,column:t[a]}}}function fn(e,t,a,n){const{gos:o,dataTypeSvc:r}=e,i={},l=o.get("defaultColDef");he(i,l,!1,!0);const s=Iv(e,i,t,a);s&&Tv(e,s,i);const c=i.cellDataType;he(i,t,!1,!0),c!==void 0&&(i.cellDataType=c);const d=o.get("autoGroupColumnDef"),g=Ze(o);return t.rowGroup&&d&&g&&he(i,{sort:d.sort,initialSort:d.initialSort},!1,!0),r?.postProcess(i),r?.validateColDef(i,t,l,a),o.validateColDef(i,a,n),i}function Iv(e,t,a,n){const o=e.dataTypeSvc?.updateColDefAndGetColumnType(t,a,n),r=a.type??o??t.type;return t.type=r,r?Ro(r):void 0}function Tv(e,t,a){if(!t.length)return;const n=Object.assign({},zv),o=e.gos.get("columnTypes")||{};for(const r of Object.keys(o)){const i=o[r];r in n?R(34,{key:r}):(i.type&&R(35),n[r]=i)}for(const r of t){const i=n[r.trim()];i?he(a,i,!1,!0):R(36,{t:r})}}function sd(e){return e.children!==void 0}function $e(e,t,a){if(t)for(let n=0;n<t.length;n++){const o=t[n];de(o)&&$e(o,o.getChildren(),a),a(o,e)}}var ht="ag-Grid-AutoColumn",ko="ag-Grid-SelectionColumn",So="ag-Grid-RowNumbersColumn",Lv="ag-Grid-HierarchyColumn";function ti(e){const t=[],a=n=>{for(let o=0;o<n.length;o++){const r=n[o];dt(r)?t.push(r):de(r)&&a(r.getChildren())}};return a(e),t}function pt(e){return e.reduce((t,a)=>t+a.getActualWidth(),0)}function mn(e,t,a){const n={};if(!t)return;$e(null,t,r=>{n[r.getInstanceId()]=r}),a&&$e(null,a,r=>{n[r.getInstanceId()]=null});const o=Object.values(n).filter(r=>r!=null);e.context.destroyBeans(o)}function xo(e){return e.getId().startsWith(ht)}function ft(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(ko)??!1}function pe(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(So)??!1}function cd(e){return ft(e)||pe(e)}function Ro(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function dd(e,t){return lt(e,t,(a,n)=>a.getColId()===n.getColId())}function gd(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function oa(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Pa(e,t){return e===t||e.colId==t||e.getColDef()===t}var Bv=(e,t)=>(a,n)=>{const o={value1:void 0,value2:void 0};let r=!1;return e&&(e[a]!==void 0&&(o.value1=e[a],r=!0),z(n)&&e[n]!==void 0&&(o.value2=e[n],r=!0)),!r&&t&&(t[a]!==void 0&&(o.value1=t[a]),z(n)&&t[n]!==void 0&&(o.value2=t[n])),o};function ud(e,t){const a={...e,sort:void 0,colId:t},n=ai(e);return n&&(a.sort=n.direction,a.sortType=n.type),a}function ai(e){const{sort:t,initialSort:a}=e,n=Da(t)||ut(t),o=Da(a)||ut(a);return n?ze(t):o?ze(a):null}function hd(e,t){return e+"_"+t}function ee(e){return e instanceof Ia}var Ia=class extends y{constructor(e,t,a,n){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=a,this.pinned=n,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=va(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return hd(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){for(const e of this.displayedChildren)ee(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=j(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;for(const t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(const t of this.displayedChildren)t.isResizable()&&(e=!0);return e}getMinWidth(){let e=0;for(const t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(const t of this.displayedChildren??[])dt(t)?e.push(t):ee(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])dt(t)?e.push(t):ee(t)&&t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e?.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(const a of this.children??[]){if(ee(a)&&!a.displayedChildren?.length)continue;switch(a.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(a);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(a);break;default:this.displayedChildren.push(a);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},C={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"},Ov=65,Hv=67,Nv=86,Vv=68,Gv=90,qv=89;function pd(e){const{keyCode:t}=e;let a;switch(t){case Ov:a=C.A;break;case Hv:a=C.C;break;case Nv:a=C.V;break;case Vv:a=C.D;break;case Gv:a=C.Z;break;case qv:a=C.Y;break;default:a=e.code}return a}function Wv(e){return typeof e.then=="function"}function Uv(e,t){return new Q(a=>{a(window.setInterval(e,t))})}var Q=class Xn{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(a=>this.onDone(a),a=>this.onReject(a))}static all(t){return t.length?new Xn(a=>{let n=t.length;const o=new Array(n);t.forEach((r,i)=>{r.then(l=>{o[i]=l,n--,n===0&&a(o)})})}):Xn.resolve()}static resolve(t=null){return new Xn(a=>a(t))}then(t){return new Xn(a=>{this.status===1?a(t(this.resolution)):this.waiters.push(n=>a(t(n)))})}onDone(t){this.status=1,this.resolution=t;for(const a of this.waiters)a(t)}onReject(t){}},fd=class extends ue{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(e,t=!1){const a={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:n=>this.onDragStart(e,n),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(a),this.beans.dragSvc.addDragSource(a)}setDragImageCompIcon(e,t=!1){const a=this.dragImageComp;a&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,a.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:a}=this;for(let n=0,o=t.length;n<o;n++)if(t[n].dragSource===e){const r=t[n];a.dragSvc?.removeDragSource(r),t.splice(n,1);break}}destroy(){const{dragSourceAndParamsList:e,dropTargets:t,beans:a}=this,n=a.dragSvc;for(const o of e)n?.removeDragSource(o);e.length=0,t.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){const e=this.lastMouseEvent;e&&this.onDragging(e,!0)}onDragStart(e,t){this.lastMouseEvent=t,this.dragSource=e,this.dragItem=e.getDragItem();const a=e.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=t.clientX-a.left,this.dragInitialSourcePointerOffsetY=t.clientY-a.top,e.onDragStarted?.(),this.createAndUpdateDragImageComp(e)}onDragStop(e){const{dragSource:t,lastDropTarget:a}=this;if(t?.onDragStopped?.(),a){const n=this.dropTargetEvent(a,e,!1);a.onDragStop?.(n)}this.clearDragAndDropProperties()}onDragCancel(){const{dragSource:e,lastDropTarget:t,lastMouseEvent:a}=this;if(e?.onDragCancelled?.(),t&&a){const n=this.dropTargetEvent(t,a,!1);t.onDragCancel?.(n)}this.clearDragAndDropProperties()}onDragging(e,t=!1){this.positionDragImageComp(e);const a=this.findCurrentDropTarget(e),{lastDropTarget:n,dragSource:o,dragItem:r}=this;let i=!1;if(a!==n){if(i=!0,n){const l=this.dropTargetEvent(n,e,t);n.onDragLeave?.(l)}if(n!==null&&!a?this.handleExit(o,r):n===null&&a&&this.handleEnter(o,r),a){const l=this.dropTargetEvent(a,e,t);a.onDragEnter?.(l)}this.lastDropTarget=a}else if(a){const l=this.dropTargetEvent(a,e,t);a.onDragging?.(l),l?.changed&&(i=!0)}this.lastMouseEvent=e,i&&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(e){const t=e.getContainer(),a=e.getSecondaryContainers?.(),n=a?.length;if(!n)return[[t]];const o=new Array(n+1);o[0]=[t];for(let r=0;r<n;++r)o[r+1]=a[r];return o}isMouseOnDropTarget(e,t){const a=this.getAllContainersFromDropTarget(t);let n=!1;const o=(l,s)=>{for(const c of s){const{width:d,height:g,left:u,right:h,top:p,bottom:f}=c.getBoundingClientRect();if(d===0||g===0)return!1;const m=l.clientX>=u&&l.clientX<h,v=l.clientY>=p&&l.clientY<f;if(!m||!v)return!1}return!0};for(const l of a)if(o(e,l)){n=!0;break}const{eElement:r,type:i}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(r)?!1:n&&t.isInterestedIn(i,r)}findCurrentDropTarget(e){const t=[],a=this.dropTargets;for(let i=0,l=a.length;i<l;++i){const s=a[i];this.isMouseOnDropTarget(e,s)&&t.push(s)}const n=t.length;if(n===0)return null;if(n===1)return t[0];const r=Ie(this.beans).elementsFromPoint(e.clientX,e.clientY);for(let i=0,l=r.length;i<l;++i){const s=r[i];for(let c=0,d=t.length;c<d;c++){const g=t[c],u=this.getAllContainersFromDropTarget(g);let h=!1;for(let p=0,f=u.length;p<f&&!h;p++){const m=u[p];for(let v=0,b=m.length;v<b;v++)if(m[v]===s){h=!0;break}}if(h)return g}}return null}addDropTarget(e){this.dropTargets.push(e),e.external&&this.externalDropZoneCount++}removeDropTarget(e){const t=e.getContainer(),a=this.dropTargets;let n=0;for(let o=0,r=a.length;o<r;++o){const i=a[o];if(i.getContainer()===t){i.external&&--this.externalDropZoneCount;continue}n!==o&&(a[n]=i),++n}a.length=n}hasExternalDropZones(){return this.externalDropZoneCount>0}findExternalZone(e){const t=this.dropTargets;for(let a=0,n=t.length;a<n;++a){const o=t[a];if(o.external&&o.getContainer()===e)return o}return null}dropTargetEvent(e,t,a){const{dragSource:n,dragItem:o,lastDraggingEvent:r,lastMouseEvent:i,dragInitialSourcePointerOffsetX:l,dragInitialSourcePointerOffsetY:s}=this,c=e.getContainer(),d=c.getBoundingClientRect(),{clientX:g,clientY:u}=t,h=g-(i?.clientX||0),p=u-(i?.clientY||0),f=this.createEvent({event:t,x:g-d.left,y:u-d.top,vDirection:p>0?"down":p<0?"up":null,hDirection:h<0?"left":h>0?"right":null,initialSourcePointerOffsetX:l,initialSourcePointerOffsetY:s,dragSource:n,fromNudge:a,dragItem:o,dropZoneTarget:c,dropTarget:r?.dropTarget??null,changed:!!r?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&pc(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(e.getGui()?.remove(),this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then(a=>{const n=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!n||!this.isAlive()){this.destroyBean(a);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const o=this.dragImageComp;o!==a&&(this.dragImageComp=a,this.removeDragImageComp(o)),a&&(this.appendDragImageComp(a),this.updateDragImageComp(),this.positionDragImageComp(n))})}appendDragImageComp(e){const t=e.getGui(),a=t.style;a.position="absolute",a.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(a.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),a.top="20px",a.left="20px";const n=ao(this.beans);n?n.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:a,lastDraggingEvent:n,dragImageLastLabel:o}=this;if(!e)return;this.setDragImageCompIcon(a?.getIconName?.(n)??null);let r=t?.dragItemName;typeof r=="function"&&(r=r(n)),r||(r=""),o!==r&&(this.dragImageLastLabel=r,e.setLabel(r))}};function md(e){return typeof e=="object"&&!!e.component}function jv(e){return e?e.prototype&&"getGui"in e.prototype:!1}function vd(e,t,a,n){const{name:o}=a;let r,i,l,s,c,d;if(t){const g=t,u=g[o+"Selector"],h=u?u(n):null,p=f=>{typeof f=="string"?r=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?l=f:i=f)};h?(p(h.component),s=h.params,c=h.popup,d=h.popupPosition):p(g[o])}return{compName:r,jsComp:i,fwComp:l,paramsFromSelector:s,popupFromSelector:c,popupPositionFromSelector:d}}var Yv=class extends y{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,a,n=!1){return this.getCompDetails(this.gridOptions,e,t,a,n)}getCompDetails(e,t,a,n,o=!1){const{name:r,cellRenderer:i}=t;let{compName:l,jsComp:s,fwComp:c,paramsFromSelector:d,popupFromSelector:g,popupPositionFromSelector:u}=vd(this.beans.frameworkOverrides,e,t,n),h,p;const f=w=>{const k=this.registry.getUserComponent(r,w);k&&(s=k.componentFromFramework?void 0:k.component,c=k.componentFromFramework?k.component:void 0,h=k.params,p=k.processParams)};if(l!=null&&f(l),s==null&&c==null&&a!=null&&f(a),s&&i&&!jv(s)&&(s=this.agCompUtils?.adaptFunction(t,s)),!s&&!c){const{validation:w}=this.beans;o&&(l!==a||!a)?l?w?.isProvidedUserComp(l)||G(50,{compName:l}):a?w||G(260,{...this.gos.getModuleErrorParams(),propName:r,compName:a}):G(216,{name:r}):a&&!w&&G(146,{comp:a});return}const m=this.mergeParams(e,t,n,d,h,p),v=s==null,b=s??c;return{componentFromFramework:v,componentClass:b,params:m,type:t,popupFromSelector:g,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(b,v,m,t)}}newAgStackInstance(e,t,a,n){const o=!t;let r;o?r=new e:r=this.frameworkCompWrapper.wrap(e,n.mandatoryMethods,n.optionalMethods,n),this.createBean(r);const i=r.init?.(a);return i==null?Q.resolve(r):i.then(()=>r)}mergeParams(e,t,a,n=null,o,r){const i={...a,...o},s=e?.[t.name+"Params"];if(typeof s=="function"){const c=s(a);he(i,c)}else typeof s=="object"&&he(i,s);return he(i,n),r?r(i):i}},Kv={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},_v={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Qv={name:"headerComponent",optionalMethods:["refresh"]},Zv={name:"innerHeaderComponent"},Jv={name:"innerHeaderGroupComponent"},Xv={name:"headerGroupComponent"},$v={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},eb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},tb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"]},ab={name:"loadingCellRenderer",cellRenderer:!0},nb={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},ob={name:"tooltipComponent"},ni={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},rb={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},ib={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},lb={name:"loadingCellRenderer",cellRenderer:!0},sb={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},cb={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function db(e,t){return e.getCompDetailsFromGridOptions(_v,"agDragAndDropImage",t,!0)}function gb(e,t,a){return e.getCompDetails(t,$v,void 0,a)}function ub(e,t,a){return e.getCompDetails(t,Qv,"agColumnHeader",a)}function hb(e,t,a){return e.getCompDetails(t,Zv,void 0,a)}function pb(e,t){const a=t.columnGroup.getColGroupDef();return e.getCompDetails(a,Xv,"agColumnGroupHeader",t)}function fb(e,t,a){return e.getCompDetails(t,Jv,void 0,a)}function mb(e,t){return e.getCompDetailsFromGridOptions(ib,void 0,t,!0)}function vb(e,t){return e.getCompDetailsFromGridOptions(lb,"agLoadingCellRenderer",t,!0)}function bb(e,t){return e.getCompDetailsFromGridOptions(sb,"agGroupRowRenderer",t,!0)}function wb(e,t){return e.getCompDetailsFromGridOptions(cb,"agDetailCellRenderer",t,!0)}function oi(e,t,a){return e.getCompDetails(t,eb,void 0,a)}function Cb(e,t,a){return e.getCompDetails(t,tb,void 0,a)}function bd(e,t,a){return e.getCompDetails(t,ab,"agSkeletonCellRenderer",a,!0)}function wd(e,t,a){return e.getCompDetails(t,nb,"agCellEditor",a,!0)}function Cd(e,t,a,n){const o=t.filter;return md(o)&&(t={filter:o.component,filterParams:t.filterParams}),e.getCompDetails(t,ni,n,a,!0)}function yb(e,t,a){return e.getCompDetails(t,Kv,"agDateInput",a,!0)}function kb(e,t){return e.getCompDetails(t.colDef,ob,"agTooltipComponent",t,!0)}function yd(e,t,a,n){return e.getCompDetails(t,rb,n,a)}function kd(e,t){return vd(e,t,ni)}function ri(e,t,a){return e.mergeParams(t,ni,a)}var Sd=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Sd||{}),Sb=class extends fd{createEvent(e){return I(this.gos,e)}createDragImageComp(e){const{gos:t,beans:a}=this;return db(a.userCompFactory,I(t,{dragSource:e}))?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){R(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const a={getContainer:e,isInterestedIn:n=>n===1||n===0,getIconName:()=>"notAllowed"};this.addDropTarget(a),t.addDestroyFunc(()=>this.removeDropTarget(a))}};function ii(e){return!!e.operator}var xd="ag-resizer-wrapper",Et=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),xb={tag:"div",cls:xd,children:[Et("eTopLeft","topLeft"),Et("eTop","top"),Et("eTopRight","topRight"),Et("eRight","right"),Et("eBottomRight","bottomRight"),Et("eBottom","bottom"),Et("eBottomLeft","bottomLeft"),Et("eLeft","left")]},Rd=class extends ue{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:a}=this.offsetParent,n=a/2-this.getWidth()/2,o=t/2-this.getHeight()/2;this.offsetElement(n,o,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:a,minWidth:n,width:o,minHeight:r,height:i,x:l,y:s}=this.config;this.offsetParent||this.setOffsetParent();let c=0,d=0;const g=Me(this.element);if(g){const u=this.findBoundaryElement(),h=window.getComputedStyle(u);if(h.minWidth!=null){const p=u.offsetWidth-this.element.offsetWidth;d=Number.parseInt(h.minWidth,10)-p}if(h.minHeight!=null){const p=u.offsetHeight-this.element.offsetHeight;c=Number.parseInt(h.minHeight,10)-p}}if(this.minHeight=r||c,this.minWidth=n||d,o&&this.setWidth(o),i&&this.setHeight(i),(!o||!i)&&this.refreshSize(),t)this.center(e);else if(l||s)this.offsetElement(l,s,e);else if(g&&a){let u=this.boundaryEl,h=!0;if(u||(u=this.findBoundaryElement(),h=!1),u){const p=Number.parseFloat(u.style.top),f=Number.parseFloat(u.style.left);h?this.offsetElement(Number.isNaN(f)?0:f,Number.isNaN(p)?0:p,e):this.setPosition(f,p)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const a=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(a),this.moveElementDragListener=a):(this.dragSvc?.removeDragSource(a),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const a=!!e[t],n=this.getResizerElement(t),o={dragStartPixels:0,eElement:n,onDragStart:r=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:r=>this.onResizeEnd(r,t)};(a||!this.isAlive()&&!a)&&(a?(this.dragSvc?.addDragSource(o),this.resizeListeners.push(o),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=a)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,a=this.element;let n=!1;if(typeof e=="string"&&e.includes("%"))an(a,e),e=Pr(a),n=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(n?(a.style.maxHeight="unset",a.style.minHeight="unset"):t?an(a,e):(a.style.height=`${e}px`,a.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:a}=this.offsetParent;if(!a)return null;const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:n.top,i=e?0:o.top;let l=0;if(t){const c=this.element.parentElement;if(c){const{bottom:d}=c.getBoundingClientRect();l=d-n.bottom}}return a+i-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:a}=this.config;let n=!1;if(typeof e=="string"&&e.includes("%"))Ne(t,e),e=$a(t),n=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=a?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(n?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Ne(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,a){const{forcePopupParentAsOffsetParent:n}=this.config,o=n?this.boundaryEl:this.element;o&&(this.popupSvc?.positionPopup({ePopup:o,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:a}),this.setPosition(Number.parseFloat(o.style.left),Number.parseFloat(o.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const a=this.getAvailableHeight();this.element.style.setProperty("max-height",`${a}px`)};e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=st(this.beans,this.popupSvc?.getPopupParent(),t)):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:a,isTop:n,anywhereWithin:o,topBuffer:r}=e,i=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,s=this.shouldSkipX(t,!!a,!!o,i)?0:i,c=this.shouldSkipY(t,!!n,r,l)?0:l;return{movementX:s,movementY:c}}shouldSkipX(e,t,a,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let s=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=i.right;return s?!0:(t?s=n<0&&e.clientX>l+r.left||n>0&&e.clientX<l+r.left:a?s=n<0&&e.clientX>i.right||n>0&&e.clientX<l+r.left:s=n<0&&e.clientX>i.right||n>0&&e.clientX<i.right,s)}shouldSkipY(e,t,a=0,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let s=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=i.bottom;return s?!0:(t?s=n<0&&e.clientY>l+r.top+a||n>0&&e.clientY<l+r.top:s=n<0&&e.clientY>i.bottom||n>0&&e.clientY<i.bottom,s)}createResizeMap(){const e=t=>({element:this.element.querySelector(`[data-ref=${t}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild(yt(xb)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${xd}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:a,forcePopupParentAsOffsetParent:n}=this.config;!a&&!n&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(a=>!a.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,a=0;for(const n of e){const o=!!n.style.flex&&n.style.flex!=="0 0 auto";if(n===this.element)continue;let r=this.minHeight||0,i=this.minWidth||0;if(o){const l=window.getComputedStyle(n);l.minHeight&&(r=Number.parseInt(l.minHeight,10)),l.minWidth&&(i=Number.parseInt(l.minWidth,10))}else r=n.offsetHeight,i=n.offsetWidth;t+=r,a+=i}return{height:t,width:a}}applySizeToSiblings(e){let t=null;const a=this.getSiblings();if(a){for(let n=0;n<a.length;n++){const o=a[n];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=a[n+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:a}=this.config,{isTop:n,isRight:o,isBottom:r,isLeft:i}=this.currentResizer,l=o||i,s=r||n,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:i,isTop:n}),g=this.position.x,u=this.position.y;let h=0,p=0;if(l&&c){const f=i?-1:1,m=this.getWidth(),v=m+c*f;let b=!1;i&&(h=m-v,(g+h<=0||v<=this.minWidth)&&(b=!0,h=0)),b||this.setWidth(v)}if(s&&d){const f=n?-1:1,m=this.getHeight(),v=m+d*f;let b=!1;n?(p=m-v,(u+p<=0||v<=this.minHeight)&&(b=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&m<v&&this.getMinSizeOfSiblings().height+v>this.element.parentElement.offsetHeight&&(b=!0),b||this.setHeight(v)}this.updateDragStartPosition(e.clientX,e.clientY),((t||a)&&h||p)&&this.offsetElement(g+h,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:a}=this.position;let n;this.config.calculateTopBuffer&&(n=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:n});this.offsetElement(t+o,a+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Ed=class extends Rd{},E=null;function li(e){return typeof e?.getGui=="function"}var si=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.includes(" ")){const n=(e||"").split(" ");if(n.length>1){for(const o of n)this.toggleCss(o,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}},Rb=0,ra=class extends ue{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Rb++,this.cssManager=new si(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(a=>[a.selector,a])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(dc):null}applyElementsToComponent(e,t,a,n=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===E)this[t]=n??e;else{const r=a?.[t];if(!this.suppressDataRefValidation&&!r)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){const a=[];for(const n of e.childNodes??[])a.push(n);for(const n of a){if(!(n instanceof HTMLElement))continue;const o=this.createComponentFromElement(n,r=>{const i=r.getGui();if(i)for(const l of n.attributes??[])i.setAttribute(l.name,l.value)},t);if(o){if(o.addItems&&n.children.length){this.createChildComponentsFromTags(n,t);const r=Array.prototype.slice.call(n.children);o.addItems(r)}this.swapComponentForNode(o,e,n)}else n.childNodes&&this.createChildComponentsFromTags(n,t)}}createComponentFromElement(e,t,a){const n=e.nodeName,o=this.getDataRefAttribute(e),r=n.indexOf("AG-")===0,i=r?this.componentSelectors.get(n):null;let l=null;if(i){const s=a&&o?a[o]:void 0;l=new i.component(s),l.setParentComponent(this),this.createBean(l,null,t)}else if(r)throw new Error(`selector: ${n}`);return this.applyElementsToComponent(e,o,a,l),l}swapComponentForNode(e,t,a){const n=e.getGui();t.replaceChild(n,a),t.insertBefore(document.createComment(a.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const a=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const n of e)n.setAttribute("tabindex",a.toString())}setTemplate(e,t,a){let n;typeof e=="string"||e==null?n=co(e):n=yt(e),this.setTemplateFromElement(n,t,a)}setTemplateFromElement(e,t,a,n=!1){if(this.eGui=e,this.suppressDataRefValidation=n,t)for(let o=0;o<t.length;o++){const r=t[o];this.componentSelectors.set(r.selector,r)}this.wireTemplate(e,a)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let a=t;return e==null?null:(a||(a=this.eGui),uo(e)?{element:e,parent:a}:{element:e.getGui(),parent:a})}prependChild(e,t){const{element:a,parent:n}=this.getContainerAndElement(e,t)||{};!a||!n||n.prepend(a)}appendChild(e,t){const{element:a,parent:n}=this.getContainerAndElement(e,t)||{};!a||!n||n.appendChild(a)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:a}=t;nc(this.eGui,e,{skipAriaHidden:a})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:a}=t;W(this.eGui,e,{skipAriaHidden:a});const n={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(n)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,a){this.eGui.addEventListener(e,t,a),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===Fd?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=Fd}},Fd=Symbol(),U=class extends ra{},ci,di,gi,ui,hi,pi,fi;function mt(){return ci===void 0&&(ci=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),ci}function ia(){return di===void 0&&(di=/(firefox)/i.test(navigator.userAgent)),di}function Md(){return gi===void 0&&(gi=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),gi}function Ft(){return ui===void 0&&(ui=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),ui}function mi(e){if(!e)return null;const t=e.tabIndex,a=e.getAttribute("tabIndex");return t===-1&&(a===null||a===""&&!ia())?null:t.toString()}function Eb(){if(fi!==void 0)return fi;if(!document.body)return-1;let e=1e6;const t=ia()?6e6:1e9,a=document.createElement("div");for(document.body.appendChild(a);;){const n=e*2;if(a.style.height=n+"px",n>t||a.clientHeight!==n)break;e=n}return a.remove(),fi=e,e}function vi(){return pi==null&&zd(),pi}function zd(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let a=t.offsetWidth-t.clientWidth;a===0&&t.clientWidth===0&&(a=null),t.parentNode&&t.remove(),a!=null&&(pi=a,hi=a===0)}function Dd(){return hi==null&&zd(),hi}var bi=!1,Eo=0;function Fb(e){Eo>0||(e.addEventListener("keydown",Fo),e.addEventListener("mousedown",Fo))}function Mb(e){Eo>0||(e.removeEventListener("keydown",Fo),e.removeEventListener("mousedown",Fo))}function Fo(e){const t=bi,a=e.type==="keydown";a&&(e.ctrlKey||e.metaKey||e.altKey)||t!==a&&(bi=a)}function zb(e){const t=ne(e);return Fb(t),Eo++,()=>{Eo--,Mb(t)}}function wi(){return bi}function Mt(e,t,a=!1){const n=Tm;let o=ac;t&&(o+=", "+t),a&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(n)).filter(s=>Me(s)),i=Array.prototype.slice.apply(e.querySelectorAll(o));return i.length?((s,c)=>s.filter(d=>c.indexOf(d)===-1))(r,i):r}function zt(e,t=!1,a=!1,n=!1){const o=Mt(e,n?".ag-tab-guard":null,a),r=t?j(o):o[0];return r?(r.focus({preventScroll:!0}),!0):!1}function Dt(e,t,a,n){const o=Mt(t,a?':not([tabindex="-1"])':null),r=_(e);let i;a?i=o.findIndex(s=>s.contains(r)):i=o.indexOf(r);const l=i+(n?-1:1);return l<0||l>=o.length?null:o[l]}function Ci(e,t=5){let a=0;for(;e&&mi(e)===null&&++a<=t;)e=e.parentElement;return mi(e)===null?null:e}var Ad="ag-focus-managed",Pd=class extends ue{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},a={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=a,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:n=>{if(n.defaultPrevented)return;const o=Dt(this.beans,this.eFocusable,!1,n.shiftKey);o&&(o.focus(),n.preventDefault())},...a}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:a}}=this;e.classList.add(Ad),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),a&&this.addManagedElementListeners(e,{focusout:a})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:t=>{if(t.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(t))return;const{callbacks:a}=this;if(a.shouldStopEventPropagation(t)){this.stopPropagationCallbacks.stopPropagation(t);return}t.key===C.TAB?a.onTabKeyDown(t):a.handleKeyDown&&a.handleKeyDown(t)}})}},Id="__ag_Grid_Stop_Propagation";function At(e){e[Id]=!0}function et(e){return e[Id]===!0}var vn={isStopPropagation:et,stopPropagation:At},Ta=class extends Pd{constructor(e,t){super(e,vn,t)}},Db={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:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`};function Te(e,t,a){return fc(e,Db,t,a)}function yi(e,t){const{debounceMs:a}=e;return bn(e)?(a!=null&&R(71),0):a??t}function bn(e){return(e.buttons?.indexOf("apply")??-1)>=0}function Td(e,t,a,n){let o=Te(e,a);if(typeof t=="function"){const r=Te(e,n);o=t({filterOptionKey:n,filterOption:r,placeholder:o})}else typeof t=="string"&&(o=t);return o}var Ld=class extends U{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new Ta(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new Ed(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){const t=e,a=this.params;this.params=t;const{source:n,state:o,additionalEventAttributes:r}=t;n==="colDef"&&this.updateParams(t,a);const i=this.state;this.state=o;const l=r?.fromAction;return(l&&l!=="apply"||o.model!==i.model||!this.areStatesEqual(o.state,i.state))&&this.setModelIntoUi(o.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=bn(e),this.setupApplyDebounced()}doesFilterPass(e){R(283);const{getHandler:t,model:a,column:n}=this.params;return t().doesFilterPass({...e,model:a,handlerParams:this.beans.colFilter.getHandlerParams(n)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return R(284),this.params.model!=null}setupApplyDebounced(){const e=yi(this.params,this.defaultDebounceMs),t=te(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return R(285),this.params.model}setModel(e){R(286);const{beans:t,params:a}=this;return t.colFilter.setModelForColumnLegacy(a.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:a=!0,model:n}}=this;if(!a)return!1;const o=!this.areModelsEqual(t.model,n);return o&&t.onAction("apply",e),o}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const a=this.getModelFromUi(),n={model:a,state:this.getState(),valid:this.canApply(a)};this.state=n;const{params:o,gos:r,eventSvc:i,applyActive:l}=this;o.onStateChange(n),o.onUiChange(this.getUiChangeEventParams()),r.get("enableFilterHandlers")||i.dispatchEvent({type:"filterModified",column:o.column,filterInstance:this}),n.valid&&(e??(e=l?void 0:"debounce"),e==="immediately"?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):e==="debounce"&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:a}=this;if(!t)return;const n=e==="floatingFilter"||e==="columnFilter";n?(t.restoreLastSize(),t.setResizable(a.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(n)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Te(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||e==null&&t==null?!0:e==null||t==null?!1:this.areNonNullModelsEqual(e,t)}},Ab=["aggregation","filter","sort","pivot","columnVisibility","columnSizing","rowGroup"],Mo=class extends ra{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},wn=class extends Mo{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange(()=>e.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function Ge(e){const t=e.rowModel;return t.getType()==="clientSide"?t:void 0}function zo(e){const t=e.rowModel;return t.getType()==="infinite"?t:void 0}function Bd(e){const t=e.rowModel;return t.getType()==="serverSide"?t:void 0}function Pb(e){const t=e.rowModel;return t.getType()==="viewport"?t:void 0}var ki="row-group-",Do="t-",Ao="b-",Ib=0,vt=class{constructor(e){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=Ib++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return e!==void 0?e:this.footer?this.sibling?.groupData:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling?this.sibling:this;const{pinnedSibling:t}=e;return t&&e.rowPinned&&(e=t,e.footer&&e.sibling&&(e=e.sibling)),e}get allLeafChildren(){const e=this._leafs;return e===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){const e=this.beans.expansionSvc;return e?e.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(e){this._expanded=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const{valueCache:a,eventSvc:n}=this.beans,o=this.data;this.data=e,a?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const r=this.createDataChangedEvent(e,o,t);if(this.__localEventService?.dispatchEvent(r),this.sibling){this.sibling.data=e;const l=this.sibling.createDataChangedEvent(e,o,t);this.sibling.__localEventService?.dispatchEvent(l)}n.dispatchEvent({type:"rowNodeDataChanged",node:this});const i=this.pinnedSibling;i&&(i.data=e,i.__localEventService?.dispatchEvent(i.createDataChangedEvent(e,o,t)),n.dispatchEvent({type:"rowNodeDataChanged",node:i}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,a){return{type:"dataChanged",node:this,oldData:t,newData:e,update:a}}getRowIndexString(){return this.rowIndex==null?(G(13),null):this.rowPinned==="top"?Do+this.rowIndex:this.rowPinned==="bottom"?Ao+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:a}=this.beans,n=a?.createDaemonNode?.(this),o=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),a&&(a.updateRowSelectable(this),a.syncInRowNode(this,n));const r=this.createDataChangedEvent(e,o,!1);this.__localEventService?.dispatchEvent(r)}setId(e){const t=ta(this.beans.gos);if(t)if(this.data){const a=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:a.length>0?a:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(ki)&&G(14,{groupPrefix:ki})}else this.id=void 0;else this.id=e}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=e!==null;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,a){this.beans.expansionSvc?.setExpanded(this,e,t,a)}setDataValue(e,t,a){const{colModel:n,valueSvc:o,gos:r,editSvc:i}=this.beans;if(e==null)return!1;let l=n.getCol(e)??n.getColDefCol(e);if(!l)return!1;if(!this.group){const d=l.getColDef();d.pivotValueColumn&&(l=d.pivotValueColumn)}const s=o.getValueForDisplay({column:l,node:this,from:"data"}).value;if(r.get("readOnlyEdit")){const{beans:{eventSvc:d},data:g,rowIndex:u,rowPinned:h}=this;return d.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:u,rowPinned:h,column:l,colDef:l.colDef,data:g,node:this,oldValue:s,newValue:t,value:t,source:a}),!1}if(a!=="data"&&i&&!i.committing){const d=i.setDataValue({rowNode:this,column:l},t,a);if(d!=null)return d}const c=o.setValue(this,l,t,a);return this.dispatchCellChangedEvent(l,t,s),c&&this.pinnedSibling?.dispatchCellChangedEvent(l,t,s),c}getDataValue(e,t="data"){const{colModel:a,valueSvc:n,formula:o}=this.beans;if(e==null)return;const r=a.getCol(e)??a.getColDefCol(e);if(!r)return;const i=t==="data-raw",l=i||t==="value"?"data":t;let s=n.getValue(r,this,l,i);if(!i&&(o&&r.isAllowFormula()&&o.isFormula(s)&&(s=o.resolveValue(r,this)),t!=="data"&&r.getAggFunc()&&typeof s=="object"&&s!=null)){if(typeof s.toNumber=="function")return s.toNumber();if("value"in s)return s.value}return s}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,a){const n={type:"cellChanged",node:this,column:e,newValue:t,oldValue:a};this.__localEventService?.dispatchEvent(n)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let a=0,n=t.length;a<n;++a)t[a].depthFirstSearch(e);e(this)}getAggregatedChildren(e,t){const a=this.beans;return a.aggChildrenSvc?.getAggregatedChildren(this,a.colModel.getCol(e),t)??[]}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,a="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:a})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){(this.__localEventService??(this.__localEventService=new Ct)).addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e);const a=this.__localEventService??(this.__localEventService=new Ct);this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,a);const n=this.frameworkEventListenerService?.wrap(e,t)??t;a.addEventListener(e,n)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.removeLocalListener(e,a)}removeLocalListener(e,t){const a=this.__localEventService;a&&(a.removeEventListener(e,t),a.noRegisteredListenersExist()&&(this.__localEventService=null))}isFullWidthCell(){if(R(61),this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const e=[];let t=this;for(;t?.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged"))}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged"))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged"))}getFirstChild(){const e=this.childStore;return e?e.getFirstNode():this.childrenAfterSort?.[0]??null}_destroy(e){if(this.destroyed)return!1;this.destroyed=!0;const t=this.pinnedSibling;if(t?.rowPinned&&!this.rowPinned&&this.beans.pinnedRowModel?.pinRow(t,null),e?this.clearRowTopAndRowIndex():(this.setRowTop(null),this.setRowIndex(null)),!this.footer){const a=this.detailNode;a&&a._destroy(e);const n=this.sibling;n&&n._destroy(e)}return!0}};function Od(e,t,a){return I(t,{type:a,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var Tb=new Set(["__autoHeights","__checkAutoHeightsDebounced","__localEventService","__objectId","_groupData","_leafs","childStore","groupValue","oldRowTop","sticky","treeNodeFlags","treeParent"]),Hd=(e,t)=>{const a=new vt(t);for(const n of Object.keys(e))Tb.has(n)||(a[n]=e[n]);return a.oldRowTop=null,a},Po=(e,t,a)=>{if(!a)return;let n=a.rowIndex;if(n==null)return;n+=t;const o=e.getRowCount();for(;n>=0&&n<o;){const r=e.getRow(n);if(!r||!r.footer&&!r.detail)return r;n+=t}},Nd=class{constructor(e,t){this.beans=e,this.floating=t,this.all=new Set,this.visible=new Set,this.order=[],this.queued=new Set}size(){return this.visible.size}add(e){const{all:t,visible:a,order:n}=this;t.has(e)||(t.add(e),a.add(e),n.push(e),this.sort())}delete(e){this.all.delete(e),this.visible.delete(e),this.queued.delete(e.id),Pe(this.order,e)}has(e){return this.visible.has(e)}forEach(e){this.order.forEach(e)}getByIndex(e){return this.order[e]}getById(e){for(const t of this.visible)if(t.id==e)return t}clear(){const{all:e,visible:t,order:a,queued:n}=this;e.clear(),n.clear(),t.clear(),a.length=0}sort(){const{sortSvc:e,rowNodeSorter:t,gos:a}=this.beans,n=e?.getSortOptions()??[],o=this.order,r=Ob(o);if(o.sort((l,s)=>t?.compareRowNodes(n,l,s)||(l.pinnedSibling?.rowIndex??0)-(s.pinnedSibling?.rowIndex??0)),!r)return;const i=Qr(a);i==="bottom"||i==="pinnedBottom"?this.order.push(r):this.order.unshift(r)}hide(e){const{all:t,visible:a}=this,n=a.size;return t.forEach(o=>e(o)?a.delete(o):a.add(o)),this.order=Array.from(a),this.sort(),n!=a.size}queue(e){this.queued.add(e)}unqueue(e){this.queued.delete(e)}forEachQueued(e){this.queued.forEach(e)}};function Vd(e){if(e.level===-1)return!0;const t=e.parent;return t?.childrenAfterSort?.some(a=>a==e)?Vd(t):!1}function Si(e,t){const{gos:a,rowModel:n,filterManager:o}=e;return Fa(a,n)?!n.getRowNode(t.id):o?.isAnyFilterPresent()?!Vd(t):a.get("pivotMode")?!t.group:!1}function Lb(e){return!!e.footer&&e.level===-1}function Bb(e){return!!e.pinnedSibling&&Lb(e.pinnedSibling)}function Ob(e){const t=e.findIndex(Bb);if(t>-1)return e.splice(t,1)?.[0]}var Gd=class extends y{constructor(){super(...arguments),this.csrm=null}postConstruct(){const{gos:e,beans:t}=this;this.top=new Nd(t,"top"),this.bottom=new Nd(t,"bottom"),this.csrm=Ge(t)??null;const a=o=>Si(t,o.pinnedSibling),n=()=>{const o=e.get("isRowPinned");o&&e.get("enableRowPinning")&&t.rowModel.forEachNode(r=>this.pinRow(r,o(r)),!0),this.refreshRowPositions(),this.dispatchRowPinnedEvents()};this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this),modelUpdated:({keepRenderedRows:o})=>{this.tryToEmptyQueues(),this.pinGrandTotalRow();let r=!1;this.forContainers(l=>{r||(r=l.hide(a))});const i=this.refreshRowPositions();(!o||i||r)&&this.dispatchRowPinnedEvents()},columnRowGroupChanged:()=>{this.forContainers(Nb),this.refreshRowPositions()},rowNodeDataChanged:({node:o})=>{(e.get("isRowPinnable")?.(o)??!0)||this.pinRow(o,null)},firstDataRendered:n}),this.addManagedPropertyListener("pivotMode",()=>{this.forContainers(o=>o.hide(a)),this.dispatchRowPinnedEvents()}),this.addManagedPropertyListener("grandTotalRow",({currentValue:o})=>{this._grandTotalPinned=o==="pinnedBottom"?"bottom":o==="pinnedTop"?"top":null}),this.addManagedPropertyListener("isRowPinned",n)}destroy(){this.reset(!1),super.destroy()}reset(e=!0){this.forContainers(t=>{const a=[];t.forEach(n=>a.push(n)),a.forEach(n=>this.pinRow(n,null)),t.clear()}),e&&this.dispatchRowPinnedEvents()}pinRow(e,t,a){if(t!=null&&e.destroyed)return;if(e.footer){const i=e.level;if(i>-1)return;if(i===-1){this._grandTotalPinned=t,this.csrm?.reMapRows();return}}const n=e.rowPinned??e.pinnedSibling?.rowPinned;if(n!=null&&t!=null&&t!=n){const i=e.rowPinned?e:e.pinnedSibling,l=e.rowPinned?e.pinnedSibling:e;this.pinRow(i,null,a),this.pinRow(l,t,a);return}const r=a&&Vb(this.beans,e,a);if(r){r.forEach(i=>this.pinRow(i,t));return}if(t==null){const i=e.rowPinned?e:e.pinnedSibling,l=this.findPinnedRowNode(i);if(!l)return;l.delete(i);const s=i.pinnedSibling;xi(i),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(s)}else{const i=qd(this.beans,e,t),l=this.getContainer(t);l.add(i),Si(this.beans,e)&&l.hide(s=>Si(this.beans,s.pinnedSibling)),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(e)}}isManual(){return!0}isEmpty(e){return this.getContainer(e).size()===0}isRowsToRender(e){return!this.isEmpty(e)}ensureRowHeightsValid(){let e=!1,t=0;const a=n=>{if(n.rowHeightEstimated){const o=ct(this.beans,n);n.setRowTop(t),n.setRowHeight(o.height),t+=o.height,e=!0}};return this.bottom.forEach(a),t=0,this.top.forEach(a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}getPinnedTopTotalHeight(){return Wd(this.top)}getPinnedBottomTotalHeight(){return Wd(this.bottom)}getPinnedTopRowCount(){return this.top.size()}getPinnedBottomRowCount(){return this.bottom.size()}getPinnedTopRow(e){return this.top.getByIndex(e)}getPinnedBottomRow(e){return this.bottom.getByIndex(e)}getPinnedRowById(e,t){return this.getContainer(t).getById(e)}forEachPinnedRow(e,t){this.getContainer(e).forEach(t)}getPinnedState(){const e=t=>{const a=[];return this.forEachPinnedRow(t,n=>{const o=n.pinnedSibling?.id;o!=null&&a.push(o)}),a};return{top:e("top"),bottom:e("bottom")}}setPinnedState(e){this.forContainers((t,a)=>{for(const n of e[a]){const o=this.beans.rowModel.getRowNode(n);o?this.pinRow(o,a):t.queue(n)}})}getGrandTotalPinned(){return this._grandTotalPinned}setGrandTotalPinned(e){this._grandTotalPinned=e}tryToEmptyQueues(){this.forContainers((e,t)=>{const a=new Set;e.forEachQueued(n=>{const o=this.beans.rowModel.getRowNode(n);o&&a.add(o)});for(const n of a)e.unqueue(n.id),this.pinRow(n,t)})}pinGrandTotalRow(){const{csrm:e,beans:t,_grandTotalPinned:a}=this;if(!e)return;const n=e.rootNode?.sibling;if(!n)return;const o=n.pinnedSibling,r=o&&this.findPinnedRowNode(o);if(a){if(r&&r.floating!==a&&(xi(o),r.delete(o)),!r||r.floating!==a){const i=qd(t,n,a);this.getContainer(a).add(i)}}else{if(!r)return;xi(o),r.delete(o)}}onGridStylesChanges(e){e.rowHeightChanged&&this.forContainers(t=>t.forEach(a=>a.setRowHeight(a.rowHeight,!0)))}getContainer(e){return e==="top"?this.top:this.bottom}findPinnedRowNode(e){if(this.top.has(e))return this.top;if(this.bottom.has(e))return this.bottom}refreshRowPositions(e){const t=n=>Hb(this.beans,n);if(e)return t(this.getContainer(e));let a=!1;return this.forContainers(n=>{const o=t(n);a||(a=o)}),a}forContainers(e){e(this.top,"top"),e(this.bottom,"bottom")}dispatchRowPinnedEvents(e){this.eventSvc.dispatchEvent({type:"pinnedRowsChanged"}),e?.dispatchRowEvent("rowPinned")}};function Hb(e,t){let a=0,n=!1;return t.forEach((o,r)=>{if(n||(n=o.rowTop!==a),o.setRowTop(a),o.rowHeightEstimated||o.rowHeight==null){const i=ct(e,o).height;n||(n=o.rowHeight!==i),o.setRowHeight(i)}o.setRowIndex(r),a+=o.rowHeight}),n}function qd(e,t,a){if(t.pinnedSibling)return t.pinnedSibling;const n=Hd(t,e);n.setRowTop(null),n.setRowIndex(null),n.rowPinned=a;const o=a==="top"?Do:Ao;return n.id=`${o}${a}-${t.id}`,n.pinnedSibling=t,t.pinnedSibling=n,n}function xi(e){if(!e.pinnedSibling)return;e.rowPinned=null,e._destroy(!1);const t=e.pinnedSibling;e.pinnedSibling=void 0,t&&(t.pinnedSibling=void 0,t.rowPinned=null)}function Nb(e){const t=new Set;e.forEach(a=>{a.group&&t.add(a)}),t.forEach(a=>e.delete(a))}function Vb(e,t,a){const{rowSpanSvc:n}=e,o=(a&&n?.isCellSpanning(a,t))??!1;if(a&&o)return n?.getCellSpan(a,t)?.spannedNodes}function Wd(e){const t=e.size();if(t===0)return 0;const a=e.getByIndex(t-1);return a===void 0?0:a.rowTop+a.rowHeight}var Ud=class extends y{constructor(){super(...arguments),this.nextId=0,this.pinnedTopRows={cache:{},order:[]},this.pinnedBottomRows={cache:{},order:[]}}postConstruct(){const e=this.gos;this.setPinnedRowData(e.get("pinnedTopRowData"),"top"),this.setPinnedRowData(e.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",t=>this.setPinnedRowData(t.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",t=>this.setPinnedRowData(t.currentValue,"bottom")),this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this)})}reset(){}isEmpty(e){return this.getCache(e).order.length===0}isRowsToRender(e){return!this.isEmpty(e)}isManual(){return!1}pinRow(e,t){}onGridStylesChanges(e){if(e.rowHeightChanged){const t=a=>{a.setRowHeight(a.rowHeight,!0)};yn(this.pinnedBottomRows,t),yn(this.pinnedTopRows,t)}}ensureRowHeightsValid(){let e=!1,t=0;const a=n=>{if(n.rowHeightEstimated){const o=ct(this.beans,n);n.setRowTop(t),n.setRowHeight(o.height),t+=o.height,e=!0}};return yn(this.pinnedBottomRows,a),t=0,yn(this.pinnedTopRows,a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventSvc.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const a=this.getCache(t);if(e===void 0){a.order.length=0,a.cache={};return}const n=ta(this.gos),o=t==="top"?Do:Ao,r=new Set(a.order),i=[],l=new Set;let s=0,c=-1;for(const d of e){const g=n?.({data:d,level:0,rowPinned:t})??o+this.nextId++;if(l.has(g)){R(96,{id:g,data:d});continue}c++,l.add(g),i.push(g);const u=Cn(a,g);if(u!==void 0)u.data!==d&&u.updateData(d),s+=this.setRowTopAndRowIndex(u,s,c),r.delete(g);else{const h=new vt(this.beans);h.id=g,h.data=d,h.rowPinned=t,s+=this.setRowTopAndRowIndex(h,s,c),a.cache[g]=h,a.order.push(g)}}for(const d of r)Cn(a,d)?.clearRowTopAndRowIndex(),delete a.cache[d];a.order=i}setRowTopAndRowIndex(e,t,a){return e.setRowTop(t),e.setRowHeight(ct(this.beans,e).height),e.setRowIndex(a),e.rowHeight}getPinnedTopTotalHeight(){return jd(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return jd(this.pinnedBottomRows)}getPinnedTopRowCount(){return Ei(this.pinnedTopRows)}getPinnedBottomRowCount(){return Ei(this.pinnedBottomRows)}getPinnedTopRow(e){return Ri(this.pinnedTopRows,e)}getPinnedBottomRow(e){return Ri(this.pinnedBottomRows,e)}getPinnedRowById(e,t){return Cn(this.getCache(t),e)}forEachPinnedRow(e,t){return yn(this.getCache(e),t)}getCache(e){return e==="top"?this.pinnedTopRows:this.pinnedBottomRows}getPinnedState(){return{top:[],bottom:[]}}setPinnedState(){}getGrandTotalPinned(){}setGrandTotalPinned(){}};function jd(e){const t=Ei(e);if(t===0)return 0;const a=Ri(e,t-1);return a===void 0?0:a.rowTop+a.rowHeight}function Cn(e,t){return e.cache[t]}function Ri(e,t){return Cn(e,e.order[t])}function yn(e,t){e.order.forEach((a,n)=>{const o=Cn(e,a);o&&t(o,n)})}function Ei(e){return e.order.length}var Yd=class extends y{constructor(){super(...arguments),this.beanName="pinnedRowModel"}postConstruct(){const{gos:e}=this,t=()=>{const a=e.get("enableRowPinning"),n=Qr(e),r=!!a||(n==="pinnedBottom"||n==="pinnedTop"),i=r?this.inner instanceof Ud:this.inner instanceof Gd;this.inner&&i&&this.destroyBean(this.inner),(i||!this.inner)&&(this.inner=this.createManagedBean(r?new Gd:new Ud))};this.addManagedPropertyListeners(["enableRowPinning","grandTotalRow"],t),t()}reset(){return this.inner.reset()}isEmpty(e){return this.inner.isEmpty(e)}isManual(){return this.inner.isManual()}isRowsToRender(e){return this.inner.isRowsToRender(e)}pinRow(e,t,a){return this.inner.pinRow(e,t,a)}ensureRowHeightsValid(){return this.inner.ensureRowHeightsValid()}getPinnedRowById(e,t){return this.inner.getPinnedRowById(e,t)}getPinnedTopTotalHeight(){return this.inner.getPinnedTopTotalHeight()}getPinnedBottomTotalHeight(){return this.inner.getPinnedBottomTotalHeight()}getPinnedTopRowCount(){return this.inner.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.inner.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.inner.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.inner.getPinnedBottomRow(e)}forEachPinnedRow(e,t){return this.inner.forEachPinnedRow(e,t)}getPinnedState(){return this.inner.getPinnedState()}setPinnedState(e){return this.inner.setPinnedState(e)}setGrandTotalPinned(e){return this.inner.setGrandTotalPinned(e)}getGrandTotalPinned(){return this.inner.getGrandTotalPinned()}},Kd=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Kd||{}),Gb=500,qb=550,Io,Wb=e=>{if(!Io)Io=new WeakSet;else if(Io.has(e))return!1;return Io.add(e),!0},Pt=class{constructor(e,t=!1){this.eElement=e,this.preventClick=t,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(e,t){let a=this.eventSvc;if(!a){if(a===null)return;this.eventSvc=a=new Ct;const n=this.onTouchStart.bind(this);this.startListener=n,this.eElement.addEventListener("touchstart",n,{passive:!0})}a.addEventListener(e,t)}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t)}onTouchStart(e){if(this.touchStart||!Wb(e))return;const t=e.touches[0];this.touchStart=t;const a=this.handlers;if(!a.length){const n=this.eElement,o=n.ownerDocument,r=this.onTouchMove.bind(this),i=this.onTouchEnd.bind(this),l=this.onTouchCancel.bind(this),s={passive:!0},c={passive:!1};po(a,[n,"touchmove",r,s],[o,"touchcancel",l,s],[o,"touchend",i,c],[o,"contextmenu",kt,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{this.longPressTimer=0,this.touchStart===t&&!this.moved&&(this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e}))},qb)}onTouchMove(e){const{moved:t,touchStart:a}=this;if(!t&&a){const n=Sa(a,e.touches);n&&!hc(n,a,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&kt(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const a=this.lastTapTime;a&&t-a>Gb&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),Br(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e)),this.cancel(),this.eElement=null,this.eventSvc=null}},_d=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(_d||{}),Ub=1,Qd=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=Ub++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const a=new t;a.beanName?this.beans[a.beanName]=a:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(a)}for(const t of e.derivedBeans??[]){const{beanName:a,bean:n}=t(this);this.beans[a]=n,this.createdBeans.push(n)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const a=this.beans;for(const n of e)n.preWireBeans?.(a),n.wireBeans?.(a);for(const n of e)n.preConstruct?.();t&&e.forEach(t);for(const n of e)n.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}};function jb(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var Yb=["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"],Zd=Object.fromEntries(Yb.map((e,t)=>[e,t]));function Kb(e,t){const a=(e.beanName?Zd[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,n=(t.beanName?Zd[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return a-n}function _b(e,t){return e?.beanName==="gridDestroySvc"?-1:t?.beanName==="gridDestroySvc"?1:0}function Jd(e){const{rowIndex:t,rowPinned:a,column:n}=e;return`${t}.${a??"null"}.${n.getId()}`}function To(e,t){const a=e.column===t.column,n=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return a&&n&&o}function Xd(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(z(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}function $d(e,t){return!e&&!t?!0:!e||!t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}function Fi(e){let t=0,a;const{pinnedRowModel:n,rowModel:o,pageBounds:r}=e;return n?.getPinnedTopRowCount()?a="top":o.getRowCount()?(a=null,t=r.getFirstRow()):n?.getPinnedBottomRowCount()&&(a="bottom"),a===void 0?null:{rowIndex:t,rowPinned:a}}function Mi(e){let t,a=null;const{pinnedRowModel:n,pageBounds:o}=e,r=n?.getPinnedBottomRowCount(),i=n?.getPinnedTopRowCount();return r?(a="bottom",t=r-1):e.rowModel.getRowCount()?t=o.getLastRow():i&&(a="top",t=i-1),t===void 0?null:{rowIndex:t,rowPinned:a}}function qe(e,t){switch(t.rowPinned){case"top":return e.pinnedRowModel?.getPinnedTopRow(t.rowIndex);case"bottom":return e.pinnedRowModel?.getPinnedBottomRow(t.rowIndex);default:return e.rowModel.getRow(t.rowIndex)}}function la(e,t){const a=e.spannedRowRenderer?.getCellByPosition(t);if(a)return a;const n=e.rowRenderer.getRowByPosition(t);return n?n.getCellCtrl(t.column):null}function Qb(e,t,a){const{rowModel:n,pinnedRowModel:o}=e;let r;return r??(r=n?.getRowNode(t)),a?r??(r=o?.getPinnedRowById(t,a)):(r??(r=o?.getPinnedRowById(t,"top")),r??(r=o?.getPinnedRowById(t,"bottom"))),r}function kn(e,t,a=!1){const{rowIndex:n,rowPinned:o}=t,{pageBounds:r,pinnedRowModel:i,rowModel:l}=e;if(n===0)return o==="top"?null:o==="bottom"&&l.isRowsToRender()?{rowIndex:r.getLastRow(),rowPinned:null}:i?.isRowsToRender("top")?{rowIndex:i.getPinnedTopRowCount()-1,rowPinned:"top"}:null;if(a){const s=o?void 0:l.getRow(n);return eg(e,s,!0)??{rowIndex:n-1,rowPinned:o}}return{rowIndex:n-1,rowPinned:o}}function Zb(e,t){const{pinnedRowModel:a,rowModel:n}=e,o=a?.getPinnedTopRowCount()??0,r=n.getRowCount(),{rowPinned:i,rowIndex:l}=t;return i==="top"?l:i==="bottom"?o+r+l:o+l}function zi(e,t,a=!1){const{rowIndex:n,rowPinned:o}=t,{pageBounds:r,pinnedRowModel:i,rowModel:l}=e;if(Jb(e,t))return o==="bottom"?null:o==="top"&&l.isRowsToRender()?{rowIndex:r.getFirstRow(),rowPinned:null}:i?.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;if(a){const s=o?void 0:l.getRow(n);return eg(e,s)??{rowIndex:n+1,rowPinned:o}}return{rowIndex:n+1,rowPinned:o}}function eg(e,t,a=!1){const{gos:n,rowRenderer:o}=e;if(!t?.sticky||!_r(n))return;const r=o.getStickyTopRowCtrls(),i=o.getStickyBottomRowCtrls(),l=!i.some(g=>g.rowNode.rowIndex===t.rowIndex),s=l?r:i,c=(a?-1:1)*(l?-1:1);let d;for(let g=0;g<s.length;g++)if(s[g].rowNode.rowIndex===t.rowIndex){d=s[g+c];break}return d?{rowIndex:d.rowNode.rowIndex,rowPinned:null}:void 0}function Jb(e,t){const{rowPinned:a,rowIndex:n}=t,{pinnedRowModel:o,pageBounds:r}=e;return a==="top"?(o?.getPinnedTopRowCount()??0)-1<=n:a==="bottom"?(o?.getPinnedBottomRowCount()??0)-1<=n:r.getLastRow()<=n}function tg(e,t,a){t.addManagedElementListeners(a,{keydown:n=>{if(!n.defaultPrevented&&!ew(n)&&n.key===C.TAB){const o=n.shiftKey;Dt(e,a,!1,o)||sa(e,o)&&n.preventDefault()}}})}function ag(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}function We(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function Sn(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function sa(e,t,a=!1){const n=e.ctrlsSvc.get("gridCtrl"),o=n.focusNextInnerContainer(t);return o===!0?!0:o===!1?o:((a||!t&&!n.isDetailGrid()&&n.isFocusInsideGridBody())&&n.forceFocusOutOfContainer(t),!1)}function ng(e,t){const a=e.focusSvc,n=a.getFocusedCell();if(n&&t&&To(n,t)){const{rowIndex:o,rowPinned:r,column:i}=t;eo(e)&&a.setFocusedCell({rowIndex:o,column:i,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!wi()})}}function Xb(e,t){const a=e.getFocusableContainerName();return a==="gridBody"?t():og(e,()=>Mt(e.getGui(),".ag-tab-guard").length>0)?a:null}function og(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var rg="__ag_Grid_Skip_Focusable_Container";function $b(e){e[rg]=!0}function ew(e){return e[rg]===!0}function tw(e){return e.cols?e.cols.treeDepth+1:-1}function Le(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Di(e){const t=[],a=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const n of a){if(!n)continue;const o=n.getGroupRowCount()||0;for(let r=0;r<o;r++){const i=n.getGroupRowCtrlAtIndex(r),l=t[r];if(i){const s=aw(e,i);(l==null||s>l)&&(t[r]=s)}}}return t}function aw(e,t){let n=e.colModel.isPivotMode()?ow(e):ig(e);const o=t.getHeaderCellCtrls();for(const r of o){const{column:i}=r,l=i.getAutoHeaderHeight();l!=null&&l>n&&i.isAutoHeaderHeight()&&(n=l)}return n}function Ai(e){let a=e.colModel.isPivotMode()?nw(e):xn(e);return e.colModel.forAllCols(n=>{const o=n.getAutoHeaderHeight();o!=null&&o>a&&n.isAutoHeaderHeight()&&(a=o)}),a}function xn(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Pi(e){return e.gos.get("floatingFiltersHeight")??xn(e)}function ig(e){return e.gos.get("groupHeaderHeight")??xn(e)}function nw(e){return e.gos.get("pivotHeaderHeight")??xn(e)}function ow(e){return e.gos.get("pivotGroupHeaderHeight")??ig(e)}function rw(e,t){return e.headerRowIndex===t.headerRowIndex&&e.column===t.column}function iw(e){return e?.headerRowIndex!=null}var lg=class extends y{setComp(e,t,a){this.comp=e,this.eGui=t;const{beans:n}=this,{headerNavigation:o,touchSvc:r,ctrlsSvc:i}=n;o&&this.createManagedBean(new Ta(a,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,n),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,n)}),this.onPivotModeChanged(n),this.setupHeaderHeight();const l=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:l}),r?.mockHeaderContextMenu(this,l),i.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>Qe(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const a=Di(e).reduce((i,l)=>i+l,0),n=Ai(e);e.filterManager?.hasFloatingFilters()&&(t+=Pi(e)),t+=a,t+=n;const o=e.environment.getHeaderRowBorderWidth(),r=t+o;if(this.headerHeightWithBorder!==r){this.headerHeightWithBorder=r;const i=`${r}px`;this.comp.setHeightAndMinHeight(i)}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const a=e.visibleCols.allCols.some(n=>n.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",a)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),a=e.shiftKey,n=a!==t?"LEFT":"RIGHT",{beans:o}=this,{headerNavigation:r,focusSvc:i}=o;(r.navigateHorizontally(n,!0,e)||!a&&i.focusOverlay(!1)||sa(o,a,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:a}=this.beans;switch(e.key){case C.LEFT:t="LEFT";case C.RIGHT:{z(t)||(t="RIGHT"),a.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case C.UP:t="UP";case C.DOWN:{z(t)||(t="DOWN"),a.navigateVertically(t,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:a,beans:n}=this;!t&&a.contains(_(n))||a.contains(t)||(n.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,a){const{menuSvc:n,ctrlsSvc:o}=this.beans;if(!e&&!a||!n?.isHeaderContextMenuEnabled())return;const{target:r}=e??t;(r===this.eGui||r===o.getHeaderRowContainerCtrl()?.eViewport)&&n.showHeaderContextMenu(void 0,e,a)}},Ii=class extends U{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},lw={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"}]},sw=class extends Ii{constructor(e){super(lw,e),this.eResize=E,this.eHeaderCompWrapper=E,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const n=this.ctrl.getSelectAllGui();n&&(this.eResize.insertAdjacentElement("afterend",n),this.addDestroyFunc(()=>n.remove()))},a={setWidth:n=>e.style.width=n,toggleCss:(n,o)=>this.toggleCss(n,o),setUserStyles:n=>tn(e,n),setAriaSort:n=>n?Js(e,n):Xs(e),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(a,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(a=>this.afterCompCreated(t,a))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},cw={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"}]},dw=class extends Ii{constructor(e){super(cw,e),this.eResize=E,this.eHeaderCompWrapper=E}postConstruct(){const e=this.getGui(),t=(n,o)=>o!=null?e.setAttribute(n,o):e.removeAttribute(n),a={toggleCss:(n,o)=>this.toggleCss(n,o),setUserStyles:n=>tn(e,n),setHeaderWrapperHidden:n=>{n?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:n=>{n!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${n}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",n!=null)},setResizableDisplayed:n=>W(this.eResize,n),setWidth:n=>e.style.width=n,setAriaExpanded:n=>t("aria-expanded",n),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(a,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const a=this.getGui(),n=e.getGui();this.eHeaderCompWrapper.appendChild(n),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(a)}},gw={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"}}]}]},uw=class extends Ii{constructor(e){super(gw,e),this.eFloatingFilterBody=E,this.eButtonWrapper=E,this.eButtonShowMainFilter=E}postConstruct(){const e=this.getGui(),t={toggleCss:(a,n)=>this.toggleCss(a,n),setUserStyles:a=>tn(e,a),addOrRemoveBodyCssClass:(a,n)=>this.eFloatingFilterBody.classList.toggle(a,n),setButtonWrapperDisplayed:a=>W(this.eButtonWrapper,a),setCompDetails:a=>this.setCompDetails(a),getFloatingFilterComp:()=>this.compPromise,setWidth:a=>e.style.width=a,setMenuIcon:a=>this.eButtonShowMainFilter.appendChild(a)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()}}},hw=class extends U{constructor(e){super({tag:"div",cls:e.headerRowClass,role:"row"}),this.ctrl=e,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),wa(this.getGui(),this.ctrl.getAriaRowIndex());const t={setHeight:a=>this.getGui().style.height=a,setTop:a=>this.getGui().style.top=a,setHeaderCtrls:(a,n)=>this.setHeaderCtrls(a,n),setWidth:a=>this.getGui().style.width=a,setRowIndex:a=>wa(this.getGui(),a)};this.ctrl.setComp(t,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const a=this.headerComps;this.headerComps={};for(const n of e){const o=n.instanceId;let r=a[o];delete a[o],r==null&&(r=this.createHeaderComp(n),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}if(Object.values(a).forEach(n=>{n.getGui().remove(),this.destroyBean(n)}),t){const n=Object.values(this.headerComps);n.sort((r,i)=>{const l=r.getCtrl().column.getLeft(),s=i.getCtrl().column.getLeft();return l-s});const o=n.map(r=>r.getGui());lc(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new dw(e);break;case"filter":t=new uw(e);break;default:t=new sw(e);break}return this.createBean(t),t.setParentComponent(this),t}},Ti=class extends y{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=se(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:a}=this.beans,n=t.bodyWidth,o=t.getColsLeftWidth(),r=t.getDisplayedColumnsRightWidth();let i;e?i=n+o+r:(i=n,this.addSpacer&&(this.gos.get("enableRtl")?o:r)===0&&a.verticalScrollShowing&&(i+=a.getScrollbarWidth())),this.callback(i)}},pw=class extends y{};function Rn(e,t,a){return a&&e.addDestroyFunc(()=>t.destroyBean(a)),a??e}var Li=class extends y{constructor(e,t,a,n){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=n,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=a}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:e,colsSpanning:t}=this;return e.gos.get("enableRtl")&&t?j(t):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,a=e.get("suppressColumnMoveAnimation"),n=z(this.columnOrGroup.getOldLeft());t?.isActive()&&n&&!a?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),a=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=a,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===a&&this.setLeft(a)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:a,visibleCols:n}=this.beans;if(!se(a,"print")||e.getPinned()==="left")return t;const r=n.getColsLeftWidth();if(e.getPinned()==="right"){const i=n.bodyWidth;return r+i+t}return r+t}setLeft(e){if(z(e)&&(this.eCell.style.left=`${e}px`),ee(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&Zs(this.ariaEl,t.length)}}},fw="ag-column-first",mw="ag-column-last";function Bi(e,t,a,n){return K(e)?[]:cg(e.headerClass,e,t,a,n)}function vw(e,t,a,n){return K(e)?[]:cg(e.toolPanelClass,e,t,a,n)}function sg(e,t,a){e.toggleCss(fw,a.isColAtEdge(t,"first")),e.toggleCss(mw,a.isColAtEdge(t,"last"))}function bw(e,t,a,n){return I(t,{colDef:e,column:a,columnGroup:n})}function cg(e,t,a,n,o){if(K(e))return[];let r;if(typeof e=="function"){const i=bw(t,a,n,o);r=e(i)}else r=e;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}var ww=0,dg="headerCtrl",Oi=class extends y{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+ww++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,a,n,o){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,a,n,o),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:a}=this.beans.focusSvc.focusedHeader,n=a.getDefinition(),o=n?.suppressHeaderKeyboardEvent;if(!z(o))return!1;const r=I(this.gos,{colDef:n,column:a,headerRowIndex:t,event:e});return!!o(r)}getWrapperHasFocus(){return _(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let a;if(typeof t=="function"){const n=this.getHeaderClassParams();a=t(n)}else a=t;a&&this.comp.setUserStyles(a)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:a,compBean:n}=e,{beans:o}=this,r=g=>{if(!this.isAlive()||!n.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:f}=Qt(this.eGui),m=u+h+p+f,b=t.offsetHeight+m;if(g<5){const k=!ne(o)?.contains(t),S=b==0;if(k||S){fo(()=>r(g+1),"raf",o);return}}this.setColHeaderHeight(this.column,b)};let i=!1,l;const s=()=>{const g=this.column.isAutoHeaderHeight();g&&!i&&c(),!g&&i&&d()},c=()=>{i=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),r(0),l=st(this.beans,t,()=>r(0))},d=()=>{i=!1,l&&l(),this.comp.toggleCss("ag-header-cell-auto-height",!1),l=void 0};s(),n.addDestroyFunc(()=>d()),n.addManagedListeners(this.column,{widthChanged:()=>i&&r(0)}),n.addManagedEventListeners({sortChanged:()=>{i&&window.setTimeout(()=>r(0))}}),a&&a(s)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:a,eGui:n}=this;!e||!t||!n||(sg(e,t,a.visibleCols),Dr(n,a.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=We(this.beans);this.eGui&&we(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=_(this.beans),a=e.key===C.LEFT||e.key===C.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||a)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&pd(e)===C.C)return this.beans.clipboardSvc?.copyToClipboard();if(!a)return;const r=e.key===C.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(r)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:a}=this.beans;return a?a.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:a}=this;let n=e.key===C.LEFT!==t.get("enableRtl");const o=a.getPinned(),r=t.get("enableRtl");return o&&r!==(o==="right")&&(n=!n),(n?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case C.PAGE_DOWN:case C.PAGE_UP:case C.PAGE_HOME:case C.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=dg,{eGui:a,gos:n}=this;$t(n,a,t,this),e.addDestroyFunc(()=>$t(n,a,t,null))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,a){const n=e??t,{menuSvc:o,gos:r}=this.beans;r.get("preventDefaultOnContextMenu")&&n.preventDefault(),o?.isHeaderContextMenuEnabled(a)&&o.showHeaderContextMenu(a,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",a)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:a}=this;e.isColumn?a.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):a.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,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}},Cw=class extends Oi{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(e,t,a,n,o){this.comp=e;const{rowCtrl:r,column:i,beans:l}=this,{colResize:s,context:c,colHover:d,rangeSvc:g}=l,u=Rn(this,c,o);this.setGui(t,u),this.updateState(),this.setupWidth(u),this.setupMovingCss(u),this.setupMenuClass(u),this.setupSortableClass(u),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:n,checkMeasuringCallback:p=>this.setRefreshFunction("measuring",p),compBean:u}),this.addColumnHoverListener(u),this.setupFilterClass(u),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(u),this.setupSelectAll(u),this.setupUserComp(),this.refreshAria(),s?this.resizeFeature=u.createManagedBean(s.createResizeFeature(r.pinned,i,a,e,this)):W(a,!1),d?.createHoverFeature(u,[i],t),g?.createRangeHighlightFeature(u,i,e),u.createManagedBean(new Li(i,t,l)),u.createManagedBean(new Ta(t,{shouldStopEventPropagation:p=>this.shouldStopEventPropagation(p),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(i,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const 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(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.colDef;return I(t.gos,{colDef:a,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return ub(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:a,gos:n}=this.beans;return I(n,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!a&&(!this.openFilterEnabled||Ce(this.gos)),showColumnMenu:(r,i)=>{e?.showColumnMenu({column:this.column,buttonElement:r,positionBy:"button",onClosedCallback:i})},showColumnMenuAfterMouseClick:(r,i)=>{e?.showColumnMenu({column:this.column,mouseEvent:r,positionBy:"mouse",onClosedCallback:i})},showFilter:r=>{e?.showFilterMenu({column:this.column,buttonElement:r,containerType:"columnFilter",positionBy:"button"})},progressSort:r=>{t?.progressSort(this.column,!!r,"uiColumnSorted")},setSort:(r,i)=>{t?.setSortForColumn(this.column,ze(r),!!i,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(r,i)=>{n.assertModuleRegistered("Tooltip",3),this.setupTooltip(r,i)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const a=t.createSelectAllFeature(this.column);a&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(a),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!a&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===C.SPACE?this.selectAllFeature?.onSpaceKeyDown(e):e.key===C.ENTER?this.onEnterKeyDown(e):e.key===C.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:a,sortable:n,beans:o}=this;let r=!1;(e.ctrlKey||e.metaKey)&&(r=this.showMenuOnKeyPress(e,!0)),r||(!e.altKey&&na(a)?o.rangeSvc?.handleColumnSelection(t,e):n&&o.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const a=this.comp.getUserCompInstance();return gg(a)&&a.onMenuKeyboardShortcut(t)?(e.preventDefault(),!0):!1}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),wi()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),a=Bi(t,this.gos,this.column,null),n=this.userHeaderClasses;this.userHeaderClasses=new Set(a);for(const o of a)n.has(o)?n.delete(o):this.comp.toggleCss(o,!0);for(const o of n)this.comp.toggleCss(o,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),!(!e||!this.draggable)&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){const e=this.lookupUserCompDetails();if(!e)return;(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const a=this.column.getActualWidth();this.comp.setWidth(`${a}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const a=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",a),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,a=e===1;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",a)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:a,beans:n}=this,o=Di(this.beans),r=o.reduce((u,h)=>u+h,0)===0;if(a.toggleCss("ag-header-parent-hidden",r),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),a.toggleCss("ag-header-span-height",!1),a.toggleCss("ag-header-span-total",!1);return}const{numberOfParents:i,isSpanningTotal:l}=this.column.getColumnGroupPaddingInfo();a.toggleCss("ag-header-span-height",i>0);const s=Ai(n);if(i===0){a.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${s}px`);return}a.toggleCss("ag-header-span-total",l);const c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=o.length-c;let g=0;for(let u=0;u<d;u++)g+=o[o.length-1-u];e.style.setProperty("top",`${-g}px`),e.style.setProperty("height",`${s+g}px`)}refreshAriaSort(){let e=null;const{beans:t,column:a,comp:n,sortable:o}=this;if(o){const r=this.getLocaleTextFunc(),i=t.sortSvc?.getDisplaySortForColumn(a)??null;n.setAriaSort(wm(i)),e=r("ariaSortableColumn","Press ENTER to sort")}else n.setAriaSort();this.setAriaDescriptionProperty("sort",e)}refreshAriaMenu(){let e=null;this.menuEnabled&&(e=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu")),this.setAriaDescriptionProperty("menu",e)}refreshAriaFilterButton(){let e=null;const{openFilterEnabled:t,gos:a}=this;t&&!Ce(a)&&(e=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter")),this.setAriaDescriptionProperty("filterButton",e)}refreshAriaFiltered(){let e=null;this.column.isFilterActive()&&(e=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered")),this.setAriaDescriptionProperty("filter",e)}refreshAriaCellSelection(){let e=null;const{gos:t,column:a}=this;na(t)&&!pe(a)&&(e=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column")),this.setAriaDescriptionProperty("cellSelection",e)}setAriaDescriptionProperty(e,t){const a=this.ariaDescriptionProperties;t!=null?a.set(e,t):a.delete(e)}announceAriaDescription(){const{beans:e,eGui:t,ariaDescriptionProperties:a}=this;if(!t.contains(_(e)))return;const n=Array.from(a.keys()).sort((o,r)=>o==="filter"?-1:r.charCodeAt(0)-o.charCodeAt(0)).map(o=>a.get(o)).join(". ");e.ariaAnnounce?.announceValue(n,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=o=>this.handleMouseOverChange(o.type==="mouseenter"),a=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},n=o=>this.handleContextMenuMouseEvent(o,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:a,contextmenu:n})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return gg(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function gg(e){return typeof e?.getAnchorElementForMenu=="function"&&typeof e.onMenuKeyboardShortcut=="function"}var yw=0,Hi=class extends y{constructor(e,t,a){super(),this.rowIndex=e,this.pinned=t,this.type=a,this.instanceId=yw++,this.comp=null,this.allCtrls=[];let n="ag-header-row-column";a==="group"?n="ag-header-row-group":a==="filter"&&(n="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${n}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=se(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.allCtrls.every(e=>e.eGui!=null):!1}setComp(e,t,a=!0){this.comp=e,t=Rn(this,this.beans.context,t),a&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),a=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:a,virtualColumnsChanged:n=>this.onVirtualColumnsChanged(n.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",a),e.addManagedPropertyListener("ensureDomOrder",n=>this.isEnsureDomOrder=n.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=se(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=Di(this.beans);for(let o=0;o<t.length;o++){if(o===this.rowIndex&&this.type==="group")return{topOffset:e,rowHeight:t[o]};e+=t[o]}const a=Ai(this.beans);if(this.type==="column")return{topOffset:e,rowHeight:a};e+=a;const n=Pi(this.beans);return{topOffset:e,rowHeight:n}}onVirtualColumnsChanged(e=!1){if(!this.comp)return;const t=this.getUpdatedHeaderCtrls(),a=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,a,e)}getUpdatedHeaderCtrls(){const e=this.ctrlsById;this.ctrlsById=new Map;const t=this.getColumnsInViewport();for(const n of t)this.recycleAndCreateHeaderCtrls(n,this.ctrlsById,e);const a=n=>{const{focusSvc:o,visibleCols:r}=this.beans;return o.isHeaderWrapperFocused(n)?r.isVisible(n.column):!1};if(e)for(const[n,o]of e)a(o)?this.ctrlsById.set(n,o):this.destroyBean(o);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,a){if(e.isEmptyGroup())return;const n=e.getUniqueId();let o;if(a&&(o=a.get(n),a.delete(n)),o&&o.column!=e&&(this.destroyBean(o),o=void 0),o==null)switch(this.type){case"filter":{o=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break}case"group":o=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:o=this.createBean(new Cw(e,this));break}t.set(n,o)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){return this.type==="group"?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const a=this.allCtrls.find(o=>o.column==e);return a?a.focus(t):!1}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},ug=class extends y{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:a,ctrlsSvc:n,colModel:o,colMoves:r}=this.beans;this.setupCenterWidth(),a?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(r,this.eViewport);const i=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:i,advancedFilterEnabledChanged:i});const l=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;n.register(l,this),o.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:a,visibleCols:n}=this.beans;let o=0;const r=t.getFocusHeaderToUseAfterRefresh(),i=()=>{const g=n.headerGroupRowCount;o=g,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const u=this.groupsRowCtrls.length;if(u!==g){if(u>g){for(let h=g;h<u;h++)this.destroyBean(this.groupsRowCtrls[h]);this.groupsRowCtrls.length=g;return}for(let h=u;h<g;h++){const p=this.createBean(new Hi(h,this.pinned,"group"));this.groupsRowCtrls.push(p)}}},l=()=>{const g=o++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}this.columnsRowCtrl==null||!e?(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new Hi(g,this.pinned,"column"))):this.columnsRowCtrl.rowIndex!==g&&this.columnsRowCtrl.setRowIndex(g)},s=()=>{this.includeFloatingFilter=!!a?.hasFloatingFilters()&&!this.hidden;const g=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){g();return}e||g();const u=o++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==u&&this.filtersRowCtrl.setRowIndex(u):this.filtersRowCtrl=this.createBean(new Hi(u,this.pinned,"filter"))},c=this.getAllCtrls();i(),l(),s();const d=this.getAllCtrls();this.comp.setCtrls(d),this.restoreFocusOnHeader(t,r),c.length!==d.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=a=>a?.getHeaderCellCtrls().find(n=>n.column===e);if(dt(e))return t(this.columnsRowCtrl);if(this.groupsRowCtrls.length!==0)for(let a=0;a<this.groupsRowCtrls.length;a++){const n=t(this.groupsRowCtrls[a]);if(n)return n}}getHtmlElementForColumnHeader(e){return this.getHeaderCtrlForColumn(e)?.eGui??null}getRowType(e){return this.getAllCtrls()[e]?.type}focusHeader(e,t,a){const o=this.getAllCtrls()[e];return o?o.focusHeader(t,a):!1}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}destroy(){this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl),this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls),super.destroy()}setupDragAndDrop(e,t){const a=e?.createBodyDropTarget(this.pinned,t);a&&this.createManagedBean(a)}restoreFocusOnHeader(e,t){if(!t)return;const{column:a}=t;a.getPinned()==this.pinned&&e.focusHeaderPosition({headerPosition:t,scroll:!1})}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Ti(e=>this.comp.setCenterWidth(`${e}px`),!0))}},kw={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},Sw={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},xw={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},Ni=class extends U{constructor(e){super(),this.eCenterContainer=E,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:a=>this.setDisplayed(a),setCtrls:a=>this.setCtrls(a),setCenterWidth:a=>this.eCenterContainer.style.width=a,setViewportScrollLeft:a=>this.getGui().scrollLeft=a,setPinnedContainerWidth:a=>{const n=this.getGui();n.style.width=a,n.style.maxWidth=a,n.style.minWidth=a}};this.createManagedBean(new ug(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",a=e?kw:t?Sw:xw;this.setTemplate(a),this.eRowContainer=this.eCenterContainer!==E?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let a;const n=o=>{const r=o.getGui();r.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(r),a&&ic(this.eRowContainer,r,a),a=r};for(const o of e){const r=o.instanceId,i=t[r];delete t[r];const l=i||this.createBean(new hw(o));this.headerRowComps[r]=l,this.rowCompsList.push(l),n(l)}for(const o of Object.values(t))this.destroyRowComp(o)}},Rw={tag:"div",cls:"ag-header",role:"presentation"},Ew=class extends U{constructor(){super(Rw)}postConstruct(){const e={toggleCss:(n,o)=>this.toggleCss(n,o),setHeightAndMinHeight:n=>{this.getGui().style.height=n,this.getGui().style.minHeight=n}};this.createManagedBean(new lg).setComp(e,this.getGui(),this.getFocusableElement());const a=n=>{this.createManagedBean(n),this.appendChild(n)};a(new Ni("left")),a(new Ni(null)),a(new Ni("right"))}},Fw={selector:"AG-HEADER-ROOT",component:Ew},Ue={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Vi=class extends y{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},a=t.autoHeight?Ue.AUTO_HEIGHT:t.print?Ue.PRINT:Ue.NORMAL;this.view.updateLayoutClasses(a,t)}},hg=class extends U{constructor(e,t){super(),this.direction=t,this.eViewport=E,this.eContainer=E,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",Md()||Ft())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Dd(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),a=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:a,touchend:a})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),Qe(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(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(e){const t=this.eViewport;wc(this,()=>Me(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},Mw={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"}]},pg=class extends hg{constructor(){super(Mw,"horizontal"),this.eLeftSpacer=E,this.eRightSpacer=E,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new Ti(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const a=!this.enableRtl&&e,n=this.scrollVisibleSvc.getScrollbarWidth();a&&(t+=n),Ne(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=n);let o=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(o+=n),Ne(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=n)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,a=this.gos.get("suppressHorizontalScroll"),n=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,r=a?0:n===0&&t?16:n,i=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),an(this.getGui(),r),an(this.eViewport,r),an(this.eContainer,r),r||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(i,100):i()}getScrollPosition(){return so(this.eViewport,this.enableRtl)}setScrollPosition(e){Me(this.eViewport)||this.attemptSettingScrollPosition(e),en(this.eViewport,e,this.enableRtl)}},zw={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:pg},fg=class extends y{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,a=t!=null?`${t}px`:"";this.eContainer.style.height=a,this.eViewport&&(this.eViewport.style.height=a)}},Dw={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"}]}]},mg=class extends hg{constructor(){super(Dw,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new fg(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,a=this.invisibleScrollbar,n=t&&e.getScrollbarWidth()||0,o=n===0&&a?16:n;this.toggleCss("ag-scrollbar-invisible",a),Ne(this.getGui(),o),Ne(this.eViewport,o),Ne(this.eContainer,o),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const a=e.getGridBodyCtrl().eBodyViewport,n=this.getScrollPosition(),o=a.scrollTop;n!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){!t&&!Me(this.eViewport)&&this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},Aw={selector:"AG-FAKE-VERTICAL-SCROLL",component:mg},vg=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(vg||{}),It="Viewport",bg="fakeVScrollComp",Gi=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],wg=100,qi=150,Pw=class extends y{constructor(e){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=e,this.resetLastHScrollDebounced=te(this,()=>this.lastScrollSource[1]=null,qi),this.resetLastVScrollDebounced=te(this,()=>this.lastScrollSource[0]=null,qi)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,a=>{this.centerRowsCtrl=a.center,this.fakeVScrollComp=a.fakeVScrollComp,this.fakeHScrollComp=a.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,It)});for(const e of Gi){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?te(this,this.onVScroll.bind(this,It),wg):this.onVScroll.bind(this,It),a=e?te(this,this.onVScroll.bind(this,bg),wg):this.onVScroll.bind(this,bg);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,a)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...Gi,It]){if(this.lastScrollSource[1]===t)continue;const a=this.getViewportForSource(t);en(a,e,this.enableRtl)}}getViewportForSource(e){return e===It?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.eViewport,{scrollLeft:a}=t;if(this.shouldBlockScrollUpdate(1,a,!0))return;const n=so(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(n),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;const t=e===It?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let a=t;if(this.shouldBlockScrollUpdate(0,a,!0))return;e===It?this.fakeVScrollComp.setScrollPosition(a):(this.eBodyViewport.scrollTop=t,a=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),a!==t&&this.fakeVScrollComp.setScrollPosition(a,!0));const{animationFrameSvc:n}=this;n?.setScrollTop(a),this.nextScrollTop=a,n?.active?n.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.fakeHScrollComp.getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},qi)}shouldBlockScrollUpdate(e,t,a=!1){return a&&!Ft()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=lo(this.eBodyViewport),{scrollHeight:a}=this.eBodyViewport;return e<0||e+t>a}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:a}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>a}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const a of Gi)if(this.getViewportForSource(a).scrollLeft!==e){t=!0;break}t&&this.onHScroll(It)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const n=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl?e=e>0?0:n:e=Math.min(Math.max(e,0),n)),en(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:a,lastScrollTop:n}=this;return{top:n,bottom:n+a}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){const{rowModel:a}=this.beans,n=a.getRowCount();let o=-1;for(let r=0;r<n;r++){const i=a.getRow(r);if(typeof e=="function"){if(i&&e(i)){o=r;break}}else if(e===i||e===i.data){o=r;break}}o>=0&&this.ensureIndexVisible(o,t)}ensureIndexVisible(e,t,a=0){if(se(this.gos,"print"))return;const{rowModel:n}=this.beans,o=n.getRowCount();if(typeof e!="number"||e<0||e>=o){R(88,{index:e});return}this.clearRetryListeners();const{frameworkOverrides:r,pageBounds:i,rowContainerHeight:l,rowRenderer:s}=this.beans;r.wrapIncoming(()=>{const c=this.ctrlsSvc.getGridBodyCtrl(),d=n.getRow(e);let g,u,h=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:p,stickyBottomHeight:f}=c,m=d.rowTop,v=d.rowHeight,b=i.getPixelOffset(),w=d.rowTop-b,k=w+d.rowHeight,S=this.getVScrollPosition(),x=l.divStretchOffset,M=S.top+x,L=S.bottom+x,O=L-M,H=l.getScrollPositionForPixel(w),B=l.getScrollPositionForPixel(k-O),Y=Math.min((H+B)/2,w),q=M+p>w,ge=L-f<k;let re=null;t==="top"?re=H-p:t==="bottom"?re=B+f:t==="middle"?re=Y:q?re=H-p:ge&&(B-H>O?re=H-p:re=B+f),re!==null&&(this.setVerticalScrollPosition(re),s.redraw({afterScroll:!0})),g=m!==d.rowTop||v!==d.rowHeight,u=p!==c.stickyTopHeight||f!==c.stickyBottomHeight,h++}while((g||u)&&h<10);if(this.animationFrameSvc?.flushAllFrames(),a<10&&(d?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const p=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{const f=this.getVScrollPosition().top;p!==f&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),!(e>=n.getRowCount())&&this.ensureIndexVisible(e,t,a+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:a,frameworkOverrides:n}=this.beans,o=a.getCol(e);if(!o||o.isPinned()||!this.visibleCols.isColDisplayed(o))return;const r=this.getPositionedHorizontalScroll(o,t);n.wrapIncoming(()=>{r!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(r),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:a,columnAfterEnd:n}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),i=this.enableRtl;let l=(i?a:n)||o,s=i?n:a;t!=="auto"&&(l=t==="start",s=t==="end");const c=t==="middle";if(l||s||c){const{colLeft:d,colMiddle:g,colRight:u}=this.getColumnBounds(e);return c?g-r/2:l?i?u:d:i?d-r:u-r}return null}isColumnOutsideViewport(e){const{start:t,end:a}=this.getViewportBounds(),{colLeft:n,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,i=r?t>o:a<o,l=r?a<n:t>n;return{columnBeforeStart:i,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,a=this.visibleCols.bodyWidth,n=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,i=t?a-o:o,l=i+n*r,s=i+n/2*r;return{colLeft:i,colMiddle:s,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),a=t,n=e+t;return{start:a,end:n,width:e}}},Cg={horizontal:{overflow:e=>e.scrollWidth-e.clientWidth,scrollSize:e=>e.scrollWidth,clientSize:e=>e.clientWidth,opposite:"vertical"},vertical:{overflow:e=>e.scrollHeight-e.clientHeight,scrollSize:e=>e.scrollHeight,clientSize:e=>e.clientHeight,opposite:"horizontal"}};function Iw(e,t,a=vi()||0,n,o){return yg(e,t,"horizontal",a,n,o)}function Tw(e,t,a=vi()||0,n,o){return yg(e,t,"vertical",a,n,o)}function yg(e,t,a,n,o,r){const i=Cg[a],l=Cg[i.opposite],s=o?Me(o):!0,c=r?Me(r):!0,d=i.overflow(e);if(d<=0)return!1;if(!t||n===0)return!0;const g=l.overflow(t);if(g<=0)return!0;if(d<=n){if(s&&c&&Lw({candidateOverflow:g,candidateScrollSize:l.scrollSize(t),candidateClientSize:l.clientSize(t),scrollbarWidth:n}))return!1;const u=i.clientSize(e)+n;return i.scrollSize(e)<=u}return!0}function Lw({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:a,scrollbarWidth:n}){if(e<=0||e>n)return!1;const o=a+n;return t>a&&t<=o}var Bw=class extends y{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:a}=this,n=()=>{Qe(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(n),a.registerBodyViewportResizeListener(n)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const a=this.centerContainerCtrl.getCenterWidth();a!==this.centerWidth&&(this.centerWidth=a,t?.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(){const e=this.gridBodyCtrl.eBodyViewport,t=lo(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const{centerContainerCtrl:e,beans:t}=this,a=e.getCenterWidth(),n=e.getViewportScrollLeft();t.colViewport.setScrollPosition(a,n)}};function Wi(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}function En(e,t,a,n){const o=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return kg(e,t,a,n,o)}function Ow(e,t,a,n){const o=t?.suppressMouseEventHandling;return kg(e,void 0,a,n,o)}function kg(e,t,a,n,o){return o?o(I(e,{column:t,node:a,event:n})):!1}function Sg(e,t,a){let n=t;for(;n;){const o=Gc(e,n,a);if(o)return o;n=n.parentElement}return null}var Lo="cellCtrl";function Bo(e,t){return Sg(e,t,Lo)}var Oo="renderedRow";function xg(e,t){return Sg(e,t,Oo)}function Ui(e,t,a,n,o){const r=n?n.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const i=I(e,{event:t,editing:o,column:n,node:a,data:a.data,colDef:n.getColDef()});return!!(r&&r(i))}function Rg(e){const{pinnedRowModel:t,rowModel:a,rangeSvc:n,visibleCols:o}=e;if(!n||o.allCols.length===0)return;const r=t?.isEmpty("top")??!0,i=t?.isEmpty("bottom")??!0,l=r?null:"top";let s,c;i?(s=null,c=a.getRowCount()-1):(s="bottom",c=t?.getPinnedBottomRowCount()??-1),n.setCellRange({rowStartIndex:0,rowStartPinned:l,rowEndIndex:c,rowEndPinned:s})}var Hw=class extends y{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";ho("pointerdown")?e="pointerdown":ho("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const a of t){const n=this.processMouseEvent.bind(this,a);this.addManagedElementListeners(this.element,{[a]:n})}}processMouseEvent(e,t){if(!nn(this.beans,t)||et(t))return;const{cellCtrl:a,rowCtrl:n}=this.getControlsForEventTarget(t.target);e==="contextmenu"?(a?.column&&a.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,n,a)):(a&&a.onMouseEvent(e,t),n&&n.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Bo(t,e),rowCtrl:xg(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:a,rowCtrl:n}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(a?this.processCellKeyboardEvent(a,e,t):n?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,e,t))}processCellKeyboardEvent(e,t,a){const n=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;!Ui(this.gos,a,e.rowNode,e.column,n)&&t==="keydown"&&(!n&&this.beans.navigation?.handlePageScrollingKey(a)||e.onKeyDown(a),this.doGridOperations(a,n),Wi(a)&&e.processCharacter(a)),t==="keydown"&&this.eventSvc.dispatchEvent(e.createEvent(a,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,a){const{rowNode:n}=e,{focusSvc:o,navigation:r}=this.beans,l=o.getFocusedCell()?.column;if(!Ui(this.gos,a,n,l,!1)){const c=a.key;if(t==="keydown")switch(c){case C.PAGE_HOME:case C.PAGE_END:case C.PAGE_UP:case C.PAGE_DOWN:r?.handlePageScrollingKey(a,!0);break;case C.LEFT:case C.RIGHT:if(!this.gos.get("embedFullWidthRows"))break;case C.UP:case C.DOWN:e.onKeyboardNavigate(a);break;case C.TAB:e.onTabKeyDown(a);break;default:}}t==="keydown"&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",a))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!nn(this.beans,e))return;const a=pd(e),{clipboardSvc:n,undoRedo:o}=this.beans;if(a===C.A)return this.onCtrlAndA(e);if(a===C.C)return this.onCtrlAndC(n,e);if(a===C.D)return this.onCtrlAndD(n,e);if(a===C.V)return this.onCtrlAndV(n,e);if(a===C.X)return this.onCtrlAndX(n,e);if(a===C.Y)return this.onCtrlAndY(o);if(a===C.Z)return this.onCtrlAndZ(o,e)}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:a,selectionSvc:n},gos:o}=this;a&&Je(o)&&!yv(o)&&t.isRowsToRender()?Rg(this.beans):n&&n.selectAllRowNodes({source:"keyboardSelectAll",selectAll:_c(o)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){!this.gos.get("undoRedoCellEditing")||!e||(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Ho=e=>e.topRowCtrls,No=e=>e.getStickyTopRowCtrls(),Vo=e=>e.getStickyBottomRowCtrls(),Go=e=>e.bottomRowCtrls,qo=e=>e.allRowCtrls,ji=e=>e.getCtrls("top"),Yi=e=>e.getCtrls("center"),Ki=e=>e.getCtrls("bottom"),Nw={center:{type:"center",name:"center-cols",getRowCtrls:qo,getSpannedRowCtrls:Yi},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:qo,getSpannedRowCtrls:Yi},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:qo,getSpannedRowCtrls:Yi},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:qo},topCenter:{type:"center",name:"floating-top",getRowCtrls:Ho,getSpannedRowCtrls:ji},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Ho,getSpannedRowCtrls:ji},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Ho,getSpannedRowCtrls:ji},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Ho},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:No},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:No},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:No},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:No},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Vo},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Vo},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Vo},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Vo},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:Go,getSpannedRowCtrls:Ki},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Go,getSpannedRowCtrls:Ki},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Go,getSpannedRowCtrls:Ki},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:Go}};function _i(e){return`ag-${La(e).name}-viewport`}function Qi(e){const t=La(e);return t.container??`ag-${t.name}-container`}function Eg(e){return`ag-${La(e).name}-spanned-cells-container`}function La(e){return Nw[e]}var Vw=["topCenter","topLeft","topRight"],Gw=["bottomCenter","bottomLeft","bottomRight"],qw=["center","left","right"],Ww=["center","left","right","fullWidth"],Uw=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],jw=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Yw=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Fg=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Mg=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],Kw=[...Fg,"stickyTopFullWidth",...Mg,"stickyBottomFullWidth"],_w=[...Vw,...Gw,...qw,...Fg,...Mg],zg=class extends y{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=La(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new Bw(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,a,n){this.comp=e,this.eContainer=t,this.eSpannedContainer=a,this.eViewport=n,this.createManagedBean(new Hw(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:o,rangeSvc:r}=this.beans,i=()=>this.onPinnedWidthChanged();this.forContainers(jw,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:i})}),this.forContainers(Yw,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:i})}),this.forContainers(Ww,()=>this.createManagedBean(new fg(this.eContainer,this.name==="center"?n:void 0))),r&&this.forContainers(_w,()=>this.createManagedBean(r.createDragListenerFeature(this.eContainer))),this.forContainers(Uw,()=>this.createManagedBean(new Ti(l=>this.comp.setContainerWidth(`${l}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,a=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:a,displayedColumnsWidthChanged:a,displayedRowsChanged:n=>this.onDisplayedRowsChanged(n.afterScroll)}),a(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const n=this.options.getSpannedRowCtrls(e);n&&this.comp.setSpannedRowCtrls(n,!1)}})}listenOnDomOrder(){if(Kw.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const a=this.gos.get("ensureDomOrder"),n=se(this.gos,"print");this.comp.setDomOrder(a||n)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=a=>{e.dragging&&a.cancelable&&a.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),a=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,a,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return ka(this.eViewport)}getCenterViewportScrollLeft(){return so(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=st(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return rc(this.eViewport)}getViewportScrollLeft(){return so(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:a}=this,n=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:o}=e,r=o.getGridBodyCtrl()?.eBodyViewport,i=o.get("fakeHScrollComp")?.getGui(),l=o.get("fakeVScrollComp")?.getGui();return n||Iw(a,r,void 0,i,l)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){en(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const a=se(this.gos,"print"),o=this.gos.get("embedFullWidthRows")||a,r=t.filter(i=>{const l=i.isFullWidth();return this.options.fullWidth?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}},Dg="ag-force-vertical-scroll",Qw="ag-selectable",Zw="ag-column-moving",Ag=class extends y{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,a,n,o,r,i){this.comp=e,this.eGridBody=t,this.eBodyViewport=a,this.eTop=n,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=i,this.eCenterColsViewport=a.querySelector(`.${_i("center")}`),this.eFullWidthContainer=a.querySelector(`.${Qi("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new Vi(this.comp)),this.scrollFeature=this.createManagedBean(new Pw(a)),this.beans.rowDragSvc?.setupRowDrag(a,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([n,a,o,r,i]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(n),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),a=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:a,rowResizeEnded:a}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t=e.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const a=t&&e.getScrollbarWidth()||0,n=Dd()?16:0,o=`calc(100% + ${a+n}px)`;Qe(this.beans,()=>this.comp.setBodyViewportWidth(o)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:a}=this;let n=a.get("treeData");if(!n){const o=t.isPivotMode();n=(e?e.columns.length:0)>=(o?2:1)}this.comp.setGridRootRole(n?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:a=>{const{target:n}=a,o=_t(n,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:a=>{const{target:n,relatedTarget:o}=a,r=t.contains(o),i=_t(o,"ag-root",t);_t(n,"ag-root",t)||(!r||i)&&t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss(Zw,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(Qw,e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,a=t.isLastRowIndexKnown()?t.getRowCount():-1,n=a===-1?-1:e+a;this.comp.setRowCount(n)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:a}=this,n=e.get("alwaysShowVerticalScroll"),o=n?Dg:null,r=se(e,"normal");t.setAlwaysVerticalScrollClass(o,n);const i=a.get("center")?.eViewport,l=a.get("fakeHScrollComp")?.getGui(),s=a.get("fakeVScrollComp")?.getGui();return n||r&&Tw(this.eBodyViewport,i,void 0,s,l)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let a=t.sizesMeasured;const n=()=>{const o=a&&ea(this.gos)&&!e.stretching,r=o?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(r,o)};n(),this.addManagedEventListeners({heightScaleChanged:n}),this.addManagedPropertyListener("animateRows",n),this.addManagedEventListeners({stylesChanged:()=>{!a&&t.sizesMeasured&&(a=!0,n())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:a,eTop:n,eBottom:o,beans:{popupSvc:r,touchSvc:i}}=this,l=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:l}),i?.mockBodyContextMenu(this,l),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,r)});const s=this.onStickyWheel.bind(this);for(const d of[t,a,n,o])this.addManagedElementListeners(d,{wheel:s});const c=this.onHorizontalWheel.bind(this);for(const d of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(d).eContainer,{wheel:c});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:a,shiftKey:n}=e;(n||Math.abs(t)>Math.abs(a))&&nn(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:a,shiftKey:n}=e;(n||Math.abs(t)>Math.abs(a))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:a}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||a})}onBodyViewportContextMenu(e,t,a){if(!e&&!a)return;this.gos.get("preventDefaultOnContextMenu")&&(e||a).preventDefault();const{target:n}=e||t;(n===this.eBodyViewport||n===this.ctrlsSvc.get("center").eViewport)&&this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:a,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e,beans:{environment:t}}=this,a=e?.getPinnedTopTotalHeight(),n=e?.getPinnedBottomTotalHeight(),o=t.getPinnedRowBorderWidth(),r=t.getRowBorderWidth(),i=o-r,l=a?i+a:0,s=n?i+n:0;this.comp.setTopHeight(l),this.comp.setBottomHeight(s),this.comp.setTopInvisible(l<=0),this.comp.setBottomInvisible(s<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){const t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),a=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let n=0;t>0&&(n+=t),a>0&&(n+=a),n>0&&(n+=1),this.comp.setStickyTopTop(`${n}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:a}=this,n=e?.getPinnedBottomTotalHeight()??0,r=t.horizontalScrollShowing&&t.getScrollbarWidth()||0,i=n+r;a.setStickyBottomBottom(`${i}px`)}};function oe(e){return yt(e)}var Jw=class extends U{constructor(e,t,a,n,o){super(),this.cellCtrl=t,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.gos=e.gos,this.column=t.column,this.rowNode=t.rowNode,this.eRow=n;const r=oe({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});this.eCell=r;let i;t.isCellSpanning()?(i=oe({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),i.appendChild(r),this.setTemplateFromElement(i)):this.setTemplateFromElement(r),this.cellCssManager=new si(()=>r),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l={toggleCss:(s,c)=>this.cellCssManager.toggleCss(s,c),setUserStyles:s=>tn(r,s),getFocusableElement:()=>r,setIncludeSelection:s=>this.includeSelection=s,setIncludeRowDrag:s=>this.includeRowDrag=s,setIncludeDndSource:s=>this.includeDndSource=s,setRowResizerElement:s=>this.setRowResizerElement(s),setRenderDetails:(s,c,d)=>this.setRenderDetails(s,c,d),setEditDetails:(s,c,d)=>this.setEditDetails(s,c,d),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(s,c)=>this.refreshEditStyles(s,c)};t.setComp(l,r,i,this.eCellWrapper,a,o,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){this.rowResizerElement&&Fe(this.rowResizerElement),this.rowResizerElement=e,e&&this.eCell.appendChild(e)}setRenderDetails(e,t,a){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(a||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)),this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement&&this.eCell.appendChild(this.rowResizerElement)}setEditDetails(e,t,a){e?this.createCellEditorInstance(e,t,a):this.destroyEditor()}removeControls(){const e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,a=t||this.forceWrapper,n=a&&this.eCellWrapper==null;n&&(this.eCellWrapper=oe({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const o=!a&&this.eCellWrapper!=null;o&&(Fe(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!a);const r=!e&&a,i=r&&this.eCellValue==null;if(i){const c=this.cellCtrl.getCellValueClass();this.eCellValue=oe({tag:"span",cls:c,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&this.eCellValue!=null;l&&(Fe(this.eCellValue),this.eCellValue=void 0);const s=n||o||i||l;return s&&this.removeControls(),!e&&t&&this.addControls(),s}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:a,includeRowDrag:n,includeDndSource:o,includeSelection:r}=this,i=l=>{l&&t.insertBefore(l.getGui(),a)};n&&this.rowDraggingComp==null&&(this.rowDraggingComp=e.createRowDragComp(),i(this.rowDraggingComp)),o&&this.dndSourceComp==null&&(this.dndSourceComp=e.createDndSource(),i(this.dndSourceComp)),r&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),i(this.checkboxSelectionComp))}createCellEditorInstance(e,t,a){const n=this.editorVersion,o=e.newAgStackInstance(),{params:r}=e;o.then(l=>this.afterCellEditorCreated(n,l,r,t,a)),K(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();le(t);const a=Yt(e);a!=null&&(t.textContent=a)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Fe(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(_(this.beans))||this.cellCtrl.hasBrowserFocus())&&this.eCell.focus({preventScroll:!0}),this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Fe(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer?.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const t=this.rendererVersion,a=r=>i=>{if(this.rendererVersion!==t||!this.isAlive())return;const s=r.newAgStackInstance(),c=this.afterCellRendererCreated.bind(this,t,r.componentClass);s?.then(c)},{animationFrameSvc:n}=this.beans;let o;if(n?.active&&this.firstRender?o=(r,i=!1)=>{n.createTask(a(r),this.rowNode.rowIndex,"p2",r.componentFromFramework,i)}:o=r=>a(r)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:r,onReady:i}=this.cellCtrl.getDeferLoadingCellRenderer();r&&(o(r),i.then(()=>o(e,!0)))}else o(e)}afterCellRendererCreated(e,t,a){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(a);return}this.cellRenderer=a,this.cellRendererClass=t;const o=a.getGui();if(this.cellRendererGui=o,o!=null){const r=this.getParentOfValue();le(r),r.appendChild(o)}}afterCellEditorCreated(e,t,a,n,o){const r=e!==this.editorVersion,{context:i}=this.beans;if(r){i.destroyBean(t);return}if(t.isCancelBeforeStart?.()){i.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){R(97,{colId:this.column.getId()}),i.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const s=n||t.isPopup?.();s?this.addPopupCellEditor(a,o):this.addInCellEditor(),this.refreshEditStyles(!0,s),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:a}=this;a.toggleCss("ag-cell-inline-editing",e&&!t),a.toggleCss("ag-cell-popup-editing",e&&!!t),a.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(_(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),le(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:a,context:n,popupSvc:o,editSvc:r}=this.beans;a.get("editType")==="fullRow"&&R(98);const i=this.cellEditorPopupWrapper=n.createBean(r.createPopupEditorWrapper(e)),{cellEditor:l,cellEditorGui:s,eCell:c,rowNode:d,column:g,cellCtrl:u}=this,h=i.getGui();s&&h.appendChild(s);const p=a.get("stopEditingWhenCellsLoseFocus"),f=t??l.getPopupPosition?.()??"over",m=a.get("enableRtl"),v={ePopup:h,additionalParams:{column:g,rowNode:d},type:"popupCellEditor",eventSource:c,position:f,alignSide:m?"right":"left",keepWithinBounds:!0},b=o.positionPopupByComponent.bind(o,v),w=o.addPopup({modal:p,eChild:h,closeOnEsc:!0,closedCallback:k=>{u.onPopupEditorClosed(k)},anchorToElement:c,positionCallback:b,ariaOwns:c});w&&(this.hideEditorPopup=w.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},Xw=class extends U{constructor(e,t,a){super(),this.cellComps=new Map,this.beans=t,this.rowCtrl=e;const n=oe({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(n,a),this.setTemplateFromElement(n);const o=n.style;this.domOrder=this.rowCtrl.getDomOrder();const r={setDomOrder:i=>this.domOrder=i,setCellCtrls:i=>this.setCellCtrls(i),showFullWidth:i=>this.showFullWidth(i),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(i,l)=>this.toggleCss(i,l),setUserStyles:i=>tn(n,i),setTop:i=>o.top=i,setTransform:i=>o.transform=i,setRowIndex:i=>n.setAttribute("row-index",i),setRowId:i=>n.setAttribute("row-id",i),setRowBusinessKey:i=>n.setAttribute("row-business-key",i),refreshFullWidth:i=>{const l=i();return this.fullWidthCellRendererParams=l,this.fullWidthCellRenderer?.refresh?.(l)??!1}};e.setComp(r,this.getGui(),a,void 0),this.addDestroyFunc(()=>{e.unsetComp(a)})}setInitialStyle(e,t){const a=this.rowCtrl.getInitialTransform(t);if(a)e.style.setProperty("transform",a);else{const n=this.rowCtrl.getInitialRowTop(t);n&&e.style.setProperty("top",n)}}showFullWidth(e){const t=n=>{if(this.isAlive()){const o=n.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(n,e.params)}else this.beans.context.destroyBean(n)};e.newAgStackInstance().then(t)}setCellCtrls(e){const t=new Map(this.cellComps);for(const a of e){const n=a.instanceId;this.cellComps.has(n)?t.delete(n):this.newCellComp(a)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const a of e){const n=this.cellComps.get(a.instanceId);n&&t.push(n.getGui())}lc(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,a=new Jw(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,a),this.getGui().appendChild(a.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(e,t){this.fullWidthCellRenderer=e,this.fullWidthCellRendererParams=t,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(e){for(const t of e.values()){if(!t)continue;const a=t.cellCtrl.instanceId;this.cellComps.get(a)===t&&(t.detach(),t.destroy(),this.cellComps.delete(a))}}};function $w(e,t,a){const n=!!a.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,o={tag:"div",ref:"eContainer",cls:Qi(e),role:"rowgroup"};if(t.type==="center"||n){const r={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${Eg(e)}`,role:"presentation"};return o.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${_i(e)}`,role:"rowgroup",children:[o,n?r:null]}}return o}var eC=class extends U{constructor(e){super(),this.eViewport=E,this.eContainer=E,this.eSpannedContainer=E,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=La(this.name)}postConstruct(){this.setTemplate($w(this.name,this.options,this.beans));const e={setHorizontalScroll:a=>this.eViewport.scrollLeft=a,setViewportHeight:a=>this.eViewport.style.height=a,setRowCtrls:({rowCtrls:a})=>this.setRowCtrls(a),setSpannedRowCtrls:a=>this.setRowCtrls(a,!0),setDomOrder:a=>{this.domOrder=a},setContainerWidth:a=>{this.eContainer.style.width=a,this.eSpannedContainer&&(this.eSpannedContainer.style.width=a)},setOffsetTop:a=>{const n=`translateY(${a})`;this.eContainer.style.transform=n,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=n)}};this.createManagedBean(new zg(this.name)).setComp(e,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:a,options:n}=this,o=t?this.eSpannedContainer:this.eContainer,r=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},i={};t?this.rowCompsWithSpan=i:this.rowCompsNoSpan=i,this.lastPlacedElement=null;const l=[];for(const s of e){const c=s.instanceId,d=r[c];let g;if(d)g=d,delete r[c];else{if(!s.rowNode.displayed)continue;g=new Xw(s,a,n.type)}i[c]=g,l.push([g,!d])}this.removeOldRows(Object.values(r)),this.addRowNodes(l,o)}addRowNodes(e,t){const{domOrder:a}=this;for(const[n,o]of e){const r=n.getGui();a?this.ensureDomOrder(r,t):o&&t.appendChild(r)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){ic(t,e,this.lastPlacedElement),this.lastPlacedElement=e}},tC={selector:"AG-ROW-CONTAINER",component:eC};function Fn(e,t){return t.map(a=>{const n=`e${a[0].toUpperCase()+a.substring(1)}RowContainer`;return e[n]={name:a},{tag:"ag-row-container",ref:n,attrs:{name:a}}})}function aC(e){const t={},a={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:Fn(t,["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:Fn(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:Fn(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:Fn(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:Fn(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:t,elementParams:a}}var nC=class extends U{constructor(){super(...arguments),this.eGridRoot=E,this.eBodyViewport=E,this.eStickyTop=E,this.eStickyBottom=E,this.eTop=E,this.eBottom=E,this.eBody=E}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,a=e?.getOverlayWrapperSelector(),{paramsMap:n,elementParams:o}=aC(!!a);this.setTemplate(o,[...a?[a]:[],zw,Aw,Fw,tC],n);const r=(l,s)=>{const c=`${l}px`;s.style.minHeight=c,s.style.height=c},i={setRowAnimationCssOnBodyViewport:(l,s)=>this.setRowAnimationCssOnBodyViewport(l,s),setColumnCount:l=>Qs(this.getGui(),l),setRowCount:l=>_s(this.getGui(),l),setTopHeight:l=>r(l,this.eTop),setBottomHeight:l=>r(l,this.eBottom),setTopInvisible:l=>this.eTop.classList.toggle("ag-invisible",l),setBottomInvisible:l=>this.eBottom.classList.toggle("ag-invisible",l),setStickyTopHeight:l=>this.eStickyTop.style.height=l,setStickyTopTop:l=>this.eStickyTop.style.top=l,setStickyTopWidth:l=>this.eStickyTop.style.width=l,setStickyBottomHeight:l=>{this.eStickyBottom.style.height=l,this.eStickyBottom.classList.toggle("ag-invisible",l==="0px")},setStickyBottomBottom:l=>this.eStickyBottom.style.bottom=l,setStickyBottomWidth:l=>this.eStickyBottom.style.width=l,setColumnMovingCss:(l,s)=>this.toggleCss(l,s),updateLayoutClasses:(l,s)=>{const c=[this.eBodyViewport.classList,this.eBody.classList];for(const d of c)d.toggle(Ue.AUTO_HEIGHT,s.autoHeight),d.toggle(Ue.NORMAL,s.normal),d.toggle(Ue.PRINT,s.print);this.toggleCss(Ue.AUTO_HEIGHT,s.autoHeight),this.toggleCss(Ue.NORMAL,s.normal),this.toggleCss(Ue.PRINT,s.print)},setAlwaysVerticalScrollClass:(l,s)=>this.eBodyViewport.classList.toggle(Dg,s),registerBodyViewportResizeListener:l=>{const s=st(this.beans,this.eBodyViewport,l);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:l=>this.eTop.style.overflowY=this.eBottom.style.overflowY=l,setCellSelectableCss:(l,s)=>{for(const c of[this.eTop,this.eBodyViewport,this.eBottom])c.classList.toggle(l,s)},setBodyViewportWidth:l=>this.eBodyViewport.style.width=l,setGridRootRole:l=>_e(this.eGridRoot,l)};this.ctrl=this.createManagedBean(new Ag),this.ctrl.setComp(i,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&Je(this.gos)||Ma(this.gos))&&Mm(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const a=this.eBodyViewport.classList;a.toggle("ag-row-animation",t),a.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}},oC={selector:"AG-GRID-BODY",component:nC},Wo={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},Pg=class extends ue{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:a,eTopGuard:n,eBottomGuard:o,focusTrapActive:r,forceFocusOutWhenTabGuardsAreEmpty:i,isFocusableContainer:l,focusInnerElement:s,onFocusIn:c,onFocusOut:d,shouldStopEventPropagation:g,onTabKeyDown:u,handleKeyDown:h,isEmpty:p,eFocusableElement:f}=e;this.comp=a,this.eTopGuard=n,this.eBottomGuard=o,this.providedFocusInnerElement=s,this.eFocusableElement=f,this.focusTrapActive=!!r,this.forceFocusOutWhenTabGuardsAreEmpty=!!i,this.isFocusableContainer=!!l,this.providedFocusIn=c,this.providedFocusOut=d,this.providedShouldStopEventPropagation=g,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=h,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new Pd(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():Mt(this.eFocusableElement,".ag-tab-guard").length===0)){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=ne(this.beans),a=Mt(t.body,null,!0),n=a.indexOf(e?this.eTopGuard:this.eBottomGuard);if(n===-1)return;let o,r;e?(o=0,r=n):(o=n+1,r=a.length);const i=a.slice(o,r),l=this.gos.get("tabIndex");i.sort((s,c)=>{const d=Number.parseInt(s.getAttribute("tabindex")||"0"),g=Number.parseInt(c.getAttribute("tabindex")||"0");return g===l?1:d===l?-1:d===0?1:g===0?-1:d-g}),i[e?i.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const a=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),a&&(a.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=Mt(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),t.length?(t[e?t.length-1:0].focus({preventScroll:!0}),!0):!1}getNextFocusableElement(e){return Dt(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},Zi=class extends ue{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:a,eFocusableElement:n,stopPropagationCallbacks:o}=this,r=[t,a],i={setTabIndex:v=>{for(const b of r)v==null?b.removeAttribute("tabindex"):b.setAttribute("tabindex",v)}};this.addTabGuards(t,a);const{focusTrapActive:l=!1,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m}=e;this.tabGuardCtrl=this.createManagedBean(new Pg({comp:i,focusTrapActive:l,eTopGuard:t,eBottomGuard:a,eFocusableElement:n,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m},o))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=ne(this.beans).createElement("div"),a=e==="top"?Wo.TAB_GUARD_TOP:Wo.TAB_GUARD_BOTTOM;return t.classList.add(Wo.TAB_GUARD,a),_e(t,"presentation"),t}addTabGuards(e,t){const a=this.eFocusableElement;a.prepend(e),a.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];le(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,a){uo(t)||(t=t.getGui());const{eBottomGuard:n}=this;n?n.before(t):e(t,a)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;Fe(e),Fe(t),super.destroy()}},Ig=class extends ra{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new Zi(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},Ji=class extends Ig{initialiseTabGuard(e){super.initialiseTabGuard(e,vn)}},Tg=(e,t)=>og(e,()=>zt(e.getGui(),t,!1,!0)),Lg=e=>e?.getFocusableContainerName()??"external",rC=e=>e==null?"external":typeof e=="string"?e:"gridBody",Bg=class extends y{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}setComp(e,t,a){this.view=e,this.eGridHostDiv=t,this.eGui=a,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:n,ctrlsSvc:o}=this.beans;n?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Vi(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");const r=st(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>r()),o.register("gridCtrl",this)}isDetailGrid(){return Ci(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:e.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(e){const{view:t}=this;e===!1?t.setCursor(null):t.setCursor(e===1?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:a,nextIndex:n}=this.getNextFocusableIndex(t,e),o=a===-1?e?t.length-1:0:n,{gos:r,beans:{focusSvc:i,navigation:l}}=this,s=r.getCallback("tabToNextGridContainer");if(s){const c=i.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:o}),d=Lg(t[o]),g=c==null&&d==="gridBody"?"gridBody":rC(c),u=s({backwards:e,previousContainer:Lg(t[a]),nextContainer:g,defaultTarget:c});if(u!==void 0){if(typeof u=="boolean")return u;if(typeof u=="string"){if(u==="gridBody")return this.focusGridBodyDefault(e)||void 0;const h=t.find(p=>p.getFocusableContainerName()===u);if(!h){Rc(`tabToNextGridContainer - ${u} container not found`);return}return Tg(h,e)?!0:void 0}return iw(u)?i.focusHeaderPosition({headerPosition:u})||void 0:(l?.ensureCellVisible(u),i.setFocusedCell({...u,forceBrowserFocus:!0}),i.isCellFocused(u)||void 0)}}return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:a,nextIndex:o})||void 0}focusInnerElement(e){const{gos:t,beans:a,beans:{focusSvc:n,visibleCols:o}}=this;if(t.getCallback("focusGridInnerElement")?.({fromBottom:!!e}))return!0;const i=this.getFocusableContainers();if(e)return this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:i,indexWithFocus:i.length,nextIndex:i.length-1})?!0:n.focusGridView({column:j(o.allCols),backwards:!0});const l=o.allCols;if(t.get("headerHeight")===0||We(a)){if(n.focusGridView({column:l[0],backwards:e}))return!0;for(let s=1;s<i.length;s++)if(zt(i[s].getGui(),e))return!0;return!1}return n.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}isFocusInsideGridBody(){const e=this.getFocusableContainers(),{indexWithFocus:t}=this.getNextFocusableIndex(e);return e[t]?.getFocusableContainerName()==="gridBody"}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){const t=this.view.getFocusableContainers(),{indexWithFocus:a,nextIndex:n}=this.getNextFocusableIndex(t,e);this.focusNextInnerContainerDefault({backwards:!!e,focusableContainers:t,indexWithFocus:a,nextIndex:n})||this.forceFocusOutOfContainer(e)}isFocusable(){const e=this.beans;return!Sn(e)||!We(e)||!!e.sideBar?.comp?.isDisplayed()}getNextFocusableIndex(e,t){const a=_(this.beans),n=e.findIndex(o=>o.getGui().contains(a));return{indexWithFocus:n,nextIndex:n+(t?-1:1)}}focusGridBodyDefault(e){const{gos:t,beans:a,beans:{focusSvc:n,visibleCols:{allCols:o}}}=this;return e?n.focusGridView({column:j(o),backwards:!0}):t.get("headerHeight")===0||We(a)?n.focusGridView({column:o[0]}):n.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:a,indexWithFocus:n}=e,o=t?-1:1;for(let r=e.nextIndex;r>=0&&r<a.length;r+=o){const i=a[r];if(i.getFocusableContainerName()==="gridBody"&&(n===-1||(t?n>r:n<r))){if(this.focusGridBodyDefault(t))return!0;continue}if(Tg(i,t))return!0}return!1}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},iC=class extends Ji{constructor(e){super(),this.gridBody=E,this.gridHeaderDropZones=E,this.sideBar=E,this.statusBar=E,this.pagination=E,this.rootWrapperBody=E,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:r=>this.addCss(r),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:r=>{this.getGui().style.userSelect=r??"",this.getGui().style.webkitUserSelect=r??""},setCursor:r=>{this.getGui().style.cursor=r??""}},t=this.createManagedBean(new Bg),a=t.getOptionalSelectors(),n=this.createTemplate(a),o=[oC,...Object.values(a).filter(r=>!!r)];this.setTemplate(n,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>t.focusInnerElement(r),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),St(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){const a=this.rootWrapperBody.classList,{AUTO_HEIGHT:n,NORMAL:o,PRINT:r}=Ue,{autoHeight:i,normal:l,print:s}=t;a.toggle(n,i),a.toggle(o,l),a.toggle(r,s),this.toggleCss(n,i),this.toggleCss(o,l),this.toggleCss(r,s)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,a=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,n=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,o=e.watermarkSelector?{tag:"ag-watermark"}:null,r=e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},a]},n,r,o]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody];for(const t of[this.sideBar,this.statusBar,this.pagination])t&&e.push(t);return e.filter(t=>Me(t.getGui()))}},T=(e,t)=>{for(const a of Object.keys(t))t[a]=e;return t},Og={dispatchEvent:"CommunityCore",...T("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...T("GridState",{getState:0,setState:0}),...T("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...T("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...T("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...T("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...T("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...T("ValueCache",{expireValueCache:0}),...T("CellApi",{getCellValue:0}),...T("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...T("Sort",{onSortChanged:0}),...T("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...T("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...T("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...T("HighlightChanges",{flashCells:0}),...T("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...T("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}),...T("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...T("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...T("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...T("ColumnResize",{setColumnWidths:0}),...T("ColumnHover",{isColumnHovered:0}),...T("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...T("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...T("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...T("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...T("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...T("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...T("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...T("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...T("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...T("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...T("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}),...T("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...T("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...T("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...T("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...T("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...T("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...T("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...T("ContextMenu",{showContextMenu:0}),...T("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...T("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...T("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...T("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...T("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}),...T("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...T("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...T("StatusBar",{getStatusPanel:0}),...T("AiToolkit",{getStructuredSchema:0})},Xi={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},lC=(e,t)=>e.eventSvc.dispatchEvent(t),Hg=class{};Reflect.defineProperty(Hg,"name",{value:"GridApi"});var sC=class extends y{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new Hg,this.fns={...Xi,dispatchEvent:lC},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(Og))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:a,beans:n}=this;a!==Xi&&(a[e]=n?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:a,fns:{[e]:n}}=this;return n?n(a,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:a,preDestroyLink:n}=this;if(!t)R(26,{fnName:e,preDestroyLink:n});else{const o=Og[e];a.assertModuleRegistered(o,`api.${e}`)&&R(27,{fnName:e,module:o})}}destroy(){super.destroy(),this.fns=Xi,this.beans=null}};function Ng(e){return e.context.getId()}function cC(e){e.gridDestroySvc.destroy()}function dC(e){return e.gridDestroySvc.destroyCalled}function gC(e,t){return e.gos.get(t)}function uC(e,t,a){Vg(e,{[t]:a})}function Vg(e,t){e.gos.updateGridOptions({options:t})}function hC(e,t){const a=t.replace(/Module$/,"");return e.gos.isModuleRegistered(a)}function Gg(e,t,a){const n=ye(e,t,a);if(n){const{className:r}=n;if(typeof r=="string"&&r.includes("ag-icon")||typeof r=="object"&&r["ag-icon"])return n}const o=oe({tag:"span"});return o.appendChild(n),o}function ye(e,t,a){let n=null;e==="smallDown"?R(262):e==="smallLeft"?R(263):e==="smallRight"&&R(264);const o=a?.getColDef().icons;if(o&&(n=o[e]),t.gos&&!n){const r=t.gos.get("icons");r&&(n=r[e])}if(n){let r;if(typeof n=="function")r=n();else if(typeof n=="string")r=n;else{R(38,{iconName:e});return}if(typeof r=="string")return co(r);if(uo(r))return r;R(133,{iconName:e});return}else{const r=t.registry.getIcon(e);return r||t.validation?.validateIcon(e),oe({tag:"span",cls:`ag-icon ag-icon-${r??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var pC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{draggable:"true"}},fC=class extends U{constructor(e,t,a){super(pC),this.rowNode=e,this.column=t,this.eCell=a}postConstruct(){this.getGui().appendChild(ye("rowDrag",this.beans,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const{rowNode:t,column:a,eCell:n,gos:o}=this,r=a.getColDef().dndSourceOnRowDrag,i=e.dataTransfer;if(i.setDragImage(n,0,0),r){const l=I(o,{rowNode:t,dragEvent:e});r(l)}else try{const l=JSON.stringify(t.data);i.setData("application/json",l),i.setData("text/plain",l)}catch{}}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},mC=".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)}",vC={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"}]}]},bC=class extends U{constructor(){super(),this.dragSource=null,this.eIcon=E,this.eLabel=E,this.eGhost=E,this.registerCSS(mC)}postConstruct(){const e=t=>Gg(t,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(vC),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:a,eIcon:n,dragSource:o,dropIconMap:r,gos:i}=this;le(n);let l=null;e||(e=o?.getDefaultIconName?o.getDefaultIconName():"notAllowed"),l=r[e],a.classList.toggle("ag-dnd-ghost-not-allowed",e==="notAllowed"),n.classList.toggle("ag-shake-left-to-right",t),!(l===r.hide&&i.get("suppressDragLeaveHidesColumns"))&&l&&n.appendChild(l)}setLabel(e){this.eLabel.textContent=e}};function wC(e,t){e.rowDragSvc?.rowDragFeature?.addRowDropZone(t)}function CC(e,t){const a=e.dragAndDrop?.findExternalZone(t.getContainer());a&&e.dragAndDrop?.removeDropTarget(a)}function yC(e,t){return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t)}function kC(e){const t=e.rowDropHighlightSvc;return t?{row:t.row,dropIndicatorPosition:t.position}:{row:null,dropIndicatorPosition:"none"}}function SC(e,t){const a=e.rowDropHighlightSvc;if(!a)return;const n=t?.row;let o=t?.dropIndicatorPosition;o!=="above"&&o!=="below"&&o!=="inside"&&(o="none");const r=n?.rowIndex;r==null||o==="none"?a.clear():a.set(n,o)}var qg=(e,t)=>{if(t!=null&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},xC=(e,t)=>{if(typeof PointerEvent>"u"||!(t instanceof PointerEvent))return null;const a=t.pointerId;if(!qg(e,a))return null;const n={eElement:e,pointerId:a,onLost(o){EC(n,o)}};return e.addEventListener("lostpointercapture",n.onLost),n},RC=e=>{if(!e)return;Wg(e);const{eElement:t,pointerId:a}=e;if(t){try{t.releasePointerCapture(a)}catch{}e.eElement=null}},Wg=e=>{const{eElement:t,onLost:a}=e;t&&a&&(t.removeEventListener("lostpointercapture",a),e.onLost=null)},EC=(e,t)=>{Wg(e);const{eElement:a,pointerId:n}=e;a&&t.pointerId===n&&qg(a,n)},Ba,Oa,$i={passive:!0},Tt={passive:!1},tt=e=>{if(!Oa)Oa=new WeakSet;else if(Oa.has(e))return!1;return Oa.add(e),!0},Ug=class extends ue{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!Ba?.has(Ie(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!!(e&&this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)jg(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let a=0,n=t.length;a<n;++a){const o=t[a];if(o.params===e){t.splice(a,1),jg(o);break}}}addDragSource(e){if(!this.isAlive())return;const{eElement:t,includeTouch:a}=e,n=[];let o;if(a){const c=t.style;c&&(o=c.touchAction,c.touchAction="none")}const r={handlers:n,params:e,oldTouchAction:o};this.dragSources.push(r),po(n,[t,"pointerdown",c=>this.onPointerDown(e,c),Tt],[t,"mousedown",c=>this.onMouseDown(e,c)]);const s=this.gos.get("suppressTouch");a&&!s&&po(n,[t,"touchstart",d=>this.onTouchStart(e,d),Tt])}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return(t==="mousemove"||t==="pointermove")&&e.cancelable&&nn(this.beans,e)&&!Ca(tl(e))}initDrag(e,...t){this.drag=e;const a=this.beans,n=l=>this.onScroll(l),o=l=>this.onKeyDown(l),r=Ie(a),i=ne(a);po(e.handlers,[r,"contextmenu",kt],[r,"keydown",o],[i,"scroll",n,{capture:!0}],[i.defaultView||window,"scroll",n],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;Ba?.get(t)===e&&Ba.delete(t),this.drag=null,RC(e.pointerCapture),Br(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const a=this.beans;if(Oa?.has(t))return;const n=t.pointerType;if(n==="touch"&&(a.gos.get("suppressTouch")||!e.includeTouch||(e.stopPropagationForTouch&&t.stopPropagation(),Ca(tl(t))))||!t.isPrimary||n==="mouse"&&t.button!==0)return;this.destroyDrag();const o=Ie(a),r=e.eElement,i=t.pointerId,l=new el(o,e,t,i);Ba??(Ba=new WeakMap),Ba.set(o,l);const s=u=>{u.pointerId===i&&this.onMouseOrPointerMove(u)},c=u=>{u.pointerId===i&&this.onMouseOrPointerUp(u)},d=u=>{u.pointerId===i&&tt(u)&&this.cancelDrag()},g=u=>this.draggingPreventDefault(u);this.initDrag(l,[o,"pointerup",c],[o,"pointercancel",d],[o,"pointermove",s,Tt],[o,"touchmove",g,Tt],[r,"mousemove",g,Tt]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):tt(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch||!tt(t)||Ca(tl(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer()){this.dragging&&kt(t);return}this.destroyDrag();const n=this.beans,o=Ie(n),r=new el(o,e,t.touches[0]),i=u=>this.onTouchMove(u),l=u=>this.onTouchUp(u),s=u=>this.onTouchCancel(u),c=u=>this.draggingPreventDefault(u),d=Ie(n),g=t.target??e.eElement;this.initDrag(r,[g,"touchmove",i,$i],[g,"touchend",l,$i],[g,"touchcancel",s,$i],[d,"touchmove",c,Tt],[d,"touchend",l,Tt],[d,"touchcancel",s,Tt]),e.dragStartPixels===0&&this.onMove(r.start)}draggingPreventDefault(e){this.dragging&&kt(e)}onMouseDown(e,t){if(t.button!==0||Oa?.has(t)||this.isPointer())return;const a=this.beans;this.destroyDrag();const n=new el(Ie(a),e,t),o=l=>this.onMouseOrPointerMove(l),r=l=>this.onMouseOrPointerUp(l),i=Ie(a);this.initDrag(n,[i,"mousemove",o],[i,"mouseup",r]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):tt(t)}onScroll(e){if(!tt(e))return;const t=this.drag,a=t?.lastDrag;a&&this.dragging&&t.params?.onDragging?.(a)}onMouseOrPointerMove(e){tt(e)&&(mt()&&ne(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&kt(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;!t||!tt(e)||Sa(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!tt(e))return;const a=Sa(t.start,e.touches);a&&(this.onMove(a),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const a=t.params;if(!this.dragging){const n=t.start,r=a.dragStartPixels??4;if(hc(e,n,r)||(this.dragging=!0,a.capturePointer&&(t.pointerCapture=xC(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:a.eElement}),a.onDragStart?.(n),this.drag!==t)||(a.onDragging?.(n),this.drag!==t))return}a.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&tt(e)&&this.onUp(Sa(t.start,e.changedTouches))}onMouseOrPointerUp(e){tt(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===C.ESCAPE&&this.cancelDrag()}},jg=e=>{Br(e.handlers);const t=e.oldTouchAction;if(t!=null){const a=e.params.eElement.style;a&&(a.touchAction=t)}},el=class{constructor(e,t,a,n=null){this.rootEl=e,this.params=t,this.start=a,this.pointerId=n,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},tl=e=>{const t=e.target;return t instanceof Element?t:null},FC=class extends Ug{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}},MC=class extends y{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:a}=this.beans;return a.addDragSource(t),()=>a.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const a=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(a)}setResizeIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},zC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{"aria-hidden":"true"}},Uo={skipAriaHidden:!0},DC=class extends U{constructor(e,t,a,n,o,r=!1){super(),this.cellValueFn=e,this.rowNode=t,this.column=a,this.customGui=n,this.dragStartPixels=o,this.alwaysVisible=r,this.dragSource=null,this.disabled=!1}isCustomGui(){return this.customGui!=null}postConstruct(){const{beans:e,customGui:t}=this;t?this.setDragElement(t,this.dragStartPixels):(this.setTemplate(zC),this.getGui().appendChild(ye("rowDrag",e,null)),this.addDragSource()),this.alwaysVisible||this.initCellDrag()}initCellDrag(){const{beans:e,rowNode:t}=this,a=this.refreshVisibility.bind(this);this.addManagedListeners(e.eventSvc,{rowDragVisibilityChanged:a}),this.addManagedListeners(t,{dataChanged:a,cellChanged:a}),this.refreshVisibility()}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}refreshVisibility(){if(this.alwaysVisible)return;const{beans:e,column:t,rowNode:a}=this,{gos:n,dragAndDrop:o,rowDragSvc:r}=e,i=r?.visibility;let s=!(i==="suppress"||i==="hidden"&&!o?.hasExternalDropZones()),c=s;if(s&&!this.isCustomGui()&&t){const d=t.getColDef().rowDrag;if(d===!1)s=!1;else{const g=typeof d=="function";c=t.isRowDrag(a),s=g||c}}s&&c&&a.footer&&n.get("rowDragManaged")&&(c=!1,s=!0),c&&(c=s),s||this.setDisplayed(s,Uo),c||this.setVisible(c,Uo),this.setDisabled(!c||i==="disabled"&&!o?.hasExternalDropZones()),s&&this.setDisplayed(s,Uo),c&&this.setVisible(c,Uo)}setDisabled(e){e!==this.disabled&&(this.disabled=e,this.getGui()?.classList?.toggle("ag-drag-handle-disabled",e))}getSelectedNodes(){const e=this.rowNode;if(!this.gos.get("rowDragMultiRow"))return[e];const a=this.beans.selectionSvc?.getSelectedNodes()??[];return a.indexOf(e)!==-1?a:[e]}getDragItem(){const{column:e,rowNode:t}=this;return{rowNode:t,rowNodes:this.getSelectedNodes(),columns:e?[e]:void 0,defaultTextValue:this.cellValueFn()}}addDragSource(e=4){if(this.dragSource&&this.removeDragSource(),this.gos.get("rowDragManaged")&&this.rowNode.footer)return;const t=this.getGui();if(this.gos.get("enableCellTextSelection")){this.removeMouseDownListener();const n=ho("pointerdown")?{pointerdown:kt}:{mousedown:kt};this.mouseDownListener=this.addManagedElementListeners(t,n)[0]}const a=this.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:n=>this.getDragItemName(n,a),getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDrop.addDragSource(this.dragSource,!0)}getDragItemName(e,t){const a=e?.dragItem||this.getDragItem(),n=(e?.dropTarget?.rows.length??a.rowNodes?.length)||1,o=this.column?.getColDef()?.rowDragText??this.gos.get("rowDragText");if(o)return o(a,n);if(n!==1)return`${n} ${t("rowDragRows","rows")}`;const r=this.cellValueFn();return r||`1 ${t("rowDragRow","rows")}`}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},Yg=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(e,t=!1){const a=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),n=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(a&&n)return;const o=this.scrollContainer.getBoundingClientRect(),r=this.scrollByTick;this.tickLeft=!n&&e.clientX<o.left+r,this.tickRight=!n&&e.clientX>o.right-r,this.tickUp=!a&&e.clientY<o.top+r,this.tickDown=!a&&e.clientY>o.bottom-r,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Mn=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},zn=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const a=t[0];if(a.sourceRowIndex>=0)return a;t=a.childrenAfterGroup}},Kg=(e,t,a,n)=>{if(!t.size||!e)return!1;let o=!1;const r=e.length??0;let i=-1;a&&(i=a.sourceRowIndex,a=i<0?zn(a):null,a&&(i=a.sourceRowIndex)),i<0||i>=r?i=r:n||++i;let l=i,s=Math.min(i,r-1);for(const g of t){const u=g.sourceRowIndex;u<l&&(l=u),u>s&&(s=u)}let c=l;for(let g=l;g<i;++g){const u=e[g];t.has(u)||(u.sourceRowIndex!==c&&(u.sourceRowIndex=c,e[c]=u,o=!0),++c)}let d=s;for(let g=s;g>=i;--g){const u=e[g];t.has(u)||(u.sourceRowIndex!==d&&(u.sourceRowIndex=d,e[d]=u,o=!0),--d)}for(const g of t)g.sourceRowIndex!==c&&(g.sourceRowIndex=c,e[c]=g,o=!0),++c;return o};function _g(e,t){return Bo(e,t.target)?.getFocusedCellPosition()??null}function al(e,t){const a=se(e.gos,"normal"),n=t;let o,r;n.clientX!=null||n.clientY!=null?(o=n.clientX,r=n.clientY):(o=n.x,r=n.y);const{pageFirstPixel:i}=e.pageBounds.getCurrentPagePixelRange();if(r+=i,a){const l=e.ctrlsSvc.getScrollFeature(),s=l.getVScrollPosition(),c=l.getHScrollPosition();o+=c.left,r+=s.top}return{x:o,y:r}}var AC=.25,PC=class extends y{constructor(e){super(),this.eContainer=e,this.lastDraggingEvent=null,this.autoScroll=null,this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,t=>{const a=()=>t.gridBodyCtrl.scrollFeature.getVScrollPosition().top,n=new Yg({scrollContainer:t.gridBodyCtrl.eBodyViewport,scrollAxis:"y",getVerticalPosition:a,setVerticalPosition:o=>t.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(o),onScrollCallback:()=>{const o=a();if(this.autoScrollOldV!==o){this.autoScrollOldV=o,this.autoScrollChanging=!0;return}const r=this.autoScrollChanging;this.autoScrollChanged=r,this.autoScrollChanging=!1,r&&(e.dragAndDrop?.nudge(),this.autoScrollChanged=!1)}});this.autoScroll=n,this.clearAutoScroll()})}destroy(){super.destroy(),this.clearAutoScroll(),this.autoScroll=null,this.lastDraggingEvent=null,this.eContainer=null}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(e){return e?.dropTarget?.allowed===!1||this.beans.rowDragSvc.visibility!=="visible"?"notAllowed":"move"}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const a=this.beans.selectionSvc?.getSelectedNodes();if(a&&a.indexOf(t)>=0)return a.slice().sort(IC)}return[t]}onDragEnter(e){this.dragging(e,!0)}onDragging(e){this.dragging(e,!1)}dragging(e,t){const{lastDraggingEvent:a,beans:n}=this;if(t){const l=this.getRowNodes(e);e.dragItem.rowNodes=l,Zg(l,!0)}this.lastDraggingEvent=e;const o=e.fromNudge,r=this.makeRowsDrop(a,e,o,!1);n.rowDropHighlightSvc?.fromDrag(e),t&&this.dispatchGridEvent("rowDragEnter",e),this.dispatchGridEvent("rowDragMove",e);const i=this.autoScroll;r?.rowDragManaged&&r.moved&&r.allowed&&r.sameGrid&&!r.suppressMoveWhenRowDragging&&(!o&&!i?.scrolling||this.autoScrollChanged)&&this.dropRows(r),i?.check(e.event)}isFromThisGrid(e){return e.dragSource.dragSourceDomDataKey===this.gos.getDomDataKey()}makeRowsDrop(e,t,a,n){const{beans:o,gos:r}=this,i=this.newRowsDrop(t,n),l=o.rowModel;if(t.dropTarget=i,t.changed=!1,!i)return null;let{sameGrid:s,rootNode:c,source:d,target:g}=i;g??(g=l.getRow(l.getRowCount()-1)??null);const u=this.beans.groupEditSvc,h=!!u?.canSetParent(i);let p=null;if(g?.footer){const m=Po(l,-1,g)??Po(l,1,g);h&&(p=g.sibling??c),g=m??null}g?.detail&&(g=g.parent),i.moved&&(i.moved=d!==g);let f=.5;if(g&&(s&&i.moved&&(p||!h)?f=d.rowIndex>g.rowIndex?-.5:.5:f=(i.y-g.rowTop-g.rowHeight/2)/g.rowHeight||0),!h&&s&&g&&i.moved&&$(r)){const m=TC(l,i);m&&(f=d.rowIndex>m.rowIndex?-.5:.5,g=m,i.moved&&(i.moved=d!==g))}return i.target=g,i.newParent=p,i.pointerPos=LC(g,i.y),i.yDelta=f,u?.fixRowsDrop(i,h,a,f),this.validateRowsDrop(i,h,n),t.changed||(t.changed=Qg(e?.dropTarget,i)),i}newRowsDrop(e,t){const{beans:a,gos:n}=this,o=a.rowModel.rootNode,r=$(n)?n.get("rowDragManaged"):!1,i=n.get("suppressMoveWhenRowDragging"),l=this.isFromThisGrid(e);let{rowNode:s,rowNodes:c}=e.dragItem;if(c||(c=s?[s]:[]),s||(s=c[0]),!s||!o)return null;const d=this.beans.dragAndDrop.isDropZoneWithinThisGrid(e);let g=!0;r&&(!c.length||a.rowDragSvc.visibility!=="visible"||(i||!l)&&!d)&&(g=!1);const u=al(a,e).y,h=this.getOverNode(u);return{api:a.gridApi,context:a.gridOptions.context,draggingEvent:e,rowDragManaged:r,suppressMoveWhenRowDragging:i,sameGrid:l,withinGrid:d,treeData:!1,rootNode:o,moved:s!==h,y:u,overNode:h,overIndex:h?.rowIndex??-1,pointerPos:"none",position:"none",source:s,target:h??null,newParent:null,rows:c,allowed:g,highlight:!t&&r&&i&&(d||!l),yDelta:0,inside:!1,droppedManaged:!1}}validateRowsDrop(e,t,a){const{source:n,target:o,yDelta:r,inside:i,moved:l,rowDragManaged:s,suppressMoveWhenRowDragging:c}=e;e.moved&&(e.moved=n!==o);const{position:d,fallbackPosition:g}=this.computeDropPosition(l,i,r);e.position=d,t||(e.newParent=null),this.enforceSuppressMoveWhenRowDragging(e,c,"initial");const u=(!s||e.allowed)&&this.gos.get("isRowValidDropPosition");u&&this.applyDropValidator(e,t,a,s,u),s&&(e.rows=this.filterRows(e)),this.beans.groupEditSvc?.clearNewSameParent(e,t),this.enforceSuppressMoveWhenRowDragging(e,c,"final"),e.position==="inside"&&(!e.allowed||!e.newParent)&&(e.position=g)}computeDropPosition(e,t,a){const n=a<0?"above":"below";return e?{position:t?"inside":n,fallbackPosition:n}:{position:"none",fallbackPosition:n}}enforceSuppressMoveWhenRowDragging(e,t,a){if(t){if(a==="initial"){e.moved||(e.allowed=!1);return}(!e.rows.length||e.position==="none")&&(e.allowed=!1)}}applyDropValidator(e,t,a,n,o){this.beans.groupEditSvc?.clearNewSameParent(e,t);const r=o(e);if(!r){e.allowed=!1;return}if(typeof r!="object")return;r.rows!==void 0&&(e.rows=r.rows??[]),t&&r.newParent!==void 0&&(e.newParent=r.newParent),r.target!==void 0&&(e.target=r.target),r.position&&(e.position=r.position),r.allowed!==void 0?e.allowed=r.allowed:n||(e.allowed=!0);const i=e.draggingEvent;r.changed&&i&&(i.changed=!0),!a&&r.highlight!==void 0&&(e.highlight=r.highlight)}addRowDropZone(e){if(!e.getContainer()){R(55);return}const t=this.beans.dragAndDrop;if(t.findExternalZone(e.getContainer())){R(56);return}const a=e.fromGrid?e:{getContainer:e.getContainer,onDragEnter:e.onDragEnter&&(o=>e.onDragEnter(this.rowDragEvent("rowDragEnter",o))),onDragLeave:e.onDragLeave&&(o=>e.onDragLeave(this.rowDragEvent("rowDragLeave",o))),onDragging:e.onDragging&&(o=>e.onDragging(this.rowDragEvent("rowDragMove",o))),onDragStop:e.onDragStop&&(o=>e.onDragStop(this.rowDragEvent("rowDragEnd",o))),onDragCancel:e.onDragCancel&&(o=>e.onDragCancel(this.rowDragEvent("rowDragCancel",o)))},n={isInterestedIn:o=>o===2,getIconName:()=>"move",external:!0,...a};t.addDropTarget(n),this.addDestroyFunc(()=>t.removeDropTarget(n))}getRowDropZone(e){return{getContainer:this.getContainer.bind(this),onDragEnter:a=>{this.onDragEnter(a),e?.onDragEnter?.(this.rowDragEvent("rowDragEnter",a))},onDragLeave:a=>{this.onDragLeave(a),e?.onDragLeave?.(this.rowDragEvent("rowDragLeave",a))},onDragging:a=>{this.onDragging(a),e?.onDragging?.(this.rowDragEvent("rowDragMove",a))},onDragStop:a=>{this.onDragStop(a),e?.onDragStop?.(this.rowDragEvent("rowDragEnd",a))},onDragCancel:a=>{this.onDragCancel(a),e?.onDragCancel?.(this.rowDragEvent("rowDragCancel",a))},fromGrid:!0}}getOverNode(e){const{pageBounds:t,rowModel:a}=this.beans,o=e>t.getCurrentPagePixelRange().pageLastPixel?-1:a.getRowIndexAtPixel(e);return o>=0?a.getRow(o):void 0}rowDragEvent(e,t){const a=this.beans,{dragItem:n,dropTarget:o,event:r,vDirection:i}=t,l=o?.rootNode===a.rowModel.rootNode,s=l?o.y:al(a,t).y,c=l?o.overNode:this.getOverNode(s),d=l?o.overIndex:c?.rowIndex??-1;return{api:a.gridApi,context:a.gridOptions.context,type:e,event:r,node:n.rowNode,nodes:n.rowNodes,overIndex:d,overNode:c,y:s,vDirection:i,rowsDrop:o}}dispatchGridEvent(e,t){const a=this.rowDragEvent(e,t);this.eventSvc.dispatchEvent(a)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e,!1)}onDragStop(e){const t=this.lastDraggingEvent?.dropTarget??null,a=this.makeRowsDrop(this.lastDraggingEvent,e,!1,!0);this.dispatchGridEvent("rowDragEnd",e),a?.allowed&&a.rowDragManaged&&(!t?.droppedManaged||Qg(t,a))&&this.dropRows(a),this.stopDragging(e,!0)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e,!0)}stopDragging(e,t){this.clearAutoScroll(),this.beans.groupEditSvc?.stopDragging(t),this.beans.rowDropHighlightSvc?.fromDrag(null),Zg(e.dragItem.rowNodes,!1),this.lastDraggingEvent=null}clearAutoScroll(){this.autoScroll?.ensureCleared(),this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}dropRows(e){return e.droppedManaged=!0,e.sameGrid?this.csrmMoveRows(e):this.csrmAddRows(e)}csrmAddRows({position:e,target:t,rows:a}){const n=ta(this.gos),o=this.beans.rowModel,r=a.filter(({data:l,rowPinned:s})=>!o.getRowNode(n?.({data:l,level:0,rowPinned:s})??l.id)).map(({data:l})=>l);if(r.length===0)return!1;let i;if(t){const l=t.sourceRowIndex>=0?t:zn(t);l&&(i=l.sourceRowIndex+(e==="above"?0:1))}return o.updateRowData({add:r,addIndex:i}),!0}filterRows(e){const{groupEditSvc:t}=this.beans,{rows:a,sameGrid:n}=e;let o;for(let r=0,i=a.length;r<i;++r){let l=!0;const s=a[r];(!s||s.footer||n&&s.destroyed&&!s.group||!this.csrmGetLeaf(s))&&(l=!1),l&&t&&!t.canDropRow(s,e)&&(l=!1),l?o?.push(s):o??(o=a.slice(0,r))}return o??a}csrmMoveRows(e){const t=this.beans.groupEditSvc;return t?.isGroupingDrop(e)?t.dropGroupEdit(e):this.csrmMoveRowsReorder(e)}csrmMoveRowsReorder({position:e,target:t,rows:a,newParent:n,rootNode:o}){let r=!1;const i=new Set;for(const u of a){n&&u.parent!==n&&(u.treeParent=n,r=!0);const h=this.csrmGetLeaf(u);h&&i.add(h)}if(!r&&i.size===0)return!1;const l=this.beans.focusSvc,s=l.getFocusedCell(),c=s&&la(this.beans,s);if(i.size&&Kg(o._leafs,i,t,e==="above")&&(r=!0),!r)return!1;const d=this.beans.rowModel,g=new Mn;return g.reordered=!0,d.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:g}),c?c.focusCell():l.clearFocusedCell(),!0}csrmGetLeaf(e){if(e.sourceRowIndex>=0)return e.destroyed?void 0:e;const t=this.beans.groupEditSvc;return t?t.csrmFirstLeaf(e):zn(e)}},Qg=(e,t)=>e!==t&&(!e||e.sameGrid!==t.sameGrid||e.allowed!==t.allowed||e.position!==t.position||e.target!==t.target||e.source!==t.source||e.newParent!==t.newParent||!lt(e.rows,t.rows)),IC=({rowIndex:e},{rowIndex:t})=>e!==null&&t!==null?e-t:0,Zg=(e,t)=>{for(let a=0,n=e?.length||0;a<n;++a){const o=e[a];o.dragging!==t&&(o.dragging=t,o.dispatchRowEvent("draggingChanged"))}},TC=(e,t)=>{let a=null,n=t.target;if(n&&t.rows.indexOf(n)<0)return null;const o=t.source;if(!n||!o)return null;let r=n.rowIndex-o.rowIndex;const i=r<0?-1:1;r=t.suppressMoveWhenRowDragging?Math.abs(r):1;const l=new Set(t.rows);do{const s=Po(e,i,n);if(!s)break;l.has(s)||(a=s,--r),n=s}while(r>0);return a},LC=(e,t)=>{const a=e?.rowTop,n=e?.rowHeight??0;if(a==null||!n||n<=0)return"none";const o=t-a,r=n*AC;return o<=r?"above":o>=n-r?"below":"inside"},BC=class extends y{constructor(){super(...arguments),this.beanName="rowDragSvc",this.rowDragFeature=null,this.visibility="suppress"}setupRowDrag(e,t){const a=t.createManagedBean(new PC(e)),n=this.beans.dragAndDrop;n.addDropTarget(a),t.addDestroyFunc(()=>n.removeDropTarget(a)),this.rowDragFeature=a;const o=()=>this.refreshVisibility();this.addManagedPropertyListeners(["rowDragManaged","suppressRowDrag","refreshAfterGroupEdit"],o),this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:o,columnPivotModeChanged:o,sortChanged:o,filterChanged:o}),this.visibility=this.computeVisibility()}createRowDragComp(e,t,a,n,o,r){return new DC(e,t,a,n,o,r)}createRowDragCompForRow(e,t){if(Je(this.gos))return;const a=this.getLocaleTextFunc();return this.createRowDragComp(()=>`1 ${a("rowDragRow","row")}`,e,void 0,t,void 0,!0)}createRowDragCompForCell(e,t,a,n,o,r){const i=this.gos;return i.get("rowDragManaged")&&(!$(i)||i.get("pagination"))?void 0:this.createRowDragComp(a,e,t,n,o,r)}cancelRowDrag(){this.rowDragFeature?.lastDraggingEvent&&this.beans.dragSvc?.cancelDrag()}computeVisibility(){const e=this.beans,t=e.gos;if(t.get("suppressRowDrag"))return"suppress";if(!t.get("rowDragManaged"))return"visible";const n=e.colModel.isPivotMode();return(n||e.rowGroupColsSvc?.columns?.length)&&!t.get("refreshAfterGroupEdit")?"hidden":n||e.filterManager?.isAnyFilterPresent()||e.sortSvc?.isSortActive()?"disabled":"visible"}refreshVisibility(){const e=this.visibility,t=this.computeVisibility();e!==t&&(this.visibility=t,this.eventSvc?.dispatchEvent({type:"rowDragVisibilityChanged"}))}},OC=class extends y{constructor(){super(...arguments),this.beanName="rowDropHighlightSvc",this.uiLevel=0,this.dragging=!1,this.row=null,this.position="none"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this)})}onModelUpdated(){const e=this.row,t=this.dragging;!e||e?.rowIndex===null||this.position==="none"?this.clear():this.set(e,this.position),this.dragging=t}destroy(){this.clear(),super.destroy()}clear(){const e=this.row;this.dragging=!1,e&&(this.uiLevel=0,this.position="none",this.row=null,e.dispatchRowEvent("rowHighlightChanged"))}set(e,t){const a=e!==this.row,n=e.uiLevel,o=t!==this.position,r=n!==this.uiLevel;this.dragging=!1,(a||o||r)&&(a&&this.clear(),this.uiLevel=n,this.position=t,this.row=e,e.dispatchRowEvent("rowHighlightChanged"))}fromDrag(e){const t=e?.dropTarget;if(t){const{highlight:a,target:n,position:o}=t;if(a&&n&&o!=="none"){this.set(n,o),this.dragging=!0;return}}this.dragging&&this.clear()}},nl={moduleName:"Drag",version:F,beans:[FC]},Jg={moduleName:"DragAndDrop",version:F,dynamicBeans:{dndSourceComp:fC},icons:{rowDrag:"grip"}},ol={moduleName:"SharedDragAndDrop",version:F,beans:[Sb],dependsOn:[nl],userComponents:{agDragAndDropImage:bC},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},Xg={moduleName:"RowDrag",version:F,beans:[OC,BC],apiFunctions:{addRowDropZone:wC,removeRowDropZone:CC,getRowDropZoneParams:yC,getRowDropPositionIndicator:kC,setRowDropPositionIndicator:SC},dependsOn:[ol]},$g={moduleName:"HorizontalResize",version:F,beans:[MC],dependsOn:[nl]},HC=":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}}",NC=class extends y{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,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.active)return;const{gos:e}=this;e.get("suppressColumnMoveAnimation")||e.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&t.setColumnMovingCss(!1)})}flush(e,t){const{executeNextFuncs:a,executeLaterFuncs:n}=this;if(a.length===0&&n.length===0){e(),t();return}const o=r=>{for(;r.length;){const i=r.pop();i&&i()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),o(a)},0),window.setTimeout(()=>{t(),o(n)},200)})}};function VC(e,t,a){e.colMoves?.moveColumnByIndex(t,a,"api")}function GC(e,t,a){e.colMoves?.moveColumns(t,a,"api")}var qC=class extends y{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const a of t)a.isPrimary()&&(a.isAnyFunctionActive()||(a.isAllowValue()?this.columnsToAggregate.push(a):a.isAllowRowGroup()?this.columnsToGroup.push(a):a.isAllowPivot()&&this.columnsToPivot.push(a)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{valueColsSvc:t,rowGroupColsSvc:a,pivotColsSvc:n}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&a?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&n?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function WC(e,t){!t||t.length<=1||t.filter(n=>e.indexOf(n)<0).length>0||t.sort((n,o)=>{const r=e.indexOf(n),i=e.indexOf(o);return r-i})}function UC(e){const t=[...e];for(const a of e){let n=null,o=a.getParent();for(;o!=null&&o.getDisplayedLeafColumns().length===1;)n=o,o=o.getParent();if(n!=null){const i=!!n.getColGroupDef()?.marryChildren?n.getProvidedColumnGroup().getLeafColumns():n.getLeafColumns();for(const l of i)t.includes(l)||t.push(l)}}return t}function jC(e,t,a,n){const o=n.allCols;let r=null,i=null;for(let l=0;l<e.length;l++){const s=e[l],c=a.getProposedColumnOrder(t,s);if(!a.doesOrderPassRules(c))continue;const d=c.filter(u=>o.includes(u));if(i===null)i=d;else if(!lt(d,i))break;const g=KC(c);(r===null||g<r.fragCount)&&(r={move:s,fragCount:g})}return r}function eu(e){const{isFromHeader:t,fromLeft:a,xPosition:n,fromEnter:o,fakeEvent:r,pinned:i,gos:l,colModel:s,colMoves:c,visibleCols:d}=e;let{allMovingColumns:g}=e;t&&(g=UC(g));const u=g.slice();WC(s.getCols(),u);const h=QC({movingCols:u,draggingRight:a,xPosition:n,pinned:i,gos:l,colModel:s,visibleCols:d}),p=YC(u,s);if(h.length===0)return;const f=h[0];if(p!==null&&(t||!o)&&!r&&(!a&&f>=p||a&&f<=p))return;const v=jC(h,u,c,d);if(!v)return;const b=v.move;if(!(b>s.getCols().length-u.length))return{columns:u,toIndex:b}}function tu(e){const{columns:t,toIndex:a}=eu(e)||{},{finished:n,colMoves:o}=e;return!t||a==null?null:(o.moveColumns(t,a,"uiColumnMoved",n),n?null:{columns:t,toIndex:a})}function YC(e,t){const a=t.getCols(),n=e.map(s=>a.indexOf(s)).sort((s,c)=>s-c),o=n[0];return j(n)-o!==n.length-1?null:o}function KC(e){function t(n){const o=[];let r=n.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let a=0;for(let n=0;n<e.length-1;n++){let o=t(e[n]),r=t(e[n+1]);[o,r]=o.length>r.length?[o,r]:[r,o];for(const i of o)r.indexOf(i)===-1&&a++}return a}function _C(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}function QC(e){const{movingCols:t,draggingRight:a,xPosition:n,pinned:o,gos:r,colModel:i,visibleCols:l}=e;if(r.get("suppressMovableColumns")||t.some(w=>w.getColDef().suppressMovable))return[];const c=_C(l,o),d=i.getCols(),g=c.filter(w=>t.includes(w)),u=c.filter(w=>!t.includes(w)),h=d.filter(w=>!t.includes(w));let p=0,f=n;if(a){let w=0;for(const k of g)w+=k.getActualWidth();f-=w}if(f>0){for(let w=0;w<u.length;w++){const k=u[w];if(f-=k.getActualWidth(),f<0)break;p++}a&&p++}let m;if(p>0){const w=u[p-1];m=h.indexOf(w)+1}else m=h.indexOf(u[0]),m===-1&&(m=0);const v=[m],b=(w,k)=>w-k;if(a){let w=m+1;const k=d.length-1;for(;w<=k;)v.push(w),w++;v.sort(b)}else{let w=m;const k=d.length-1;let S=d[w];for(;w<=k&&c.indexOf(S)<0;)w++,v.push(w),S=d[w];w=m-1;const x=0;for(;w>=x;)v.push(w),w--;v.sort(b).reverse()}return v}function rl(e){const{pinned:t,fromKeyboard:a,gos:n,ctrlsSvc:o,useHeaderRow:r,skipScrollPadding:i}=e;let l=o.getHeaderRowContainerCtrl(t)?.eViewport,{x:s}=e;return l?(a&&(s-=l.getBoundingClientRect().left),n.get("enableRtl")&&(r&&(l=l.querySelector(".ag-header-row")),s=l.clientWidth-s),t==null&&!i&&(s+=o.get("center").getCenterViewportScrollLeft()),s):0}function il(e,t){for(const a of e)a.moving=t,a.dispatchColEvent("movingChanged","uiColumnMoved")}var au=7,ll=100,jo=ll/2,ZC=5,JC=100,XC=class extends y{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!z(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:a}=t||{},n=a?.columns??[];for(const o of n){const r=o.getPinned();if(o.getColDef().lockPinned){if(r==e)return"move";continue}const i=a?.containerType;if(i===e||!e)return"move";if(e&&(!r||i!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,a=t.columns;if(e.dragSource.type===0)this.setColumnsVisible(a,!0,"uiColumnDragged");else{const o=t.visibleState,r=(a||[]).filter(i=>o[i.getId()]&&!i.isVisible());this.setColumnsVisible(r,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(a,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,a=!1,n=!1){const{gos:o,ctrlsSvc:r}=this.beans,i=o.get("suppressMoveWhenColumnDragging");if(n&&!i){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!n&&K(e.hDirection))return;const l=rl({x:e.x,pinned:this.pinned,gos:o,ctrlsSvc:r});t||this.checkCenterForScrolling(l),i?this.handleColumnDragWhileSuppressingMovement(e,t,a,l,n):this.handleColumnDragWhileAllowingMovement(e,t,a,l,n)}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(e,t,a){if(!e?.length)return;const n=e.filter(o=>!o.getColDef().lockVisible);n.length&&this.beans.colModel.setColsVisible(n,t,a)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:a}=e;this.beans.colMoves.moveColumns(t,a,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,a,n,o){const r=this.getAllMovingColumns(e,!0);if(o){const i=this.isAttemptingToPin(r);i&&this.attemptToPinColumns(r,void 0,!0);const{fromLeft:l,xPosition:s}=this.getNormalisedXPositionInfo(r,i)||{};if(l==null||s==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:r,xPosition:s,fromEnter:t,fakeEvent:a,fromLeft:l})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(r,n)}}handleColumnDragWhileAllowingMovement(e,t,a,n,o){const r=this.getAllMovingColumns(e),i=this.normaliseDirection(e.hDirection)==="right",l=e.dragSource.type===1,s=this.getMoveColumnParams({allMovingColumns:r,isFromHeader:l,xPosition:n,fromLeft:i,fromEnter:t,fakeEvent:a}),c=tu({...s,finished:o});c&&(this.lastMovedInfo=c)}getAllMovingColumns(e,t=!1){const a=e.dragSource.getDragItem();let n=null;t?(n=a.columnsInSplit,n||(n=a.columns)):n=a.columns;const o=r=>r.getColDef().lockPinned?r.getPinned()==this.pinned:!0;return n?n.filter(o):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:a,xPosition:n,fromLeft:o,fromEnter:r,fakeEvent:i}=e,{gos:l,colModel:s,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:a,fromLeft:o,xPosition:n,pinned:this.pinned,fromEnter:r,fakeEvent:i,gos:l,colModel:s,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){const{gos:a,colModel:n}=this.beans,o=a.get("enableRtl"),r=n.getCols().filter(d=>d.isVisible()&&d.getPinned()===this.pinned);let i=null,l=null,s=null;for(const d of r){if(l=d.getActualWidth(),i=this.getNormalisedColumnLeft(d,0,o),i!=null){const g=i+l;if(i<=t&&g>=t){s=d;break}}i=null,l=null}if(s)e.indexOf(s)!==-1&&(s=null);else{for(let d=r.length-1;d>=0;d--){const g=r[d],u=r[d].getParent();if(!u){s=g;break}const h=u?.getDisplayedLeafColumns();if(h.length){s=j(h);break}}if(!s)return;i=this.getNormalisedColumnLeft(s,0,o),l=s.getActualWidth()}if(s==null||i==null||l==null){this.lastHighlightedColumn?.column!==s&&this.clearHighlighted();return}let c;if(t-i<l/2){const d=r.indexOf(s);d===0?c=0:(c=1,s=r[d-1])}else c=1;(this.lastHighlightedColumn?.column!==s||this.lastHighlightedColumn?.position!==c)&&this.clearHighlighted(),nu(s,c),this.lastHighlightedColumn={column:s,position:c}}getNormalisedXPositionInfo(e,t){const{gos:a,visibleCols:n}=this.beans,o=a.get("enableRtl"),{firstMovingCol:r,column:i,position:l}=this.getColumnMoveAndTargetInfo(e,t,o);if(!r||!i||l==null)return;const s=n.allCols,c=s.indexOf(r),d=s.indexOf(i),g=l===0,u=c<d||c===d&&!g;let h=0;if(g?u&&(h-=1):u||(h+=1),d+h===c)return;const p=s[d+h];if(!p)return;const f=this.getNormalisedColumnLeft(p,20,o);return{fromLeft:u,xPosition:f}}getColumnMoveAndTargetInfo(e,t,a){const n=this.lastHighlightedColumn||{},{firstMovingCol:o,lastMovingCol:r}=$C(e);if(!o||!r||n.column||!t)return{firstMovingCol:o,...n};const l=this.getPinDirection()==="left";return{firstMovingCol:o,position:l?1:0,column:l!==a?o:r}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case"left":return"right";case"right":return"left"}return e}getNormalisedColumnLeft(e,t,a){const{gos:n,ctrlsSvc:o}=this.beans,r=e.getLeft();if(r==null)return null;const i=e.getActualWidth();return rl({x:a?r+i-t:r+t,pinned:e.getPinned(),useHeaderRow:a,skipScrollPadding:!0,gos:n,ctrlsSvc:o})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,a=this.failedMoveAttempts>au;return t&&a||e.some(n=>n.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:a,fromEnter:n,fakeEvent:o,fromLeft:r}=e,i=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:a,fromLeft:r,fromEnter:n,fakeEvent:o}),{columns:l,toIndex:s}=eu(i)||{};l&&s!=null&&(this.lastMovedInfo={columns:l,toIndex:s}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(nu(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),a=t.getCenterViewportScrollLeft(),n=a+t.getCenterWidth();let o,r;this.gos.get("enableRtl")?(o=e<a+jo,r=e>n-jo):(r=e<a+jo,o=e>n-jo),this.needToMoveRight=o,this.needToMoveLeft=r,r||o?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),JC),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*ZC,e>ll&&(e=ll);let t=null;const a=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=a.scrollHorizontally(-e):this.needToMoveRight&&(t=a.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:n,dragAndDrop:o,gos:r}=this.beans;if(this.failedMoveAttempts<=au+1||!n)return;if(o.setDragImageCompIcon("pinned"),!r.get("suppressMoveWhenColumnDragging")){const i=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(i,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,a=!1){const n=(e||[]).filter(i=>!i.getColDef().lockPinned);if(!n.length)return 0;a&&(t=this.getPinDirection());const{pinnedCols:o,dragAndDrop:r}=this.beans;return o?.setColsPinned(n,t,"uiColumnDragged"),a&&r.nudge(),n.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function nu(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}function $C(e){const t=e.length;let a,n;for(let o=0;o<t;o++){if(!a){const r=e[o];r.getLeft()!=null&&(a=r)}if(!n){const r=e[t-1-o];r.getLeft()!=null&&(n=r)}if(a&&n)break}return{firstMovingCol:a,lastMovingCol:n}}var e0=class extends y{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans,a=this.pinned;e.whenReady(this,n=>{let o;const r=n.gridBodyCtrl.eBodyViewport;switch(a){case"left":o=[[r,n.left.eContainer],[n.bottomLeft.eContainer],[n.topLeft.eContainer]];break;case"right":o=[[r,n.right.eContainer],[n.bottomRight.eContainer],[n.topRight.eContainer]];break;default:o=[[r,n.center.eViewport],[n.bottomCenter.eViewport],[n.topCenter.eViewport]];break}this.eSecondaryContainers=o}),this.moveColumnFeature=this.createManagedBean(new XC(a)),this.bodyDropPivotTarget=this.createManagedBean(new qC(a)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}};function ou(e,t){const a=[],n=[],o=[];return e.forEach(i=>{const l=i.getColDef().lockPosition;l==="right"?o.push(i):l==="left"||l===!0?a.push(i):n.push(i)}),t.get("enableRtl")?[...o,...n,...a]:[...a,...n,...o]}function ru(e,t){let a=!0;return $e(null,t,n=>{if(!de(n))return;const o=n;if(!o.getColGroupDef()?.marryChildren)return;const l=[];for(const u of o.getLeafColumns()){const h=e.indexOf(u);l.push(h)}const s=Math.max.apply(Math,l),c=Math.min.apply(Math,l),d=s-c,g=o.getLeafColumns().length-1;d>g&&(a=!1)}),a}var t0=class extends y{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,a){const n=this.beans.colModel.getCols();if(!n)return;const o=n[e];this.moveColumns([o],t,a)}moveColumns(e,t,a,n=!0){const{colModel:o,colAnimation:r,visibleCols:i,eventSvc:l}=this.beans,s=o.getCols();if(!s)return;if(t>s.length-e.length){R(30,{toIndex:t});return}r?.start();const c=o.getColsForKeys(e);this.doesMovePassRules(c,t)&&(Vs(o.getCols(),c,t),i.refresh(a),l.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,toIndex:t,finished:n,source:a})),r?.finish()}doesMovePassRules(e,t){const a=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(a)}doesOrderPassRules(e){const{colModel:t,gos:a}=this.beans;return!(!ru(e,t.getColTree())||!(o=>{const r=c=>c?c==="left"||c===!0?-1:1:0,i=a.get("enableRtl");let l=i?1:-1,s=!0;for(const c of o){const d=r(c.getColDef().lockPosition);i?d>l&&(s=!1):d<l&&(s=!1),l=d}return s})(e))}getProposedColumnOrder(e,t){const n=this.beans.colModel.getCols().slice();return Vs(n,e,t),n}createBodyDropTarget(e,t){return new e0(e,t)}moveHeader(e,t,a,n,o){const{ctrlsSvc:r,gos:i,colModel:l,visibleCols:s,focusSvc:c}=this.beans,d=t.getBoundingClientRect(),g=d.left,u=ee(a),h=u?d.width:a.getActualWidth(),p=e==="left"!==i.get("enableRtl"),f=rl({x:p?g-20:g+h+20,pinned:n,fromKeyboard:!0,gos:i,ctrlsSvc:r}),m=c.focusedHeader;tu({allMovingColumns:u?a.getLeafColumns():[a],isFromHeader:!0,fromLeft:e==="right",xPosition:f,pinned:n,fromEnter:!1,fakeEvent:!1,gos:i,colModel:l,colMoves:this,visibleCols:s,finished:!0});let v;if(u){const b=a.getDisplayedLeafColumns();v=p?b[0]:j(b)}else v=a;if(r.getScrollFeature().ensureColumnVisible(v,"auto"),(!o.isAlive()||i.get("ensureDomOrder"))&&m){let b;if(u){const w=a.getGroupId(),k=a.getLeafColumns();if(!k.length)return;const S=k[0].getParent();if(!S)return;b=a0(S,w)}else b=a;b&&c.focusHeaderPosition({headerPosition:{...m,column:b}})}}setDragSourceForHeader(e,t,a){const{gos:n,colModel:o,dragAndDrop:r,visibleCols:i}=this.beans;let l=!n.get("suppressDragLeaveHidesColumns");const s=ee(t),c=s?t.getProvidedColumnGroup().getLeafColumns():[t],g={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:s?()=>o0(t,i.allCols):()=>n0(t),dragItemName:a,onDragStarted:()=>{l=!n.get("suppressDragLeaveHidesColumns"),il(c,!0)},onDragStopped:()=>il(c,!1),onDragCancelled:()=>il(c,!1),onGridEnter:u=>{if(l){const{columns:h=[],visibleState:p}=u??{},f=s?v=>!p||p[v.getColId()]:()=>!0,m=h.filter(v=>!v.getColDef().lockVisible&&f(v));o.setColsVisible(m,!0,"uiColumnMoved")}},onGridExit:u=>{if(l){const h=u?.columns?.filter(p=>!p.getColDef().lockVisible)||[];o.setColsVisible(h,!1,"uiColumnMoved")}}};return r.addDragSource(g,!0),g}};function a0(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}}function n0(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}function o0(e,t){const a=e.getProvidedColumnGroup().getLeafColumns(),n={};for(const l of a)n[l.getId()]=l.isVisible();const o=[];for(const l of t)a.indexOf(l)>=0&&(o.push(l),Pe(a,l));for(const l of a)o.push(l);const r=[],i=e.getLeafColumns();for(const l of o)i.indexOf(l)!==-1&&r.push(l);return{columns:o,columnsInSplit:r,visibleState:n,containerType:r[0]?.pinned}}var iu={moduleName:"ColumnMove",version:F,beans:[t0,NC],apiFunctions:{moveColumnByIndex:VC,moveColumns:GC},dependsOn:[ol],css:[HC]},r0=class extends y{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const a=this.getHeaderCellForColumn(e);if(!a)return-1;const n=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||n.push(a),this.getPreferredWidthForElements(n)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const a=document.createElement("form");a.style.position="fixed";const n=this.centerRowContainerCtrl.eContainer;for(const r of e)this.cloneItemIntoDummy(r,a);n.appendChild(a);const o=Math.ceil(a.getBoundingClientRect().width);return a.remove(),t=t??this.gos.get("autoSizePadding"),o+t}getHeaderCellForColumn(e){let t=null;for(const a of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const n=a.getHtmlElementForColumnHeader(e);n!=null&&(t=n)}return t}cloneItemIntoDummy(e,t){const a=e.cloneNode(!0);a.style.width="",a.style.position="static",a.style.left="";const n=document.createElement("div"),o=n.classList;["ag-header-cell","ag-header-group-cell"].some(l=>a.classList.contains(l))?(o.add("ag-header","ag-header-row"),n.style.position="static"):o.add("ag-row");let i=e.parentElement;for(;i;){if(["ag-header-row","ag-row"].some(s=>i.classList.contains(s))){for(let s=0;s<i.classList.length;s++){const c=i.classList[s];c!="ag-row-position-absolute"&&o.add(c)}break}i=i.parentElement}n.appendChild(a),t.appendChild(n)}},lu={moduleName:"AutoWidth",version:F,beans:[r0]};function i0(e,t,a=!0,n="api"){e.colResize?.setColumnWidths(t,!1,a,n)}function su(e,t){if(!e||e.length==0)return;const a=t(e[0]);for(let n=1;n<e.length;n++)if(a!==t(e[n]))return;return a}function cu(e,t,a){if(!t.length)return;const n=t.length===1?t[0]:null,o=su(t,r=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:n,source:a})}function l0(e,t,a){if(!t.length)return;const n=t.length===1?t[0]:null,o=su(t,r=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:n,source:a})}function du(e,t,a,n){e.dispatchEvent({type:t,columns:a,column:a&&a.length==1?a[0]:null,source:n})}function Ha(e,t,a,n,o=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:a,source:n})}var s0=class extends y{constructor(e,t,a,n){super(),this.comp=e,this.eResize=t,this.pinned=a,this.columnGroup=n}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const{horizontalResizeSvc:e,gos:t,colAutosize:a}=this.beans,n=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(n),!t.get("suppressAutoSize")&&a&&this.addDestroyFunc(a.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:a,resizeRatios:n,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:i}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=a,this.resizeRatios=n,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=i,this.toggleColumnResizing(!0)}onResizing(e,t,a="uiColumnResized"){const n=this.normaliseDragChange(t),o=this.resizeStartWidth+n;this.resizeColumnsFromLocalValues(o,a,e)}getInitialValues(e){const t=s=>s.reduce((c,d)=>c+d.getActualWidth(),0),a=(s,c)=>s.map(d=>d.getActualWidth()/c),n=this.getColumnsToResize(),o=t(n),r=a(n,o),i={columnsToResize:n,resizeStartWidth:o,resizeRatios:r};let l=null;if(e&&(l=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),l){const s=l.getDisplayedLeafColumns(),c=i.groupAfterColumns=s.filter(g=>g.isResizable()),d=i.groupAfterStartWidth=t(c);i.groupAfterRatios=a(c,d)}else i.groupAfterColumns=void 0,i.groupAfterStartWidth=void 0,i.groupAfterRatios=void 0;return i}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),a=this.getInitialValues();t>a.resizeStartWidth&&this.resizeColumns(a,t,e,!0)}resizeColumnsFromLocalValues(e,t,a=!0){if(!this.resizeCols||!this.resizeRatios)return;const n={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(n,e,t,a)}resizeColumns(e,t,a,n=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:i,groupAfterColumns:l,groupAfterStartWidth:s,groupAfterRatios:c}=e,d=[];if(d.push({columns:o,ratios:i,width:t}),l){const g=t-r;d.push({columns:l,ratios:c,width:s-g})}this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:n,source:a}),n&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},c0=class extends y{constructor(e,t,a,n,o){super(),this.pinned=e,this.column=t,this.eResize=a,this.comp=n,this.ctrl=o}postConstruct(){const e=[];let t,a;const n=()=>{if(W(this.eResize,t),!t)return;const{horizontalResizeSvc:i,colAutosize:l}=this.beans,s=i.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(s),a&&l&&e.push(l.addColumnAutosizeListeners(this.eResize,this.column))},o=()=>{for(const i of e)i();e.length=0},r=()=>{const i=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(i!==t||l!==a)&&(t=i,a=l,o(),n())};r(),this.addDestroyFunc(o),this.ctrl.setRefreshFunction("resize",r)}onResizing(e,t){const{column:a,lastResizeAmount:n,resizeStartWidth:o,beans:r}=this,i=this.normaliseResizeAmount(t),l=o+i,s=[{key:a,newWidth:l}],{pinnedCols:c,ctrlsSvc:d,colResize:g}=r;if(this.column.getPinned()){const u=c?.leftWidth??0,h=c?.rightWidth??0,p=ka(d.getGridBodyCtrl().eBodyViewport)-50;if(u+h+(i-n)>p)return}this.lastResizeAmount=i,g?.setColumnWidths(s,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const a=this.pinned!=="left",n=this.pinned==="right";return this.gos.get("enableRtl")?a&&(t*=-1):n&&(t*=-1),t}},d0=class extends y{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,a,n){const o=[],{colModel:r,gos:i,visibleCols:l}=this.beans;for(const s of e){const c=r.getColDefCol(s.key)||r.getCol(s.key);if(!c)continue;if(o.push({width:s.newWidth,ratios:[1],columns:[c]}),i.get("colResizeDefault")==="shift"&&(t=!t),t){const g=l.getColAfter(c);if(!g)continue;const u=c.getActualWidth()-s.newWidth,h=g.getActualWidth()+u;o.push({width:h,ratios:[1],columns:[g]})}}o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:a,source:n})}resizeColumnSets(e){const{resizeSets:t,finished:a,source:n}=e;if(!(!t||t.every(d=>g0(d)))){if(a){const d=t&&t.length>0?t[0].columns:null;Ha(this.eventSvc,d,a,n)}return}const r=[],i=[];for(const d of t){const{width:g,columns:u,ratios:h}=d,p={},f={};for(const b of u)i.push(b);let m=!0,v=0;for(;m;){if(v++,v>1e3){G(31);break}m=!1;const b=[];let w=0,k=g;u.forEach((x,M)=>{if(f[x.getId()])k-=p[x.getId()];else{b.push(x);const O=h[M];w+=O}});const S=1/w;b.forEach((x,M)=>{const L=M===b.length-1;let O;L?O=k:(O=Math.round(h[M]*g*S),k-=O);const H=x.getMinWidth(),B=x.getMaxWidth();O<H?(O=H,f[x.getId()]=!0,m=!0):B>0&&O>B&&(O=B,f[x.getId()]=!0,m=!0),p[x.getId()]=O})}for(const b of u){const w=p[b.getId()];b.getActualWidth()!==w&&(b.setActualWidth(w,n),r.push(b))}}const l=r.length>0;let s=[];if(l){const{colFlex:d,visibleCols:g,colViewport:u}=this.beans;s=d?.refreshFlexedColumns({resizingCols:i,skipSetLeft:!0})??[],g.setLeftValues(n),g.updateBodyWidths(),u.checkViewportColumns()}const c=i.concat(s);(l||a)&&Ha(this.eventSvc,c,a,n,s)}resizeHeader(e,t,a){if(!e.isResizable())return;const n=e.getActualWidth(),o=e.getMinWidth(),r=e.getMaxWidth(),i=Math.min(Math.max(n+t,o),r);this.setColumnWidths([{key:e,newWidth:i}],a,!0,"uiColumnResized")}createResizeFeature(e,t,a,n,o){return new c0(e,t,a,n,o)}createGroupResizeFeature(e,t,a,n){return new s0(e,t,a,n)}};function g0(e){const{columns:t,width:a}=e;let n=0,o=0,r=!0;for(const s of t){const c=s.getMinWidth();n+=c||0;const d=s.getMaxWidth();d>0?o+=d:r=!1}const i=a>=n,l=!r||a<=o;return i&&l}var u0={moduleName:"ColumnResize",version:F,beans:[d0],apiFunctions:{setColumnWidths:i0},dependsOn:[$g,lu]},h0=class extends y{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)})}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",e===0)}},p0=class extends Oi{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,a,n,o){const{column:r,beans:i}=this,{context:l,colNames:s,colHover:c,rangeSvc:d,colResize:g}=i;this.comp=e,o=Rn(this,l,o),this.setGui(t,o),this.displayName=s.getDisplayNameForColumnGroup(r,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(o),this.setupExpandable(o),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:n,compBean:o}),this.setupUserComp(),this.addHeaderMouseListeners(o,n),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const u=this.rowCtrl.pinned,h=r.getProvidedColumnGroup().getLeafColumns();c?.createHoverFeature(o,h,t),d?.createRangeHighlightFeature(o,r,e),o.createManagedBean(new Li(r,t,i)),o.createManagedBean(new h0(e,r)),g?this.resizeFeature=o.createManagedBean(g.createGroupResizeFeature(e,a,u,r)):e.setResizableDisplayed(!1),o.createManagedBean(new Ta(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(o,h),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),o.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(o),o.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.getDefinition();return I(t.gos,{colDef:a,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,a=e.get("groupHeaderHeight");a!=null?a===0?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(a):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const a of t)e.addManagedListeners(a,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,a)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),a=t[0]===e,n=j(t)===e;if(!a&&!n)return;const o=e.getHighlighted(),r=!!this.rowCtrl.getHeaderCellCtrls().find(s=>s.column.isMoving());let i=!1,l=!1;if(r){const s=this.beans.gos.get("enableRtl"),c=o===1,d=o===0;a&&(s?l=c:i=d),n&&(s?i=d:l=c)}this.comp.toggleCss("ag-header-highlight-before",i),this.comp.toggleCss("ag-header-highlight-after",l)}resizeHeader(e,t){const{resizeFeature:a}=this;if(!a)return;const n=a.getInitialValues(t);a.resizeColumns(n,n.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:a,enterpriseMenuFactory:n}=this.beans,o=this.column,r=o.getProvidedColumnGroup(),i=I(a,{displayName:this.displayName,columnGroup:o,setExpanded:s=>{e.setColumnGroupOpened(r,s,"gridInitializing")},setTooltip:(s,c)=>{a.assertModuleRegistered("Tooltip",3),this.setupTooltip(s,c)},showColumnMenu:(s,c)=>n?.showMenuAfterButtonClick(r,s,"columnMenu",c),showColumnMenuAfterMouseClick:(s,c)=>n?.showMenuAfterMouseEvent(r,s,"columnMenu",c),eGridHeader:this.eGui}),l=pb(t,i);l&&this.comp.setUserCompDetails(l)}addHeaderMouseListeners(e,t){const{column:a,comp:n,beans:{rangeSvc:o},gos:r}=this,i=d=>this.handleMouseOverChange(d.type==="mouseenter"),l=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",a.getProvidedColumnGroup()),s=d=>this.handleContextMenuMouseEvent(d,void 0,a.getProvidedColumnGroup());e.addManagedListeners(this.eGui,{mouseenter:i,mouseleave:i,click:l,contextmenu:s}),n.toggleCss("ag-header-group-cell-selectable",na(r));const c=o?.createHeaderGroupCellMouseListenerFeature(this.column,t);c&&this.createManagedBean(c)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,e,t)}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const a=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:a,expandableChanged:a})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),a=Bi(t,this.gos,null,e);e.isPadding()?(a.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(o=>o.isSpanHeaderHeight())&&a.push("ag-header-span-height")):(a.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&a.push("ag-header-cell-wrap-text"));for(const n of a)this.comp.toggleCss(n,!0)}setupMovingCss(e){const{column:t}=this,n=t.getProvidedColumnGroup().getLeafColumns(),o=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const r of n)e.addManagedListeners(r,{movingChanged:o});o()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:a,expandable:n,gos:o,beans:r}=this,i=na(o);if(e.key==C.ENTER){if(i&&!e.altKey)r.rangeSvc?.handleColumnSelection(a,e);else if(n){const l=!a.isExpanded();r.colGroupSvc.setColumnGroupOpened(a.getProvidedColumnGroup(),l,"uiColumnExpanded")}}}refreshAnnouncement(){let e;const{gos:t}=this;na(t)&&(e=this.getLocaleTextFunc()("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group")),this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:a}=this;!a||!t.contains(_(e))||e.ariaAnnounce?.announceValue(a,"columnHeader")}setDragSource(e){!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some(e=>e.getColDef().suppressMovable||e.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function f0(e,t,a){e.colGroupSvc?.setColumnGroupOpened(t,a,"api")}function m0(e,t,a){return e.colGroupSvc?.getColumnGroup(t,a)??null}function v0(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null}function b0(e,t,a){return e.colNames.getDisplayNameForColumnGroup(t,a)||""}function w0(e){return e.colGroupSvc?.getColumnGroupState()??[]}function C0(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}function y0(e){e.colGroupSvc?.resetColumnGroupState("api")}function k0(e){return e.visibleCols.treeLeft}function S0(e){return e.visibleCols.treeCenter}function x0(e){return e.visibleCols.treeRight}function R0(e){return e.visibleCols.getAllTrees()}var sl=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let a;return typeof t!="number"?a=0:a=t+1,this.existingIds[e]=a,a}};function E0(e,t){for(let a=0;a<t.length;a++){const n=e.indexOf(t[a]);n>=0&&(e[n]=e[e.length-1],e.pop())}}var F0=class extends y{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(e,t=!1){const{colFlex:a,colModel:n,colGroupSvc:o,colViewport:r,selectionColSvc:i}=this.beans;t||this.buildTrees(n,o),o?.updateOpenClosedVisibility(),this.leftCols=cl(this.treeLeft),this.centerCols=cl(this.treeCenter),this.rightCols=cl(this.treeRight),i?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(n),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(l=>l.isAutoHeight()),a?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(n,this.leftCols,this.rightCols,e),r.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let e=0;for(const t of this.allCols){let a=t.getParent();for(;a;){if(!a.isPadding()){const n=a.getProvidedColumnGroup().getLevel()+1;n>e&&(e=n);break}a=a.getParent()}}return e}updateBodyWidths(){const e=pt(this.centerCols),t=pt(this.leftCols),a=pt(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==a)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=a,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e,t,a,n){let o,r;this.gos.get("enableRtl")?(o=t?t[0]:null,r=a?j(a):null):(o=t?j(t):null,r=a?a[0]:null);for(const i of e.getCols())i.setLastLeftPinned(i===o,n),i.setFirstRightPinned(i===r,n)}buildTrees(e,t){const a=e.getColsToShow(),n=a.filter(s=>s.getPinned()=="left"),o=a.filter(s=>s.getPinned()=="right"),r=a.filter(s=>s.getPinned()!="left"&&s.getPinned()!="right"),i=new sl,l=s=>t?t.createColumnGroups(s):s.columns;this.treeLeft=l({columns:n,idCreator:i,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=l({columns:o,idCreator:i,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=l({columns:r,idCreator:i,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),a=[],n=[],o=[];for(const r of t){const i=r.getPinned();i?i===!0||i==="left"?a.push(r):o.push(r):n.push(r)}this.ariaOrderColumns=a.concat(n).concat(o)}getAriaColIndex(e){let t;return ee(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)ee(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const n=t.getCols().slice(0),o=this.gos.get("enableRtl");for(const r of[this.leftCols,this.rightCols,this.centerCols]){if(o){let i=pt(r);for(const l of r)i-=l.getActualWidth(),l.setLeft(i,e)}else{let i=0;for(const l of r)l.setLeft(i,e),i+=l.getActualWidth()}E0(n,r)}for(const r of n)r.setLeft(null,e)}joinCols(){this.gos.get("enableRtl")?this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols):this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){const{leftCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,a,n){const o=[];let r=null;for(let i=0;i<t.length;i++){const l=t[i],s=t.length-i,c=Math.min(l.getColSpan(e),s),d=[l];if(c>1){const u=c-1;for(let h=1;h<=u;h++)d.push(t[i+h]);i+=u}let g;if(a){g=!1;for(const u of d)a(u)&&(g=!0)}else g=!0;g&&(o.length===0&&r&&(n&&n(l))&&o.push(r),o.push(l)),r=l}return o}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,a=t.indexOf(e);return a>0?t[a-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};ca(this.treeCenter,!1,e),ca(this.treeLeft,!1,e),ca(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["leftCols","centerCols","rightCols"];e&&t.reverse();for(let a=0;a<t.length;a++){const n=this[t[a]];if(n.length)return e?j(n):n[0]}return null}getColAfter(e){const t=this.allCols,a=t.indexOf(e);return a<t.length-1?t[a+1]:null}getColsLeftWidth(){return pt(this.leftCols)}getDisplayedColumnsRightWidth(){return pt(this.rightCols)}isColAtEdge(e,t){const a=this.allCols;if(!a.length)return!1;const n=t==="first";let o;if(ee(e)){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=n?r[0]:j(r)}else o=e;return(n?a[0]:j(a))===o}};function ca(e,t,a){if(e)for(let n=0;n<e.length;n++){const o=e[n];if(ee(o)){const r=t?o.getDisplayedChildren():o.getChildren();ca(r,t,a)}a(o)}}function cl(e){const t=[];return ca(e,!0,a=>{dt(a)&&t.push(a)}),t}var M0=class extends y{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[],t=this.beans.colModel.getColTree();return $e(null,t,a=>{de(a)&&e.push({groupId:a.getGroupId(),open:a.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const a=[];$e(null,t,n=>{if(de(n)){const o=n.getColGroupDef(),r={groupId:n.getGroupId(),open:o?o.openByDefault:void 0};a.push(r)}}),this.setColumnGroupState(a,e)}setColumnGroupState(e,t){const{colModel:a,colAnimation:n,visibleCols:o,eventSvc:r}=this.beans;if(!a.getColTree().length)return;n?.start();const l=[];for(const s of e){const c=s.groupId,d=s.open,g=this.getProvidedColGroup(c);g&&g.isExpanded()!==d&&(g.setExpanded(d),l.push(g))}o.refresh(t,!0),l.length&&r.dispatchEvent({type:"columnGroupOpened",columnGroup:l.length===1?l[0]:void 0,columnGroups:l}),n?.finish()}setColumnGroupOpened(e,t,a){let n;de(e)?n=e.getId():n=e||"",this.setColumnGroupState([{groupId:n,open:t}],a)}getProvidedColGroup(e){let t=null;return $e(null,this.beans.colModel.getColTree(),a=>{de(a)&&a.getId()===e&&(t=a)}),t}getGroupAtDirection(e,t){const a=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),n=e.getDisplayedLeafColumns(),o=t==="After"?j(n):n[0],r=`getCol${t}`;for(;;){const i=this.beans.visibleCols[r](o);if(!i)return null;const l=this.getColGroupAtLevel(i,a);if(l!==e)return l}}getColGroupAtLevel(e,t){let a=e.getParent(),n,o;for(;n=a.getProvidedColumnGroup().getLevel(),o=a.getPaddingLevel(),!(n+o<=t);)a=a.getParent();return a}updateOpenClosedVisibility(){const e=this.beans.visibleCols.getAllTrees();ca(e,!1,t=>{ee(t)&&t.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(ee(e))return e;const a=this.beans.visibleCols.getAllTrees(),n=typeof t=="number";let o=null;return ca(a,!1,r=>{if(ee(r)){const i=r;let l;n?l=e===i.getGroupId()&&t===i.getPartId():l=e===i.getGroupId(),l&&(o=i)}}),o}createColumnGroups(e){const{columns:t,idCreator:a,pinned:n,oldDisplayedGroups:o,isStandaloneStructure:r}=e,i=this.mapOldGroupsById(o),l=[];let s=t;for(;s.length;){const c=s;s=[];let d=0;const g=u=>{const h=d;d=u;const p=c[h],m=(ee(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let b=h;b<u;b++)l.push(c[b]);return}const v=this.createColumnGroup(m,a,i,n,r);for(let b=h;b<u;b++)v.addChild(c[b]);s.push(v)};for(let u=1;u<c.length;u++){const h=c[u],f=(ee(h)?h.getProvidedColumnGroup():h).getOriginalParent(),m=c[d],b=(ee(m)?m.getProvidedColumnGroup():m).getOriginalParent();f!==b&&g(u)}d<c.length&&g(c.length)}return r||this.setupParentsIntoCols(l,null),l}createProvidedColumnGroup(e,t,a,n,o,r,i){const l=o.getUniqueKey(t.groupId||null,null),s=$r(this.beans,t,l),c=new Aa(s,l,!1,a);this.createBean(c);const d=this.findExistingGroup(t,r);d&&r.splice(d.idx,1);const g=d?.group;g&&c.setExpanded(g.isExpanded());const u=id(this.beans,s.children,a+1,e,n,o,r,i);return c.setChildren(u),c}balanceColumnTree(e,t,a,n){const o=[];for(let r=0;r<e.length;r++){const i=e[r];if(de(i)){const l=i,s=this.balanceColumnTree(l.getChildren(),t+1,a,n);l.setChildren(s),o.push(l)}else{let l,s;for(let c=t;c<a;c++){const d=n.getUniqueKey(null,null),g=$r(this.beans,null,d),u=new Aa(g,d,!0,c);this.createBean(u),s&&s.setChildren([u]),s=u,l||(l=s)}if(l&&s)if(o.push(l),e.some(d=>de(d))){s.setChildren([i]);continue}else{s.setChildren(e);break}o.push(i)}}return o}findDepth(e){let t=0,a=e;for(;a?.[0]&&de(a[0]);)t++,a=a[0].getChildren();return t}findMaxDepth(e,t){let a=t;for(let n=0;n<e.length;n++){const o=e[n];if(de(o)){const r=o,i=this.findMaxDepth(r.getChildren(),t+1);a<i&&(a=i)}}return a}balanceTreeForAutoCols(e,t){const a=[];for(const n of e){let o=n;for(let r=t-1;r>=0;r--){const i=new Aa(null,`FAKE_PATH_${n.getId()}_${r}`,!0,r);this.createBean(i),i.setChildren([o]),o.originalParent=i,o=i}t===0&&(n.originalParent=null),a.push(o)}return a}findExistingGroup(e,t){if(e.groupId!=null)for(let n=0;n<t.length;n++){const o=t[n];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:n,group:o}}}createColumnGroup(e,t,a,n,o){const r=e.getGroupId(),i=t.getInstanceIdForKey(r),l=hd(r,i);let s=a[l];return s&&s.getProvidedColumnGroup()!==e&&(s=null),z(s)?s.reset():(s=new Ia(e,r,i,n),o||this.createBean(s)),s}mapOldGroupsById(e){const t={},a=n=>{for(const o of n)if(ee(o)){const r=o;t[o.getUniqueId()]=r,a(r.getChildren())}};return e&&a(e),t}setupParentsIntoCols(e,t){for(const a of e??[])if(a.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),a.parent=t,ee(a)){const n=a;this.setupParentsIntoCols(n.getChildren(),n)}}},gu={moduleName:"ColumnGroup",version:F,dynamicBeans:{headerGroupCellCtrl:p0},beans:[M0],apiFunctions:{getAllDisplayedColumnGroups:R0,getCenterDisplayedColumnGroups:S0,getColumnGroup:m0,getColumnGroupState:w0,getDisplayNameForColumnGroup:b0,getLeftDisplayedColumnGroups:k0,getProvidedColumnGroup:v0,getRightDisplayedColumnGroups:x0,resetColumnGroupState:y0,setColumnGroupOpened:f0,setColumnGroupState:C0}};function Be(e,t,a){const{colModel:n,rowGroupColsSvc:o,pivotColsSvc:r,autoColSvc:i,selectionColSvc:l,colAnimation:s,visibleCols:c,pivotResultCols:d,environment:g,valueColsSvc:u,eventSvc:h,gos:p}=e,f=n.getColDefCols()??[],m=l?.getColumns();if(!f.length&&!m?.length)return!1;if(t?.state&&!t.state.forEach)return R(32),!1;const v=(S,x,M,L,O)=>{if(!S)return;const H=Bv(x,t.defaultState),B=H("flex").value1,Y=H("sort").value1,q=H("sortType").value1,ge=ut(Y)||yo(q),re=Xe(q),Ls=pn(Y),Bs=ge?{type:re,direction:Ls}:void 0;if(ld(e,S,H("hide").value1,Bs,H("sortIndex").value1,H("pinned").value1,B,a),B==null){const Qa=H("width").value1;if(Qa!=null){const Zn=S.getColDef().minWidth??g.getDefaultColumnMinWidth();Zn!=null&&Qa>=Zn&&S.setActualWidth(Qa,a)}}O||!S.isPrimary()||(u?.syncColumnWithState(S,a,H),o?.syncColumnWithState(S,a,H,M),r?.syncColumnWithState(S,a,H,L))},b=(S,x,M)=>{const L=hu(e,a),O=x.slice(),H={},B={},Y=[],q=[],ge=[];let re=0;const Ls=o?.columns.slice()??[],Bs=r?.columns.slice()??[];for(const Se of S){const Jn=Se.colId;if(Jn.startsWith(ht)){Y.push(Se),ge.push(Se);continue}if(ft(Jn)){q.push(Se),ge.push(Se);continue}const Za=M(Jn);Za?(v(Za,Se,H,B,!1),Pe(O,Za)):(ge.push(Se),re+=1)}const Qa=Se=>v(Se,null,H,B,!1);O.forEach(Qa),o?.sortColumns(fu.bind(o,H,Ls)),r?.sortColumns(fu.bind(r,B,Bs)),n.refreshCols(!1,a);const Zn=(Se,Jn,Os=[])=>{for(const Za of Jn){const im=Se(Za.colId);Pe(Os,im),v(im,Za,null,null,!0)}Os.forEach(Qa)};return Zn(Se=>i?.getColumn(Se)??null,Y,i?.getColumns()?.slice()),Zn(Se=>l?.getColumn(Se)??null,q,l?.getColumns()?.slice()),z0(t,n,p),c.refresh(a),h.dispatchEvent({type:"columnEverythingChanged",source:a}),L(),{unmatchedAndAutoStates:ge,unmatchedCount:re}};s?.start();let{unmatchedAndAutoStates:w,unmatchedCount:k}=b(t.state||[],f,S=>n.getColDefCol(S));if(w.length>0||z(t.defaultState)){const S=d?.getPivotResultCols()?.list??[];k=b(w,S,x=>d?.getPivotResultCol(x)??null).unmatchedCount}return s?.finish(),k===0}function uu(e,t){const{colModel:a,autoColSvc:n,selectionColSvc:o,eventSvc:r,gos:i}=e,l=a.getColDefCols();if(!l?.length)return;const s=a.getColDefColTree(),c=ti(s),d=[];let g=1e3,u=1e3;const h=b=>{const w=pu(b);K(w.rowGroupIndex)&&w.rowGroup&&(w.rowGroupIndex=g++),K(w.pivotIndex)&&w.pivot&&(w.pivotIndex=u++),d.push(w)};n?.getColumns()?.forEach(h),o?.getColumns()?.forEach(h),c?.forEach(h),Be(e,{state:d},t);const p=n?.getColumns()??[],v=[...o?.getColumns()??[],...p,...l].map(b=>({colId:b.colId}));Be(e,{state:v,applyOrder:!0},t),r.dispatchEvent(I(i,{type:"columnsReset",source:t}))}function hu(e,t){const{rowGroupColsSvc:a,pivotColsSvc:n,valueColsSvc:o,colModel:r,sortSvc:i,eventSvc:l}=e,s={rowGroupColumns:a?.columns.slice()??[],pivotColumns:n?.columns.slice()??[],valueColumns:o?.columns.slice()??[]},c=Dn(e),d={};for(const g of c)d[g.colId]=g;return()=>{const g=(x,M,L,O)=>{const H=M.map(O),B=L.map(O);if(lt(H,B))return;const q=new Set(M);for(const re of L)q.delete(re)||q.add(re);const ge=[...q];l.dispatchEvent({type:x,columns:ge,column:ge.length===1?ge[0]:null,source:t})},u=x=>{const M=[];return r.forAllCols(L=>{const O=d[L.getColId()];O&&x(O,L)&&M.push(L)}),M},h=x=>x.getColId();g("columnRowGroupChanged",s.rowGroupColumns,a?.columns??[],h),g("columnPivotChanged",s.pivotColumns,n?.columns??[],h);const f=u((x,M)=>{const L=x.aggFunc!=null,O=L!=M.isValueActive(),H=L&&x.aggFunc!=M.getAggFunc();return O||H});f.length>0&&du(l,"columnValueChanged",f,t),Ha(l,u((x,M)=>x.width!=M.getActualWidth()),!0,t),cu(l,u((x,M)=>x.pinned!=M.getPinned()),t),l0(l,u((x,M)=>x.hide==M.isVisible()),t);const k=u((x,M)=>!hn(M.getSortDef(),{type:Xe(x.sortType),direction:pn(x.sort)})||x.sortIndex!=M.getSortIndex());k.length>0&&i?.dispatchSortChangedEvents(t,k);const S=Dn(e);A0(c,S,t,r,l)}}function Dn(e){const{colModel:t,rowGroupColsSvc:a,pivotColsSvc:n}=e,o=t.getColDefCols();if(K(o)||!t.isAlive())return[];const r=a?.columns,i=n?.columns,l=[],s=d=>{const g=d.isRowGroupActive()&&r?r.indexOf(d):null,u=d.isPivotActive()&&i?i.indexOf(d):null,h=d.isValueActive()?d.getAggFunc():null,p=d.getSortIndex()!=null?d.getSortIndex():null;l.push({colId:d.getColId(),width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:d.getSort(),sortType:d.getSortDef()?.type,sortIndex:p,aggFunc:h,rowGroup:d.isRowGroupActive(),rowGroupIndex:g,pivot:d.isPivotActive(),pivotIndex:u,flex:d.getFlex()??null})};t.forAllCols(d=>s(d));const c=new Map(t.getCols().map((d,g)=>[d.getColId(),g]));return l.sort((d,g)=>{const u=c.has(d.colId)?c.get(d.colId):-1,h=c.has(g.colId)?c.get(g.colId):-1;return u-h}),l}function pu(e){const t=(m,v)=>m??v??null,a=e.getColDef(),n=ze(t(a.sort,a.initialSort)),o=n.direction,r=n.type,i=t(a.sortIndex,a.initialSortIndex),l=t(a.hide,a.initialHide),s=t(a.pinned,a.initialPinned),c=t(a.width,a.initialWidth),d=t(a.flex,a.initialFlex);let g=t(a.rowGroupIndex,a.initialRowGroupIndex),u=t(a.rowGroup,a.initialRowGroup);g==null&&!u&&(g=null,u=null);let h=t(a.pivotIndex,a.initialPivotIndex),p=t(a.pivot,a.initialPivot);h==null&&!p&&(h=null,p=null);const f=t(a.aggFunc,a.initialAggFunc);return{colId:e.getColId(),sort:o,sortType:r,sortIndex:i,hide:l,pinned:s,width:c,flex:d,rowGroup:u,rowGroupIndex:g,pivot:p,pivotIndex:h,aggFunc:f}}function z0(e,t,a){if(!e.applyOrder||!e.state)return;const n=[];for(const o of e.state)o.colId!=null&&n.push(o.colId);D0(t.cols,n,t,a)}function D0(e,t,a,n){if(e==null)return;let o=[];const r={};for(const l of t){if(r[l])continue;const s=e.map[l];s&&(o.push(s),r[l]=!0)}let i=0;for(const l of e.list){const s=l.getColId();if(r[s]!=null)continue;s.startsWith(ht)?o.splice(i++,0,l):o.push(l)}if(o=ou(o,n),!ru(o,a.getColTree())){R(39);return}e.list=o}function A0(e,t,a,n,o){const r={};for(const d of t)r[d.colId]=d;const i={};for(const d of e)r[d.colId]&&(i[d.colId]=!0);const l=e.filter(d=>i[d.colId]),s=t.filter(d=>i[d.colId]),c=[];s.forEach((d,g)=>{const u=l?.[g];if(u&&u.colId!==d.colId){const h=n.getCol(u.colId);h&&c.push(h)}}),c.length&&o.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:a})}var fu=(e,t,a,n)=>{const o=e[a.getId()],r=e[n.getId()],i=o!=null,l=r!=null;if(i&&l)return o-r;if(i)return-1;if(l)return 1;const s=t.indexOf(a),c=t.indexOf(n),d=s>=0,g=c>=0;return d&&g?s-c:d?-1:1},P0=class extends y{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"],e=>this.refreshAll(oa(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),oa(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:a,colAutosize:n,rowGroupColsSvc:o,pivotColsSvc:r,valueColsSvc:i,visibleCols:l,eventSvc:s,groupHierarchyColSvc:c}=t,d=this.colDefs?hu(t,e):void 0;a?.expire();const g=this.colDefCols?.list,u=this.colDefCols?.tree,h=od(t,this.colDefs,!0,u,e);mn(t,this.colDefCols?.tree,h.columnTree);const p=h.columnTree,f=h.treeDepth,m=ti(p),v={};for(const b of m)v[b.getId()]=b;this.colDefCols={tree:p,treeDepth:f,list:m,map:v},this.createColumnsForService([c],this.colDefCols,e),o?.extractCols(e,g),r?.extractCols(e,g),i?.extractCols(e,g),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,l.refresh(e),s.dispatchEvent({type:"columnEverythingChanged",source:e}),d&&(this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1),s.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&n?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;const a=this.cols?.tree;this.saveColOrder();const{autoColSvc:n,selectionColSvc:o,rowNumbersSvc:r,quickFilter:i,pivotResultCols:l,showRowGroupCols:s,rowAutoHeight:c,visibleCols:d,colViewport:g,eventSvc:u,formula:h}=this.beans,p=this.selectCols(l,this.colDefCols);h?.setFormulasActive(p),this.createColumnsForService([n,o,r],p,t);const f=gv(this.gos,this.showingPivotResult);(!e||f)&&this.restoreColOrder(p),this.positionLockedCols(p),s?.refresh(),i?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),g.clear(),lt(a,this.cols.tree)||u.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,a){for(const n of e)n&&(n.createColumns(t,o=>{this.lastOrder=o(this.lastOrder),this.lastPivotOrder=o(this.lastPivotOrder)},a),n.addColumns(t))}selectCols(e,t){const a=e?.getPivotResultCols()??null;this.showingPivotResult=a!=null;const{map:n,list:o,tree:r,treeDepth:i}=a??t;return this.cols={list:o.slice(),map:{...n},tree:r.slice(),treeDepth:i},a&&(a.list.some(s=>this.cols?.map[s.getColId()]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:a}=this,{valueColsSvc:n,selectionColSvc:o,gos:r}=e,i=this.isPivotMode()&&!t,l=o?.isSelectionColumnEnabled(),s=Vc(e),c=n?.columns,d=Wc(r);return a.list.filter(u=>{const h=xo(u);return i?c?.includes(u)||h&&(!d||u.isVisible())||l&&ft(u)||s&&pe(u):h&&!d||u.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,a){Be(this.beans,{state:e.map(n=>({colId:typeof n=="string"?n:n.getColId(),hide:!t}))},a)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const a=t.filter(g=>e.map[g.getId()]!=null);if(a.length===0)return;if(a.length===e.list.length){e.list=a;return}const n=g=>{const u=g.getOriginalParent();return u?u.getChildren().length>1?!0:n(u):!1};if(!a.some(g=>n(g))){const g=new Set(a);for(const u of e.list)g.has(u)||a.push(u);e.list=a;return}const o=new Map;for(let g=0;g<a.length;g++){const u=a[g];o.set(u,g)}const r=e.list.filter(g=>!o.has(g));if(r.length===0){e.list=a;return}const i=(g,u)=>{const h=u?u.getOriginalParent():g.getOriginalParent();if(!h)return null;let p=null,f=null;for(const m of h.getChildren())if(!(m===u||m===g)){if(m instanceof gt){const v=o.get(m);if(v==null)continue;(p==null||p<v)&&(p=v,f=m);continue}m.forEachLeafColumn(v=>{const b=o.get(v);b!=null&&(p==null||p<b)&&(p=b,f=v)})}return f??i(g,h)},l=[],s=new Map;for(const g of r){const u=i(g,null);if(u==null){l.push(g);continue}const h=s.get(u);h===void 0?s.set(u,g):Array.isArray(h)?h.push(g):s.set(u,[h,g])}const c=new Array(e.list.length);let d=c.length-1;for(let g=l.length-1;g>=0;g--)c[d--]=l[g];for(let g=a.length-1;g>=0;g--){const u=a[g],h=s.get(u);if(h)if(Array.isArray(h))for(let p=h.length-1;p>=0;p--){const f=h[p];c[d--]=f}else c[d--]=h;c[d--]=u}e.list=c}positionLockedCols(e){e.list=ou(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:a,eventSvc:n}=this.beans;a.refresh(t),n.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=oa(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){mn(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(e){const{pivotResultCols:t,autoColSvc:a,selectionColSvc:n,groupHierarchyColSvc:o}=this.beans;Xa(this.colDefCols?.list,e)||Xa(a?.columns?.list,e)||Xa(n?.columns?.list,e)||Xa(o?.columns?.list,e)||Xa(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;const{map:a,list:n}=t;if(typeof e=="string"&&a[e])return a[e];for(let l=0;l<n.length;l++)if(Pa(n[l],e))return n[l];const{autoColSvc:o,selectionColSvc:r,groupHierarchyColSvc:i}=this.beans;return o?.getColumn(e)??r?.getColumn(e)??i?.getColumn(e)??null}},I0=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",mu=class extends ra{constructor(e,t,a){super(t,a),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(I0)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:a,labelAlignment:n,disabled:o,labelEllipsis:r}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),a!=null&&this.setLabelWidth(a),r!=null&&this.setLabelEllipsis(r),this.setLabelAlignment(n||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;le(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(W(t,!1),_e(t,"presentation")):(W(t,!0),_e(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const a=this.getGui().classList;return a.toggle("ag-label-align-left",e==="left"),a.toggle("ag-label-align-right",e==="right"),a.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(go(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return ya(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},dl=class extends mu{constructor(e,t,a,n){super(e,t,a),this.className=n}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:a,ariaLabel:n}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),a!=null&&this.onValueChange(a),n!=null&&this.setAriaLabel(n),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),a=this.getLabel();a==null||a==""||ym(e)!==null?ba(e,""):ba(e,t??"")}setAriaLabel(e){return Kt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Ne(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function T0(e){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:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var Lt=class extends dl{constructor(e,t,a="text",n="input"){super(e,e?.template??T0(n),[],t),this.inputType=a,this.displayFieldTag=n,this.eLabel=E,this.eWrapper=E,this.eInput=E}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:a,className:n}=this;e.classList.add(`${n}-label`),t.classList.add(`${n}-input-wrapper`),a.classList.add(`${n}-input`),this.addCss("ag-input-field"),a.id=a.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:r,inputPlaceholder:i,autoComplete:l,tabIndex:s}=this.config;o!=null&&this.setInputName(o),r!=null&&this.setInputWidth(r),i!=null&&this.setInputPlaceholder(i),l!=null&&this.setAutoComplete(l),this.addInputListeners(),this.activateTabIndex([a],s)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,we(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return go(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return we(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Kt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ya(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)we(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";we(this.eInput,"autocomplete",t)}return this}},An=class extends Lt{constructor(e,t="ag-checkbox",a="checkbox"){super(e,t,a),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:a}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t),a!=null&&this.setName(a)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const a=this.eInput;a.checked=e,a.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,a){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:a});const n=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:n.id,name:n.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),a=this.selected=e.target.checked;this.refreshSelectedClass(a),this.dispatchChange(a,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},Yo={selector:"AG-CHECKBOX",component:An},L0=".ag-checkbox-cell{height:100%}",B0={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},O0=class extends U{constructor(){super(B0,[Yo]),this.eCheckbox=E,this.registerCSS(L0)}init(e){this.refresh(e);const{eCheckbox:t,beans:a}=this,n=t.getInputElement();n.setAttribute("tabindex","-1"),Us(n,"polite"),this.addManagedListeners(n,{click:o=>{if(At(o),t.isDisabled())return;const r=t.getValue();this.onCheckboxChanged(r)},dblclick:o=>{At(o)}}),this.addManagedElementListeners(e.eGridCell,{keydown:o=>{if(o.key===C.SPACE&&!t.isDisabled()){e.eGridCell===_(a)&&t.toggle();const r=t.getValue();this.onCheckboxChanged(r),o.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,a=!0;const{value:n,column:o,node:r}=e;if(r.group&&o)if(typeof n=="boolean")t=n;else{const g=o.getColId();g.startsWith(ht)?t=n==null||n===""?void 0:n==="true":r.aggData&&r.aggData[g]!==void 0||r.sourceRowIndex>=0?t=n??void 0:a=!1}else t=n??void 0;const{eCheckbox:i}=this;if(!a){i.setDisplayed(!1);return}i.setValue(t);const l=e.disabled??!o?.isCellEditable(r);i.setDisabled(l);const s=this.getLocaleTextFunc(),c=io(s,t),d=l?c:`${s("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;i.setInputAriaLabel(d)}onCheckboxChanged(e){const{params:t}=this,{column:a,node:n,value:o}=t,{editSvc:r}=this.beans;if(!a)return;const i={rowNode:n,column:a};r?.dispatchCellEvent(i,null,"cellEditingStarted",{value:o});const l=n.setDataValue(a,e,"ui");r?.dispatchCellEvent(i,null,"cellEditingStopped",{oldValue:o,newValue:e,valueChanged:l}),l||this.updateCheckbox(t)}},H0={tag:"div",cls:"ag-skeleton-container"},N0=class extends U{constructor(){super(H0)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>ba(e.eParentOfValue)),ba(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Kt(this.getGui(),t)}setupLoading(e){const t=oe({tag:"div",cls:"ag-skeleton-effect"}),a=e.node.rowIndex;if(a!=null){const r=75+25*(a%2===0?Math.sin(a):Math.cos(a));t.style.width=`${r}%`}this.getGui().appendChild(t);const n=this.getLocaleTextFunc(),o=e.deferRender?n("ariaDeferSkeletonCellLoading","Cell is loading"):n("ariaSkeletonCellLoading","Row data is loading");Kt(this.getGui(),o)}refresh(e){return!1}},V0={moduleName:"CheckboxCellRenderer",version:F,userComponents:{agCheckboxCellRenderer:O0}},G0={moduleName:"SkeletonCellRenderer",version:F,userComponents:{agSkeletonCellRenderer:N0}};function q0(e,t){const a=e.colModel.getColDefCol(t);return a?a.getColDef():null}function W0(e){return e.colModel.getColumnDefs(!0)}function U0(e,t,a){return e.colNames.getDisplayNameForColumn(t,a)||""}function j0(e,t){return e.colModel.getColDefCol(t)}function Y0(e){return e.colModel.getColDefCols()}function K0(e,t){return Be(e,t,"api")}function _0(e){return Dn(e)}function Q0(e){uu(e,"api")}function Z0(e){return e.visibleCols.isPinningLeft()||e.visibleCols.isPinningRight()}function J0(e){return e.visibleCols.isPinningLeft()}function X0(e){return e.visibleCols.isPinningRight()}function $0(e,t){return e.visibleCols.getColAfter(t)}function e1(e,t){return e.visibleCols.getColBefore(t)}function t1(e,t,a){e.colModel.setColsVisible(t,a,"api")}function a1(e,t,a){e.pinnedCols?.setColsPinned(t,a,"api")}function n1(e){return e.colModel.getCols()}function o1(e){return e.visibleCols.leftCols}function r1(e){return e.visibleCols.centerCols}function i1(e){return e.visibleCols.rightCols}function l1(e){return e.visibleCols.allCols}function s1(e){return e.colViewport.getViewportColumns()}function gl(e,t){if(!e)return;const a=e,n={};for(const o of Object.keys(a)){if(t&&t.indexOf(o)>=0||Cc.has(o))continue;const r=a[o];typeof r=="object"&&r!==null&&r.constructor===Object?n[o]=gl(r):n[o]=r}return n}var c1=class extends y{constructor(){super(...arguments),this.beanName="colDefFactory"}wireBeans(e){this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc}getColumnDefs(e,t,a,n,o=!1){const r=e.slice();t?r.sort((s,c)=>a.indexOf(s)-a.indexOf(c)):(a||o)&&r.sort((s,c)=>n.indexOf(s)-n.indexOf(c));const i=this.rowGroupColsSvc?.columns,l=this.pivotColsSvc?.columns;return this.buildColumnDefs(r,i,l)}buildColumnDefs(e,t=[],a=[]){const n=[],o={};for(const r of e){const i=this.createDefFromColumn(r,t,a);let l=!0,s=i,c=r.getOriginalParent(),d=null;for(;c;){let g=null;if(c.isPadding()){c=c.getOriginalParent();continue}const u=o[c.getGroupId()];if(u){u.children.push(s),l=!1;break}if(g=this.createDefFromGroup(c),g&&(g.children=[s],o[g.groupId]=g,s=g,c=c.getOriginalParent()),c!=null&&d===c){l=!1;break}d=c}l&&n.push(s)}return n}createDefFromGroup(e){const t=gl(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,a){const n=gl(e.getColDef());return n.colId=e.getColId(),n.width=e.getActualWidth(),n.rowGroup=e.isRowGroupActive(),n.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,n.pivot=e.isPivotActive(),n.pivotIndex=e.isPivotActive()?a.indexOf(e):null,n.aggFunc=e.isValueActive()?e.getAggFunc():null,n.hide=e.isVisible()?void 0:!0,n.pinned=e.isPinned()?e.getPinned():null,n.sort=e.getSortDef(),n.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,n}},d1=class extends y{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth);const a=this.flexViewportWidth,{visibleCols:n,colDelayRenderSvc:o}=this.beans,r=n.centerCols;let i=-1;if(e.resizingCols){const f=new Set(e.resizingCols);for(let m=r.length-1;m>=0;m--)if(f.has(r[m])){i=m;break}}let l=!1;const s=r.map((f,m)=>{const v=f.getFlex(),b=v!=null&&v>0&&m>i;return l||(l=b),{col:f,isFlex:b,flex:Math.max(0,v??0),initialSize:f.getActualWidth(),min:f.getMinWidth(),max:f.getMaxWidth(),targetSize:0}});if(l?(o?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(o),!a||!l)return[];let c=s.length,d=s.reduce((f,m)=>f+m.flex,0),g=a;const u=(f,m)=>{f.frozenSize=m,f.col.setActualWidth(m,t),g-=m,d-=f.flex,c-=1},h=f=>f.frozenSize!=null;for(const f of s)f.isFlex||u(f,f.initialSize);for(;c>0;){const f=Math.round(d<1?g*d:g);let m,v=0,b=0;for(const S of s){if(h(S))continue;m=S,b+=f*(S.flex/d);const x=b-v,M=Math.round(x);S.targetSize=M,v+=M}m&&(m.targetSize+=f-v);let w=0;for(const S of s){if(h(S))continue;const x=S.targetSize,M=Math.min(Math.max(x,S.min),S.max);w+=M-x,S.violationType=M===x?void 0:M<x?"max":"min",S.targetSize=M}const k=w===0?"all":w>0?"min":"max";for(const S of s)h(S)||(k==="all"||S.violationType===k)&&u(S,S.targetSize)}e.skipSetLeft||n.setLeftValues(t),e.updateBodyWidths&&n.updateBodyWidths();const p=s.filter(f=>f.isFlex&&!f.violationType).map(f=>f.col);if(e.fireResizedEvent){const f=s.filter(v=>v.initialSize!==v.frozenSize).map(v=>v.col),m=s.filter(v=>v.flex).map(v=>v.col);Ha(this.eventSvc,f,!0,t,m)}return this.revealColumns(o),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:a}=e.colDef;t!==void 0?e.flex=t:a!==void 0&&(e.flex=a)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}},ke=e=>{if(typeof e=="bigint")return e;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&(t=e.trim(),t===""||(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))))return null;if(t==null)return null;try{return BigInt(t)}catch{return null}},ul="T",g1=new RegExp(`[${ul} ]`),u1=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${ul}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function at(e,t){return e.toString().padStart(t,"0")}function fe(e,t=!0,a=ul){if(!e)return null;let n=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>at(o,2)).join("-");return t&&(n+=a+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>at(o,2)).join(":")),n}function Pn(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),at(e.getDate(),2),at(e.getHours(),2),`:${at(e.getMinutes(),2)}`,`:${at(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,at(e.getDate(),2)].map(String):null}var hl=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},pl=["January","February","March","April","May","June","July","August","September","October","November","December"],fl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function h1(e,t){if(t==null)return fe(e,!1);const a=at(e.getFullYear(),4),n={YYYY:()=>a.slice(a.length-4,a.length),YY:()=>a.slice(a.length-2,a.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>pl[e.getMonth()],MMM:()=>pl[e.getMonth()].slice(0,3),MM:()=>at(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${hl(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${hl(e.getDate())}`,DD:()=>at(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>fl[e.getDay()],ddd:()=>fl[e.getDay()].slice(0,3),dd:()=>fl[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${hl(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(n).join("|"),"g");return t.replace(o,r=>r in n?n[r]():r)}function Ko(e,t=!1){return!!me(e,t)}function p1(e){return Ko(e,!0)}function me(e,t=!1,a){if(!e||!a&&!u1.test(e))return null;const[n,o]=e.split(g1);if(!n)return null;const r=n.split("-").map(h=>Number.parseInt(h,10));if(r.filter(h=>!isNaN(h)).length!==3)return null;const[i,l,s]=r,c=new Date(i,l-1,s);if(c.getFullYear()!==i||c.getMonth()!==l-1||c.getDate()!==s||!o&&t)return null;if(!o||o==="00:00:00")return c;const[d,g,u]=o.split(":").map(h=>Number.parseInt(h,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(g>=0&&g<60)c.setMinutes(g);else if(t)return null;if(u>=0&&u<60)c.setSeconds(u);else if(t)return null;return c}function In(e,t,a){if(!t||!e)return;if(!a)return e[t];const n=t.split(".");let o=e;for(let r=0;r<n.length;r++){if(o==null)return;o=o[n[r]]}return o}var f1=["dateTimeString","dateString","text","number","bigint","boolean","date"],m1=class extends y{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number(){return{cellEditor:"agNumberCellEditor"}},bigint({filterModuleBean:e}){return e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:C1,absolute:y1}}},boolean(){return{cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:a})=>t.key===C.SPACE&&a.isCellEditable(e)}},date({formatValue:e}){return{cellEditor:"agDateCellEditor",keyCreator:e}},dateString({formatValue:e}){return{cellEditor:"agDateStringCellEditor",keyCreator:e}},dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object({formatValue:e,colModel:t,colId:a}){return{cellEditorParams:{useFormatter:!0},comparator:(n,o)=>{const r=t.getColDefCol(a),i=r?.getColDef();if(!r||!i)return 0;const l=n==null?"":e({column:r,node:null,value:n}),s=o==null?"":e({column:r,node:null,value:o});return l===s?0:l>s?1:-1},keyCreator:e}},text(){return{}}}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},a={},n=d=>g=>{const{column:u,node:h,value:p}=g;let f=u.getColDef().valueFormatter;return f===d.groupSafeValueFormatter&&(f=d.valueFormatter),this.beans.valueSvc.formatValue(u,h,p,f)};for(const d of Object.keys(e)){const g=e[d],u={...g,groupSafeValueFormatter:wu(g,this.gos)};t[d]=u,a[d]=n(u)}const o=this.gos.get("dataTypeDefinitions")??{},r={};for(const d of Object.keys(o)){const g=o[d],u=this.processDataTypeDefinition(g,o,[d],e);u&&(t[d]=u,g.dataTypeMatcher&&(r[d]=g.dataTypeMatcher),a[d]=n(u))}const{valueParser:i,valueFormatter:l}=e.object,{valueParser:s,valueFormatter:c}=t.object;this.hasObjectValueParser=s!==i,this.hasObjectValueFormatter=c!==l,this.formatValueFuncs=a,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(r,e)}sortKeysInMatchers(e,t){const a={...e};for(const n of f1)delete a[n],a[n]=e[n]??t[n].dataTypeMatcher;return a}processDataTypeDefinition(e,t,a,n){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=n[r];const l=t[r];if(i&&l&&(i=l),!bu(e,i,r))return;o=vu(i,e)}else{if(a.includes(r)){R(44);return}const i=t[r];if(!bu(e,i,r))return;const l=this.processDataTypeDefinition(i,t,[...a,r],n);if(!l)return;o=vu(l,e)}return{...o,groupSafeValueFormatter:wu(o,this.gos)}}updateColDefAndGetColumnType(e,t,a){let{cellDataType:n}=t;n===void 0&&(n=e.cellDataType);const{field:o}=t;if((n==null||n===!0)&&(n=this.canInferCellDataType(e,t)?this.inferCellDataType(o,a):!1),this.addFormulaCellEditorToColDef(e,t),!n){e.cellDataType=!1;return}const r=this.dataTypeDefinitions[n];if(!r){R(47,{cellDataType:n});return}return e.cellDataType=n,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,r,a),r.columnTypes}addFormulaCellEditorToColDef(e,t){!(t.allowFormula??e.allowFormula)||t.cellEditor||(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const a=n=>{t.add(n.key)};e.__addEventListener("columnStateUpdated",a),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",a))}canInferCellDataType(e,t){const{gos:a}=this;if(!$(a))return!1;const n={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(ml(t,n))return!1;const o=t.type===null?e.type:t.type;if(o){const r=a.get("columnTypes")??{};if(Ro(o).some(l=>{const s=r[l.trim()];return s&&ml(s,n)}))return!1}return!ml(e,n)}inferCellDataType(e,t){if(!e)return;let a;const n=this.getInitialData();if(n){const r=e.includes(".")&&!this.gos.get("suppressFieldDotNotation");a=In(n,e,r)}else this.initWaitForRowData(t);return a==null?void 0:Object.keys(this.dataTypeMatchers).find(r=>this.dataTypeMatchers[r](a))??"object"}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.beans.rowModel.rootNode?._leafs;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:a,eventSvc:n}=this.beans;t&&a&&(a.shouldQueueResizeOperations=!0);const[o]=this.addManagedEventListeners({rowDataUpdateStarted:r=>{const{firstRowData:i}=r;i&&(o?.(),this.isPendingInference=!1,this.processColumnsPendingInference(i,t),this.columnStateUpdatesPendingInference={},t&&a?.processResizeOperations(),n.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const a=[];this.destroyColumnStateUpdateListeners();const n={},o={};for(const r of Object.keys(this.columnStateUpdatesPendingInference)){const i=this.columnStateUpdatesPendingInference[r],l=this.colModel.getCol(r);if(!l)continue;const s=l.getColDef();if(!this.resetColDefIntoCol(l,"cellDataTypeInferred"))continue;const c=l.getColDef();if(t&&c.type&&c.type!==s.type){const d=k1(l,i);d.rowGroup&&d.rowGroupIndex==null&&(n[r]=d),d.pivot&&d.pivotIndex==null&&(o[r]=d),a.push(d)}}t&&a.push(...this.generateColumnStateForRowGroupAndPivotIndexes(n,o)),a.length&&Be(this.beans,{state:a},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const a={},{rowGroupColsSvc:n,pivotColsSvc:o}=this.beans;return n?.restoreColumnOrder(a,e),o?.restoreColumnOrder(a,t),Object.values(a)}resetColDefIntoCol(e,t){const a=e.getUserProvidedColDef();if(!a)return!1;const n=fn(this.beans,a,e.getColId());return e.setColDef(n,a,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return e==="dateTime"||e==="dateTimeString"}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const a=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!a||e.getColDef().allowFormula&&this.beans.formula?.isFormula(t)?!0:a(t)}validateColDef(e,t,a,n){if(e.cellDataType==="object"){const o=s=>s?.cellDataType==null||s?.cellDataType===!0,r=o(t)&&o(a),i=s=>R(48,{property:s,inferred:r,colId:n}),{object:l}=this.dataTypeDefinitions;e.valueFormatter===l.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&i("Formatter"),e.editable&&e.valueParser===l.valueParser&&!this.hasObjectValueParser&&i("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||typeof t!="string")return;const{dataTypeDefinitions:a,beans:n,formatValueFuncs:o}=this,r=a[t];r&&n.colFilter?.setColDefPropsForDataType(e,r,o[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,a,n){const o=this.formatValueFuncs[t],r=this.columnDefinitionPropsPerDataType[a.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:a,colId:n,formatValue:o,filterModuleBean:this.beans.filterManager});e.cellEditor==="agFormulaCellEditor"&&r.cellEditor!==e.cellEditor&&(r.cellEditor=e.cellEditor),Object.assign(e,r)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),a=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:n=>me(n.newValue&&String(n.newValue)),valueFormatter:n=>n.value==null?"":!(n.value instanceof Date)||isNaN(n.value.getTime())?t("invalidDate","Invalid Date"):fe(n.value,a)??"",dataTypeMatcher:n=>n instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:a=>me(a)??void 0,dateFormatter:a=>fe(a??null,t)??void 0,valueParser:a=>Ko(String(a.newValue))?a.newValue:null,valueFormatter:a=>Ko(String(a.value))?String(a.value):"",dataTypeMatcher:a=>typeof a=="string"&&Ko(a)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:t=>t.newValue?.trim?.()===""?null:Number(t.newValue),valueFormatter:t=>t.value==null?"":typeof t.value!="number"||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:t=>typeof t=="number"},bigint:{baseDataType:"bigint",valueParser:t=>{const{newValue:a}=t;return a==null||typeof a=="string"&&a.trim()===""?null:ke(a)},valueFormatter:t=>t.value==null?"":typeof t.value!="bigint"?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:t=>typeof t=="bigint"},text:{baseDataType:"text",valueParser:t=>t.newValue===""?null:$n(t.newValue),dataTypeMatcher:t=>typeof t=="string"},boolean:{baseDataType:"boolean",valueParser:t=>t.newValue==null?t.newValue:t.newValue?.trim?.()===""?null:String(t.newValue).toLowerCase()==="true",valueFormatter:t=>t.value==null?"":String(t.value),dataTypeMatcher:t=>typeof t=="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:t=>typeof t=="string"&&p1(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:t=>$n(t.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function vu(e,t){const a={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(a.columnTypes=[...Ro(e.columnTypes),...Ro(t.columnTypes)]),a}function bu(e,t,a){return t?t.baseDataType!==e.baseDataType?(R(46),!1):!0:(R(45,{parentCellDataType:a}),!1)}var v1=e=>typeof e=="bigint"||typeof e=="number",b1=e=>e==="number"||e==="bigint";function wu(e,t){if(e.valueFormatter)return a=>{const{node:n,colDef:o,column:r,value:i}=a;if(n?.group){const l=(o.pivotValueColumn??r).getAggFunc();if(l){if(l==="first"||l==="last")return e.valueFormatter(a);const{baseDataType:s}=e;if(b1(s)&&l!=="count"){if(v1(i))return e.valueFormatter(a);if(i==null)return;if(typeof i=="object"){if(typeof i.toNumber=="function")return e.valueFormatter({...a,value:i.toNumber()});if("value"in i)return e.valueFormatter({...a,value:i.value})}}return}}else if(t.get("groupHideOpenParents")&&a.column.isRowGroupActive()&&typeof a.value=="string"&&!e.dataTypeMatcher?.(a.value))return;return e.valueFormatter(a)}}function w1(e,t,a,n){if(!t[a])return!1;const o=e[a];return o===null?(t[a]=!1,!1):n===void 0?!!o:o===n}function C1(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=ke(e),n=ke(t);return a!=null&&n!=null?a===n?0:a>n?1:-1:0}function y1(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=Cu(e),n=Cu(t);return a!=null&&n!=null?a===n?0:a>n?1:-1:0}function Cu(e){const t=ke(e);return t==null?null:t<0n?-t:t}function ml(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([a,n])=>w1(e,t,a,n))}function k1(e,t){const a=pu(e);for(const n of t)delete a[n],n==="rowGroup"?delete a.rowGroupIndex:n==="pivot"&&delete a.pivotIndex;return a}var S1={moduleName:"DataType",version:F,beans:[m1],dependsOn:[V0]},x1={moduleName:"ColumnFlex",version:F,beans:[d1]},vl={moduleName:"ColumnApi",version:F,beans:[c1],apiFunctions:{getColumnDef:q0,getDisplayNameForColumn:U0,getColumn:j0,getColumns:Y0,applyColumnState:K0,getColumnState:_0,resetColumnState:Q0,isPinning:Z0,isPinningLeft:J0,isPinningRight:X0,getDisplayedColAfter:$0,getDisplayedColBefore:e1,setColumnsVisible:t1,setColumnsPinned:a1,getAllGridColumns:n1,getDisplayedLeftColumns:o1,getDisplayedCenterColumns:r1,getDisplayedRightColumns:i1,getAllDisplayedColumns:l1,getAllDisplayedVirtualColumns:s1,getColumnDefs:W0}},R1=class extends y{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,a=!1){if(!e)return null;const n=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:o}=this.beans;return a&&o?o.getHeaderName(e,n):n}getDisplayNameForProvidedColumnGroup(e,t,a){const n=t?.getColGroupDef();return n?this.getHeaderName(n,null,e,t,a):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,a,n,o){const r=e.headerValueGetter;if(r){const i=I(this.gos,{colDef:e,column:t,columnGroup:a,providedColumnGroup:n,location:o});return typeof r=="function"?r(i):typeof r=="string"?this.beans.expressionSvc?.evaluate(r,i)??null:""}else{if(e.headerName!=null)return e.headerName;if(e.field)return qs(e.field)}return""}},E1=class extends y{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(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,a=!1){const{visibleCols:n}=this,o=n.isBodyWidthDirty;if(!(e===this.scrollWidth&&t===this.scrollPosition&&!o)){if(this.scrollWidth=e,this.scrollPosition=t,n.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const i=n.bodyWidth;this.viewportLeft=i-t-e,this.viewportRight=i-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(a)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let a;switch(e){case"left":a=this.rowsOfHeadersToRenderLeft[t];break;case"right":a=this.rowsOfHeadersToRenderRight[t];break;default:a=this.rowsOfHeadersToRenderCenter[t];break}return a??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||F1(e)?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,a=t+e.getActualWidth(),n=this.viewportLeft-200,o=this.viewportRight+200,r=t<n&&a<n,i=t>o&&a>o;return!r&&!i}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=r=>{const i=r.getLeft();return z(i)&&i>this.viewportLeft},a=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:n}=this,o=n.centerCols;return n.getColsForRow(e,o,a,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const a=n=>{const o=new Set,r={};for(const i of n){let l=i.getParent();const s=i.isSpanHeaderHeight();for(;l&&!o.has(l);){if(s&&l.isPadding()){l=l.getParent();continue}const d=l.getProvidedColumnGroup().getLevel();r[d]??(r[d]=[]),r[d].push(l),o.add(l),l=l.getParent()}}return r};this.rowsOfHeadersToRenderLeft=a(e),this.rowsOfHeadersToRenderRight=a(t),this.rowsOfHeadersToRenderCenter=a(this.headerColsWithinViewport)}extractViewport(){const e=n=>`${n.getId()}-${n.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),a=this.colsWithinViewportHash!==t;return a&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),a}};function F1(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}var M1=class extends y{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;class a{refresh(){return!1}getGui(){return this.eGui}init(o){const r=t(o),i=typeof r;if(i==="string"||i==="number"||i==="boolean"){this.eGui=co("<span>"+r+"</span>");return}if(r==null){this.eGui=oe({tag:"span"});return}this.eGui=r}}return a}},z1={moduleName:"CellRendererFunction",version:F,beans:[M1]},yu=class extends ue{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...a){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const n=this.dynamicBeans[e];if(n==null){if(t)throw new Error(this.getDynamicError(e,!1));return}return new n(...a)}};function D1(e){return typeof e=="object"&&!!e.getComp}var A1=class extends yu{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(e!=null)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:a,dynamicBeans:n,selectors:o}=e;if(a){const r=(i,l,s,c)=>{this.agGridDefaults[i]=l,(s||c)&&(this.agGridDefaultOverrides[i]={params:s,processParams:c})};for(const i of Object.keys(a)){let l=a[i];if(D1(l)&&(l=l.getComp(this.beans)),typeof l=="object"){const{classImp:s,params:c,processParams:d}=l;r(i,s,c,d)}else r(i,l)}}this.registerDynamicBeans(n);for(const r of o??[])this.selectors[r.selector]=r;if(t)for(const r of Object.keys(t))this.icons[r]=t[r]}getUserComponent(e,t){const a=(l,s,c,d)=>({componentFromFramework:s,component:l,params:c,processParams:d}),{frameworkOverrides:n}=this.beans,o=n.frameworkComponent(t,this.gos.get("components"));if(o!=null)return a(o,!0);const r=this.jsComps[t];if(r){const l=n.isFrameworkComponent(r);return a(r,l)}const i=this.agGridDefaults[t];if(i){const l=this.agGridDefaultOverrides[t];return a(i,!1,l?.params,l?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?Ve(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Ve(256)}},P1=23,I1=class extends y{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){const e=Object.values(this.params);this.ready=e.length===P1&&e.every(t=>t?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const a=this.readyCallbacks.indexOf(t);a>=0&&this.readyCallbacks.splice(a,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:a}=this.params;return[e,a,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},T1=':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}',bl=typeof window!="object"||!window?.document?.fonts?.forEach,_o=!1,da=(e,t,a,n,o,r,i=!1)=>{if(bl||_o)return;n&&(e=`@layer ${CSS.escape(n).replaceAll("\\.",".")} { ${e} }`);let l=nt.map.get(t);if(l||(l=[],nt.map.set(t,l)),l.some(g=>g.css===e))return;const s=document.createElement("style");r&&s.setAttribute("nonce",r),s.dataset.agCss=a,s.dataset.agCssVersion=F,s.textContent=e;const c={css:e,el:s,priority:o,isParams:i};let d;for(const g of l){if(g.priority>o)break;d=g}if(d){d.el.after(s);const g=l.indexOf(d);l.splice(g+1,0,c)}else t.nodeName==="STYLE"?t.after(s):t.insertBefore(s,t.querySelector(":not(title, meta)")),l.push(c)},ku=(e,t,a,n)=>{da(T1,e,"shared",t,0,a),n?.forEach((o,r)=>o.forEach(i=>da(i,e,r,t,0,a)))},L1=(e,t,a,n,o,r)=>{if(bl||_o)return;const i=nt.grids.get(e);i?i.paramsCss=t:nt.grids.set(e,{styleContainer:n,paramsCss:t}),wl(n),t&&a&&da(t,n,a,o,2,r,!0)},B1=e=>{const t=nt.grids.get(e)?.styleContainer;if(!t)return;nt.grids.delete(e),Array.from(nt.grids.values()).some(n=>n.styleContainer===t)?wl(t):(wl(t,!0),nt.map.delete(t))},wl=(e,t=!1)=>{const a=new Set;for(const o of nt.grids.values())o.styleContainer===e&&a.add(o.paramsCss);const n=nt.map.get(e)??[];for(let o=n.length-1;o>=0;o--)(t||n[o].isParams&&!a.has(n[o].css))&&(n[o].el.remove(),n.splice(o,1))},Su=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(F);return t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(F,t)),t},nt=Su(),V=e=>new xu(e),Bt="$default",O1=0,xu=class{constructor({feature:e,params:t,modeParams:a={},css:n,cssImports:o}){this.feature=e,this.css=n,this.cssImports=o,this.modeParams={[Bt]:{...a[Bt]??{},...t??{}},...a}}use(e,t,a){let n=this._inject;if(n==null){let{css:o}=this;if(o){const r=`ag-theme-${this.feature??"part"}-${++O1}`;typeof o=="function"&&(o=o()),o=`:where(.${r}) {
13338
+ `,e)}function Nc(e,t){return e.get("rowModelType")===t}function $(e,t){return Nc(e,"clientSide")}function Fa(e,t){return Nc(e,"serverSide")}function se(e,t){return e.get("domLayout")===t}function xt(e){return gn(e)!==void 0}function Yr(e){return typeof e.get("getRowHeight")=="function"}function gv(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Vc({gos:e,formula:t}){const a=e.get("rowNumbers");return a||!!t?.active&&a!==!1}function ct(e,t,a=!1,n){const{gos:o,environment:r}=e;if(n==null&&(n=r.getDefaultRowHeight()),Yr(o)){if(a)return{height:n,estimated:!0};const s={node:t,data:t.data},c=o.getCallback("getRowHeight")(s);if(Kr(c))return c===0&&R(23),{height:Math.max(1,c),estimated:!1}}if(t.detail&&o.get("masterDetail"))return uv(o);const i=o.get("rowHeight");return{height:i&&Kr(i)?i:n,estimated:!1}}function uv(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Kr(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Rt(e){const{environment:t,gos:a}=e,n=a.get("rowHeight");if(!n||K(n))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(R(24),t.getDefaultRowHeight())}function Kr(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Gc(e,t,a){const n=t[e.getDomDataKey()];return n?n[a]:void 0}function $t(e,t,a,n){const o=e.getDomDataKey();let r=t[o];K(r)&&(r={},t[o]=r),r[a]=n}function ea(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function _r(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||se(e,"print"))}function Ze(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function sn(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function Qr(e){return e.get("grandTotalRow")}function hv(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function qc(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function Wc(e){return qc(e)&&e.get("groupHideColumnsUntilExpanded")&&$(e)}function Zr(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function Jr(e,t,a){return!!t.group&&!t.footer&&Zr(e,a)}function ta(e){const t=e.getCallback("getRowId");return t===void 0?t:a=>{let n=t(a);return typeof n!="string"&&(on(()=>R(25,{id:n}),"getRowIdString"),n=String(n)),n}}function Uc(e,t){const a=e.get("groupHideParentOfSingleChild");return!!(a===!0||a==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function jc(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function pv(e,t){const a=e.get("suppressGroupChangesColumnVisibility");if(a===!0||t&&a==="suppressHideOnGroup"||!t&&a==="suppressShowOnUngroup")return!1;const n=e.get("suppressRowGroupHidesColumns");if(t&&n===!0)return!1;const o=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&o===!0)}function aa(e){return e?.checkboxes??!0}function cn(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function dn(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function Xr(e){return e?.hideDisabledCheckboxes??!1}function Yc(e){return typeof e.get("rowSelection")!="string"}function fv(e){return e.get("cellSelection")!==void 0}function mv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Je(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function vv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function na(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function Kc(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const a=e.get("suppressRowClickSelection"),n=e.get("suppressRowDeselection");return a&&n?!1:a?"enableDeselection":n?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function bv(e){const t=Kc(e);return t===!0||t==="enableSelection"}function wv(e){const t=Kc(e);return t===!0||t==="enableDeselection"}function Co(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function gn(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Ma(e){return gn(e)==="multiRow"}function Cv(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function un(e){const t=e.get("rowSelection");if(typeof t=="string"){const a=e.get("groupSelectsChildren"),n=e.get("groupSelectsFiltered");return a&&n?"filteredDescendants":a?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function _c(e,t=!0){const a=e.get("rowSelection");return typeof a!="object"?t?"all":void 0:a.mode==="multiRow"?a.selectAll:"all"}function yv(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function za(e){const t=un(e);return t==="descendants"||t==="filteredDescendants"}function Qc(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function Zc(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Ce(e){return e.get("columnMenu")==="legacy"}function Jc(e){return!Ce(e)}function Xc(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function kv(e,t,a){typeof e!="object"&&(e={});const n={...e};for(const o of a){const r=t[o];typeof r<"u"&&(n[o]=r)}return n}function Sv(e,t){if(!e)return;const a={};let n=!1;for(const i of Object.keys(e))a[i]=e[i],n=!0;if(!n)return;const o={type:"gridOptionsChanged",options:a};t.dispatchEvent(o);const r={type:"componentStateChanged",...a};t.dispatchEvent(r)}function I(e,t){return e.addCommon(t)}function xv(e,t){return e[t]??e.gridOptions?.[t]??Vr(t)??kc[t]}function $c({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var Rv={resizable:!0,sortable:!0},Ev=0;function ed(){return Ev++}function dt(e){return e instanceof gt}var Fv=["asc","desc",null],Mv=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],gt=class extends y{constructor(e,t,a,n){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=a,this.primary=n,this.isColumn=!0,this.instanceId=ed(),this.autoHeaderHeight=null,this.sortDef=ze(),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 Ct,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=va(a)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:a,colFlex:n}}=this;t?.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,a?.initCol(this),n?.initCol(this)}setColDef(e,t,a){const n=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),n&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",a)}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(){const{gos:e,colDef:{field:t,tooltipField:a}}=this,n=e.get("suppressFieldDotNotation");this.fieldContainsDots=z(t)&&t.includes(".")&&!n,this.tooltipFieldContainsDots=z(a)&&a.includes(".")&&!n}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:a=>{const n=e.recreateColDef(this.colDef);this.setColDef(n,n,a.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!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(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const a=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,a)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,a)}createColumnFunctionCallbackParams(e){return I(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Rv[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const a=this.createColumnFunctionCallbackParams(e);return t(a)}return!1}createColumnEvent(e,t){return I(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){return this.sortDef.direction?this.sortDef:null}getColDefAllowedSortTypes(){const e=[],{sort:t,initialSort:a}=this.colDef,n=t===null?t:Xe(t?.type),o=a===null?a:Xe(a?.type);return n&&e.push(n),o&&e.push(o),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?Mv:Fv;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(t=>ze(t))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((t,a)=>(a.direction&&t.push(a.type),t),this.getColDefAllowedSortTypes());return new Set(e)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(e,t=!1){t||(this._wasSortExplicitlyRemoved=!e.direction),this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return K(this.getSort())}isSorting(){return z(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(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return R(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const a=e===!0;this.visible!==a&&(this.visible=a,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let a=!0;for(;e;){if(!e.isPadding()){a=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:a}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return I(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(K(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.colSpan(t);return Math.max(a,1)}getRowSpan(e){if(K(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),a=this.colDef.rowSpan(t);return Math.max(a,1)}setActualWidth(e,t,a=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),a||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>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(e,t,a){const n=this.createColumnEvent(e,t);a&&he(n,a),this.colEventSvc.dispatchEvent(n)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function ze(e){return Da(e)?{direction:e.direction,type:e.type}:{direction:pn(e),type:Xe(e)}}function ut(e){return e==="asc"||e==="desc"||e===null}function yo(e){return e==="default"||e==="absolute"}function Da(e){if(!e||typeof e!="object")return!1;const t=e;return yo(t.type)&&ut(t.direction)}function hn(e,t){return e?t?e.type===t.type&&e.direction===t.direction:e?e.direction===null:!0:t?t.direction===null:!0}function pn(e){return ut(e)?e:null}function Xe(e){return yo(e)?e:"default"}function td(e,t,a){const o=a?.()??t.sortSvc.getDisplaySortForColumn(e),r=Xe(o?.type),i=pn(o?.direction),l=e.getAvailableSortTypes(),s=l.has("default"),c=l.has("absolute");return{isDefaultSortAllowed:s,isAbsoluteSortAllowed:c,isAbsoluteSort:r==="absolute",isDefaultSort:r==="default",isAscending:i==="asc",isDescending:i==="desc",direction:i}}function de(e){return e instanceof Aa}var Aa=class extends y{constructor(e,t,a,n){super(),this.colGroupDef=e,this.groupId=t,this.padding=a,this.level=n,this.isColumn=!1,this.expandable=!1,this.instanceId=ed(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)dt(t)?e(t):de(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)dt(t)?e.push(t):de(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,a=!1;const n=this.findChildrenRemovingPadding();for(let r=0,i=n.length;r<i;r++){const l=n[r];if(!l.isVisible())continue;const s=l.getColumnGroupShow();s==="open"?(e=!0,a=!0):s==="closed"?(t=!0,a=!0):(e=!0,t=!0)}const o=e&&t&&a;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=a=>{for(const n of a)de(n)&&n.isPadding()?t(n.children):e.push(n)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},zv={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function $r(e,t,a){const n={},o=e.gos;return Object.assign(n,o.get("defaultColGroupDef")),Object.assign(n,t),o.validateColDef(n,a),n}var ad=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=$n(e);let a=0;for(;;){let n=e??t;if(n?a!==0&&(n+="_"+a):n=a,!this.existingKeys[n]){const o=String(n);return e&&a>0&&R(273,{providedId:e,usedId:o}),this.existingKeys[o]=!0,o}a++}}},nd=(e,t)=>{de(e)&&e.setupExpandable(),e.originalParent=t};function Dv(e,t=null,a,n,o){const{existingCols:r,existingGroups:i}=rd(n),l=new Map(r.map(f=>[f.getId(),f])),s=new Map(i.map(f=>[f.getId(),f]));let c=0;const d=(f,m)=>{if(c=Math.max(c,m),sd(f)){if(!e.colGroupSvc)return null;const k=f.groupId,S=s.get(k),x=$r(e,f,k),M=new Aa(x,k,!1,m);return e.context.createBean(M),S&&M.setExpanded(S.isExpanded()),M.setChildren(f.children.map(L=>d(L,m+1))),M}const v=f.colId;let b=l.get(v);const w=fn(e,f,b?.getColId()??v);return b?(b.setColDef(w,f,o),ei(e,b,w,o)):(b=new gt(w,f,v,a),e.context.createBean(b)),e.dataTypeSvc?.addColumnListeners(b),b},g=t?.map(f=>d(f,0))??[];let u=0;const h={getUniqueKey:(f,m)=>String(++u)},p=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(g,0,c,h):g;return $e(null,p,nd),{columnTree:p,treeDepth:c}}function od(e,t=null,a,n,o){const r=new ad,{existingCols:i,existingGroups:l,existingColKeys:s}=rd(n);r.addExistingKeys(s);const c=id(e,t,0,a,i,r,l,o),{colGroupSvc:d}=e,g=d?.findMaxDepth(c,0)??0,u=d?d.balanceColumnTree(c,0,g,r):c;return $e(null,u,nd),{columnTree:u,treeDepth:g}}function rd(e){const t=[],a=[],n=[];return e&&$e(null,e,o=>{if(de(o)){const r=o;a.push(r)}else{const r=o;n.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:a,existingColKeys:n}}function id(e,t,a,n,o,r,i,l){if(!t)return[];const{colGroupSvc:s}=e,c=new Array(t.length);for(let d=0;d<c.length;d++){const g=t[d];s&&sd(g)?c[d]=s.createProvidedColumnGroup(n,g,a,o,r,i,l):c[d]=Av(e,n,g,o,r,l)}return c}function Av(e,t,a,n,o,r){const i=Pv(a,n);i&&n?.splice(i.idx,1);let l=i?.column;if(l){const s=fn(e,a,l.getColId());l.setColDef(s,a,r),ei(e,l,s,r)}else{const s=o.getUniqueKey(a.colId,a.field),c=fn(e,a,s);l=new gt(c,a,s,t),e.context.createBean(l)}return e.dataTypeSvc?.addColumnListeners(l),l}function ld(e,t,a,n,o,r,i,l){const{sortSvc:s,pinnedCols:c,colFlex:d}=e;a!==void 0&&t.setVisible(!a,l),s&&(s.updateColSort(t,n,l),o!==void 0&&s.setColSortIndex(t,o)),r!==void 0&&c?.setColPinned(t,r),i!==void 0&&d?.setColFlex(t,i)}function ei(e,t,a,n){ld(e,t,a.hide,a.sort,a.sortIndex,a.pinned,a.flex,n);const o=t.getFlex();if(!(o!=null&&o>0))if(a.width!=null)t.setActualWidth(a.width,n);else{const r=t.getActualWidth();t.setActualWidth(r,n)}}function Pv(e,t){if(t)for(let a=0;a<t.length;a++){const n=t[a].getUserProvidedColDef();if(!n)continue;if(e.colId!=null){if(t[a].getId()===e.colId)return{idx:a,column:t[a]};continue}if(e.field!=null){if(n.field===e.field)return{idx:a,column:t[a]};continue}if(n===e)return{idx:a,column:t[a]}}}function fn(e,t,a,n){const{gos:o,dataTypeSvc:r}=e,i={},l=o.get("defaultColDef");he(i,l,!1,!0);const s=Iv(e,i,t,a);s&&Tv(e,s,i);const c=i.cellDataType;he(i,t,!1,!0),c!==void 0&&(i.cellDataType=c);const d=o.get("autoGroupColumnDef"),g=Ze(o);return t.rowGroup&&d&&g&&he(i,{sort:d.sort,initialSort:d.initialSort},!1,!0),r?.postProcess(i),r?.validateColDef(i,t,l,a),o.validateColDef(i,a,n),i}function Iv(e,t,a,n){const o=e.dataTypeSvc?.updateColDefAndGetColumnType(t,a,n),r=a.type??o??t.type;return t.type=r,r?Ro(r):void 0}function Tv(e,t,a){if(!t.length)return;const n=Object.assign({},zv),o=e.gos.get("columnTypes")||{};for(const r of Object.keys(o)){const i=o[r];r in n?R(34,{key:r}):(i.type&&R(35),n[r]=i)}for(const r of t){const i=n[r.trim()];i?he(a,i,!1,!0):R(36,{t:r})}}function sd(e){return e.children!==void 0}function $e(e,t,a){if(t)for(let n=0;n<t.length;n++){const o=t[n];de(o)&&$e(o,o.getChildren(),a),a(o,e)}}var ht="ag-Grid-AutoColumn",ko="ag-Grid-SelectionColumn",So="ag-Grid-RowNumbersColumn",Lv="ag-Grid-HierarchyColumn";function ti(e){const t=[],a=n=>{for(let o=0;o<n.length;o++){const r=n[o];dt(r)?t.push(r):de(r)&&a(r.getChildren())}};return a(e),t}function pt(e){return e.reduce((t,a)=>t+a.getActualWidth(),0)}function mn(e,t,a){const n={};if(!t)return;$e(null,t,r=>{n[r.getInstanceId()]=r}),a&&$e(null,a,r=>{n[r.getInstanceId()]=null});const o=Object.values(n).filter(r=>r!=null);e.context.destroyBeans(o)}function xo(e){return e.getId().startsWith(ht)}function ft(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(ko)??!1}function pe(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(So)??!1}function cd(e){return ft(e)||pe(e)}function Ro(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function dd(e,t){return lt(e,t,(a,n)=>a.getColId()===n.getColId())}function gd(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function oa(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Pa(e,t){return e===t||e.colId==t||e.getColDef()===t}var Bv=(e,t)=>(a,n)=>{const o={value1:void 0,value2:void 0};let r=!1;return e&&(e[a]!==void 0&&(o.value1=e[a],r=!0),z(n)&&e[n]!==void 0&&(o.value2=e[n],r=!0)),!r&&t&&(t[a]!==void 0&&(o.value1=t[a]),z(n)&&t[n]!==void 0&&(o.value2=t[n])),o};function ud(e,t){const a={...e,sort:void 0,colId:t},n=ai(e);return n&&(a.sort=n.direction,a.sortType=n.type),a}function ai(e){const{sort:t,initialSort:a}=e,n=Da(t)||ut(t),o=Da(a)||ut(a);return n?ze(t):o?ze(a):null}function hd(e,t){return e+"_"+t}function ee(e){return e instanceof Ia}var Ia=class extends y{constructor(e,t,a,n){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=a,this.pinned=n,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=va(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return hd(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){for(const e of this.displayedChildren)ee(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=j(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;for(const t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(const t of this.displayedChildren)t.isResizable()&&(e=!0);return e}getMinWidth(){let e=0;for(const t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(const t of this.displayedChildren??[])dt(t)?e.push(t):ee(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])dt(t)?e.push(t):ee(t)&&t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e?.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(const a of this.children??[]){if(ee(a)&&!a.displayedChildren?.length)continue;switch(a.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(a);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(a);break;default:this.displayedChildren.push(a);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},C={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"},Ov=65,Hv=67,Nv=86,Vv=68,Gv=90,qv=89;function pd(e){const{keyCode:t}=e;let a;switch(t){case Ov:a=C.A;break;case Hv:a=C.C;break;case Nv:a=C.V;break;case Vv:a=C.D;break;case Gv:a=C.Z;break;case qv:a=C.Y;break;default:a=e.code}return a}function Wv(e){return typeof e.then=="function"}function Uv(e,t){return new Q(a=>{a(window.setInterval(e,t))})}var Q=class Xn{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(a=>this.onDone(a),a=>this.onReject(a))}static all(t){return t.length?new Xn(a=>{let n=t.length;const o=new Array(n);t.forEach((r,i)=>{r.then(l=>{o[i]=l,n--,n===0&&a(o)})})}):Xn.resolve()}static resolve(t=null){return new Xn(a=>a(t))}then(t){return new Xn(a=>{this.status===1?a(t(this.resolution)):this.waiters.push(n=>a(t(n)))})}onDone(t){this.status=1,this.resolution=t;for(const a of this.waiters)a(t)}onReject(t){}},fd=class extends ue{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(e,t=!1){const a={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:n=>this.onDragStart(e,n),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(a),this.beans.dragSvc.addDragSource(a)}setDragImageCompIcon(e,t=!1){const a=this.dragImageComp;a&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,a.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:a}=this;for(let n=0,o=t.length;n<o;n++)if(t[n].dragSource===e){const r=t[n];a.dragSvc?.removeDragSource(r),t.splice(n,1);break}}destroy(){const{dragSourceAndParamsList:e,dropTargets:t,beans:a}=this,n=a.dragSvc;for(const o of e)n?.removeDragSource(o);e.length=0,t.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){const e=this.lastMouseEvent;e&&this.onDragging(e,!0)}onDragStart(e,t){this.lastMouseEvent=t,this.dragSource=e,this.dragItem=e.getDragItem();const a=e.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=t.clientX-a.left,this.dragInitialSourcePointerOffsetY=t.clientY-a.top,e.onDragStarted?.(),this.createAndUpdateDragImageComp(e)}onDragStop(e){const{dragSource:t,lastDropTarget:a}=this;if(t?.onDragStopped?.(),a){const n=this.dropTargetEvent(a,e,!1);a.onDragStop?.(n)}this.clearDragAndDropProperties()}onDragCancel(){const{dragSource:e,lastDropTarget:t,lastMouseEvent:a}=this;if(e?.onDragCancelled?.(),t&&a){const n=this.dropTargetEvent(t,a,!1);t.onDragCancel?.(n)}this.clearDragAndDropProperties()}onDragging(e,t=!1){this.positionDragImageComp(e);const a=this.findCurrentDropTarget(e),{lastDropTarget:n,dragSource:o,dragItem:r}=this;let i=!1;if(a!==n){if(i=!0,n){const l=this.dropTargetEvent(n,e,t);n.onDragLeave?.(l)}if(n!==null&&!a?this.handleExit(o,r):n===null&&a&&this.handleEnter(o,r),a){const l=this.dropTargetEvent(a,e,t);a.onDragEnter?.(l)}this.lastDropTarget=a}else if(a){const l=this.dropTargetEvent(a,e,t);a.onDragging?.(l),l?.changed&&(i=!0)}this.lastMouseEvent=e,i&&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(e){const t=e.getContainer(),a=e.getSecondaryContainers?.(),n=a?.length;if(!n)return[[t]];const o=new Array(n+1);o[0]=[t];for(let r=0;r<n;++r)o[r+1]=a[r];return o}isMouseOnDropTarget(e,t){const a=this.getAllContainersFromDropTarget(t);let n=!1;const o=(l,s)=>{for(const c of s){const{width:d,height:g,left:u,right:h,top:p,bottom:f}=c.getBoundingClientRect();if(d===0||g===0)return!1;const m=l.clientX>=u&&l.clientX<h,v=l.clientY>=p&&l.clientY<f;if(!m||!v)return!1}return!0};for(const l of a)if(o(e,l)){n=!0;break}const{eElement:r,type:i}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(r)?!1:n&&t.isInterestedIn(i,r)}findCurrentDropTarget(e){const t=[],a=this.dropTargets;for(let i=0,l=a.length;i<l;++i){const s=a[i];this.isMouseOnDropTarget(e,s)&&t.push(s)}const n=t.length;if(n===0)return null;if(n===1)return t[0];const r=Ie(this.beans).elementsFromPoint(e.clientX,e.clientY);for(let i=0,l=r.length;i<l;++i){const s=r[i];for(let c=0,d=t.length;c<d;c++){const g=t[c],u=this.getAllContainersFromDropTarget(g);let h=!1;for(let p=0,f=u.length;p<f&&!h;p++){const m=u[p];for(let v=0,b=m.length;v<b;v++)if(m[v]===s){h=!0;break}}if(h)return g}}return null}addDropTarget(e){this.dropTargets.push(e),e.external&&this.externalDropZoneCount++}removeDropTarget(e){const t=e.getContainer(),a=this.dropTargets;let n=0;for(let o=0,r=a.length;o<r;++o){const i=a[o];if(i.getContainer()===t){i.external&&--this.externalDropZoneCount;continue}n!==o&&(a[n]=i),++n}a.length=n}hasExternalDropZones(){return this.externalDropZoneCount>0}findExternalZone(e){const t=this.dropTargets;for(let a=0,n=t.length;a<n;++a){const o=t[a];if(o.external&&o.getContainer()===e)return o}return null}dropTargetEvent(e,t,a){const{dragSource:n,dragItem:o,lastDraggingEvent:r,lastMouseEvent:i,dragInitialSourcePointerOffsetX:l,dragInitialSourcePointerOffsetY:s}=this,c=e.getContainer(),d=c.getBoundingClientRect(),{clientX:g,clientY:u}=t,h=g-(i?.clientX||0),p=u-(i?.clientY||0),f=this.createEvent({event:t,x:g-d.left,y:u-d.top,vDirection:p>0?"down":p<0?"up":null,hDirection:h<0?"left":h>0?"right":null,initialSourcePointerOffsetX:l,initialSourcePointerOffsetY:s,dragSource:n,fromNudge:a,dragItem:o,dropZoneTarget:c,dropTarget:r?.dropTarget??null,changed:!!r?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&pc(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(e.getGui()?.remove(),this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then(a=>{const n=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!n||!this.isAlive()){this.destroyBean(a);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const o=this.dragImageComp;o!==a&&(this.dragImageComp=a,this.removeDragImageComp(o)),a&&(this.appendDragImageComp(a),this.updateDragImageComp(),this.positionDragImageComp(n))})}appendDragImageComp(e){const t=e.getGui(),a=t.style;a.position="absolute",a.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(a.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),a.top="20px",a.left="20px";const n=ao(this.beans);n?n.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:a,lastDraggingEvent:n,dragImageLastLabel:o}=this;if(!e)return;this.setDragImageCompIcon(a?.getIconName?.(n)??null);let r=t?.dragItemName;typeof r=="function"&&(r=r(n)),r||(r=""),o!==r&&(this.dragImageLastLabel=r,e.setLabel(r))}};function md(e){return typeof e=="object"&&!!e.component}function jv(e){return e?e.prototype&&"getGui"in e.prototype:!1}function vd(e,t,a,n){const{name:o}=a;let r,i,l,s,c,d;if(t){const g=t,u=g[o+"Selector"],h=u?u(n):null,p=f=>{typeof f=="string"?r=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?l=f:i=f)};h?(p(h.component),s=h.params,c=h.popup,d=h.popupPosition):p(g[o])}return{compName:r,jsComp:i,fwComp:l,paramsFromSelector:s,popupFromSelector:c,popupPositionFromSelector:d}}var Yv=class extends y{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,a,n=!1){return this.getCompDetails(this.gridOptions,e,t,a,n)}getCompDetails(e,t,a,n,o=!1){const{name:r,cellRenderer:i}=t;let{compName:l,jsComp:s,fwComp:c,paramsFromSelector:d,popupFromSelector:g,popupPositionFromSelector:u}=vd(this.beans.frameworkOverrides,e,t,n),h,p;const f=w=>{const k=this.registry.getUserComponent(r,w);k&&(s=k.componentFromFramework?void 0:k.component,c=k.componentFromFramework?k.component:void 0,h=k.params,p=k.processParams)};if(l!=null&&f(l),s==null&&c==null&&a!=null&&f(a),s&&i&&!jv(s)&&(s=this.agCompUtils?.adaptFunction(t,s)),!s&&!c){const{validation:w}=this.beans;o&&(l!==a||!a)?l?w?.isProvidedUserComp(l)||G(50,{compName:l}):a?w||G(260,{...this.gos.getModuleErrorParams(),propName:r,compName:a}):G(216,{name:r}):a&&!w&&G(146,{comp:a});return}const m=this.mergeParams(e,t,n,d,h,p),v=s==null,b=s??c;return{componentFromFramework:v,componentClass:b,params:m,type:t,popupFromSelector:g,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(b,v,m,t)}}newAgStackInstance(e,t,a,n){const o=!t;let r;o?r=new e:r=this.frameworkCompWrapper.wrap(e,n.mandatoryMethods,n.optionalMethods,n),this.createBean(r);const i=r.init?.(a);return i==null?Q.resolve(r):i.then(()=>r)}mergeParams(e,t,a,n=null,o,r){const i={...a,...o},s=e?.[t.name+"Params"];if(typeof s=="function"){const c=s(a);he(i,c)}else typeof s=="object"&&he(i,s);return he(i,n),r?r(i):i}},Kv={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},_v={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Qv={name:"headerComponent",optionalMethods:["refresh"]},Zv={name:"innerHeaderComponent"},Jv={name:"innerHeaderGroupComponent"},Xv={name:"headerGroupComponent"},$v={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},eb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},tb={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"]},ab={name:"loadingCellRenderer",cellRenderer:!0},nb={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},ob={name:"tooltipComponent"},ni={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},rb={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},ib={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},lb={name:"loadingCellRenderer",cellRenderer:!0},sb={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},cb={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function db(e,t){return e.getCompDetailsFromGridOptions(_v,"agDragAndDropImage",t,!0)}function gb(e,t,a){return e.getCompDetails(t,$v,void 0,a)}function ub(e,t,a){return e.getCompDetails(t,Qv,"agColumnHeader",a)}function hb(e,t,a){return e.getCompDetails(t,Zv,void 0,a)}function pb(e,t){const a=t.columnGroup.getColGroupDef();return e.getCompDetails(a,Xv,"agColumnGroupHeader",t)}function fb(e,t,a){return e.getCompDetails(t,Jv,void 0,a)}function mb(e,t){return e.getCompDetailsFromGridOptions(ib,void 0,t,!0)}function vb(e,t){return e.getCompDetailsFromGridOptions(lb,"agLoadingCellRenderer",t,!0)}function bb(e,t){return e.getCompDetailsFromGridOptions(sb,"agGroupRowRenderer",t,!0)}function wb(e,t){return e.getCompDetailsFromGridOptions(cb,"agDetailCellRenderer",t,!0)}function oi(e,t,a){return e.getCompDetails(t,eb,void 0,a)}function Cb(e,t,a){return e.getCompDetails(t,tb,void 0,a)}function bd(e,t,a){return e.getCompDetails(t,ab,"agSkeletonCellRenderer",a,!0)}function wd(e,t,a){return e.getCompDetails(t,nb,"agCellEditor",a,!0)}function Cd(e,t,a,n){const o=t.filter;return md(o)&&(t={filter:o.component,filterParams:t.filterParams}),e.getCompDetails(t,ni,n,a,!0)}function yb(e,t,a){return e.getCompDetails(t,Kv,"agDateInput",a,!0)}function kb(e,t){return e.getCompDetails(t.colDef,ob,"agTooltipComponent",t,!0)}function yd(e,t,a,n){return e.getCompDetails(t,rb,n,a)}function kd(e,t){return vd(e,t,ni)}function ri(e,t,a){return e.mergeParams(t,ni,a)}var Sd=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Sd||{}),Sb=class extends fd{createEvent(e){return I(this.gos,e)}createDragImageComp(e){const{gos:t,beans:a}=this;return db(a.userCompFactory,I(t,{dragSource:e}))?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){R(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const a={getContainer:e,isInterestedIn:n=>n===1||n===0,getIconName:()=>"notAllowed"};this.addDropTarget(a),t.addDestroyFunc(()=>this.removeDropTarget(a))}};function ii(e){return!!e.operator}var xd="ag-resizer-wrapper",Et=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),xb={tag:"div",cls:xd,children:[Et("eTopLeft","topLeft"),Et("eTop","top"),Et("eTopRight","topRight"),Et("eRight","right"),Et("eBottomRight","bottomRight"),Et("eBottom","bottom"),Et("eBottomLeft","bottomLeft"),Et("eLeft","left")]},Rd=class extends ue{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:a}=this.offsetParent,n=a/2-this.getWidth()/2,o=t/2-this.getHeight()/2;this.offsetElement(n,o,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:a,minWidth:n,width:o,minHeight:r,height:i,x:l,y:s}=this.config;this.offsetParent||this.setOffsetParent();let c=0,d=0;const g=Me(this.element);if(g){const u=this.findBoundaryElement(),h=window.getComputedStyle(u);if(h.minWidth!=null){const p=u.offsetWidth-this.element.offsetWidth;d=Number.parseInt(h.minWidth,10)-p}if(h.minHeight!=null){const p=u.offsetHeight-this.element.offsetHeight;c=Number.parseInt(h.minHeight,10)-p}}if(this.minHeight=r||c,this.minWidth=n||d,o&&this.setWidth(o),i&&this.setHeight(i),(!o||!i)&&this.refreshSize(),t)this.center(e);else if(l||s)this.offsetElement(l,s,e);else if(g&&a){let u=this.boundaryEl,h=!0;if(u||(u=this.findBoundaryElement(),h=!1),u){const p=Number.parseFloat(u.style.top),f=Number.parseFloat(u.style.left);h?this.offsetElement(Number.isNaN(f)?0:f,Number.isNaN(p)?0:p,e):this.setPosition(f,p)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const a=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(a),this.moveElementDragListener=a):(this.dragSvc?.removeDragSource(a),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const a=!!e[t],n=this.getResizerElement(t),o={dragStartPixels:0,eElement:n,onDragStart:r=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:r=>this.onResizeEnd(r,t)};(a||!this.isAlive()&&!a)&&(a?(this.dragSvc?.addDragSource(o),this.resizeListeners.push(o),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=a)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,a=this.element;let n=!1;if(typeof e=="string"&&e.includes("%"))an(a,e),e=Pr(a),n=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(n?(a.style.maxHeight="unset",a.style.minHeight="unset"):t?an(a,e):(a.style.height=`${e}px`,a.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:a}=this.offsetParent;if(!a)return null;const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:n.top,i=e?0:o.top;let l=0;if(t){const c=this.element.parentElement;if(c){const{bottom:d}=c.getBoundingClientRect();l=d-n.bottom}}return a+i-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:a}=this.config;let n=!1;if(typeof e=="string"&&e.includes("%"))Ne(t,e),e=$a(t),n=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=a?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(n?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Ne(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,a){const{forcePopupParentAsOffsetParent:n}=this.config,o=n?this.boundaryEl:this.element;o&&(this.popupSvc?.positionPopup({ePopup:o,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:a}),this.setPosition(Number.parseFloat(o.style.left),Number.parseFloat(o.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const a=this.getAvailableHeight();this.element.style.setProperty("max-height",`${a}px`)};e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=st(this.beans,this.popupSvc?.getPopupParent(),t)):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:a,isTop:n,anywhereWithin:o,topBuffer:r}=e,i=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,s=this.shouldSkipX(t,!!a,!!o,i)?0:i,c=this.shouldSkipY(t,!!n,r,l)?0:l;return{movementX:s,movementY:c}}shouldSkipX(e,t,a,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let s=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=i.right;return s?!0:(t?s=n<0&&e.clientX>l+r.left||n>0&&e.clientX<l+r.left:a?s=n<0&&e.clientX>i.right||n>0&&e.clientX<l+r.left:s=n<0&&e.clientX>i.right||n>0&&e.clientX<i.right,s)}shouldSkipY(e,t,a=0,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),i=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let s=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=i.bottom;return s?!0:(t?s=n<0&&e.clientY>l+r.top+a||n>0&&e.clientY<l+r.top:s=n<0&&e.clientY>i.bottom||n>0&&e.clientY<i.bottom,s)}createResizeMap(){const e=t=>({element:this.element.querySelector(`[data-ref=${t}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild(yt(xb)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${xd}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:a,forcePopupParentAsOffsetParent:n}=this.config;!a&&!n&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(a=>!a.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,a=0;for(const n of e){const o=!!n.style.flex&&n.style.flex!=="0 0 auto";if(n===this.element)continue;let r=this.minHeight||0,i=this.minWidth||0;if(o){const l=window.getComputedStyle(n);l.minHeight&&(r=Number.parseInt(l.minHeight,10)),l.minWidth&&(i=Number.parseInt(l.minWidth,10))}else r=n.offsetHeight,i=n.offsetWidth;t+=r,a+=i}return{height:t,width:a}}applySizeToSiblings(e){let t=null;const a=this.getSiblings();if(a){for(let n=0;n<a.length;n++){const o=a[n];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=a[n+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:a}=this.config,{isTop:n,isRight:o,isBottom:r,isLeft:i}=this.currentResizer,l=o||i,s=r||n,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:i,isTop:n}),g=this.position.x,u=this.position.y;let h=0,p=0;if(l&&c){const f=i?-1:1,m=this.getWidth(),v=m+c*f;let b=!1;i&&(h=m-v,(g+h<=0||v<=this.minWidth)&&(b=!0,h=0)),b||this.setWidth(v)}if(s&&d){const f=n?-1:1,m=this.getHeight(),v=m+d*f;let b=!1;n?(p=m-v,(u+p<=0||v<=this.minHeight)&&(b=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&m<v&&this.getMinSizeOfSiblings().height+v>this.element.parentElement.offsetHeight&&(b=!0),b||this.setHeight(v)}this.updateDragStartPosition(e.clientX,e.clientY),((t||a)&&h||p)&&this.offsetElement(g+h,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:a}=this.position;let n;this.config.calculateTopBuffer&&(n=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:n});this.offsetElement(t+o,a+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Ed=class extends Rd{},E=null;function li(e){return typeof e?.getGui=="function"}var si=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.includes(" ")){const n=(e||"").split(" ");if(n.length>1){for(const o of n)this.toggleCss(o,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}},Rb=0,ra=class extends ue{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Rb++,this.cssManager=new si(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(a=>[a.selector,a])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(dc):null}applyElementsToComponent(e,t,a,n=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===E)this[t]=n??e;else{const r=a?.[t];if(!this.suppressDataRefValidation&&!r)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){const a=[];for(const n of e.childNodes??[])a.push(n);for(const n of a){if(!(n instanceof HTMLElement))continue;const o=this.createComponentFromElement(n,r=>{const i=r.getGui();if(i)for(const l of n.attributes??[])i.setAttribute(l.name,l.value)},t);if(o){if(o.addItems&&n.children.length){this.createChildComponentsFromTags(n,t);const r=Array.prototype.slice.call(n.children);o.addItems(r)}this.swapComponentForNode(o,e,n)}else n.childNodes&&this.createChildComponentsFromTags(n,t)}}createComponentFromElement(e,t,a){const n=e.nodeName,o=this.getDataRefAttribute(e),r=n.indexOf("AG-")===0,i=r?this.componentSelectors.get(n):null;let l=null;if(i){const s=a&&o?a[o]:void 0;l=new i.component(s),l.setParentComponent(this),this.createBean(l,null,t)}else if(r)throw new Error(`selector: ${n}`);return this.applyElementsToComponent(e,o,a,l),l}swapComponentForNode(e,t,a){const n=e.getGui();t.replaceChild(n,a),t.insertBefore(document.createComment(a.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const a=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const n of e)n.setAttribute("tabindex",a.toString())}setTemplate(e,t,a){let n;typeof e=="string"||e==null?n=co(e):n=yt(e),this.setTemplateFromElement(n,t,a)}setTemplateFromElement(e,t,a,n=!1){if(this.eGui=e,this.suppressDataRefValidation=n,t)for(let o=0;o<t.length;o++){const r=t[o];this.componentSelectors.set(r.selector,r)}this.wireTemplate(e,a)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let a=t;return e==null?null:(a||(a=this.eGui),uo(e)?{element:e,parent:a}:{element:e.getGui(),parent:a})}prependChild(e,t){const{element:a,parent:n}=this.getContainerAndElement(e,t)||{};!a||!n||n.prepend(a)}appendChild(e,t){const{element:a,parent:n}=this.getContainerAndElement(e,t)||{};!a||!n||n.appendChild(a)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:a}=t;nc(this.eGui,e,{skipAriaHidden:a})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:a}=t;W(this.eGui,e,{skipAriaHidden:a});const n={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(n)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,a){this.eGui.addEventListener(e,t,a),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===Fd?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=Fd}},Fd=Symbol(),U=class extends ra{},ci,di,gi,ui,hi,pi,fi;function mt(){return ci===void 0&&(ci=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),ci}function ia(){return di===void 0&&(di=/(firefox)/i.test(navigator.userAgent)),di}function Md(){return gi===void 0&&(gi=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),gi}function Ft(){return ui===void 0&&(ui=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),ui}function mi(e){if(!e)return null;const t=e.tabIndex,a=e.getAttribute("tabIndex");return t===-1&&(a===null||a===""&&!ia())?null:t.toString()}function Eb(){if(fi!==void 0)return fi;if(!document.body)return-1;let e=1e6;const t=ia()?6e6:1e9,a=document.createElement("div");for(document.body.appendChild(a);;){const n=e*2;if(a.style.height=n+"px",n>t||a.clientHeight!==n)break;e=n}return a.remove(),fi=e,e}function vi(){return pi==null&&zd(),pi}function zd(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let a=t.offsetWidth-t.clientWidth;a===0&&t.clientWidth===0&&(a=null),t.parentNode&&t.remove(),a!=null&&(pi=a,hi=a===0)}function Dd(){return hi==null&&zd(),hi}var bi=!1,Eo=0;function Fb(e){Eo>0||(e.addEventListener("keydown",Fo),e.addEventListener("mousedown",Fo))}function Mb(e){Eo>0||(e.removeEventListener("keydown",Fo),e.removeEventListener("mousedown",Fo))}function Fo(e){const t=bi,a=e.type==="keydown";a&&(e.ctrlKey||e.metaKey||e.altKey)||t!==a&&(bi=a)}function zb(e){const t=ne(e);return Fb(t),Eo++,()=>{Eo--,Mb(t)}}function wi(){return bi}function Mt(e,t,a=!1){const n=Tm;let o=ac;t&&(o+=", "+t),a&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(n)).filter(s=>Me(s)),i=Array.prototype.slice.apply(e.querySelectorAll(o));return i.length?((s,c)=>s.filter(d=>c.indexOf(d)===-1))(r,i):r}function zt(e,t=!1,a=!1,n=!1){const o=Mt(e,n?".ag-tab-guard":null,a),r=t?j(o):o[0];return r?(r.focus({preventScroll:!0}),!0):!1}function Dt(e,t,a,n){const o=Mt(t,a?':not([tabindex="-1"])':null),r=_(e);let i;a?i=o.findIndex(s=>s.contains(r)):i=o.indexOf(r);const l=i+(n?-1:1);return l<0||l>=o.length?null:o[l]}function Ci(e,t=5){let a=0;for(;e&&mi(e)===null&&++a<=t;)e=e.parentElement;return mi(e)===null?null:e}var Ad="ag-focus-managed",Pd=class extends ue{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},a={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=a,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:n=>{if(n.defaultPrevented)return;const o=Dt(this.beans,this.eFocusable,!1,n.shiftKey);o&&(o.focus(),n.preventDefault())},...a}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:a}}=this;e.classList.add(Ad),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),a&&this.addManagedElementListeners(e,{focusout:a})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:t=>{if(t.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(t))return;const{callbacks:a}=this;if(a.shouldStopEventPropagation(t)){this.stopPropagationCallbacks.stopPropagation(t);return}t.key===C.TAB?a.onTabKeyDown(t):a.handleKeyDown&&a.handleKeyDown(t)}})}},Id="__ag_Grid_Stop_Propagation";function At(e){e[Id]=!0}function et(e){return e[Id]===!0}var vn={isStopPropagation:et,stopPropagation:At},Ta=class extends Pd{constructor(e,t){super(e,vn,t)}},Db={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:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`};function Te(e,t,a){return fc(e,Db,t,a)}function yi(e,t){const{debounceMs:a}=e;return bn(e)?(a!=null&&R(71),0):a??t}function bn(e){return(e.buttons?.indexOf("apply")??-1)>=0}function Td(e,t,a,n){let o=Te(e,a);if(typeof t=="function"){const r=Te(e,n);o=t({filterOptionKey:n,filterOption:r,placeholder:o})}else typeof t=="string"&&(o=t);return o}var Ld=class extends U{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new Ta(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new Ed(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){const t=e,a=this.params;this.params=t;const{source:n,state:o,additionalEventAttributes:r}=t;n==="colDef"&&this.updateParams(t,a);const i=this.state;this.state=o;const l=r?.fromAction;return(l&&l!=="apply"||o.model!==i.model||!this.areStatesEqual(o.state,i.state))&&this.setModelIntoUi(o.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=bn(e),this.setupApplyDebounced()}doesFilterPass(e){R(283);const{getHandler:t,model:a,column:n}=this.params;return t().doesFilterPass({...e,model:a,handlerParams:this.beans.colFilter.getHandlerParams(n)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return R(284),this.params.model!=null}setupApplyDebounced(){const e=yi(this.params,this.defaultDebounceMs),t=te(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return R(285),this.params.model}setModel(e){R(286);const{beans:t,params:a}=this;return t.colFilter.setModelForColumnLegacy(a.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:a=!0,model:n}}=this;if(!a)return!1;const o=!this.areModelsEqual(t.model,n);return o&&t.onAction("apply",e),o}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const a=this.getModelFromUi(),n={model:a,state:this.getState(),valid:this.canApply(a)};this.state=n;const{params:o,gos:r,eventSvc:i,applyActive:l}=this;o.onStateChange(n),o.onUiChange(this.getUiChangeEventParams()),r.get("enableFilterHandlers")||i.dispatchEvent({type:"filterModified",column:o.column,filterInstance:this}),n.valid&&(e??(e=l?void 0:"debounce"),e==="immediately"?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):e==="debounce"&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:a}=this;if(!t)return;const n=e==="floatingFilter"||e==="columnFilter";n?(t.restoreLastSize(),t.setResizable(a.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(n)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Te(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||e==null&&t==null?!0:e==null||t==null?!1:this.areNonNullModelsEqual(e,t)}},Ab=["aggregation","filter","sort","pivot","columnVisibility","columnSizing","rowGroup"],Mo=class extends ra{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},wn=class extends Mo{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange(()=>e.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}};function Ge(e){const t=e.rowModel;return t.getType()==="clientSide"?t:void 0}function zo(e){const t=e.rowModel;return t.getType()==="infinite"?t:void 0}function Bd(e){const t=e.rowModel;return t.getType()==="serverSide"?t:void 0}function Pb(e){const t=e.rowModel;return t.getType()==="viewport"?t:void 0}var ki="row-group-",Do="t-",Ao="b-",Ib=0,vt=class{constructor(e){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=Ib++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return e!==void 0?e:this.footer?this.sibling?.groupData:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling?this.sibling:this;const{pinnedSibling:t}=e;return t&&e.rowPinned&&(e=t,e.footer&&e.sibling&&(e=e.sibling)),e}get allLeafChildren(){const e=this._leafs;return e===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){const e=this.beans.expansionSvc;return e?e.isExpanded(this):this.level===-1?!0:!!this._expanded}set expanded(e){this._expanded=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const{valueCache:a,eventSvc:n}=this.beans,o=this.data;this.data=e,a?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const r=this.createDataChangedEvent(e,o,t);if(this.__localEventService?.dispatchEvent(r),this.sibling){this.sibling.data=e;const l=this.sibling.createDataChangedEvent(e,o,t);this.sibling.__localEventService?.dispatchEvent(l)}n.dispatchEvent({type:"rowNodeDataChanged",node:this});const i=this.pinnedSibling;i&&(i.data=e,i.__localEventService?.dispatchEvent(i.createDataChangedEvent(e,o,t)),n.dispatchEvent({type:"rowNodeDataChanged",node:i}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,a){return{type:"dataChanged",node:this,oldData:t,newData:e,update:a}}getRowIndexString(){return this.rowIndex==null?(G(13),null):this.rowPinned==="top"?Do+this.rowIndex:this.rowPinned==="bottom"?Ao+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:a}=this.beans,n=a?.createDaemonNode?.(this),o=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),a&&(a.updateRowSelectable(this),a.syncInRowNode(this,n));const r=this.createDataChangedEvent(e,o,!1);this.__localEventService?.dispatchEvent(r)}setId(e){const t=ta(this.beans.gos);if(t)if(this.data){const a=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:a.length>0?a:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(ki)&&G(14,{groupPrefix:ki})}else this.id=void 0;else this.id=e}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=e!==null;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,a){this.beans.expansionSvc?.setExpanded(this,e,t,a)}setDataValue(e,t,a){const{colModel:n,valueSvc:o,gos:r,editSvc:i}=this.beans;if(e==null)return!1;let l=n.getCol(e)??n.getColDefCol(e);if(!l)return!1;if(!this.group){const d=l.getColDef();d.pivotValueColumn&&(l=d.pivotValueColumn)}const s=o.getValueForDisplay({column:l,node:this,from:"data"}).value;if(r.get("readOnlyEdit")){const{beans:{eventSvc:d},data:g,rowIndex:u,rowPinned:h}=this;return d.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:u,rowPinned:h,column:l,colDef:l.colDef,data:g,node:this,oldValue:s,newValue:t,value:t,source:a}),!1}if(a!=="data"&&i&&!i.committing){const d=i.setDataValue({rowNode:this,column:l},t,a);if(d!=null)return d}const c=o.setValue(this,l,t,a);return this.dispatchCellChangedEvent(l,t,s),c&&this.pinnedSibling?.dispatchCellChangedEvent(l,t,s),c}getDataValue(e,t="data"){const{colModel:a,valueSvc:n,formula:o}=this.beans;if(e==null)return;const r=a.getCol(e)??a.getColDefCol(e);if(!r)return;const i=t==="data-raw",l=i||t==="value"?"data":t;let s=n.getValue(r,this,l,i);if(!i&&(o&&r.isAllowFormula()&&o.isFormula(s)&&(s=o.resolveValue(r,this)),t!=="data"&&r.getAggFunc()&&typeof s=="object"&&s!=null)){if(typeof s.toNumber=="function")return s.toNumber();if("value"in s)return s.value}return s}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,a){const n={type:"cellChanged",node:this,column:e,newValue:t,oldValue:a};this.__localEventService?.dispatchEvent(n)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let a=0,n=t.length;a<n;++a)t[a].depthFirstSearch(e);e(this)}getAggregatedChildren(e,t){const a=this.beans;return a.aggChildrenSvc?.getAggregatedChildren(this,a.colModel.getCol(e),t)??[]}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,a="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:a})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){(this.__localEventService??(this.__localEventService=new Ct)).addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e);const a=this.__localEventService??(this.__localEventService=new Ct);this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,a);const n=this.frameworkEventListenerService?.wrap(e,t)??t;a.addEventListener(e,n)}removeEventListener(e,t){const a=this.frameworkEventListenerService?.unwrap(e,t)??t;this.removeLocalListener(e,a)}removeLocalListener(e,t){const a=this.__localEventService;a&&(a.removeEventListener(e,t),a.noRegisteredListenersExist()&&(this.__localEventService=null))}isFullWidthCell(){if(R(61),this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const e=[];let t=this;for(;t?.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged"))}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged"))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged"))}getFirstChild(){const e=this.childStore;return e?e.getFirstNode():this.childrenAfterSort?.[0]??null}_destroy(e){if(this.destroyed)return!1;this.destroyed=!0;const t=this.pinnedSibling;if(t?.rowPinned&&!this.rowPinned&&this.beans.pinnedRowModel?.pinRow(t,null),e?this.clearRowTopAndRowIndex():(this.setRowTop(null),this.setRowIndex(null)),!this.footer){const a=this.detailNode;a&&a._destroy(e);const n=this.sibling;n&&n._destroy(e)}return!0}};function Od(e,t,a){return I(t,{type:a,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var Tb=new Set(["__autoHeights","__checkAutoHeightsDebounced","__localEventService","__objectId","_groupData","_leafs","childStore","groupValue","oldRowTop","sticky","treeNodeFlags","treeParent"]),Hd=(e,t)=>{const a=new vt(t);for(const n of Object.keys(e))Tb.has(n)||(a[n]=e[n]);return a.oldRowTop=null,a},Po=(e,t,a)=>{if(!a)return;let n=a.rowIndex;if(n==null)return;n+=t;const o=e.getRowCount();for(;n>=0&&n<o;){const r=e.getRow(n);if(!r||!r.footer&&!r.detail)return r;n+=t}},Nd=class{constructor(e,t){this.beans=e,this.floating=t,this.all=new Set,this.visible=new Set,this.order=[],this.queued=new Set}size(){return this.visible.size}add(e){const{all:t,visible:a,order:n}=this;t.has(e)||(t.add(e),a.add(e),n.push(e),this.sort())}delete(e){this.all.delete(e),this.visible.delete(e),this.queued.delete(e.id),Pe(this.order,e)}has(e){return this.visible.has(e)}forEach(e){this.order.forEach(e)}getByIndex(e){return this.order[e]}getById(e){for(const t of this.visible)if(t.id==e)return t}clear(){const{all:e,visible:t,order:a,queued:n}=this;e.clear(),n.clear(),t.clear(),a.length=0}sort(){const{sortSvc:e,rowNodeSorter:t,gos:a}=this.beans,n=e?.getSortOptions()??[],o=this.order,r=Ob(o);if(o.sort((l,s)=>t?.compareRowNodes(n,l,s)||(l.pinnedSibling?.rowIndex??0)-(s.pinnedSibling?.rowIndex??0)),!r)return;const i=Qr(a);i==="bottom"||i==="pinnedBottom"?this.order.push(r):this.order.unshift(r)}hide(e){const{all:t,visible:a}=this,n=a.size;return t.forEach(o=>e(o)?a.delete(o):a.add(o)),this.order=Array.from(a),this.sort(),n!=a.size}queue(e){this.queued.add(e)}unqueue(e){this.queued.delete(e)}forEachQueued(e){this.queued.forEach(e)}};function Vd(e){if(e.level===-1)return!0;const t=e.parent;return t?.childrenAfterSort?.some(a=>a==e)?Vd(t):!1}function Si(e,t){const{gos:a,rowModel:n,filterManager:o}=e;return Fa(a,n)?!n.getRowNode(t.id):o?.isAnyFilterPresent()?!Vd(t):a.get("pivotMode")?!t.group:!1}function Lb(e){return!!e.footer&&e.level===-1}function Bb(e){return!!e.pinnedSibling&&Lb(e.pinnedSibling)}function Ob(e){const t=e.findIndex(Bb);if(t>-1)return e.splice(t,1)?.[0]}var Gd=class extends y{constructor(){super(...arguments),this.csrm=null}postConstruct(){const{gos:e,beans:t}=this;this.top=new Nd(t,"top"),this.bottom=new Nd(t,"bottom"),this.csrm=Ge(t)??null;const a=o=>Si(t,o.pinnedSibling),n=()=>{const o=e.get("isRowPinned");o&&e.get("enableRowPinning")&&t.rowModel.forEachNode(r=>this.pinRow(r,o(r)),!0),this.refreshRowPositions(),this.dispatchRowPinnedEvents()};this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this),modelUpdated:({keepRenderedRows:o})=>{this.tryToEmptyQueues(),this.pinGrandTotalRow();let r=!1;this.forContainers(l=>{r||(r=l.hide(a))});const i=this.refreshRowPositions();(!o||i||r)&&this.dispatchRowPinnedEvents()},columnRowGroupChanged:()=>{this.forContainers(Nb),this.refreshRowPositions()},rowNodeDataChanged:({node:o})=>{(e.get("isRowPinnable")?.(o)??!0)||this.pinRow(o,null)},firstDataRendered:n}),this.addManagedPropertyListener("pivotMode",()=>{this.forContainers(o=>o.hide(a)),this.dispatchRowPinnedEvents()}),this.addManagedPropertyListener("grandTotalRow",({currentValue:o})=>{this._grandTotalPinned=o==="pinnedBottom"?"bottom":o==="pinnedTop"?"top":null}),this.addManagedPropertyListener("isRowPinned",n)}destroy(){this.reset(!1),super.destroy()}reset(e=!0){this.forContainers(t=>{const a=[];t.forEach(n=>a.push(n)),a.forEach(n=>this.pinRow(n,null)),t.clear()}),e&&this.dispatchRowPinnedEvents()}pinRow(e,t,a){if(t!=null&&e.destroyed)return;if(e.footer){const i=e.level;if(i>-1)return;if(i===-1){this._grandTotalPinned=t,this.csrm?.reMapRows();return}}const n=e.rowPinned??e.pinnedSibling?.rowPinned;if(n!=null&&t!=null&&t!=n){const i=e.rowPinned?e:e.pinnedSibling,l=e.rowPinned?e.pinnedSibling:e;this.pinRow(i,null,a),this.pinRow(l,t,a);return}const r=a&&Vb(this.beans,e,a);if(r){r.forEach(i=>this.pinRow(i,t));return}if(t==null){const i=e.rowPinned?e:e.pinnedSibling,l=this.findPinnedRowNode(i);if(!l)return;l.delete(i);const s=i.pinnedSibling;xi(i),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(s)}else{const i=qd(this.beans,e,t),l=this.getContainer(t);l.add(i),Si(this.beans,e)&&l.hide(s=>Si(this.beans,s.pinnedSibling)),this.refreshRowPositions(t),this.dispatchRowPinnedEvents(e)}}isManual(){return!0}isEmpty(e){return this.getContainer(e).size()===0}isRowsToRender(e){return!this.isEmpty(e)}ensureRowHeightsValid(){let e=!1,t=0;const a=n=>{if(n.rowHeightEstimated){const o=ct(this.beans,n);n.setRowTop(t),n.setRowHeight(o.height),t+=o.height,e=!0}};return this.bottom.forEach(a),t=0,this.top.forEach(a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}getPinnedTopTotalHeight(){return Wd(this.top)}getPinnedBottomTotalHeight(){return Wd(this.bottom)}getPinnedTopRowCount(){return this.top.size()}getPinnedBottomRowCount(){return this.bottom.size()}getPinnedTopRow(e){return this.top.getByIndex(e)}getPinnedBottomRow(e){return this.bottom.getByIndex(e)}getPinnedRowById(e,t){return this.getContainer(t).getById(e)}forEachPinnedRow(e,t){this.getContainer(e).forEach(t)}getPinnedState(){const e=t=>{const a=[];return this.forEachPinnedRow(t,n=>{const o=n.pinnedSibling?.id;o!=null&&a.push(o)}),a};return{top:e("top"),bottom:e("bottom")}}setPinnedState(e){this.forContainers((t,a)=>{for(const n of e[a]){const o=this.beans.rowModel.getRowNode(n);o?this.pinRow(o,a):t.queue(n)}})}getGrandTotalPinned(){return this._grandTotalPinned}setGrandTotalPinned(e){this._grandTotalPinned=e}tryToEmptyQueues(){this.forContainers((e,t)=>{const a=new Set;e.forEachQueued(n=>{const o=this.beans.rowModel.getRowNode(n);o&&a.add(o)});for(const n of a)e.unqueue(n.id),this.pinRow(n,t)})}pinGrandTotalRow(){const{csrm:e,beans:t,_grandTotalPinned:a}=this;if(!e)return;const n=e.rootNode?.sibling;if(!n)return;const o=n.pinnedSibling,r=o&&this.findPinnedRowNode(o);if(a){if(r&&r.floating!==a&&(xi(o),r.delete(o)),!r||r.floating!==a){const i=qd(t,n,a);this.getContainer(a).add(i)}}else{if(!r)return;xi(o),r.delete(o)}}onGridStylesChanges(e){e.rowHeightChanged&&this.forContainers(t=>t.forEach(a=>a.setRowHeight(a.rowHeight,!0)))}getContainer(e){return e==="top"?this.top:this.bottom}findPinnedRowNode(e){if(this.top.has(e))return this.top;if(this.bottom.has(e))return this.bottom}refreshRowPositions(e){const t=n=>Hb(this.beans,n);if(e)return t(this.getContainer(e));let a=!1;return this.forContainers(n=>{const o=t(n);a||(a=o)}),a}forContainers(e){e(this.top,"top"),e(this.bottom,"bottom")}dispatchRowPinnedEvents(e){this.eventSvc.dispatchEvent({type:"pinnedRowsChanged"}),e?.dispatchRowEvent("rowPinned")}};function Hb(e,t){let a=0,n=!1;return t.forEach((o,r)=>{if(n||(n=o.rowTop!==a),o.setRowTop(a),o.rowHeightEstimated||o.rowHeight==null){const i=ct(e,o).height;n||(n=o.rowHeight!==i),o.setRowHeight(i)}o.setRowIndex(r),a+=o.rowHeight}),n}function qd(e,t,a){if(t.pinnedSibling)return t.pinnedSibling;const n=Hd(t,e);n.setRowTop(null),n.setRowIndex(null),n.rowPinned=a;const o=a==="top"?Do:Ao;return n.id=`${o}${a}-${t.id}`,n.pinnedSibling=t,t.pinnedSibling=n,n}function xi(e){if(!e.pinnedSibling)return;e.rowPinned=null,e._destroy(!1);const t=e.pinnedSibling;e.pinnedSibling=void 0,t&&(t.pinnedSibling=void 0,t.rowPinned=null)}function Nb(e){const t=new Set;e.forEach(a=>{a.group&&t.add(a)}),t.forEach(a=>e.delete(a))}function Vb(e,t,a){const{rowSpanSvc:n}=e,o=(a&&n?.isCellSpanning(a,t))??!1;if(a&&o)return n?.getCellSpan(a,t)?.spannedNodes}function Wd(e){const t=e.size();if(t===0)return 0;const a=e.getByIndex(t-1);return a===void 0?0:a.rowTop+a.rowHeight}var Ud=class extends y{constructor(){super(...arguments),this.nextId=0,this.pinnedTopRows={cache:{},order:[]},this.pinnedBottomRows={cache:{},order:[]}}postConstruct(){const e=this.gos;this.setPinnedRowData(e.get("pinnedTopRowData"),"top"),this.setPinnedRowData(e.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",t=>this.setPinnedRowData(t.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",t=>this.setPinnedRowData(t.currentValue,"bottom")),this.addManagedEventListeners({stylesChanged:this.onGridStylesChanges.bind(this)})}reset(){}isEmpty(e){return this.getCache(e).order.length===0}isRowsToRender(e){return!this.isEmpty(e)}isManual(){return!1}pinRow(e,t){}onGridStylesChanges(e){if(e.rowHeightChanged){const t=a=>{a.setRowHeight(a.rowHeight,!0)};yn(this.pinnedBottomRows,t),yn(this.pinnedTopRows,t)}}ensureRowHeightsValid(){let e=!1,t=0;const a=n=>{if(n.rowHeightEstimated){const o=ct(this.beans,n);n.setRowTop(t),n.setRowHeight(o.height),t+=o.height,e=!0}};return yn(this.pinnedBottomRows,a),t=0,yn(this.pinnedTopRows,a),this.eventSvc.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventSvc.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const a=this.getCache(t);if(e===void 0){a.order.length=0,a.cache={};return}const n=ta(this.gos),o=t==="top"?Do:Ao,r=new Set(a.order),i=[],l=new Set;let s=0,c=-1;for(const d of e){const g=n?.({data:d,level:0,rowPinned:t})??o+this.nextId++;if(l.has(g)){R(96,{id:g,data:d});continue}c++,l.add(g),i.push(g);const u=Cn(a,g);if(u!==void 0)u.data!==d&&u.updateData(d),s+=this.setRowTopAndRowIndex(u,s,c),r.delete(g);else{const h=new vt(this.beans);h.id=g,h.data=d,h.rowPinned=t,s+=this.setRowTopAndRowIndex(h,s,c),a.cache[g]=h,a.order.push(g)}}for(const d of r)Cn(a,d)?.clearRowTopAndRowIndex(),delete a.cache[d];a.order=i}setRowTopAndRowIndex(e,t,a){return e.setRowTop(t),e.setRowHeight(ct(this.beans,e).height),e.setRowIndex(a),e.rowHeight}getPinnedTopTotalHeight(){return jd(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return jd(this.pinnedBottomRows)}getPinnedTopRowCount(){return Ei(this.pinnedTopRows)}getPinnedBottomRowCount(){return Ei(this.pinnedBottomRows)}getPinnedTopRow(e){return Ri(this.pinnedTopRows,e)}getPinnedBottomRow(e){return Ri(this.pinnedBottomRows,e)}getPinnedRowById(e,t){return Cn(this.getCache(t),e)}forEachPinnedRow(e,t){return yn(this.getCache(e),t)}getCache(e){return e==="top"?this.pinnedTopRows:this.pinnedBottomRows}getPinnedState(){return{top:[],bottom:[]}}setPinnedState(){}getGrandTotalPinned(){}setGrandTotalPinned(){}};function jd(e){const t=Ei(e);if(t===0)return 0;const a=Ri(e,t-1);return a===void 0?0:a.rowTop+a.rowHeight}function Cn(e,t){return e.cache[t]}function Ri(e,t){return Cn(e,e.order[t])}function yn(e,t){e.order.forEach((a,n)=>{const o=Cn(e,a);o&&t(o,n)})}function Ei(e){return e.order.length}var Yd=class extends y{constructor(){super(...arguments),this.beanName="pinnedRowModel"}postConstruct(){const{gos:e}=this,t=()=>{const a=e.get("enableRowPinning"),n=Qr(e),r=!!a||(n==="pinnedBottom"||n==="pinnedTop"),i=r?this.inner instanceof Ud:this.inner instanceof Gd;this.inner&&i&&this.destroyBean(this.inner),(i||!this.inner)&&(this.inner=this.createManagedBean(r?new Gd:new Ud))};this.addManagedPropertyListeners(["enableRowPinning","grandTotalRow"],t),t()}reset(){return this.inner.reset()}isEmpty(e){return this.inner.isEmpty(e)}isManual(){return this.inner.isManual()}isRowsToRender(e){return this.inner.isRowsToRender(e)}pinRow(e,t,a){return this.inner.pinRow(e,t,a)}ensureRowHeightsValid(){return this.inner.ensureRowHeightsValid()}getPinnedRowById(e,t){return this.inner.getPinnedRowById(e,t)}getPinnedTopTotalHeight(){return this.inner.getPinnedTopTotalHeight()}getPinnedBottomTotalHeight(){return this.inner.getPinnedBottomTotalHeight()}getPinnedTopRowCount(){return this.inner.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.inner.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.inner.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.inner.getPinnedBottomRow(e)}forEachPinnedRow(e,t){return this.inner.forEachPinnedRow(e,t)}getPinnedState(){return this.inner.getPinnedState()}setPinnedState(e){return this.inner.setPinnedState(e)}setGrandTotalPinned(e){return this.inner.setGrandTotalPinned(e)}getGrandTotalPinned(){return this.inner.getGrandTotalPinned()}},Kd=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Kd||{}),Gb=500,qb=550,Io,Wb=e=>{if(!Io)Io=new WeakSet;else if(Io.has(e))return!1;return Io.add(e),!0},Pt=class{constructor(e,t=!1){this.eElement=e,this.preventClick=t,this.startListener=null,this.handlers=[],this.eventSvc=void 0,this.touchStart=null,this.lastTapTime=null,this.longPressTimer=0,this.moved=!1}addEventListener(e,t){let a=this.eventSvc;if(!a){if(a===null)return;this.eventSvc=a=new Ct;const n=this.onTouchStart.bind(this);this.startListener=n,this.eElement.addEventListener("touchstart",n,{passive:!0})}a.addEventListener(e,t)}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t)}onTouchStart(e){if(this.touchStart||!Wb(e))return;const t=e.touches[0];this.touchStart=t;const a=this.handlers;if(!a.length){const n=this.eElement,o=n.ownerDocument,r=this.onTouchMove.bind(this),i=this.onTouchEnd.bind(this),l=this.onTouchCancel.bind(this),s={passive:!0},c={passive:!1};po(a,[n,"touchmove",r,s],[o,"touchcancel",l,s],[o,"touchend",i,c],[o,"contextmenu",kt,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{this.longPressTimer=0,this.touchStart===t&&!this.moved&&(this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e}))},qb)}onTouchMove(e){const{moved:t,touchStart:a}=this;if(!t&&a){const n=Sa(a,e.touches);n&&!hc(n,a,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&kt(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;!t||!Sa(t,e.changedTouches)||(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const a=this.lastTapTime;a&&t-a>Gb&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),Br(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e)),this.cancel(),this.eElement=null,this.eventSvc=null}},_d=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(_d||{}),Ub=1,Qd=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=Ub++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const a=new t;a.beanName?this.beans[a.beanName]=a:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(a)}for(const t of e.derivedBeans??[]){const{beanName:a,bean:n}=t(this);this.beans[a]=n,this.createdBeans.push(n)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const a=this.beans;for(const n of e)n.preWireBeans?.(a),n.wireBeans?.(a);for(const n of e)n.preConstruct?.();t&&e.forEach(t);for(const n of e)n.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}};function jb(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var Yb=["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"],Zd=Object.fromEntries(Yb.map((e,t)=>[e,t]));function Kb(e,t){const a=(e.beanName?Zd[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,n=(t.beanName?Zd[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return a-n}function _b(e,t){return e?.beanName==="gridDestroySvc"?-1:t?.beanName==="gridDestroySvc"?1:0}function Jd(e){const{rowIndex:t,rowPinned:a,column:n}=e;return`${t}.${a??"null"}.${n.getId()}`}function To(e,t){const a=e.column===t.column,n=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return a&&n&&o}function Xd(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(z(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}function $d(e,t){return!e&&!t?!0:!e||!t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}function Fi(e){let t=0,a;const{pinnedRowModel:n,rowModel:o,pageBounds:r}=e;return n?.getPinnedTopRowCount()?a="top":o.getRowCount()?(a=null,t=r.getFirstRow()):n?.getPinnedBottomRowCount()&&(a="bottom"),a===void 0?null:{rowIndex:t,rowPinned:a}}function Mi(e){let t,a=null;const{pinnedRowModel:n,pageBounds:o}=e,r=n?.getPinnedBottomRowCount(),i=n?.getPinnedTopRowCount();return r?(a="bottom",t=r-1):e.rowModel.getRowCount()?t=o.getLastRow():i&&(a="top",t=i-1),t===void 0?null:{rowIndex:t,rowPinned:a}}function qe(e,t){switch(t.rowPinned){case"top":return e.pinnedRowModel?.getPinnedTopRow(t.rowIndex);case"bottom":return e.pinnedRowModel?.getPinnedBottomRow(t.rowIndex);default:return e.rowModel.getRow(t.rowIndex)}}function la(e,t){const a=e.spannedRowRenderer?.getCellByPosition(t);if(a)return a;const n=e.rowRenderer.getRowByPosition(t);return n?n.getCellCtrl(t.column):null}function Qb(e,t,a){const{rowModel:n,pinnedRowModel:o}=e;let r;return r??(r=n?.getRowNode(t)),a?r??(r=o?.getPinnedRowById(t,a)):(r??(r=o?.getPinnedRowById(t,"top")),r??(r=o?.getPinnedRowById(t,"bottom"))),r}function kn(e,t,a=!1){const{rowIndex:n,rowPinned:o}=t,{pageBounds:r,pinnedRowModel:i,rowModel:l}=e;if(n===0)return o==="top"?null:o==="bottom"&&l.isRowsToRender()?{rowIndex:r.getLastRow(),rowPinned:null}:i?.isRowsToRender("top")?{rowIndex:i.getPinnedTopRowCount()-1,rowPinned:"top"}:null;if(a){const s=o?void 0:l.getRow(n);return eg(e,s,!0)??{rowIndex:n-1,rowPinned:o}}return{rowIndex:n-1,rowPinned:o}}function Zb(e,t){const{pinnedRowModel:a,rowModel:n}=e,o=a?.getPinnedTopRowCount()??0,r=n.getRowCount(),{rowPinned:i,rowIndex:l}=t;return i==="top"?l:i==="bottom"?o+r+l:o+l}function zi(e,t,a=!1){const{rowIndex:n,rowPinned:o}=t,{pageBounds:r,pinnedRowModel:i,rowModel:l}=e;if(Jb(e,t))return o==="bottom"?null:o==="top"&&l.isRowsToRender()?{rowIndex:r.getFirstRow(),rowPinned:null}:i?.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;if(a){const s=o?void 0:l.getRow(n);return eg(e,s)??{rowIndex:n+1,rowPinned:o}}return{rowIndex:n+1,rowPinned:o}}function eg(e,t,a=!1){const{gos:n,rowRenderer:o}=e;if(!t?.sticky||!_r(n))return;const r=o.getStickyTopRowCtrls(),i=o.getStickyBottomRowCtrls(),l=!i.some(g=>g.rowNode.rowIndex===t.rowIndex),s=l?r:i,c=(a?-1:1)*(l?-1:1);let d;for(let g=0;g<s.length;g++)if(s[g].rowNode.rowIndex===t.rowIndex){d=s[g+c];break}return d?{rowIndex:d.rowNode.rowIndex,rowPinned:null}:void 0}function Jb(e,t){const{rowPinned:a,rowIndex:n}=t,{pinnedRowModel:o,pageBounds:r}=e;return a==="top"?(o?.getPinnedTopRowCount()??0)-1<=n:a==="bottom"?(o?.getPinnedBottomRowCount()??0)-1<=n:r.getLastRow()<=n}function tg(e,t,a){t.addManagedElementListeners(a,{keydown:n=>{if(!n.defaultPrevented&&!ew(n)&&n.key===C.TAB){const o=n.shiftKey;Dt(e,a,!1,o)||sa(e,o)&&n.preventDefault()}}})}function ag(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}function We(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function Sn(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function sa(e,t,a=!1){const n=e.ctrlsSvc.get("gridCtrl"),o=n.focusNextInnerContainer(t);return o===!0?!0:o===!1?o:((a||!t&&!n.isDetailGrid()&&n.isFocusInsideGridBody())&&n.forceFocusOutOfContainer(t),!1)}function ng(e,t){const a=e.focusSvc,n=a.getFocusedCell();if(n&&t&&To(n,t)){const{rowIndex:o,rowPinned:r,column:i}=t;eo(e)&&a.setFocusedCell({rowIndex:o,column:i,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!wi()})}}function Xb(e,t){const a=e.getFocusableContainerName();return a==="gridBody"?t():og(e,()=>Mt(e.getGui(),".ag-tab-guard").length>0)?a:null}function og(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var rg="__ag_Grid_Skip_Focusable_Container";function $b(e){e[rg]=!0}function ew(e){return e[rg]===!0}function tw(e){return e.cols?e.cols.treeDepth+1:-1}function Le(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Di(e){const t=[],a=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const n of a){if(!n)continue;const o=n.getGroupRowCount()||0;for(let r=0;r<o;r++){const i=n.getGroupRowCtrlAtIndex(r),l=t[r];if(i){const s=aw(e,i);(l==null||s>l)&&(t[r]=s)}}}return t}function aw(e,t){let n=e.colModel.isPivotMode()?ow(e):ig(e);const o=t.getHeaderCellCtrls();for(const r of o){const{column:i}=r,l=i.getAutoHeaderHeight();l!=null&&l>n&&i.isAutoHeaderHeight()&&(n=l)}return n}function Ai(e){let a=e.colModel.isPivotMode()?nw(e):xn(e);return e.colModel.forAllCols(n=>{const o=n.getAutoHeaderHeight();o!=null&&o>a&&n.isAutoHeaderHeight()&&(a=o)}),a}function xn(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Pi(e){return e.gos.get("floatingFiltersHeight")??xn(e)}function ig(e){return e.gos.get("groupHeaderHeight")??xn(e)}function nw(e){return e.gos.get("pivotHeaderHeight")??xn(e)}function ow(e){return e.gos.get("pivotGroupHeaderHeight")??ig(e)}function rw(e,t){return e.headerRowIndex===t.headerRowIndex&&e.column===t.column}function iw(e){return e?.headerRowIndex!=null}var lg=class extends y{setComp(e,t,a){this.comp=e,this.eGui=t;const{beans:n}=this,{headerNavigation:o,touchSvc:r,ctrlsSvc:i}=n;o&&this.createManagedBean(new Ta(a,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,n),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,n)}),this.onPivotModeChanged(n),this.setupHeaderHeight();const l=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:l}),r?.mockHeaderContextMenu(this,l),i.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>Qe(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const a=Di(e).reduce((i,l)=>i+l,0),n=Ai(e);e.filterManager?.hasFloatingFilters()&&(t+=Pi(e)),t+=a,t+=n;const o=e.environment.getHeaderRowBorderWidth(),r=t+o;if(this.headerHeightWithBorder!==r){this.headerHeightWithBorder=r;const i=`${r}px`;this.comp.setHeightAndMinHeight(i)}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const a=e.visibleCols.allCols.some(n=>n.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",a)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),a=e.shiftKey,n=a!==t?"LEFT":"RIGHT",{beans:o}=this,{headerNavigation:r,focusSvc:i}=o;(r.navigateHorizontally(n,!0,e)||!a&&i.focusOverlay(!1)||sa(o,a,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:a}=this.beans;switch(e.key){case C.LEFT:t="LEFT";case C.RIGHT:{z(t)||(t="RIGHT"),a.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case C.UP:t="UP";case C.DOWN:{z(t)||(t="DOWN"),a.navigateVertically(t,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:a,beans:n}=this;!t&&a.contains(_(n))||a.contains(t)||(n.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,a){const{menuSvc:n,ctrlsSvc:o}=this.beans;if(!e&&!a||!n?.isHeaderContextMenuEnabled())return;const{target:r}=e??t;(r===this.eGui||r===o.getHeaderRowContainerCtrl()?.eViewport)&&n.showHeaderContextMenu(void 0,e,a)}},Ii=class extends U{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},lw={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"}]},sw=class extends Ii{constructor(e){super(lw,e),this.eResize=E,this.eHeaderCompWrapper=E,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const n=this.ctrl.getSelectAllGui();n&&(this.eResize.insertAdjacentElement("afterend",n),this.addDestroyFunc(()=>n.remove()))},a={setWidth:n=>e.style.width=n,toggleCss:(n,o)=>this.toggleCss(n,o),setUserStyles:n=>tn(e,n),setAriaSort:n=>n?Js(e,n):Xs(e),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(a,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(a=>this.afterCompCreated(t,a))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},cw={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"}]},dw=class extends Ii{constructor(e){super(cw,e),this.eResize=E,this.eHeaderCompWrapper=E}postConstruct(){const e=this.getGui(),t=(n,o)=>o!=null?e.setAttribute(n,o):e.removeAttribute(n),a={toggleCss:(n,o)=>this.toggleCss(n,o),setUserStyles:n=>tn(e,n),setHeaderWrapperHidden:n=>{n?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:n=>{n!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${n}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",n!=null)},setResizableDisplayed:n=>W(this.eResize,n),setWidth:n=>e.style.width=n,setAriaExpanded:n=>t("aria-expanded",n),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(a,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const a=this.getGui(),n=e.getGui();this.eHeaderCompWrapper.appendChild(n),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(a)}},gw={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"}}]}]},uw=class extends Ii{constructor(e){super(gw,e),this.eFloatingFilterBody=E,this.eButtonWrapper=E,this.eButtonShowMainFilter=E}postConstruct(){const e=this.getGui(),t={toggleCss:(a,n)=>this.toggleCss(a,n),setUserStyles:a=>tn(e,a),addOrRemoveBodyCssClass:(a,n)=>this.eFloatingFilterBody.classList.toggle(a,n),setButtonWrapperDisplayed:a=>W(this.eButtonWrapper,a),setCompDetails:a=>this.setCompDetails(a),getFloatingFilterComp:()=>this.compPromise,setWidth:a=>e.style.width=a,setMenuIcon:a=>this.eButtonShowMainFilter.appendChild(a)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()}}},hw=class extends U{constructor(e){super({tag:"div",cls:e.headerRowClass,role:"row"}),this.ctrl=e,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),wa(this.getGui(),this.ctrl.getAriaRowIndex());const t={setHeight:a=>this.getGui().style.height=a,setTop:a=>this.getGui().style.top=a,setHeaderCtrls:(a,n)=>this.setHeaderCtrls(a,n),setWidth:a=>this.getGui().style.width=a,setRowIndex:a=>wa(this.getGui(),a)};this.ctrl.setComp(t,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const a=this.headerComps;this.headerComps={};for(const n of e){const o=n.instanceId;let r=a[o];delete a[o],r==null&&(r=this.createHeaderComp(n),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}if(Object.values(a).forEach(n=>{n.getGui().remove(),this.destroyBean(n)}),t){const n=Object.values(this.headerComps);n.sort((r,i)=>{const l=r.getCtrl().column.getLeft(),s=i.getCtrl().column.getLeft();return l-s});const o=n.map(r=>r.getGui());lc(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new dw(e);break;case"filter":t=new uw(e);break;default:t=new sw(e);break}return this.createBean(t),t.setParentComponent(this),t}},Ti=class extends y{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=se(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:a}=this.beans,n=t.bodyWidth,o=t.getColsLeftWidth(),r=t.getDisplayedColumnsRightWidth();let i;e?i=n+o+r:(i=n,this.addSpacer&&(this.gos.get("enableRtl")?o:r)===0&&a.verticalScrollShowing&&(i+=a.getScrollbarWidth())),this.callback(i)}},pw=class extends y{};function Rn(e,t,a){return a&&e.addDestroyFunc(()=>t.destroyBean(a)),a??e}var Li=class extends y{constructor(e,t,a,n){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=n,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=a}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:e,colsSpanning:t}=this;return e.gos.get("enableRtl")&&t?j(t):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,a=e.get("suppressColumnMoveAnimation"),n=z(this.columnOrGroup.getOldLeft());t?.isActive()&&n&&!a?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),a=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=a,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===a&&this.setLeft(a)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:a,visibleCols:n}=this.beans;if(!se(a,"print")||e.getPinned()==="left")return t;const r=n.getColsLeftWidth();if(e.getPinned()==="right"){const i=n.bodyWidth;return r+i+t}return r+t}setLeft(e){if(z(e)&&(this.eCell.style.left=`${e}px`),ee(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&Zs(this.ariaEl,t.length)}}},fw="ag-column-first",mw="ag-column-last";function Bi(e,t,a,n){return K(e)?[]:cg(e.headerClass,e,t,a,n)}function vw(e,t,a,n){return K(e)?[]:cg(e.toolPanelClass,e,t,a,n)}function sg(e,t,a){e.toggleCss(fw,a.isColAtEdge(t,"first")),e.toggleCss(mw,a.isColAtEdge(t,"last"))}function bw(e,t,a,n){return I(t,{colDef:e,column:a,columnGroup:n})}function cg(e,t,a,n,o){if(K(e))return[];let r;if(typeof e=="function"){const i=bw(t,a,n,o);r=e(i)}else r=e;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}var ww=0,dg="headerCtrl",Oi=class extends y{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+ww++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,a,n,o){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,a,n,o),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:a}=this.beans.focusSvc.focusedHeader,n=a.getDefinition(),o=n?.suppressHeaderKeyboardEvent;if(!z(o))return!1;const r=I(this.gos,{colDef:n,column:a,headerRowIndex:t,event:e});return!!o(r)}getWrapperHasFocus(){return _(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let a;if(typeof t=="function"){const n=this.getHeaderClassParams();a=t(n)}else a=t;a&&this.comp.setUserStyles(a)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:a,compBean:n}=e,{beans:o}=this,r=g=>{if(!this.isAlive()||!n.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:f}=Qt(this.eGui),m=u+h+p+f,b=t.offsetHeight+m;if(g<5){const k=!ne(o)?.contains(t),S=b==0;if(k||S){fo(()=>r(g+1),"raf",o);return}}this.setColHeaderHeight(this.column,b)};let i=!1,l;const s=()=>{const g=this.column.isAutoHeaderHeight();g&&!i&&c(),!g&&i&&d()},c=()=>{i=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),r(0),l=st(this.beans,t,()=>r(0))},d=()=>{i=!1,l&&l(),this.comp.toggleCss("ag-header-cell-auto-height",!1),l=void 0};s(),n.addDestroyFunc(()=>d()),n.addManagedListeners(this.column,{widthChanged:()=>i&&r(0)}),n.addManagedEventListeners({sortChanged:()=>{i&&window.setTimeout(()=>r(0))}}),a&&a(s)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:a,eGui:n}=this;!e||!t||!n||(sg(e,t,a.visibleCols),Dr(n,a.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=We(this.beans);this.eGui&&we(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=_(this.beans),a=e.key===C.LEFT||e.key===C.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||a)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&pd(e)===C.C)return this.beans.clipboardSvc?.copyToClipboard();if(!a)return;const r=e.key===C.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(r)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:a}=this.beans;return a?a.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:a}=this;let n=e.key===C.LEFT!==t.get("enableRtl");const o=a.getPinned(),r=t.get("enableRtl");return o&&r!==(o==="right")&&(n=!n),(n?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case C.PAGE_DOWN:case C.PAGE_UP:case C.PAGE_HOME:case C.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=dg,{eGui:a,gos:n}=this;$t(n,a,t,this),e.addDestroyFunc(()=>$t(n,a,t,null))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,a){const n=e??t,{menuSvc:o,gos:r}=this.beans;r.get("preventDefaultOnContextMenu")&&n.preventDefault(),o?.isHeaderContextMenuEnabled(a)&&o.showHeaderContextMenu(a,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",a)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:a}=this;e.isColumn?a.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):a.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,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}},Cw=class extends Oi{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(e,t,a,n,o){this.comp=e;const{rowCtrl:r,column:i,beans:l}=this,{colResize:s,context:c,colHover:d,rangeSvc:g}=l,u=Rn(this,c,o);this.setGui(t,u),this.updateState(),this.setupWidth(u),this.setupMovingCss(u),this.setupMenuClass(u),this.setupSortableClass(u),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:n,checkMeasuringCallback:p=>this.setRefreshFunction("measuring",p),compBean:u}),this.addColumnHoverListener(u),this.setupFilterClass(u),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(u),this.setupSelectAll(u),this.setupUserComp(),this.refreshAria(),s?this.resizeFeature=u.createManagedBean(s.createResizeFeature(r.pinned,i,a,e,this)):W(a,!1),d?.createHoverFeature(u,[i],t),g?.createRangeHighlightFeature(u,i,e),u.createManagedBean(new Li(i,t,l)),u.createManagedBean(new Ta(t,{shouldStopEventPropagation:p=>this.shouldStopEventPropagation(p),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(i,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const 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(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.colDef;return I(t.gos,{colDef:a,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return ub(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:a,gos:n}=this.beans;return I(n,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!a&&(!this.openFilterEnabled||Ce(this.gos)),showColumnMenu:(r,i)=>{e?.showColumnMenu({column:this.column,buttonElement:r,positionBy:"button",onClosedCallback:i})},showColumnMenuAfterMouseClick:(r,i)=>{e?.showColumnMenu({column:this.column,mouseEvent:r,positionBy:"mouse",onClosedCallback:i})},showFilter:r=>{e?.showFilterMenu({column:this.column,buttonElement:r,containerType:"columnFilter",positionBy:"button"})},progressSort:r=>{t?.progressSort(this.column,!!r,"uiColumnSorted")},setSort:(r,i)=>{t?.setSortForColumn(this.column,ze(r),!!i,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(r,i)=>{n.assertModuleRegistered("Tooltip",3),this.setupTooltip(r,i)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const a=t.createSelectAllFeature(this.column);a&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(a),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!a&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===C.SPACE?this.selectAllFeature?.onSpaceKeyDown(e):e.key===C.ENTER?this.onEnterKeyDown(e):e.key===C.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:a,sortable:n,beans:o}=this;let r=!1;(e.ctrlKey||e.metaKey)&&(r=this.showMenuOnKeyPress(e,!0)),r||(!e.altKey&&na(a)?o.rangeSvc?.handleColumnSelection(t,e):n&&o.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const a=this.comp.getUserCompInstance();return gg(a)&&a.onMenuKeyboardShortcut(t)?(e.preventDefault(),!0):!1}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),wi()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),a=Bi(t,this.gos,this.column,null),n=this.userHeaderClasses;this.userHeaderClasses=new Set(a);for(const o of a)n.has(o)?n.delete(o):this.comp.toggleCss(o,!0);for(const o of n)this.comp.toggleCss(o,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),!(!e||!this.draggable)&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){const e=this.lookupUserCompDetails();if(!e)return;(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const a=this.column.getActualWidth();this.comp.setWidth(`${a}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const a=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",a),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,a=e===1;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",a)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:a,beans:n}=this,o=Di(this.beans),r=o.reduce((u,h)=>u+h,0)===0;if(a.toggleCss("ag-header-parent-hidden",r),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),a.toggleCss("ag-header-span-height",!1),a.toggleCss("ag-header-span-total",!1);return}const{numberOfParents:i,isSpanningTotal:l}=this.column.getColumnGroupPaddingInfo();a.toggleCss("ag-header-span-height",i>0);const s=Ai(n);if(i===0){a.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${s}px`);return}a.toggleCss("ag-header-span-total",l);const c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=o.length-c;let g=0;for(let u=0;u<d;u++)g+=o[o.length-1-u];e.style.setProperty("top",`${-g}px`),e.style.setProperty("height",`${s+g}px`)}refreshAriaSort(){let e=null;const{beans:t,column:a,comp:n,sortable:o}=this;if(o){const r=this.getLocaleTextFunc(),i=t.sortSvc?.getDisplaySortForColumn(a)??null;n.setAriaSort(wm(i)),e=r("ariaSortableColumn","Press ENTER to sort")}else n.setAriaSort();this.setAriaDescriptionProperty("sort",e)}refreshAriaMenu(){let e=null;this.menuEnabled&&(e=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu")),this.setAriaDescriptionProperty("menu",e)}refreshAriaFilterButton(){let e=null;const{openFilterEnabled:t,gos:a}=this;t&&!Ce(a)&&(e=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter")),this.setAriaDescriptionProperty("filterButton",e)}refreshAriaFiltered(){let e=null;this.column.isFilterActive()&&(e=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered")),this.setAriaDescriptionProperty("filter",e)}refreshAriaCellSelection(){let e=null;const{gos:t,column:a}=this;na(t)&&!pe(a)&&(e=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column")),this.setAriaDescriptionProperty("cellSelection",e)}setAriaDescriptionProperty(e,t){const a=this.ariaDescriptionProperties;t!=null?a.set(e,t):a.delete(e)}announceAriaDescription(){const{beans:e,eGui:t,ariaDescriptionProperties:a}=this;if(!t.contains(_(e)))return;const n=Array.from(a.keys()).sort((o,r)=>o==="filter"?-1:r.charCodeAt(0)-o.charCodeAt(0)).map(o=>a.get(o)).join(". ");e.ariaAnnounce?.announceValue(n,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=o=>this.handleMouseOverChange(o.type==="mouseenter"),a=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},n=o=>this.handleContextMenuMouseEvent(o,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:a,contextmenu:n})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return gg(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function gg(e){return typeof e?.getAnchorElementForMenu=="function"&&typeof e.onMenuKeyboardShortcut=="function"}var yw=0,Hi=class extends y{constructor(e,t,a){super(),this.rowIndex=e,this.pinned=t,this.type=a,this.instanceId=yw++,this.comp=null,this.allCtrls=[];let n="ag-header-row-column";a==="group"?n="ag-header-row-group":a==="filter"&&(n="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${n}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=se(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.allCtrls.every(e=>e.eGui!=null):!1}setComp(e,t,a=!0){this.comp=e,t=Rn(this,this.beans.context,t),a&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),a=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:a,virtualColumnsChanged:n=>this.onVirtualColumnsChanged(n.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",a),e.addManagedPropertyListener("ensureDomOrder",n=>this.isEnsureDomOrder=n.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=se(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=Di(this.beans);for(let o=0;o<t.length;o++){if(o===this.rowIndex&&this.type==="group")return{topOffset:e,rowHeight:t[o]};e+=t[o]}const a=Ai(this.beans);if(this.type==="column")return{topOffset:e,rowHeight:a};e+=a;const n=Pi(this.beans);return{topOffset:e,rowHeight:n}}onVirtualColumnsChanged(e=!1){if(!this.comp)return;const t=this.getUpdatedHeaderCtrls(),a=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,a,e)}getUpdatedHeaderCtrls(){const e=this.ctrlsById;this.ctrlsById=new Map;const t=this.getColumnsInViewport();for(const n of t)this.recycleAndCreateHeaderCtrls(n,this.ctrlsById,e);const a=n=>{const{focusSvc:o,visibleCols:r}=this.beans;return o.isHeaderWrapperFocused(n)?r.isVisible(n.column):!1};if(e)for(const[n,o]of e)a(o)?this.ctrlsById.set(n,o):this.destroyBean(o);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,a){if(e.isEmptyGroup())return;const n=e.getUniqueId();let o;if(a&&(o=a.get(n),a.delete(n)),o&&o.column!=e&&(this.destroyBean(o),o=void 0),o==null)switch(this.type){case"filter":{o=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break}case"group":o=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:o=this.createBean(new Cw(e,this));break}t.set(n,o)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){return this.type==="group"?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const a=this.allCtrls.find(o=>o.column==e);return a?a.focus(t):!1}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},ug=class extends y{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:a,ctrlsSvc:n,colModel:o,colMoves:r}=this.beans;this.setupCenterWidth(),a?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(r,this.eViewport);const i=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:i,advancedFilterEnabledChanged:i});const l=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;n.register(l,this),o.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:a,visibleCols:n}=this.beans;let o=0;const r=t.getFocusHeaderToUseAfterRefresh(),i=()=>{const g=n.headerGroupRowCount;o=g,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const u=this.groupsRowCtrls.length;if(u!==g){if(u>g){for(let h=g;h<u;h++)this.destroyBean(this.groupsRowCtrls[h]);this.groupsRowCtrls.length=g;return}for(let h=u;h<g;h++){const p=this.createBean(new Hi(h,this.pinned,"group"));this.groupsRowCtrls.push(p)}}},l=()=>{const g=o++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}this.columnsRowCtrl==null||!e?(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new Hi(g,this.pinned,"column"))):this.columnsRowCtrl.rowIndex!==g&&this.columnsRowCtrl.setRowIndex(g)},s=()=>{this.includeFloatingFilter=!!a?.hasFloatingFilters()&&!this.hidden;const g=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){g();return}e||g();const u=o++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==u&&this.filtersRowCtrl.setRowIndex(u):this.filtersRowCtrl=this.createBean(new Hi(u,this.pinned,"filter"))},c=this.getAllCtrls();i(),l(),s();const d=this.getAllCtrls();this.comp.setCtrls(d),this.restoreFocusOnHeader(t,r),c.length!==d.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=a=>a?.getHeaderCellCtrls().find(n=>n.column===e);if(dt(e))return t(this.columnsRowCtrl);if(this.groupsRowCtrls.length!==0)for(let a=0;a<this.groupsRowCtrls.length;a++){const n=t(this.groupsRowCtrls[a]);if(n)return n}}getHtmlElementForColumnHeader(e){return this.getHeaderCtrlForColumn(e)?.eGui??null}getRowType(e){return this.getAllCtrls()[e]?.type}focusHeader(e,t,a){const o=this.getAllCtrls()[e];return o?o.focusHeader(t,a):!1}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}destroy(){this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl),this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls),super.destroy()}setupDragAndDrop(e,t){const a=e?.createBodyDropTarget(this.pinned,t);a&&this.createManagedBean(a)}restoreFocusOnHeader(e,t){if(!t)return;const{column:a}=t;a.getPinned()==this.pinned&&e.focusHeaderPosition({headerPosition:t,scroll:!1})}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Ti(e=>this.comp.setCenterWidth(`${e}px`),!0))}},kw={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},Sw={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},xw={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},Ni=class extends U{constructor(e){super(),this.eCenterContainer=E,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:a=>this.setDisplayed(a),setCtrls:a=>this.setCtrls(a),setCenterWidth:a=>this.eCenterContainer.style.width=a,setViewportScrollLeft:a=>this.getGui().scrollLeft=a,setPinnedContainerWidth:a=>{const n=this.getGui();n.style.width=a,n.style.maxWidth=a,n.style.minWidth=a}};this.createManagedBean(new ug(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",a=e?kw:t?Sw:xw;this.setTemplate(a),this.eRowContainer=this.eCenterContainer!==E?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let a;const n=o=>{const r=o.getGui();r.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(r),a&&ic(this.eRowContainer,r,a),a=r};for(const o of e){const r=o.instanceId,i=t[r];delete t[r];const l=i||this.createBean(new hw(o));this.headerRowComps[r]=l,this.rowCompsList.push(l),n(l)}for(const o of Object.values(t))this.destroyRowComp(o)}},Rw={tag:"div",cls:"ag-header",role:"presentation"},Ew=class extends U{constructor(){super(Rw)}postConstruct(){const e={toggleCss:(n,o)=>this.toggleCss(n,o),setHeightAndMinHeight:n=>{this.getGui().style.height=n,this.getGui().style.minHeight=n}};this.createManagedBean(new lg).setComp(e,this.getGui(),this.getFocusableElement());const a=n=>{this.createManagedBean(n),this.appendChild(n)};a(new Ni("left")),a(new Ni(null)),a(new Ni("right"))}},Fw={selector:"AG-HEADER-ROOT",component:Ew},Ue={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Vi=class extends y{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},a=t.autoHeight?Ue.AUTO_HEIGHT:t.print?Ue.PRINT:Ue.NORMAL;this.view.updateLayoutClasses(a,t)}},hg=class extends U{constructor(e,t){super(),this.direction=t,this.eViewport=E,this.eContainer=E,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",Md()||Ft())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Dd(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),a=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:a,touchend:a})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),Qe(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(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(e){const t=this.eViewport;wc(this,()=>Me(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},Mw={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"}]},pg=class extends hg{constructor(){super(Mw,"horizontal"),this.eLeftSpacer=E,this.eRightSpacer=E,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new Ti(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const a=!this.enableRtl&&e,n=this.scrollVisibleSvc.getScrollbarWidth();a&&(t+=n),Ne(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=n);let o=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(o+=n),Ne(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=n)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,a=this.gos.get("suppressHorizontalScroll"),n=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,r=a?0:n===0&&t?16:n,i=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),an(this.getGui(),r),an(this.eViewport,r),an(this.eContainer,r),r||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(i,100):i()}getScrollPosition(){return so(this.eViewport,this.enableRtl)}setScrollPosition(e){Me(this.eViewport)||this.attemptSettingScrollPosition(e),en(this.eViewport,e,this.enableRtl)}},zw={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:pg},fg=class extends y{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,a=t!=null?`${t}px`:"";this.eContainer.style.height=a,this.eViewport&&(this.eViewport.style.height=a)}},Dw={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"}]}]},mg=class extends hg{constructor(){super(Dw,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new fg(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,a=this.invisibleScrollbar,n=t&&e.getScrollbarWidth()||0,o=n===0&&a?16:n;this.toggleCss("ag-scrollbar-invisible",a),Ne(this.getGui(),o),Ne(this.eViewport,o),Ne(this.eContainer,o),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const a=e.getGridBodyCtrl().eBodyViewport,n=this.getScrollPosition(),o=a.scrollTop;n!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){!t&&!Me(this.eViewport)&&this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},Aw={selector:"AG-FAKE-VERTICAL-SCROLL",component:mg},vg=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(vg||{}),It="Viewport",bg="fakeVScrollComp",Gi=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],wg=100,qi=150,Pw=class extends y{constructor(e){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=e,this.resetLastHScrollDebounced=te(this,()=>this.lastScrollSource[1]=null,qi),this.resetLastVScrollDebounced=te(this,()=>this.lastScrollSource[0]=null,qi)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,a=>{this.centerRowsCtrl=a.center,this.fakeVScrollComp=a.fakeVScrollComp,this.fakeHScrollComp=a.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,It)});for(const e of Gi){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.gos.get("debounceVerticalScrollbar"),t=e?te(this,this.onVScroll.bind(this,It),wg):this.onVScroll.bind(this,It),a=e?te(this,this.onVScroll.bind(this,bg),wg):this.onVScroll.bind(this,bg);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,a)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...Gi,It]){if(this.lastScrollSource[1]===t)continue;const a=this.getViewportForSource(t);en(a,e,this.enableRtl)}}getViewportForSource(e){return e===It?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.eViewport,{scrollLeft:a}=t;if(this.shouldBlockScrollUpdate(1,a,!0))return;const n=so(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(n),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;const t=e===It?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition();let a=t;if(this.shouldBlockScrollUpdate(0,a,!0))return;e===It?this.fakeVScrollComp.setScrollPosition(a):(this.eBodyViewport.scrollTop=t,a=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),a!==t&&this.fakeVScrollComp.setScrollPosition(a,!0));const{animationFrameSvc:n}=this;n?.setScrollTop(a),this.nextScrollTop=a,n?.active?n.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.fakeHScrollComp.getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},qi)}shouldBlockScrollUpdate(e,t,a=!1){return a&&!Ft()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=lo(this.eBodyViewport),{scrollHeight:a}=this.eBodyViewport;return e<0||e+t>a}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:a}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>a}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const a of Gi)if(this.getViewportForSource(a).scrollLeft!==e){t=!0;break}t&&this.onHScroll(It)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const n=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl?e=e>0?0:n:e=Math.min(Math.max(e,0),n)),en(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:a,lastScrollTop:n}=this;return{top:n,bottom:n+a}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){const{rowModel:a}=this.beans,n=a.getRowCount();let o=-1;for(let r=0;r<n;r++){const i=a.getRow(r);if(typeof e=="function"){if(i&&e(i)){o=r;break}}else if(e===i||e===i.data){o=r;break}}o>=0&&this.ensureIndexVisible(o,t)}ensureIndexVisible(e,t,a=0){if(se(this.gos,"print"))return;const{rowModel:n}=this.beans,o=n.getRowCount();if(typeof e!="number"||e<0||e>=o){R(88,{index:e});return}this.clearRetryListeners();const{frameworkOverrides:r,pageBounds:i,rowContainerHeight:l,rowRenderer:s}=this.beans;r.wrapIncoming(()=>{const c=this.ctrlsSvc.getGridBodyCtrl(),d=n.getRow(e);let g,u,h=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:p,stickyBottomHeight:f}=c,m=d.rowTop,v=d.rowHeight,b=i.getPixelOffset(),w=d.rowTop-b,k=w+d.rowHeight,S=this.getVScrollPosition(),x=l.divStretchOffset,M=S.top+x,L=S.bottom+x,O=L-M,H=l.getScrollPositionForPixel(w),B=l.getScrollPositionForPixel(k-O),Y=Math.min((H+B)/2,w),q=M+p>w,ge=L-f<k;let re=null;t==="top"?re=H-p:t==="bottom"?re=B+f:t==="middle"?re=Y:q?re=H-p:ge&&(B-H>O?re=H-p:re=B+f),re!==null&&(this.setVerticalScrollPosition(re),s.redraw({afterScroll:!0})),g=m!==d.rowTop||v!==d.rowHeight,u=p!==c.stickyTopHeight||f!==c.stickyBottomHeight,h++}while((g||u)&&h<10);if(this.animationFrameSvc?.flushAllFrames(),a<10&&(d?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const p=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{const f=this.getVScrollPosition().top;p!==f&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),!(e>=n.getRowCount())&&this.ensureIndexVisible(e,t,a+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:a,frameworkOverrides:n}=this.beans,o=a.getCol(e);if(!o||o.isPinned()||!this.visibleCols.isColDisplayed(o))return;const r=this.getPositionedHorizontalScroll(o,t);n.wrapIncoming(()=>{r!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(r),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:a,columnAfterEnd:n}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),i=this.enableRtl;let l=(i?a:n)||o,s=i?n:a;t!=="auto"&&(l=t==="start",s=t==="end");const c=t==="middle";if(l||s||c){const{colLeft:d,colMiddle:g,colRight:u}=this.getColumnBounds(e);return c?g-r/2:l?i?u:d:i?d-r:u-r}return null}isColumnOutsideViewport(e){const{start:t,end:a}=this.getViewportBounds(),{colLeft:n,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,i=r?t>o:a<o,l=r?a<n:t>n;return{columnBeforeStart:i,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,a=this.visibleCols.bodyWidth,n=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,i=t?a-o:o,l=i+n*r,s=i+n/2*r;return{colLeft:i,colMiddle:s,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),a=t,n=e+t;return{start:a,end:n,width:e}}},Cg={horizontal:{overflow:e=>e.scrollWidth-e.clientWidth,scrollSize:e=>e.scrollWidth,clientSize:e=>e.clientWidth,opposite:"vertical"},vertical:{overflow:e=>e.scrollHeight-e.clientHeight,scrollSize:e=>e.scrollHeight,clientSize:e=>e.clientHeight,opposite:"horizontal"}};function Iw(e,t,a=vi()||0,n,o){return yg(e,t,"horizontal",a,n,o)}function Tw(e,t,a=vi()||0,n,o){return yg(e,t,"vertical",a,n,o)}function yg(e,t,a,n,o,r){const i=Cg[a],l=Cg[i.opposite],s=o?Me(o):!0,c=r?Me(r):!0,d=i.overflow(e);if(d<=0)return!1;if(!t||n===0)return!0;const g=l.overflow(t);if(g<=0)return!0;if(d<=n){if(s&&c&&Lw({candidateOverflow:g,candidateScrollSize:l.scrollSize(t),candidateClientSize:l.clientSize(t),scrollbarWidth:n}))return!1;const u=i.clientSize(e)+n;return i.scrollSize(e)<=u}return!0}function Lw({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:a,scrollbarWidth:n}){if(e<=0||e>n)return!1;const o=a+n;return t>a&&t<=o}var Bw=class extends y{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:a}=this,n=()=>{Qe(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(n),a.registerBodyViewportResizeListener(n)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const a=this.centerContainerCtrl.getCenterWidth();a!==this.centerWidth&&(this.centerWidth=a,t?.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(){const e=this.gridBodyCtrl.eBodyViewport,t=lo(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const{centerContainerCtrl:e,beans:t}=this,a=e.getCenterWidth(),n=e.getViewportScrollLeft();t.colViewport.setScrollPosition(a,n)}};function Wi(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}function En(e,t,a,n){const o=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return kg(e,t,a,n,o)}function Ow(e,t,a,n){const o=t?.suppressMouseEventHandling;return kg(e,void 0,a,n,o)}function kg(e,t,a,n,o){return o?o(I(e,{column:t,node:a,event:n})):!1}function Sg(e,t,a){let n=t;for(;n;){const o=Gc(e,n,a);if(o)return o;n=n.parentElement}return null}var Lo="cellCtrl";function Bo(e,t){return Sg(e,t,Lo)}var Oo="renderedRow";function xg(e,t){return Sg(e,t,Oo)}function Ui(e,t,a,n,o){const r=n?n.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const i=I(e,{event:t,editing:o,column:n,node:a,data:a.data,colDef:n.getColDef()});return!!(r&&r(i))}function Rg(e){const{pinnedRowModel:t,rowModel:a,rangeSvc:n,visibleCols:o}=e;if(!n||o.allCols.length===0)return;const r=t?.isEmpty("top")??!0,i=t?.isEmpty("bottom")??!0,l=r?null:"top";let s,c;i?(s=null,c=a.getRowCount()-1):(s="bottom",c=t?.getPinnedBottomRowCount()??-1),n.setCellRange({rowStartIndex:0,rowStartPinned:l,rowEndIndex:c,rowEndPinned:s})}var Hw=class extends y{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";ho("pointerdown")?e="pointerdown":ho("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const a of t){const n=this.processMouseEvent.bind(this,a);this.addManagedElementListeners(this.element,{[a]:n})}}processMouseEvent(e,t){if(!nn(this.beans,t)||et(t))return;const{cellCtrl:a,rowCtrl:n}=this.getControlsForEventTarget(t.target);e==="contextmenu"?(a?.column&&a.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,n,a)):(a&&a.onMouseEvent(e,t),n&&n.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Bo(t,e),rowCtrl:xg(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:a,rowCtrl:n}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(a?this.processCellKeyboardEvent(a,e,t):n?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,e,t))}processCellKeyboardEvent(e,t,a){const n=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;!Ui(this.gos,a,e.rowNode,e.column,n)&&t==="keydown"&&(!n&&this.beans.navigation?.handlePageScrollingKey(a)||e.onKeyDown(a),this.doGridOperations(a,n),Wi(a)&&e.processCharacter(a)),t==="keydown"&&this.eventSvc.dispatchEvent(e.createEvent(a,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,a){const{rowNode:n}=e,{focusSvc:o,navigation:r}=this.beans,l=o.getFocusedCell()?.column;if(!Ui(this.gos,a,n,l,!1)){const c=a.key;if(t==="keydown")switch(c){case C.PAGE_HOME:case C.PAGE_END:case C.PAGE_UP:case C.PAGE_DOWN:r?.handlePageScrollingKey(a,!0);break;case C.LEFT:case C.RIGHT:if(!this.gos.get("embedFullWidthRows"))break;case C.UP:case C.DOWN:e.onKeyboardNavigate(a);break;case C.TAB:e.onTabKeyDown(a);break;default:}}t==="keydown"&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",a))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!nn(this.beans,e))return;const a=pd(e),{clipboardSvc:n,undoRedo:o}=this.beans;if(a===C.A)return this.onCtrlAndA(e);if(a===C.C)return this.onCtrlAndC(n,e);if(a===C.D)return this.onCtrlAndD(n,e);if(a===C.V)return this.onCtrlAndV(n,e);if(a===C.X)return this.onCtrlAndX(n,e);if(a===C.Y)return this.onCtrlAndY(o);if(a===C.Z)return this.onCtrlAndZ(o,e)}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:a,selectionSvc:n},gos:o}=this;a&&Je(o)&&!yv(o)&&t.isRowsToRender()?Rg(this.beans):n&&n.selectAllRowNodes({source:"keyboardSelectAll",selectAll:_c(o)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:a}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(a,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){!this.gos.get("undoRedoCellEditing")||!e||(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Ho=e=>e.topRowCtrls,No=e=>e.getStickyTopRowCtrls(),Vo=e=>e.getStickyBottomRowCtrls(),Go=e=>e.bottomRowCtrls,qo=e=>e.allRowCtrls,ji=e=>e.getCtrls("top"),Yi=e=>e.getCtrls("center"),Ki=e=>e.getCtrls("bottom"),Nw={center:{type:"center",name:"center-cols",getRowCtrls:qo,getSpannedRowCtrls:Yi},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:qo,getSpannedRowCtrls:Yi},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:qo,getSpannedRowCtrls:Yi},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:qo},topCenter:{type:"center",name:"floating-top",getRowCtrls:Ho,getSpannedRowCtrls:ji},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Ho,getSpannedRowCtrls:ji},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Ho,getSpannedRowCtrls:ji},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Ho},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:No},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:No},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:No},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:No},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Vo},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Vo},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Vo},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Vo},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:Go,getSpannedRowCtrls:Ki},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Go,getSpannedRowCtrls:Ki},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Go,getSpannedRowCtrls:Ki},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:Go}};function _i(e){return`ag-${La(e).name}-viewport`}function Qi(e){const t=La(e);return t.container??`ag-${t.name}-container`}function Eg(e){return`ag-${La(e).name}-spanned-cells-container`}function La(e){return Nw[e]}var Vw=["topCenter","topLeft","topRight"],Gw=["bottomCenter","bottomLeft","bottomRight"],qw=["center","left","right"],Ww=["center","left","right","fullWidth"],Uw=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],jw=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Yw=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Fg=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Mg=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],Kw=[...Fg,"stickyTopFullWidth",...Mg,"stickyBottomFullWidth"],_w=[...Vw,...Gw,...qw,...Fg,...Mg],zg=class extends y{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=La(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new Bw(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,a,n){this.comp=e,this.eContainer=t,this.eSpannedContainer=a,this.eViewport=n,this.createManagedBean(new Hw(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:o,rangeSvc:r}=this.beans,i=()=>this.onPinnedWidthChanged();this.forContainers(jw,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:i})}),this.forContainers(Yw,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:i})}),this.forContainers(Ww,()=>this.createManagedBean(new fg(this.eContainer,this.name==="center"?n:void 0))),r&&this.forContainers(_w,()=>this.createManagedBean(r.createDragListenerFeature(this.eContainer))),this.forContainers(Uw,()=>this.createManagedBean(new Ti(l=>this.comp.setContainerWidth(`${l}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,a=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:a,displayedColumnsWidthChanged:a,displayedRowsChanged:n=>this.onDisplayedRowsChanged(n.afterScroll)}),a(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const n=this.options.getSpannedRowCtrls(e);n&&this.comp.setSpannedRowCtrls(n,!1)}})}listenOnDomOrder(){if(Kw.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const a=this.gos.get("ensureDomOrder"),n=se(this.gos,"print");this.comp.setDomOrder(a||n)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=a=>{e.dragging&&a.cancelable&&a.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),a=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,a,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return ka(this.eViewport)}getCenterViewportScrollLeft(){return so(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=st(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return rc(this.eViewport)}getViewportScrollLeft(){return so(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:a}=this,n=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:o}=e,r=o.getGridBodyCtrl()?.eBodyViewport,i=o.get("fakeHScrollComp")?.getGui(),l=o.get("fakeVScrollComp")?.getGui();return n||Iw(a,r,void 0,i,l)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){en(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const a=se(this.gos,"print"),o=this.gos.get("embedFullWidthRows")||a,r=t.filter(i=>{const l=i.isFullWidth();return this.options.fullWidth?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}},Dg="ag-force-vertical-scroll",Qw="ag-selectable",Zw="ag-column-moving",Ag=class extends y{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,a,n,o,r,i){this.comp=e,this.eGridBody=t,this.eBodyViewport=a,this.eTop=n,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=i,this.eCenterColsViewport=a.querySelector(`.${_i("center")}`),this.eFullWidthContainer=a.querySelector(`.${Qi("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new Vi(this.comp)),this.scrollFeature=this.createManagedBean(new Pw(a)),this.beans.rowDragSvc?.setupRowDrag(a,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([n,a,o,r,i]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(n),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),a=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:a,rowResizeEnded:a}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t=e.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const a=t&&e.getScrollbarWidth()||0,n=Dd()?16:0,o=`calc(100% + ${a+n}px)`;Qe(this.beans,()=>this.comp.setBodyViewportWidth(o)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:a}=this;let n=a.get("treeData");if(!n){const o=t.isPivotMode();n=(e?e.columns.length:0)>=(o?2:1)}this.comp.setGridRootRole(n?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:a=>{const{target:n}=a,o=_t(n,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:a=>{const{target:n,relatedTarget:o}=a,r=t.contains(o),i=_t(o,"ag-root",t);_t(n,"ag-root",t)||(!r||i)&&t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss(Zw,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(Qw,e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,a=t.isLastRowIndexKnown()?t.getRowCount():-1,n=a===-1?-1:e+a;this.comp.setRowCount(n)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:a}=this,n=e.get("alwaysShowVerticalScroll"),o=n?Dg:null,r=se(e,"normal");t.setAlwaysVerticalScrollClass(o,n);const i=a.get("center")?.eViewport,l=a.get("fakeHScrollComp")?.getGui(),s=a.get("fakeVScrollComp")?.getGui();return n||r&&Tw(this.eBodyViewport,i,void 0,s,l)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let a=t.sizesMeasured;const n=()=>{const o=a&&ea(this.gos)&&!e.stretching,r=o?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(r,o)};n(),this.addManagedEventListeners({heightScaleChanged:n}),this.addManagedPropertyListener("animateRows",n),this.addManagedEventListeners({stylesChanged:()=>{!a&&t.sizesMeasured&&(a=!0,n())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:a,eTop:n,eBottom:o,beans:{popupSvc:r,touchSvc:i}}=this,l=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:l}),i?.mockBodyContextMenu(this,l),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,r)});const s=this.onStickyWheel.bind(this);for(const d of[t,a,n,o])this.addManagedElementListeners(d,{wheel:s});const c=this.onHorizontalWheel.bind(this);for(const d of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(d).eContainer,{wheel:c});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:a,shiftKey:n}=e;(n||Math.abs(t)>Math.abs(a))&&nn(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:a,shiftKey:n}=e;(n||Math.abs(t)>Math.abs(a))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:a}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||a})}onBodyViewportContextMenu(e,t,a){if(!e&&!a)return;this.gos.get("preventDefaultOnContextMenu")&&(e||a).preventDefault();const{target:n}=e||t;(n===this.eBodyViewport||n===this.ctrlsSvc.get("center").eViewport)&&this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:a,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e,beans:{environment:t}}=this,a=e?.getPinnedTopTotalHeight(),n=e?.getPinnedBottomTotalHeight(),o=t.getPinnedRowBorderWidth(),r=t.getRowBorderWidth(),i=o-r,l=a?i+a:0,s=n?i+n:0;this.comp.setTopHeight(l),this.comp.setBottomHeight(s),this.comp.setTopInvisible(l<=0),this.comp.setBottomInvisible(s<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){const t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),a=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let n=0;t>0&&(n+=t),a>0&&(n+=a),n>0&&(n+=1),this.comp.setStickyTopTop(`${n}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:a}=this,n=e?.getPinnedBottomTotalHeight()??0,r=t.horizontalScrollShowing&&t.getScrollbarWidth()||0,i=n+r;a.setStickyBottomBottom(`${i}px`)}};function oe(e){return yt(e)}var Jw=class extends U{constructor(e,t,a,n,o){super(),this.cellCtrl=t,this.rowResizerElement=null,this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.gos=e.gos,this.column=t.column,this.rowNode=t.rowNode,this.eRow=n;const r=oe({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});this.eCell=r;let i;t.isCellSpanning()?(i=oe({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),i.appendChild(r),this.setTemplateFromElement(i)):this.setTemplateFromElement(r),this.cellCssManager=new si(()=>r),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l={toggleCss:(s,c)=>this.cellCssManager.toggleCss(s,c),setUserStyles:s=>tn(r,s),getFocusableElement:()=>r,setIncludeSelection:s=>this.includeSelection=s,setIncludeRowDrag:s=>this.includeRowDrag=s,setIncludeDndSource:s=>this.includeDndSource=s,setRowResizerElement:s=>this.setRowResizerElement(s),setRenderDetails:(s,c,d)=>this.setRenderDetails(s,c,d),setEditDetails:(s,c,d)=>this.setEditDetails(s,c,d),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(s,c)=>this.refreshEditStyles(s,c)};t.setComp(l,r,i,this.eCellWrapper,a,o,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){this.rowResizerElement&&Fe(this.rowResizerElement),this.rowResizerElement=e,e&&this.eCell.appendChild(e)}setRenderDetails(e,t,a){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(a||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)),this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement&&this.eCell.appendChild(this.rowResizerElement)}setEditDetails(e,t,a){e?this.createCellEditorInstance(e,t,a):this.destroyEditor()}removeControls(){const e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,a=t||this.forceWrapper,n=a&&this.eCellWrapper==null;n&&(this.eCellWrapper=oe({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const o=!a&&this.eCellWrapper!=null;o&&(Fe(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!a);const r=!e&&a,i=r&&this.eCellValue==null;if(i){const c=this.cellCtrl.getCellValueClass();this.eCellValue=oe({tag:"span",cls:c,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&this.eCellValue!=null;l&&(Fe(this.eCellValue),this.eCellValue=void 0);const s=n||o||i||l;return s&&this.removeControls(),!e&&t&&this.addControls(),s}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:a,includeRowDrag:n,includeDndSource:o,includeSelection:r}=this,i=l=>{l&&t.insertBefore(l.getGui(),a)};n&&this.rowDraggingComp==null&&(this.rowDraggingComp=e.createRowDragComp(),i(this.rowDraggingComp)),o&&this.dndSourceComp==null&&(this.dndSourceComp=e.createDndSource(),i(this.dndSourceComp)),r&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),i(this.checkboxSelectionComp))}createCellEditorInstance(e,t,a){const n=this.editorVersion,o=e.newAgStackInstance(),{params:r}=e;o.then(l=>this.afterCellEditorCreated(n,l,r,t,a)),K(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();le(t);const a=Yt(e);a!=null&&(t.textContent=a)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Fe(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(_(this.beans))||this.cellCtrl.hasBrowserFocus())&&this.eCell.focus({preventScroll:!0}),this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Fe(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer?.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const t=this.rendererVersion,a=r=>i=>{if(this.rendererVersion!==t||!this.isAlive())return;const s=r.newAgStackInstance(),c=this.afterCellRendererCreated.bind(this,t,r.componentClass);s?.then(c)},{animationFrameSvc:n}=this.beans;let o;if(n?.active&&this.firstRender?o=(r,i=!1)=>{n.createTask(a(r),this.rowNode.rowIndex,"p2",r.componentFromFramework,i)}:o=r=>a(r)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:r,onReady:i}=this.cellCtrl.getDeferLoadingCellRenderer();r&&(o(r),i.then(()=>o(e,!0)))}else o(e)}afterCellRendererCreated(e,t,a){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(a);return}this.cellRenderer=a,this.cellRendererClass=t;const o=a.getGui();if(this.cellRendererGui=o,o!=null){const r=this.getParentOfValue();le(r),r.appendChild(o)}}afterCellEditorCreated(e,t,a,n,o){const r=e!==this.editorVersion,{context:i}=this.beans;if(r){i.destroyBean(t);return}if(t.isCancelBeforeStart?.()){i.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){R(97,{colId:this.column.getId()}),i.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const s=n||t.isPopup?.();s?this.addPopupCellEditor(a,o):this.addInCellEditor(),this.refreshEditStyles(!0,s),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:a}=this;a.toggleCss("ag-cell-inline-editing",e&&!t),a.toggleCss("ag-cell-popup-editing",e&&!!t),a.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(_(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),le(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:a,context:n,popupSvc:o,editSvc:r}=this.beans;a.get("editType")==="fullRow"&&R(98);const i=this.cellEditorPopupWrapper=n.createBean(r.createPopupEditorWrapper(e)),{cellEditor:l,cellEditorGui:s,eCell:c,rowNode:d,column:g,cellCtrl:u}=this,h=i.getGui();s&&h.appendChild(s);const p=a.get("stopEditingWhenCellsLoseFocus"),f=t??l.getPopupPosition?.()??"over",m=a.get("enableRtl"),v={ePopup:h,additionalParams:{column:g,rowNode:d},type:"popupCellEditor",eventSource:c,position:f,alignSide:m?"right":"left",keepWithinBounds:!0},b=o.positionPopupByComponent.bind(o,v),w=o.addPopup({modal:p,eChild:h,closeOnEsc:!0,closedCallback:k=>{u.onPopupEditorClosed(k)},anchorToElement:c,positionCallback:b,ariaOwns:c});w&&(this.hideEditorPopup=w.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},Xw=class extends U{constructor(e,t,a){super(),this.cellComps=new Map,this.beans=t,this.rowCtrl=e;const n=oe({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(n,a),this.setTemplateFromElement(n);const o=n.style;this.domOrder=this.rowCtrl.getDomOrder();const r={setDomOrder:i=>this.domOrder=i,setCellCtrls:i=>this.setCellCtrls(i),showFullWidth:i=>this.showFullWidth(i),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(i,l)=>this.toggleCss(i,l),setUserStyles:i=>tn(n,i),setTop:i=>o.top=i,setTransform:i=>o.transform=i,setRowIndex:i=>n.setAttribute("row-index",i),setRowId:i=>n.setAttribute("row-id",i),setRowBusinessKey:i=>n.setAttribute("row-business-key",i),refreshFullWidth:i=>{const l=i();return this.fullWidthCellRendererParams=l,this.fullWidthCellRenderer?.refresh?.(l)??!1}};e.setComp(r,this.getGui(),a,void 0),this.addDestroyFunc(()=>{e.unsetComp(a)})}setInitialStyle(e,t){const a=this.rowCtrl.getInitialTransform(t);if(a)e.style.setProperty("transform",a);else{const n=this.rowCtrl.getInitialRowTop(t);n&&e.style.setProperty("top",n)}}showFullWidth(e){const t=n=>{if(this.isAlive()){const o=n.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(n,e.params)}else this.beans.context.destroyBean(n)};e.newAgStackInstance().then(t)}setCellCtrls(e){const t=new Map(this.cellComps);for(const a of e){const n=a.instanceId;this.cellComps.has(n)?t.delete(n):this.newCellComp(a)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const a of e){const n=this.cellComps.get(a.instanceId);n&&t.push(n.getGui())}lc(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,a=new Jw(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,a),this.getGui().appendChild(a.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(e,t){this.fullWidthCellRenderer=e,this.fullWidthCellRendererParams=t,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(e){for(const t of e.values()){if(!t)continue;const a=t.cellCtrl.instanceId;this.cellComps.get(a)===t&&(t.detach(),t.destroy(),this.cellComps.delete(a))}}};function $w(e,t,a){const n=!!a.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,o={tag:"div",ref:"eContainer",cls:Qi(e),role:"rowgroup"};if(t.type==="center"||n){const r={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${Eg(e)}`,role:"presentation"};return o.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${_i(e)}`,role:"rowgroup",children:[o,n?r:null]}}return o}var eC=class extends U{constructor(e){super(),this.eViewport=E,this.eContainer=E,this.eSpannedContainer=E,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=La(this.name)}postConstruct(){this.setTemplate($w(this.name,this.options,this.beans));const e={setHorizontalScroll:a=>this.eViewport.scrollLeft=a,setViewportHeight:a=>this.eViewport.style.height=a,setRowCtrls:({rowCtrls:a})=>this.setRowCtrls(a),setSpannedRowCtrls:a=>this.setRowCtrls(a,!0),setDomOrder:a=>{this.domOrder=a},setContainerWidth:a=>{this.eContainer.style.width=a,this.eSpannedContainer&&(this.eSpannedContainer.style.width=a)},setOffsetTop:a=>{const n=`translateY(${a})`;this.eContainer.style.transform=n,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=n)}};this.createManagedBean(new zg(this.name)).setComp(e,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:a,options:n}=this,o=t?this.eSpannedContainer:this.eContainer,r=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},i={};t?this.rowCompsWithSpan=i:this.rowCompsNoSpan=i,this.lastPlacedElement=null;const l=[];for(const s of e){const c=s.instanceId,d=r[c];let g;if(d)g=d,delete r[c];else{if(!s.rowNode.displayed)continue;g=new Xw(s,a,n.type)}i[c]=g,l.push([g,!d])}this.removeOldRows(Object.values(r)),this.addRowNodes(l,o)}addRowNodes(e,t){const{domOrder:a}=this;for(const[n,o]of e){const r=n.getGui();a?this.ensureDomOrder(r,t):o&&t.appendChild(r)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){ic(t,e,this.lastPlacedElement),this.lastPlacedElement=e}},tC={selector:"AG-ROW-CONTAINER",component:eC};function Fn(e,t){return t.map(a=>{const n=`e${a[0].toUpperCase()+a.substring(1)}RowContainer`;return e[n]={name:a},{tag:"ag-row-container",ref:n,attrs:{name:a}}})}function aC(e){const t={},a={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:Fn(t,["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:Fn(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:Fn(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:Fn(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:Fn(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:t,elementParams:a}}var nC=class extends U{constructor(){super(...arguments),this.eGridRoot=E,this.eBodyViewport=E,this.eStickyTop=E,this.eStickyBottom=E,this.eTop=E,this.eBottom=E,this.eBody=E}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,a=e?.getOverlayWrapperSelector(),{paramsMap:n,elementParams:o}=aC(!!a);this.setTemplate(o,[...a?[a]:[],zw,Aw,Fw,tC],n);const r=(l,s)=>{const c=`${l}px`;s.style.minHeight=c,s.style.height=c},i={setRowAnimationCssOnBodyViewport:(l,s)=>this.setRowAnimationCssOnBodyViewport(l,s),setColumnCount:l=>Qs(this.getGui(),l),setRowCount:l=>_s(this.getGui(),l),setTopHeight:l=>r(l,this.eTop),setBottomHeight:l=>r(l,this.eBottom),setTopInvisible:l=>this.eTop.classList.toggle("ag-invisible",l),setBottomInvisible:l=>this.eBottom.classList.toggle("ag-invisible",l),setStickyTopHeight:l=>this.eStickyTop.style.height=l,setStickyTopTop:l=>this.eStickyTop.style.top=l,setStickyTopWidth:l=>this.eStickyTop.style.width=l,setStickyBottomHeight:l=>{this.eStickyBottom.style.height=l,this.eStickyBottom.classList.toggle("ag-invisible",l==="0px")},setStickyBottomBottom:l=>this.eStickyBottom.style.bottom=l,setStickyBottomWidth:l=>this.eStickyBottom.style.width=l,setColumnMovingCss:(l,s)=>this.toggleCss(l,s),updateLayoutClasses:(l,s)=>{const c=[this.eBodyViewport.classList,this.eBody.classList];for(const d of c)d.toggle(Ue.AUTO_HEIGHT,s.autoHeight),d.toggle(Ue.NORMAL,s.normal),d.toggle(Ue.PRINT,s.print);this.toggleCss(Ue.AUTO_HEIGHT,s.autoHeight),this.toggleCss(Ue.NORMAL,s.normal),this.toggleCss(Ue.PRINT,s.print)},setAlwaysVerticalScrollClass:(l,s)=>this.eBodyViewport.classList.toggle(Dg,s),registerBodyViewportResizeListener:l=>{const s=st(this.beans,this.eBodyViewport,l);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:l=>this.eTop.style.overflowY=this.eBottom.style.overflowY=l,setCellSelectableCss:(l,s)=>{for(const c of[this.eTop,this.eBodyViewport,this.eBottom])c.classList.toggle(l,s)},setBodyViewportWidth:l=>this.eBodyViewport.style.width=l,setGridRootRole:l=>_e(this.eGridRoot,l)};this.ctrl=this.createManagedBean(new Ag),this.ctrl.setComp(i,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&Je(this.gos)||Ma(this.gos))&&Mm(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const a=this.eBodyViewport.classList;a.toggle("ag-row-animation",t),a.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}},oC={selector:"AG-GRID-BODY",component:nC},Wo={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},Pg=class extends ue{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:a,eTopGuard:n,eBottomGuard:o,focusTrapActive:r,forceFocusOutWhenTabGuardsAreEmpty:i,isFocusableContainer:l,focusInnerElement:s,onFocusIn:c,onFocusOut:d,shouldStopEventPropagation:g,onTabKeyDown:u,handleKeyDown:h,isEmpty:p,eFocusableElement:f}=e;this.comp=a,this.eTopGuard=n,this.eBottomGuard=o,this.providedFocusInnerElement=s,this.eFocusableElement=f,this.focusTrapActive=!!r,this.forceFocusOutWhenTabGuardsAreEmpty=!!i,this.isFocusableContainer=!!l,this.providedFocusIn=c,this.providedFocusOut=d,this.providedShouldStopEventPropagation=g,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=h,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new Pd(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():Mt(this.eFocusableElement,".ag-tab-guard").length===0)){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=ne(this.beans),a=Mt(t.body,null,!0),n=a.indexOf(e?this.eTopGuard:this.eBottomGuard);if(n===-1)return;let o,r;e?(o=0,r=n):(o=n+1,r=a.length);const i=a.slice(o,r),l=this.gos.get("tabIndex");i.sort((s,c)=>{const d=Number.parseInt(s.getAttribute("tabindex")||"0"),g=Number.parseInt(c.getAttribute("tabindex")||"0");return g===l?1:d===l?-1:d===0?1:g===0?-1:d-g}),i[e?i.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const a=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),a&&(a.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=Mt(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),t.length?(t[e?t.length-1:0].focus({preventScroll:!0}),!0):!1}getNextFocusableElement(e){return Dt(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},Zi=class extends ue{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:a,eFocusableElement:n,stopPropagationCallbacks:o}=this,r=[t,a],i={setTabIndex:v=>{for(const b of r)v==null?b.removeAttribute("tabindex"):b.setAttribute("tabindex",v)}};this.addTabGuards(t,a);const{focusTrapActive:l=!1,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m}=e;this.tabGuardCtrl=this.createManagedBean(new Pg({comp:i,focusTrapActive:l,eTopGuard:t,eBottomGuard:a,eFocusableElement:n,onFocusIn:s,onFocusOut:c,focusInnerElement:d,handleKeyDown:g,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m},o))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=ne(this.beans).createElement("div"),a=e==="top"?Wo.TAB_GUARD_TOP:Wo.TAB_GUARD_BOTTOM;return t.classList.add(Wo.TAB_GUARD,a),_e(t,"presentation"),t}addTabGuards(e,t){const a=this.eFocusableElement;a.prepend(e),a.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];le(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,a){uo(t)||(t=t.getGui());const{eBottomGuard:n}=this;n?n.before(t):e(t,a)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;Fe(e),Fe(t),super.destroy()}},Ig=class extends ra{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new Zi(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},Ji=class extends Ig{initialiseTabGuard(e){super.initialiseTabGuard(e,vn)}},Tg=(e,t)=>og(e,()=>zt(e.getGui(),t,!1,!0)),Lg=e=>e?.getFocusableContainerName()??"external",rC=e=>e==null?"external":typeof e=="string"?e:"gridBody",Bg=class extends y{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}setComp(e,t,a){this.view=e,this.eGridHostDiv=t,this.eGui=a,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:n,ctrlsSvc:o}=this.beans;n?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Vi(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");const r=st(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>r()),o.register("gridCtrl",this)}isDetailGrid(){return Ci(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:e.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(e){const{view:t}=this;e===!1?t.setCursor(null):t.setCursor(e===1?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:a,nextIndex:n}=this.getNextFocusableIndex(t,e),o=a===-1?e?t.length-1:0:n,{gos:r,beans:{focusSvc:i,navigation:l}}=this,s=r.getCallback("tabToNextGridContainer");if(s){const c=i.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:o}),d=Lg(t[o]),g=c==null&&d==="gridBody"?"gridBody":rC(c),u=s({backwards:e,previousContainer:Lg(t[a]),nextContainer:g,defaultTarget:c});if(u!==void 0){if(typeof u=="boolean")return u;if(typeof u=="string"){if(u==="gridBody")return this.focusGridBodyDefault(e)||void 0;const h=t.find(p=>p.getFocusableContainerName()===u);if(!h){Rc(`tabToNextGridContainer - ${u} container not found`);return}return Tg(h,e)?!0:void 0}return iw(u)?i.focusHeaderPosition({headerPosition:u})||void 0:(l?.ensureCellVisible(u),i.setFocusedCell({...u,forceBrowserFocus:!0}),i.isCellFocused(u)||void 0)}}return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:a,nextIndex:o})||void 0}focusInnerElement(e){const{gos:t,beans:a,beans:{focusSvc:n,visibleCols:o}}=this;if(t.getCallback("focusGridInnerElement")?.({fromBottom:!!e}))return!0;const i=this.getFocusableContainers();if(e)return this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:i,indexWithFocus:i.length,nextIndex:i.length-1})?!0:n.focusGridView({column:j(o.allCols),backwards:!0});const l=o.allCols;if(t.get("headerHeight")===0||We(a)){if(n.focusGridView({column:l[0],backwards:e}))return!0;for(let s=1;s<i.length;s++)if(zt(i[s].getGui(),e))return!0;return!1}return n.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}isFocusInsideGridBody(){const e=this.getFocusableContainers(),{indexWithFocus:t}=this.getNextFocusableIndex(e);return e[t]?.getFocusableContainerName()==="gridBody"}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){const t=this.view.getFocusableContainers(),{indexWithFocus:a,nextIndex:n}=this.getNextFocusableIndex(t,e);this.focusNextInnerContainerDefault({backwards:!!e,focusableContainers:t,indexWithFocus:a,nextIndex:n})||this.forceFocusOutOfContainer(e)}isFocusable(){const e=this.beans;return!Sn(e)||!We(e)||!!e.sideBar?.comp?.isDisplayed()}getNextFocusableIndex(e,t){const a=_(this.beans),n=e.findIndex(o=>o.getGui().contains(a));return{indexWithFocus:n,nextIndex:n+(t?-1:1)}}focusGridBodyDefault(e){const{gos:t,beans:a,beans:{focusSvc:n,visibleCols:{allCols:o}}}=this;return e?n.focusGridView({column:j(o),backwards:!0}):t.get("headerHeight")===0||We(a)?n.focusGridView({column:o[0]}):n.focusFirstHeader()}focusNextInnerContainerDefault(e){const{backwards:t,focusableContainers:a,indexWithFocus:n}=e,o=t?-1:1;for(let r=e.nextIndex;r>=0&&r<a.length;r+=o){const i=a[r];if(i.getFocusableContainerName()==="gridBody"&&(n===-1||(t?n>r:n<r))){if(this.focusGridBodyDefault(t))return!0;continue}if(Tg(i,t))return!0}return!1}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},iC=class extends Ji{constructor(e){super(),this.gridBody=E,this.gridHeaderDropZones=E,this.sideBar=E,this.statusBar=E,this.pagination=E,this.rootWrapperBody=E,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:r=>this.addCss(r),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:r=>{this.getGui().style.userSelect=r??"",this.getGui().style.webkitUserSelect=r??""},setCursor:r=>{this.getGui().style.cursor=r??""}},t=this.createManagedBean(new Bg),a=t.getOptionalSelectors(),n=this.createTemplate(a),o=[oC,...Object.values(a).filter(r=>!!r)];this.setTemplate(n,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>t.focusInnerElement(r),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),St(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){const a=this.rootWrapperBody.classList,{AUTO_HEIGHT:n,NORMAL:o,PRINT:r}=Ue,{autoHeight:i,normal:l,print:s}=t;a.toggle(n,i),a.toggle(o,l),a.toggle(r,s),this.toggleCss(n,i),this.toggleCss(o,l),this.toggleCss(r,s)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,a=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,n=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,o=e.watermarkSelector?{tag:"ag-watermark"}:null,r=e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},a]},n,r,o]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody];for(const t of[this.sideBar,this.statusBar,this.pagination])t&&e.push(t);return e.filter(t=>Me(t.getGui()))}},T=(e,t)=>{for(const a of Object.keys(t))t[a]=e;return t},Og={dispatchEvent:"CommunityCore",...T("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...T("GridState",{getState:0,setState:0}),...T("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...T("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...T("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...T("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...T("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...T("ValueCache",{expireValueCache:0}),...T("CellApi",{getCellValue:0}),...T("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...T("Sort",{onSortChanged:0}),...T("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...T("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...T("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...T("HighlightChanges",{flashCells:0}),...T("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...T("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}),...T("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...T("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...T("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...T("ColumnResize",{setColumnWidths:0}),...T("ColumnHover",{isColumnHovered:0}),...T("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...T("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...T("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...T("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...T("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...T("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...T("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...T("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...T("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...T("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...T("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}),...T("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...T("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...T("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...T("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...T("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...T("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...T("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...T("ContextMenu",{showContextMenu:0}),...T("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...T("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...T("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...T("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...T("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}),...T("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...T("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...T("StatusBar",{getStatusPanel:0}),...T("AiToolkit",{getStructuredSchema:0})},Xi={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},lC=(e,t)=>e.eventSvc.dispatchEvent(t),Hg=class{};Reflect.defineProperty(Hg,"name",{value:"GridApi"});var sC=class extends y{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new Hg,this.fns={...Xi,dispatchEvent:lC},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(Og))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:a,beans:n}=this;a!==Xi&&(a[e]=n?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:a,fns:{[e]:n}}=this;return n?n(a,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:a,preDestroyLink:n}=this;if(!t)R(26,{fnName:e,preDestroyLink:n});else{const o=Og[e];a.assertModuleRegistered(o,`api.${e}`)&&R(27,{fnName:e,module:o})}}destroy(){super.destroy(),this.fns=Xi,this.beans=null}};function Ng(e){return e.context.getId()}function cC(e){e.gridDestroySvc.destroy()}function dC(e){return e.gridDestroySvc.destroyCalled}function gC(e,t){return e.gos.get(t)}function uC(e,t,a){Vg(e,{[t]:a})}function Vg(e,t){e.gos.updateGridOptions({options:t})}function hC(e,t){const a=t.replace(/Module$/,"");return e.gos.isModuleRegistered(a)}function Gg(e,t,a){const n=ye(e,t,a);if(n){const{className:r}=n;if(typeof r=="string"&&r.includes("ag-icon")||typeof r=="object"&&r["ag-icon"])return n}const o=oe({tag:"span"});return o.appendChild(n),o}function ye(e,t,a){let n=null;e==="smallDown"?R(262):e==="smallLeft"?R(263):e==="smallRight"&&R(264);const o=a?.getColDef().icons;if(o&&(n=o[e]),t.gos&&!n){const r=t.gos.get("icons");r&&(n=r[e])}if(n){let r;if(typeof n=="function")r=n();else if(typeof n=="string")r=n;else{R(38,{iconName:e});return}if(typeof r=="string")return co(r);if(uo(r))return r;R(133,{iconName:e});return}else{const r=t.registry.getIcon(e);return r||t.validation?.validateIcon(e),oe({tag:"span",cls:`ag-icon ag-icon-${r??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var pC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{draggable:"true"}},fC=class extends U{constructor(e,t,a){super(pC),this.rowNode=e,this.column=t,this.eCell=a}postConstruct(){this.getGui().appendChild(ye("rowDrag",this.beans,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const{rowNode:t,column:a,eCell:n,gos:o}=this,r=a.getColDef().dndSourceOnRowDrag,i=e.dataTransfer;if(i.setDragImage(n,0,0),r){const l=I(o,{rowNode:t,dragEvent:e});r(l)}else try{const l=JSON.stringify(t.data);i.setData("application/json",l),i.setData("text/plain",l)}catch{}}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},mC=".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)}",vC={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"}]}]},bC=class extends U{constructor(){super(),this.dragSource=null,this.eIcon=E,this.eLabel=E,this.eGhost=E,this.registerCSS(mC)}postConstruct(){const e=t=>Gg(t,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(vC),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:a,eIcon:n,dragSource:o,dropIconMap:r,gos:i}=this;le(n);let l=null;e||(e=o?.getDefaultIconName?o.getDefaultIconName():"notAllowed"),l=r[e],a.classList.toggle("ag-dnd-ghost-not-allowed",e==="notAllowed"),n.classList.toggle("ag-shake-left-to-right",t),!(l===r.hide&&i.get("suppressDragLeaveHidesColumns"))&&l&&n.appendChild(l)}setLabel(e){this.eLabel.textContent=e}};function wC(e,t){e.rowDragSvc?.rowDragFeature?.addRowDropZone(t)}function CC(e,t){const a=e.dragAndDrop?.findExternalZone(t.getContainer());a&&e.dragAndDrop?.removeDropTarget(a)}function yC(e,t){return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t)}function kC(e){const t=e.rowDropHighlightSvc;return t?{row:t.row,dropIndicatorPosition:t.position}:{row:null,dropIndicatorPosition:"none"}}function SC(e,t){const a=e.rowDropHighlightSvc;if(!a)return;const n=t?.row;let o=t?.dropIndicatorPosition;o!=="above"&&o!=="below"&&o!=="inside"&&(o="none");const r=n?.rowIndex;r==null||o==="none"?a.clear():a.set(n,o)}var qg=(e,t)=>{if(t!=null&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},xC=(e,t)=>{if(typeof PointerEvent>"u"||!(t instanceof PointerEvent))return null;const a=t.pointerId;if(!qg(e,a))return null;const n={eElement:e,pointerId:a,onLost(o){EC(n,o)}};return e.addEventListener("lostpointercapture",n.onLost),n},RC=e=>{if(!e)return;Wg(e);const{eElement:t,pointerId:a}=e;if(t){try{t.releasePointerCapture(a)}catch{}e.eElement=null}},Wg=e=>{const{eElement:t,onLost:a}=e;t&&a&&(t.removeEventListener("lostpointercapture",a),e.onLost=null)},EC=(e,t)=>{Wg(e);const{eElement:a,pointerId:n}=e;a&&t.pointerId===n&&qg(a,n)},Ba,Oa,$i={passive:!0},Tt={passive:!1},tt=e=>{if(!Oa)Oa=new WeakSet;else if(Oa.has(e))return!1;return Oa.add(e),!0},Ug=class extends ue{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!Ba?.has(Ie(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!!(e&&this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)jg(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let a=0,n=t.length;a<n;++a){const o=t[a];if(o.params===e){t.splice(a,1),jg(o);break}}}addDragSource(e){if(!this.isAlive())return;const{eElement:t,includeTouch:a}=e,n=[];let o;if(a){const c=t.style;c&&(o=c.touchAction,c.touchAction="none")}const r={handlers:n,params:e,oldTouchAction:o};this.dragSources.push(r),po(n,[t,"pointerdown",c=>this.onPointerDown(e,c),Tt],[t,"mousedown",c=>this.onMouseDown(e,c)]);const s=this.gos.get("suppressTouch");a&&!s&&po(n,[t,"touchstart",d=>this.onTouchStart(e,d),Tt])}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return(t==="mousemove"||t==="pointermove")&&e.cancelable&&nn(this.beans,e)&&!Ca(tl(e))}initDrag(e,...t){this.drag=e;const a=this.beans,n=l=>this.onScroll(l),o=l=>this.onKeyDown(l),r=Ie(a),i=ne(a);po(e.handlers,[r,"contextmenu",kt],[r,"keydown",o],[i,"scroll",n,{capture:!0}],[i.defaultView||window,"scroll",n],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;Ba?.get(t)===e&&Ba.delete(t),this.drag=null,RC(e.pointerCapture),Br(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const a=this.beans;if(Oa?.has(t))return;const n=t.pointerType;if(n==="touch"&&(a.gos.get("suppressTouch")||!e.includeTouch||(e.stopPropagationForTouch&&t.stopPropagation(),Ca(tl(t))))||!t.isPrimary||n==="mouse"&&t.button!==0)return;this.destroyDrag();const o=Ie(a),r=e.eElement,i=t.pointerId,l=new el(o,e,t,i);Ba??(Ba=new WeakMap),Ba.set(o,l);const s=u=>{u.pointerId===i&&this.onMouseOrPointerMove(u)},c=u=>{u.pointerId===i&&this.onMouseOrPointerUp(u)},d=u=>{u.pointerId===i&&tt(u)&&this.cancelDrag()},g=u=>this.draggingPreventDefault(u);this.initDrag(l,[o,"pointerup",c],[o,"pointercancel",d],[o,"pointermove",s,Tt],[o,"touchmove",g,Tt],[r,"mousemove",g,Tt]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):tt(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch||!tt(t)||Ca(tl(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer()){this.dragging&&kt(t);return}this.destroyDrag();const n=this.beans,o=Ie(n),r=new el(o,e,t.touches[0]),i=u=>this.onTouchMove(u),l=u=>this.onTouchUp(u),s=u=>this.onTouchCancel(u),c=u=>this.draggingPreventDefault(u),d=Ie(n),g=t.target??e.eElement;this.initDrag(r,[g,"touchmove",i,$i],[g,"touchend",l,$i],[g,"touchcancel",s,$i],[d,"touchmove",c,Tt],[d,"touchend",l,Tt],[d,"touchcancel",s,Tt]),e.dragStartPixels===0&&this.onMove(r.start)}draggingPreventDefault(e){this.dragging&&kt(e)}onMouseDown(e,t){if(t.button!==0||Oa?.has(t)||this.isPointer())return;const a=this.beans;this.destroyDrag();const n=new el(Ie(a),e,t),o=l=>this.onMouseOrPointerMove(l),r=l=>this.onMouseOrPointerUp(l),i=Ie(a);this.initDrag(n,[i,"mousemove",o],[i,"mouseup",r]),e.dragStartPixels===0?this.onMouseOrPointerMove(t):tt(t)}onScroll(e){if(!tt(e))return;const t=this.drag,a=t?.lastDrag;a&&this.dragging&&t.params?.onDragging?.(a)}onMouseOrPointerMove(e){tt(e)&&(mt()&&ne(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&kt(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;!t||!tt(e)||Sa(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!tt(e))return;const a=Sa(t.start,e.touches);a&&(this.onMove(a),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const a=t.params;if(!this.dragging){const n=t.start,r=a.dragStartPixels??4;if(hc(e,n,r)||(this.dragging=!0,a.capturePointer&&(t.pointerCapture=xC(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:a.eElement}),a.onDragStart?.(n),this.drag!==t)||(a.onDragging?.(n),this.drag!==t))return}a.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&tt(e)&&this.onUp(Sa(t.start,e.changedTouches))}onMouseOrPointerUp(e){tt(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===C.ESCAPE&&this.cancelDrag()}},jg=e=>{Br(e.handlers);const t=e.oldTouchAction;if(t!=null){const a=e.params.eElement.style;a&&(a.touchAction=t)}},el=class{constructor(e,t,a,n=null){this.rootEl=e,this.params=t,this.start=a,this.pointerId=n,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},tl=e=>{const t=e.target;return t instanceof Element?t:null},FC=class extends Ug{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}},MC=class extends y{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:a}=this.beans;return a.addDragSource(t),()=>a.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const a=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(a)}setResizeIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},zC={tag:"div",cls:"ag-drag-handle ag-row-drag",attrs:{"aria-hidden":"true"}},Uo={skipAriaHidden:!0},DC=class extends U{constructor(e,t,a,n,o,r=!1){super(),this.cellValueFn=e,this.rowNode=t,this.column=a,this.customGui=n,this.dragStartPixels=o,this.alwaysVisible=r,this.dragSource=null,this.disabled=!1}isCustomGui(){return this.customGui!=null}postConstruct(){const{beans:e,customGui:t}=this;t?this.setDragElement(t,this.dragStartPixels):(this.setTemplate(zC),this.getGui().appendChild(ye("rowDrag",e,null)),this.addDragSource()),this.alwaysVisible||this.initCellDrag()}initCellDrag(){const{beans:e,rowNode:t}=this,a=this.refreshVisibility.bind(this);this.addManagedListeners(e.eventSvc,{rowDragVisibilityChanged:a}),this.addManagedListeners(t,{dataChanged:a,cellChanged:a}),this.refreshVisibility()}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}refreshVisibility(){if(this.alwaysVisible)return;const{beans:e,column:t,rowNode:a}=this,{gos:n,dragAndDrop:o,rowDragSvc:r}=e,i=r?.visibility;let s=!(i==="suppress"||i==="hidden"&&!o?.hasExternalDropZones()),c=s;if(s&&!this.isCustomGui()&&t){const d=t.getColDef().rowDrag;if(d===!1)s=!1;else{const g=typeof d=="function";c=t.isRowDrag(a),s=g||c}}s&&c&&a.footer&&n.get("rowDragManaged")&&(c=!1,s=!0),c&&(c=s),s||this.setDisplayed(s,Uo),c||this.setVisible(c,Uo),this.setDisabled(!c||i==="disabled"&&!o?.hasExternalDropZones()),s&&this.setDisplayed(s,Uo),c&&this.setVisible(c,Uo)}setDisabled(e){e!==this.disabled&&(this.disabled=e,this.getGui()?.classList?.toggle("ag-drag-handle-disabled",e))}getSelectedNodes(){const e=this.rowNode;if(!this.gos.get("rowDragMultiRow"))return[e];const a=this.beans.selectionSvc?.getSelectedNodes()??[];return a.indexOf(e)!==-1?a:[e]}getDragItem(){const{column:e,rowNode:t}=this;return{rowNode:t,rowNodes:this.getSelectedNodes(),columns:e?[e]:void 0,defaultTextValue:this.cellValueFn()}}addDragSource(e=4){if(this.dragSource&&this.removeDragSource(),this.gos.get("rowDragManaged")&&this.rowNode.footer)return;const t=this.getGui();if(this.gos.get("enableCellTextSelection")){this.removeMouseDownListener();const n=ho("pointerdown")?{pointerdown:kt}:{mousedown:kt};this.mouseDownListener=this.addManagedElementListeners(t,n)[0]}const a=this.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:n=>this.getDragItemName(n,a),getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDrop.addDragSource(this.dragSource,!0)}getDragItemName(e,t){const a=e?.dragItem||this.getDragItem(),n=(e?.dropTarget?.rows.length??a.rowNodes?.length)||1,o=this.column?.getColDef()?.rowDragText??this.gos.get("rowDragText");if(o)return o(a,n);if(n!==1)return`${n} ${t("rowDragRows","rows")}`;const r=this.cellValueFn();return r||`1 ${t("rowDragRow","rows")}`}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},Yg=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return this.tickingInterval!==null}check(e,t=!1){const a=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),n=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(a&&n)return;const o=this.scrollContainer.getBoundingClientRect(),r=this.scrollByTick;this.tickLeft=!n&&e.clientX<o.left+r,this.tickRight=!n&&e.clientX>o.right-r,this.tickUp=!a&&e.clientY<o.top+r,this.tickDown=!a&&e.clientY>o.bottom-r,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Mn=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},zn=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const a=t[0];if(a.sourceRowIndex>=0)return a;t=a.childrenAfterGroup}},Kg=(e,t,a,n)=>{if(!t.size||!e)return!1;let o=!1;const r=e.length??0;let i=-1;a&&(i=a.sourceRowIndex,a=i<0?zn(a):null,a&&(i=a.sourceRowIndex)),i<0||i>=r?i=r:n||++i;let l=i,s=Math.min(i,r-1);for(const g of t){const u=g.sourceRowIndex;u<l&&(l=u),u>s&&(s=u)}let c=l;for(let g=l;g<i;++g){const u=e[g];t.has(u)||(u.sourceRowIndex!==c&&(u.sourceRowIndex=c,e[c]=u,o=!0),++c)}let d=s;for(let g=s;g>=i;--g){const u=e[g];t.has(u)||(u.sourceRowIndex!==d&&(u.sourceRowIndex=d,e[d]=u,o=!0),--d)}for(const g of t)g.sourceRowIndex!==c&&(g.sourceRowIndex=c,e[c]=g,o=!0),++c;return o};function _g(e,t){return Bo(e,t.target)?.getFocusedCellPosition()??null}function al(e,t){const a=se(e.gos,"normal"),n=t;let o,r;n.clientX!=null||n.clientY!=null?(o=n.clientX,r=n.clientY):(o=n.x,r=n.y);const{pageFirstPixel:i}=e.pageBounds.getCurrentPagePixelRange();if(r+=i,a){const l=e.ctrlsSvc.getScrollFeature(),s=l.getVScrollPosition(),c=l.getHScrollPosition();o+=c.left,r+=s.top}return{x:o,y:r}}var AC=.25,PC=class extends y{constructor(e){super(),this.eContainer=e,this.lastDraggingEvent=null,this.autoScroll=null,this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,t=>{const a=()=>t.gridBodyCtrl.scrollFeature.getVScrollPosition().top,n=new Yg({scrollContainer:t.gridBodyCtrl.eBodyViewport,scrollAxis:"y",getVerticalPosition:a,setVerticalPosition:o=>t.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(o),onScrollCallback:()=>{const o=a();if(this.autoScrollOldV!==o){this.autoScrollOldV=o,this.autoScrollChanging=!0;return}const r=this.autoScrollChanging;this.autoScrollChanged=r,this.autoScrollChanging=!1,r&&(e.dragAndDrop?.nudge(),this.autoScrollChanged=!1)}});this.autoScroll=n,this.clearAutoScroll()})}destroy(){super.destroy(),this.clearAutoScroll(),this.autoScroll=null,this.lastDraggingEvent=null,this.eContainer=null}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(e){return e?.dropTarget?.allowed===!1||this.beans.rowDragSvc.visibility!=="visible"?"notAllowed":"move"}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const a=this.beans.selectionSvc?.getSelectedNodes();if(a&&a.indexOf(t)>=0)return a.slice().sort(IC)}return[t]}onDragEnter(e){this.dragging(e,!0)}onDragging(e){this.dragging(e,!1)}dragging(e,t){const{lastDraggingEvent:a,beans:n}=this;if(t){const l=this.getRowNodes(e);e.dragItem.rowNodes=l,Zg(l,!0)}this.lastDraggingEvent=e;const o=e.fromNudge,r=this.makeRowsDrop(a,e,o,!1);n.rowDropHighlightSvc?.fromDrag(e),t&&this.dispatchGridEvent("rowDragEnter",e),this.dispatchGridEvent("rowDragMove",e);const i=this.autoScroll;r?.rowDragManaged&&r.moved&&r.allowed&&r.sameGrid&&!r.suppressMoveWhenRowDragging&&(!o&&!i?.scrolling||this.autoScrollChanged)&&this.dropRows(r),i?.check(e.event)}isFromThisGrid(e){return e.dragSource.dragSourceDomDataKey===this.gos.getDomDataKey()}makeRowsDrop(e,t,a,n){const{beans:o,gos:r}=this,i=this.newRowsDrop(t,n),l=o.rowModel;if(t.dropTarget=i,t.changed=!1,!i)return null;let{sameGrid:s,rootNode:c,source:d,target:g}=i;g??(g=l.getRow(l.getRowCount()-1)??null);const u=this.beans.groupEditSvc,h=!!u?.canSetParent(i);let p=null;if(g?.footer){const m=Po(l,-1,g)??Po(l,1,g);h&&(p=g.sibling??c),g=m??null}g?.detail&&(g=g.parent),i.moved&&(i.moved=d!==g);let f=.5;if(g&&(s&&i.moved&&(p||!h)?f=d.rowIndex>g.rowIndex?-.5:.5:f=(i.y-g.rowTop-g.rowHeight/2)/g.rowHeight||0),!h&&s&&g&&i.moved&&$(r)){const m=TC(l,i);m&&(f=d.rowIndex>m.rowIndex?-.5:.5,g=m,i.moved&&(i.moved=d!==g))}return i.target=g,i.newParent=p,i.pointerPos=LC(g,i.y),i.yDelta=f,u?.fixRowsDrop(i,h,a,f),this.validateRowsDrop(i,h,n),t.changed||(t.changed=Qg(e?.dropTarget,i)),i}newRowsDrop(e,t){const{beans:a,gos:n}=this,o=a.rowModel.rootNode,r=$(n)?n.get("rowDragManaged"):!1,i=n.get("suppressMoveWhenRowDragging"),l=this.isFromThisGrid(e);let{rowNode:s,rowNodes:c}=e.dragItem;if(c||(c=s?[s]:[]),s||(s=c[0]),!s||!o)return null;const d=this.beans.dragAndDrop.isDropZoneWithinThisGrid(e);let g=!0;r&&(!c.length||a.rowDragSvc.visibility!=="visible"||(i||!l)&&!d)&&(g=!1);const u=al(a,e).y,h=this.getOverNode(u);return{api:a.gridApi,context:a.gridOptions.context,draggingEvent:e,rowDragManaged:r,suppressMoveWhenRowDragging:i,sameGrid:l,withinGrid:d,treeData:!1,rootNode:o,moved:s!==h,y:u,overNode:h,overIndex:h?.rowIndex??-1,pointerPos:"none",position:"none",source:s,target:h??null,newParent:null,rows:c,allowed:g,highlight:!t&&r&&i&&(d||!l),yDelta:0,inside:!1,droppedManaged:!1}}validateRowsDrop(e,t,a){const{source:n,target:o,yDelta:r,inside:i,moved:l,rowDragManaged:s,suppressMoveWhenRowDragging:c}=e;e.moved&&(e.moved=n!==o);const{position:d,fallbackPosition:g}=this.computeDropPosition(l,i,r);e.position=d,t||(e.newParent=null),this.enforceSuppressMoveWhenRowDragging(e,c,"initial");const u=(!s||e.allowed)&&this.gos.get("isRowValidDropPosition");u&&this.applyDropValidator(e,t,a,s,u),s&&(e.rows=this.filterRows(e)),this.beans.groupEditSvc?.clearNewSameParent(e,t),this.enforceSuppressMoveWhenRowDragging(e,c,"final"),e.position==="inside"&&(!e.allowed||!e.newParent)&&(e.position=g)}computeDropPosition(e,t,a){const n=a<0?"above":"below";return e?{position:t?"inside":n,fallbackPosition:n}:{position:"none",fallbackPosition:n}}enforceSuppressMoveWhenRowDragging(e,t,a){if(t){if(a==="initial"){e.moved||(e.allowed=!1);return}(!e.rows.length||e.position==="none")&&(e.allowed=!1)}}applyDropValidator(e,t,a,n,o){this.beans.groupEditSvc?.clearNewSameParent(e,t);const r=o(e);if(!r){e.allowed=!1;return}if(typeof r!="object")return;r.rows!==void 0&&(e.rows=r.rows??[]),t&&r.newParent!==void 0&&(e.newParent=r.newParent),r.target!==void 0&&(e.target=r.target),r.position&&(e.position=r.position),r.allowed!==void 0?e.allowed=r.allowed:n||(e.allowed=!0);const i=e.draggingEvent;r.changed&&i&&(i.changed=!0),!a&&r.highlight!==void 0&&(e.highlight=r.highlight)}addRowDropZone(e){if(!e.getContainer()){R(55);return}const t=this.beans.dragAndDrop;if(t.findExternalZone(e.getContainer())){R(56);return}const a=e.fromGrid?e:{getContainer:e.getContainer,onDragEnter:e.onDragEnter&&(o=>e.onDragEnter(this.rowDragEvent("rowDragEnter",o))),onDragLeave:e.onDragLeave&&(o=>e.onDragLeave(this.rowDragEvent("rowDragLeave",o))),onDragging:e.onDragging&&(o=>e.onDragging(this.rowDragEvent("rowDragMove",o))),onDragStop:e.onDragStop&&(o=>e.onDragStop(this.rowDragEvent("rowDragEnd",o))),onDragCancel:e.onDragCancel&&(o=>e.onDragCancel(this.rowDragEvent("rowDragCancel",o)))},n={isInterestedIn:o=>o===2,getIconName:()=>"move",external:!0,...a};t.addDropTarget(n),this.addDestroyFunc(()=>t.removeDropTarget(n))}getRowDropZone(e){return{getContainer:this.getContainer.bind(this),onDragEnter:a=>{this.onDragEnter(a),e?.onDragEnter?.(this.rowDragEvent("rowDragEnter",a))},onDragLeave:a=>{this.onDragLeave(a),e?.onDragLeave?.(this.rowDragEvent("rowDragLeave",a))},onDragging:a=>{this.onDragging(a),e?.onDragging?.(this.rowDragEvent("rowDragMove",a))},onDragStop:a=>{this.onDragStop(a),e?.onDragStop?.(this.rowDragEvent("rowDragEnd",a))},onDragCancel:a=>{this.onDragCancel(a),e?.onDragCancel?.(this.rowDragEvent("rowDragCancel",a))},fromGrid:!0}}getOverNode(e){const{pageBounds:t,rowModel:a}=this.beans,o=e>t.getCurrentPagePixelRange().pageLastPixel?-1:a.getRowIndexAtPixel(e);return o>=0?a.getRow(o):void 0}rowDragEvent(e,t){const a=this.beans,{dragItem:n,dropTarget:o,event:r,vDirection:i}=t,l=o?.rootNode===a.rowModel.rootNode,s=l?o.y:al(a,t).y,c=l?o.overNode:this.getOverNode(s),d=l?o.overIndex:c?.rowIndex??-1;return{api:a.gridApi,context:a.gridOptions.context,type:e,event:r,node:n.rowNode,nodes:n.rowNodes,overIndex:d,overNode:c,y:s,vDirection:i,rowsDrop:o}}dispatchGridEvent(e,t){const a=this.rowDragEvent(e,t);this.eventSvc.dispatchEvent(a)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e,!1)}onDragStop(e){const t=this.lastDraggingEvent?.dropTarget??null,a=this.makeRowsDrop(this.lastDraggingEvent,e,!1,!0);this.dispatchGridEvent("rowDragEnd",e),a?.allowed&&a.rowDragManaged&&(!t?.droppedManaged||Qg(t,a))&&this.dropRows(a),this.stopDragging(e,!0)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e,!0)}stopDragging(e,t){this.clearAutoScroll(),this.beans.groupEditSvc?.stopDragging(t),this.beans.rowDropHighlightSvc?.fromDrag(null),Zg(e.dragItem.rowNodes,!1),this.lastDraggingEvent=null}clearAutoScroll(){this.autoScroll?.ensureCleared(),this.autoScrollChanged=!1,this.autoScrollChanging=!1,this.autoScrollOldV=null}dropRows(e){return e.droppedManaged=!0,e.sameGrid?this.csrmMoveRows(e):this.csrmAddRows(e)}csrmAddRows({position:e,target:t,rows:a}){const n=ta(this.gos),o=this.beans.rowModel,r=a.filter(({data:l,rowPinned:s})=>!o.getRowNode(n?.({data:l,level:0,rowPinned:s})??l.id)).map(({data:l})=>l);if(r.length===0)return!1;let i;if(t){const l=t.sourceRowIndex>=0?t:zn(t);l&&(i=l.sourceRowIndex+(e==="above"?0:1))}return o.updateRowData({add:r,addIndex:i}),!0}filterRows(e){const{groupEditSvc:t}=this.beans,{rows:a,sameGrid:n}=e;let o;for(let r=0,i=a.length;r<i;++r){let l=!0;const s=a[r];(!s||s.footer||n&&s.destroyed&&!s.group||!this.csrmGetLeaf(s))&&(l=!1),l&&t&&!t.canDropRow(s,e)&&(l=!1),l?o?.push(s):o??(o=a.slice(0,r))}return o??a}csrmMoveRows(e){const t=this.beans.groupEditSvc;return t?.isGroupingDrop(e)?t.dropGroupEdit(e):this.csrmMoveRowsReorder(e)}csrmMoveRowsReorder({position:e,target:t,rows:a,newParent:n,rootNode:o}){let r=!1;const i=new Set;for(const u of a){n&&u.parent!==n&&(u.treeParent=n,r=!0);const h=this.csrmGetLeaf(u);h&&i.add(h)}if(!r&&i.size===0)return!1;const l=this.beans.focusSvc,s=l.getFocusedCell(),c=s&&la(this.beans,s);if(i.size&&Kg(o._leafs,i,t,e==="above")&&(r=!0),!r)return!1;const d=this.beans.rowModel,g=new Mn;return g.reordered=!0,d.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:g}),c?c.focusCell():l.clearFocusedCell(),!0}csrmGetLeaf(e){if(e.sourceRowIndex>=0)return e.destroyed?void 0:e;const t=this.beans.groupEditSvc;return t?t.csrmFirstLeaf(e):zn(e)}},Qg=(e,t)=>e!==t&&(!e||e.sameGrid!==t.sameGrid||e.allowed!==t.allowed||e.position!==t.position||e.target!==t.target||e.source!==t.source||e.newParent!==t.newParent||!lt(e.rows,t.rows)),IC=({rowIndex:e},{rowIndex:t})=>e!==null&&t!==null?e-t:0,Zg=(e,t)=>{for(let a=0,n=e?.length||0;a<n;++a){const o=e[a];o.dragging!==t&&(o.dragging=t,o.dispatchRowEvent("draggingChanged"))}},TC=(e,t)=>{let a=null,n=t.target;if(n&&t.rows.indexOf(n)<0)return null;const o=t.source;if(!n||!o)return null;let r=n.rowIndex-o.rowIndex;const i=r<0?-1:1;r=t.suppressMoveWhenRowDragging?Math.abs(r):1;const l=new Set(t.rows);do{const s=Po(e,i,n);if(!s)break;l.has(s)||(a=s,--r),n=s}while(r>0);return a},LC=(e,t)=>{const a=e?.rowTop,n=e?.rowHeight??0;if(a==null||!n||n<=0)return"none";const o=t-a,r=n*AC;return o<=r?"above":o>=n-r?"below":"inside"},BC=class extends y{constructor(){super(...arguments),this.beanName="rowDragSvc",this.rowDragFeature=null,this.visibility="suppress"}setupRowDrag(e,t){const a=t.createManagedBean(new PC(e)),n=this.beans.dragAndDrop;n.addDropTarget(a),t.addDestroyFunc(()=>n.removeDropTarget(a)),this.rowDragFeature=a;const o=()=>this.refreshVisibility();this.addManagedPropertyListeners(["rowDragManaged","suppressRowDrag","refreshAfterGroupEdit"],o),this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:o,columnPivotModeChanged:o,sortChanged:o,filterChanged:o}),this.visibility=this.computeVisibility()}createRowDragComp(e,t,a,n,o,r){return new DC(e,t,a,n,o,r)}createRowDragCompForRow(e,t){if(Je(this.gos))return;const a=this.getLocaleTextFunc();return this.createRowDragComp(()=>`1 ${a("rowDragRow","row")}`,e,void 0,t,void 0,!0)}createRowDragCompForCell(e,t,a,n,o,r){const i=this.gos;return i.get("rowDragManaged")&&(!$(i)||i.get("pagination"))?void 0:this.createRowDragComp(a,e,t,n,o,r)}cancelRowDrag(){this.rowDragFeature?.lastDraggingEvent&&this.beans.dragSvc?.cancelDrag()}computeVisibility(){const e=this.beans,t=e.gos;if(t.get("suppressRowDrag"))return"suppress";if(!t.get("rowDragManaged"))return"visible";const n=e.colModel.isPivotMode();return(n||e.rowGroupColsSvc?.columns?.length)&&!t.get("refreshAfterGroupEdit")?"hidden":n||e.filterManager?.isAnyFilterPresent()||e.sortSvc?.isSortActive()?"disabled":"visible"}refreshVisibility(){const e=this.visibility,t=this.computeVisibility();e!==t&&(this.visibility=t,this.eventSvc?.dispatchEvent({type:"rowDragVisibilityChanged"}))}},OC=class extends y{constructor(){super(...arguments),this.beanName="rowDropHighlightSvc",this.uiLevel=0,this.dragging=!1,this.row=null,this.position="none"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this)})}onModelUpdated(){const e=this.row,t=this.dragging;!e||e?.rowIndex===null||this.position==="none"?this.clear():this.set(e,this.position),this.dragging=t}destroy(){this.clear(),super.destroy()}clear(){const e=this.row;this.dragging=!1,e&&(this.uiLevel=0,this.position="none",this.row=null,e.dispatchRowEvent("rowHighlightChanged"))}set(e,t){const a=e!==this.row,n=e.uiLevel,o=t!==this.position,r=n!==this.uiLevel;this.dragging=!1,(a||o||r)&&(a&&this.clear(),this.uiLevel=n,this.position=t,this.row=e,e.dispatchRowEvent("rowHighlightChanged"))}fromDrag(e){const t=e?.dropTarget;if(t){const{highlight:a,target:n,position:o}=t;if(a&&n&&o!=="none"){this.set(n,o),this.dragging=!0;return}}this.dragging&&this.clear()}},nl={moduleName:"Drag",version:F,beans:[FC]},Jg={moduleName:"DragAndDrop",version:F,dynamicBeans:{dndSourceComp:fC},icons:{rowDrag:"grip"}},ol={moduleName:"SharedDragAndDrop",version:F,beans:[Sb],dependsOn:[nl],userComponents:{agDragAndDropImage:bC},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},Xg={moduleName:"RowDrag",version:F,beans:[OC,BC],apiFunctions:{addRowDropZone:wC,removeRowDropZone:CC,getRowDropZoneParams:yC,getRowDropPositionIndicator:kC,setRowDropPositionIndicator:SC},dependsOn:[ol]},$g={moduleName:"HorizontalResize",version:F,beans:[MC],dependsOn:[nl]},HC=":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}}",NC=class extends y{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,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.active)return;const{gos:e}=this;e.get("suppressColumnMoveAnimation")||e.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&t.setColumnMovingCss(!1)})}flush(e,t){const{executeNextFuncs:a,executeLaterFuncs:n}=this;if(a.length===0&&n.length===0){e(),t();return}const o=r=>{for(;r.length;){const i=r.pop();i&&i()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),o(a)},0),window.setTimeout(()=>{t(),o(n)},200)})}};function VC(e,t,a){e.colMoves?.moveColumnByIndex(t,a,"api")}function GC(e,t,a){e.colMoves?.moveColumns(t,a,"api")}var qC=class extends y{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const a of t)a.isPrimary()&&(a.isAnyFunctionActive()||(a.isAllowValue()?this.columnsToAggregate.push(a):a.isAllowRowGroup()?this.columnsToGroup.push(a):a.isAllowPivot()&&this.columnsToPivot.push(a)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{valueColsSvc:t,rowGroupColsSvc:a,pivotColsSvc:n}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&a?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&n?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function WC(e,t){!t||t.length<=1||t.filter(n=>e.indexOf(n)<0).length>0||t.sort((n,o)=>{const r=e.indexOf(n),i=e.indexOf(o);return r-i})}function UC(e){const t=[...e];for(const a of e){let n=null,o=a.getParent();for(;o!=null&&o.getDisplayedLeafColumns().length===1;)n=o,o=o.getParent();if(n!=null){const i=!!n.getColGroupDef()?.marryChildren?n.getProvidedColumnGroup().getLeafColumns():n.getLeafColumns();for(const l of i)t.includes(l)||t.push(l)}}return t}function jC(e,t,a,n){const o=n.allCols;let r=null,i=null;for(let l=0;l<e.length;l++){const s=e[l],c=a.getProposedColumnOrder(t,s);if(!a.doesOrderPassRules(c))continue;const d=c.filter(u=>o.includes(u));if(i===null)i=d;else if(!lt(d,i))break;const g=KC(c);(r===null||g<r.fragCount)&&(r={move:s,fragCount:g})}return r}function eu(e){const{isFromHeader:t,fromLeft:a,xPosition:n,fromEnter:o,fakeEvent:r,pinned:i,gos:l,colModel:s,colMoves:c,visibleCols:d}=e;let{allMovingColumns:g}=e;t&&(g=UC(g));const u=g.slice();WC(s.getCols(),u);const h=QC({movingCols:u,draggingRight:a,xPosition:n,pinned:i,gos:l,colModel:s,visibleCols:d}),p=YC(u,s);if(h.length===0)return;const f=h[0];if(p!==null&&(t||!o)&&!r&&(!a&&f>=p||a&&f<=p))return;const v=jC(h,u,c,d);if(!v)return;const b=v.move;if(!(b>s.getCols().length-u.length))return{columns:u,toIndex:b}}function tu(e){const{columns:t,toIndex:a}=eu(e)||{},{finished:n,colMoves:o}=e;return!t||a==null?null:(o.moveColumns(t,a,"uiColumnMoved",n),n?null:{columns:t,toIndex:a})}function YC(e,t){const a=t.getCols(),n=e.map(s=>a.indexOf(s)).sort((s,c)=>s-c),o=n[0];return j(n)-o!==n.length-1?null:o}function KC(e){function t(n){const o=[];let r=n.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let a=0;for(let n=0;n<e.length-1;n++){let o=t(e[n]),r=t(e[n+1]);[o,r]=o.length>r.length?[o,r]:[r,o];for(const i of o)r.indexOf(i)===-1&&a++}return a}function _C(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}function QC(e){const{movingCols:t,draggingRight:a,xPosition:n,pinned:o,gos:r,colModel:i,visibleCols:l}=e;if(r.get("suppressMovableColumns")||t.some(w=>w.getColDef().suppressMovable))return[];const c=_C(l,o),d=i.getCols(),g=c.filter(w=>t.includes(w)),u=c.filter(w=>!t.includes(w)),h=d.filter(w=>!t.includes(w));let p=0,f=n;if(a){let w=0;for(const k of g)w+=k.getActualWidth();f-=w}if(f>0){for(let w=0;w<u.length;w++){const k=u[w];if(f-=k.getActualWidth(),f<0)break;p++}a&&p++}let m;if(p>0){const w=u[p-1];m=h.indexOf(w)+1}else m=h.indexOf(u[0]),m===-1&&(m=0);const v=[m],b=(w,k)=>w-k;if(a){let w=m+1;const k=d.length-1;for(;w<=k;)v.push(w),w++;v.sort(b)}else{let w=m;const k=d.length-1;let S=d[w];for(;w<=k&&c.indexOf(S)<0;)w++,v.push(w),S=d[w];w=m-1;const x=0;for(;w>=x;)v.push(w),w--;v.sort(b).reverse()}return v}function rl(e){const{pinned:t,fromKeyboard:a,gos:n,ctrlsSvc:o,useHeaderRow:r,skipScrollPadding:i}=e;let l=o.getHeaderRowContainerCtrl(t)?.eViewport,{x:s}=e;return l?(a&&(s-=l.getBoundingClientRect().left),n.get("enableRtl")&&(r&&(l=l.querySelector(".ag-header-row")),s=l.clientWidth-s),t==null&&!i&&(s+=o.get("center").getCenterViewportScrollLeft()),s):0}function il(e,t){for(const a of e)a.moving=t,a.dispatchColEvent("movingChanged","uiColumnMoved")}var au=7,ll=100,jo=ll/2,ZC=5,JC=100,XC=class extends y{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!z(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:a}=t||{},n=a?.columns??[];for(const o of n){const r=o.getPinned();if(o.getColDef().lockPinned){if(r==e)return"move";continue}const i=a?.containerType;if(i===e||!e)return"move";if(e&&(!r||i!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,a=t.columns;if(e.dragSource.type===0)this.setColumnsVisible(a,!0,"uiColumnDragged");else{const o=t.visibleState,r=(a||[]).filter(i=>o[i.getId()]&&!i.isVisible());this.setColumnsVisible(r,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(a,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,a=!1,n=!1){const{gos:o,ctrlsSvc:r}=this.beans,i=o.get("suppressMoveWhenColumnDragging");if(n&&!i){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!n&&K(e.hDirection))return;const l=rl({x:e.x,pinned:this.pinned,gos:o,ctrlsSvc:r});t||this.checkCenterForScrolling(l),i?this.handleColumnDragWhileSuppressingMovement(e,t,a,l,n):this.handleColumnDragWhileAllowingMovement(e,t,a,l,n)}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(e,t,a){if(!e?.length)return;const n=e.filter(o=>!o.getColDef().lockVisible);n.length&&this.beans.colModel.setColsVisible(n,t,a)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:a}=e;this.beans.colMoves.moveColumns(t,a,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,a,n,o){const r=this.getAllMovingColumns(e,!0);if(o){const i=this.isAttemptingToPin(r);i&&this.attemptToPinColumns(r,void 0,!0);const{fromLeft:l,xPosition:s}=this.getNormalisedXPositionInfo(r,i)||{};if(l==null||s==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:r,xPosition:s,fromEnter:t,fakeEvent:a,fromLeft:l})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(r,n)}}handleColumnDragWhileAllowingMovement(e,t,a,n,o){const r=this.getAllMovingColumns(e),i=this.normaliseDirection(e.hDirection)==="right",l=e.dragSource.type===1,s=this.getMoveColumnParams({allMovingColumns:r,isFromHeader:l,xPosition:n,fromLeft:i,fromEnter:t,fakeEvent:a}),c=tu({...s,finished:o});c&&(this.lastMovedInfo=c)}getAllMovingColumns(e,t=!1){const a=e.dragSource.getDragItem();let n=null;t?(n=a.columnsInSplit,n||(n=a.columns)):n=a.columns;const o=r=>r.getColDef().lockPinned?r.getPinned()==this.pinned:!0;return n?n.filter(o):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:a,xPosition:n,fromLeft:o,fromEnter:r,fakeEvent:i}=e,{gos:l,colModel:s,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:a,fromLeft:o,xPosition:n,pinned:this.pinned,fromEnter:r,fakeEvent:i,gos:l,colModel:s,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){const{gos:a,colModel:n}=this.beans,o=a.get("enableRtl"),r=n.getCols().filter(d=>d.isVisible()&&d.getPinned()===this.pinned);let i=null,l=null,s=null;for(const d of r){if(l=d.getActualWidth(),i=this.getNormalisedColumnLeft(d,0,o),i!=null){const g=i+l;if(i<=t&&g>=t){s=d;break}}i=null,l=null}if(s)e.indexOf(s)!==-1&&(s=null);else{for(let d=r.length-1;d>=0;d--){const g=r[d],u=r[d].getParent();if(!u){s=g;break}const h=u?.getDisplayedLeafColumns();if(h.length){s=j(h);break}}if(!s)return;i=this.getNormalisedColumnLeft(s,0,o),l=s.getActualWidth()}if(s==null||i==null||l==null){this.lastHighlightedColumn?.column!==s&&this.clearHighlighted();return}let c;if(t-i<l/2){const d=r.indexOf(s);d===0?c=0:(c=1,s=r[d-1])}else c=1;(this.lastHighlightedColumn?.column!==s||this.lastHighlightedColumn?.position!==c)&&this.clearHighlighted(),nu(s,c),this.lastHighlightedColumn={column:s,position:c}}getNormalisedXPositionInfo(e,t){const{gos:a,visibleCols:n}=this.beans,o=a.get("enableRtl"),{firstMovingCol:r,column:i,position:l}=this.getColumnMoveAndTargetInfo(e,t,o);if(!r||!i||l==null)return;const s=n.allCols,c=s.indexOf(r),d=s.indexOf(i),g=l===0,u=c<d||c===d&&!g;let h=0;if(g?u&&(h-=1):u||(h+=1),d+h===c)return;const p=s[d+h];if(!p)return;const f=this.getNormalisedColumnLeft(p,20,o);return{fromLeft:u,xPosition:f}}getColumnMoveAndTargetInfo(e,t,a){const n=this.lastHighlightedColumn||{},{firstMovingCol:o,lastMovingCol:r}=$C(e);if(!o||!r||n.column||!t)return{firstMovingCol:o,...n};const l=this.getPinDirection()==="left";return{firstMovingCol:o,position:l?1:0,column:l!==a?o:r}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case"left":return"right";case"right":return"left"}return e}getNormalisedColumnLeft(e,t,a){const{gos:n,ctrlsSvc:o}=this.beans,r=e.getLeft();if(r==null)return null;const i=e.getActualWidth();return rl({x:a?r+i-t:r+t,pinned:e.getPinned(),useHeaderRow:a,skipScrollPadding:!0,gos:n,ctrlsSvc:o})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,a=this.failedMoveAttempts>au;return t&&a||e.some(n=>n.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:a,fromEnter:n,fakeEvent:o,fromLeft:r}=e,i=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:a,fromLeft:r,fromEnter:n,fakeEvent:o}),{columns:l,toIndex:s}=eu(i)||{};l&&s!=null&&(this.lastMovedInfo={columns:l,toIndex:s}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(nu(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),a=t.getCenterViewportScrollLeft(),n=a+t.getCenterWidth();let o,r;this.gos.get("enableRtl")?(o=e<a+jo,r=e>n-jo):(r=e<a+jo,o=e>n-jo),this.needToMoveRight=o,this.needToMoveLeft=r,r||o?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),JC),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*ZC,e>ll&&(e=ll);let t=null;const a=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=a.scrollHorizontally(-e):this.needToMoveRight&&(t=a.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:n,dragAndDrop:o,gos:r}=this.beans;if(this.failedMoveAttempts<=au+1||!n)return;if(o.setDragImageCompIcon("pinned"),!r.get("suppressMoveWhenColumnDragging")){const i=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(i,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,a=!1){const n=(e||[]).filter(i=>!i.getColDef().lockPinned);if(!n.length)return 0;a&&(t=this.getPinDirection());const{pinnedCols:o,dragAndDrop:r}=this.beans;return o?.setColsPinned(n,t,"uiColumnDragged"),a&&r.nudge(),n.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function nu(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}function $C(e){const t=e.length;let a,n;for(let o=0;o<t;o++){if(!a){const r=e[o];r.getLeft()!=null&&(a=r)}if(!n){const r=e[t-1-o];r.getLeft()!=null&&(n=r)}if(a&&n)break}return{firstMovingCol:a,lastMovingCol:n}}var e0=class extends y{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans,a=this.pinned;e.whenReady(this,n=>{let o;const r=n.gridBodyCtrl.eBodyViewport;switch(a){case"left":o=[[r,n.left.eContainer],[n.bottomLeft.eContainer],[n.topLeft.eContainer]];break;case"right":o=[[r,n.right.eContainer],[n.bottomRight.eContainer],[n.topRight.eContainer]];break;default:o=[[r,n.center.eViewport],[n.bottomCenter.eViewport],[n.topCenter.eViewport]];break}this.eSecondaryContainers=o}),this.moveColumnFeature=this.createManagedBean(new XC(a)),this.bodyDropPivotTarget=this.createManagedBean(new qC(a)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}};function ou(e,t){const a=[],n=[],o=[];return e.forEach(i=>{const l=i.getColDef().lockPosition;l==="right"?o.push(i):l==="left"||l===!0?a.push(i):n.push(i)}),t.get("enableRtl")?[...o,...n,...a]:[...a,...n,...o]}function ru(e,t){let a=!0;return $e(null,t,n=>{if(!de(n))return;const o=n;if(!o.getColGroupDef()?.marryChildren)return;const l=[];for(const u of o.getLeafColumns()){const h=e.indexOf(u);l.push(h)}const s=Math.max.apply(Math,l),c=Math.min.apply(Math,l),d=s-c,g=o.getLeafColumns().length-1;d>g&&(a=!1)}),a}var t0=class extends y{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,a){const n=this.beans.colModel.getCols();if(!n)return;const o=n[e];this.moveColumns([o],t,a)}moveColumns(e,t,a,n=!0){const{colModel:o,colAnimation:r,visibleCols:i,eventSvc:l}=this.beans,s=o.getCols();if(!s)return;if(t>s.length-e.length){R(30,{toIndex:t});return}r?.start();const c=o.getColsForKeys(e);this.doesMovePassRules(c,t)&&(Vs(o.getCols(),c,t),i.refresh(a),l.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,toIndex:t,finished:n,source:a})),r?.finish()}doesMovePassRules(e,t){const a=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(a)}doesOrderPassRules(e){const{colModel:t,gos:a}=this.beans;return!(!ru(e,t.getColTree())||!(o=>{const r=c=>c?c==="left"||c===!0?-1:1:0,i=a.get("enableRtl");let l=i?1:-1,s=!0;for(const c of o){const d=r(c.getColDef().lockPosition);i?d>l&&(s=!1):d<l&&(s=!1),l=d}return s})(e))}getProposedColumnOrder(e,t){const n=this.beans.colModel.getCols().slice();return Vs(n,e,t),n}createBodyDropTarget(e,t){return new e0(e,t)}moveHeader(e,t,a,n,o){const{ctrlsSvc:r,gos:i,colModel:l,visibleCols:s,focusSvc:c}=this.beans,d=t.getBoundingClientRect(),g=d.left,u=ee(a),h=u?d.width:a.getActualWidth(),p=e==="left"!==i.get("enableRtl"),f=rl({x:p?g-20:g+h+20,pinned:n,fromKeyboard:!0,gos:i,ctrlsSvc:r}),m=c.focusedHeader;tu({allMovingColumns:u?a.getLeafColumns():[a],isFromHeader:!0,fromLeft:e==="right",xPosition:f,pinned:n,fromEnter:!1,fakeEvent:!1,gos:i,colModel:l,colMoves:this,visibleCols:s,finished:!0});let v;if(u){const b=a.getDisplayedLeafColumns();v=p?b[0]:j(b)}else v=a;if(r.getScrollFeature().ensureColumnVisible(v,"auto"),(!o.isAlive()||i.get("ensureDomOrder"))&&m){let b;if(u){const w=a.getGroupId(),k=a.getLeafColumns();if(!k.length)return;const S=k[0].getParent();if(!S)return;b=a0(S,w)}else b=a;b&&c.focusHeaderPosition({headerPosition:{...m,column:b}})}}setDragSourceForHeader(e,t,a){const{gos:n,colModel:o,dragAndDrop:r,visibleCols:i}=this.beans;let l=!n.get("suppressDragLeaveHidesColumns");const s=ee(t),c=s?t.getProvidedColumnGroup().getLeafColumns():[t],g={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:s?()=>o0(t,i.allCols):()=>n0(t),dragItemName:a,onDragStarted:()=>{l=!n.get("suppressDragLeaveHidesColumns"),il(c,!0)},onDragStopped:()=>il(c,!1),onDragCancelled:()=>il(c,!1),onGridEnter:u=>{if(l){const{columns:h=[],visibleState:p}=u??{},f=s?v=>!p||p[v.getColId()]:()=>!0,m=h.filter(v=>!v.getColDef().lockVisible&&f(v));o.setColsVisible(m,!0,"uiColumnMoved")}},onGridExit:u=>{if(l){const h=u?.columns?.filter(p=>!p.getColDef().lockVisible)||[];o.setColsVisible(h,!1,"uiColumnMoved")}}};return r.addDragSource(g,!0),g}};function a0(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}}function n0(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}function o0(e,t){const a=e.getProvidedColumnGroup().getLeafColumns(),n={};for(const l of a)n[l.getId()]=l.isVisible();const o=[];for(const l of t)a.indexOf(l)>=0&&(o.push(l),Pe(a,l));for(const l of a)o.push(l);const r=[],i=e.getLeafColumns();for(const l of o)i.indexOf(l)!==-1&&r.push(l);return{columns:o,columnsInSplit:r,visibleState:n,containerType:r[0]?.pinned}}var iu={moduleName:"ColumnMove",version:F,beans:[t0,NC],apiFunctions:{moveColumnByIndex:VC,moveColumns:GC},dependsOn:[ol],css:[HC]},r0=class extends y{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const a=this.getHeaderCellForColumn(e);if(!a)return-1;const n=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||n.push(a),this.getPreferredWidthForElements(n)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const a=document.createElement("form");a.style.position="fixed";const n=this.centerRowContainerCtrl.eContainer;for(const r of e)this.cloneItemIntoDummy(r,a);n.appendChild(a);const o=Math.ceil(a.getBoundingClientRect().width);return a.remove(),t=t??this.gos.get("autoSizePadding"),o+t}getHeaderCellForColumn(e){let t=null;for(const a of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const n=a.getHtmlElementForColumnHeader(e);n!=null&&(t=n)}return t}cloneItemIntoDummy(e,t){const a=e.cloneNode(!0);a.style.width="",a.style.position="static",a.style.left="";const n=document.createElement("div"),o=n.classList;["ag-header-cell","ag-header-group-cell"].some(l=>a.classList.contains(l))?(o.add("ag-header","ag-header-row"),n.style.position="static"):o.add("ag-row");let i=e.parentElement;for(;i;){if(["ag-header-row","ag-row"].some(s=>i.classList.contains(s))){for(let s=0;s<i.classList.length;s++){const c=i.classList[s];c!="ag-row-position-absolute"&&o.add(c)}break}i=i.parentElement}n.appendChild(a),t.appendChild(n)}},lu={moduleName:"AutoWidth",version:F,beans:[r0]};function i0(e,t,a=!0,n="api"){e.colResize?.setColumnWidths(t,!1,a,n)}function su(e,t){if(!e||e.length==0)return;const a=t(e[0]);for(let n=1;n<e.length;n++)if(a!==t(e[n]))return;return a}function cu(e,t,a){if(!t.length)return;const n=t.length===1?t[0]:null,o=su(t,r=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:n,source:a})}function l0(e,t,a){if(!t.length)return;const n=t.length===1?t[0]:null,o=su(t,r=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:n,source:a})}function du(e,t,a,n){e.dispatchEvent({type:t,columns:a,column:a&&a.length==1?a[0]:null,source:n})}function Ha(e,t,a,n,o=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:a,source:n})}var s0=class extends y{constructor(e,t,a,n){super(),this.comp=e,this.eResize=t,this.pinned=a,this.columnGroup=n}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const{horizontalResizeSvc:e,gos:t,colAutosize:a}=this.beans,n=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});this.addDestroyFunc(n),!t.get("suppressAutoSize")&&a&&this.addDestroyFunc(a.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:a,resizeRatios:n,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:i}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=a,this.resizeRatios=n,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=i,this.toggleColumnResizing(!0)}onResizing(e,t,a="uiColumnResized"){const n=this.normaliseDragChange(t),o=this.resizeStartWidth+n;this.resizeColumnsFromLocalValues(o,a,e)}getInitialValues(e){const t=s=>s.reduce((c,d)=>c+d.getActualWidth(),0),a=(s,c)=>s.map(d=>d.getActualWidth()/c),n=this.getColumnsToResize(),o=t(n),r=a(n,o),i={columnsToResize:n,resizeStartWidth:o,resizeRatios:r};let l=null;if(e&&(l=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),l){const s=l.getDisplayedLeafColumns(),c=i.groupAfterColumns=s.filter(g=>g.isResizable()),d=i.groupAfterStartWidth=t(c);i.groupAfterRatios=a(c,d)}else i.groupAfterColumns=void 0,i.groupAfterStartWidth=void 0,i.groupAfterRatios=void 0;return i}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),a=this.getInitialValues();t>a.resizeStartWidth&&this.resizeColumns(a,t,e,!0)}resizeColumnsFromLocalValues(e,t,a=!0){if(!this.resizeCols||!this.resizeRatios)return;const n={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(n,e,t,a)}resizeColumns(e,t,a,n=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:i,groupAfterColumns:l,groupAfterStartWidth:s,groupAfterRatios:c}=e,d=[];if(d.push({columns:o,ratios:i,width:t}),l){const g=t-r;d.push({columns:l,ratios:c,width:s-g})}this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:n,source:a}),n&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},c0=class extends y{constructor(e,t,a,n,o){super(),this.pinned=e,this.column=t,this.eResize=a,this.comp=n,this.ctrl=o}postConstruct(){const e=[];let t,a;const n=()=>{if(W(this.eResize,t),!t)return;const{horizontalResizeSvc:i,colAutosize:l}=this.beans,s=i.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(s),a&&l&&e.push(l.addColumnAutosizeListeners(this.eResize,this.column))},o=()=>{for(const i of e)i();e.length=0},r=()=>{const i=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(i!==t||l!==a)&&(t=i,a=l,o(),n())};r(),this.addDestroyFunc(o),this.ctrl.setRefreshFunction("resize",r)}onResizing(e,t){const{column:a,lastResizeAmount:n,resizeStartWidth:o,beans:r}=this,i=this.normaliseResizeAmount(t),l=o+i,s=[{key:a,newWidth:l}],{pinnedCols:c,ctrlsSvc:d,colResize:g}=r;if(this.column.getPinned()){const u=c?.leftWidth??0,h=c?.rightWidth??0,p=ka(d.getGridBodyCtrl().eBodyViewport)-50;if(u+h+(i-n)>p)return}this.lastResizeAmount=i,g?.setColumnWidths(s,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const a=this.pinned!=="left",n=this.pinned==="right";return this.gos.get("enableRtl")?a&&(t*=-1):n&&(t*=-1),t}},d0=class extends y{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,a,n){const o=[],{colModel:r,gos:i,visibleCols:l}=this.beans;for(const s of e){const c=r.getColDefCol(s.key)||r.getCol(s.key);if(!c)continue;if(o.push({width:s.newWidth,ratios:[1],columns:[c]}),i.get("colResizeDefault")==="shift"&&(t=!t),t){const g=l.getColAfter(c);if(!g)continue;const u=c.getActualWidth()-s.newWidth,h=g.getActualWidth()+u;o.push({width:h,ratios:[1],columns:[g]})}}o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:a,source:n})}resizeColumnSets(e){const{resizeSets:t,finished:a,source:n}=e;if(!(!t||t.every(d=>g0(d)))){if(a){const d=t&&t.length>0?t[0].columns:null;Ha(this.eventSvc,d,a,n)}return}const r=[],i=[];for(const d of t){const{width:g,columns:u,ratios:h}=d,p={},f={};for(const b of u)i.push(b);let m=!0,v=0;for(;m;){if(v++,v>1e3){G(31);break}m=!1;const b=[];let w=0,k=g;u.forEach((x,M)=>{if(f[x.getId()])k-=p[x.getId()];else{b.push(x);const O=h[M];w+=O}});const S=1/w;b.forEach((x,M)=>{const L=M===b.length-1;let O;L?O=k:(O=Math.round(h[M]*g*S),k-=O);const H=x.getMinWidth(),B=x.getMaxWidth();O<H?(O=H,f[x.getId()]=!0,m=!0):B>0&&O>B&&(O=B,f[x.getId()]=!0,m=!0),p[x.getId()]=O})}for(const b of u){const w=p[b.getId()];b.getActualWidth()!==w&&(b.setActualWidth(w,n),r.push(b))}}const l=r.length>0;let s=[];if(l){const{colFlex:d,visibleCols:g,colViewport:u}=this.beans;s=d?.refreshFlexedColumns({resizingCols:i,skipSetLeft:!0})??[],g.setLeftValues(n),g.updateBodyWidths(),u.checkViewportColumns()}const c=i.concat(s);(l||a)&&Ha(this.eventSvc,c,a,n,s)}resizeHeader(e,t,a){if(!e.isResizable())return;const n=e.getActualWidth(),o=e.getMinWidth(),r=e.getMaxWidth(),i=Math.min(Math.max(n+t,o),r);this.setColumnWidths([{key:e,newWidth:i}],a,!0,"uiColumnResized")}createResizeFeature(e,t,a,n,o){return new c0(e,t,a,n,o)}createGroupResizeFeature(e,t,a,n){return new s0(e,t,a,n)}};function g0(e){const{columns:t,width:a}=e;let n=0,o=0,r=!0;for(const s of t){const c=s.getMinWidth();n+=c||0;const d=s.getMaxWidth();d>0?o+=d:r=!1}const i=a>=n,l=!r||a<=o;return i&&l}var u0={moduleName:"ColumnResize",version:F,beans:[d0],apiFunctions:{setColumnWidths:i0},dependsOn:[$g,lu]},h0=class extends y{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)})}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",e===0)}},p0=class extends Oi{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,a,n,o){const{column:r,beans:i}=this,{context:l,colNames:s,colHover:c,rangeSvc:d,colResize:g}=i;this.comp=e,o=Rn(this,l,o),this.setGui(t,o),this.displayName=s.getDisplayNameForColumnGroup(r,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(o),this.setupExpandable(o),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:n,compBean:o}),this.setupUserComp(),this.addHeaderMouseListeners(o,n),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const u=this.rowCtrl.pinned,h=r.getProvidedColumnGroup().getLeafColumns();c?.createHoverFeature(o,h,t),d?.createRangeHighlightFeature(o,r,e),o.createManagedBean(new Li(r,t,i)),o.createManagedBean(new h0(e,r)),g?this.resizeFeature=o.createManagedBean(g.createGroupResizeFeature(e,a,u,r)):e.setResizableDisplayed(!1),o.createManagedBean(new Ta(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(o,h),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),o.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(o),o.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,a=e.getDefinition();return I(t.gos,{colDef:a,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,a=e.get("groupHeaderHeight");a!=null?a===0?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(a):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const a of t)e.addManagedListeners(a,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,a)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),a=t[0]===e,n=j(t)===e;if(!a&&!n)return;const o=e.getHighlighted(),r=!!this.rowCtrl.getHeaderCellCtrls().find(s=>s.column.isMoving());let i=!1,l=!1;if(r){const s=this.beans.gos.get("enableRtl"),c=o===1,d=o===0;a&&(s?l=c:i=d),n&&(s?i=d:l=c)}this.comp.toggleCss("ag-header-highlight-before",i),this.comp.toggleCss("ag-header-highlight-after",l)}resizeHeader(e,t){const{resizeFeature:a}=this;if(!a)return;const n=a.getInitialValues(t);a.resizeColumns(n,n.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:a,enterpriseMenuFactory:n}=this.beans,o=this.column,r=o.getProvidedColumnGroup(),i=I(a,{displayName:this.displayName,columnGroup:o,setExpanded:s=>{e.setColumnGroupOpened(r,s,"gridInitializing")},setTooltip:(s,c)=>{a.assertModuleRegistered("Tooltip",3),this.setupTooltip(s,c)},showColumnMenu:(s,c)=>n?.showMenuAfterButtonClick(r,s,"columnMenu",c),showColumnMenuAfterMouseClick:(s,c)=>n?.showMenuAfterMouseEvent(r,s,"columnMenu",c),eGridHeader:this.eGui}),l=pb(t,i);l&&this.comp.setUserCompDetails(l)}addHeaderMouseListeners(e,t){const{column:a,comp:n,beans:{rangeSvc:o},gos:r}=this,i=d=>this.handleMouseOverChange(d.type==="mouseenter"),l=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",a.getProvidedColumnGroup()),s=d=>this.handleContextMenuMouseEvent(d,void 0,a.getProvidedColumnGroup());e.addManagedListeners(this.eGui,{mouseenter:i,mouseleave:i,click:l,contextmenu:s}),n.toggleCss("ag-header-group-cell-selectable",na(r));const c=o?.createHeaderGroupCellMouseListenerFeature(this.column,t);c&&this.createManagedBean(c)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,e,t)}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const a=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:a,expandableChanged:a})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),a=Bi(t,this.gos,null,e);e.isPadding()?(a.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(o=>o.isSpanHeaderHeight())&&a.push("ag-header-span-height")):(a.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&a.push("ag-header-cell-wrap-text"));for(const n of a)this.comp.toggleCss(n,!0)}setupMovingCss(e){const{column:t}=this,n=t.getProvidedColumnGroup().getLeafColumns(),o=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const r of n)e.addManagedListeners(r,{movingChanged:o});o()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:a,expandable:n,gos:o,beans:r}=this,i=na(o);if(e.key==C.ENTER){if(i&&!e.altKey)r.rangeSvc?.handleColumnSelection(a,e);else if(n){const l=!a.isExpanded();r.colGroupSvc.setColumnGroupOpened(a.getProvidedColumnGroup(),l,"uiColumnExpanded")}}}refreshAnnouncement(){let e;const{gos:t}=this;na(t)&&(e=this.getLocaleTextFunc()("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group")),this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:a}=this;!a||!t.contains(_(e))||e.ariaAnnounce?.announceValue(a,"columnHeader")}setDragSource(e){!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some(e=>e.getColDef().suppressMovable||e.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function f0(e,t,a){e.colGroupSvc?.setColumnGroupOpened(t,a,"api")}function m0(e,t,a){return e.colGroupSvc?.getColumnGroup(t,a)??null}function v0(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null}function b0(e,t,a){return e.colNames.getDisplayNameForColumnGroup(t,a)||""}function w0(e){return e.colGroupSvc?.getColumnGroupState()??[]}function C0(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}function y0(e){e.colGroupSvc?.resetColumnGroupState("api")}function k0(e){return e.visibleCols.treeLeft}function S0(e){return e.visibleCols.treeCenter}function x0(e){return e.visibleCols.treeRight}function R0(e){return e.visibleCols.getAllTrees()}var sl=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let a;return typeof t!="number"?a=0:a=t+1,this.existingIds[e]=a,a}};function E0(e,t){for(let a=0;a<t.length;a++){const n=e.indexOf(t[a]);n>=0&&(e[n]=e[e.length-1],e.pop())}}var F0=class extends y{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(e,t=!1){const{colFlex:a,colModel:n,colGroupSvc:o,colViewport:r,selectionColSvc:i}=this.beans;t||this.buildTrees(n,o),o?.updateOpenClosedVisibility(),this.leftCols=cl(this.treeLeft),this.centerCols=cl(this.treeCenter),this.rightCols=cl(this.treeRight),i?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(n),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(l=>l.isAutoHeight()),a?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(n,this.leftCols,this.rightCols,e),r.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let e=0;for(const t of this.allCols){let a=t.getParent();for(;a;){if(!a.isPadding()){const n=a.getProvidedColumnGroup().getLevel()+1;n>e&&(e=n);break}a=a.getParent()}}return e}updateBodyWidths(){const e=pt(this.centerCols),t=pt(this.leftCols),a=pt(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==a)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=a,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e,t,a,n){let o,r;this.gos.get("enableRtl")?(o=t?t[0]:null,r=a?j(a):null):(o=t?j(t):null,r=a?a[0]:null);for(const i of e.getCols())i.setLastLeftPinned(i===o,n),i.setFirstRightPinned(i===r,n)}buildTrees(e,t){const a=e.getColsToShow(),n=a.filter(s=>s.getPinned()=="left"),o=a.filter(s=>s.getPinned()=="right"),r=a.filter(s=>s.getPinned()!="left"&&s.getPinned()!="right"),i=new sl,l=s=>t?t.createColumnGroups(s):s.columns;this.treeLeft=l({columns:n,idCreator:i,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=l({columns:o,idCreator:i,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=l({columns:r,idCreator:i,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),a=[],n=[],o=[];for(const r of t){const i=r.getPinned();i?i===!0||i==="left"?a.push(r):o.push(r):n.push(r)}this.ariaOrderColumns=a.concat(n).concat(o)}getAriaColIndex(e){let t;return ee(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)ee(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const n=t.getCols().slice(0),o=this.gos.get("enableRtl");for(const r of[this.leftCols,this.rightCols,this.centerCols]){if(o){let i=pt(r);for(const l of r)i-=l.getActualWidth(),l.setLeft(i,e)}else{let i=0;for(const l of r)l.setLeft(i,e),i+=l.getActualWidth()}E0(n,r)}for(const r of n)r.setLeft(null,e)}joinCols(){this.gos.get("enableRtl")?this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols):this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){const{leftCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:a}}=this;return a.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,a,n){const o=[];let r=null;for(let i=0;i<t.length;i++){const l=t[i],s=t.length-i,c=Math.min(l.getColSpan(e),s),d=[l];if(c>1){const u=c-1;for(let h=1;h<=u;h++)d.push(t[i+h]);i+=u}let g;if(a){g=!1;for(const u of d)a(u)&&(g=!0)}else g=!0;g&&(o.length===0&&r&&(n&&n(l))&&o.push(r),o.push(l)),r=l}return o}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,a=t.indexOf(e);return a>0?t[a-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};ca(this.treeCenter,!1,e),ca(this.treeLeft,!1,e),ca(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["leftCols","centerCols","rightCols"];e&&t.reverse();for(let a=0;a<t.length;a++){const n=this[t[a]];if(n.length)return e?j(n):n[0]}return null}getColAfter(e){const t=this.allCols,a=t.indexOf(e);return a<t.length-1?t[a+1]:null}getColsLeftWidth(){return pt(this.leftCols)}getDisplayedColumnsRightWidth(){return pt(this.rightCols)}isColAtEdge(e,t){const a=this.allCols;if(!a.length)return!1;const n=t==="first";let o;if(ee(e)){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=n?r[0]:j(r)}else o=e;return(n?a[0]:j(a))===o}};function ca(e,t,a){if(e)for(let n=0;n<e.length;n++){const o=e[n];if(ee(o)){const r=t?o.getDisplayedChildren():o.getChildren();ca(r,t,a)}a(o)}}function cl(e){const t=[];return ca(e,!0,a=>{dt(a)&&t.push(a)}),t}var M0=class extends y{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[],t=this.beans.colModel.getColTree();return $e(null,t,a=>{de(a)&&e.push({groupId:a.getGroupId(),open:a.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const a=[];$e(null,t,n=>{if(de(n)){const o=n.getColGroupDef(),r={groupId:n.getGroupId(),open:o?o.openByDefault:void 0};a.push(r)}}),this.setColumnGroupState(a,e)}setColumnGroupState(e,t){const{colModel:a,colAnimation:n,visibleCols:o,eventSvc:r}=this.beans;if(!a.getColTree().length)return;n?.start();const l=[];for(const s of e){const c=s.groupId,d=s.open,g=this.getProvidedColGroup(c);g&&g.isExpanded()!==d&&(g.setExpanded(d),l.push(g))}o.refresh(t,!0),l.length&&r.dispatchEvent({type:"columnGroupOpened",columnGroup:l.length===1?l[0]:void 0,columnGroups:l}),n?.finish()}setColumnGroupOpened(e,t,a){let n;de(e)?n=e.getId():n=e||"",this.setColumnGroupState([{groupId:n,open:t}],a)}getProvidedColGroup(e){let t=null;return $e(null,this.beans.colModel.getColTree(),a=>{de(a)&&a.getId()===e&&(t=a)}),t}getGroupAtDirection(e,t){const a=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),n=e.getDisplayedLeafColumns(),o=t==="After"?j(n):n[0],r=`getCol${t}`;for(;;){const i=this.beans.visibleCols[r](o);if(!i)return null;const l=this.getColGroupAtLevel(i,a);if(l!==e)return l}}getColGroupAtLevel(e,t){let a=e.getParent(),n,o;for(;n=a.getProvidedColumnGroup().getLevel(),o=a.getPaddingLevel(),!(n+o<=t);)a=a.getParent();return a}updateOpenClosedVisibility(){const e=this.beans.visibleCols.getAllTrees();ca(e,!1,t=>{ee(t)&&t.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(ee(e))return e;const a=this.beans.visibleCols.getAllTrees(),n=typeof t=="number";let o=null;return ca(a,!1,r=>{if(ee(r)){const i=r;let l;n?l=e===i.getGroupId()&&t===i.getPartId():l=e===i.getGroupId(),l&&(o=i)}}),o}createColumnGroups(e){const{columns:t,idCreator:a,pinned:n,oldDisplayedGroups:o,isStandaloneStructure:r}=e,i=this.mapOldGroupsById(o),l=[];let s=t;for(;s.length;){const c=s;s=[];let d=0;const g=u=>{const h=d;d=u;const p=c[h],m=(ee(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let b=h;b<u;b++)l.push(c[b]);return}const v=this.createColumnGroup(m,a,i,n,r);for(let b=h;b<u;b++)v.addChild(c[b]);s.push(v)};for(let u=1;u<c.length;u++){const h=c[u],f=(ee(h)?h.getProvidedColumnGroup():h).getOriginalParent(),m=c[d],b=(ee(m)?m.getProvidedColumnGroup():m).getOriginalParent();f!==b&&g(u)}d<c.length&&g(c.length)}return r||this.setupParentsIntoCols(l,null),l}createProvidedColumnGroup(e,t,a,n,o,r,i){const l=o.getUniqueKey(t.groupId||null,null),s=$r(this.beans,t,l),c=new Aa(s,l,!1,a);this.createBean(c);const d=this.findExistingGroup(t,r);d&&r.splice(d.idx,1);const g=d?.group;g&&c.setExpanded(g.isExpanded());const u=id(this.beans,s.children,a+1,e,n,o,r,i);return c.setChildren(u),c}balanceColumnTree(e,t,a,n){const o=[];for(let r=0;r<e.length;r++){const i=e[r];if(de(i)){const l=i,s=this.balanceColumnTree(l.getChildren(),t+1,a,n);l.setChildren(s),o.push(l)}else{let l,s;for(let c=t;c<a;c++){const d=n.getUniqueKey(null,null),g=$r(this.beans,null,d),u=new Aa(g,d,!0,c);this.createBean(u),s&&s.setChildren([u]),s=u,l||(l=s)}if(l&&s)if(o.push(l),e.some(d=>de(d))){s.setChildren([i]);continue}else{s.setChildren(e);break}o.push(i)}}return o}findDepth(e){let t=0,a=e;for(;a?.[0]&&de(a[0]);)t++,a=a[0].getChildren();return t}findMaxDepth(e,t){let a=t;for(let n=0;n<e.length;n++){const o=e[n];if(de(o)){const r=o,i=this.findMaxDepth(r.getChildren(),t+1);a<i&&(a=i)}}return a}balanceTreeForAutoCols(e,t){const a=[];for(const n of e){let o=n;for(let r=t-1;r>=0;r--){const i=new Aa(null,`FAKE_PATH_${n.getId()}_${r}`,!0,r);this.createBean(i),i.setChildren([o]),o.originalParent=i,o=i}t===0&&(n.originalParent=null),a.push(o)}return a}findExistingGroup(e,t){if(e.groupId!=null)for(let n=0;n<t.length;n++){const o=t[n];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:n,group:o}}}createColumnGroup(e,t,a,n,o){const r=e.getGroupId(),i=t.getInstanceIdForKey(r),l=hd(r,i);let s=a[l];return s&&s.getProvidedColumnGroup()!==e&&(s=null),z(s)?s.reset():(s=new Ia(e,r,i,n),o||this.createBean(s)),s}mapOldGroupsById(e){const t={},a=n=>{for(const o of n)if(ee(o)){const r=o;t[o.getUniqueId()]=r,a(r.getChildren())}};return e&&a(e),t}setupParentsIntoCols(e,t){for(const a of e??[])if(a.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),a.parent=t,ee(a)){const n=a;this.setupParentsIntoCols(n.getChildren(),n)}}},gu={moduleName:"ColumnGroup",version:F,dynamicBeans:{headerGroupCellCtrl:p0},beans:[M0],apiFunctions:{getAllDisplayedColumnGroups:R0,getCenterDisplayedColumnGroups:S0,getColumnGroup:m0,getColumnGroupState:w0,getDisplayNameForColumnGroup:b0,getLeftDisplayedColumnGroups:k0,getProvidedColumnGroup:v0,getRightDisplayedColumnGroups:x0,resetColumnGroupState:y0,setColumnGroupOpened:f0,setColumnGroupState:C0}};function Be(e,t,a){const{colModel:n,rowGroupColsSvc:o,pivotColsSvc:r,autoColSvc:i,selectionColSvc:l,colAnimation:s,visibleCols:c,pivotResultCols:d,environment:g,valueColsSvc:u,eventSvc:h,gos:p}=e,f=n.getColDefCols()??[],m=l?.getColumns();if(!f.length&&!m?.length)return!1;if(t?.state&&!t.state.forEach)return R(32),!1;const v=(S,x,M,L,O)=>{if(!S)return;const H=Bv(x,t.defaultState),B=H("flex").value1,Y=H("sort").value1,q=H("sortType").value1,ge=ut(Y)||yo(q),re=Xe(q),Ls=pn(Y),Bs=ge?{type:re,direction:Ls}:void 0;if(ld(e,S,H("hide").value1,Bs,H("sortIndex").value1,H("pinned").value1,B,a),B==null){const Qa=H("width").value1;if(Qa!=null){const Zn=S.getColDef().minWidth??g.getDefaultColumnMinWidth();Zn!=null&&Qa>=Zn&&S.setActualWidth(Qa,a)}}O||!S.isPrimary()||(u?.syncColumnWithState(S,a,H),o?.syncColumnWithState(S,a,H,M),r?.syncColumnWithState(S,a,H,L))},b=(S,x,M)=>{const L=hu(e,a),O=x.slice(),H={},B={},Y=[],q=[],ge=[];let re=0;const Ls=o?.columns.slice()??[],Bs=r?.columns.slice()??[];for(const Se of S){const Jn=Se.colId;if(Jn.startsWith(ht)){Y.push(Se),ge.push(Se);continue}if(ft(Jn)){q.push(Se),ge.push(Se);continue}const Za=M(Jn);Za?(v(Za,Se,H,B,!1),Pe(O,Za)):(ge.push(Se),re+=1)}const Qa=Se=>v(Se,null,H,B,!1);O.forEach(Qa),o?.sortColumns(fu.bind(o,H,Ls)),r?.sortColumns(fu.bind(r,B,Bs)),n.refreshCols(!1,a);const Zn=(Se,Jn,Os=[])=>{for(const Za of Jn){const im=Se(Za.colId);Pe(Os,im),v(im,Za,null,null,!0)}Os.forEach(Qa)};return Zn(Se=>i?.getColumn(Se)??null,Y,i?.getColumns()?.slice()),Zn(Se=>l?.getColumn(Se)??null,q,l?.getColumns()?.slice()),z0(t,n,p),c.refresh(a),h.dispatchEvent({type:"columnEverythingChanged",source:a}),L(),{unmatchedAndAutoStates:ge,unmatchedCount:re}};s?.start();let{unmatchedAndAutoStates:w,unmatchedCount:k}=b(t.state||[],f,S=>n.getColDefCol(S));if(w.length>0||z(t.defaultState)){const S=d?.getPivotResultCols()?.list??[];k=b(w,S,x=>d?.getPivotResultCol(x)??null).unmatchedCount}return s?.finish(),k===0}function uu(e,t){const{colModel:a,autoColSvc:n,selectionColSvc:o,eventSvc:r,gos:i}=e,l=a.getColDefCols();if(!l?.length)return;const s=a.getColDefColTree(),c=ti(s),d=[];let g=1e3,u=1e3;const h=b=>{const w=pu(b);K(w.rowGroupIndex)&&w.rowGroup&&(w.rowGroupIndex=g++),K(w.pivotIndex)&&w.pivot&&(w.pivotIndex=u++),d.push(w)};n?.getColumns()?.forEach(h),o?.getColumns()?.forEach(h),c?.forEach(h),Be(e,{state:d},t);const p=n?.getColumns()??[],v=[...o?.getColumns()??[],...p,...l].map(b=>({colId:b.colId}));Be(e,{state:v,applyOrder:!0},t),r.dispatchEvent(I(i,{type:"columnsReset",source:t}))}function hu(e,t){const{rowGroupColsSvc:a,pivotColsSvc:n,valueColsSvc:o,colModel:r,sortSvc:i,eventSvc:l}=e,s={rowGroupColumns:a?.columns.slice()??[],pivotColumns:n?.columns.slice()??[],valueColumns:o?.columns.slice()??[]},c=Dn(e),d={};for(const g of c)d[g.colId]=g;return()=>{const g=(x,M,L,O)=>{const H=M.map(O),B=L.map(O);if(lt(H,B))return;const q=new Set(M);for(const re of L)q.delete(re)||q.add(re);const ge=[...q];l.dispatchEvent({type:x,columns:ge,column:ge.length===1?ge[0]:null,source:t})},u=x=>{const M=[];return r.forAllCols(L=>{const O=d[L.getColId()];O&&x(O,L)&&M.push(L)}),M},h=x=>x.getColId();g("columnRowGroupChanged",s.rowGroupColumns,a?.columns??[],h),g("columnPivotChanged",s.pivotColumns,n?.columns??[],h);const f=u((x,M)=>{const L=x.aggFunc!=null,O=L!=M.isValueActive(),H=L&&x.aggFunc!=M.getAggFunc();return O||H});f.length>0&&du(l,"columnValueChanged",f,t),Ha(l,u((x,M)=>x.width!=M.getActualWidth()),!0,t),cu(l,u((x,M)=>x.pinned!=M.getPinned()),t),l0(l,u((x,M)=>x.hide==M.isVisible()),t);const k=u((x,M)=>!hn(M.getSortDef(),{type:Xe(x.sortType),direction:pn(x.sort)})||x.sortIndex!=M.getSortIndex());k.length>0&&i?.dispatchSortChangedEvents(t,k);const S=Dn(e);A0(c,S,t,r,l)}}function Dn(e){const{colModel:t,rowGroupColsSvc:a,pivotColsSvc:n}=e,o=t.getColDefCols();if(K(o)||!t.isAlive())return[];const r=a?.columns,i=n?.columns,l=[],s=d=>{const g=d.isRowGroupActive()&&r?r.indexOf(d):null,u=d.isPivotActive()&&i?i.indexOf(d):null,h=d.isValueActive()?d.getAggFunc():null,p=d.getSortIndex()!=null?d.getSortIndex():null;l.push({colId:d.getColId(),width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:d.getSort(),sortType:d.getSortDef()?.type,sortIndex:p,aggFunc:h,rowGroup:d.isRowGroupActive(),rowGroupIndex:g,pivot:d.isPivotActive(),pivotIndex:u,flex:d.getFlex()??null})};t.forAllCols(d=>s(d));const c=new Map(t.getCols().map((d,g)=>[d.getColId(),g]));return l.sort((d,g)=>{const u=c.has(d.colId)?c.get(d.colId):-1,h=c.has(g.colId)?c.get(g.colId):-1;return u-h}),l}function pu(e){const t=(m,v)=>m??v??null,a=e.getColDef(),n=ze(t(a.sort,a.initialSort)),o=n.direction,r=n.type,i=t(a.sortIndex,a.initialSortIndex),l=t(a.hide,a.initialHide),s=t(a.pinned,a.initialPinned),c=t(a.width,a.initialWidth),d=t(a.flex,a.initialFlex);let g=t(a.rowGroupIndex,a.initialRowGroupIndex),u=t(a.rowGroup,a.initialRowGroup);g==null&&!u&&(g=null,u=null);let h=t(a.pivotIndex,a.initialPivotIndex),p=t(a.pivot,a.initialPivot);h==null&&!p&&(h=null,p=null);const f=t(a.aggFunc,a.initialAggFunc);return{colId:e.getColId(),sort:o,sortType:r,sortIndex:i,hide:l,pinned:s,width:c,flex:d,rowGroup:u,rowGroupIndex:g,pivot:p,pivotIndex:h,aggFunc:f}}function z0(e,t,a){if(!e.applyOrder||!e.state)return;const n=[];for(const o of e.state)o.colId!=null&&n.push(o.colId);D0(t.cols,n,t,a)}function D0(e,t,a,n){if(e==null)return;let o=[];const r={};for(const l of t){if(r[l])continue;const s=e.map[l];s&&(o.push(s),r[l]=!0)}let i=0;for(const l of e.list){const s=l.getColId();if(r[s]!=null)continue;s.startsWith(ht)?o.splice(i++,0,l):o.push(l)}if(o=ou(o,n),!ru(o,a.getColTree())){R(39);return}e.list=o}function A0(e,t,a,n,o){const r={};for(const d of t)r[d.colId]=d;const i={};for(const d of e)r[d.colId]&&(i[d.colId]=!0);const l=e.filter(d=>i[d.colId]),s=t.filter(d=>i[d.colId]),c=[];s.forEach((d,g)=>{const u=l?.[g];if(u&&u.colId!==d.colId){const h=n.getCol(u.colId);h&&c.push(h)}}),c.length&&o.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:a})}var fu=(e,t,a,n)=>{const o=e[a.getId()],r=e[n.getId()],i=o!=null,l=r!=null;if(i&&l)return o-r;if(i)return-1;if(l)return 1;const s=t.indexOf(a),c=t.indexOf(n),d=s>=0,g=c>=0;return d&&g?s-c:d?-1:1},P0=class extends y{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"],e=>this.refreshAll(oa(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),oa(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:a,colAutosize:n,rowGroupColsSvc:o,pivotColsSvc:r,valueColsSvc:i,visibleCols:l,eventSvc:s,groupHierarchyColSvc:c}=t,d=this.colDefs?hu(t,e):void 0;a?.expire();const g=this.colDefCols?.list,u=this.colDefCols?.tree,h=od(t,this.colDefs,!0,u,e);mn(t,this.colDefCols?.tree,h.columnTree);const p=h.columnTree,f=h.treeDepth,m=ti(p),v={};for(const b of m)v[b.getId()]=b;this.colDefCols={tree:p,treeDepth:f,list:m,map:v},this.createColumnsForService([c],this.colDefCols,e),o?.extractCols(e,g),r?.extractCols(e,g),i?.extractCols(e,g),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,l.refresh(e),s.dispatchEvent({type:"columnEverythingChanged",source:e}),d&&(this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1),s.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&n?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;const a=this.cols?.tree;this.saveColOrder();const{autoColSvc:n,selectionColSvc:o,rowNumbersSvc:r,quickFilter:i,pivotResultCols:l,showRowGroupCols:s,rowAutoHeight:c,visibleCols:d,colViewport:g,eventSvc:u,formula:h}=this.beans,p=this.selectCols(l,this.colDefCols);h?.setFormulasActive(p),this.createColumnsForService([n,o,r],p,t);const f=gv(this.gos,this.showingPivotResult);(!e||f)&&this.restoreColOrder(p),this.positionLockedCols(p),s?.refresh(),i?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),g.clear(),lt(a,this.cols.tree)||u.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,a){for(const n of e)n&&(n.createColumns(t,o=>{this.lastOrder=o(this.lastOrder),this.lastPivotOrder=o(this.lastPivotOrder)},a),n.addColumns(t))}selectCols(e,t){const a=e?.getPivotResultCols()??null;this.showingPivotResult=a!=null;const{map:n,list:o,tree:r,treeDepth:i}=a??t;return this.cols={list:o.slice(),map:{...n},tree:r.slice(),treeDepth:i},a&&(a.list.some(s=>this.cols?.map[s.getColId()]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:a}=this,{valueColsSvc:n,selectionColSvc:o,gos:r}=e,i=this.isPivotMode()&&!t,l=o?.isSelectionColumnEnabled(),s=Vc(e),c=n?.columns,d=Wc(r);return a.list.filter(u=>{const h=xo(u);return i?c?.includes(u)||h&&(!d||u.isVisible())||l&&ft(u)||s&&pe(u):h&&!d||u.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,a){Be(this.beans,{state:e.map(n=>({colId:typeof n=="string"?n:n.getColId(),hide:!t}))},a)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const a=t.filter(g=>e.map[g.getId()]!=null);if(a.length===0)return;if(a.length===e.list.length){e.list=a;return}const n=g=>{const u=g.getOriginalParent();return u?u.getChildren().length>1?!0:n(u):!1};if(!a.some(g=>n(g))){const g=new Set(a);for(const u of e.list)g.has(u)||a.push(u);e.list=a;return}const o=new Map;for(let g=0;g<a.length;g++){const u=a[g];o.set(u,g)}const r=e.list.filter(g=>!o.has(g));if(r.length===0){e.list=a;return}const i=(g,u)=>{const h=u?u.getOriginalParent():g.getOriginalParent();if(!h)return null;let p=null,f=null;for(const m of h.getChildren())if(!(m===u||m===g)){if(m instanceof gt){const v=o.get(m);if(v==null)continue;(p==null||p<v)&&(p=v,f=m);continue}m.forEachLeafColumn(v=>{const b=o.get(v);b!=null&&(p==null||p<b)&&(p=b,f=v)})}return f??i(g,h)},l=[],s=new Map;for(const g of r){const u=i(g,null);if(u==null){l.push(g);continue}const h=s.get(u);h===void 0?s.set(u,g):Array.isArray(h)?h.push(g):s.set(u,[h,g])}const c=new Array(e.list.length);let d=c.length-1;for(let g=l.length-1;g>=0;g--)c[d--]=l[g];for(let g=a.length-1;g>=0;g--){const u=a[g],h=s.get(u);if(h)if(Array.isArray(h))for(let p=h.length-1;p>=0;p--){const f=h[p];c[d--]=f}else c[d--]=h;c[d--]=u}e.list=c}positionLockedCols(e){e.list=ou(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:a,eventSvc:n}=this.beans;a.refresh(t),n.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=oa(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){mn(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(e){const{pivotResultCols:t,autoColSvc:a,selectionColSvc:n,groupHierarchyColSvc:o}=this.beans;Xa(this.colDefCols?.list,e)||Xa(a?.columns?.list,e)||Xa(n?.columns?.list,e)||Xa(o?.columns?.list,e)||Xa(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;const{map:a,list:n}=t;if(typeof e=="string"&&a[e])return a[e];for(let l=0;l<n.length;l++)if(Pa(n[l],e))return n[l];const{autoColSvc:o,selectionColSvc:r,groupHierarchyColSvc:i}=this.beans;return o?.getColumn(e)??r?.getColumn(e)??i?.getColumn(e)??null}},I0=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",mu=class extends ra{constructor(e,t,a){super(t,a),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(I0)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:a,labelAlignment:n,disabled:o,labelEllipsis:r}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),a!=null&&this.setLabelWidth(a),r!=null&&this.setLabelEllipsis(r),this.setLabelAlignment(n||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;le(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(W(t,!1),_e(t,"presentation")):(W(t,!0),_e(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const a=this.getGui().classList;return a.toggle("ag-label-align-left",e==="left"),a.toggle("ag-label-align-right",e==="right"),a.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(go(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return ya(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},dl=class extends mu{constructor(e,t,a,n){super(e,t,a),this.className=n}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:a,ariaLabel:n}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),a!=null&&this.onValueChange(a),n!=null&&this.setAriaLabel(n),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),a=this.getLabel();a==null||a==""||ym(e)!==null?ba(e,""):ba(e,t??"")}setAriaLabel(e){return Kt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Ne(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function T0(e){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:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var Lt=class extends dl{constructor(e,t,a="text",n="input"){super(e,e?.template??T0(n),[],t),this.inputType=a,this.displayFieldTag=n,this.eLabel=E,this.eWrapper=E,this.eInput=E}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:a,className:n}=this;e.classList.add(`${n}-label`),t.classList.add(`${n}-input-wrapper`),a.classList.add(`${n}-input`),this.addCss("ag-input-field"),a.id=a.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:r,inputPlaceholder:i,autoComplete:l,tabIndex:s}=this.config;o!=null&&this.setInputName(o),r!=null&&this.setInputWidth(r),i!=null&&this.setInputPlaceholder(i),l!=null&&this.setAutoComplete(l),this.addInputListeners(),this.activateTabIndex([a],s)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,we(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return go(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return we(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Kt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ya(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)we(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";we(this.eInput,"autocomplete",t)}return this}},An=class extends Lt{constructor(e,t="ag-checkbox",a="checkbox"){super(e,t,a),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:a}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t),a!=null&&this.setName(a)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const a=this.eInput;a.checked=e,a.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,a){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:a});const n=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:n.id,name:n.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),a=this.selected=e.target.checked;this.refreshSelectedClass(a),this.dispatchChange(a,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},Yo={selector:"AG-CHECKBOX",component:An},L0=".ag-checkbox-cell{height:100%}",B0={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},O0=class extends U{constructor(){super(B0,[Yo]),this.eCheckbox=E,this.registerCSS(L0)}init(e){this.refresh(e);const{eCheckbox:t,beans:a}=this,n=t.getInputElement();n.setAttribute("tabindex","-1"),Us(n,"polite"),this.addManagedListeners(n,{click:o=>{if(At(o),t.isDisabled())return;const r=t.getValue();this.onCheckboxChanged(r)},dblclick:o=>{At(o)}}),this.addManagedElementListeners(e.eGridCell,{keydown:o=>{if(o.key===C.SPACE&&!t.isDisabled()){e.eGridCell===_(a)&&t.toggle();const r=t.getValue();this.onCheckboxChanged(r),o.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,a=!0;const{value:n,column:o,node:r}=e;if(r.group&&o)if(typeof n=="boolean")t=n;else{const g=o.getColId();g.startsWith(ht)?t=n==null||n===""?void 0:n==="true":r.aggData&&r.aggData[g]!==void 0||r.sourceRowIndex>=0?t=n??void 0:a=!1}else t=n??void 0;const{eCheckbox:i}=this;if(!a){i.setDisplayed(!1);return}i.setValue(t);const l=e.disabled??!o?.isCellEditable(r);i.setDisabled(l);const s=this.getLocaleTextFunc(),c=io(s,t),d=l?c:`${s("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;i.setInputAriaLabel(d)}onCheckboxChanged(e){const{params:t}=this,{column:a,node:n,value:o}=t,{editSvc:r}=this.beans;if(!a)return;const i={rowNode:n,column:a};r?.dispatchCellEvent(i,null,"cellEditingStarted",{value:o});const l=n.setDataValue(a,e,"ui");r?.dispatchCellEvent(i,null,"cellEditingStopped",{oldValue:o,newValue:e,valueChanged:l}),l||this.updateCheckbox(t)}},H0={tag:"div",cls:"ag-skeleton-container"},N0=class extends U{constructor(){super(H0)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>ba(e.eParentOfValue)),ba(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Kt(this.getGui(),t)}setupLoading(e){const t=oe({tag:"div",cls:"ag-skeleton-effect"}),a=e.node.rowIndex;if(a!=null){const r=75+25*(a%2===0?Math.sin(a):Math.cos(a));t.style.width=`${r}%`}this.getGui().appendChild(t);const n=this.getLocaleTextFunc(),o=e.deferRender?n("ariaDeferSkeletonCellLoading","Cell is loading"):n("ariaSkeletonCellLoading","Row data is loading");Kt(this.getGui(),o)}refresh(e){return!1}},V0={moduleName:"CheckboxCellRenderer",version:F,userComponents:{agCheckboxCellRenderer:O0}},G0={moduleName:"SkeletonCellRenderer",version:F,userComponents:{agSkeletonCellRenderer:N0}};function q0(e,t){const a=e.colModel.getColDefCol(t);return a?a.getColDef():null}function W0(e){return e.colModel.getColumnDefs(!0)}function U0(e,t,a){return e.colNames.getDisplayNameForColumn(t,a)||""}function j0(e,t){return e.colModel.getColDefCol(t)}function Y0(e){return e.colModel.getColDefCols()}function K0(e,t){return Be(e,t,"api")}function _0(e){return Dn(e)}function Q0(e){uu(e,"api")}function Z0(e){return e.visibleCols.isPinningLeft()||e.visibleCols.isPinningRight()}function J0(e){return e.visibleCols.isPinningLeft()}function X0(e){return e.visibleCols.isPinningRight()}function $0(e,t){return e.visibleCols.getColAfter(t)}function e1(e,t){return e.visibleCols.getColBefore(t)}function t1(e,t,a){e.colModel.setColsVisible(t,a,"api")}function a1(e,t,a){e.pinnedCols?.setColsPinned(t,a,"api")}function n1(e){return e.colModel.getCols()}function o1(e){return e.visibleCols.leftCols}function r1(e){return e.visibleCols.centerCols}function i1(e){return e.visibleCols.rightCols}function l1(e){return e.visibleCols.allCols}function s1(e){return e.colViewport.getViewportColumns()}function gl(e,t){if(!e)return;const a=e,n={};for(const o of Object.keys(a)){if(t&&t.indexOf(o)>=0||Cc.has(o))continue;const r=a[o];typeof r=="object"&&r!==null&&r.constructor===Object?n[o]=gl(r):n[o]=r}return n}var c1=class extends y{constructor(){super(...arguments),this.beanName="colDefFactory"}wireBeans(e){this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc}getColumnDefs(e,t,a,n,o=!1){const r=e.slice();t?r.sort((s,c)=>a.indexOf(s)-a.indexOf(c)):(a||o)&&r.sort((s,c)=>n.indexOf(s)-n.indexOf(c));const i=this.rowGroupColsSvc?.columns,l=this.pivotColsSvc?.columns;return this.buildColumnDefs(r,i,l)}buildColumnDefs(e,t=[],a=[]){const n=[],o={};for(const r of e){const i=this.createDefFromColumn(r,t,a);let l=!0,s=i,c=r.getOriginalParent(),d=null;for(;c;){let g=null;if(c.isPadding()){c=c.getOriginalParent();continue}const u=o[c.getGroupId()];if(u){u.children.push(s),l=!1;break}if(g=this.createDefFromGroup(c),g&&(g.children=[s],o[g.groupId]=g,s=g,c=c.getOriginalParent()),c!=null&&d===c){l=!1;break}d=c}l&&n.push(s)}return n}createDefFromGroup(e){const t=gl(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,a){const n=gl(e.getColDef());return n.colId=e.getColId(),n.width=e.getActualWidth(),n.rowGroup=e.isRowGroupActive(),n.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,n.pivot=e.isPivotActive(),n.pivotIndex=e.isPivotActive()?a.indexOf(e):null,n.aggFunc=e.isValueActive()?e.getAggFunc():null,n.hide=e.isVisible()?void 0:!0,n.pinned=e.isPinned()?e.getPinned():null,n.sort=e.getSortDef(),n.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,n}},d1=class extends y{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth);const a=this.flexViewportWidth,{visibleCols:n,colDelayRenderSvc:o}=this.beans,r=n.centerCols;let i=-1;if(e.resizingCols){const f=new Set(e.resizingCols);for(let m=r.length-1;m>=0;m--)if(f.has(r[m])){i=m;break}}let l=!1;const s=r.map((f,m)=>{const v=f.getFlex(),b=v!=null&&v>0&&m>i;return l||(l=b),{col:f,isFlex:b,flex:Math.max(0,v??0),initialSize:f.getActualWidth(),min:f.getMinWidth(),max:f.getMaxWidth(),targetSize:0}});if(l?(o?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(o),!a||!l)return[];let c=s.length,d=s.reduce((f,m)=>f+m.flex,0),g=a;const u=(f,m)=>{f.frozenSize=m,f.col.setActualWidth(m,t),g-=m,d-=f.flex,c-=1},h=f=>f.frozenSize!=null;for(const f of s)f.isFlex||u(f,f.initialSize);for(;c>0;){const f=Math.round(d<1?g*d:g);let m,v=0,b=0;for(const S of s){if(h(S))continue;m=S,b+=f*(S.flex/d);const x=b-v,M=Math.round(x);S.targetSize=M,v+=M}m&&(m.targetSize+=f-v);let w=0;for(const S of s){if(h(S))continue;const x=S.targetSize,M=Math.min(Math.max(x,S.min),S.max);w+=M-x,S.violationType=M===x?void 0:M<x?"max":"min",S.targetSize=M}const k=w===0?"all":w>0?"min":"max";for(const S of s)h(S)||(k==="all"||S.violationType===k)&&u(S,S.targetSize)}e.skipSetLeft||n.setLeftValues(t),e.updateBodyWidths&&n.updateBodyWidths();const p=s.filter(f=>f.isFlex&&!f.violationType).map(f=>f.col);if(e.fireResizedEvent){const f=s.filter(v=>v.initialSize!==v.frozenSize).map(v=>v.col),m=s.filter(v=>v.flex).map(v=>v.col);Ha(this.eventSvc,f,!0,t,m)}return this.revealColumns(o),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:a}=e.colDef;t!==void 0?e.flex=t:a!==void 0&&(e.flex=a)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}},ke=e=>{if(typeof e=="bigint")return e;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&(t=e.trim(),t===""||(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))))return null;if(t==null)return null;try{return BigInt(t)}catch{return null}},ul="T",g1=new RegExp(`[${ul} ]`),u1=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${ul}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function at(e,t){return e.toString().padStart(t,"0")}function fe(e,t=!0,a=ul){if(!e)return null;let n=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>at(o,2)).join("-");return t&&(n+=a+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>at(o,2)).join(":")),n}function Pn(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),at(e.getDate(),2),at(e.getHours(),2),`:${at(e.getMinutes(),2)}`,`:${at(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,at(e.getDate(),2)].map(String):null}var hl=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},pl=["January","February","March","April","May","June","July","August","September","October","November","December"],fl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function h1(e,t){if(t==null)return fe(e,!1);const a=at(e.getFullYear(),4),n={YYYY:()=>a.slice(a.length-4,a.length),YY:()=>a.slice(a.length-2,a.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>pl[e.getMonth()],MMM:()=>pl[e.getMonth()].slice(0,3),MM:()=>at(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${hl(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${hl(e.getDate())}`,DD:()=>at(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>fl[e.getDay()],ddd:()=>fl[e.getDay()].slice(0,3),dd:()=>fl[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${hl(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(n).join("|"),"g");return t.replace(o,r=>r in n?n[r]():r)}function Ko(e,t=!1){return!!me(e,t)}function p1(e){return Ko(e,!0)}function me(e,t=!1,a){if(!e||!a&&!u1.test(e))return null;const[n,o]=e.split(g1);if(!n)return null;const r=n.split("-").map(h=>Number.parseInt(h,10));if(r.filter(h=>!isNaN(h)).length!==3)return null;const[i,l,s]=r,c=new Date(i,l-1,s);if(c.getFullYear()!==i||c.getMonth()!==l-1||c.getDate()!==s||!o&&t)return null;if(!o||o==="00:00:00")return c;const[d,g,u]=o.split(":").map(h=>Number.parseInt(h,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(g>=0&&g<60)c.setMinutes(g);else if(t)return null;if(u>=0&&u<60)c.setSeconds(u);else if(t)return null;return c}function In(e,t,a){if(!t||!e)return;if(!a)return e[t];const n=t.split(".");let o=e;for(let r=0;r<n.length;r++){if(o==null)return;o=o[n[r]]}return o}var f1=["dateTimeString","dateString","text","number","bigint","boolean","date"],m1=class extends y{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number(){return{cellEditor:"agNumberCellEditor"}},bigint({filterModuleBean:e}){return e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:C1,absolute:y1}}},boolean(){return{cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:a})=>t.key===C.SPACE&&a.isCellEditable(e)}},date({formatValue:e}){return{cellEditor:"agDateCellEditor",keyCreator:e}},dateString({formatValue:e}){return{cellEditor:"agDateStringCellEditor",keyCreator:e}},dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object({formatValue:e,colModel:t,colId:a}){return{cellEditorParams:{useFormatter:!0},comparator:(n,o)=>{const r=t.getColDefCol(a),i=r?.getColDef();if(!r||!i)return 0;const l=n==null?"":e({column:r,node:null,value:n}),s=o==null?"":e({column:r,node:null,value:o});return l===s?0:l>s?1:-1},keyCreator:e}},text(){return{}}}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},a={},n=d=>g=>{const{column:u,node:h,value:p}=g;let f=u.getColDef().valueFormatter;return f===d.groupSafeValueFormatter&&(f=d.valueFormatter),this.beans.valueSvc.formatValue(u,h,p,f)};for(const d of Object.keys(e)){const g=e[d],u={...g,groupSafeValueFormatter:wu(g,this.gos)};t[d]=u,a[d]=n(u)}const o=this.gos.get("dataTypeDefinitions")??{},r={};for(const d of Object.keys(o)){const g=o[d],u=this.processDataTypeDefinition(g,o,[d],e);u&&(t[d]=u,g.dataTypeMatcher&&(r[d]=g.dataTypeMatcher),a[d]=n(u))}const{valueParser:i,valueFormatter:l}=e.object,{valueParser:s,valueFormatter:c}=t.object;this.hasObjectValueParser=s!==i,this.hasObjectValueFormatter=c!==l,this.formatValueFuncs=a,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(r,e)}sortKeysInMatchers(e,t){const a={...e};for(const n of f1)delete a[n],a[n]=e[n]??t[n].dataTypeMatcher;return a}processDataTypeDefinition(e,t,a,n){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=n[r];const l=t[r];if(i&&l&&(i=l),!bu(e,i,r))return;o=vu(i,e)}else{if(a.includes(r)){R(44);return}const i=t[r];if(!bu(e,i,r))return;const l=this.processDataTypeDefinition(i,t,[...a,r],n);if(!l)return;o=vu(l,e)}return{...o,groupSafeValueFormatter:wu(o,this.gos)}}updateColDefAndGetColumnType(e,t,a){let{cellDataType:n}=t;n===void 0&&(n=e.cellDataType);const{field:o}=t;if((n==null||n===!0)&&(n=this.canInferCellDataType(e,t)?this.inferCellDataType(o,a):!1),this.addFormulaCellEditorToColDef(e,t),!n){e.cellDataType=!1;return}const r=this.dataTypeDefinitions[n];if(!r){R(47,{cellDataType:n});return}return e.cellDataType=n,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,r,a),r.columnTypes}addFormulaCellEditorToColDef(e,t){!(t.allowFormula??e.allowFormula)||t.cellEditor||(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const a=n=>{t.add(n.key)};e.__addEventListener("columnStateUpdated",a),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",a))}canInferCellDataType(e,t){const{gos:a}=this;if(!$(a))return!1;const n={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(ml(t,n))return!1;const o=t.type===null?e.type:t.type;if(o){const r=a.get("columnTypes")??{};if(Ro(o).some(l=>{const s=r[l.trim()];return s&&ml(s,n)}))return!1}return!ml(e,n)}inferCellDataType(e,t){if(!e)return;let a;const n=this.getInitialData();if(n){const r=e.includes(".")&&!this.gos.get("suppressFieldDotNotation");a=In(n,e,r)}else this.initWaitForRowData(t);return a==null?void 0:Object.keys(this.dataTypeMatchers).find(r=>this.dataTypeMatchers[r](a))??"object"}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.beans.rowModel.rootNode?._leafs;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:a,eventSvc:n}=this.beans;t&&a&&(a.shouldQueueResizeOperations=!0);const[o]=this.addManagedEventListeners({rowDataUpdateStarted:r=>{const{firstRowData:i}=r;i&&(o?.(),this.isPendingInference=!1,this.processColumnsPendingInference(i,t),this.columnStateUpdatesPendingInference={},t&&a?.processResizeOperations(),n.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const a=[];this.destroyColumnStateUpdateListeners();const n={},o={};for(const r of Object.keys(this.columnStateUpdatesPendingInference)){const i=this.columnStateUpdatesPendingInference[r],l=this.colModel.getCol(r);if(!l)continue;const s=l.getColDef();if(!this.resetColDefIntoCol(l,"cellDataTypeInferred"))continue;const c=l.getColDef();if(t&&c.type&&c.type!==s.type){const d=k1(l,i);d.rowGroup&&d.rowGroupIndex==null&&(n[r]=d),d.pivot&&d.pivotIndex==null&&(o[r]=d),a.push(d)}}t&&a.push(...this.generateColumnStateForRowGroupAndPivotIndexes(n,o)),a.length&&Be(this.beans,{state:a},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const a={},{rowGroupColsSvc:n,pivotColsSvc:o}=this.beans;return n?.restoreColumnOrder(a,e),o?.restoreColumnOrder(a,t),Object.values(a)}resetColDefIntoCol(e,t){const a=e.getUserProvidedColDef();if(!a)return!1;const n=fn(this.beans,a,e.getColId());return e.setColDef(n,a,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return e==="dateTime"||e==="dateTimeString"}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const a=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!a||e.getColDef().allowFormula&&this.beans.formula?.isFormula(t)?!0:a(t)}validateColDef(e,t,a,n){if(e.cellDataType==="object"){const o=s=>s?.cellDataType==null||s?.cellDataType===!0,r=o(t)&&o(a),i=s=>R(48,{property:s,inferred:r,colId:n}),{object:l}=this.dataTypeDefinitions;e.valueFormatter===l.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&i("Formatter"),e.editable&&e.valueParser===l.valueParser&&!this.hasObjectValueParser&&i("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||typeof t!="string")return;const{dataTypeDefinitions:a,beans:n,formatValueFuncs:o}=this,r=a[t];r&&n.colFilter?.setColDefPropsForDataType(e,r,o[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,a,n){const o=this.formatValueFuncs[t],r=this.columnDefinitionPropsPerDataType[a.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:a,colId:n,formatValue:o,filterModuleBean:this.beans.filterManager});e.cellEditor==="agFormulaCellEditor"&&r.cellEditor!==e.cellEditor&&(r.cellEditor=e.cellEditor),Object.assign(e,r)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),a=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:n=>me(n.newValue&&String(n.newValue)),valueFormatter:n=>n.value==null?"":!(n.value instanceof Date)||isNaN(n.value.getTime())?t("invalidDate","Invalid Date"):fe(n.value,a)??"",dataTypeMatcher:n=>n instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:a=>me(a)??void 0,dateFormatter:a=>fe(a??null,t)??void 0,valueParser:a=>Ko(String(a.newValue))?a.newValue:null,valueFormatter:a=>Ko(String(a.value))?String(a.value):"",dataTypeMatcher:a=>typeof a=="string"&&Ko(a)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:t=>t.newValue?.trim?.()===""?null:Number(t.newValue),valueFormatter:t=>t.value==null?"":typeof t.value!="number"||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:t=>typeof t=="number"},bigint:{baseDataType:"bigint",valueParser:t=>{const{newValue:a}=t;return a==null||typeof a=="string"&&a.trim()===""?null:ke(a)},valueFormatter:t=>t.value==null?"":typeof t.value!="bigint"?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:t=>typeof t=="bigint"},text:{baseDataType:"text",valueParser:t=>t.newValue===""?null:$n(t.newValue),dataTypeMatcher:t=>typeof t=="string"},boolean:{baseDataType:"boolean",valueParser:t=>t.newValue==null?t.newValue:t.newValue?.trim?.()===""?null:String(t.newValue).toLowerCase()==="true",valueFormatter:t=>t.value==null?"":String(t.value),dataTypeMatcher:t=>typeof t=="boolean"},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:t=>typeof t=="string"&&p1(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:t=>$n(t.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function vu(e,t){const a={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(a.columnTypes=[...Ro(e.columnTypes),...Ro(t.columnTypes)]),a}function bu(e,t,a){return t?t.baseDataType!==e.baseDataType?(R(46),!1):!0:(R(45,{parentCellDataType:a}),!1)}var v1=e=>typeof e=="bigint"||typeof e=="number",b1=e=>e==="number"||e==="bigint";function wu(e,t){if(e.valueFormatter)return a=>{const{node:n,colDef:o,column:r,value:i}=a;if(n?.group){const l=(o.pivotValueColumn??r).getAggFunc();if(l){if(l==="first"||l==="last")return e.valueFormatter(a);const{baseDataType:s}=e;if(b1(s)&&l!=="count"){if(v1(i))return e.valueFormatter(a);if(i==null)return;if(typeof i=="object"){if(typeof i.toNumber=="function")return e.valueFormatter({...a,value:i.toNumber()});if("value"in i)return e.valueFormatter({...a,value:i.value})}}return}}else if(t.get("groupHideOpenParents")&&a.column.isRowGroupActive()&&typeof a.value=="string"&&!e.dataTypeMatcher?.(a.value))return;return e.valueFormatter(a)}}function w1(e,t,a,n){if(!t[a])return!1;const o=e[a];return o===null?(t[a]=!1,!1):n===void 0?!!o:o===n}function C1(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=ke(e),n=ke(t);return a!=null&&n!=null?a===n?0:a>n?1:-1:0}function y1(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;const a=Cu(e),n=Cu(t);return a!=null&&n!=null?a===n?0:a>n?1:-1:0}function Cu(e){const t=ke(e);return t==null?null:t<0n?-t:t}function ml(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([a,n])=>w1(e,t,a,n))}function k1(e,t){const a=pu(e);for(const n of t)delete a[n],n==="rowGroup"?delete a.rowGroupIndex:n==="pivot"&&delete a.pivotIndex;return a}var S1={moduleName:"DataType",version:F,beans:[m1],dependsOn:[V0]},x1={moduleName:"ColumnFlex",version:F,beans:[d1]},vl={moduleName:"ColumnApi",version:F,beans:[c1],apiFunctions:{getColumnDef:q0,getDisplayNameForColumn:U0,getColumn:j0,getColumns:Y0,applyColumnState:K0,getColumnState:_0,resetColumnState:Q0,isPinning:Z0,isPinningLeft:J0,isPinningRight:X0,getDisplayedColAfter:$0,getDisplayedColBefore:e1,setColumnsVisible:t1,setColumnsPinned:a1,getAllGridColumns:n1,getDisplayedLeftColumns:o1,getDisplayedCenterColumns:r1,getDisplayedRightColumns:i1,getAllDisplayedColumns:l1,getAllDisplayedVirtualColumns:s1,getColumnDefs:W0}},R1=class extends y{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,a=!1){if(!e)return null;const n=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:o}=this.beans;return a&&o?o.getHeaderName(e,n):n}getDisplayNameForProvidedColumnGroup(e,t,a){const n=t?.getColGroupDef();return n?this.getHeaderName(n,null,e,t,a):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,a,n,o){const r=e.headerValueGetter;if(r){const i=I(this.gos,{colDef:e,column:t,columnGroup:a,providedColumnGroup:n,location:o});return typeof r=="function"?r(i):typeof r=="string"?this.beans.expressionSvc?.evaluate(r,i)??null:""}else{if(e.headerName!=null)return e.headerName;if(e.field)return qs(e.field)}return""}},E1=class extends y{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(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,a=!1){const{visibleCols:n}=this,o=n.isBodyWidthDirty;if(!(e===this.scrollWidth&&t===this.scrollPosition&&!o)){if(this.scrollWidth=e,this.scrollPosition=t,n.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const i=n.bodyWidth;this.viewportLeft=i-t-e,this.viewportRight=i-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(a)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let a;switch(e){case"left":a=this.rowsOfHeadersToRenderLeft[t];break;case"right":a=this.rowsOfHeadersToRenderRight[t];break;default:a=this.rowsOfHeadersToRenderCenter[t];break}return a??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||F1(e)?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,a=t+e.getActualWidth(),n=this.viewportLeft-200,o=this.viewportRight+200,r=t<n&&a<n,i=t>o&&a>o;return!r&&!i}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=r=>{const i=r.getLeft();return z(i)&&i>this.viewportLeft},a=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:n}=this,o=n.centerCols;return n.getColsForRow(e,o,a,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const a=n=>{const o=new Set,r={};for(const i of n){let l=i.getParent();const s=i.isSpanHeaderHeight();for(;l&&!o.has(l);){if(s&&l.isPadding()){l=l.getParent();continue}const d=l.getProvidedColumnGroup().getLevel();r[d]??(r[d]=[]),r[d].push(l),o.add(l),l=l.getParent()}}return r};this.rowsOfHeadersToRenderLeft=a(e),this.rowsOfHeadersToRenderRight=a(t),this.rowsOfHeadersToRenderCenter=a(this.headerColsWithinViewport)}extractViewport(){const e=n=>`${n.getId()}-${n.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),a=this.colsWithinViewportHash!==t;return a&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),a}};function F1(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}var M1=class extends y{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;class a{refresh(){return!1}getGui(){return this.eGui}init(o){const r=t(o),i=typeof r;if(i==="string"||i==="number"||i==="boolean"){this.eGui=co("<span>"+r+"</span>");return}if(r==null){this.eGui=oe({tag:"span"});return}this.eGui=r}}return a}},z1={moduleName:"CellRendererFunction",version:F,beans:[M1]},yu=class extends ue{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...a){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const n=this.dynamicBeans[e];if(n==null){if(t)throw new Error(this.getDynamicError(e,!1));return}return new n(...a)}};function D1(e){return typeof e=="object"&&!!e.getComp}var A1=class extends yu{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(e!=null)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:a,dynamicBeans:n,selectors:o}=e;if(a){const r=(i,l,s,c)=>{this.agGridDefaults[i]=l,(s||c)&&(this.agGridDefaultOverrides[i]={params:s,processParams:c})};for(const i of Object.keys(a)){let l=a[i];if(D1(l)&&(l=l.getComp(this.beans)),typeof l=="object"){const{classImp:s,params:c,processParams:d}=l;r(i,s,c,d)}else r(i,l)}}this.registerDynamicBeans(n);for(const r of o??[])this.selectors[r.selector]=r;if(t)for(const r of Object.keys(t))this.icons[r]=t[r]}getUserComponent(e,t){const a=(l,s,c,d)=>({componentFromFramework:s,component:l,params:c,processParams:d}),{frameworkOverrides:n}=this.beans,o=n.frameworkComponent(t,this.gos.get("components"));if(o!=null)return a(o,!0);const r=this.jsComps[t];if(r){const l=n.isFrameworkComponent(r);return a(r,l)}const i=this.agGridDefaults[t];if(i){const l=this.agGridDefaultOverrides[t];return a(i,!1,l?.params,l?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?Ve(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??Ve(256)}},P1=23,I1=class extends y{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){const e=Object.values(this.params);this.ready=e.length===P1&&e.every(t=>t?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const a=this.readyCallbacks.indexOf(t);a>=0&&this.readyCallbacks.splice(a,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:a}=this.params;return[e,a,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},T1=':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}',bl=typeof window!="object"||!window?.document?.fonts?.forEach,_o=!1,da=(e,t,a,n,o,r,i=!1)=>{if(bl||_o)return;let l=e;n&&(l=`@layer ${CSS.escape(n).replaceAll("\\.",".")} { ${e} }`);let s=nt.map.get(t);if(s||(s=[],nt.map.set(t,s)),s.some(u=>u.injectedCss===l))return;const c=document.createElement("style");r&&c.setAttribute("nonce",r),c.dataset.agCss=a,c.dataset.agCssVersion=F,c.textContent=l;const d={rawCss:e,injectedCss:l,el:c,priority:o,isParams:i};let g;for(const u of s){if(u.priority>o)break;g=u}if(g){g.el.after(c);const u=s.indexOf(g);s.splice(u+1,0,d)}else t.nodeName==="STYLE"?t.after(c):t.insertBefore(c,t.querySelector(":not(title, meta)")),s.push(d)},ku=(e,t,a,n)=>{da(T1,e,"shared",t,0,a),n?.forEach((o,r)=>o.forEach(i=>da(i,e,r,t,0,a)))},L1=(e,t,a,n,o,r)=>{if(bl||_o)return;const i=nt.grids.get(e);i?i.paramsCss=t:nt.grids.set(e,{styleContainer:n,paramsCss:t}),wl(n),t&&a&&da(t,n,a,o,2,r,!0)},B1=e=>{const t=nt.grids.get(e)?.styleContainer;if(!t)return;nt.grids.delete(e),Array.from(nt.grids.values()).some(n=>n.styleContainer===t)?wl(t):(wl(t,!0),nt.map.delete(t))},wl=(e,t=!1)=>{const a=new Set;for(const o of nt.grids.values())o.styleContainer===e&&a.add(o.paramsCss);const n=nt.map.get(e)??[];for(let o=n.length-1;o>=0;o--)(t||n[o].isParams&&!a.has(n[o].rawCss))&&(n[o].el.remove(),n.splice(o,1))},Su=()=>{const e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map);let t=e.get(F);return t||(t={map:new WeakMap,grids:new Map,paramsId:0},e.set(F,t)),t},nt=Su(),V=e=>new xu(e),Bt="$default",O1=0,xu=class{constructor({feature:e,params:t,modeParams:a={},css:n,cssImports:o}){this.feature=e,this.css=n,this.cssImports=o,this.modeParams={[Bt]:{...a[Bt]??{},...t??{}},...a}}use(e,t,a){let n=this._inject;if(n==null){let{css:o}=this;if(o){const r=`ag-theme-${this.feature??"part"}-${++O1}`;typeof o=="function"&&(o=o()),o=`:where(.${r}) {
13339
13339
  ${o}
13340
13340
  }
13341
13341
  `;for(const i of this.cssImports??[])o=`@import url(${JSON.stringify(i)});